http://qs321.pair.com?node_id=1107123


in reply to Re^2: The future of Perl?
in thread The future of Perl?

Perl6 like Perl5 is a high-level language that is able to reach down to low-level things like bit strings and fine-grained control over system calls. With XS and the the FFI C is part of the Perl5 language. Perl6 has a much improved FFI. One of the goals of Perl6 is to have compilation and as far as I remember that includes JIT, precompilation, partial precompilation, separate compilation, and optimizations. Perl6 supports optional static typing for faster and safer programs.

Go, Rust, and D on the other hand are systems languages but are not so low-level as C. They are all growing toward higher-level concepts but retaining as much compilation speed and runtime speed as they can.

Go for example has goroutines, maps, slices, a continue for loops, support for imaginary and complex numbers, labelled goto, methods, a return of possibly multiple values, panics, channels, and more. It compiles quickly for fast development iterations. It has regular expressions in its standard library (although they aren't as integrated into the language as in Perl). Strings, although immutable, are a separate type from characters and aren't just bare character arrays.

Rust has vectors that support push and pop. It has variable interpolation. It has traits and dynamic dispatch. You can pass closures. Its match is closer to Perl's smartmatch than to a C switch. The 'if' block is an expression rather than a statement, so it can return a value to a 'let'. This is a great generalization of something like the ternary operator or Puppet's setcode() or Puppet's case statement. It supports channels for communication. There are both references and pointers. Rust's regex library supports iterating over capture groups, supports named and numbered captures, supports character classes, and more.

D's regex library is part of the standard library. It supports matches, splits, replaces, etc. D has associative arrays built into the language. It has mixins, operator overloading, contracts, attributes, traits, exceptions, and try/catch/finally/throw.

Go and D are garbage collected. What I've mentioned just scratches the surface. That I've mentioned a feature for one of the three doesn't mean it doesn't exist in the other two. Some of the features in these languages actually borrow from Perl, Python, and Ruby in syntax or inspiration.

There's a lot of growing downward from higher-level languages these days. Perl has always been at the forefront of allowing one to reach down into the system a bit. There's a lot of growing upward from some of these newer low-level languages, too. As people look at object-oriented, perhaps compiled or JIT compiled, modular languages with strong standard libraries and the ability to prototype and iterate quickly I see Rust, D, and Go as a niche just adjacent to Perl6, Clojure, and perhaps Lua.