Readit News logoReadit News
hoping1 commented on De Bruijn notation, and why it's useful   blueberrywren.dev/blog/de... · Posted by u/blueberry87
Joker_vD · 7 months ago
> Now we're cool! Everything works as expected, and it takes much less work

Does it though? It's about the same amount of work as in renaming potentially conflicting variables (and more work than renaming actually conflicting variables). AFAIK, the main argument for them (by B. C. Pierce in his TAPL?) is that if you botch up the implementation of de Bruijn indices/levels, it will blow up in your face almost immediately, while the conventional renaming schemes may have subtle undetected bugs for months.

hoping1 · 7 months ago
This and the other comment under this seem to be talking about the work the computer is doing at runtime. I believe the point is about the developer's work in implementing this. (For example, renaming potentially conflicting variables is clearly _less_ work than renaming only the actually conflicting variables, in this framing.) This kind of work is important for (1) compilers whose bugs are potentially very financially expensive, and (2) compilers with very intentionally-portable implementations (including but not limited to educational implementations)
hoping1 commented on De Bruijn notation, and why it's useful   blueberrywren.dev/blog/de... · Posted by u/blueberry87
guerrilla · 7 months ago
I've implemted this several times before (years ago), but somone tell me, why don't we just consider variables unique. Each instance of a name* should have an absolute (i.e. global) sequence number associated with it. That seems simpler than this relative sequence numbering and the complexity that comes from it.

Scrolling comments, I see somone else nentions this as well. I feel like this is something that got stuck in academia hell but in practice could be solved in more oractical ways. I remember various papers on fresh naming and name calculi from the 00's but why? We have a parser and we have numbers.

The reason I bring this up is because I recall it being easy to introduce bugs into de Bruijn calculi and also adding symbolic debugging to real-world languages was annoying for reasons I have no memory of.

* Note I said name not variable. (\ x . x (\x . x)) Would be (\ x#0 . x#0 (\x#1 . x#1)) similar to de Bruijn indices but could differ in other situations.

hoping1 · 7 months ago
See cvoss's comment in another thread:

" What happens in the evaluator when you have

(\ a . a a) (\ x . \ y . x y)

Variables are uniquely named at parse time, but after one beta step, you have two distinct instances each of x and y, albeit in different scopes, and after a second beta step, you have two distinct variables named y in the same scope. "

This doesn't come up in most mainstream languages, but Zig and Jai are getting people excited about comptime evaluation, and dependent types need comptime evaluation as well. Uniqueness is fine until you're doing higher-order evaluation in your compilation pipeline like this, which will be more and more desirable in the future, at least if the current trends are any indication.

hoping1 commented on Linear Logic: Par, a Friendly Explanation   ryanbrewer.dev/posts/par/... · Posted by u/hoping1
hoping1 · 9 months ago
An accessible introduction to the infamous Par operator, with a focus on intuition. Notably, this is on the broader concept of multiplicative disjunction, which appears even outside of linear logic!
hoping1 commented on Par Part 3: Par, Continued   ryanbrewer.dev/posts/par/... · Posted by u/hoping1
hoping1 · 10 months ago
Alternative title: Par and Constructive Classical Logic.

I've finally rounded out the Par trilogy, on sequent calculus, linear logic, and continuations! This post was the point of the whole series, and the most likely to contain things you haven't already heard. I really love par and the theory around it; the elegance is incredibly satisfying. I hope I can share that with you!

hoping1 commented on A Tutorial on Linear Logic   ryanbrewer.dev/posts/line... · Posted by u/hoping1
hoping1 · 10 months ago
A new guide on linear logic! Much deeper than the usual "imagine a vending machine" guide, though I do mention the connection to that at the end lol. This is great for getting an intuition for substructural logics in academic papers, as well as the notorious multiple-conclusion sequents used in, say, type systems for safe parallelism. The post prior gives the necessary background on sequent calculus, if needed. This series is on much of the most beautiful theory ever, and I hope you enjoy!!
hoping1 commented on Linear Logic – Par Part 2   ryanbrewer.dev/posts/line... · Posted by u/hoping1
yo_yo_yo-yo · 10 months ago
What are your plans for future posts in this series? You’ve done some nice work here. Where were you introduced to this subject? Looking forward to more, especially because your presentation is so clean.
hoping1 · 10 months ago
I'm glad you liked it! I have one more post planned for this series, on par and using continuations for classical logic proof terms. I have two other posts in the works but they aren't part of this series, which will only have that one more post. Much of what I learned was from blog posts like this one, or at least they got me to the point where I could understand the papers on my own. Blog posts, YouTube, reddit, discord, all helped me a ton. Originally I just wanted to make a cool programming language, but the more research I learned the more my interest shifted to the research, because it's just so unbelievably gorgeous and elegant!
hoping1 commented on Linear Logic – Par Part 2   ryanbrewer.dev/posts/line... · Posted by u/hoping1
Cascais · 10 months ago
Nice work :)
hoping1 · 10 months ago
Thanks!

u/hoping1

KarmaCake day111December 11, 2023
About
The creator of SaberVM. https://ryanbrewer.dev/posts/announcing-svm.html
View Original