3 ms·
Show me the more advanced parts of the language, are they transducers, monads, functors, natural transformations, auto-compilers, self-replicating systems, high
by lovboat 11y ago
Show me the more advanced parts of the language, are they transducers, monads, functors, natural transformations, auto-compilers, self-replicating systems, high AI in action, ML, NLP. What is the honey spot for this new language?
- justinator 11y agoIt may be Perl 6, but it's still Perl - and Perl is good for, "Getting Your Shit Done"
- raiph 11y agoA lot of the advanced stuff is internal work leading to a simple exterior (at least in principle, modulo bugs and optimization work). Think "tormenting implementors on behalf of users". For example, in Perl 6 a character at the language level is a grapheme. This is per a proper understanding of the Unicode standard. It seems that most folk (and language designers/designs, including eg gvr/py3) don't/didn't realize that Unicode always intended graphemes as the obligatory ultimate destination for modelling "characters" and providing truly clean Unicode text handling. (Swift has attempted the same thing but their current character iterating implementation and API are clearly inappropriate long term for a performant text manipulation focused language so they'll surely have to redo that part of Swift over the coming years.) Another example is the parallelizing, async, and concurrency features in Perl 6. These are all surprisingly simple to use and performant but took a lot of design talent, and engineering talent under the hood, to get right internally and simple externally. Sticking to positive stuff for a moment longer, some features bring important concepts from decades past in to this century. Most notably, afaict, Perl 6 provides a universal unrestricted grammar[1]. Aiui this could put help put "string rewriting", a relatively neglected mathematically proven isomorphism to the lambda calculus and turing machine models of computation, back on the map. It will be interesting to see what happens as Perl 6 matures. The biggest downside I see, beyond widespread negative associations with the name 'Perl', is immaturity. Perl 6 has lots of bugs, poor doc, is currently slow as molasses for a lot of stuff, and so on. [1] https://en.wikipedia.org/wiki/Unrestricted_grammar https://en.wikipedia.org/wiki/Unrestricted_grammar
- ekiru 11y agoI haven't been using Perl 6 lately, but, as of a few years ago when I did, some of the more notably unusual features or planned features were: * Grapheme-level string processing, even when there's no pre-composed Unicode codepoint for the grapheme. I think Swift is now doing this, too, but I'm not sure if anyone else is. * Perl 6's grammars are to an extension of parsing expression grammars what the regular expressions in Perl 5/Ruby/JavaScript/etc. are to an extension of regular expressions. One can use PEGs (or other grammar formalisms) in any language with a library or code generator, but, with a few exceptions like Parsec, it's usually not nearly as convenient. * Roles, similar to the traits concept developed by Nathanael Schärli, Stéphane Ducasse, Oscar Nierstrasz, and Andrew P. Black (and present under that name in e.g. Squeak Smalltalk and PHP since 5.4). Roles/traits are similar to mixin-style multiple inheritance, except that, when including multiple traits with conflicting methods, the including class must explicitly resolve the conflict. Mixin-style systems use an implicit linearized method-resolution order, which is more fragile because newly added methods in earlier mixins can silently override methods of the same name from another mixin that the caller was actually intending to call. * Multiple dispatch is not unique to Perl 6, but it's not especially common, and it's very convenient. * Configurable object representations. For example, a class can be defined to use the default P6opaque representation, which is I think usually implemented as a pretty standard struct-like representation with properties at fixed offsets. Other possibilities might be a hash table representation, where an object is represented by a hash table and attribute access is done by accessing the values of appropriate keys in the hash table. If one wants to forgo the optimizations allowed by fixed representations, one can even define a class with `is repr(*)` to allow individual objects of the class to be created with different representations.
- kbenson 11y agoHere's a short list of some interesting things: phasers[1], lazy evaluation, feed operators[2], grammars[3], meta/hyper operators[4], subtypes[5], multiple dispatch[6]. 1: http://design.perl6.org/S04.html#Phasers http://design.perl6.org/S04.html#Phasers 2: https://en.wikibooks.org/wiki/Perl_6_Programming/Lazy_Lists_and_Feeds https://en.wikibooks.org/wiki/Perl_6_Programming/Lazy_Lists_... 3: http://design.perl6.org/S05.html#Grammars http://design.perl6.org/S05.html#Grammars 4: http://design.perl6.org/S03.html#Binary_hyper_operators http://design.perl6.org/S03.html#Binary_hyper_operators 5: http://design.perl6.org/S12.html#Types_and_Subtypes http://design.perl6.org/S12.html#Types_and_Subtypes 6: http://design.perl6.org/S12.html#Multisubs_and_Multimethods http://design.perl6.org/S12.html#Multisubs_and_Multimethods