4 ms·
Ask HN: Import Common Lisp Code into Parenscript
I have trouble understanding what parenscript does and not does.
Am I "out on Mars" in the Lisp world with parenscript or can I also make use of other Common Lisp Code easily like trivia etc? What are people actually doing with parenscript, develop everything themselves from "the ground up"?
Thanks
- remexre 6y agoMost Lisp libraries won't automatically work with Parenscript -- think of Parenscript as just being more Lisp-like syntax for JS, rather than a compile from Lisp to JS. It's quite useful if you want to dynamically generate JS, or wish JS had macros, but it won't give you trivia for free. Hopefully some day there'll be a production-quality Lisp implementation that runs in WebAssembly... Though, I wonder if you could hack together ECL and emscripten?
- tresilience 6y agoNoted. I wasn't too sure.. thanks!
- jinwoo68 6y agoThere's JSCL [1], an implementation of Common Lisp in JS. It's not a full implementation but you would be able to use some CL libraries, I guess. [1] https://github.com/jscl-project/jscl https://github.com/jscl-project/jscl
- tresilience 6y agoI'll have a look. There is also (ps:import-macros-from-lisp 'rutils:aif) in Parenscript which lets one import macros from CL. https://40ants.com/lisp-project-of-the-day/2020/05/0071-parenscript.html https://40ants.com/lisp-project-of-the-day/2020/05/0071-pare...
- jinwoo68 6y agoCool. But I wouldn't expect import-macros-from-lisp to work with many existing CL macros. Parenscript is quite mechanical in its transpiling to JS.