| ▲ | andai a day ago | ||||||||||||||||||||||
> External/world effects are visible in function signatures Brilliant. I think Jai has something like that? Each function declares what it's going to touch (both read/write) globally, and I think you can specify that per block even. I haven't used Jai (I think it's not out yet) but I remember the author talking about this and it sounded like a great idea. It's related to the idea of pure functions being easy to reason about. Right now most languages don't even have a concept of pure functions, but the ones that do, just have two categories. When a function is messing with global state you do actually want to know what it's doing. I think that can be statically computed (and displayed as IDE annotations or whatever) but specifying it explicitly sounds like a good practice either way. I like that you're including other side effects (e.g. network) there too though, that's pretty cool! Another thing I'm really interested in is proofs. Not necessarily total proofs (though we seem to be moving in that direction, at least for subsets of the codebase), but just normalizing rudimentary pre and post conditions checks. I was thinking of setting it up so code can't even compile in release mode if those are missing. (Not every function would need them, but you at least want to state their absence explicitly.) I was also thinking of setting up strictness levels per function, using hashing or something, so if a function is modified, you'd have to go through a process of double checking it again. And then functions labeled e.g. level 7 strict couldn't call ones with a lower proven strictness level, and so on. I'm told that I've basically been reinventing Ada from first principles so I should probably go and take a look at that... Wait, your thing is doing hashing too... Woah. (I think that comes from proofs land or something?) | |||||||||||||||||||||||
| ▲ | jbwinters a day ago | parent | next [-] | ||||||||||||||||||||||
Thanks for the pointer to Jai! I will check it out. Yes, Jacquard uses content-addressed definitions and it should be possible to set up a process for 'review again if this changes' on top of it. Warp, the testing framework, already uses this to avoid rerunning pure tests when neither the definition or dependencies have changed. Jacquard does not currently implement proof or strictness levels, but binding those to a definition’s content identity is interesting and definitely worth exploring. What are you building that people keep comparing to Ada? | |||||||||||||||||||||||
| |||||||||||||||||||||||
| ▲ | lolinder a day ago | parent | prev | next [-] | ||||||||||||||||||||||
Not just effects, multi-shot effects: > Algebraic effects with deep, multi-shot handlers. A handler can resume a computation zero, one, or many times, which is what makes exhaustive search and exact inference ordinary library code. I love me some algebraic effects, but this sets off alarm bells for me. Multi-shot effects are neat and powerful but are incredibly difficult to reason about for humans, and given that there are few languages that have implemented them (and they're so niche with very little training data) I'm skeptical that LLMs are sufficiently better at them to make up the gap. One-shot effects are a cross between `throw` and a function call. Multi-shot are full-on delimited continuations and come with all the complexity that entails. | |||||||||||||||||||||||
| |||||||||||||||||||||||
| ▲ | fwip a day ago | parent | prev [-] | ||||||||||||||||||||||
AST hashing & effects are both used in Unison, if you want to check that out. I don't know that they have any proof-land stuff, though. | |||||||||||||||||||||||