Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'master' of github.com:perl6/doc
  • Loading branch information
jonathanstowe committed Dec 5, 2015
2 parents 96be575 + effb68d commit b1f31c2
Showing 1 changed file with 65 additions and 27 deletions.
92 changes: 65 additions & 27 deletions doc/Language/faq.pod
Expand Up @@ -457,57 +457,95 @@ Perl 6 unifies many great ideas that aren't usually found in other programming
languages. While several other languages offer some of these features, none of
them offer all.
Unlike most languages, it offers
=item Perl 6 offers procedural, object-oriented AND functional programming methodologies.
=item cleaned up regular expressions
=item Easy to use consistent syntax, using invariable sigils for data-structures.
=item L<PEG|http://en.wikipedia.org/wiki/Parsing_expression_grammar> like grammars for parsing
=item Full grapheme based Unicode support, including Annex #29.
=item lazy lists
=item Regular expressions are cleaned up, made more readable, taken to the next level of usability, with a lot more functionality. Named regular expressions are made possible for ease of use.
=item a powerful meta object system
=item Junctions allowing easy checking of multiple possibilities, e.g. $a == 1|3|42 (meaning is $a equal to 1 or 3 or 42).
=item junctions of values
=item Dynamic variables provide a lexically scoped alternative to global variables.
=item easy access to higher-order functional features like partial application and currying
=item Emphasis on composability and lexical scoping to prevent “action at a distance”. For example, imports are always lexically scoped.
=item separate mechanism for subtyping (inheritance) and code reuse (role application)
=item Easy to understand consistent scoping rules and closures.
=item optional type annotations
=item Powerful object orientation, with classes and roles (everything can be seen as an object). Inheritance. Subtyping. Code-reuse.
=item powerful run-time multi dispatch for both subroutines and methods based on arity, types and additional code constraints
=item Introspection into objects and meta-objects (turtles all the way down).
=item lexical imports
=item Meta Object Protocol allowing for meta-programming without needing to generate / parse code.
It also offers
=item Subroutine and method signatures for easy unpacking of positional and named parameters.
=item closures
=item Multi dispatch on identically named subroutines/methods with different signatures, based on arity, types and optional additional code.
=item anonymous types
=item Compile time error reporting on unknown subroutines / impossible dispatch.
=item roles and traits
=item Optional gradual type-checking at no additional runtime cost. With optional type annotations.
=item named arguments
=item Advanced error reporting based on introspection of the compiler/runtime state. This means more useful, more precise error messages.
=item nested signatures
=item Phasers (like BEGIN / END) allow code to be executed at scope entry / exit, loop first / last / next and many more special contexts.
=item object unpacking in signatures
=item High level concurrency model, both for implicit as well as explicit multi-processing, which goes way beyond primitive threads and locks. Perl 6's concurrency offers a rich set of (composable) tools.
=item intuitive, nice syntax (unlike Lisp)
=item Multiple-core computers are getting used more and more, and with Perl 6 these can be used thanks to parallelism, both implicit (e.g. with the >>. method) and explicit ( start { code } ). This is important, because Moore's Law is ending.
=item easy to understand, explicit scoping rules (unlike Python)
=item Structured language support is provided to enable programming for asynchronous execution of code.
=item a strong meta object system that does not rely on eval (unlike Ruby)
=item Supplies allow code to be executed when something happens (like a timer, or a signal, or a file-system event).
=item expressive routine signatures (unlike Perl 5)
=item react / whenever / supply keywords allows easy construction of interactive, event driven applications.
=item state variables
=item Lazy evaluation when possible, eager evaluation when wanted or necessary. This means, for example, lazy lists, and even infinite lazy lists, like the Fibonacci sequence, or all prime numbers.
=item named regexes for easy reuse
=item Native data types for faster, closer to the metal, processing.
=item unlike many dynamic languages, calls to missing subroutines are caught
at compile time, and in some cases even signature mismatches can be
caught at compile time.
=item Interfacing to external libraries in C / C++ are trivially simple with NativeCall.
=item Interfacing with Perl 5 (CPAN) / Python modules trivially simple with Inline::Perl5 resp. Inline::Python.
=item Can have multiple versions of a module installed and loaded simultaneously.
=item System administration simplified due to simpler update/upgrade policies.
=item Floating point math without precision loss because of Rats (rational numbers).
=item Extensible grammars for parsing data or code (which Perl 6 uses to parse itself).
=item Perl 6 is a very mutable language (define your own functions, operators, traits and data-types, which modify the parser for you).
=item Large selection of data-types, plus the possibility to create your own types.
=item Multi-dimensional shaped and/or native arrays with proper bounds checking.
=item Execute code at any time during parsing of a grammar, or when a certain match occurred.
=item Adding a custom operator or adding a trait is as simple as writing a subroutine.
=item Automatic generation of hyper-operators on any operator (system or custom added).
=item Runs on a variety of back-ends. Currently MoarVM & JVM, JavaScript in development, more may follow.
=item Runtime optimization of hot code paths during execution (JIT).
=item Runs on small (e.g. Raspberry Pi) and large multi-processor hardware.
=item Garbage collect based: no timely destruction, so no ref-counting necessary. Use phasers for timely actions.
=item Methods can be mixed into any instantiated object at runtime, e.g. to allow adding out-of-band data.
=item Easy command-line interface accessible by MAIN subroutine with multiple dispatch and automated usage message generation.
=item Fewer lines of code allow for more compact program creation. Huffman-coding of names allows for better readability.
=item Lazy lists defined with a simple iterator interface, which any class can supply by minimally supplying a single method.
=item Perl 6's motto's remain the same as they have been for Perl all along: “Perl is different. In a nutshell, Perl is designed to make the easy jobs easy, without making the hard jobs impossible.” and “There Is More Than One Way To Do It”. Now with even more -Ofun added.
Please see the L<feature comparison
matrix|https://perl6.org/compilers/features> for an overview of implemented
Expand Down

0 comments on commit b1f31c2

Please sign in to comment.