4 ms·
That both indicates to me why Perl 6 is cool, and also why it's a bit mad. Junctions, in the core language? Really? Wouldn't they be best placed just being a li
by hbex5 11y ago
That both indicates to me why Perl 6 is cool, and also why it's a bit mad. Junctions, in the core language? Really? Wouldn't they be best placed just being a library?
- awwaiid 11y agoYes! "Cool and also a bit mad" is a great description of Perl 6 (and maybe a few other awesome languages. At least until people get used to them... I guess we're all a bit mad!)
- deleted 11y ago[deleted]
- kbenson 11y agoAh, but when it's part of the core, that enables some other cool features (such as automatic spooling of operations to multiple CPUs for where applicable), and well thought out and stable interaction with other core features.
- Ovid 11y agoJunctions are insanely useful once you get used to them and I use them frequently. Basically, any time you have a list and you're worried the properties of any, all, or none of the list members (hmm, just about all lists), then junctions are often a very clean way of expressing the issue. if all(@ages) >= 18 { # let 'em in the club } Or: if any(@ages) < 18 { # don't let 'em in the club } Or: if none(@ages) < 18 { # don't let 'em in the club } So I use logic like the above quite a bit, however, there are plenty of areas where the above can be better if it's deeply integrated into the language. In this case, as already mentioned, it's auto-threading where appropriate. That's not an easy feature to get right if it's not baked into the language, but it's a huge win if done right. Perl 6 also has gradual typing baked in. Other languages have gradual typing as a library, but that often fails dramatically (http://blog.circleci.com/why-were-no-longer-using-core-typed/ http://blog.circleci.com/why-were-no-longer-using-core-typed...). In Perl 6, because it's built-in, not only are the failures described something Perl 6 can avoid, but there are also plenty of type checks Perl 6 can avoid at run time with integrated gradual typing (imagine that benefit in hot loops). You could even combine that with native junction auto-threading and presumably have super-fast comparisons where the needs for checking types is eliminated at run time because it's already been done at compile time. If you do that with libraries, it's awfully tricky to get right, if not impossible.