sunjay / brain

A high level programming language that compiles into the brainfuck esoteric programming language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Explicit Type Declarations

sunjay opened this issue Β· comments

Types! πŸ˜€

Initially types were left out because there was only one type: raw byte arrays.

Before 1.0.0, in order to avoid immediately jumping to 2.0.0, we should support the following syntax:

let a: byte[] = "Hello, world";
let b: byte[3] = "abc";

// these two are the same
let c: byte = "c";
let d: byte[1] = "d";

// this syntax needs work
in q: byte[1];
// might just want to support:
//let q: byte[1] = read();
// where read is a special function?
// if we do this, we should also change out:
//out("a =", a, "\n");

Eventually, we'll support more types like int and maybe even user defined types! This syntax will help us do that in the future.

  • Implement this in the parser
  • Update all examples to use the new syntax