freenode/#lisp - IRC Chatlog
Search
4:01:50
pjb
(defun eval (expr) (funcall (coerce `(lambda () ,expr) 'function))) is a valid CL:EVAL implementation.
4:02:27
pjb
Notice it doesn't imply compilation. Coercing to the type function doesn't imply anything about interpretation or compilation.
4:03:08
pjb
(defun eval (expr) (funcall (compile nil `(lambda () ,expr)))) is another implementation that explicitely invokes the compiler.
4:31:08
aeth
_death: Ime, for technical subjects Wikipedia is good at explaining things, but bad at teaching things. It's okay to read the article on Foo if you already learned about Foo from somewhere else.
4:31:35
PuercoPop
oi, I'm having trouble writing to an unix socket. I've disabled buffering and send finish-output jic. Am I missing something else? https://gist.github.com/PuercoPop/709ac450430cc7097d50d4c02554d304
4:46:00
fiddlerwoaroof
What's the best way to get bindings for a C library? wrapping the types with the groveler than manually writing bindings for the functions?
4:57:07
beach
Or you can write a Common Lisp version of the library that would then benefit the entire Common Lisp community.
5:09:03
fiddlerwoaroof
My goal is to figure out the objective-c runtime well enough that I can fix the beagle backend for clim
5:11:01
beach
whoman: Is that a new discussion topic, or is it somehow related to what fiddlerwoaroof is doing?
7:00:09
White_Flame
I've used the cons cell for the purpose. It tends not to be just the smallest in memory footprint, but in code too
7:02:54
shka
beach: i need to track ownership for shared objects, owner can mutate his object, rest has to copy, i figured that i can stick gensym into box and then add this box to every object. Finalizer of owner will set content of box to nil to indicate that ownership can be taken by any other object.
7:09:46
shka
beach: anyway, it is not that complicated, and all it boils down is to side effect containment. Combined with lazy approach it gives optimized functional containers.
7:11:42
shka
beach: if you are interested in this: http://hypirion.com/musings/understanding-clojure-transients
7:13:27
shka
(that is: it does not prevent code from working, but it is a little bit pointless at certain point)
9:27:33
codesine
What’s a good book or single point of entry for Common Lisp programming especially from a math background
9:29:26
minion
codesine: 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).
9:29:43
beach
codesine: Common Lisp is not considered a particularly function language in that sense.
9:30:07
beach
codesine: So you are going to have a hard time finding a book that does functional programming only in Common Lisp.
9:32:13
beach
"functional programming only" as opposed to "both functional, imperative, and object-oriented programming"
9:33:21
beach
codesine: I should have said: Common Lisp is not considered a particularly functionAL language in that sense.
9:34:37
beach
codesine: Well, since this channel is dedicated to Common Lisp, the opinions here are biased.
9:35:47
beach
codesine: Functional programming is one of the paradigms that Common Lisp supports, but I think it will be hard to find a book that uses Common Lisp and that is all or even mostly about functional programming.
9:38:39
beach
codesine: One important use of functional programming in Common Lisp is in macro expanders, because you typically don't want macro expanders to have side effects. Therefore, a book like On Lisp mostly uses functional programming, but it is a very special use case for that style.
9:41:17
beach
Scheme is also not particularly functional, but maybe Scheme books emphasize that style more often.
9:44:58
Zhivago
I think it's more that recursion looks more functional than iteration, to people who don't realize that iteration is recursion.
9:55:49
Shinmera
It's somewhat convenient for getting a simple app running "directly" on every major OS
10:02:32
_death
it's useful in helping (read "practically forcing") people think about representations that may not be immediately obvious
10:15:38
whoman
C is close to the ... von neu? wait.. asm? x86? way of doing things. close to how the machine works, more so with our current machines than lisp afaik
10:24:45
p_l
VM is just a catch-all for the environment specified to be used by language so you have simple replicated target to write your applications against
10:25:21
whoman
or could i say, the unoptimized disasm of C more closely resembles the machines instructions than for Lisp ?
10:27:43
p_l
nope. unoptimized output of C also tends to not look very modern, though compilers kinda cheat there by not implementing truly unoptimized form in output
10:28:39
whoman
yea ? cuz that part is a bit of an obstacle for me with lisp as i grew up with C, but i really dont see how lisp is any different, if i grew up on that instead
10:30:22
p_l
C gives an illusion of being very low level, but I think it hasn't been true since it left PDP-11
10:31:45
p_l
_death: I know one person who trolled C programmers with standard-compliant C-in-Perl implementation
10:33:06
beach
So in fact, for applications, C is inconvenient, and for "system programming", you have to write nonconforming code to do what you want.
10:33:22
p_l
yeah, also known as "UB" and "compiler is allowed to do anything, including murdering your pet goat, upon encountering that line"
10:35:03
p_l
It's low level in the sense of making you worry about irrelevant (to application you're writing) concerns
10:37:15
p_l
for popular definition of "systems programming", the code is pretty much always full of non-conforming bits, or at least "uses a VM implemented in nonconforming code" as runtime
10:41:09
_death
I think C, Forth, and assembly are prime candidates for an embedded program.. of course, you could use Lisp to generate the code ;)
10:44:32
p_l
_death: assembly doesn't count, since it's essentially an intermediate form of a program generated by something else
10:46:22
p_l
that's not assembly then, just programming the way before assemblers gave us useful intermediate
10:47:39
p_l
I mean that assembler, in its typical form, doesn't count as essentially an intermediate for talking native language of the chip
10:48:28
p_l
hell, PDP-10 bootstrap was handled by handwriting opcodes into registers then swapping them with memory
10:49:20
p_l
_death: and arguably every lisp compiler that generates native code does something like that, though they sometimes happen to not show it directly
10:50:23
_death
p_l: yep.. the other day I pasted https://gist.github.com/death/5ec259ef473b982898a3c5e36b21b1cd
10:56:34
_death
p_l: I also found Kragen Sitaker's urscheme implementation, which generates assembly text, to be very neat.. http://canonical.org/~kragen/sw/urscheme/compiler.scm.html
11:05:34
beach
Shinmera: Yes, it's an independent repository: https://github.com/robert-strandh/Cluster
11:06:54
p_l
btw, does anyone know a single place where I could read about R. Scott McIntyre's CL libs?
15:49:17
jmercouris
Is it more expensive to pass around a large list as an arugment instead of a boolean? or is the cost the same?