Introducing the OCaml Local Mode | OCaml Unboxed

  Рет қаралды 6,270

Jane Street

Jane Street

Күн бұрын

Пікірлер: 26
@SkinnyGeek_1010
@SkinnyGeek_1010 10 ай бұрын
What an excellent video! I fully expected to watch a dry whitepaper type of video but this was easy to absorb :)
@mathiassven
@mathiassven 10 ай бұрын
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
@jslee0909
@jslee0909 10 ай бұрын
So it's like Rust lifecycles without that manual memory management. Nice
@anarchymatt
@anarchymatt 10 ай бұрын
It's the guy from the Tweag videos 😃
@RichardEisenberg-JS
@RichardEisenberg-JS 10 ай бұрын
Happy to be back on KZbin. 😁
@vedthiru575
@vedthiru575 10 ай бұрын
FYI, there's a typo in the link to the compiler (it takes me to the branch "with-extepensions" instead of "with-extensions").
@donbasti
@donbasti 10 ай бұрын
Eisenberg - "IO monad is nothing but passing in the World as a parameter to your function" (or smth like this)
@drew-et1mm
@drew-et1mm 10 ай бұрын
its a lifetime annotation!
@RichardEisenberg-JS
@RichardEisenberg-JS 10 ай бұрын
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-uf4lf2bp8t
@user-uf4lf2bp8t 2 ай бұрын
​@@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
@hsyl20
@hsyl20 10 ай бұрын
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-JS
@RichardEisenberg-JS 10 ай бұрын
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.)
@dmmulroy
@dmmulroy 10 ай бұрын
This is cool, great intro to the topic!
@SlickMona
@SlickMona 10 ай бұрын
FYI the Github link is currently broken.
@RichardEisenberg-JS
@RichardEisenberg-JS 10 ай бұрын
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.
@jugsma6676
@jugsma6676 9 ай бұрын
Now, i think it's fixed
@moonbird2266
@moonbird2266 9 ай бұрын
What an awesome video!
@adicide9070
@adicide9070 9 ай бұрын
you trying to do some rust here now?
@RichardEisenberg-JS
@RichardEisenberg-JS 9 ай бұрын
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. :)
@adicide9070
@adicide9070 9 ай бұрын
@@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-JS
@RichardEisenberg-JS 9 ай бұрын
@@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.
@clementdato6328
@clementdato6328 10 ай бұрын
is this extension publicly available?
@RichardEisenberg-JS
@RichardEisenberg-JS 10 ай бұрын
Yes! Link is in the description.
@jameslew7269
@jameslew7269 10 ай бұрын
all fun and games until you can't unpack GADTs bc they'll escape );
@RichardEisenberg-JS
@RichardEisenberg-JS 10 ай бұрын
Do you have an example? Should work fine with unpacking GADTs.
@jameslew7269
@jameslew7269 10 ай бұрын
@@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
Annotating OCaml Variables and Returns with local_ | OCaml Unboxed
12:52
Inferring Locality in OCaml | OCaml Unboxed
22:27
Jane Street
Рет қаралды 1,4 М.
Twin Telepathy Challenge!
00:23
Stokes Twins
Рет қаралды 78 МЛН
Миллионер | 3 - серия
36:09
Million Show
Рет қаралды 1,9 МЛН
Молодой боец приземлил легенду!
01:02
МИНУС БАЛЛ
Рет қаралды 1,7 МЛН
Coding in a Random Programming Language Everyday (Huge Mistake)
17:17
Writing an interpreter... in OCaml?!?
17:10
TJ DeVries
Рет қаралды 40 М.
Master the python logging module
9:30
Timnology
Рет қаралды 2,2 М.
Jane and the Compiler
1:03:46
Jane Street
Рет қаралды 13 М.
Ocaml First Thoughts
11:49
ThePrimeTime
Рет қаралды 61 М.
uv: An Extremely Fast Python Package Manager
40:34
Jane Street
Рет қаралды 43 М.
Why OCaml
1:06:40
Jane Street
Рет қаралды 122 М.
OCaml Locals Save Allocations | OCaml Unboxed
23:25
Jane Street
Рет қаралды 2 М.
Twin Telepathy Challenge!
00:23
Stokes Twins
Рет қаралды 78 МЛН