Compare commits

..

No commits in common. "5e3ffb0e1e1d33d238697adf7c7f840785313a75" and "2fccbe96ebdf2b014412be8be81fd12bf32d360f" have entirely different histories.

8 changed files with 10 additions and 5 deletions

Binary file not shown.

View File

@ -6489,7 +6489,7 @@ var __emscripten_stack_alloc = (a0) => (__emscripten_stack_alloc = wasmExports['
var _emscripten_stack_get_current = () => (_emscripten_stack_get_current = wasmExports['emscripten_stack_get_current'])();
var ___cxa_is_pointer_type = createExportWrapper('__cxa_is_pointer_type', 1);
var dynCall_jiji = Module['dynCall_jiji'] = createExportWrapper('dynCall_jiji', 5);
var ___emscripten_embedded_file_data = Module['___emscripten_embedded_file_data'] = 1781548;
var ___emscripten_embedded_file_data = Module['___emscripten_embedded_file_data'] = 1782340;
function invoke_i(index) {
var sp = stackSave();
try {

Binary file not shown.

View File

@ -1,3 +1,5 @@
import {run} from "./ludus.mjs"
console.log(run(`let foo = 42; "{foo} bar"`))
console.log("Imported ludus wasm")
console.log(run(`print! ("hello, world!")`))

View File

@ -18,6 +18,7 @@ doc:
# publish to npm (did you build things first?)
publish:
just build
npm version patch
npm publish

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "@ludus/ludus-js-pure",
"version": "0.1.8",
"version": "0.1.7",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@ludus/ludus-js-pure",
"version": "0.1.8",
"version": "0.1.7",
"license": "GPL-3.0",
"devDependencies": {
"shadow-cljs": "^2.26.0",

View File

@ -1,6 +1,6 @@
{
"name": "@ludus/ludus-js-pure",
"version": "0.1.8",
"version": "0.1.7",
"description": "A Ludus interpreter in a pure JS function.",
"type": "module",
"main": "build/ludus.mjs",

View File

@ -189,6 +189,7 @@ fn fold {
"Folds a list."
(f as :fn, xs as :list) -> fold (f, xs, f ())
(f as :fn, xs as :list, root) -> {
base :print! (("folding ", xs, " with ", f))
loop (root, first (xs), rest (xs)) with {
(prev, curr, []) -> f (prev, curr)
(prev, curr, remaining) -> recur (
@ -1051,6 +1052,7 @@ box bgcolor = colors :black
fn add_call! (call) -> update! (p5_calls, append (_, call))
fn add_command! (command) -> {
print! ("adding command", command)
update! (turtle_commands, append (_, command))
let prev = do turtle_states > unbox > last
let curr = apply_command (prev, command)