gr-base/README.org
2025-09-01 14:06:50 +07:00

240 lines
8.6 KiB
Org Mode

#+title: Grimu-R
*Grimu-R* is an open ecosystem and a framework for mixed visual-textual dataflow scripting.
It consists primarily of the following components:
- Interactive web-based *visual-textual* editor
- *Polyglot scripting* runtime environment
- Execution model allowing computations to be expressed as *reactive graphs*
* Goals
** Immediate feedback and composability
Grimu-R makes it easy to inject new processing steps, visualize intermediate results,
experiment and reuse previous work.
** Embeddable build targets
An interactive visual editor allows one to prototype, debug and run one-off jobs comfortably.
But the work can always be distilled into an executable artifact:
a CLI tool, an RPC server, or a web application, to be distributed as such or integrated into larger flows.
** Hassle-free reproducible builds
Powered by Nix, Grimu-R projects require minimal effort to build, run, or depend on.
For interactive use with scripts, the default mode is runtime dependency loading.
For builds, it is recommended to have dependencies defined statically and provisioned by Nix.
** Reactivity taken seriously
Push or pull? Throttle, debounce, batch?
Granular configuration lets you decide precisely how reactivity works in your dataflows,
giving you a way to manage backpressure, retries and failures.
** Malleability
End users of Grimu-R applications enjoy the same superpowers as their developers,
being able to inspect or modify the dataflow graph and its constituents using the same editor (with caveats).
** Unlimited extensibility
Unlike some similar products, Grimu-R doesn't stop at ingesting CSVs and calling HTTP endpoints.
Real code blocks in familiar languages are prioritized from day one, leveraging their own ecosystems.
** Powerful out-of-the-box toolkit
Get started without implementing your own components.
Low code to high code.
* Non-goals
Some things Grimu-R itself will not take care of, delegating them to the surrounding environment or just omitting:
- Resumable/durable execution
- Real-time collaborative editing
- Authentication and access control
- Telemetry
* Use cases
- Rapid prototyping of *data processing* pipelines
- *Self-hosted* workflow automation
- *Dashboards* with custom logic
- *Internal tooling* and automation scripts
- Hacker-friendly, highly *customizable* applications
* Positioning
Grimu-R aims to take the best without the worst from:
- Rigid, limited or proprietary visual programming environments
- Messy, brittle script bundles held together by spit and duct tape
- Opaque, obscure, perishable code notebooks
while being developer-first.
* Nomenclature
Grimu-R introduces some fanciful jargon to avoid the wrong technical connotations.
Below is a brief explanation for the key terms:
** Weave
A Grimu-R project's weave is what changes when someone is working on it ("weaving").
It's a persistent, Git-friendly representation of the dataflow graph and its graphic layout.
** Braid
Weaves are composed of braids, which serve the dual purpose of reusable modules and entry points.
An braid could correspond to an RPC method or a CLI subcommand in a build.
Braids can be nested within other braids, appearing as single nodes that encapsulate their internal graphs.
** Sigil
Sigils are the basic building blocks for braids.
A sigil is just a normal computer program that acts as:
- data source (e. g. a static CSV sheet)
- data sink (e. g. a POST endpoint)
- data transformer (e. g. grep)
Each sigil is based on a scroll and can contain a dynamic script ("inscription") stored in the weave.
** Scroll
Scrolls define a default configuration for sigils, as well as the runtime environment to run a sigil in.
They are developed outside of Grimu-R using standard development tooling and integrated with Nix.
** Inscription
Sigils based on interpreter scrolls (like Bash, Node.js) can have their inscriptions edited
directly in the visual editor, enabling live code changes without rebuilding the development environment.
There can be other kinds of inscriptions: templates, configurations, parameters, etc.
* How it works
** Development environment
Grimu-R projects being Nix flakes, the development tooling ("loom") is provisioned in a Nix shell.
It gives you the visual editor, the companion CLI tool and the execution context for sigils.
** Workflow
- The visual editor is served by a development or application server.
- Changes and execution requests for natively executed sigils are sent over a bidirectional WebSocket connection.
- User modifications are stored locally in the browser's storage, exportable as a file.
- Weaves are tracked by usual VCS tools.
** Cross-language connections
Think Unix pipes but with structured data formats like JSON lines instead of plain text.
** Execution environment
Purpose-specific scrolls used in a weave have their requirements defined in Nix terms.
For example, if several scrolls need Deno, they can all refer to the same deno Nix package defined in the flake's nixpkgs overlay and declare their Deno dependencies normally in deno.json.
A single copy of Deno runtime and a shared Deno cache would be bundled in a build.
However, the general-purpose Deno scroll executing arbitrary TypeScript inscriptions
would have Deno fetch dependencies during runtime.
* FAQ
** Is this a yet another web framework?
No, but it could be.
One framework called [[https://cycle.js.org/][Cycle.js]] defines a web application as a pure dataflow mapping that has sinks wired back to sources, proxied by drivers that handle side effects.
Grimu-R can do a similar thing if you want it to.
Or you could use any framework you like with the dataflow stuff being incidental.
** How does malleability work in client-server applications?
Unlike standalone builds executing entirely on the end user's machine,
client-server builds split the weave between runtime components.
Only the client-side part of the weave can be inspected and edited by
the end user.
** Can I opt out of Nix?
To some extent, yes.
While Grimu-R is built on top of Nix and wouldn't make a lot of sense otherwise,
you always have the option to access out-of-store files from your sigils,
at the cost of reproducibility.
So you could use e. g. runtime JS imports or call some executable on PATH from a shell script.
** How do I test my weave?
If you do it manually: right in the visual editor.
Add sigils with a constant output as test data sources and connect them to the sigils you want to test.
If you need automation: call the braids programmatically.
If you already have test data stored in the weave, you can extract it by the sigil's id using loom CLI or library.
** Can I integrate AI models?
There are three integration scenarios which would make sense:
1. AI sigils in the weave:
Sigils calling inference APIs, equipped with MCP sigils and
template sigils for prompt composition
2. AI weaving copilot:
Loom providing AI tools to edit the weave
3. MCP server builds:
Braids exposed as tools for external AI systems
#1 is easy to do even with no out-of-the-box support.
#2 and #3 would require some work on development tooling.
* Licensing
The Grimu-R platform components, including Loom development utilities and
the weave executor builders, are licensed under AGPL v3.
Base scrolls and other non-platform code are licensed under MIT.
** Repository Structure :noexport:
In this repository:
- Platform components are in the ~platform/~ directory
- Everything outside ~platform/~ falls under MIT or CC0 licensing
- Full license texts are in ~LICENCES/~
** Copyright and Contributions :noexport:
Copyright (C) 2025 Voleum
By contributing to this repository, you assign your copyright to Voleum under
the condition that your contribution will always remain available under the
original license terms specified above.
Alternative contribution arrangements may be available upon request.
** Compliance guide
Your options for licensing your work are restricted in the following scenarios:
1. You fork Loom or weave executor builders and distribute your fork.
2. You build a product extending the platform's or its fork's functionality
while incorporating their code.
3. Your weave or scrolls make use of third-party copyleft-licensed software.
This is independent of Grimu-R platform's licensing.
Note that AGPL terms apply even for SaaS solutions.
Loom being AGPL does not affect the licensing of weaves you develop using it.
Weave executors being AGPL means that your application using them has
to provide AGPL license notice and link to their source code repository;
your application's code, however, needs not be provided.