Live data from Hacker News

Show HN: Scripton – Python IDE with built-in realtime visualizations

scripton.dev

1–10 of 154 posts

Show HN: Scripton – Python IDE with built-in realtime visualizations

#1
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.

Show HN: Scripton – Python IDE with built-in realtime visualizations
scripton.dev

Re: Show HN: Scripton – Python IDE with built-in realtime visualizations

#2
This looks beautiful, I don't do data viz in Python so I don't have a use for this. I do mostly web dev in Python, but wow it looks amazing!

I'm really surprised (and almost not) to hear the UI is in TypeScript, did you use a specific web framework like React by chance? The UI looks really nice to me.

Re: Show HN: Scripton – Python IDE with built-in realtime visualizations

#6

This looks beautiful, I don't do data viz in Python so I don't have a use for this. I do mostly web dev in Python, but wow it looks amazing! I'm really surprised (and almost not) to hear the UI is in TypeScript, did you use a specific web framework like React by chance? The UI looks really nice to me.

Thanks!

The initial prototype did use React, but the overhead in certain cases soon became an issue. It got replaced by a custom virtual dom implementation (coincidentally quite similar to Atom's Etch), but debugging complex updates remained an issue. Eventually, it ended up in a place quite similar to vscode: no frameworks and a handful of "core components" (eg: a virtualized list view)

Re: Show HN: Scripton – Python IDE with built-in realtime visualizations

#8

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).

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.

Re: Show HN: Scripton – Python IDE with built-in realtime visualizations

#10

How does Observable Plot work here? Do you translate the code to JavaScript?

The scripton Python library internally transforms many common Python data formats (regular arrays and dicts, numpy arrays, data frames, ...) to an intermediate format. These are transferred to the IDE when you call the plotting functions, and then auto-translated into the JS equivalent.

Your Python plotting code ends up looking like this: https://docs.scripton.dev/api/plot/orion/overview

Post reply on HN