News for hackers. Stuff that matters.
Re:Jane Street Tech Blog – Oxidizing OCaml: Locality by yafbum on Saturday May 27, 2023 @01:27PM (#36096502)
This is a great idea, but I have questions

* Is there a process for upstreaming this into the mainline language, or is this essentially JaneStML now?

* Why choose such an obscure word as `exclave` to indicate return-value optimization? How about `return local` or something similarly approachable?

Re:Jane Street Tech Blog – Oxidizing OCaml: Locality by ReleaseCandidat on Saturday May 27, 2023 @02:21PM (#36096948)
They always had their own version of the compiler: https://github.com/ocaml-flambda/ocaml-jst/tree/main

Many of their changes have been ported to the 'official' OCaml compiler.

Re:Jane Street Tech Blog – Oxidizing OCaml: Locality by HyperSane on Saturday May 27, 2023 @02:27PM (#36097006)
Using obscure works makes some people feel smart.
Re:Jane Street Tech Blog – Oxidizing OCaml: Locality by malkia on Saturday May 27, 2023 @02:39PM (#36097103)
Explain std::launder then - https://en.cppreference.com/w/cpp/utility/launder - it's simple word, mostly used when talking about dirty money ;) - but hey - I've still no idea how/when/why to use it...

;)

Re:Jane Street Tech Blog – Oxidizing OCaml: Locality by saghm on Saturday May 27, 2023 @04:39PM (#36098075)
Using simple words in confusing contexts also makes people feel smart. Essentially any way of being technically correct in confusing ways has this effect; "I'm so much smarter that you can't even understand _why_ I'm right" is too juicy a flex for some people to avoid.
Re:Jane Street Tech Blog – Oxidizing OCaml: Locality by malkia on Saturday May 27, 2023 @07:24PM (#36099433)
https://twitter.com/ciura_victor/status/1662536472342192128

"Rinse and repeat That’s my std::launder joke "

best answer I've got so far :)

Re:Jane Street Tech Blog – Oxidizing OCaml: Locality by still_grokking on Sunday May 28, 2023 @03:00AM (#36101791)
Actually the word "launder" seems to be quite to the point given what this does.

I'm not a C/C++ developer and I have to admit: For me reading anything about those languages is every time just mind-bending! (And I have a hard time not to use any curse words right now in addition).

It took me over 20 minutes to understand (more or less) what this `std::launder()` does. The spec is just gibberish! So I've tried a BS generator a.k.a "AI" than[1]. Together with a Stackoverflow entry[2] it finally made click.

This function "launders" pointers from compiler assumptions. It will give you a "clean", pristine pointer back, without for example the information about the concrete object attached to it previously (because for example casting an object to its base class won't give you a proper pointer to the base class; at least that's what as SO comments says… Sounds quite ill, but so is C++). It will also for example "launder" away compiler assumptions about the `const` property of an object pointer. It's needed for example when you do "in-place replacement of an object" (replacing directly the bytes in some memory area of another object). Just casting won't make the compiler "forget" where this memory came from / to which object it was once attached. So you need to launder the pointer to the new object so the compiler forgets what it assumed previously about that memory area.

But let's not talk about what it actually means when a language needs some mechanism like that… My "WTF per Minute" output just reached a new all time high, I guess.

[1] https://www.phind.com/search?cache=91e3f5ce-dde2-422e-a3eb-6... [2] https://stackoverflow.com/questions/66176720/why-introduce-s...

Re:Jane Street Tech Blog – Oxidizing OCaml: Locality by malkia on Sunday May 28, 2023 @02:01PM (#36106285)
Holy - the explanation you provided clicked for me! Thank you!

And I should use now `phind.com` - awesome!

Re:Jane Street Tech Blog – Oxidizing OCaml: Locality by ReleaseCandidat on Saturday May 27, 2023 @02:32PM (#36097050)
Exclave is also a (PPX - that's a kind of preprocessor for generating the actual code) keyword: `[%exclave]`. Using this avoids name clashes.

See: https://ocaml.org/docs/metaprogramming

Re:Jane Street Tech Blog – Oxidizing OCaml: Locality by lpw25 on Saturday May 27, 2023 @03:40PM (#36097547)
Our long term aim is to upstream all of our work from our branch of the OCaml compiler. Of course, that is contingent on the ideas we’re developing there being accepted by the community. There are two main reasons we work on our own branch:

1. Language design is hard. And we at Jane Street have a great opportunity to design new features, test them extensively in a realistic environment, and then change them. Because we have access to the entire code base where the features are deployed, we can even change concrete syntax relatively easily. So by developing internally, releasing internally, and then upstreaming with experience, we can be more confident that the feature design is correct.

2. We get a faster turnaround between idea conception and internal deployment. Working solely with upstream, we would develop an idea, go through a long design discussion with upstream, implement, merge, wait for release, wait for the rest of Jane Street to be ready to upgrade, and upgrade. Now, we can implement an idea in parallel with its design, rolling it out internally in stages (as appropriate), and then upstream later. This is a big win for us, and well worth the extra time spent moving changes back and forth.

> Why choose such an obscure word as `exclave`

We discussed a lot of possible choices and eventually decided this was the best one. I personally think names should either be self-explanatory or memorable -- so that once they have been explained they aren't forgotten -- here we went with memorable. As a word, exclave also captures what is going on in terms of part of the parent region being contained within the child region. `return local` was a strong contender, but it implies that `exclave` is always about functions -- whereas the actual feature is a bit more general than that. It is also a bit easier, when adding new keywords, if you pick a word that isn't used much, and `return` is used a lot.

Re:Jane Street Tech Blog – Oxidizing OCaml: Locality by yawaramin on Saturday May 27, 2023 @04:56PM (#36098223)
I was reading the post and thinking 'glocal' :-D
Re:Jane Street Tech Blog – Oxidizing OCaml: Locality by c-cube on Saturday May 27, 2023 @06:15PM (#36098929)
As someone from the community, I absolutely love this design (and blog post). It would be especially great for returning options, tuples, results, etc. with no overhead at all.

I suppose it could also be useful to allocate int64, floats, and maybe even bigints on the data stack? I suppose it's more difficult to put C blocks like bigints or bigarrays in a region.

Re:Jane Street Tech Blog – Oxidizing OCaml: Locality by electroly on Saturday May 27, 2023 @07:38PM (#36099553)
This process seems to intentionally cut off upstream from having input into the design of the features during development when there's still a chance to change it. What happens when you implement something that you like, release it internally, but then it turns out upstream doesn't like it or wants it a different way? Will you maintain your feature on your fork forever (thus JaneStML), or will you abandon your feature?
Re:Jane Street Tech Blog – Oxidizing OCaml: Locality by nequo on Saturday May 27, 2023 @11:01PM (#36100768)
Another possibility is to change the design based on upstream feedback and adjust the internal codebase to it.

By parent’s description, those codebase adjustments are done during the iterative process of feature development too. Upstreaming would just be the last iteration.

Re:Jane Street Tech Blog – Oxidizing OCaml: Locality by michaelcampbell on Monday May 29, 2023 @09:00AM (#36113511)
> should either be self-explanatory or memorable -- so that once they have been explained they aren't forgotten

For years I've had a pet, personal theory on the hierarchy of naming; and these were my first 2 "levels". I never heard anyone else ever blurt it out in these terms. (My thought was that I was weird, or it was just so obvious that no one ever needed to.)