A language implemented mainly for the purpose of learning. This is meant to be a language with a syntax close to Ruby that transpiles to C code.
This c-ruby snippet
import <stdio.h>
import <stdlib.h>
fn say_hello(name: *char) -> void do
printf("Hello, %s!\n", name)
end
fn print_person(name: *char, age: int) -> void do
printf("Person<name=%s, age=%d>\n", name, age)
end
fn main -> int do
name: *char = "Eder"
age: int = 20
say_hello(name)
print_person(name, age)
return 0
end
Turns into this when transpiled into C code:
#include<stdio.h>#include<stdlib.h>voidsay_hello (char*name) {
printf("Hello, %s!\n", name);
}
voidprint_person (char*name, intage) {
printf("Person<name=%s, age=%d>\n", name, age);
}
intmain (void) {
char*name="Eder";
intage=20;
say_hello(name);
print_person(name, age);
return0;
}- NodeJS
- GCC
Check if the syntax is valid and generate an AST.
$ yarn dev:parse <file>Build the parser module to use in conjunction with the codegen.
$ yarn build:parserTurning c-ruby into c code.
$ yarn transpile <file>![]() |
|---|
| Eder Lima |
