An open API service indexing awesome lists of open source software.

https://github.com/zdimension/macro-forth

Compile-time const Forth evaluation with macros
https://github.com/zdimension/macro-forth

compile-time forth macro rust

Last synced: 10 months ago
JSON representation

Compile-time const Forth evaluation with macros

Awesome Lists containing this project

README

          

# macro-forth

Forth, in macros.

```rust
fn main() {
const TWO: i32 = forth!(5 3 -);
forth!(
TWO . // 2
);

const HUNDRED: i8 = forth!(
1 2 dup * + dup + // 10
dup * // 100
hundred !
3 dup swap drop drop
hundred @
);

forth!(
HUNDRED @ dup . // 100
50 > if "bigger" else "smaller" then . // bigger
);
}
```