1. Locality: https://blog.janestreet.com/oxidizing-ocaml-locality/ (Discussion: https://news.ycombinator.com/item?id=36094799)
2. Rust-style ownership: https://blog.janestreet.com/oxidizing-ocaml-ownership/
144 karma · joined February 14, 2014
1. Locality: https://blog.janestreet.com/oxidizing-ocaml-locality/ (Discussion: https://news.ycombinator.com/item?id=36094799)
2. Rust-style ownership: https://blog.janestreet.com/oxidizing-ocaml-ownership/
Part 1: https://blog.janestreet.com/oxidizing-ocaml-locality/
Part 2: https://blog.janestreet.com/oxidizing-ocaml-ownership/
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.
Pet peeve: OCaml's concurrency is pretty good, it's parallelism that it struggles with.
You can see some things on:
https://github.com/ocamllabs/ocaml-modular-implicits
but you shouldn't take a lack of activity on there as a sign nothing is happening. For instance, Frederic is actively hacking on the prototype at the moment but hasn't pushed anything to that repo.Judging academia from your experience on program committees is like judging the entertainment industry from watching Britain's Got Talent.
let f x = x + x
will be inferred as int -> int.For OCaml:
- row polymorphism (in particular polymorphic variants)
- higher-order and applicative functors (not the Haskell thing).
- first-class modules
For both:
- Higher-rank polymorphism
For Haskell (and now in both):
- GADTs
By introduced here, I'm ignoring them being implemented in toy languages first (since that is simply the first step of introducing them to programming). Similarly, it is not reasonable to say that F-omega or a dependently typed calculus already had such features, because that ignores issues of type inference and efficient implementation.
Anecdotally from one specific well-known troll. (I'm not saying it is or isn't true, just that almost all of these claims originate from a single individual with an axe to grind).
For example, see this section of Real World OCaml:
https://realworldocaml.org/v1/en/html/classes.html#open-recu...
Consider the case of a set implemented as a binary tree. The type of such a set should be parametrised by the type of the elements and the ordering used. With applicative functors this is the case as your set type will be `Set(O).t` where `O` is a structure containing the type and the ordering. With generative functors each individual set type is abstract -- so the type itself is not parameterised by the ordering.
You could consider this to be just an example of what you are calling "Modular Type Classes", but there doesn't need to be a system of implicit module parameters for it to be useful.
Modular implicits: https://github.com/ocamllabs/ocaml-modular-implicits
js_of_ocaml has good code size and performance in my experience. Interop with js is variable -- some js libraries are inherently typed and are easy to bind to in a well typed way, others use very dynamic typing and those are difficult to bind.
I think the opposite is true. Good programmers know where the risks of subtle bugs are, and will use the appropriate tools (e.g. good use of a decent type system, well documented code with well designed abstractions) to make completely sure they don't exist.
This just leaves simple stupid bugs in the parts of the code where any such bug will manifest itself quickly and obviously, exactly the kind of thing caught by code review.
Another way to put it would be: good programmers design their code in such a way that all bugs are catchable by code review.
I believe the main use is for embedded DSLs. I'm afraid I don't have any practical examples on hand to link to.
I like F#, but this just isn't true:
- Polymorphic variants
- GADTs
- Module system
The last one, in particular, is one of the best features of OCaml.
Maybe, although it is also not type safe because Haskell doesn't have a value restriction for polymorphism. (or looked at another way Haskell's value restriction assumes that function application is a value).
Still, I enjoyed reading the post, and it is good to see people looking to improve OCaml and make suggestions.
Maybe http://rgrinberg.com/blog/2014/04/04/introducing-opium/ is relevant.