Goiaba
Experimental Go parser and compiler.
WebAssembly Compilation Usage
use compile_str;
use ;
CLI Usage
goiaba main.go -o main.wasm
goiaba input.go --output output.wasm --verbose
# Generate a complete web project
goiaba main.go -w ./web-project
# Compile with custom output and web generation
goiaba calculator.go -o calc.wasm -w ./demo --verbose
Todo
- Parses Go source code into an Abstract Syntax Tree (AST)
- Translates Go constructs to WebAssembly representations
- Compiles to WebAssembly bytecode
- Supports function definitions with parameter and return types
- Handles variable declarations and assignments
- Supports control flow statements (if/else, loops)
- Generates exportable WASM functions
- Supports arithmetic and comparison operations
- Handles increment/decrement operators
- Support for struct types
- Support for arrays and slices
- Implement switch statements
- Add support for string literals
- Implement pointer types
- Add garbage collection support
- Support for goroutines and channels
- Implement more standard library functions
- Add support for package imports
- Improve error reporting and diagnostics
- Optimize generated WASM code
- Add support for floating-point operations
- Cli support
goiaba main.go - Cli support produces the js with wasm-bindgen
- Add LLVM-IR target for compilation
License
GPL-3.0 - Raphael Amorim