Readit News logoReadit News
Posted by u/nightcraft 6 months ago
Show HN: Scripton – Python IDE with built-in realtime visualizationsscripton.dev...
Hey HN, Scripton (https://scripton.dev) is a Python IDE built for fast, interactive visualizations and exploratory programming — without the constraints of notebooks.

Why another Python IDE? Scripton hopes to fill a gap in the Python development ecosystem by being an IDE that:

1. Focuses on easy, fast, and interactive visualizations (and exposes rich JS plotting libraries like Observable Plot and Plotly directly to Python) 2. Provides a tightly integrated REPL for rapid prototyping and exploration 3. Is script-centric (as opposed to, say, notebook-style)

A historical detour for why these 3 features: Not so long ago (ok, well, maybe over a decade ago...), the go-to environment for many researchers in scientific fields would have been something like MATLAB. Generating multiple simultaneous visualizations (potentially dynamic) directly from your scripts, rapidly prototyping in the REPL, all without giving up on writing regular scripts. Over time, many switched over to Python but there wasn't an equivalent environment offering similar capabilities. IPython/Jupyter notebooks eventually became the de facto replacement. And while notebooks are great for many things (indeed, it wasn't uncommon for folks to switch between MATLAB and Mathematica Notebooks), they do make certain trade-offs that prevent them from being a full substitute.

Inner workings:

- Implemented in C++ (IDE <-> Python IPC), Python, TypeScript (UI), WGSL (WebGPU-based visualizations)

- While the editor component is based off Monaco, the IDE is not a vscode fork and was written from scratch. Happy to chat about the trade-offs if anyone's interested

- Uses a custom Python debugger written from scratch (which enables features like visualizing intermediate outputs while paused in the debugger)

Scripton's under active development (currently only available for macOS but Linux and Windows support is planned). Would love for you to try it out and share your thoughts! Since this is HN, I’m also happy to chat about its internals.

zipy124 · 6 months ago
Fantastic product and props to the creator on it! Though Mac only and a subscription price of this magnitude for an IDE is a hard sell, given the availability of other options, which aren't neccesarily $20 a month worse. Never the less I'll keep my eye on this project.
kaboomshebang · 6 months ago
What happens when I would stop my subscription? The scripton lib is open source and the lyra orion plot functions can output image files without refactoring? (Or do I have to reactivate my subscription?) (Congrats on your product launch btw :)
roger_ · 6 months ago
This looks incredible, but I’m not a fan of the subscription pricing.

How about a hobbyist rate at least?

erichocean · 6 months ago
If you want this in Clojure, check out Clerk. [0]

As a bonus, you can continue to use whatever IDE you already use.

[0] https://github.com/nextjournal/clerk

upghost · 6 months ago
well, I didn't know I could use clerk with my IDE. Thanks for pointing that out!
gcanyon · 6 months ago
This looks really nice! I currently use LiveCode (which isn't Python-based) for my daily "I have a bunch of data I'm looking to filter/transform/clean up" tasks. I'm always on the lookout for a similar tool, which for me means:

   1. Text inputs (table/spreadsheet inputs?)
   2. Text outputs
   3. Buttons
   4. Menus
   5. Sliders
   6. Checkboxes/radio buttons
And bonus points for:

   7. bundle it up and give it to someone else to run
I think out of that list you have 2, 3, and 5? https://docs.scripton.dev/api/interact/user-interfaces/widge...

Any chance you'll push further into the build-a-UI-to-muck-with-data realm?

nightcraft · 6 months ago
Thanks!

That's correct: 2, 3, and 5 are currently available. This initial set was intended as a minimal (albeit limited) set that demonstrates the UI capabilities. More widgets/controls (including the ones you've mentioned) are definitely coming.

7 is something I've considered (along the lines of a redistributable "Scripton runtime" that packages up the scripts and bundles a portable Python distribution). However, that's currently much further down on the todo list.

gcanyon · 6 months ago
That is exciting news. I will check out Scripton in greater depth, and with the right set of interface widgets I would be in the heart of your target market.
KeplerBoy · 6 months ago
Can it visualize PyTorch Tensors without an additional memory copy? I.e. mapping it directly to a texture which is then displayed?

I know this is not much of a concern on a system with unified memory (all recent apple computers).

nightcraft · 6 months ago
Not yet. Some internal prototypes did try using IOSurfaces on macOS to go with the zero copy route, but there were a fair number of limitations.

That said, the IPC minimizes copies and is actually fairly efficient at handling large numerical arrays.

Maelcum · 6 months ago
As far as I'm concerned, the subscription model is an instant showstopper, just like web-based UIs.
for_i_in_range · 6 months ago
This reminds me of Light Table from a decade ago: https://news.ycombinator.com/item?id=3836978