Skip to content

Just a funny toy language that I wrote to explain some basic concepts about compilers in my blog.

Notifications You must be signed in to change notification settings

KindaSloth/Cria

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Builtin types (Strings, Numbers and Booleans)

Equals JavaScript

Math OPs

Equals Lisp but with optional parens

Variables

cria minguinha = "EUMINGUINHA";

Functions

pegaVisao add(x: number, y: number): number {
    tomali (+ x y);
}

Functions App

pegaVisao add(x: number, y: number): number {
    tomali (+ x y);
}

cria result = add(1, 2);

If condition

pegaVisao factorial(n: number): number {
    qualfoi? (== n 1) {
        tomali 1;
    }

    tomali (* n factorial(- n 1));
}

I/O output

radinho("this string will be logged (aka compiled to console.log)");

High Order Functions

pegaVisao add(x: number, y: number): number {
    tomali (+ x y);
}

pegaVisao test(f: (number, number) => number, x: number, y: number): number {
    tomali f(x, y);
}

cria result = test(add, 1, 2);

About

Just a funny toy language that I wrote to explain some basic concepts about compilers in my blog.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published