freenode/#lisp - IRC Chatlog
Search
2:55:40
White_Flame
if you just C-c C-c an expression, instead of C-c C-k'ing the entire file, it might not have actually run the in-package. I've hit that on simple files
2:59:07
White_Flame
it's weird not to load the full contents of a package before loading another one, though
3:13:10
White_Flame
restarting fixes a lot, but doesn't always tell you where the problem is, especially if it's dynamically munged
13:31:23
huonib
does anyone know of a compiled, dynamic language that doesn't use a garbage collector? I think an academic one might exist, but I am not sure
13:31:41
huonib
I am unsure if being dynamic requires a garbage collector... and I cannot find anything making that claim online
13:35:43
jackdaniel
put in your init (ext::disable-gc) and there you go, common lisp doesn't use the garbage collector ;-)
13:36:29
Krystof
I seem to recall stories about Lisp Machines needing to be power-cycled because they really really believed in tenure
13:37:04
Xach
I recently learned that Allegro has an operation "panify" to ensure that certain objects never grow old
13:40:39
jcowan
huonib: GC is what you do to the heap, and Forth has no heap, only two stacks. (Which at that is better than Fortran II, which has neither heap nor stack.)
13:44:00
phantomics
Here's a question, not sure if this is completely off the wall ridiculous or not: how practical would it be to create a dialect or DSL within CL that runs code without GC? Meaning inside the code written in this DSL, you would have to manually manage memory and there would be functions for that
13:44:40
Bike
it would be difficult for objects in a managed space to refer to objects in an unmanaged space and vice versa. though it's possible. i mean, most implementations can handle foreign pointers.
13:45:19
Bike
but if an object in unmanaged space has a pointer to an object in managed space, and the collector tries to move things, problems will happen
13:45:59
phantomics
Yeah, if CFFI is possible I'd think something like this should be, I don't know if CLs have any functions that let you turn off GC for objects created within a particular block of code
13:49:09
Nilby
phantomics: When heavily using a C FFI objects you have to somewhat restrict yourself to such a dialect. Thank goodness for with- macros. There are also some foreign calls which necessitate turning off GC in some implementations.
13:52:34
Shinmera
And that's not even a joke. Allocate things once in a block, then manually recycle the objects. Presto, no GC.
13:53:11
Shinmera
You don't need a DSL or whatever for that, just a lot of restraint and a lot of annoying manual recycling, just when you manually malloc/free.
13:54:12
Bike
it might be nice if the compiler could help by flagging function calls that allocate, though.
13:54:53
Shinmera
But not even a DSL can help with that (you can't know what's going to allocate without help from the compiler)
13:57:40
Shinmera
One trick I've been making use of in Kandria recently is, since I know some things are going to run single-threaded, but I cannot stack-allocate certain complex objects, I can instead use load-time-value to create a local instance that'll be re-used. Certainly less handy and more dangerous than stack allocation, but it does the trick.
13:58:17
Bike
there have been a couple times when i've been like "i know, i'll do the l-t-v trick" and then remembered other threads exist. very sad
13:58:56
mfiano
Shinmera: Interesting. Can you link to one part of your code that does that? I'd like to see it in context.
13:59:49
phoe
what is the issue with l-t-v in a multithreaded context? race conditions, or also something else?
14:00:16
Shinmera
if two threads access the same function at the same time they'll use the same instance and thrash it
14:00:22
semz
Nilby, I recall something like that as well, but iirc it had a supremely ungoogleable name like CL- or something...
14:00:47
Shinmera
mfiano: https://gitea.tymoon.eu/shinmera/kandria/src/branch/master/toolkit.lisp#L335 and tvec/tv+ things.
14:01:32
Shinmera
mfiano: For hit I know the object is not going to escape or be cached, so I can avoid allocating more than one instance.
14:02:16
Shinmera
I could potentially stack-allocate the vecs, but as 3d-vectors is set up it can't do that most of the time.
14:03:34
mfiano
AH I have recently start stack-allocating some vectors in my collision detection codes, and some lexical variables cannot be stack allocated because they call c2mop:s-i-a or something. Was trying to figure out what I could do about it
14:05:41
mfiano
But I did make it more manageable. I had a OBB struct with like 20 slots, mostly all for mutating temp variables. It was a mess lol. Now there's only 5, with 2 of them being an unfortunate temp variable
14:10:27
semz
Turns out I was thinking of CL_1 as defined by CLICC, but that does seem to have a GC, so probably a different project.
14:15:33
beach
I define "dynamic language" as one with semantics defined by a suite of interactions.
14:29:10
phoe
convert your string into a byte array, append the string's length to it, convert the result into an integer
14:32:22
phoe
my UX instincts are telling me that modes should provide some sort of taskbar-like icon that can then be displayed, but that's orthogonal to your issue
14:33:07
phoe
that's not really a #lisp question I think :D you can try to use the first letter of the mode, or something
14:33:22
jmercouris
well it is a #lisp question in the sense that I want to go from string -> unique glyph