- Rust 63.5%
- C 24%
- JavaScript 8.4%
- Python 4%
- HTML 0.1%
|
|
||
|---|---|---|
| .forgejo | ||
| crates | ||
| docs | ||
| editors/vscode | ||
| examples | ||
| sdk | ||
| tools/abi | ||
| .gitignore | ||
| .prettierignore | ||
| .prettierrc.json | ||
| Cargo.lock | ||
| Cargo.toml | ||
| LICENSE | ||
| README.md | ||
DETLEF
DETLEF Evaluates Typed Language Expressions Functionally
DETLEF is a small, typed, embeddable scripting language with a deliberately minimal core.
Its syntax consists primarily of literals, identifiers, calls, and blocks. Language constructs such as variable declarations, conditionals, loops, and arithmetic can be implemented outside the core language through host-provided Functions and Controls.
declare(x, integer, 0)
while(
less(x, 10),
{
print("DETLEF")
set(x, add(x, 1))
}
)
Functions and Controls
DETLEF distinguishes between two kinds of callable constructs:
- A Function receives values after its arguments have been evaluated from left to right.
- A Control receives its argument expressions unevaluated and decides if, when, and how often they are evaluated.
Both use the same call syntax.
This allows constructs such as if, while, declare, and set to be
implemented without dedicated syntax in the parser.
Project Structure
DETLEF is implemented in Rust as a Cargo workspace:
detlef-syntax— lexer, parser, source spans, and ASTdetlef-runtime— evaluation, types, values, environments, functions, controls, objects, and packagesdetlef-stdlib— standard librarydetlef-cli— command-line interpreter
Running DETLEF
The releases page provides CLI and C SDK downloads for Windows and Linux x86-64, a JavaScript/Wasm SDK, and the C package-authoring SDK. SDK files and runtime binaries must come from the same release.
Extract the CLI archive and run bin/detlef script.dtf (bin/detlef.exe on
Windows), or add its bin directory to your PATH.
To run from source:
cargo run -p detlef-cli -- script.dtf
Or build the CLI first:
cargo build --release -p detlef-cli
./target/release/detlef script.dtf
On Windows:
.\target\release\detlef.exe script.dtf
Add the directory containing the executable to your PATH to run it from
anywhere:
detlef script.dtf
Relative script paths are resolved from your current working directory.
Documentation
Read the online documentation for the language and standard library, C SDK, and JavaScript SDK.
The language documentation is built with mdBook; the C SDK reference uses Doxygen. See the documentation build instructions.
To serve it locally:
python docs/serve.py
The language manual currently covers:
- syntax
- values and types
- evaluation
- lexical scoping
The standard library reference covers the current operations, their evaluation rules, errors, and examples.
Runnable embedding and package examples are in examples/.
Status
Public C headers, JavaScript wrappers, and package tools are in the SDK.
Experimental embedding interfaces live in crates/detlef-ffi
for native C hosts and crates/detlef-wasm for
JavaScript in Node and browsers. Their READMEs include build instructions and examples.
DETLEF is under active development. The language and its APIs are not yet stable.
VS Code Extension
Syntax highlighting and editing support for .dtf files lives in
editors/vscode. Open that folder in VS Code and
press F5 to try it in an Extension Development Host, or follow its README
to build and install a local VSIX.
License
Licensed under the MIT License. This covers the project code, documentation, and logo. Bundled third-party assets retain their respective licenses and notices.