Home

Awesome

The Diatom Programming Language

Unit Tests doc Crates.io license

dependency status issue pr coverage

A dynamic typed scripting language for embedded use in applications. This project is yet another attempt of being a "better" lua.

Warning: Project is still in experimental stage and API is considered as unstable.

Features

*: Panic may still be triggered by external functions
**: Results are from our benchmarks which may vary betweens different builds and test codes.

Quick Start

Try Diatom online

You can try diatom at the online playground.

Install with cargo

Make sure you have Rust and Cargo installed.

cargo install diatom-cli
diatom-cli --help # show help for diatom CLI
diatom-cli # Enter diatom REPL console

Build from source

Run the following script:

git clone https://github.com/diatom-lang/diatom.git
cd diatom
cargo run --release # Run interactive console

Syntax highlight

Reference & Grammar

The Reference Book

The Diatom Reference (with examples) is available at here.

Examples

For standard library function and built-in types and methods checks examples. These examples are checked by unit tests.

Embedding in Application

Embedding in Rust Application

Diatom is available at crates.io with detailed examples.

To use latest build, add this repo to your Cargo.toml. Latest build documentation is available here.

Use C bindings

Work in progress.

Feature Showcase

Functional style std-lib

<img width="890" alt="Screenshot 2023-02-19 at 10 23 38 PM" src="https://user-images.githubusercontent.com/63455223/219954981-47d4e2c9-cbac-4f5d-af07-43556ed36ec9.png">

Pretty error reporting and trace-back

<img width="885" alt="Screenshot 2023-02-19 at 10 00 53 PM" src="https://user-images.githubusercontent.com/63455223/219954955-1c6b4e10-2549-4184-a39a-70f71fcde29a.png">

Expression based syntax

<img width="889" alt="Screenshot 2023-02-19 at 10 25 16 PM" src="https://user-images.githubusercontent.com/63455223/219954993-c5d4f493-3d40-474e-a777-27d2f207511e.png">

Interactive REPL console with syntax highlight

<img width="890" alt="Screenshot 2023-02-19 at 10 26 39 PM" src="https://user-images.githubusercontent.com/63455223/219955007-f2ebaebc-1265-4cf1-95f1-297825e5fed7.png">