Xach changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <https://irclog.tymoon.eu/freenode/%23lisp> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/>
slyrus_ has quit [Ping timeout: 258 seconds]
cosimone has quit [Ping timeout: 248 seconds]
brown121408 has quit [Read error: Connection reset by peer]
brown121408 has joined #lisp
wxie has joined #lisp
asdf_asdf_asdf has quit [Quit: asdf_asdf_asdf]
karlosz has quit [Quit: karlosz]
atgreen has joined #lisp
karlosz has joined #lisp
davisr has joined #lisp
slyrus_ has joined #lisp
Kundry_Wag has joined #lisp
slyrus__ has quit [Ping timeout: 265 seconds]
eddof13 has quit [Quit: eddof13]
Kundry_Wag has quit [Ping timeout: 265 seconds]
turona has quit [Ping timeout: 246 seconds]
turona has joined #lisp
random-nick has quit [Ping timeout: 260 seconds]
arichiardi has joined #lisp
wxie has quit [Ping timeout: 260 seconds]
phlim has joined #lisp
z147 has quit [Ping timeout: 240 seconds]
harovali has quit [Ping timeout: 240 seconds]
milanj has quit [Quit: This computer has gone to sleep]
oni-on-ion has quit [Ping timeout: 240 seconds]
ck_ has quit [Ping timeout: 250 seconds]
ck_ has joined #lisp
dxtr has quit [Ping timeout: 250 seconds]
dxtr has joined #lisp
slyrus__ has joined #lisp
sjl has quit [Ping timeout: 265 seconds]
slyrus_ has quit [Ping timeout: 258 seconds]
arichiardi has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
Oladon has joined #lisp
Kundry_W_ has joined #lisp
XenophonF has quit [Ping timeout: 265 seconds]
<phoe> wait a second, cffi:f-a-t-l should work
<phoe> jasom: _death:
Kundry_W_ has quit [Remote host closed the connection]
Jeanne-Kamikaze has joined #lisp
karayan has quit [Read error: Connection reset by peer]
patlv has joined #lisp
smokeink has joined #lisp
karayan has joined #lisp
phlim has quit [Quit: WeeChat 2.4]
sjl has joined #lisp
davisr has quit [Quit: Leaving]
phlim has joined #lisp
papachan has quit [Quit: Leaving]
xkapastel has quit [Quit: Connection closed for inactivity]
Kundry_W_ has joined #lisp
Kundry_W_ has quit [Read error: No route to host]
Kundry_W_ has joined #lisp
zclark has joined #lisp
Kundry_W_ has quit [Remote host closed the connection]
shifty has joined #lisp
bitmapper has quit [Ping timeout: 258 seconds]
karlosz has quit [Remote host closed the connection]
patlv has quit [Ping timeout: 240 seconds]
idxu has joined #lisp
akoana has quit [Quit: leaving]
Kundry_Wag has quit [Ping timeout: 260 seconds]
zclark` has joined #lisp
dddddd has quit [Ping timeout: 240 seconds]
zclark has quit [Ping timeout: 265 seconds]
Kundry_Wag has joined #lisp
rwcom has quit [Ping timeout: 240 seconds]
rumbler31 has quit [Remote host closed the connection]
Kundry_Wag has quit [Remote host closed the connection]
davisr has joined #lisp
Oladon has quit [Quit: Leaving.]
karlosz has joined #lisp
davisr has quit [Client Quit]
Khisanth has quit [Ping timeout: 268 seconds]
slyrus_ has joined #lisp
slyrus__ has quit [Ping timeout: 268 seconds]
rwcom has joined #lisp
zclark` has quit [Ping timeout: 268 seconds]
slyrus__ has joined #lisp
slyrus_ has quit [Ping timeout: 268 seconds]
karlosz has quit [Remote host closed the connection]
Lord_of_Life has quit [Ping timeout: 260 seconds]
Lord_of_Life has joined #lisp
Khisanth has joined #lisp
slac-in-the-box has quit [Remote host closed the connection]
mono has joined #lisp
Jeanne-Kamikaze has quit [Remote host closed the connection]
monokrom has quit [Ping timeout: 258 seconds]
adam4567 has joined #lisp
akoana has joined #lisp
karlosz has joined #lisp
Necktwi_ has joined #lisp
Necktwi has quit [Read error: Connection reset by peer]
rumbler31 has joined #lisp
rumbler31 has quit [Ping timeout: 268 seconds]
karlosz has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
adam4567 has quit [Ping timeout: 260 seconds]
akoana has quit [Quit: leaving]
rwcom1 has joined #lisp
rwcom has quit [Ping timeout: 240 seconds]
rwcom1 is now known as rwcom
Kundry_Wag has quit [Remote host closed the connection]
Lord_of_Life has quit [Ping timeout: 268 seconds]
karayan has quit [Ping timeout: 260 seconds]
karayan has joined #lisp
Lord_of_Life has joined #lisp
phlim has quit [Quit: WeeChat 2.4]
Kundry_Wag has joined #lisp
karlosz has joined #lisp
Kundry_Wag has quit [Ping timeout: 265 seconds]
anewuser has joined #lisp
<beach> Good morning everyone!
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
lbtjp has joined #lisp
adam4567 has joined #lisp
krid has quit [Ping timeout: 260 seconds]
HiRE has joined #lisp
<HiRE> hi everyone. I'm getting started in lisp coming from a systems programming background. I am curious how pointers are managed in lisp. I would imagine it would be possible to write a garbage collector in pure lisp but I am not sure how you could manage memory.
<HiRE> I thought the mezzano project was very interesting. I'm curious about how lower-level lisp works.
<beach> Pointers are not available to the application programmer.
<HiRE> yeah seems that way. Closest you get is conses.
<beach> And you can't write a garbage collector in portable Lisp. But you only need tow additional primitives, namely read and write memory at a particular address.
<HiRE> ah, so the systems programming stuff would be highly system dependent. If I'm using SBCL on linux would there be read and write available to lisp or would I have to hook into some C or assembly for that?
<beach> The fact that pointers are "hidden" is one of the main strengths of Common Lisp.
<HiRE> I agree. It's mostly a theoretical question.
<beach> I would think SBCL has something like that, but you would have to know the low-level details of SBCL in order to use it properly.
<HiRE> I'll take a look. I had no idea it would be compiler and system dependent. Very interesting. Thank you
<beach> Sure.
<beach> Also, SBCL has a copying garbage collector, so you don't know that a pointer remains valid for very long.
<HiRE> Oh ok. Sure. I guess my thought was to use lisp for _everything_ because I really enjoy writing it.
<beach> Great!
brown121408 has quit [Ping timeout: 265 seconds]
<beach> Common Lisp uses what I call "uniform reference semantics", meaning that it works as if you always manipulate a reference (pointer) to an object, and never the object itself.
<HiRE> I just learned that reading ANSI common lisp (great book). I used it to write a neat little sieve of erastosthenes that did the stuff in place to save on memory.
rumbler31 has joined #lisp
<HiRE> I'd like to peek inside the setf macro to see how its machinery works
<beach> I learned Common Lisp from that book as well, but it is a bit old.
<HiRE> Is there a more up to date book you could recommend?
brown121407 has joined #lisp
<beach> Nowadays, classes and generic functions are used quite a lot, and Graham doesn't use those.
<beach> minion: Please tell HiRE about PCL.
<minion> HiRE: please look at PCL: pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005).
<HiRE> awesome! I had this book in my cart but I snagged a used copy of ansi common lisp for like $7 because it was cheap and it had paul grahams name on it
<beach> Graham's programming style is not quite according to established conventions.
gravicappa has joined #lisp
<HiRE> suppose that's expected given it's age
<beach> ?
<HiRE> the book, sorry
<HiRE> ansi common lisp
<beach> I think the reason is different, but what do I know.
decent-username has joined #lisp
<beach> Peter Seibel, on the other hand, spent a lot of time here, making sure he knew all the conventions.
<HiRE> oh why do you think his style is unconventional?
<beach> I don't remember the details of it. I read the book a long time ago. But for one thing, he does not use standard classes and generic functions.
rumbler31 has quit [Ping timeout: 265 seconds]
<HiRE> ah ok. I haven't learned those yet. By the sounds of it if I keep reading ansi common lisp I'll never learn :P
<no-defun-allowed> Yeah, he often uses ckisyres in place of objects and calls them with "messages" comprised of a symbol (in place of, say a generic function) and arguments , which is similar to the object representation in SICP.
<no-defun-allowed> *closures; what the hell is a ckisyre?
<HiRE> was about to ask the same thing
<beach> I was just wondering. :)
<beach> Oh, yes, that's not a great programming style for Common Lisp.
<HiRE> and PCL covers the more modern stuff with good style?
<HiRE> I just ordered it...lol
<beach> Definitely!
<HiRE> its kind of funny now that I've drank the koolaid im on the other side of the conversation at work about languages
<HiRE> everyone complains about parentheses
<HiRE> I hardly see them and I've only been at it a few weeks
<no-defun-allowed> Yes. In the meantime, you can read the book online, but I've heard some people concentrate much better with dead-tree format.
<beach> HiRE: There are some very strong psychological forces that make people resist learning new stuff, even when they are told how much better the new stuff is.
<no-defun-allowed> It's probably cliché now, but you can ask them if they complain about spaces between words in a newspaper, or if you can get away with some snide, give them a quiz on operator precedence in their language.
<HiRE> I think thats what I love most about lisp so far
<HiRE> its unambiguous
<HiRE> most of them are python programmers (I am at work) so...you know that type
<HiRE> you'd think people who enjoy having tabnanny cram style down their throats wouldn't be bothered by some parens :P
<stylewarning> HiRE: make sure the thing you ultimately fall in love with isn’t some austere beauty of the language, but rather it’s ability to make you productive at writing code. In other words, write lots of code!
<beach> If they are Python programmers, then at least they won't use performance as an argument against Common Lisp.
zulu-inuoe_ has quit [Read error: Connection reset by peer]
<HiRE> stylewarning: I agree. Im not productive in common lisp yet but it is certainly fun to write. The idea that code can mutate itself and you can basically bolt on your own DSL for _anything_ for free is great.
<no-defun-allowed> It's rare to see self-modifying code in (any) Lisp, but code can definitely process other code very easily.
<HiRE> the last time I've seen lisp in the wild was back in my undergrad AI class
<HiRE> where my professor was a lisp fanboy and went on monologues about how its the best language ever made
<HiRE> guess the shoe is finally on the other foot
<no-defun-allowed> That is probably how I'm going to get "introduced" to it in formal education, in a year and a bit.
notzmv has joined #lisp
<beach> Yeah, good luck.
<HiRE> maybe not. My class was a very traditional "CS AI" class - prolog and what not were taught as well. Most new universities seem to be trending towards python...gag
notzmv is now known as Guest35026
<HiRE> **new university classes
Guest35026 has left #lisp [#lisp]
<no-defun-allowed> We do get Prolog too, and there is quite a lot of symbolic AI as well as the other sorts of AI like state search.
<beach> There are some good reasons in favor of Python as a first language, but those reasons are off topic here, so I won't go into detail.
<no-defun-allowed> There is also some machine learning—wait, symbolic (as well as "connectionist") machine learning?
oni-on-ion has joined #lisp
<stylewarning> The reason universities use Python is because every time they sunset the language, the plethora of textbook authors have something to rewrite. And that’s how you make the big bucks in academia.
notzmv has joined #lisp
<HiRE> that was the pretext of the class I took. It culminated with a simple expert system.
<HiRE> which fit the lisp/prolog mold nicely.
<HiRE> pretense*
<HiRE> pretext ...
milanj has joined #lisp
<beach> stylewarning: That is not the reason I decided on Python as a first language here.
<no-defun-allowed> And again, there is Norvig's Artificial Intelligence: A Modern Approach, so I think the course can't be too terrible.
<stylewarning> beach: ;-)
<HiRE> well I wont tie up the channel any longer in case anyone has anything else. I appreciate the help guys, I'll have to idle here more.
<beach> HiRE: There are specific channels for Mezzano and other projects, in case you are interested.
<beach> HiRE: And if you need stuff to work on, just let us know. :)
<beach> HiRE: metamodular.com/Common-Lisp/suggested-projects.html
<HiRE> oh great. This is awesome. I'll give it a look. Thank you
<beach> Anytime.
narimiran has joined #lisp
Bike has quit [Quit: Lost terminal]
Xach has quit [Ping timeout: 252 seconds]
Xach has joined #lisp
phlim has joined #lisp
rwcom5 has joined #lisp
rwcom has quit [Ping timeout: 268 seconds]
rwcom5 is now known as rwcom
krid has joined #lisp
jfb4_ has joined #lisp
sauvin has joined #lisp
jfb4 has quit [Ping timeout: 265 seconds]
krid has quit [Ping timeout: 260 seconds]
karlosz has quit [Quit: karlosz]
karlosz has joined #lisp
Oladon has joined #lisp
vlatkoB has joined #lisp
fouric has quit [Ping timeout: 250 seconds]
<LdBeth> Is there any source on how to use Lisp as a macro assembler/how to design a macro assembler?
drewc has quit [Ping timeout: 258 seconds]
drewc has joined #lisp
fouric has joined #lisp
gravicappa has quit [Ping timeout: 260 seconds]
karayan has quit [Ping timeout: 260 seconds]
karayan has joined #lisp
<beach> LdBeth: I have no information for you, but I am interested in knowing more about your project. I wrote an assembler in Common Lisp, but it is not a macro assembler, and it is quite different from others in that it does not have any surface syntax defined.
adam4567 has quit [Remote host closed the connection]
<beach> For x86-64 (the current target), an interesting problem is that of selecting the appropriate machine instruction for a given desired effect. There are often several instructions that will have the same effect, so there is not a 1-1 mapping between source and machine code.
sjl has quit [Quit: WeeChat 2.3-dev]
<LdBeth> beach: DEK's MMIX has demonstrated some different instruction that shares the same op code. I have limited knowledge and little interests on AMD64, for that it is a very sophisticated arch.
<LdBeth> My primary interest are in some old risc flavor arch, such as PowerPC, Alpha, 68000
karlosz has quit [Quit: karlosz]
william1_ has joined #lisp
<beach> I see.
<beach> So is there no existing assembler for those processors?
<LdBeth> they usually rely on a specific OS tied to the arch
<beach> Ah, OK.
<LdBeth> for example, to run a PPC assembler, I might need to setup a complete MacOS in a emulator first
dale has quit [Quit: My computer has gone to sleep]
<beach> I understand.
guna_ has quit [Ping timeout: 265 seconds]
william1_ has quit [Ping timeout: 265 seconds]
<LdBeth> I wish to write and assemble some "bare metal" program using the native OS I'm currently using, then run them using qemu or something
<beach> Got it.
<beach> Hold on, can't you use GAS?
wxie has joined #lisp
Oladon has quit [Quit: Leaving.]
<LdBeth> beach: for powerpc, yes I may setup a cross compiler toolchain
rumbler31 has joined #lisp
<LdBeth> but gas is not as powerful as nasm
jello_pudding has joined #lisp
<beach> True, it is meant as a backend for compilers, not for humans.
rumbler31 has quit [Ping timeout: 268 seconds]
wxie1 has joined #lisp
wxie has quit [Remote host closed the connection]
wxie1 is now known as wxie
marusich has joined #lisp
jellopudding has joined #lisp
jello_pudding has quit [Read error: Connection reset by peer]
jellopudding has quit [Client Quit]
jello_pudding has joined #lisp
kmeow has joined #lisp
wxie has quit [Ping timeout: 260 seconds]
wxie has joined #lisp
wxie has quit [Remote host closed the connection]
igemnace has quit [Quit: WeeChat 2.7]
marusich has quit [Quit: Leaving]
z147 has joined #lisp
MonoBobo has quit [Ping timeout: 265 seconds]
shka_ has joined #lisp
gravicappa has joined #lisp
Necktwi_ has quit [Ping timeout: 268 seconds]
frgo has quit [Remote host closed the connection]
anewuser has quit [Quit: anewuser]
frgo has joined #lisp
karayan has quit [Ping timeout: 260 seconds]
karayan has joined #lisp
nowhere_man has joined #lisp
logicmoo is now known as dmiles
rumbler31 has joined #lisp
harovali has joined #lisp
<harovali> hi! How do I specify the #\Page char in a cl-ppcre regex to split on it?
rumbler31 has quit [Ping timeout: 265 seconds]
ggole has joined #lisp
MonoBobo has joined #lisp
<beach> harovali: Did you see my answer to your question about scope the other day?
z147 has quit [Ping timeout: 240 seconds]
random-nick has joined #lisp
shifty has quit [Ping timeout: 258 seconds]
smokeink has quit [Remote host closed the connection]
narimiran has quit [Ping timeout: 260 seconds]
smokeink has joined #lisp
smokeink has quit [Remote host closed the connection]
quazimodo has quit [Ping timeout: 258 seconds]
william1_ has joined #lisp
xuxuru has joined #lisp
quazimodo has joined #lisp
CrazyEddy has quit [Remote host closed the connection]
<harovali> beach: yes !! thanks indeed !
<harovali> I reformulated my code from that point on
<beach> It would be great if you would acknowledge when you have seen an answer, and even better if you would tell the person giving it whether it was of any help to you.
<harovali> beach: I agree. Sorry indeed. Thanks for asking back and yielding the oportunity of apologizing to me.
<beach> Sure.
<harovali> supose (defun fun (anotherfun) (funcall 'anotherfun))
<harovali> that will trigger the variable unused warning right ?
<beach> Sounds right.
<harovali> because I'm using it as a symbol right ?
<harovali> so I'l have to declare it as ignored right ?
<beach> You are not using the parameter.
<harovali> thanks
<beach> Why would you want to do something like that?
<harovali> like what?
<harovali> because I'm passing a closure as an argument
<beach> Having a parameter named X and then funcalling a global function that also happens to be named X.
<beach> There is no relation between the two occurrences of ANOTHERFUN.
<beach> So your FUNCALL is not going to call the closure you are passing in general.
<harovali> how do you call the closure there ?
CrazyEddy has joined #lisp
<beach> No quote (FUNCALL ANOTHERFUN)
<harovali> thanks! excellent
<beach> When ANOTHERFUN is unused, it means you are not calling it.
<harovali> great
<harovali> thank you
<beach> Sure.
quazimodo has quit [Ping timeout: 260 seconds]
<harovali> I had a reboot session back then , including upgrading to sbcl 2.0.0 , just after you answered, my chat session got closed and later I forgot to come back
<beach> I see. Don't worry about it.
nowhereman has joined #lisp
nowhere_man has quit [Ping timeout: 268 seconds]
<pjb> beach: I beg to differ: you can write a garbage collector in conforming Common Lisp. Perhaps not one that garbage its own memory, but one good metalinguistic garbage collector, definitely!
<beach> Sure.
<beach> HiRE: Speaking of which, you can't write a low-level garbage collector in conforming C either.
z147 has joined #lisp
<pjb> :-)
<pjb> HiRE: for an example of a GC written in CL, have a look at https://github.com/informatimago/lisp/blob/master/common-lisp/heap/heap.lisp#L1824
quazimodo has joined #lisp
FreeBirdLjj has joined #lisp
<aeth> I think the SBCL team stance is that SBCL's GC is C so they can debug it iirc (I can't speak for them directly, I'm just remembering)
<beach> I guess if you make all of memory look like a huge array of unsigned bytes, you can write a GC in Common Lisp.
<aeth> You can write large parts of a program in non-consing CL, at least in SBCL. The profiling's good enough. So you should be able to write a GC in it. It'd be tricky, I guess. Especially debugging, since the non-consing style usually assumes that it's, well, working.
<pjb> HiRE: or a simpler example of GC: https://groups.google.com/forum/#!msg/comp.lang.lisp/Ac-Vj8UJpZ8/s6-kmPmKQIIJ
<pjb> LdBeth: since assembler is often used as a HIR for a compiler: https://groups.google.com/forum/#!msg/comp.lang.lisp/QMakibYYZRg/fgQulr5b4BwJ
<aeth> What I mean is, yes, your GC program is non-consing (just preallocating what it needs, declaring dynamic-extent most of the rest, and using a special heap data structure that's a huge array), but is e.g. your condition system? Probably not. So once you get an error...
<pjb> LdBeth: or IR at least…
<pjb> aeth: If you wanted to do that in a real implementation or system, you would have to define a non-consing subset…
<aeth> pjb: You don't have to define a non-consing subset because you can profile SBCL enough just to make sure you accidentally don't introduce consing.
<aeth> I mean, I guess you could have your compiler enforce it instead of just relying on the profilers.
FreeBirdLjj has quit [Ping timeout: 260 seconds]
<pjb> aeth: Yes, like the button astronauts shouldn't press if they wanted to get back to Earth from the Moon… Right.
<aeth> But, anyway, that subset does exist and I think it's probably large enough to write a GC in it, if you allow preallocating.
<aeth> At least in SBCL. Other implementations might cons more, and seem to be harder to check.
<aeth> Non-consing is not as hard as it seems because it's not really non-consing, it's cons-up-front, and then use dynamic-extent for the rare rest.
<no-defun-allowed> "The astronauts had access to only 72 kilobytes of computer memory (a 64-gigabyte cell phone today carries almost a million times more storage space)." Conflating primary and secondary memory (where such a barrier does exist due to software limitations) is always a sign the author is proficient in writing about computers.
frgo has quit [Remote host closed the connection]
wxie has joined #lisp
<harovali> https://pastebin.com/iKxDh2Sc if you wanna see my code. For some reaseon beyond my understanding and my research abilities, the funcalls (especially the first one , in line 72 ) fail miserably with the error ' evaluation stopped on nil'
<no-defun-allowed> Do you have a backtrace?
Inline has joined #lisp
<no-defun-allowed> You would probably also be better served by a class instead of a set of six closures that represent a state.
<harovali> no-defun-allowed: no log , just that error
<harovali> no-defun-allowed: yes
<no-defun-allowed> Then I'm not sure how much I can suggest without a backtrace to see how you got there.
<harovali> no-defun-allowed: I'll try to manage to provide one
<harovali> no-defun-allowed: thanks !
Inline has quit [Client Quit]
Inline has joined #lisp
karayan has quit [Ping timeout: 260 seconds]
karayan has joined #lisp
z147 has quit [Ping timeout: 240 seconds]
z147 has joined #lisp
frgo has joined #lisp
cosimone has joined #lisp
jonatack has quit [Ping timeout: 260 seconds]
CrazyEddy has quit [Remote host closed the connection]
<harovali> be back later, gotta sleep
dddddd has joined #lisp
harovali has left #lisp ["ERC (IRC client for Emacs 26.3)"]
<no-defun-allowed> Same here. Funny that.
xuxuru has quit [Quit: xuxuru]
rumbler31 has joined #lisp
kmeow has quit [Remote host closed the connection]
rumbler31 has quit [Ping timeout: 240 seconds]
ebrasca has joined #lisp
random-nick has quit [Ping timeout: 240 seconds]
srandon111 has joined #lisp
wxie has quit [Ping timeout: 260 seconds]
EvW has joined #lisp
srandon111 has quit [Ping timeout: 260 seconds]
wxie has joined #lisp
quazimodo has quit [Ping timeout: 260 seconds]
quazimodo has joined #lisp
asdf_asdf_asdf has joined #lisp
srandon111 has joined #lisp
_whitelogger has joined #lisp
atgreen has quit [Ping timeout: 260 seconds]
karayan has quit [Ping timeout: 260 seconds]
Bike has joined #lisp
varjag has joined #lisp
frgo has quit [Remote host closed the connection]
narimiran has joined #lisp
frgo has joined #lisp
shifty has joined #lisp
atgreen has joined #lisp
cosimone has joined #lisp
__jrjsmrtn__ has joined #lisp
_jrjsmrtn has quit [Ping timeout: 268 seconds]
<|3b|> are there any "best practices" for compiling a set of code a few times, with different package each time? if i just put the file in the .asd 3 times, it will get the same .fasl each time, which won't work
random-nick has joined #lisp
* |3b| 's ideas so far are: convince asdf to change the .fasl name for each instance. "include" the code file into 3 separate wrapper file that set the package etc. write some ugly defining macros to duplicate the definitions with package prefixes
<|3b|> macro gets even uglier if i want the option to not load all 3 packages at once
scymtym has quit [Ping timeout: 260 seconds]
<|3b|> end-goal is to implement some code once and have versions specialized on single-float, double-float, or real. user code would then specify which it wants with package local nicknames
wxie has quit [Ping timeout: 260 seconds]
EvW has quit [Ping timeout: 248 seconds]
<Xach> excellent, first sick abuse of package-local nicknames
<|3b|> that's an intended usage :)
kajo has joined #lisp
rumbler31 has joined #lisp
rumbler31 has quit [Ping timeout: 268 seconds]
kajo has quit [Ping timeout: 248 seconds]
nckx has quit [Ping timeout: 268 seconds]
<varjag> hm, copying an array into foreign memory with cffi/ccl is somehow super slow..
<varjag> must be doing something wrong
<|3b|> declaring types might help
<|3b|> or if it is unsigned-byte 8 array, maybe use nibbles to copy 4 or 8 bytes at a time, depending on length and alignment
<varjag> hmm..
<|3b|> also make sure cffi knows types at compile time (possibly duplicate code if needed)
<varjag> thanks, will check on these
cosimone has quit [Quit: Quit.]
cosimone has joined #lisp
<varjag> the code fills the array via individual mem-arefs in a loop
shifty has quit [Ping timeout: 268 seconds]
shifty has joined #lisp
<varjag> is it the only/most efficient way doing that for arrays?
atgreen has quit [Ping timeout: 265 seconds]
<|3b|> if you can use static-vectors to avoid copying at all, that might be better, though it requires manual memory management which makes it annoying for some things
* |3b| usually does element-by-element copies for lisp->foreign though, if static-vectors isn't applicable
<asdf_asdf_asdf> Hi. I do C-M-s and typed regex. It marked words. How changing marked to "selection", that able copy more than one marked words?
<|3b|> #emacs knows more about how emacs works
<varjag> this is is in my alsa code… worked fine on faster systems, but on an arm target beginning to get underruns with sample rates at 32k+
<|3b|> (assuming that's what you are asking about)
<varjag> yes, just shoving samples to a sound buffer
<|3b|> might see if ccl has some way to get a pointer to the vector data, and call memcpy or similar on it
<|3b|> (wrapping it in some portability thing that copies if it has to, if you care about other implementations)
<|3b|> looks like ccl:with-pointer-to-ivector might do that
<|3b|> or just use cffi:with-pointer-to-vector-data, but then you might pay double copy cost on implementations that don't have a way to get a pointer
quazimodo has quit [Ping timeout: 240 seconds]
<varjag> oh… didn't see that one
<varjag> thanks!
shifty has quit [Ping timeout: 258 seconds]
theBlackDragon has quit [Remote host closed the connection]
<|3b|> it's "very experimental interface" according to comments in source
scymtym has joined #lisp
<|3b|> looks like there is also a make-shareable-byte-vector you should use with it for complete portability, but the extra copy on some implementations usually means i don't want full portability when i use it anyway
<|3b|> the clisp implementation does 2 copies for example
<varjag> we're moving to lispworks for prod but would really like to sort it out with ccl first
<varjag> appears lispworks has a similar call
papachan has joined #lisp
<|3b|> looks like lispworks might want make-shareable-byte-vector for use with with-pointer-to-vector-data
theBlackDragon has joined #lisp
quazimodo has joined #lisp
<_death> for sbcl I implemented (a POC) mmaped memory as lisp arrays, so you can use shared memory naturally
CrazyEddy has joined #lisp
<varjag> nice
<varjag> sadly there's no native threads on sbcl/arm32
<|3b|> looks like cffi uses http://www.lispworks.com/documentation/lw71/FLI/html/fli-122.htm on lw, which wants special allocation
<varjag> cffi:make-shareable-byte-vector appears to do that too yes
<|3b|> yeah, that does the 'special allocation' part if applicable
<|3b|> sbcl and ccl can apparently get pointers to any vector, so it just makes a normal array
<beach> I am looking at the LispWorks manual, specifically the section about the debugger. It looks to me like the LispWorks debugger is no more sophisticated than the one in SBCL/SLIME. Am I right? In particular, I don't see a way to set a breakpoint before a program is started. Can anyone who has used LispWorks confirm this interpretation of mine?
<beach> I apologize for this brief question about a non-free Common Lisp system.
<Xach> beach: I don't know, but I do know that the lisp-hug mailing list is always very helpful.
<Xach> I don't know of a real-time irc-like chat forum specifically for lispworks.
lucasb has joined #lisp
<beach> OK, thanks for the information.
<beach> I could also call Martin.
<|3b|> lispworks personal edition ide has a "set breakpoint" button that seems to work
<beach> Thanks.
quazimodo has quit [Ping timeout: 240 seconds]
asdf_asdf_asdf has quit [Quit: asdf_asdf_asdf]
quazimodo has joined #lisp
Kundry_Wag has joined #lisp
Lycurgus has joined #lisp
<p_l> beach: also macro tracing (this switches code to evaluator instead of compiled, afaik) and working Who Calls database
Kundry_Wag has quit [Remote host closed the connection]
<beach> I am mostly interested in breakpoints and how they work. Specifically if you can set a breakpoint in system code, like CONS or POSITION.
grabarz has joined #lisp
<p_l> according to docs, everything that isn't special form can be breakpointed
<beach> Interesting.
<beach> I guess I need to figure out how that works.
<p_l> (can't test right now, as personal edition no longer works on mac, and I'm too lazy to take a trip for the other laptop)
<p_l> beach: it's hooked into "dspec system" according to http://www.lispworks.com/documentation/lw70/IDE-W/html/ide-w-207.htm
<beach> Ah, that's the section I was looking for. Thanks!
<p_l> sounds to me like it's similar to SBCL's global database
<beach> Maybe so. I'll read up some more. Thanks again.
<p_l> glad to help
william1_ has quit [Ping timeout: 260 seconds]
patlv has joined #lisp
patlv has quit [Client Quit]
<pjb> |3b|: I would have different files that would each define the current package, and include the common file (eg. with com.informatimago.common-lisp.cesarum.utility:include-file).
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 265 seconds]
Lord_of_Life_ is now known as Lord_of_Life
srandon111 has quit [Read error: Connection reset by peer]
<pjb> beach: the way break points work depends on the level of the code you're trying to suspend. You can have breakpoints at the source level (eg. inserting (break) forms. You can have breakpoints at the microcode level, either by live-patching the instructions, replacing them by a jump or a software interrupt, a trap, or even an invalid instruction if you can handle it and resume, or by stepping all the execution setting a flag to do
<pjb> (mostly done when debugging from another process).
<pjb> You could also set break points by configuring the MMU to prevent access to the specfied instructions.
<p_l> most modern CPUs have "debug registers" that enable breakpoints without modifying code
<pjb> Working at the source level can be easier: you directly know where the break point occurs, while if you break (or step) low level instructions you have to map their addresses to source expressions (which may be difficult or impossible, depending on the compiler optimizations)
Lycurgus has quit [Remote host closed the connection]
<pjb> Indeed, since modifying the code has its difficulties. It may be complicated to do or even prevented by the system…
<p_l> or simply you might not want to deal with the trouble of arranging possibly complex jump chain to get the original instruction continued
<p_l> debug registers let you create a hw breakpoint that has separate configuration from what application might have used for itself
<pjb> One easy way to do it, is to "instrument" the code. It's easy to do at the compilation level (eg. with high debug level). You just insert the instructions needed to step/break.
rwcom has quit [Ping timeout: 265 seconds]
<pjb> You don't need support from the system or the processor, it can work portably and conformingly, and it can give very good results source-wise. The only problem is that the instrumentation changes the generated code, so bugs may appear or disappear when you do that… (should not be a problem if the compiler is bug free!).
rwcom has joined #lisp
Kundry_Wag has joined #lisp
<beach> pjb: I am specifically interested in the mechanism used by LispWorks. But I see now that breakpoints are part of the stepper, so that should give me some hints.
srandon111 has joined #lisp
Kundry_Wag has quit [Ping timeout: 240 seconds]
<splittist> one day I will remember the correct order of arguments to get-hash. Today is not that day.
<jackdaniel> splittist: you may arrange it as English sequence: "get eggs from the store" is more natural than "get from the store eggs"
<jackdaniel> sentence ^_^
<splittist> jackdaniel: brilliant!
<|3b|> "get eggs from the store, or milk if they don't have any"?
<jackdaniel> good one :)
Kundry_Wag has joined #lisp
<nirved> splittist: doesn't it show in the echo area of emacs?
<varjag> now do that for aref :p
<|3b|> "access array at indices x,y..."?
Kundry_Wag has quit [Remote host closed the connection]
<jackdaniel> varjag: get book in a library found at shelf 3 column 4 and row 2
rumbler31 has joined #lisp
<splittist> nirved: yes
frgo has quit [Remote host closed the connection]
gareppa has joined #lisp
rumbler31 has quit [Ping timeout: 240 seconds]
<p_l> beach: given the list of places that a breakpoint can be declared, I'd say there's good chance that they replace call sequence
<pjb> getting eggs from the milk?
MonoBobo_ has joined #lisp
MonoBobo has quit [Ping timeout: 260 seconds]
<beach> p_l: Yes, I agree.
<beach> And I think that doing that is possible only in the stepper.
<beach> Now I need to know what kind of performance penalty the stepper creates.
grabarz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<p_l> why would it be possible only in the stepper, if they can hijack the call by simply changing the address?
frgo has joined #lisp
jfb4_ has quit [Ping timeout: 260 seconds]
rumbler31 has joined #lisp
jfb4 has joined #lisp
stepnem_ has quit [Read error: Connection reset by peer]
stepnem has joined #lisp
shifty has joined #lisp
<beach> Good question.
<beach> I think I need to write to them.
jfb4 has quit [Ping timeout: 268 seconds]
jprajzne has joined #lisp
jfb4_ has joined #lisp
Kundry_Wag has joined #lisp
shifty has quit [Ping timeout: 268 seconds]
Kundry_Wag has quit [Ping timeout: 260 seconds]
<p_l> beach: Rainer Joswig had also made an interesting set of twitter posts of various debug features in LW
<varjag> |3b|: it's prefect now with shareable vectors
<varjag> in ccl at least
<varjag> now need to come up with some user friendly idiom for also-alsa
rwcom has quit [Ping timeout: 268 seconds]
rwcom8 has joined #lisp
test1600 has joined #lisp
test1600 has quit [Remote host closed the connection]
test1600 has joined #lisp
<beach> p_l: I'll look for them.
pnp has joined #lisp
pnp has left #lisp [#lisp]
gareppa has quit [Quit: Leaving]
kajo has joined #lisp
jfb4 has joined #lisp
jfb4_ has quit [Ping timeout: 260 seconds]
X-Scale` has joined #lisp
X-Scale has quit [Ping timeout: 260 seconds]
X-Scale` is now known as X-Scale
kajo has quit [Ping timeout: 260 seconds]
heisig has joined #lisp
oni-on-ion has quit [Remote host closed the connection]
oni-on-ion has joined #lisp
cosimone has quit [Quit: Quit.]
cosimone has joined #lisp
cosimone has quit [Client Quit]
cosimone has joined #lisp
Colleen has quit [Ping timeout: 268 seconds]
Colleen has joined #lisp
cosimone has quit [Quit: Quit.]
cosimone has joined #lisp
cosimone has quit [Client Quit]
hiroaki has quit [Ping timeout: 258 seconds]
Kundry_Wag has joined #lisp
_heisig has joined #lisp
cosimone has joined #lisp
heisig has quit [Ping timeout: 248 seconds]
karlosz has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
heisig__ has joined #lisp
heisig__ is now known as heisig
_heisig has quit [Ping timeout: 246 seconds]
heisig has quit [Remote host closed the connection]
heisig has joined #lisp
ebrasca has quit [Remote host closed the connection]
hiroaki has joined #lisp
rwcom has joined #lisp
rwcom8 has quit [Ping timeout: 260 seconds]
gravicappa has quit [Read error: Connection reset by peer]
test1600 has quit [Quit: Leaving]
gravicappa has joined #lisp
MonoBobo_ has quit [Ping timeout: 268 seconds]
MonoBobo has joined #lisp
decent-username has quit [Ping timeout: 252 seconds]
decent-username has joined #lisp
cosimone has quit [Quit: Quit.]
kajo has joined #lisp
davisr has joined #lisp
MonoBobo has quit [Ping timeout: 268 seconds]
tumdum has quit [Ping timeout: 268 seconds]
tumdum has joined #lisp
tumdum has joined #lisp
tumdum has quit [Changing host]
jprajzne has quit [Quit: jprajzne]
MonoBobo has joined #lisp
gareppa has joined #lisp
dale has joined #lisp
Shinmera- has joined #lisp
MonoBobo_ has joined #lisp
MonoBobo has quit [Read error: Connection reset by peer]
puchacz has joined #lisp
<puchacz> hi, it seems that variables used in loop are bound as if they were (let ...), so safe to use the same name in inner loop, like here: (loop :for i :from 0 :to 3 :collect (cons i (loop :for i :from 1 :to 2 :collect i)))
Shinmera has quit [Ping timeout: 268 seconds]
Shinmera- is now known as Shinmera
<puchacz> the result is ((0 1 2) (1 1 2) (2 1 2) (3 1 2))
<puchacz> it is not by accident, is it?
<Bike> there's a binding, sure
<puchacz> so Bike, nothing wrong with what I did, is it?
<puchacz> by "reusing" the name
<|3b|> shadowing the outer binding(s) is fine
<puchacz> exactly like with (let ...) ?
<|3b|> (fine for the compiler, might be less fine for humans)
varjag has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
<puchacz> |3b| perfectly fine for me :)
<pjb> puchacz: note that the standard doesn't specify weither there's one binding per iteration or one bindinig for the whole loop.
<|3b|> doesn't matter what creates the bindings, they work the same way
<pjb> (mapcar 'funcall (loop for i below 3 collect (lambda () i))) #| --> (3 3 3) or (0 1 2) |#
<|3b|> (defun foo (i) (let ((i i)) (loop for i from i collect (loop for i below i collect i))))
<pjb> (mapcar 'funcall (loop for i below 3 collect (let ((i i)) (lambda () i)))) #| --> (0 1 2) |# if you want one binding per iteration.
* |3b| 's loop doesn't terminate though, so possibly bad example)
<puchacz> pjb: I did not know that, thanks. sbcl has one binding for the whole loop if I remember, checking
<puchacz> yes, (3 3 3)
<puchacz> I discovered it some time ago, and use (let...) if I need, I did not know that some lisps may not need (let ...) - of course even those lisps will work fine with extra let
<puchacz> so my example with one binding per whole iteration, is it guaranteed to work across all common lisps?
<Bike> i mean, loop makes aat least one binding, yes.
<pjb> Yes.
<puchacz> okay, so I am good
<puchacz> :)
<puchacz> thanks guys!
papachan has quit [Ping timeout: 268 seconds]
tumdum has quit [Ping timeout: 240 seconds]
gareppa has quit [Quit: Leaving]
tumdum has joined #lisp
jfb4 has quit [Ping timeout: 240 seconds]
jfb4_ has joined #lisp
slyrus_ has joined #lisp
scymtym_ has joined #lisp
slyrus__ has quit [Ping timeout: 260 seconds]
oxum has joined #lisp
scymtym has quit [Ping timeout: 248 seconds]
scymtym_ has quit [Ping timeout: 248 seconds]
klltkr has joined #lisp
heisig has quit [Read error: Connection reset by peer]
heisig has joined #lisp
Kundry_Wag has joined #lisp
cpape has quit [Ping timeout: 240 seconds]
cpape has joined #lisp
asarch has joined #lisp
Kundry_Wag has quit [Ping timeout: 260 seconds]
<asarch> One stupid question: just like the mini golf, what would be the shortest way to count from 0 to 5?
<puchacz> (loop :for i :from 0 : to 5 :do (print i))
pjb has quit [Read error: Connection reset by peer]
pjb has joined #lisp
dale has quit [Read error: Connection reset by peer]
cpape` has joined #lisp
dale has joined #lisp
Buggys has quit [Ping timeout: 258 seconds]
simplegauss has quit [Ping timeout: 258 seconds]
<LdBeth> pjb: thank you for the links, I'll read them later
easye` has joined #lisp
Shinmera- has joined #lisp
nowhere_man has joined #lisp
nowhereman has quit [Ping timeout: 268 seconds]
aindilis has quit [Ping timeout: 268 seconds]
simplegauss_ has joined #lisp
<LdBeth> asarch: install april and write “[]IO<-0 <> i5”
slyrus has joined #lisp
nckx has joined #lisp
easye has quit [Remote host closed the connection]
cpape has quit [Remote host closed the connection]
Shinmera has quit [Remote host closed the connection]
easye` has quit [Read error: Connection reset by peer]
Buggys has joined #lisp
slyrus_ has quit [Ping timeout: 240 seconds]
easye` has joined #lisp
<|3b|> loop starts from 0 if you don't specify, so (loop for i to 5 do(print i)) is a bit shorter, but (dotimes(i 5)(print i)) is shorter than loop
ShinmerARGH has joined #lisp
ShinmerARGH is now known as Shinmera
Shinmera- has quit [Ping timeout: 240 seconds]
heisig has quit [Quit: Leaving]
easye` has quit [Excess Flood]
easye` has joined #lisp
aindilis has joined #lisp
ggole has quit [Quit: Leaving]
gabc has joined #lisp
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
<pjb> (loop for i to 5 collect i) #| --> (0 1 2 3 4 5) |# is shorter than (let ((is '())) (dotimes (i (1+ 5) (nreverse is)) (push i is))) #| --> (0 1 2 3 4 5) |#
<pjb> |3b|: and your do is shorter, but doesn't do the same as your loop.
<pjb> s/do/dotimes/
<|3b|> right, building a list is easier in loop, and i should probably test more carefully :/
<asarch> Yeah! Thank you!
<|3b|> though for golfing, you should skip the spaces before ( and drop the ' :)
<asarch> “[]IO<-0 <> i5” <- Is this Lisp?
<Inline> uhuh
<oni-on-ion> could be...
<|3b|> it is (presumably) lisp with a custom reader
<Inline> that looks more like apl
<Inline> hmmm
<Bike> ah, yep, it's an APL to Lisp compiler... hows about that.
<Inline> hahaha
<|3b|> (let(l)(dotimes(i 6(reverse l))(push i l))) is ugly, but still a good bit longer than the LOOP equivalent
<asarch> (dotimes(i 5)(print i))
<|3b|> asarch: 6 if you want 0 to 5 inclusive
<Bike> '(0 1 2 3 4 5) bam
<|3b|> if you allow libs and just want a list, (iota 6) ;; from alexandria
<asarch> (each (i '(0 .. 5)) (print i))
<|3b|> or (map()'print(iota 5))
FreeBirdLjj has joined #lisp
<|3b|> but then presumably you'd just use a hypothetical golf lib that had any function you want assigned to some unicode character
<|3b|> (and wrapped in a symbol macro to avoid the extra ()
<asarch> I mean, the less commands you need to accomplish a task
<|3b|> 'commands' /= 'characters' :)
davisr_ has joined #lisp
slyrus_ has joined #lisp
minion has quit [Remote host closed the connection]
akrl` has joined #lisp
specbot has quit [Disconnected by services]
minion has joined #lisp
specbot has joined #lisp
FreeBirdLjj has quit [Ping timeout: 260 seconds]
* |3b| wonders how long it would take to run out of good characters if you added a function to the lib every time someone suggested a new golf task
cpape`` has joined #lisp
frgo_ has joined #lisp
_jrjsmrtn has joined #lisp
slyrus has quit [Remote host closed the connection]
davisr has quit [Remote host closed the connection]
Krystof has quit [Ping timeout: 265 seconds]
frgo has quit [Read error: Connection reset by peer]
__jrjsmrtn__ has quit [Quit: Bye !]
femi has quit [Ping timeout: 265 seconds]
akrl has quit [Remote host closed the connection]
cpape` has quit [Remote host closed the connection]
jcob has quit [Ping timeout: 265 seconds]
rwcom9 has joined #lisp
bmansurov has quit [Ping timeout: 252 seconds]
rwcom has quit [Ping timeout: 240 seconds]
rwcom9 is now known as rwcom
jcob has joined #lisp
femi has joined #lisp
bmansurov has joined #lisp
heisig has joined #lisp
MonoBobo_ has quit [Ping timeout: 258 seconds]
<asarch> See you later!
asarch has quit [Quit: Leaving]
heisig has quit [Client Quit]
X-Scale` has joined #lisp
X-Scale has quit [Ping timeout: 268 seconds]
X-Scale` is now known as X-Scale
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
MonoBobo has joined #lisp
z147 has quit [Ping timeout: 240 seconds]
vlatkoB has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
MonoBobo has quit [Read error: Connection reset by peer]
<pjb> |3b|: unicode has a lot of good characters. But I agree that golf tasks naturally reduce good character in the most mild mannered and educated people…
rumbler31 has quit [Remote host closed the connection]
varjag has joined #lisp
z147 has joined #lisp
asdf_asdf_asdf has joined #lisp
sauvin has quit [Ping timeout: 265 seconds]
sauvin has joined #lisp
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
Odin- has joined #lisp
slyrus__ has joined #lisp
slyrus_ has quit [Ping timeout: 260 seconds]
kajo has quit [Ping timeout: 248 seconds]
cosimone has joined #lisp
ravndal has quit [Quit: WeeChat 2.7]
ravndal has joined #lisp
kajo has joined #lisp
Kundry_Wag has joined #lisp
shka_ has quit [Ping timeout: 258 seconds]
FreeBirdLjj has joined #lisp
bitmapper has joined #lisp
bmansurov has quit [Ping timeout: 260 seconds]
Kundry_Wag has quit [Ping timeout: 260 seconds]
FreeBirdLjj has quit [Ping timeout: 260 seconds]
narimiran has quit [Ping timeout: 258 seconds]
bmansurov has joined #lisp
cosimone has quit [Quit: Quit.]
Josh_2 has quit [Ping timeout: 240 seconds]
gravicappa has quit [Ping timeout: 260 seconds]
Odin- has quit [Read error: Connection reset by peer]
slyrus has joined #lisp
slyrus__ has quit [Ping timeout: 240 seconds]
karayan has joined #lisp
akoana has joined #lisp
stepnem has quit [Read error: Connection reset by peer]
stepnem has joined #lisp
Oladon has joined #lisp
_whitelogger has joined #lisp
asdf_asdf_asdf has quit [Remote host closed the connection]
asdf_asdf_asdf has joined #lisp
jonatack has joined #lisp
brown121407 has quit [Read error: Connection reset by peer]
brown121407 has joined #lisp
varjag has quit [Remote host closed the connection]
varjag has joined #lisp
jfb4 has joined #lisp
ebrasca has joined #lisp
jfb4_ has quit [Ping timeout: 268 seconds]
Shinmera- has joined #lisp
Shinmera has quit [Ping timeout: 268 seconds]
Shinmera- is now known as Shinmera
ebrasca has quit [Remote host closed the connection]
tumdum has quit [Ping timeout: 268 seconds]
tumdum has joined #lisp
tumdum has quit [Changing host]
tumdum has joined #lisp
karayan has quit [Ping timeout: 260 seconds]
decent-username has quit [Ping timeout: 260 seconds]
Odin- has joined #lisp
brettgilio has quit [Ping timeout: 260 seconds]
papachan has joined #lisp
Mark35 has joined #lisp
torbo has joined #lisp
<Mark35> How would one pretty print json in lisp? It appears possible with https://common-lisp.net/project/cl-json/cl-json.html but I'm not sure how to go about it.
<Mark35> Specifically I would like to pretty print the JSON output, not a lisp structure.
lucasb has quit [Quit: Connection closed for inactivity]
DGASAU has quit [Ping timeout: 260 seconds]
z147 has quit [Ping timeout: 240 seconds]
<Odin-> XP is pretty configurable. Shouldn't be much of a problem convincing it to print Lisp structures as JSON.
slyrus_ has joined #lisp
Mark35 has quit [Remote host closed the connection]
slyrus has quit [Ping timeout: 265 seconds]
puchacz has quit [Quit: Connection closed for inactivity]