2 ms·
I designed a standard, a reference implementation in Ruby, and an unfinished self-compiled implementation for my unreleased language "Cub", which compiles to C
by vortico 10y ago
I designed a standard, a reference implementation in Ruby, and an unfinished self-compiled implementation for my unreleased language "Cub", which compiles to C and looks a bit Go-like while still preserving the full functionality that C offers, such as pointers, the stdlib, and binding to C libraries without glue code. Here's a short example. Let me know if this is interesting at all.
include "stdio.h"
class Widget {
x int
y int
func init() {
@x = 0
@y = 0
}
func draw() {}
}
class Button extends Widget {
func draw() {
printf("Drawing button!\n")
}
}
func main() int {
w *Widget = new(Button)
w@draw()
delete(w)
}