just realized it might not be hard to dump a scittle image as JS via squint, maybe with tree shaking, all in the browser
@alandipert certainly possible
oh wait, with squint?
well, as an option, recognizing not full compat
I guess bootstrapped cljs would be better, if that's still a thing
yeah, #cherry (same as squint but uses the CLJS stdlib) has more chances of being compatible with CLJS code as is, although I'm trying hard to make #squint as compatible within reason the problem is the dependencies that are compiled along with scittle
Those are already js though right? So at a minimum they could be prepended
but one could make a similar thing as scittle but with cherry and then the idea would 100% work https://github.com/squint-cljs/cherry/blob/main/doc/embed.md
Thx
true, but those deps are optimized for scittle, you can't just mix and match modules that were advanced compiled
Yep makes sense
you can "eject" a single js file just from scittle stuff only as well. it's just less optimal, but it still works
I've done a similar thing for #nbb which is SCI based]
Zooming out the vision here that I've had in mind for a few years is a maximally flexible but slow/big lisp environment ...but that lets you build up an image Which you can layer optimization and delivery stuff onto, in the target environment (browser)
In retrospect I feel gclosure advanced and things like it are in opposition to the vision (impose closed world requirements earlier than necessary, produce object files that can't be linked easily)
yep. cherry and squint are open world with a shared stdlib (clojure.core if you will) such that you can actually share your libraries on npm with others. advanced compilation only happens in applications, never with libs
Glad you've been building it all while I've just been thinking about it 😄
hehe, probably not there yet though
What are your thoughts on wasm (+ GC extensions) subsuming this all in relative near future?
take this example, a pinball game in squint: https://squint-cljs.github.io/squint/?src=https://gist.githubusercontent.com/borkdude/ca3af924dc2526f00361f28dcf5d0bfb/raw/09cd9e17bf0d6fa3655d0e7cbf2c878e19cb894f/pinball.cljs You can see the generated JS in the right pane. It wouldn't be hard to produce a single .js file from this and take it with you elsewhere
I guess in that world sci would just run wasm and you could keep the scittle API?
I haven't been looking at WASM that much
Fair enough. I have only because it's the end run on browser Common Lisps. Better fit for them because CL only runs standard with things JS can't do efficiently (jumps, ints)
I remember that you presented something at EuroLisp (or what was the title of the conf) about a Common Lisp in the browser, right?
Is that still a thing?
It still exists, yes 😄
I went with a compiler first tho and it wasn't snappy enough to give me the scittl-like dev setup I wanted, so I lost some steam
But my favorite CL (ECL) now runs via emscripten in wasm, so I might be able to get away with just driving that via script tags
They're also working on a compiler overhaul to support wasm target. So I'm enthusiastic anew about browser CL prospects
yeah that's pretty cool
Just saw about scittle "eject", sounds like that dumps deps + scripts + interpreter?
where did you see this?
AFAIK I haven't made it yet but yes, that's how I would do it currently (nbb bundle does the same thing)
Above, "you can "eject" a single js file just from scittle stuff only as well. it's just less optimal, but it still works" perhaps I misunderstood
yes, you could theoretically do this
append the modules you're using + your script(s) in some string variables and then call scittle.core.eval_string on those in order
ok cool, makes sense, thanks
I guess you could put all that in the html and "download webpage" could work
I guess you could also come up with a different "eject" which creates a zip file for you with a proper CLJS project
yeah could also work
So many things ✨