freenode/lisp - IRC Chatlog
Search
14:31:59
uhrenmacher
Ok, hello people, just havin' two questions my knowledge in terms programming is limited to C, Java and some scripting langs. So I thtought about learning something like some Lisp dialect. What dialect do you recommend a newbie? 2. I have been using Vim for some time now, I am pretty used to it, is it worth it to go for Emacs, when coding in Lisp?
14:32:44
beach
uhrenmacher: This channel is dedicated to Common Lisp, so we will be biased in favor of Common Lisp.
14:34:46
uhrenmacher
>Java, bruh learned it when I was like 12 to h4xx0r in gaymes, using it for GUIs only nawadays
14:36:05
beach
uhrenmacher: See random-state.net/features-of-common-lisp.html for a list of features of Common Lisp.
14:39:20
cl-arthur
uhrenmacher: I used to use vim, now after enough lisp I use emacs (w/ SLIME). lisping with emacs/slime is far better an experience than the straight vim I used before. There's something SLIME-like for vim, but yeah go emacs.
14:39:47
beach
uhrenmacher: Most people here probably use SBCL. It is not just a compiler. It is an interactive system, just like any other Common Lisp implementation.
14:40:37
phoe
uhrenmacher: the interactivity of Lisp is a massive benefit over all non-interactive languages
14:41:07
phoe
one can, and should, inspect, debug, modify, converse with a living Lisp application without ever quitting it
14:41:34
Inline
it's just that interactivity i sometimes lack especially when doing oop related stuff
14:41:35
uhrenmacher
ah, yeah, that was something. Ok, this question is probably far to retarded, but...why can't I just write my code in a file, compile it and then execute it? Like just looked up some tuts on it, but couldn't find anything for this. Maybe I am to brainlet to see the advantages, idk
14:42:52
phoe
when your program doesn't work then it just crashes, which means that you don't get to debug it or inspect its data structures live
14:43:08
beach
shortername: You would create an executable only at the end of a long development cycle. We can discuss that in a few months.
14:43:39
phoe
Lisp can compile incrementally, which means very short feedback loops, where a newly compiled function is available inside your program in milliseconds rather than seconds and you can immediately play with it in the REPL
14:43:40
Inline
for redefining functions/macros it's ok i suppose, but really i have not found a good way to oop stuff yet
14:46:09
jackdaniel
removing methods from a generic functions is kind of awkward, maybe that's what he means
14:51:31
Xach
maybe i'd also like a nicer inspect-at-point type thing - something that knows if it's looking at a defgeneric, defun, defmethod form and inspects appropriately instead of requiring me to manually enter #'foo at the prompt
18:49:28
benjamindc
Does anyone know of a good tutorial the describes up-to-date best practices for Lisp project organization and build processes?
19:10:54
loli
is there any literature on how to write an image based system, akin to Common lisp or those forth/smalltalk systems?
19:15:28
phoe
the basic idea of the Roots of Lisp interpreter is the same idea that stands behind all image-based systems
19:15:38
dlowe
a lot of "scripting languages" are also image based systems, so I'm not sure why people acts it's so crazy when lisp does it
19:16:51
loli
can those systems save the current image, then resume on a ceratin function afterwords? I'm curious on how the format of that is, thanks for the suggestion
19:16:55
no-defun-allowed
They're just tedious to use interactively; I can't break into a REPL in a Python program too easily.
19:17:28
loli
well I'm curious if that kind of detail is noted anywhere, as when I searched for papers on the subject it came up baren
19:17:33
phoe
most Lisp implementations dump their in-memory data structures somewhere and then restore those when the image is reloaded
19:17:41
no-defun-allowed
And one does not have update-instance-for-redefined class, so one is limited in what they can change while live.
19:18:05
phoe
the simplest idea ever is to record all commands that were issued to the image from its start to its freezing and then replay them when the image is thawed
19:19:20
phoe
I mean, if in theory you do (defun foo () 42) (defun bar () (foo)) (dump-image "foo.image") then all that is required for the dumped image to become equivalent is to reexecute (defun foo () 42) (defun bar () (foo))
19:19:43
phoe
obviously this won't work in case of filesystem interaction or other side effects, but it's a simple idea that will work for toy interpreters
19:20:07
no-defun-allowed
Some Smalltalk implementations do that, and export a changelog pretty much like that one.
19:26:25
loli
I've made a fair few interpreters in my day, I guess the saving the memory to disk in a format that is very quick to reload is what alludes me
19:27:07
no-defun-allowed
I can't remember if they also dump an image now, but in some cases, they don't touch the filesystem at any other time.
19:29:22
phoe
https://github.com/phoe-trash/ccl/blob/0aa5b5d209f288ee04157c60624dea5f79787c16/xdump/faslenv.lisp
19:30:06
phoe
DEFINE-FASL-OPERATIONS contains a declarative list of all FASL commands permitted in a CCL FASL file
19:33:17
loli
thanks for the links, I'll spend some time studying them, and hopefully have a better idea how to make a nice image environment
19:35:05
no-defun-allowed
Wouldn't code have to be position-independent, or installable at an arbitrary location given to you?
19:37:58
phoe
but e.g. if all of your code is interpreted then your code is actually data, and dumping data is easier
19:39:22
phoe
then your compiled code needs to take this into account - code must be reloadable like this
19:47:53
benjamin`
oh i did come across that, but it hasn't been touched in 4 years, save for an edit to the README
19:57:30
phoe
e.g. https://github.com/rtoy/cmucl/commit/932884a4b406572614a9830bf864738a0c3a5700.patch has his mail
20:32:21
dbotton
Is there any document that describes the interaction between threads and condition handlers? dynamic variables?
20:34:23
no-defun-allowed
Those are usually implemented with dynamic variables, and dynamic variables are also thread-local. What phoe said.
20:34:46
Bike
i don't see condition handlers or other parts of the dynamic environment mentioned in bordeaux-threads's docs, at a glance
20:35:51
no-defun-allowed
You probably should use mailboxes for message passing (eg safe-queue provides those).
20:44:04
aeth
multithreading is still an underexplored frontier in most languages and CL is no exception (or is that "condition"?) here
20:44:56
phoe
well, in CL every thread has its own handlers since every thread has its own dynamic environment
20:45:11
phoe
passing condition objects around threads is possible since they're Lisp data like any other
20:45:29
phoe
it's just that stack information is not passable so easily because it's strictly thread-local unlike condition objects
20:50:41
dbotton
I wouldn't say most languages. The idea Bike is to say to have a thread block until receives a signal etc
20:51:17
aeth
dbotton: re "most"... by quantity, I wouldn't be surprised if most languages don't even have "real" (non-green) threads yet.
20:55:27
sm2n
dbotton, I don't really see what would stop you from writing your own scheduler that could do that though
20:58:42
dbotton
sm2n, I am actually thinking about copying some of the Ada concurrency abstractions as an exercise
20:58:57
_death
so, I've decided to archive the old Road to Lisp Survey submissions that were hosted on ALU wiki on github.. https://github.com/death/road-to-lisp hopefully none of those listed minds...
21:03:29
dbotton
aeth maybe I am missing it, but the use of non-green threads is going to be more of the implementation or os then the language
21:12:31
Bike
how's that? i googled up https://oberoncore.ru/_media/wiki/lang/reali_p.active_oberon_language_report.en.pdf but it's a different sense of the word
21:14:18
no-defun-allowed
There are "condition variables" which are synchronisation primitives, but not related to the condition system.
21:14:54
Bike
i mean, the wikipedia article does make it sound like lisp type conditions, but there's no detailed information
21:16:53
aeth
dbotton: most languages are single-implementation or single-dominant-implementation languages, so it's doubtful that they have something like bordeaux-threads if the dominant implementation doesn't have the need for it yet.
21:20:17
dbotton
at least tasks, protected types etc like Ada or perhaps something like the model of active oberon (I wish I could say have experience with it but do not but I like the idea)
22:17:13
sm2n
dbotton_, CL does have some high level concurrency abstractions, for example lparallel