Skip to main content

Rose

Search before you write. Rose is a concept for a small, LLM-optimised programming language. Instead of re-inventing solved problems, an LLM references verified building blocks – algorithms from Rosetta Code, mathematical facts, physical laws, controllers and state machines – and writes only the glue. The compiler rosec carries this knowledge itself (std/, no server needed): it finds the blocks, checks the result (types, physical units, contracts, exhaustive tables and state machines) and compiles it to Python (C, IEC 61131-3 ST and ESPHome C++ planned).

Status: knowledge module usable, compiler v1 experimental. rose.exists() points to known solutions in 278 969 searchable cards – mathematics, physics, algorithms, control engineering, biology, plants and drugs, radio technology, social psychology, Python packages – and says when a problem is open, a concept disputed, or a plant has poison records. It never solves the task itself. Counts per topic: docs/STATISTICS.md. Want to help? See TODO.md.

How to use

pip install git+https://github.com/gerontec/roselang     # distribution "roselang", import name "rose"

No server, no network, no API key: the knowledge ships with the package. Size: 75 MB download, 118 MB installed, plus a 362 MB index unpacked on the first query into ~/.cache/roselang ($ROSE_CACHE). First query after installing ~0.6 s, then ~7 ms per query (median, measured).

1. Does a known solution exist? – one verdict, the pointers, their sources:

$ rosec exists "plan a tour for a delivery van that visits 30 customers and returns to the depot" -k 1
SOLVED: A known solution exists: travelling salesperson problem (TSP) (NP-hard); ready-made solver: networkx.algorithms.approximation.traveling_salesman.traveling_salesman_problem.
  - travelling salesperson problem (TSP)  [problem:travelling_salesperson]  https://www.wikidata.org/wiki/Q322212
$ rosec exists "ESP32 RS485 Modbus RTU master" -k 1
SOLVED: A known solution exists: ESPHome modbus_controller (Modbus RTU master on ESP32/ESP8266); ready-made solver: pip install esphome; YAML: uart + modbus (flow_control_pin) + one modbus_controller per address; esphome run <config>.yaml.
$ rosec exists "is P equal to NP" -k 1
OPEN: No known solution: P versus NP problem is an open problem.
$ rosec exists "is elderberry edible" -k 1
CAUTION: Sources record uses of Sambucus canadensis (American elderberry), see the card; whether anything is safe to eat or to take depends on the part, preparation, amount and correct identification - Rose does not confirm it.
$ rosec exists "mass formation psychosis" -k 1
DISPUTED: Not established knowledge: mass formation psychosis is a proposed, disputed concept without established empirical support - see the source.
Verdict Means
solved a known solution, definition, theorem or maintained package exists – with source, licence and, where there is one, the exact library call
open the best match is an unsolved problem (negative knowledge) – do not claim a general solution
caution the best match is a plant with food or poison records – shown with source, never a confirmation of safety
disputed the best match is a proposed concept without established empirical support
unknown nothing in the knowledge matches

2. The same from Python (for an LLM tool call or a script):

import rose
v = rose.exists("estimate the state of a system from noisy measurements")
v["verdict"], v["answer"]          # 'solved', 'A known solution exists: ...'
for s in v["solutions"]:           # ref, name, url, licence, level, call (ready-made solver), status
    print(s["ref"], s["url"], s.get("call"))
rose.get("bio:drug.ephedrine")     # the full card: intent, source, licence, ATC codes ...
rose.search("free space path loss", k=5)   # ranked cards without a verdict

3. More detail – rosec plan "<task>" shows the recognised category, structure and quantities with units; rosec search "<words>" [--kind law|math|algo|bio|lib|...] lists ranked cards; rosec get <ref> prints one card; every command takes --json.

Rules for using the answers: Rose only points. Check the source behind a card before relying on it; a solved card is a pointer, not a verified result for your input. Drug and plant cards carry no dose, preparation or safety information.

The language (experimental)

rosec plan "speed of light in vacuum"
python3 -c 'import rose; print(rose.use("law:kinetic_energy"))'

From a checkout:

