Skip to content

Latest commit

 

History

History
85 lines (69 loc) · 1.23 KB

README.md

File metadata and controls

85 lines (69 loc) · 1.23 KB

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