WASM-first IDL
Go++ is the language. wasigoc is the compiler. You write Go, and wasigoc lowers that source to one C++ translation unit. That C++ is the program the module runs.
The surface is Go: packages, functions, slices, maps, goroutines, channels, and defer. That source is the interface of the program.
wasigoc is the compiler. It reads the Go++ and emits C++. Integers become long long. fmt.Println becomes a stream write. main stays main.
The emitted C++ is the wasm program: Oilpan collection, cooperative goroutines, one linear memory, and the Win32, Nix, and Android catalogs inside the module.
Edit a program and run it. wasigoc lowers the source, and this edge runs the C++ it just emitted. The panel under the output is that C++.
wasigoc keeps the shape of the Go++ and spells each construct as the C++ that belongs in the module.
| Go++ | C++ |
|---|---|
func / main | A C++ function. int is long long. |
| goroutine | wasigo::Task, a cooperative coroutine on one run queue. |
chan | wasigo::Chan<T> |
defer | RAII. Destructors run in LIFO order. |
[]T | wasigo::Slice<T> |
map[K]V | wasigo::Map<K,V> |
| interface | A generated vtable. |
| GC | Oilpan. Precise trace, stop the world, inside the module. |
package main
import "fmt"
func main() {
fmt.Println("hello, goxxlang")
}