freenode/#lisp - IRC Chatlog
Search
10:26:59
puchacz
hi, in lparallel, https://github.com/lmj/lparallel/blob/master/src/kernel/stealing-scheduler.lisp, line 98, the function wakes up a worker only if there is a worker waiting
10:27:48
puchacz
using with-lock-predicate/wait which gets expanded to https://en.wikipedia.org/wiki/Double-checked_locking - so it checks if there is a worker waiting before acquiring a lock, and if there is, it grabs a lock and checks again
10:28:10
puchacz
is it actually correct? the first check may incorrectly show that there is no worker waiting
10:33:33
puchacz
there is a notify-count as well, updated only within a locked block, maybe it helps:) ?
11:11:33
beach
Just use do-all-symbols and check whether the symbol and `(setf ,the-symbol) are FBOUND.
13:06:50
jcowan
first because it is dynamic, and second because it is characterized by a global object space.
13:10:27
jcowan
I took it to be closely analogous to "Smalltalk image" or "Interlisp sysout"; that is, a static representation of a running process.
13:14:58
jcowan
On the second point, it is a very interesting formal characteristic and much wider than Lisp, the idea of a fully shared object space
13:15:13
Xach
a miracle tool that will make you better than all those averages (people of average intelligence who do not use lisp)
13:43:49
beach
People tend to associate "compilation" with batch processing where an executable file is created, and "interpretation" with interactive work.
13:46:05
beach
... and since most programmers seem to have very skimpy training when it comes to how programming languages are processed, they don't see other possibilities.
13:46:59
beach
It doesn't help that more widely used programming systems such a Python are both interactive and slow.
13:50:50
Odin-
It just seems odd, given that Lisp has had compilers since essentially the very start.
13:51:55
Xach
Personally speaking, I did not really understand what "compile" meant before encountering Common Lisp.
13:52:18
Xach
The DISASSEMBLE function helped me understand a little better that an interactive compiled thing was possible.
13:54:55
Odin-
Probably the same for me, though I remember reading a fair bit about how it isn't just one or the other in connection with Perl's processing model.
14:01:51
aeth
Mentioned in 1994 and fully outlined in 1998, so Common Lisp was already published by then.
14:03:55
aeth
This kind of thinking is implicit in the design of Unix, though... where you paired shell with C.
14:08:08
Odin-
And the ones that don't are treated as either curiosities (Lisp, Fortran) or silly things we've developed past (COBOL, BASIC). Funny that.
15:05:10
jcowan
The original Dartmouth Basic was a compiler; I think the idea that all REPL-ish development systems are interpreters was a result of the microcomputer bottleneck.
15:10:09
fitzsim
jcowan: last week you were asking about a HOWTO for Common Lisp scripting that minimizes boilerplate
15:11:05
fitzsim
jcowan: can you try out https://git.sr.ht/~fitzsim/cl-starter-script and see if it does what you want?
15:11:34
fitzsim
I happened to be working on it for fun, and seeing someone else wanting the same thing, I decided to publish it
15:12:59
fitzsim
I'm hoping you can paste the clone && run one-liner and it'll work for you, if you already have your operating system's SBCL or CLISP installed
15:15:27
srandon111
hello all, can somebody explain to me why by default lisp is case insensitive for functions ?
15:16:14
jcowan
srandon111: BECAUSE LISP GOES BACK TO THE TIME WHEN COMPUTERS OFTEN COULDN'T DO LOWER CASE.
15:16:15
beach
srandon111: And it has nothing to do with functions. It has to do with how the reader creates symbols.
15:17:03
jackdaniel
if you care about how symbols are printed, just (setf *print-case* :downcase) in the repl
15:18:07
jackdaniel
srandon111: i.e you could set the readtable case to :preserve, but that's not a good idea
15:18:23
beach
srandon111: And, as I often explain, it is usually pretty pointless to ask "why" Lisp is the way it is, because the explanation is often just historical.
15:18:52
jcowan
It's an extremely common performance error: our poor monkey brains don't seem to be good at how many negations there are in a sentence.
15:19:57
jcowan
In the end all explanations are historical, and it seemed to me that srandon111 was asking for one: "Why is this the default?"
15:21:14
phoe
"it used to work in the past, if it still works then it means that the folks who got this the first time reproduced well enough"
15:23:14
phoe
conscious evolution of software systems is a little bit better than blind evolution because we can actually anticipate meteors and program defensively around them
15:23:30
phoe
so if we're lucky our Lisp programs may survive longer than us in case of another cataclysmic event
15:24:49
jcowan
There's a tendency for people outside the CL community to look at the 1500+ pages of weirdness and think "Oh, this is a research system where everything and the kitchen sink was put in because why not."
15:25:32
jcowan
And then (being in the grip of Geek Explainer Syndrome) I have to explain that no, everything is there because it once served a severely practical purpose. Except the Roman numerals.
15:29:02
fitzsim
"nearly all implementations produce Roman numerals only for integers in the range 1 to 3999, inclusive."
15:35:17
fitzsim
oh, I was joking, but, https://stackoverflow.com/questions/45844555/how-to-print-roman-numerals-greater-than-3-999
15:40:53
jcowan
CIↃ isn't that great either, because the C is in modern style and the Ↄ is in archaic style.
15:41:21
ecraven
hm.. maybe it's time to go and look for another font, patching bitmap terminus for everything isn't fun any longer, even if it is the best font I've found... are there outline fonts that are as crisp as proper bitmap fonts on normal dpi displays?
15:48:40
TMA
(the pattern is even more prevalent... V is half od X; all told, the roman numerals consist of letters IVXLΨDΦ or more commonly IVXLCDM)
15:49:00
Nilby
It's nice that (= (+ ೧೨೩೪ ५६७८) (+ 1234 5678)) , but a little sad that (+ ⅠⅡⅢⅣ 5678) doesn't work.
15:49:56
jcowan
In general, Unicode distinguishes between digits and decimal digits, and place-value arithmetic only works on the decimal digits.
15:54:26
jcowan
Traditional Tamil numbers used the "3 100 4 10 5" pattern, but later a proper zero was added.
16:32:19
matryoshka
jcowan: lisp images are not just a dump of the environment table and the state of running processes to disk?
16:32:36
matryoshka
where/how did you find out about this? I've been trying to figure out the workings of lisp images for a while.
16:36:04
beach
matryoshka: I think jcowan is saying that by "Lisp image" it is often meant the live execution environment when the Common Lisp system is running.
16:37:15
phoe
then what do we call the "frozen" form of the image, created via things like save-lisp-and-die?
16:38:03
beach
matryoshka: Though, if you have any questions about how a running Common Lisp system works, please do not hesitate to ask.
16:39:09
phoe
the docstring for uiop:dump-image says, "Dump an image of the current Lisp environment at pathname FILENAME, with various options."
16:39:37
phoe
Rainer states at https://stackoverflow.com/questions/480083/what-is-a-lisp-image that an image is usually a file which is a memory dump of a Lisp system
16:40:10
fitzsim
cl-launch uses the term "dumped image" and tries to support many Common Lisp implementations
16:41:30
jcowan
That is not, however, necessarily the correct definition in contexts other than the CLHS.
16:43:18
Odin-
I'm fairly sure I've seen references in modern documentation to "loading a system into the image" in the "an image is a live thing" sense.
16:43:19
phoe
so I'd say that around #lisp, an image, depending on context, can mean either the complete live state of a running Lisp system or its file-dumped form that can be restored back into a live Lisp system
16:44:02
phoe
and whenever clarification is needed, "live image" and "dumped image" work well I guess
16:44:07
jcowan
When I loosely used the term "raise an exception" instead of "signal a condition" the other day, you (correctly but somewhat pedantically) corrected me. That got me to wondering: definitely "signal" is better than "raise" in the Lisp context, but I am not sure that the divergence between "condition (object)" and "exception (object)" carries any special meaning.
16:44:08
Odin-
The thing is, the _obvious_ thing to do is to consider a file that can be loaded to (more or less) restore a given image to effectively _be_ that image...
16:44:44
Odin-
jcowan: I think in that case the issue is that Common Lisp doesn't have anything it calls exceptions.
16:46:06
phoe
signaling a CL condition winds the stack further, raising/throwing an exception usually unwinds the stack
16:47:00
Odin-
jcowan: True, but the fact that it doesn't immediately unwind it is the difference in question....
16:48:08
beach
phoe: My point is that you made up the difference and named it. I like it, but you did make it up. We do that all the time. Be proud of it.
16:49:37
Odin-
beach: I get where you're coming from, but I also get why someone wouldn't think of it as having invented something.
16:50:15
jcowan
Scheme has exactly the the same resumption semantics as CL, but uses "exception handler" vs. "condition object".
16:55:25
Bike
does scheme use continuations to resume? i mean, if there's an error, and the handler resumes to somewhere, does that unwind and rewind the stack in a way dynamic-wind deals with?
16:58:05
phoe
yes, that's one thing - it's not standard C++ though, it's a Windows sort of extension
17:10:42
phoe
if you execute a function named FOO then you reach the actual code through the symbol FOO
17:11:34
phoe
so if you modify the place that the symbol FOO points you to, bam, you have just redefined that code for all pieces of code that reach that code through the symbol FOO
17:16:38
phoe
make yourself a hash table from strings to structs, ensure that one of those struct fields is a function pointer, replace it via standard assignment of struct fields
17:18:28
phoe
as long as all callers go through this struct indirection, you can atomically replace function pointers for all of your system
17:20:07
phoe
if you only need functions then sure; I was thinking of structs that have things like variable/function/class bindings and such
17:23:07
MrtnDk[m]
I have been considering what it would take to implement a really basic Lisp-like thing in C.
17:25:32
jackdaniel
you'll see lisp-in-c, lisp in less than 200 lines of c, learn c - build your own lisp yada yada ,)
17:27:07
phadthai
and of course https://en.wikipedia.org/wiki/Kyoto_Common_Lisp and derivatives are C implementations (including ECL)
17:44:04
Odin-
The more interesting question, in my view, is whether you can build a useful Lisp system on some of the more constrained systems that are in use nowadays.
17:49:42
ecraven
mfiano: just tried that with antialias=false, it's atrocious ;) like all non-bitmap fonts
18:31:13
White_Flame
when RAM is measured in KB, the footprint of just the CL symbols can be challenging
18:38:28
_death
Odin-: I played with ulisp a month ago or so (on an m5stickc), but indeed it's a bit limited (no compilation/macros).. I think something like a vm running clisp's bytecode or a subset of it could be nice