I have a few questions - Is this inspired/based on the Blender node editor package?
Some stylistic choices look very much taken from there, even if some other details (eg font) look much more primitive
- If itâs not based on that, why?
Blander has an Excellent Python-based cross-platform ui which is completely open source. Iâve always thought itâs a crying shame thatâs not available as a package to build desktop apps. And I think it would be very good to take things from there, like their very mature graph editor
That last point is _very_ interesting.
Blender was my first thought here, too.
A while ago, I was asked to write a plugin for Blender since I really liked the program. I looked into it but realized that it was a python-only situation and I really just can't stand coding like that, so I passed on it. But if I could get the python ecosystem without having to code like that - that's a really interesting prospect!
Never looked in to its package size, as far as UI goes, but that does sound like something that could be interesting! I do wonder how different it is from imgui, but there could be something there!
Animation nodes plugin for blender did wonders for understanding blender bedfore it was basically consumed by the core team by Jacques Locke
It looks like ComfyUI, which is blowing up in the creative space.
I can see some advantages of this kind of editor for specific contexts, like if youâre building a shader, this UI forces you to be purely functional without explicitly teaching purely functional concepts.
But it seems like thereâs also a general feeling that this is easier than learning how to code, and I guess my question is⌠is it? Is this really a better idea than a simple to use API with a DSL (or just a simple language like Go or Lua). Is it just less intimidating to beginners?
You still have to learn the concepts and rules of the system, in addition to figuring out cable management. It seems to make documenting your âcodeâ a lot harder. And now with AI assistants, youâre giving up even more by not working with text.
I've got 2 decades of professional programming experience under my belt and I still think node graph editors are grand. I regularly use VFXGraph / Shadergraph / Custom nodegraph editors for various gamedev things (e.g. dialog trees, checkpoint graphs, all sorts of things)
I'm very defensive of my "repl latency". By that I mean, how much effort/time does it take for me to see the results of my change in action? Every node editor that's found its way into my workflow brings that latency down to real time.
They provide much more information so much faster about every change you're making as you're making it. It's like a causality scope. If the widget you're tuning/iterating on benefits from that, they're a joy.
Isnât that, again, specifically a benefit of being purely functional?
To me, the way inputs and outputs are presented in nodegraph editors adds value on top of the benefits functional programming provides. You see the cascade of every change in real time. Change parameters and see every stage's new inputs and outputs as they're transformed.
If I added Logger.Log calls to show as much info, my console would be a blur. I wouldn't be able to click on a parameter in my log and change its value and see what the consequences were.
You can change values at a breakpoint, but that's a single moment in time. If your code's running at 60hz, breakpoints can feel like trying to solve a where's waldo through an electron microscope.
I have not came across any workflow in my IDEs that is as flexible and informative for the situations where nodegraph editors shine. If something comes to mind for you, I'd love to know about it.
There's no theoretical reason a text editor couldn't be made to show the same cross section of key information though. TempleOS is kind of like that lol.
Itâs somewhere between excel and traditional source trees. It isnât a bad idea, but the tooling isnât there for general purpose work.
Great work, I love node based uis! I'm still looking for an isolated minmal python package that soly does the backend part of these graph node frameworks like comfy, n8n, or node-red. I.e loading json & serialziing, executing nodes. Which also includes the various ways of processing nodes. Like topology sort, node executing queues. If you all know something lmk!
Say more. Are you wanting âNode-RED but for Pythonâ? Or the non-UI parts that are accessible programmatically?
Iâve had similar interests and realized I essentially needed two things:
1. Something like âFastAPI without the HTTP partsâ. Basically a request/response cycle with middleware functionality, where we run a registered Python callable in response to a JSON request, but where that JSON request can be from any source, like âpulled from a queueâ or read from the command line, instead of âpushed from a web browserâ. For that I essentially pieced together a basic task registration decorator class with pydanticâs `validate_call` decorator and let pydantic handle the serialization/deserialization. There are libraries like FastAPI, typer, Celery and others that do this, but theyâre all tightly coupled with specific transports. I want to be able to delegate to a developer âbuild a function that takes this JSON and performs this task and returns JSONâ, but not with HTTP (FastAPI), and I donât want to be required to add Redis to run some small task (Celery), and I do want the task to be callable by CLI (typer), but not only CLI. It seems like there are all of these tools but none of them are loosely coupled enough to do this in a straightforward way.
2. Some way to run a directed acyclic graph (DAG) of those registered tasks. There are lots of tools that do this in varying degrees of heaviness (Airflow, Luigi, Dagster, etc), but for a lightweight solution this is built into Python with graphlibâs TopologicalSorter. But the point here would be, whichever one of these you pick, it helps to have #1 available in a way that allows for generic ârunning approved Python functions from JSONâ.
So I sort of have those parts of it roughed out, but now Iâd also like a better UI for it, for instance to allow for a more high level dashboard red/yellow/green status of things, or to enable a less technical user to adjust the schedule of a registered task, and so on. Djangoâs admin portal is a first step her but ultimately weâd need something more interactive to make it a team effort where more employees can contribute without needing to know Python.
NodeRED has a very simple json format to describe flows - basically an array of objects with each object describing a node and its connection.
If there were to be a commonality of formats between various node-based programming environments then an interchange between backends and frontends would be possible.
I was thinking of creating a python interpreter for node red flows but stopped at things such as jsonata support and mustache template engine.
NodeRED does make much use of its underlying NodeJS roots.
FTA: âFor instance, this is all you need to turn numpy.save() into a node:
from numpy import save
main_callable = save
third_party_import_text = 'from numpy import save'
âSo, if you want to turn multiple Numpy methods into nodes, youâll have to copy-paste-edit this?
Looks unergonomic and slow (repeatedly parsing the Numpy file, once for each node to create) to me.
I would think a single file
from numpy import save,foo,bar,baz
should be enough to more efficiently generate four versions of the above.What do I overlook?
At a guess, the implementation detail/difficulty of making multiple nodes from a single declaration.
You could use a script to automate creating the modules from import specs.
A good way to not only eliminate syntax errors (given the minimal typing), but also greatly reduce type errors (although from a glance I don't see mention of type-hint checks to ensure incompatible sockets aren't connectable). It bothers me that I see nothing about async support, nor reusing a graph as a node in another graph (after all, it's all function compositions). Maybe I'll try it, but I don't like to think of the hoops I may have to jump through to work around limitations.
the customizable node source code is neat
Very nice! It might be able to run on the browser with pygame-wasm/pybag
That's pretty cool. Not something I'd use for serious work, but a fun little toy nonetheless.
Get a daily email with the the top stories from Hacker News. No spam, unsubscribe at any time.