Shimlang Design Goals
Shimlang is a new scripting language and interpreter that’s intended to be
modern, lightweight, and easily distributed. But what does that mean, exactly?
Modern
- The syntax is largely dervied from modern languages like Swift and Rust
- The language and standard library are expression-oriented
- Type annotations are first-class (in contrast to Mypy for Python, Sorbet for Ruby, and TypeScript)
- Solid standard library, without bringing in the entire world
Lightweight
- The interpreter and standard library should be less than 300 kB (about the size of The Great Gatsby)
- A smaller release should be available with just a “core” set of libraries
Easily Distributed
- The interpreter should be a single-file executable
- No dependencies, including glibc
- In general, the interpreter should be small enough that folks should be just barely okay with including copies of the resulting binary (for multiple platforms!) in their git repository
- A packaged interpreter should be easy to extend with additional modules
- Scripts developed with Shimlang should be easily packaged into single file binaries along with the interpreter
- Should be easy to embed into other applications, whether that’s C, C++, Rust, Zig, or WASM
Why?
Various languages over the years have been popular “glue” for adding a sprinkle
of automation. Bash, Perl, Python, and Ruby have are still popular choices for
this. Although these are popular, you cannot assume that they’ll be present on
every machine you’d want to run them on. Additionally, if your glue script
relies on third-party packages, then the environment management required to get
started with your project will drive people away.
Lua is close to meeting these needs, but the syntax and semantics of the
language are unorthodox.
Where should you not use Shimlang?
- Don’t use Shimlang if performance matters. That’s not a goal.
- Don’t use Shimlang if you’re building an application. Other languages have ecosystems that suit that better.
Where should you use Shimlang?
- Use Shimlang if there’s a script you want to share with someone. You don’t need to worry about their environment causing havoc.
- Use Shimlang if you need to generate files from some source in your code repository
- Use Shimlang for scripting in games
- Extend applications with Shimlang