freenode/#lisp - IRC Chatlog
Search
16:04:22
jdz
Larry Wall is entitled to see lisp code like that since the rest of the world sees Perl code as line noise.
16:05:37
pmetzger
Perl was a big improvement over the practical alternatives for gluing stuff together 25 years ago. Now the alternatives are a big improvement over perl.
16:06:10
pmetzger
Perl 6 really killed Perl. Weirdly it wasn't so much second systems effect as third or fourth.
16:27:56
comborico1611
Has there been any improvements made to evaltrace notation since 1990? I'm thinking mainly in terms of using it with paper and pencil.
16:41:08
beach
comborico1611: Are you planning to use it in order to learn the evaluation rules of Common Lisp?
16:59:34
comborico1611
beach: Yeah, it is in the book I'm using. Common Lisp: A Gentle Introduction to Symbolic Computation. Gotta go!
16:59:50
CodeOrangutan
comborico1611: Ran across this article today, but honestly not sure that it's an improvement: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.98.5477&rep=rep1&type=pdf
17:00:16
stacksmith
Some of these 'teaching aids' are more complicated to learn than the subject itself...
17:07:06
stacksmith
Wonder how many people bang their head against things like 'evaltrace notation' instead of just learning Lisp.
17:18:57
CodeOrangutan
stacksmith: I'm finding the evaltrace notation useful to understand things like double and triple recursion.
17:51:13
CodeOrangutan
beach: Like FLATTEN FLAT and PRUNE in this code: https://github.com/GustavBertram/lisp-book-exercises/blob/master/on_lisp/4_3_operations_on_lists.lisp
18:01:33
CodeOrangutan
I'm not sure if it's required that the function call itself like so: (func x (func y z)) or if (+ (func x) (func y)) is sufficient for double recursion, but the former form looks like it might qualify as a legit math term.
18:08:30
Pierpa
All this fuss about recursion is only because Fortran 66 did not allow for the same function be active more than once at the same time.
18:09:36
Pierpa
It It was not for this historical accident then then a function would be a function call. Stop.
18:12:03
Bike
recursivity is an important computational property even without computing devices being involved.
18:13:05
jmercouris
as in, I've never had a time where recursion has made a problem of mine significantly easier, or maybe I'm not skilled enough to have seen it
18:13:50
jmercouris
Bike: when I say "good", I mean "applicable", an orange is not "good" at removing bolts, but a socket is
18:14:49
Bike
if you have four differently colored balls, how many different ways can you arrange them in a row?
18:15:18
sukaeto
I gave his book to my wife, and she became confounded by his introduction to lists - how he goes into detail drawing linked list diagrams of cons cells
18:16:00
sukaeto
not because it didn't make sense, but because she became impatient with it. "What's the point of this! Where is he going with this? This is stupid! Is this what you deal with every day at work?"
18:16:57
sukaeto
and it got me thinking that yes, maybe talking about how things are laid out in memory that early on is not only unnecessary, it's actually detrimental
18:17:27
pfdietz
Tree als can be done iteratively but that often means you are implicitly unwinding a recursive algorithm with your own stack.
18:18:18
Bike
shka: there's no "right" order. you just need to ensure that whatever is reading it back later wants the bytes in that order.
18:19:37
jmercouris
I'm not much of a C developer, but I believe different implementations didn't implement floats in the same way
18:20:15
stacksmith
shka: there is no standard for serializing floats in Lisp or C - it is _application_ dependent
18:53:53
didi
Xach: Good question. (values nil nil) sounds appropriate, as the second value represents emptiness.
19:48:47
phoe
The moment you get a segfault, the game is over in general case. Your code might have already written all over your memory and corrupted things that will screw you up later.
19:49:28
phoe
SBCL has error handlers installed for that, so when it segfaults, it drops you into its Lisp debugger in most cases.
19:49:53
phoe
But the fact that your OS detected a segfault is one thing, it's more fun when your system does *not* detect a segfault.
19:51:06
phoe
In other words: welcome to the joys of development with memory-unsafe languages. Please enjoy the view and fasten your seatbSegmentation fault (core dumped)
19:51:35
emaczen
Well yesterday I was learning how CFFI deals with C pointers in terms of getting an address and dereferencing
19:56:00
phoe
translating stuff between languages requires thinking, especially between languages as wildly different as C and Lisp.
19:56:42
phoe
where one is a weakly statically typed static language and the other is a strongly dynamically typed interactive language. and that's just one difference out of many.
19:57:42
emaczen
phoe: One of the reasons why I like Lisp so much is that the grammar makes it immediately obvious
19:59:32
Bike
i suppose the concept of lvalues is a bit like places. i think it makes sense to view & as similar to a macro.
20:03:06
Bike
so if it was in cffi, you'd have like (addressof (mem-aref x y z)) expand to (mem-aptr x y z).
20:07:49
emaczen
One observation I do have though is that I tend to get a lot of segfaults because the C code I am translating is passing pointers to be modified, and then uses this pointer again and I can't tell if it needs dereferenced.
20:09:04
emaczen
Is this a correct observation? There are cases that I can obviously tell where pointers need dereferenced, but it is when these pointers are modified in a function and used later (without looking at the function) nobody can tell they may need dereferenced?
20:10:11
phoe
if you pass a number around, that number is always itself, unless you explicitly incf or decf it using C's ++ or -- operators.
20:11:49
emaczen
In the code I am looking at, config is declared as a pointer, its address is then passed to a function for initialization, and finally it is used like: &config->interface[i]
20:12:20
emaczen
In my lisp code, I had to use mem-ref on config before I could use foreign-slot-value and finally mem-aptr
20:15:24
emaczen
I have: (cffi:mem-aptr (cffi:foreign-slot-value (cffi:mem-ref config) ..) ..) and what I don't understand is why I had to mem-ref when I had previously, foreign-alloced config and then passed it to the initializer
20:16:12
emaczen
(let ((config (cffi:foreign-alloc '(:struct libusb-config-descriptor)))) -- that's what I did
20:19:37
Bike
i thought you had like "struct libusb_config_descriptor* config; initialize(&config);"
20:23:40
Bike
Okay let's think about this for a moment. config, in C, is of type struct libusb_config_descriptor*. Then &config must be of type libusb_config_descriptor**.
20:24:59
Bike
I think you want like (let ((&config (cffi:foreign-alloc '(:pointer (:struct libusb-config-descriptor))))) ...)
20:29:55
Bike
The reason CFFI is conceptually difficult is that it deals with C programs without C's compiler restrictions, which is why all pointers are the same and such. But it still uses some c-like syntax. It can be confusing
20:31:49
Bike
In this situation - the alloc thing - "pointers are all the same" isn't actually so, though.
20:31:56
|3b|
ACTION isn't sure "without ... restrictions" is quite right, since actually keeping track of the types would be a nice feature for correctness :)
20:32:26
Bike
When you (foreign-alloc '(:struct libusb-config-descriptor)) it allocates however many bytes of memory that struct takes up. That could be, for instance, zero, though I assume it isn't
20:32:27
|3b|
problem is more that you can't stack-allocate C things and take address of them, so you can't translate c code directly
20:32:57
Bike
you then pass C a pointer to that memory, and the C program assumes that it can mess with as many bytes pointed to as there are in a pointer
20:33:48
|3b|
(well, maybe you can stack allocate them and take address of them, but you can't /not/ take the address of them and use them directly)
20:35:13
|3b|
would probably help with some of the above problems (assuming correct function definitions), if function wants ** and you pass it *, it could tell you :)
21:26:46
pjb
minion: memo for schweers: "IMPORTER:**;*.tar.gz" is not a logical pathname, because gz is not a valid version number.
21:53:44
pjb
comborico1611: you're asking specifically about evaltrace and stuff, but perhaps you would be interested in cl-stepper?
21:55:30
pjb
comborico1611: https://groups.google.com/forum/#!original/comp.lang.lisp/50k86A63WJA/hMu30bPh6OsJ
22:08:44
pjb
Yes, I'm sure my teachers was looking for something done with pencil and paper whe I wrote 10 for i=1 to 100 : print "I will not expose the ignorance of the faculty." : next i and used the tty instead.
22:10:49
pjb
Come to think of it, that must be the reason why bic stylos are sent by 5, when one bic is usually enough for the whole year… (and notice their convenient hexagonal section).
22:17:30
pjb
phoe: for the whole world, 2+2*2 has no ambiguity. Only those idiots of amercans can find an ambiguity there.
23:17:12
jcowan
Well, I suppose you can't force people to understand things, even if they have known all about them since age eight.
23:26:51
jmercouris
I have found an example of using the sbcl unix domain sockets: https://gist.github.com/205c1de56cb66de167c30271666c6975
3:02:20
dandruff
I've heard people say that macros wouldn't be possible with a static type system, but it looks like it might be possible with linear/unique types: https://github.com/fare/moll
3:12:33
sigjuice
what are the unusual looking filenames in quicklisp/dists/quicklisp/software/eazy-project-20180131-git/skeleton about?
3:16:02
sigjuice
I also stumbled across this thing on my computer a few months ago. ~/Library/Caches/$(CFBundleIdentifier)