Most DSL (domain specific language) like nvidia-warp, tile-lang, use Python as front-end. However, Python as DSL front-end suffers from:
- raw source code extraction and re-parsing: which makes the advanced function features of Python useless.
- ordinary diagnostic ability: while DSL can have very arbitary diagnostic needs like dependant-type analysis.
Moss-lang aims to be a meta-language to create DSL front-end with very advanced features, providing easy integration for JIT/AOT backend.
-
language-server is interpreter, diagnostic is error value
as long as you want language-server to report an error, just return an error value.
-
pure DAG (acyclic dependency graph) form
backend directly get a DAG with fully resolved symbols.
-
first-class function, closure, higher-order function
which can create function template easily.
-
parallel diagnosing/interpreting in mutual-recursive module level
module is just a parallel hint, no cyclic dependency hell.
-
fine‑grained field dependency tracking
depending on a field of a struct is not depending on the whole struct.
-
setup Rust developing environment, download Zed and have it in PATH, have Python in PATH.
-
clone this repo recursively.
git clone https://github.com/windwhiterain/moss-lang --recursive -
debug build the project.
cargo build -
run the install script.
python install.pyyou can uninstall by run it with one arbitrary argument
python install.py utry run
mossin any terminal to check if installed successfully.mossgot:
Moss Lang v0.1.0 -
run Zed from terminal.
zed --foreground -
install zed extension in Zed via
Extensins/Install Dev Extension. -
restart Zed, open example Moss project, diagnostics and inlay-hint should appear.
zed --foreground language_example/_ -
open more project inside example Moss projects, note that a moss project is a folder with a
srcsub-folder.zed --foreground language_example/function/higher_order