6 ms·
pretty hard to enable lisp without eval or garbage collection
by jhpriestley 7y ago
pretty hard to enable lisp without eval or garbage collection
- TomMarius 7y agoYou might find these interesting: - https://github.com/WebAssembly/gc https://github.com/WebAssembly/gc - https://github.com/WebAssembly/reference-types https://github.com/WebAssembly/reference-types - https://github.com/WebAssembly/funclets https://github.com/WebAssembly/funclets As for the eval thing, you surely can compile and execute code on the fly. Such features would be enabled by the aforementioned proposals, but should be possible today as well (through shared memory).
- jhpriestley 7y agoyou mean you can compile code into a separate module, right? Which could then access the original module only via marshaled calls through the javascript layer? I guess anything can be compiled into anything but I wouldn't prefer to target lisp to such an environment.
- TomMarius 7y agoYes, what you are saying, but that can be optimized very well after the proposals come through.
- pjmlp 7y agoMy Intel CPU also doesn't have garbage collection or eval opcodes and yet it runs Lisp...
- jhpriestley 7y agoyour intel CPU allows you to iterate through the stack and jump to a location in the heap though (as long as you don't mark the page NX). These features are used by most gc and jit implementations respectively. wasm requires all functions to be specified at module creation time and gives no access to the stack.
- pjmlp 7y agoThere are plenty of GC algorithms to chose from, and several examples how to implement them in WebAssembly already. https://github.com/appcypher/awesome-wasm-langs/blob/master/README.md https://github.com/appcypher/awesome-wasm-langs/blob/master/... No need to get everything served on a plate.
- monocasa 7y agoThose have suboptimal GC implementations because of the lack of primitives to do better. Some just straight up use reference counting and leak anything with circular references.
- pjmlp 7y agoSo what? Yes some have buggy implementations, others could do better, yet they exist. I rather have a half working bicycle that takes me to town than none at all.
- monocasa 7y agoWhat is a "half working bicycle that takes me to town". Like by definition it fulfills it purpose. A garbage collector that breaks down on circular references is crazy town for real work. Like there's even AI Lab Koan about that specifically. http://catb.org/jargon/html/koans.html http://catb.org/jargon/html/koans.html A better example would be a bicycle without the front wheel. Yeah, if you're real good and real careful you can probably treat it as a unicycle and get to where you're going, but you'd be real pissed if someone sold it to you as a working bicycle, no?
- pjmlp 7y agoNot all GC enabled languages that currently target WebAssembly are buggy as you make it to be. PNaCL also did not have direct GC support, yet it got released with working OCaml support.