python3 tests/run_tests.py                       # self-test, no network
./rosec test examples/kinetic.rose
./rosec plan "prove that every even integer greater than 2 is the sum of two primes"
use law:kinetic_energy                       # from std/ (Wikidata Q46276): T = 1/2 m v^2

fn speed_for(e: Real[J], m: Real[kg]) -> Real[m/s]
  intent "speed of a body of mass m that carries kinetic energy e"
do
  return solve kinetic_energy for v given T = e, m = m
end

test speed_for(200 kJ, 1000 kg) == 20 m/s within 1 %

Contents

Path What
docs/STATISTICS.md what can be found: cards per topic, verdicts, distinct facts (tools/stats.py)
docs/pharma/, docs/pypi/ browsable overviews: drugs by ATC group, top PyPI packages by topic
docs/CONCEPT.md full concept: principles, language, corpus sources and licences, verification levels, where the knowledge lives, benchmark and go/no-go rule, roadmap
spec/grammar.ebnf grammar draft v0
spec/mcp-tools.md tool interface (CLI --json; optional MCP adapter) and diagnostic codes
rose/std/ generated standard library and knowledge catalog (do not edit; tools/export_std.py)
schema/rose_schema.sql MariaDB 11.8 corpus schema (rose_*, VECTOR(1024) + HNSW)
rose/ compiler v1 (rosec): parser, unit checker, solve, tables, Python codegen, corpus access
tools/ corpus importers (Wikidata, CODATA, GO, mathlib, Rosetta Code, Modelica, PyPI, GRIN/WCVP, Orange Book, ...), export and release build
tests/ self-test: positive programs and negative programs per diagnostic code
TODO.md open tasks and rules for contributors (humans and LLMs)
examples/ fn, law, ctrl, machine, table, bio examples

Key ideas

  • Reference, not copy: use rc:Sieve_of_Eratosthenes – the model sees a ~50-token signature card, the compiler inserts the tested implementation.
  • Units are types: Real[kg/s], degC vs K; laws are acausal equations solved at compile time.
  • Finite parts are enumerated: decision tables and state machines are checked for completeness, overlap, reachability and deadlock.
  • Machine-readable diagnostics with fix suggestions, plus R201 known-solution when hand-written code re-implements a corpus unit.
  • Provenance and licences in the lock file; --license permissive excludes share-alike sources (Rosetta Code is GFDL).
  • Bio tasks take the local shortcut: sequence, homology and taxon questions compile onto the local DIAMOND nr (gerontec/blastDiamond): MariaDB pre-selection, then DIAMOND through the existing job queue; online BLAST is a compile error.
  • Measured, not assumed: the language is dropped if LLM + Rose does not beat LLM + a plain Python module on the same knowledge.

Licence

Language, tools and documents: MIT. Corpus data keeps the licence of its source.

Metadata

Release files for roselang 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for roselang 0.1.0
File Size Uploaded Provenance Actions
roselang-0.1.0.tar.gz 78.2 MB Without provenance Details for roselang-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for roselang 0.1.0
File Interpreter ABI Platform Actions
roselang-0.1.0-py3-none-any.whl Python 3 none any Details for roselang-0.1.0-py3-none-any.whl

Total release size: 156.4 MB

Release files / roselang-0.1.0.tar.gz

Download URL roselang-0.1.0.tar.gz
Size 78.2 MB
Tags Source
SHA-256 checksum
How to use checksums
833dd116294d789aa98f6fe3549f59fcda980d160d589143aad355983c7603da
BLAKE2b-256 checksum
How to use checksums
4a44f514933d5a5a6101d9ed9b6257b476757b12306f5dcab83dd46a26554a9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / roselang-0.1.0-py3-none-any.whl

Download URL roselang-0.1.0-py3-none-any.whl
Size 78.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
a80920d5c318811e2c00a17fae52413adf89cca7fec231d732ad5ffca2ea5dcf
BLAKE2b-256 checksum
How to use checksums
b174b3da3662803a8cffb4d3ca1beefedc23e2503a9633dba7df881894287edd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for roselang 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page