-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove remnants of bytecode interpreter (or, alternatively, fix it) #37
Comments
Newbie here. I've just read the XL history and I'm still a bit confused about state of things regarding compilation with static types to a native binary. Because XL is so versatile, there can be (from what I understand) apps written in a way which does require runtime "eval" (e.g. through bytecode interpretation). There can be also apps written in a way which can be fully compiled to a native binary without any runtime "eval" and without garbage collector. And of course apps which can combine both (but I'm not sure whether XL "toolchain" does support such compilation). Am I right about this understanding? |
On 10 Jun 2021, at 21:21, dumblob ***@***.***> wrote:
Newbie here. I've just read the XL history and I'm still a bit confused about state of things regarding compilation with static types to a native binary. Because XL is so versatile, there can be (from what I understand) apps written in a way which does require runtime "eval" (e.g. through bytecode interpretation). There can be also apps written in a way which can be fully compiled to a native binary without any runtime "eval" and without garbage collector. And of course apps which can combine both (but I'm not sure whether XL "toolchain" does support such compilation).
Am I right about this understanding?
You are right about the theoretical understanding. However, there was never a fully functional implementation that worked without garbage collection. I never completed a type inference that was solid enough. It took me a while to understand why I was running into problem, until I reduced it to the fact that XL as currently defined accepts the following type:
type goedel is (X: not goedel)
In other words, something belongs to the goedel type if it does not belong to the goedel type.
I am still trying to figure out what is the minimum set of rules that allows me to deal with cases like this correctly. An option would be to remove not. There are other ideas. None I like.
… —
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#37 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAM6BNCE34YEDJHBF3FQZPDTSEGDHANCNFSM4KSCXCSA>.
|
Ok, I understand.
Could you point me to those ideas? Generally it'll need to be some trade-off. I wouldn't like any "one solution rules them all" approach (like the "remove not"). But I'd say some of the state space can be covered with higher-level rules with higher precedence (new "axioms" - maybe tens or hundreds of them) and the rest will be an error (i.e. let the user decide). I myself don't care the language is undecidable, I just need it compile the code to HW-executable binary 😉. For decidability etc. there are special tools like Kind. |
I would intuitively think a contradictory definition like above would simply equate goedel to something like the "never"/! type in rust; a type to which no value belongs. I guess that's sort of like nil in current XL? I'm unsure whether nil is more like null/None, void/()/Unit, or Never. null/None being "there could be something, but there isn't", void/()/Unit being a valid value that carries 0 bits of information, and Never/! being an unconstructible type (also defined as a sum type with 0 variants). Or maybe it's all of the above? Would just saying "goedel is a type for which no value exists" be correct/usable? In rust such types are used to represent the return value of expressions that do not ever return, such as panic!, abort, exit, or a truly infinite loop. I think such a type could also be called "bottom" or ⊥, but I'm not entirely familiar with the more mathematical definitions of things. I'd think the only major difference would be "there happens to not be a matching value for this type" vs "there can never exist a value that fulfills this definition", so that a type |
Not really: it's a type for which I cannot decide anything at compile time, and would run into an infinite loop if I checked it at runtime. It is the type system equivalent of a definition like
The XL
I don't think so. I think it's more like In theory, with the current definition, you could create in XL a
Yes, the type for "unreacheable code" for example is a slightly (if related) problem. However, that one is decidable at compile time. As a matter of fact, it primarily exists to allow the compiler to optimize away stuff at compile-time when it's known by the developer that a case cannot exist.
A difference in terms of implementation is whether I can use that to actually generate better code. |
The bytecode interpreter (
-O1
option) is entirely broken.Choose one of the following options:
The text was updated successfully, but these errors were encountered: