Super cool that you got something working inside of a notebook!
Though it would be super cool to add more languages in, it’ll be a pretty gradual process. Unlike most other notebooks, Observable is very semantic - a lot of the magic is how a mixture of static analysis and a smart runtime can simplify programming. We wouldn’t want to, say, add ClojureScript support but require you to manually re-evaluate cljs cells - we’d want cross-language evaluation to be at least reasonably reactive, in the way that evaluation is currently reactive.
Of course no shade on ClojureScript (I’ve built a few things with Clojure and mightily enjoyed it), but the focus for now is on making an exceptional environment, and then on potentially cross-language capabilities.
I suppose you can always try the tagged template approach, but then the other language is more like a pre-processor (edit: just noticed that this is exactly how the ClojureScript works in linked notebook at the start (waarom is Kees eigenlijk een topper, @jeroenvandijk?))
Take a look in the ganja.js topic for more ideas:
Also, you just inspired me to try embedding the Walt compiler in the Observable notebook, seems to work pretty well!
very nice notebook! to make it work on a retina screen, you might want to use context = DOM.context2d(width, height, 1) or adapt all the canvas.onmouse* (otherwise it paints only the top-left quarter of the screen).
Yes they have the correct size, but you can see they’re using “non retina pixels”.
But as you’re making the images with a matrix and putImageData(), I don’t think you want to have to think about devicePixelRatio.
That is cool! I’m also working on adding support for another language to Observable. It would be very nice if there were an extensible way to e.g. syntax-highlight the code inside a cljs or html or svg block.
It would also be incredibly cool if it were possible to make ”cljs cells” the default cell type, which would mean pre-populating the text of any new cell with the template literal and placing the cursor in between the backticks.
6 years later now, I’m going to bump this thread which goes to the heart of my ongoing struggle with Observable. Although I’m always delighted by what I ultimately achieve with Observable, the actual process of working with JS is so joyless for me (I recognize this is mere opinion) that I dread every return to the platform. I really ought to be working on a notebook now, but I can’t even.
I’m noticing some work by @shadoof (2023) using ‘Literate CoffeeScript‘. Would anyone else be aware of ongoing progress in this or any similar (anything-but-JS) direction?
TY for sharing this new development. “Seamless integration of [LLMs]” is a deal-killer tho. For me, programming isn’t some nuisance to be passed off to a statistical parrot, but an opportunity to reflect deeply on my problem. This is why I so desperately want an elegant language to express myself in.
Seeing how completely ‘AI’ has engulfed the spirit in which Observable evolves now, I feel I’ve arrived as a liberating juncture where I must start over, and retool from the ground up. I’ve noted Pluto.jl with some interest, and certainly appreciate the humanistic spirit in which it is developed; its deliberately narrowed scope (education) might however limit its applicability e.g. to general front-end dev (my main concern at this time).
I had clicked thru the 1st link, stating “Notebook Kit is available as part of Notebooks 2.0 Technology Preview,” and there found:
Our goals for a next-generation notebook editor are:
Seamlessly integrate AI to boost creativity, learning, and productivity
Streamline editing for a clean look and feel, focused on coding
Notebooks are the perfect environment for coding with AI. The instant feedback you get with reactive coding, the lightweight composability and flexibility of cells, the ability to inspect and tinker to understand what the code is doing, the infinite variety of importable open-source libraries at your fingertips — notebooks enable AI to perform as a more effective teacher and muse, inviting you to collaborate with it, rather than treating it as a black box code generator.
Eventually, this new editor and AI will be coming to the web, giving you the same great authoring experience for notebooks …
From this, I gather that Observable and I are moving in different directions, with different underlying commitments to programming craft, and that any effort I might make to hang on would be a temporizing measure at best that only postpones the inevitable.
This is all too bad, since I loved the declarative nature of d3, and it was an endless source of wonder and delight!