Live data from Hacker News

Ask HN: Import Common Lisp Code into Parenscript

news.ycombinator.com

1–6 of 6 posts

Ask HN: Import Common Lisp Code into Parenscript

#1
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

Re: Ask HN: Import Common Lisp Code into Parenscript

#2
Most 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?

Re: Ask HN: Import Common Lisp Code into Parenscript

#3
post #2

Most 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 h…

Noted. I wasn't too sure.. thanks!

Re: Ask HN: Import Common Lisp Code into Parenscript

#5
post #4

There'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

I'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-pare...

Re: Ask HN: Import Common Lisp Code into Parenscript

#6
post #4

There'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

I'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-pare...

Cool. 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.