freenode/#lisp - IRC Chatlog
Search
17:23:15
Spaceman77
I just want to tackle some impossible problems. Is Lisp an adequate language to tackle impossible problems?
17:24:06
pjb
Spaceman77: AFAIK, it's the only one. (well, perhaps ometa too, but I'm cheating here).
17:24:37
aeth
Spaceman77: What you get in Lisp is being able to trivially do anything at compile time that you can do at run time.
17:25:01
aeth
I would say "Well, within reason." but you can even get input in the user at compile time, but then you basically turn compile time into run time.
17:26:35
Spaceman77
Oh, this is curious. I've heard of this wacky stuff you can do with Lisp. Is it true that Lisp can interpret itself and change itself?
17:26:57
pjb
(defparameter *version* #.(progn (format *query-io* "What version are we compiling? ") (finish-output *query-io*) (read-line *query-io*)))
17:29:15
dlowe
Spaceman77: Well, it means that we don't have to have another language when we want to write code that operates on code
17:29:51
dim
Spaceman77: e.g. in pgloader I benefit from that by parsing the command language that the users give me into a lisp program, that I compile at run-time and then execute
17:30:19
dlowe
Spaceman77: the source code is made of nested lists. The text files that are parsed into nested lists are a convenience for humans.
17:30:33
|3b|
Spaceman77: are you familiar with c++ template metaprogramming? if so, imagine being able to use a sane programming language instead of template hacks
17:30:35
dim
if you've been doing some C/C++ before, imagine that the preprocessor would be in C/C++ rather than this #define pseudo-language
17:30:36
dlowe
Spaceman77: therefore, manipulating the soruce code programmatically is manipulating nested lists
17:34:30
Spaceman77
but "The Book" i keep stumbling upon whenever i see people discussing learning lisp is SICP
17:34:53
dim
Spaceman77: I think PAIP first chapter is a good start, and you can read it online at https://github.com/norvig/paip-lisp/blob/master/docs/chapter1.md
17:41:08
dlowe
yeah, but if you made an assembler, it's possible that even interpreted implementations would let you jump into it
17:45:25
Shinmera
anyway, for sbcl, consider https://www.pvk.ca/Blog/2014/03/15/sbcl-the-ultimate-assembly-code-breadboard/
17:45:49
Bike
putting assembly into different languages is kind of a pain. you know how gcc does it, right? this weird shit with strings and dependencies? not great
17:46:30
dlowe
it looks like https://github.com/sile/cl-asm will do x86 assembly and will execute it in an image with sbcl
17:46:37
AeroNotix
Kind of wish the VOP stuff was more documented with a few more examples/tutorials
17:47:50
pfdietz
You don't want it to (just) be documented, you want it to be specified and formally delivered, so it won't change out from under you.
17:48:41
Shinmera
anyhow, might be easier to just write the asm separately, compile to a shared object and then use cffi
17:49:04
AeroNotix
just would like to see how far it's possible to go within just CL itself rather than resorting to that
17:52:48
Shinmera
well, since you're adding a new operator to the compiler, it needs quite a bit of information to know how and when to use it.
17:53:16
_death
played with sb-assem a while ago.. https://gist.github.com/death/5ec259ef473b982898a3c5e36b21b1cd
17:54:59
Shinmera
I did some experiments with the ssa stuff but never took it beyond experiments https://github.com/Shinmera/3d-vectors/blob/master/ssa.lisp
17:57:02
_death
what does "ssa" mean? to me it flashes up as "single static assignment", but here it looks like "sse"
17:59:21
AeroNotix
https://www.pvk.ca/Blog/2014/08/16/how-to-define-new-intrinsics-in-sbcl/ <- useful
18:12:46
phoe
AeroNotix: https://www.pvk.ca/Blog/2014/03/15/sbcl-the-ultimate-assembly-code-breadboard/ <- same author, other interesting post