Skip to content

pyanzin/interpreter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

interpreter

AST interpreter for JavaScript-like language

fold = (z, xs, f) => {
    if (xs) {
        fold(f(z, head(xs)), tail(xs), f);
    }
    else {
        z;
    }
};

xs = [12,3,5,6,8];

sum = fold(0, xs, (z, x) => z + x);
production = fold(1, xs, (z, x) => z * x);

writeLine(sum);
writeLine(production);

About

AST interpreter for JavaScript-like language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages