gracelang / minigrace

Self-hosting compiler for the Grace programming language
39 stars 22 forks source link

minigrace can load the wrong version of a module at runtime #310

Open apblack opened 4 years ago

apblack commented 4 years ago

Under the SHA-hashing scheme introduced to resolve #293, we are sure to find corresponding versions of source code and compiled code at compile time. But there is no guarantee that the correct version will be loaded at execution time, even if the same GRACE_MODULE_PATH is used.

I believe that the best way to resolve this issue is to include the SHA hash of the source file as an argument to minigrace.loadModule. In the browser, this argument would be ignored, but at the command line it would be used to select from the (possibly several) modules found on GRACE_MODULE_PATH, just as it is used at compile time.