Ask Lemmy
A Fediverse community for open-ended, thought provoking questions
Rules: (interactive)
1) Be nice and; have fun
Doxxing, trolling, sealioning, racism, and toxicity are not welcomed in AskLemmy. Remember what your mother said: if you can't say something nice, don't say anything at all. In addition, the site-wide Lemmy.world terms of service also apply here. Please familiarize yourself with them
2) All posts must end with a '?'
This is sort of like Jeopardy. Please phrase all post titles in the form of a proper question ending with ?
3) No spam
Please do not flood the community with nonsense. Actual suspected spammers will be banned on site. No astroturfing.
4) NSFW is okay, within reason
Just remember to tag posts with either a content warning or a [NSFW] tag. Overtly sexual posts are not allowed, please direct them to either !asklemmyafterdark@lemmy.world or !asklemmynsfw@lemmynsfw.com.
NSFW comments should be restricted to posts tagged [NSFW].
5) This is not a support community.
It is not a place for 'how do I?', type questions.
If you have any questions regarding the site itself or would like to report a community, please direct them to Lemmy.world Support or email info@lemmy.world. For other questions check our partnered communities list, or use the search function.
6) No US Politics.
Please don't post about current US Politics. If you need to do this, try !politicaldiscussion@lemmy.world or !askusa@discuss.online
Reminder: The terms of service apply here too.
Partnered Communities:
Logo design credit goes to: tubbadu
view the rest of the comments
https://gitlab.com/bss03/grtt is my published code. But, I have far more intuitions that I need to write code for than finished code.
While evaluating something well-typed under a context, the heap: does not need to contain a value for a binder with modality 0, must contain a single, strict value for a binder with a modality 1, must contain a single, lazy closure for a binder with a modality of ?, must contain multiple references to a shared, strict value for a binder with a modality n, must contain at least a single reference to a strict value for a binder with a modality of +, must contain at least a single reference to a lazy closure for a binder with a modality of *. Since the typing rules propagate the modalities to subterms precisely, we should be able to identify the exact point a closure must be forced to a value (or dropped) before runtime. That's in addition to being able to compile linear functions to heap updates, eliminating at least some allocations.
There's some similarities with both the exact-use-count and relevant-or-erased semirings, but I think some things (e.g. around sums) are hard/awkward/impossible to type and the ?/+/* modalities make some make things easier while still allowing the abstract machine to know exactly when to "optimize the heap" based on a runtime flow that "activates" a particular static analysis.
Of course, it's still MLTT "compatible" -- anything that would type-check in MLTT should type-check in my variation of GRTT by "simply" using the
*modality everywhere -- so you get full proofs-as-programs and a total language.I'm probably a bit off in the weeds, but it still makes my brain buzz to think about and occasionally I'll make progress. I've been a little bit distracted with https://gitlab.com/bss03/nested which should allow me to write the abstract machine as a fold, but as proven to be place I can also put a lot of programming time into (again, with sporadic real progress).
Interesting. Do you have some specific goal in mind? Like, implementing a language/library for the GRTT stuff.
Sure, eventually, I'd like a language with Haskell-ish syntax to compile to Linux x86_64 and webassembly and use the language to make better software. If my language existed today, I'd probably work on writing my own ActivityPub software, and improve/port https://github.com/NARBEHOUSE/Ben-s-Software- because my father might want it soon.