Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 2592

Proposing new syntax for zero-cost unwrapping options/results

$
0
0

One part is of course that - this surfaces as a wanted feature fairly often. Features along these lines have been up for debate from time to time, but this type of feature is difficult to find a good trade off for.

A lot of thought goes into trying to keep the language simple and coherent, with a rather small syntax and API surface. That keeps the language approachable. For this particular issue people are experiencing, we feel this type of feature is a good trade off that also enables (or at least vastly enhances) patterns we want to encourage.

We’ve done a lot of work enhancing some of the builtin types (dicts with dedicated syntax + pattern matching, results are now builtin properly to the language, options always was, etc), working through the editor tooling, and so on. Encouraging using those builtins are a priority for us as well, since it’s so much easier to work on making a few set concepts and types as well supported as possible, rather than trying to cater to the general case. This is about tooling and ergonomics, but also about compiler optimizations.

Finally, one good part about let? is that since it’s just a simple syntax transform, ejecting from it (if it should ever be needed) would be trivial.


Viewing all articles
Browse latest Browse all 2592

Trending Articles