This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-11-27
Channels
- # announcements (4)
- # beginners (41)
- # biff (8)
- # cider (14)
- # clj-kondo (5)
- # clojure (45)
- # clojure-brasil (1)
- # clojure-europe (20)
- # clojure-nl (1)
- # clojure-norway (30)
- # clojure-uk (10)
- # clojurescript (8)
- # cursive (25)
- # datomic (20)
- # emacs (11)
- # events (1)
- # hoplon (9)
- # humbleui (7)
- # hyperfiddle (6)
- # lsp (63)
- # matrix (1)
- # observability (20)
- # off-topic (36)
- # polylith (11)
- # re-frame (2)
- # releases (1)
- # rewrite-clj (6)
- # scittle (42)
- # sql (6)
- # squint (86)
- # tools-deps (9)
just realized it might not be hard to dump a scittle image as JS via squint, maybe with tree shaking, all in the browser
@U04VC31U8 certainly possible
well, as an option, recognizing not full compat
I guess bootstrapped cljs would be better, if that's still a thing
yeah, #C03QZH5PG6M (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 #C03U8L2NXNC 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
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
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 😄
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?
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?
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
Just saw about scittle "eject", sounds like that dumps deps + scripts + interpreter?
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
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
So many things ✨