NHacker Next
  • new
  • past
  • show
  • ask
  • show
  • jobs
  • submit
How Dada enables internal references (smallcultfollowing.com)
amluto 17 minutes ago [-]
Can Dada put a value on the stack and pass any sort of mutable reference to it to a function? I don’t know the syntax, but maybe:

    let x: given i32 = 42
    f(x.mut)
    // now x == 43
If all permission variants of a type are shallowly laid out like the raw type, then x and x.mut are literally 32-bit integers, so how does one mutate it from a function body? A special boxed i32?
armchairhacker 22 minutes ago [-]
I believe places are a much better model than lifetimes, but there are challenges not discussed in this post. Ex: what would a linked list’s definition and methods look like? How does Dada handle mutation and deallocation?
nine_k 3 hours ago [-]
This is interesting and somehow neat, but how sound is it?

Lifetimes are based on affine types, which have some proven mathematics backing their properties. This is what guarantees the absence of invalid references, the fearless concurrency, etc.

What is backing the place-based system, and what formally proves that it always works?

brson 3 hours ago [-]
Quite a lot of type system modeling has gone into Dada so far, though I don't know the details. Some of that work is here: https://github.com/dada-lang/dada-model
jadengeller 3 hours ago [-]
I think this is a bit similar to Mojo's origin types: https://docs.modular.com/mojo/manual/values/lifetimes/#origi...
cc-d 3 hours ago [-]
[flagged]
3 hours ago [-]
Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
Rendered at 22:42:38 GMT+0000 (Coordinated Universal Time) with Vercel.