freenode/#clasp - IRC Chatlog
Search
15:55:22
drmeister
Hello - I wasn't able to work on compiler issues this weekend. I'm tied up in application land.
15:59:31
drmeister
What I wanted to do was either 1. set things up again so that clasp's serial and parallel compilers both dump llvm-ir and clasp can load it directly; or 2. figure out how to generate library files (dylib or faso) from llvm-ir files.
17:04:40
karlosz
Bike: you can try inserting reverse or something in the list implementation in an attempt to get a "bad order"
17:36:30
karlosz
but theres like a miniscule chance its a problem with the hash table implementaiton
18:11:08
karlosz
i solved that by fixpointing the algorithm so you'd get deterministic results from that
18:11:52
karlosz
i bet there's a similar issue lurking somewhere where the order in which we operate on functions over a module is important
18:19:50
judson_
ok dumb question - I thought any llvm IR could be turned into wasm? or are certain things not allowed
18:20:34
Bike
https://webassembly.org/roadmap/ as you can see, exception handling, simd, tail calls, and atomics/threads are all merely proposals
18:21:24
Bike
this also doesn't cover llvm intrinsics we might use. i don't know if things like llvm.frameaddress are implemented
18:22:57
Bike
also, practically speaking, even if wasm did have all the components, you'd end up with a gigabyte sized web page
18:23:50
phoe
I'll be giving a presentation of control flow in Lisp for the WASM people at the end of this month
18:25:06
Bike
i am one of the world's foremost experts in implementing lisp conditions in terms of C++ exceptions
18:25:16
Bike
the other expert is drmeister, and nobody else even knows what the hell we're on about
18:26:32
Bike
i'm not seeing The Problem with shuffled lists. it does segfault sometimes, though. that's super
18:28:52
phoe
Bike: my talk will be exactly about not needing to implement non-local jumps with throws
18:30:07
Bike
phoe: we non local jumps with C++ exceptions. maybe that's more or less what you mean by throws? anyway, it's horrible and i'm happy to rant at you
18:32:59
Bike
C++ implementations sometimes provide a setjmp/longjmp implementation of exceptions, which is more or less handler-case in terms of return-from, but nobody uses it
18:33:41
Bike
llvm doesn't provide any primitives for nonlocal exits other than the handler-case thing and setjmp/longjump :(
18:34:44
Bike
not sure what you mean by respect unwinds. it does allow nonlocal control transfers, but there's no unwind-protect
18:36:37
Bike
well, not as such, no. libunwind lets you implement setjmp/longjmp, more like. lets you do stuff like manipulate stack frames as data structures
18:37:09
Bike
learning how to implement unwind-protect has been interesting. it's rather more involved than merely exiting
20:22:17
princesspancake
hello. i'm making a CL binding for a game engine by using ECL. i recently heard about clasp and i wanted to know how embeding a shared library would work with it but i failed to find any documentation. do you have any info or a link toward some docs ?
20:22:53
princesspancake
(by embedding a shared library, i mean creating a shared library form CL source code, and use it in a c/c++ program)
22:15:55
drmeister
Reading. Hi princesspancake - ok thinking about creating a shared library from CL source code. Can you do this with ECL? How do you deal with garbage collection?
22:54:34
princesspancake
drmeister: garbage collecting works as usual. foreign datatypes aren't GC'd so there is no issue
22:55:35
princesspancake
in ECL i can do `(asdf:make-build :package-name :type :shared-library)` and i get a .so file
22:56:32
princesspancake
and since it's for a game engine i want as little as possible overhead for interfacing C <> CL
22:57:38
princesspancake
in those i just do `cl_boot(); ecl_init_module(NULL, module_init_function); ecl_funcall(1, ecl_make_symbol("entry-point", "mypackage"));` and the control is given to the CL code
22:58:36
princesspancake
even if it has ways to add C declarations and inline C code, it has issues regarding FFI types handling
22:59:27
princesspancake
if you want i can upload my project to github/gitlab and show you the source if you want to see how it's done
22:59:49
drmeister
The C <> CL interfacing is much easier in Clasp I believe. But could we talk about this a bit more? I'm trying to wrap my head around how we would turn Clasp into a library.
23:00:36
princesspancake
is there some runtime features that can only be in the clasp .so and not embeded directly in the output dll ?
23:01:53
drmeister
I'm not sure. Clasp supports two garbage collectors. When I was sorting out how to deal with the two of them I came up with an approach that is kind of troublesome to put into a library. I'm not sure though.
23:03:27
drmeister
Hmm, the syntax is a little out of date - but it's close enough to get the idea across.
23:03:44
drmeister
https://github.com/clasp-developers/demo-clasp-cxx-interoperation/blob/master/hello-world/hello-world-cxx.cc#L56
23:04:19
drmeister
https://github.com/clasp-developers/demo-clasp-cxx-interoperation/blob/master/hello-world/hello-world-cxx.cc#L7