libera/#commonlisp - IRC Chatlog
Search
9:18:38
mfiano
The initform for clearp is quoted, unlike the others. The input in the beginning of the book obviously intends for this to be evaluated and is not quoted
9:19:29
mfiano
I guess we are looking at different books. I am referring to the result of the call: (display-defclass* 'color-rectangle)
9:21:15
mfiano
I'm unsure if the example code is wrong, or just the return value transcription has a typo
9:26:42
mfiano
Which leaves either the wrong slot-definition-initform function/glue macro, or a typo in the return value of the book
9:28:34
mfiano
I'm trying to study this book in detail, and I don't mind which one it is, but would be very nice to be aware of which :)
10:34:08
pjb
Guest92: have you had a look at http://informatimago.com/~pjb/files/lisp/common-lisp/flet-or-labels.png
11:03:15
Mrtn[m]
Did @mayuresh:libera.chat leave #commonlisp:libera.chat ? Autocomplete doesn't seem to catch his profile ID. I thought I had some advice to perse, that I am not sure was mentioned. I am mostly agreeing with what was said already though, so it's not a "Biggie". Ah, perse quit already because of 268 seconds of ping timeout. Oh well.
11:03:57
mfiano
pjb: They are not here, and their account is not registered (it is a randomly selected guest nick)
11:17:26
Mrtn[m]
Is an effort being made to pick up the regulars, that was lost in transit to Libera?
13:55:28
beach
The book is about CLOS programming, and there are some chapters containing examples that are close to finished. For instance one chapter that describes Cluffer, more or less.
13:59:09
beach
Thanks. But my favorite coauthor kind of abandoned me, so most book projects are stalled. Then phoe was going to help me with one of them, but he got very busy with projects for Apress.
14:07:50
didi
I wonder if there is a builtin form for the idiom (let ((var (make-var))) (mutate-var var) ... var), i.e., create an object, mutate it, and return it.
14:09:46
mfiano
How would something built-in know how to create something, whatever semantics is intended by that?
14:10:54
didi
mfiano: No no, I want something like (prog1 (setf var (make-var)) (mutate-var var) ...).
14:13:07
_death
there is no "built-in" operator for that stylistic misstep.. probably a close one is anaphora:aprog1, but then you have two stylistic missteps
16:09:03
beach
I think phoe tried to convince the WASM people that Common Lisp needed control instruction and not exceptions. I don't know how that went.
16:19:49
jeosol
I have a question for those running some kind of "release engineering" workflow. I am looking to move some code and test on the cloud. I am thinking of having methodology to test and push code that can be automated as possible. code is in a huge mono-repo if that matters
16:22:56
jeosol
@beach: Thanks to you and other here for useful pointers over the last several months (years perhaps), my project is stable now and I can do tests on my machine. Much stable now. I don't do any optimization on CL side for now because the bottle neck is in a different external call
16:24:49
aeth
CL rarely needs optimization other than using something with better big-O than linked lists. Computers are fast.
16:26:46
jeosol
I also like the stability - I can run the application now for weeks. Each run taking up to 4 weeks - no issues at all. I am also not using a lot of conditions at this time - if I get a bad input, I just give it a bad score (objective function)
16:28:06
jeosol
Obviously backward compatibility - I update SBCL monthly and I rarely get any issues (except ironclad related one some versions back)
17:01:26
copec
beach: Yeah, I read the old discussions. It seems like if the wasm people were more on board to supporting higher language features it could become the runtime environment to rule them all
17:03:17
aeth
but the web has an issue and it's that its security model (justifiably) can't support next-gen graphics APIs like Vulkan because those are too low-level
17:05:26
aeth
There are probably some other things you don't want to let a web browser do that you do want to let native apps do
17:07:16
copec
The trend with operating systems has been towards to settle on a single system with api to control virtualization extensions that software uses. With GPU's supporting SRV-IO I'm hoping some standard will evolve that parallels that
17:50:59
beach
copec: The thing is, any system of conditions or exceptions can be implemented with the suggested control structures. The other way around is way more difficult as the Clasp developers can tell you from implementing unwinding with C++ exceptions.
18:02:27
Bike
but yes, i can say authoritatively that implementing lisp control structures through C++ exceptions is frustrating on every level
18:10:51
jcowan
I guess that's the downside of deep integration, where there is no single FFI point of control where you could catch a C++ exception and fire a Lisp one.
18:12:15
Bike
yeah, if you want to be able to interleave frames from both languages C++ pretty much forces you to play by its rules
18:12:41
Bike
the itanium exception ABI everyone uses nominally works with different languages, even ones with different models, but it's a lie
18:16:59
jcowan
Well, it probably works with everything except Lisp (broadly considered, including Dylan)
18:19:14
Bike
i'm not sure about that. non-C++ exceptions are kind of second class citizens. doing stuff like trying to rethrow them from a handler can cause the C++ runtime to give up and terminate
18:21:17
Bike
http://ix.io/3yRX i wrote a quick gloss of what implementing return-from with exceptions looks like. it's not great
18:21:48
Bike
c++ won't let you write return-or-control-error, since if throw doesn't find a handler it terminates
18:26:13
Bike
i think windows SEH is a little less dumb? at least it has finally blocks, which are sort of annoying to emulate
18:32:13
Bike
although i recall some complaints that the details of continuations within dynamic-wind are ambiguous
18:53:45
jcowan
In addition, there is a mysterious discrepancy between Scheme and CL exception handlers: a Scheme handler exits when the exception is handled, and reraises when it needs to pass the buck.
18:55:05
Bike
oh, you mean like if the handler function just returns further handlers aren't called?
18:56:16
jcowan
Right, and what the handler returns is what raise-continuably gets. If you call raise instead, it will immediately raise another exception.
18:57:22
jcowan
So it's more like Java etc., although it does not rewind the stack unless an explicit non-local jump is done (which is implicit with guard, the analog of handler-case)
19:23:42
copec
(Forgive the hopeful/ignorant questions) Bike: Could clasp be bootstrapped all under the wasm? Do the C++ exception semantics get mapped to Wasm, so that the work you've done in clasp would carry?
19:30:06
Bike
c++ exceptions are basically slow by design (as they are in practice implemented), so, yeah
19:31:24
shka
Bike: maybe you are bored and want to explain how c++ exceptions implementation is different from exceptions in lisp?
19:33:16
Bike
lisp implementations usually cons a bit on the stack to indicate the presence of exit points and cleanup blocks to the unwinder
19:34:00
Bike
C++ implementations instead record information about exit points and cleanup blocks in the executable file
19:35:00
Bike
the good part of that is that it means no consing whatsoever. the bad part is that getting that information becomes orders of magnitude slower
19:35:35
Bike
it's "zero-cost exception handling", yeah. i don't know if that's conceived relative to C or anything
19:36:28
shka
iirc the running gag in C++ community is that C++ exceptions are 0 cost, unless you actually want to use it
19:36:46
White_Flame
I always balk at that description. The handling is very expensive. It's when exceptions aren't fired/handled that it's zero cost
19:38:27
Bike
it even screws up parallelism, since the unwinder might have to walk loaded shared objects to find the code, and that's lock protected
19:39:47
Bike
or "throw less exceptions", which is pretty much what we're doing, because we can't make C++ faster
19:40:00
jcowan
Given that most actual problems in C++ code don't throw exceptions but are just UB, there is a point to that.
19:40:27
Bike
we have it set up to use setjmp/longjmp instead which we can, which works much faster, but probably isn't supported by wasm
19:41:14
White_Flame
every C++ project always has an exact subset of the language that they agree to use
19:41:17
jcowan
Also, it is false that exceptions are zero-cost, because every one of them bloats your code, which squeezes more out of cache
19:41:47
White_Flame
It's almost architecturally impossible to actually use all of C++ in one codebase
19:43:20
Bike
jcowan: yeah, that's true. we haven't really noticed since we do actually use exceptions and that's so much worse :/
19:43:59
shka
C++ with all the templates stuff can become really, really, really good example of code bloat anyway
19:44:42
lotuseater
or not just shooting easily in the foot like with C but instead rip of the whole leg at once
19:55:59
copec
Bike: It seems like it would have almost been easier to make a binary translator for Dr Meister to suck his C++ libraries into a CL image rather then to suck CL into C++
19:58:25
copec
I come from an aspect of someone who has used dtrace fairly often and has the debug symbols
19:59:17
copec
and then I see stuff like high level emulation binary translation for video games, and wonder if you could parse and translate a binary library into a usable lisp library
20:00:25
shka
but the thing is, C++ libraries currently in use really need that code generation templates offer
20:02:49
Bike
so they work normally with slot-value and stuff, but you can also sling them at C++ functions expecting the superclass
20:07:30
Bike
how do i feel about it? well, i'm hoping to soup up the compiler, mainly. nothing directly c++ related
20:09:53
yitzi
As a user of clasp the performance has improved dramatically over the last year and half. But as Bike said there are certain things you have to be careful about like signals.
20:12:19
copec
I'd love to see clasp tied into unreal engine for all sorts of direct parametric generation fun
20:18:50
yitzi
drmeister uses ngl via ngl-clj generally for 3d. ngl-clj is a lisp widget for ngl (3d molecules) that I wrote for juyter lab.
21:16:30
jcowan
One reason langs with a C FFI rarely have a C++ FFI are header-only libs (there are many others, from overloading to exceptions themselves