Skip to content

windwhiterain/moss-lang

Repository files navigation

The Moss Programming Language

meta-language to create DSL front-end

License: MIT Contributions GPU status

Why Moss

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.

Features

  • language-server is interpreter, diagnostic is error value

    as long as you want language-server to report an error, just return an error value.

    example project

  • pure DAG (acyclic dependency graph) form

    backend directly get a DAG with fully resolved symbols.

    example project

  • first-class function, closure, higher-order function

    which can create function template easily.

    example project

  • parallel diagnosing/interpreting in mutual-recursive module level

    module is just a parallel hint, no cyclic dependency hell.

    example project

  • fine‑grained field dependency tracking

    depending on a field of a struct is not depending on the whole struct.

    example project

Start Developing

  1. setup Rust developing environment, download Zed and have it in PATH, have Python in PATH.

  2. clone this repo recursively.

    git clone https://github.com/windwhiterain/moss-lang --recursive
    
  3. debug build the project.

    cargo build
    
  4. run the install script.

    python install.py
    

    you can uninstall by run it with one arbitrary argument

    python install.py u
    

    try run moss in any terminal to check if installed successfully.

    moss
    

    got:

    Moss Lang v0.1.0
    
  5. run Zed from terminal.

    zed --foreground
    
  6. install zed extension in Zed via Extensins/Install Dev Extension.

  7. restart Zed, open example Moss project, diagnostics and inlay-hint should appear.

    zed --foreground language_example/_
    
  8. open more project inside example Moss projects, note that a moss project is a folder with a src sub-folder.

    zed --foreground language_example/function/higher_order
    

About

meta language to create DSL frontend

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors