Skip to content

kvbc/rylang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rylang

A programming language in progress, which this repository will host the compiler of.

See docs/spec.md

For ease of reading the Markdown files, I recommend opening them up in VSCode

TODO

  • Link to external Markdown reader, for example: https://dillinger.io/ (this one doesn't work with custom heading ids)
  • Better error messages and handling
  • Perhaps separate all stringify functions in ASTNode into its own Stringifier class

Compiler

graph TD
    Lexer --> |Tokens| Parser
    Parser --> |Untyped AST| Analyzer
    Analyzer --> |Untyped AST| Typer
    Typer --> |Typed AST| CTEE[Compile-time expression evaluator - CTEE]
    subgraph Frontend
        Lexer & Parser & Analyzer & Typer
    end

    CTEE ---> |Unmodified Typed AST| Transpiler
    CTEE .-> |Modified Typed AST| Transpiler
    Transpiler --> C[C code]
    C --> CComp[C Compiler]

    C .-> JIT[C JIT]
    JIT .-> |evaluations| CTEE
    CTEE <.-> |?| Macro[Macro Processor ?]

    subgraph Third-party
        JIT & CComp
    end

    subgraph Backend
        Macro & CTEE & Transpiler
    end

    CComp --> EXE[Final Executable]
Loading

Overview

Vector2 := $[
    x, y #i32;
    
    add[self *#Vector2, other *Vector2] => [] = {
        self.x += other.x;
        self.y += other.y;
    }
]

main[] => [] = {
    pos Vector2 = [1, 2];
    ofs Vector2 = [3, 4];
    pos.add[&ofs];
}

Installing

  1. Get meson with pip3 install meson
  2. Get ninja
  3. Run setup.bat

Building

Run build.bat

Running

Run run.bat

About

A programming language in progress

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages