GithubHelp home page GithubHelp logo

yisonpylkita / mssl Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 47 KB

[WIP] My simple scripting language

License: MIT License

Vim Script 6.03% Rust 93.97%
wip scripting-language learning-by-doing compiler language-design

mssl's Introduction

mssl - My Simple Scripting Language

Rust

Currently very much in progress!!! - only lexer kind of works right now

I wanted to understand how compiler works so I created one

Code example

# My simple scripting language

# This is a comment
# Every comment starts with # and ends with \n

# This is a scripting language so we do not have a main function

# But we do have a normal functions
# They are declared this way
fn dummy_function(a: i32, b: i32) -> i32 {
    return a + b;
}

# We can have variable declarations
# Right now i32 is the only supported type
let first_num = 2;
let second_num = 5;

Usage

Just lexer result

cargo run -- lex "let x = 10; println(\"Hello world\");"

Run provided code

cargo run -- run "let x = 10; println(\"Hello world\");"

Vim config

I wrote configuration for Vim to support mssl. To enable it run

$ mkdir -p ~/.vim/syntax
$ cp misc/mssl.vim ~/.vim/syntax

and add this line to your .vimrc

au BufRead,BufNewFile *.mssl setfiletype mssl

mssl's People

Contributors

yisonpylkita avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.