|
|
|
|
|
by patrickas
2486 days ago
|
|
Off the top of my head:
Concurrency and parallelism using high level and low level APIs. There is no GIL. Grammars which are like regular expressions on steroids for parsing. ( admittedly still not optimized for speed) Gradual typing, you can go from no types at all for short one liners, to using built in types, to defining your own complex types for big programs. subset Positive of Int where { $^number > 0; } #create a new type called Positive
multi factorial(1) { 1 } #multi subroutines that dispatch on type
multi factorial(Positive \n) { n * factorial(n-1) }
#say factorial(0); #Error type mismatch
#say factorial(5.5); #Error type mismatch
say factorial(5); #120
hyper for (1 .. 1000) -> $n { #use hyper indicate for loop can be run in parallel on all available CPUs
say "Factorial of $n is { factorial($n) }"; #Gives correct results by automatically upgrading to big int when needed
}
|
|