All Projects → wduquette → molt

wduquette / molt

Licence: BSD-3-Clause license
Embeddable TCL Interpreter for Rust applications

Programming Languages

rust
11053 projects
tcl
693 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects
HTML
75241 projects

Projects that are alternatives of or similar to molt

j2
j2 is a minimalist concatenative programming language that makes up for its simplicity by its ability to natively bind with C libraries' ABI *and types*, *without glue*
Stars: ✭ 37 (-56.98%)
Mutual labels:  interpreter, extension-language
coq-elpi
Coq plugin embedding elpi
Stars: ✭ 92 (+6.98%)
Mutual labels:  extension-language
Mond
A scripting language for .NET Core
Stars: ✭ 237 (+175.58%)
Mutual labels:  interpreter
StepULC
Efficient and single-steppable ULC evaluation algorithm
Stars: ✭ 15 (-82.56%)
Mutual labels:  interpreter
Hackide
hackIDE is an online code editor, compiler and interpreter based on Django, powered by HackerEarth API! Go, hack it!
Stars: ✭ 242 (+181.4%)
Mutual labels:  interpreter
clox
A virtual machine and a tree-walk interpreter for the Lox programming language in C89 🌀
Stars: ✭ 38 (-55.81%)
Mutual labels:  interpreter
Gwion
🎵 strongly-timed musical programming language
Stars: ✭ 235 (+173.26%)
Mutual labels:  interpreter
sigmastate-interpreter
ErgoScript compiler and ErgoTree Interpreter implementation for Ergo blockchain
Stars: ✭ 56 (-34.88%)
Mutual labels:  interpreter
lispy
LISP interpreter in Python
Stars: ✭ 31 (-63.95%)
Mutual labels:  interpreter
pythonvm-rust
An incomplete stackless interpreter of Python bytecode, written in Rust.
Stars: ✭ 65 (-24.42%)
Mutual labels:  interpreter
NatsuLang
No description or website provided.
Stars: ✭ 96 (+11.63%)
Mutual labels:  interpreter
Go Pry
An interactive REPL for Go that allows you to drop into your code at any point.
Stars: ✭ 2,747 (+3094.19%)
Mutual labels:  interpreter
LLVM-JVM
[W.I.P] A Just-In-Time Java Virtual Machine written in Haskell
Stars: ✭ 22 (-74.42%)
Mutual labels:  interpreter
Openj9
Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput. Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.
Stars: ✭ 2,802 (+3158.14%)
Mutual labels:  interpreter
fundot
The Fundot programming language.
Stars: ✭ 15 (-82.56%)
Mutual labels:  interpreter
Tabloid
A minimal programming language inspired by clickbait headlines
Stars: ✭ 235 (+173.26%)
Mutual labels:  interpreter
Xstate
State machines and statecharts for the modern web.
Stars: ✭ 18,300 (+21179.07%)
Mutual labels:  interpreter
wasm
A fast Pascal (Delphi) WebAssembly interpreter
Stars: ✭ 40 (-53.49%)
Mutual labels:  interpreter
Tagha
Minimal, low-level, fast, and self-contained register-based bytecode virtual machine/runtime environment.
Stars: ✭ 101 (+17.44%)
Mutual labels:  interpreter
kiwi-8
CHIP-8 interpreter for Windows and MacOS
Stars: ✭ 16 (-81.4%)
Mutual labels:  interpreter

Molt -- More Or Less TCL

Rust Crates.io

MoltLogo.png

Molt is a minimal implementation of the TCL language for embedding in Rust apps and for scripting Rust libraries. See The Molt Book for details and user documentation, and docs.rs/molt for the Rust API.

Mazegen: An Example

See Mazegen as an example of using Molt to provide a TCL interface for real Rust APIs. Mazegen is a collection of maze generation code and related infrastructure, with a Molt interface as an aid for debugging and experimentation. Among other things, Mazegen includes:

  • A simple binding to (a small part of) the rand::thread_rng crate
  • The smallest beginning of a binding to the image crate (more to come)

New in Molt 0.3.1

  • molt_throw! macro
  • New Exception methods
  • Access to environment variables via the env() variable
  • Additional TCL commands

See the Annotated Change Log in the Molt Book for the complete list of new features by version.

Coming Attractions

At this point Molt is capable and robust enough for real work, though the Rust-level API is not yet completely stable. Standard Rust 0.y.z semantic versioning applies: ".y" changes can break the Rust-level API, ".z" changes will not.

  • Additional TCL commands
  • Testing improvements
  • Documentation improvements
  • Feature: Regex and Glob pattern matching by Molt commands

Why Molt Exists

Using Molt, you can:

  • Create a shell interpreter for scripting and interactive testing of your Rust crates.
  • Provide your Rust applications with an interactive REPL for debugging and administration.
  • Extend your Rust application with scripts provided at compile-time or at run-time.
  • Allow your users to script your applications and libraries.

See the molt-sample repo for a sample Molt client skeleton.

Molt and Standard TCL

Molt is intended to be lightweight and require minimal dependencies, so that it can be added to any project without greatly increasing its footprint. (At present, the core language is a single library create with no dependencies at all!) As such, it does not provide all of the features of Standard TCL (e.g., TCL 8.6).

At the same time, Molt's implementation of TCL should be consistent with TCL 8.6 so far as it goes. Some archaic commands and command features are omitted; some changes are made so Molt works better in the Rust ecosystem. (E.g., Molt's notion of whitespace is the same as Rust's.) All liens against Standard TCL are documented in the The Molt Book.

No effort has been made to make the Rust-level API for extending Molt in Rust look like Standard TCL's C API; rather, the goal is to make the Rust-level API as simple and ergonomic as possible. Note: A big part of this effort is defining and refining the Rust API used to interact with and extend the interpreter. If you have comments or suggestions for improvement, please contact me or write an issue!

Building and Installation

The easiest approach is to get the latest Molt through crates.io. Look for the molt, molt-shell, and molt-app crates, or add them to your dependencies list in cargo.toml.

To build Molt:

  • Install the latest stable version of Rust (1.38.0 at time of writing)
  • Clone this repository
  • To build:
$ cd .../molt
$ cargo build
  • To run the interactive shell
$ cargo run shell
  • To run just the language test suite
$ cargo run test molt/tests/all.tcl

Since Molt 0.2.0 the language tests are also run by cargo test; however, it's much easier to see the output of the individual tests using the above command.

Dependencies

At present, the only dependency required by the Molt core is indexmap.

Acknowledgements

I've gotten help from many people in this endeavor; here's a (necessarily partial) list.

  • Mary Duquette, for the Molt logo
  • Jonathan Castello, for general Rust info
  • Kevin Kenny, for help with TCL numerics and general encouragement
  • Don Porter, for help with TCL parsing
  • rfdonnelly, for the crates.io badge, etc.
  • Coleman McFarland, for improvements to molt_shell::repl.
  • dbohdan, for TCL command implementations and advice.
  • Various folks from users.rust-lang.org who have answered my questions:
    • Krishna Sannasi, for help getting Value to work with arbitrary user data types
    • Yandros, for pointing me at OnceCell and UnsafeCell.
    • jethrogb, for help on how to use Ref::map to return a Ref<T> of a component deep within a RefCell<S> from a function. (Mind you, once I got it working and gave it a try I tore it out again, because of BorrowMutError panics. But I had to try it.)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].