Adding builtins as native-functions. desugaring symbols as native function application. except ~ which is the new pipe operator, > is now greater than

This commit is contained in:
Dustin Swan 2026-02-02 20:10:32 -07:00
parent 5b40e9d298
commit 216fe6bd30
No known key found for this signature in database
GPG key ID: 30D46587E2100467
7 changed files with 587 additions and 115 deletions

View file

@ -4,6 +4,7 @@ import { tokenize } from './lexer'
import { Parser } from './parser'
import cgCode from './counter.cg?raw';
import { runApp } from './runtime';
import { builtins } from './builtins';
const canvas = document.createElement('canvas');
canvas.width = 800;
@ -15,7 +16,7 @@ const parser = new Parser(tokens);
const ast = parser.parse();
console.log(ast);
const env: Env = new Map();
const env: Env = new Map(Object.entries(builtins));
const appRecord = evaluate(ast, env);
console.log(appRecord);