Skip to content

A toy programming language with the interpreter written in Rust

Notifications You must be signed in to change notification settings

TaPO4eg3D/flexlanguage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FLEX Language

A toy language designed to flex.

The Language can be compiled as WASM and you can play with it right in your browswer PLAYGROUND

Goals

  1. Flex on peasants who didn't implement their own language yet
  2. Figure out how far I can go with implementing my own language
  3. Learn and have fun

Features

  • full unicode support (thanks Rust!)
let привет = 1;
let пока = 2;

>> привет + пока;
3
  • variable bindings
>> let a = 1;
>> let b = 2;

>> a + b
3
  • integers and booleans (floats? never heard of it)
>> !(0 + 1) == false
true
  • arithmetic expressions
>> 1 + 1 * 4
5
  • conditions (they are expressions!)
let a = if (1 < 10) {
    true;
} else { false; }

>> a;
true
  • first-class and higher-order functions / closures
let a = fn(x) {
    return fn(y) {
        x * y;
    };
}

>> a(10)(5);
50
  • strings and operations on them
// Concantination
let a = "hello";
let b = " world";

>> a + b + "!";
"hello world!"

// String repeat
let a = "hi! ";

>> a * 2;
"hi! hi! "

TODO

  • Extend standart library
  • More friendly errors handling
  • JIT Compiler
  • Comments
  • LOOPS!!! For Gods sake

About

A toy programming language with the interpreter written in Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages