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. At Jane Street we 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.
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? Is the thought that, honestly, this will never happen given Jane Street's track record in the community and the level of battle testing that this process brings to the design process?
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.
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.
> 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.)
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...
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.
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.
* 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?