gr-base/README.org

294 lines
9.9 KiB
Org Mode
Raw Normal View History

2025-08-01 06:41:00 +00:00
:PROPERTIES:
:ID: 55a85682-80d7-41fe-ab55-d3afe9abbc38
:END:
2025-08-01 10:35:46 +00:00
#+OPTIONS: toc:nil
2025-08-01 11:05:42 +00:00
#+BEGIN_EXPORT html
<style>
body {
font-family: 'Courier New', Courier, monospace;
background-color: ivory;
2025-08-01 15:48:56 +00:00
line-height: 1.5;
padding-right: 1em;
}
h2 {
margin-top: 1.8rem;
padding-left: 0.5rem;
border-left: 4px solid #3498db;
}
table {
width: 100%;
}
#content {
max-width: 48em;
2025-08-01 11:05:42 +00:00
}
.outline-2 div {
2025-08-01 15:48:56 +00:00
padding-left: 1em;
2025-08-01 11:05:42 +00:00
}
2025-08-01 11:20:17 +00:00
2025-08-01 15:48:56 +00:00
a:link {
color: #2E5EAA;
text-decoration: none;
}
a:visited {
color: #663399;
}
a:hover {
color: #1a4480;
text-decoration: underline;
}
2025-08-01 11:05:42 +00:00
</style>
#+END_EXPORT
#+title: Grimu-R
2025-08-01 10:35:46 +00:00
Grimu-R is an *open ecosystem* and a framework for mixed visual-textual *dataflow* scripting.
2025-08-01 06:41:00 +00:00
It consists primarily of the following components:
2025-08-01 10:35:46 +00:00
- Execution model allowing computations to be expressed as *reactive graphs*
- *Polyglot scripting* runtime environment
2025-08-04 12:37:53 +07:00
- Interactive web-based *visual-textual* editor
2025-08-01 10:35:46 +00:00
#+TOC: headlines 2
2025-08-01 11:08:28 +00:00
* Table of Contents :TOC_2_gh:noexport:
2025-08-01 06:41:00 +00:00
- [[#inspiration][Inspiration]]
- [[#goals][Goals]]
- [[#immediate-feedback-and-composability][Immediate feedback and composability]]
2025-08-01 15:48:56 +00:00
- [[#embeddable-build-targets][Embeddable build targets]]
2025-08-01 06:41:00 +00:00
- [[#hassle-free-reproducible-builds][Hassle-free reproducible builds]]
- [[#reactivity-taken-seriously][Reactivity taken seriously]]
- [[#malleability][Malleability]]
- [[#unlimited-extensibility][Unlimited extensibility]]
- [[#powerful-out-of-the-box-toolkit][Powerful out-of-the-box toolkit]]
- [[#non-goals][Non-goals]]
- [[#use-cases][Use cases]]
- [[#positioning][Positioning]]
- [[#nomenclature][Nomenclature]]
- [[#weave][Weave]]
- [[#ornament][Ornament]]
- [[#spell][Spell]]
- [[#scroll][Scroll]]
- [[#inscription][Inscription]]
- [[#how-it-works][How it works]]
- [[#development-environment][Development environment]]
- [[#workflow][Workflow]]
- [[#cross-language-connections][Cross-language connections]]
- [[#execution-environment][Execution environment]]
- [[#features][Features]]
- [[#faq][FAQ]]
- [[#is-this-a-yet-another-web-framework][Is this a yet another web framework?]]
2025-08-04 12:37:53 +07:00
- [[#how-does-malleability-work-in-client-server-applications][How does malleability work in client-server applications?]]
2025-08-01 06:41:00 +00:00
- [[#can-i-opt-out-of-nix][Can I opt out of Nix?]]
- [[#how-do-i-test-my-weave][How do I test my weave?]]
2025-08-04 12:37:53 +07:00
- [[#can-i-integrate-ai-models][Can I integrate AI models?]]
2025-08-01 06:41:00 +00:00
* Inspiration
- [[https://github.com/enso-org/enso][Enso]]
- [[https://unit.software][Unit]]
- [[https://jupyter.org/][Jupyter Notebooks]]
- [[https://observablehq.com/][Observable]]
* Goals
** Immediate feedback and composability
Grimu-R makes it easy to inject new processing steps, visualize intermediate results,
experiment and reuse previous work.
2025-08-01 15:48:56 +00:00
** Embeddable build targets
2025-08-01 06:41:00 +00:00
2025-08-01 15:48:56 +00:00
An interactive visual editor allows one to prototype, debug and run one-off jobs comfortably.
2025-07-30 17:11:09 +00:00
2025-08-01 15:48:56 +00:00
But the work can always be distilled into an executable artifact:
2025-08-01 06:41:00 +00:00
a CLI tool, an RPC server, or a web application, to be distributed as such or integrated into larger workflows.
** Hassle-free reproducible builds
Powered by Nix, Grimu-R projects require minimal effort to build, run, or depend on.
2025-08-01 06:41:00 +00:00
2025-08-04 12:37:53 +07:00
For interactive use with scripts, the default mode is runtime dependencies.
For builds, it is recommended to have dependencies defined statically and provisioned by Nix.
2025-08-01 06:41:00 +00:00
** 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
2025-07-30 17:11:09 +00:00
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.
2025-08-01 06:41:00 +00:00
** Powerful out-of-the-box toolkit
2025-08-01 15:48:56 +00:00
Get started without implementing your own components.
No code to low code to high code.
2025-08-01 06:41:00 +00:00
* Non-goals
Some things Grimu-R itself will not take care of, delegating them to the surrounding environment:
2025-08-01 06:41:00 +00:00
- Resumable/durable execution
2025-08-04 12:37:53 +07:00
- Distributed deployment orchestration
- Collaborative editing
- Authentication and access control
2025-07-30 17:11:09 +00:00
- Telemetry
2025-08-01 06:41:00 +00:00
* Use cases
- Rapid prototyping of data processing pipelines
- Self-hosted workflow automation
2025-07-30 17:11:09 +00:00
- Dashboards with custom logic
- Internal tooling and automation scripts
2025-07-30 17:11:09 +00:00
- Hacker-friendly, highly customizable applications
2025-08-01 06:41:00 +00:00
* Positioning
2025-07-30 17:11:09 +00:00
Grimu-R aims to take the best without the worst from:
2025-08-01 06:41:00 +00:00
- Rigid, limited or proprietary visual programming environments
- Messy, brittle script bundles held together by spit and duct tape
- Opaque, obscure, perishable code notebooks
2025-08-01 15:48:56 +00:00
while being developer-first.
2025-08-01 06:41:00 +00:00
* Nomenclature
Grimu-R introduces some fanciful jargon to avoid the wrong technical connotations.
2025-07-30 17:11:09 +00:00
2025-08-01 06:41:00 +00:00
Below is a brief explanation for the key terms:
2025-07-30 17:11:09 +00:00
2025-08-01 06:41:00 +00:00
** Weave
2025-07-30 17:11:09 +00:00
2025-08-01 06:41:00 +00:00
A Grimu-R project's weave is what changes when someone is working on it ("weaving").
It's a persistent representation of the dataflow graph and its graphic layout.
** Ornament
Weaves are composed of ornaments, which serve the dual purpose of reusable modules and entry points.
An ornament would correspond to an RPC method or a CLI subcommand.
Ornaments can be nested within other ornaments, appearing as single nodes that encapsulate their internal graphs.
** Spell
Spells are the basic building blocks for ornaments.
A spell 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 spell is based on a scroll and can contain a dynamic script ("inscription") stored in the weave.
** Scroll
Scrolls define a default configuration for spells, as well as the runtime environment to run a spell in.
2025-07-30 17:11:09 +00:00
2025-08-01 06:41:00 +00:00
They are developed outside of Grimu-R using standard development tooling.
2025-07-30 17:11:09 +00:00
2025-08-01 06:41:00 +00:00
** Inscription
2025-07-30 17:11:09 +00:00
2025-08-01 06:41:00 +00:00
Spells 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.
* How it works
** Development environment
2025-08-04 12:37:53 +07:00
Grimu-R projects being Nix flakes, the development tooling ("loom") is provisioned in a Nix shell.
2025-08-01 06:41:00 +00:00
2025-08-01 15:48:56 +00:00
It gives you the visual editor, the companion CLI tool and the execution context for spells.
2025-08-01 06:41:00 +00:00
** Workflow
- The visual editor is served by a development or application server.
- Changes and execution requests for server-side spells are sent over a bidirectional WebSocket connection.
- User modifications are stored locally in the browser's storage, exportable as a file.
2025-08-04 12:37:53 +07:00
- Weaves are tracked by usual VCS tools.
2025-08-01 06:41:00 +00:00
** Cross-language connections
Think Unix pipes but with structured data formats like JSON lines instead of plain text.
** Execution environment
2025-08-04 12:37:53 +07:00
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 and declare their Deno dependencies normally.
2025-08-01 06:41:00 +00:00
2025-08-04 12:37:53 +07:00
A single copy of Deno runtime and a shared Deno cache would be bundled in an edition.
However, the general-purpose Deno scroll executing arbitrary TypeScript inscriptions
would have Deno fetch dependencies during runtime.
2025-08-01 06:41:00 +00:00
* Features
| | On the roadmap | Ideas |
|--------------------------+--------------------------------+--------------------|
| Editions (build targets) | Self-sufficient CLI executable | Mobile application |
| | CLI client + RPC server | React component |
| | Web application | |
| | | |
2025-08-01 15:48:56 +00:00
| Scripting languages | TypeScript | DuckDB SQL |
| | Bash | Python |
| | Haskell | R |
2025-08-01 06:41:00 +00:00
* 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.
2025-08-01 15:48:56 +00:00
Grimu-R can do a similar thing if you want it to.
2025-08-01 06:41:00 +00:00
Or you could use any framework you like with the dataflow stuff being incidental.
2025-08-04 12:37:53 +07:00
** How does malleability work in client-server applications?
2025-08-01 06:41:00 +00:00
2025-08-04 12:37:53 +07:00
Unlike standalone editions executing entirely on the end user's machine,
client-server editions split the weave between runtime components.
2025-08-01 06:41:00 +00:00
2025-08-04 12:37:53 +07:00
Only the client-side part of the weave can be inspected and edited by
the end user.
2025-08-01 06:41:00 +00:00
** 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 spells' inscriptions,
at the cost of reproducibility.
2025-08-04 12:37:53 +07:00
So you could use e. g. runtime JS imports or call some executable on PATH from a shell script.
2025-08-01 06:41:00 +00:00
** How do I test my weave?
If you do it manually: right in the visual editor.
Add spells with a constant output as test data sources and stitch them to the spells you want to test.
If you need automation: build an edition and call the ornaments programmatically.
If you already have test data stored in the weave, you can extract it by the spell's id using loom CLI or library.
2025-08-04 12:37:53 +07:00
** Can I integrate AI models?
There are three integration scenarios which would make sense:
1. AI spells in the weave:
Spells calling inference APIs, equipped with MCP spells and
template spells for prompt composition
2. AI weaving copilot:
Loom providing AI tools to edit the weave
3. MCP server editions:
2025-08-01 06:41:00 +00:00
2025-08-04 12:37:53 +07:00
Ornaments exposed as tools for external AI systems
2025-08-01 06:41:00 +00:00
2025-08-04 12:37:53 +07:00
#1 is easy to do even with no out-of-the-box support.
2025-08-01 06:41:00 +00:00
2025-08-04 12:37:53 +07:00
#2 and #3 would require some work on development tooling.