-
-
Notifications
You must be signed in to change notification settings - Fork 403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Analysis of how we use and run parenscript
#2505
Comments
I don't agree! We need:
Which represents another vision: the vision of fuzing Lisp and JS, as a desire to add a nice syntax and data model to an otherwise unescapably dominant JavaScript. |
Oh, and we also need a way to generically interact with our interfaces, for those renderers that we might need to support and that don't have JS (#2433 is probably a better place for this point). |
How does that differ from |
It assigns it to a certain globally accessible name and abstracts away the details (as any function does), for one :)
I haven't :P |
I believe you haven't understood my points. We're conflating two different things: generating JS, and evaluating it. I'll draft a PR soon. |
I've understood your points, and I'm answering to those: we need to conflate those, exactly because we can't put JS in a can and ignore it until we require it. We need to dynamically interop with JS, in all its grotesque ubiquity. |
Firstly, an overview.
There are always 2 steps:
ps:ps
and others);ffi-buffer-evaluate-javascript
orffi-buffer-evaluate-javascript-async
).Unfortunately, the macros from
renderer-script.lisp
conflate both. There should be a single macro to handle step 2 (peval
, which should be renamed tops-eval
btw).Regarding the former, we could just use regular CL functions defined with
defun
. Example:But, arguably, it is confusing to define functions that output valid JS code as a string with
defun
. Perhaps it should be defined withdefps
. The computer doesn't care, humans do.defps
would simply be:(There's also
ps:ps*
, another method to compile to JS).Notice that once JS functions are evaluated (step 2) they will belong to the JS environment and they can be referenced with
(ps:ps (add 4))
("add(4);"
). Still, we can't control the way the renderer garbage collects the environment (I assume).Actions:
peval
tops-eval
pflet
define-parenscript
defps
The text was updated successfully, but these errors were encountered: