jamii
03/16/2025, 3:28 AMKonrad Hinsen
03/16/2025, 8:35 AMjamii
03/16/2025, 10:23 PMjamii
03/16/2025, 10:23 PMif ((new Date()).getDay() == 1) {
Date.prototype.getDay = function() { return "funday" }
}jamii
03/16/2025, 10:25 PMjamii
03/16/2025, 11:29 PMjamii
03/16/2025, 11:31 PMjamii
03/16/2025, 11:32 PMjamii
03/17/2025, 1:19 AMjamii
03/17/2025, 1:29 AMyou wouldn't be able to reproduce that way; file compilation has different semantics than repl interaction (the latter happens strictly at "load" or "execute" time, while the former happens partially at "compile" time)
guitarvydas
03/17/2025, 2:16 AMjamii
03/17/2025, 3:18 AMMost live systems gain their interactivity from mutable environments and late binding. Code loading is an imperative process that can cause arbitrary side effects. The behaviour of the system can depend on what order code was loaded in, and when. There isn't even any guarantee that loading the same code in the same order will reproduce the same system.
Konrad Hinsen
03/17/2025, 9:49 AMjonathoda
03/17/2025, 2:51 PMjamii
03/17/2025, 7:03 PMI assume that in your scheme, the right way is to recompute the data after reloading the code, to ensure consistency.The point of not allowing nominal types is that data is independent of the code that produced it, so you can keep data around while reloading the code, or send it to a different process or save it to disk.
jamii
03/17/2025, 7:06 PMWhen live reloading code, do you support the common hack of allowing new fields to be added to the end of structures?I think that's something that only has meaning for nominal types. If your types are structural then they have no identity and there is no meaningful way to talk about having changed the type. But the goal of having a dynamic dialect is to have a language in which it's easy to talk about migrations. So I could write a function that adds a field to my structs.
Jack Rusher
03/18/2025, 12:35 PMjamii
03/18/2025, 6:15 PM