You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any way to compile incrementally, while keeping in-memory state from previous compiles?
E.g.
$ let x = [1, 1];
$ for k in 0 .. 10
x.append(x[k] + x[k+1]);
This is compiled so that, for example, x is a vector of 8-byte ints. x also has 12 specific values.
Then the next line in the repl might be
$ diff(x)
[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55]
There are several challenges:
How to make this part of the original program (same types etc) without recompiling everything?
What if diff is diff(y: i64)? If it were one program, it'd have inferred i64 for x and it'd work, but not it might not.
Perhaps most challenging: how to make x refer to the same location in memory as the existing x in the already running program?
The alternative is to make an interpreter for Mango. I'd prefer to avoid duplicate effort, have compiled code, and to solve this challenge.
The rest of the repl, I hope, is just wrapping print(...) around anything that doesn't end in a ;, then reading and printing in a loop. It's the e in repl that's problematic.
The text was updated successfully, but these errors were encountered:
Is there any way to compile incrementally, while keeping in-memory state from previous compiles?
E.g.
This is compiled so that, for example,
x
is a vector of 8-byte ints.x
also has 12 specific values.Then the next line in the repl might be
There are several challenges:
diff
isdiff(y: i64)
? If it were one program, it'd have inferredi64
forx
and it'd work, but not it might not.x
refer to the same location in memory as the existingx
in the already running program?The alternative is to make an interpreter for Mango. I'd prefer to avoid duplicate effort, have compiled code, and to solve this challenge.
The rest of the repl, I hope, is just wrapping
print(...)
around anything that doesn't end in a;
, then reading and printing in a loop. It's thee
inrepl
that's problematic.The text was updated successfully, but these errors were encountered: