Conversation

Are there any languages that can decouple logical representation from physical representation in this way? The only language I can think of that might be able to do it is ATS, but I don’t know ATS. Can I write an inductive GADT that is represented as a packed array in ATS?
16
36
I have often thought about this - about ways to decouple the declarative structure from the physical representation. I want to be able to declare my inductive type, but also have multiple ways of translating that into some target memory layout in a way that's not too onerous.
1
3
This Tweet is from a suspended account. Learn more
Oh cool! I’ve been hoping to use something like that in Pikelet (although in probably a less rigorous form). Currently trying to learn about how multistage programming fits in. Seems kind if handy for offline partial evaluation I think?
2
You could then have some user-defined struct/union packing algorithms that could run at compile time on datatype descriptions, that could figure out how to lay things out, and assign tag bits, etc.
1
and I were discussing similar ideas, seeing if the modality in twitter.com/dannygratzer/s might work for this kind of staging. Unfortunately con_nat [pg9] is not very staging-friendly, and it's not clear how to rule it out in a reasonable way.
Quote Tweet
I'll be talking about Implementing a Modal Dependent Type Theory, looking forward to seeing people there! preprint: jozefg.github.io/papers/2019-im
Show this thread
1
András had some other ideas based on universe levels, the naive version of which had the problem of not being able to distinguish compile-time from runtime booleans (e.g.); I don't remember if the more sophisticated attempts had better success.
1
Yeah, I saw that one! They had a talk on it at POPL: youtube.com/watch?v=gCsb1a Thought the cross-stage persistence and quoting/unquoting seemed pretty neat and useful! What do you mean by 'syntax-heavy'? Curious about what you would want to do differently and why.