brain
brain copied to clipboard
A high level programming language that compiles into the brainfuck esoteric programming language
This brain assembly language can be used as an IR for this compiler. It has a simple bytes-only memory representation and is in a sense much "lower level" than brain....
The current instruction generation for `stdin.read_exact()` is not exactly what was described in https://github.com/brain-lang/brain/issues/66. - [ ] Implement the full, exception safe version of reading input (branching on whether a...
Be able to generate operations for every part of the AST. - [x] block - [x] supports last statement as return type (using .pop() on the provided statements) - [x]...
Consider the following code: ```brain let x: bool = true; stdout.println(x); x = !x; stdout.println(x); ``` You would expect it to output: ``` 1 0 ``` However, in reality it...
[Short-circuit evaluation](https://en.wikipedia.org/wiki/Short-circuit_evaluation) This is less of a problem now because we don't have functions yet (#16), but this is a very important property of booleans that should be properly implemented...
This is the beginning of being able to have dynamically allocated objects in brain (instead of the static things we have now). We need a malloc-esque API for memory allocation...
The [current algorithm for displaying numbers](https://github.com/brain-lang/brain/blob/operations/src/core/primitives/u8.rs#L69) is quite naive and largely broken. It only really works for numbers between `0` and `9`. After that, it prints out many punctuation characters...
Reference: `&Foo` Mutable reference: `&mut Foo` Move/Copy: `Foo` The data should be moved if type does not implement Copy, copy otherwise. - [ ] Fix all variables are mutable references...
This is an intentional/planned bug. In order to make the MVP implementation simpler, all variables are essentially mutable references when passed into functions. This isn't explicit at all and is...
Functions can only be defined at the top level of modules and have access to global variables and their function arguments. Closures are anonymous functions that capture values of variables...