Crates.io | june-lang |
lib.rs | june-lang |
version | 0.1.0 |
source | src |
created_at | 2024-01-21 20:05:50.179167 |
updated_at | 2024-01-21 20:05:50.179167 |
description | a small statically-typed language that runs on wasm |
homepage | |
repository | https://github.com/dhconnelly/june-lang |
max_upload_size | |
id | 1107851 |
size | 126,433 |
a small statically-typed (work-in-progress) language that runs on wasm
I wanted to write a compiler that targets a VM that I didn't create myself, and I wanted to implement static type checking, neither of which I had done before. The design is roughly "Go but even simpler" and the feature set corresponds to what I think is necessary to solve Advent of Code puzzles.
end-to-end for basic programs (i.e. functions, local variables, strings, basic built-ins for string processing, garbage collection):
add features:
refactoring:
productionization:
See the examples
directory.
Dependencies:
To build and install from source:
git clone git@github.com:dhconnelly/june-lang.git
cargo test
cargo install --path .
To install from crates.io:
TODO
To use a pre-built release:
TODO
june examples/hello.june
For more usage information, run junec --help
. For examples, see examples/
.
For more details on wasm and wasmtime:
This is my eighth hobby language implementation. Here are the previous ones:
None of these languages are interesting: it's all Scheme variants or JavaScript lookalikes. June is my first attempt at creating a statically typed language. Despite having used a lot of languages -- I've written C, C++, Objective-C, Java, Scala, JavaScript, TypeScript, Python, and Go professionally (not counting domain-specific languages), plus Rust, Clojure, Haskell, OCaml, and Scheme for hobby stuff -- I'm less interested in language design than implementation :)
I read a lot of stuff that made this possible. Here are the resources that helped me the most:
Additionally, I've read most of SICP and poked around in the Engineering a Compiler and Modern Compiler Implementation in ML textbooks.
I also briefly worked on the GCL team at Google. (GCL is a bizarre internal language used to generate protocol buffers in a whole bunch of different scenarios, including configuration of Borg jobs as well as live experiments; there are some more details in this paper). For various reasons I didn't stay long enough to have any impact, but I was lucky to have the opportunity to review a bunch of code written by the team for a new implementation of the language, including some of the bytecode VM and compiler as well as garbage collection. This was a good (if short) learning experience.
Before that I also did an internship on the Google Web Toolkit (a Java to JavaScript compiler) team, and spent most of an internship on the Google Sheets team working on J2ObjC, a Java-to-Objective-C compiler.
MIT