What an excellent video! I fully expected to watch a dry whitepaper type of video but this was easy to absorb :)
@mathiassven10 ай бұрын
Glad to see you back on YT! I might pick up OCaml just so I can follow along, your videos are always incredibly insightful on whatever topic you speak on
@jslee090910 ай бұрын
So it's like Rust lifecycles without that manual memory management. Nice
@anarchymatt10 ай бұрын
It's the guy from the Tweag videos 😃
@RichardEisenberg-JS10 ай бұрын
Happy to be back on KZbin. 😁
@vedthiru57510 ай бұрын
FYI, there's a typo in the link to the compiler (it takes me to the branch "with-extepensions" instead of "with-extensions").
@donbasti10 ай бұрын
Eisenberg - "IO monad is nothing but passing in the World as a parameter to your function" (or smth like this)
@drew-et1mm10 ай бұрын
its a lifetime annotation!
@RichardEisenberg-JS10 ай бұрын
Indeed! Well, it's a little different from Rust's interpretations of lifetime (ours are simpler; Rust's are more expressive). But I didn't want to start by assuming knowledge of Rust.
@user-uf4lf2bp8t2 ай бұрын
@@RichardEisenberg-JSI think simpler is better for something that can become as mind-numbing to take care of manually as lifetimes. In rust, they tend to blow up, pushing you to just clone everything everywhere
@hsyl2010 ай бұрын
It would be nice to have this in Haskell too! We could assert that a param isn't stored in a thunk (think `DynFlags` in GHC itself). How difficult would that be to implement?
@RichardEisenberg-JS10 ай бұрын
I think thunks should be fine; it's just that the thunk itself would have to be local in order to capture local data. It would be a pretty major lift, though -- getting this working in OCaml wasn't easy. (I don't take credit, as most of it was implemented before I started at Jane Street.)
@dmmulroy10 ай бұрын
This is cool, great intro to the topic!
@SlickMona10 ай бұрын
FYI the Github link is currently broken.
@RichardEisenberg-JS10 ай бұрын
It seems to work for me, even when I log out. Looks like YT redirects to snag some analytics; maybe that's the problem somehow? If you search for "Jane Street opam repository", you'll find it. You might need to follow a link at the bottom to get our compiler extensions; should be hopefully clear from context.
@jugsma66769 ай бұрын
Now, i think it's fixed
@moonbird22669 ай бұрын
What an awesome video!
@adicide90709 ай бұрын
you trying to do some rust here now?
@RichardEisenberg-JS9 ай бұрын
Well, yes! Rust is an inspiration for what we're up to, but we're not trying to mimic it directly. Instead, we see how Rust uses lifetimes to effectively allow stack allocation, and we want that, too. :)
@adicide90709 ай бұрын
@@RichardEisenberg-JS, sure, I get it. but as a dude that is trying to get into ML, with OCaml already being a hard sell -- queries like "Why Ocaml sucks" bring up interesting, if sometimes outdated, results -- it looks a bit cumbersome to throw this in the mix. just like the sentence I just wrote, inadvertently!
@RichardEisenberg-JS9 ай бұрын
@@adicide9070 Makes sense. There's always a delicate balance between expressiveness and simplicity. We're hoping to gain experience by targeting primarily fellow Jane Streeters, figure out where the pain points are, and then try to make it so that all of this becomes simple. One nice bit of feedback I've gotten roaming the office is that some programmers here don't even really know what locals are -- that means that you can successfully use OCaml without knowing about this niche feature.
@clementdato632810 ай бұрын
is this extension publicly available?
@RichardEisenberg-JS10 ай бұрын
Yes! Link is in the description.
@jameslew726910 ай бұрын
all fun and games until you can't unpack GADTs bc they'll escape );
@RichardEisenberg-JS10 ай бұрын
Do you have an example? Should work fine with unpacking GADTs.
@jameslew726910 ай бұрын
@@RichardEisenberg-JS i had an issue with unpacking GADTs where their type escaped the region. it works as intended but have to be careful bc so many ways fail. which is good since thats partially why local_ is there, to spot mistakes