3 ms·
More interesting link, I think: https://github.com/nickmqb/muon/blob/master/docs/muon_by_example.md https://github.com/nickmqb/muon/blob/master/docs/muon_by_exa
by saagarjha 8y ago
More interesting link, I think: https://github.com/nickmqb/muon/blob/master/docs/muon_by_example.md https://github.com/nickmqb/muon/blob/master/docs/muon_by_exa...
Uniform call syntax and constructor functions go a long way in making usage more pleasant. I’m curious about “tagged pointers”, though: is the only way to make a “union” by taking the reference of a bunch of things? Seems somewhat inconvenient. Finally, there seem to be a couple of opinionated requirements in the language, namely significant whitespace (made “worse” because you’re already using brackets to define scope) and restricting generic parameters to single-letter names that seem like they’re a bit too restrictive.
- nickmqb 8y agoCorrect, tagged pointers are just for pointer unions, a value union could be emulated using the transmute builtin function. A more general mechanism for discriminated unions is on the roadmap. It would have been nice to include it for the initial version, but I've been in stealth mode for too long already so really needed to launch ;). Re: whitespace, see my comment here: https://news.ycombinator.com/item?id=19599908 https://news.ycombinator.com/item?id=19599908 I'm not worried about single letter generic param names being too restrictive. Having more than 2 or 3 type params usually implies some fairly heavy abstraction, which is not really in the spirit of the language.
- saagarjha 8y agoMy concern with generic parameters was that I might have situations where both of them start with the same letter so I have to assign an unrelated letter to one of them (for example, say a type generic over an Iterator and Index: one of them can be I and the other one would be…J?)
- nickmqb 8y agoGood point, I agree that's a bit of an awkward case. It's something I'm planning to keep an eye on. If this becomes a problem in practice, we can do something about it.