Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
b2gills
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
17 ms
·
91.
▲
by
b2gills
7y ago
The `start` statement prefix operator is a bit like Go's `go` keyword. (In that when I translate Go into Raku, I usually replace `go` with `start`.) my Channel \input .= new; my Channel \output .= new; start for input -&
92.
▲
by
b2gills
7y ago
Raku has `await` but it doesn't need `async`. sub foo ( Int \n where 1..100 ) { # ___ start is a prefix operator that creates a Promise # V start { sleep n.rand; (1..n).pick } } my $result = foo(10);
93.
▲
by
b2gills
7y ago
Rakudo does have macros. They weren't good enough to be enshrined in the Perl6 language itself. So there is a project named 007 for exploring how macros should work in Perl6.
94.
▲
by
b2gills
7y ago
In reality Perl6 is strangely consistent.
95.
▲
by
b2gills
7y ago
Sure you know what `sum` means, and maybe even what `product` means. `sum` is applying `add` repeatedly to a list. `product` is applying `multiply` repeatedly to a list. The thing is most people use `+` instead of `add`. Also why use two
96.
▲
by
b2gills
7y ago
Why does it have to be any of those things? Can't it just be its own thing for the sake of being itself? --- If you want a compelling reason to be Perl6, how about one of these: It brings together many features from many different lang
97.
▲
by
b2gills
7y ago
Fairly early in the life of Perl6 it was basically decided there wasn't going to be a transition. Not like the Python one at least. Also I've heard about projects that transitioned from Python2 right to Go. (The way it sounded, it
98.
▲
by
b2gills
7y ago
Perl 6 supports all kinds of paradigms, this makes it so that you don't have to write parts of the code in different languages and try to cobble them together. So the code can be written using the clearest paradigm for the task at hand
99.
▲
by
b2gills
7y ago
You're right Perl 5.18 is no longer being maintained. But Perl 5.30 is still maintained, and almost all Perl 5.18 code should run on it unaltered. --- As far as I know, there is no-one who is involved with maintaining both Perl5 and Pe
100.
▲
by
b2gills
7y ago
Many of those are because one way to write the code is slower than another way to write it. So it is more about the speed not being evenly distributed.
101.
▲
by
b2gills
7y ago
Someone once posted Perl6 and C/C++ code to #perl6 on freenode.net According to them, Perl6 was faster. (The Perl6 code was also a lot shorter, and I could argue it was easier to understand.) --- My guess is that the reason was that th
102.
▲
by
b2gills
7y ago
In 1998 you would definitely need closures and objects to replace Perl, since Perl has had both since 1994. I was using closures to great effect in Perl before I even knew what a closure was. (Are closures supposed to be a difficult or extr
103.
▲
by
b2gills
7y ago
I've heard that Perligata has actually been used in production. (It was similar to their native language.)
104.
▲
by
b2gills
7y ago
For some benchmarks Perl6 is faster than Perl5. One person posted to #perl6 on freenode.net code written in both Perl6 and C/C++. They reported that the Perl6 code was faster. (I'm sure that the difference is mainly because the C&
105.
▲
by
b2gills
7y ago
MoarVM has gotten an optimization where it doesn't always have to actually generate the object. Though that is more about time optimization than space optimization.
106.
▲
by
b2gills
7y ago
Even better than that, if you create a new infix operator: sub infix:<OP> ( $a, $b ) {…} You get `OP=` for free: $x OP= $y; # $x = $x OP $y That is because `=` is actually a meta operator. (It takes an infix operator
107.
▲
by
b2gills
7y ago
Not to mention that just about all of the changes I've heard about in Python from 2 to 3 are changes that Perl5 has already handled in a backwards compatible way. (In at least some cases the changes happened more than a decade ago.)
108.
▲
by
b2gills
7y ago
Rust's match blocks appear to be less powerful than the smart-match feature in Perl6. Rust doesn't appear to allow arbitrary code in the condition. --- given 1 { when (0 ≤ * ≤ 9) { 'digit' } } Expandin
109.
▲
by
b2gills
7y ago
It only appears superficial because you have only looked at the surface of it. Perl6 brings together features from many languages, but makes them feel as if they have always belonged together. Imagine writing Haskell and C code in the same
110.
▲
by
b2gills
7y ago
Perl6 is “supposed” to have syntax macros. Rakudo has a macro feature, but the current design was deemed not good enough to be part of the Perl6 specification testsuite yet. There has been design work in this area in the 007 project. https
111.
▲
by
b2gills
7y ago
Actually this feature is in Perl5, you just have to ask the compiler for a recent enough version. Though it has been marked as experimental because the Perl6 design for this didn't fit into Perl5 as well as was hoped for. That is it ha
112.
▲
by
b2gills
7y ago
Perl6 has a fallthrough keyword named `proceed`. It also has a keyword named `succeed` which is the default for `when` blocks. given 1 { when Int { say 'integer'; proceed } if 0 ≤ $_ ≤ 9 { say 'digit';
113.
▲
by
b2gills
7y ago
Perl6 has remedied the accidental leak of values to the caller by allowing you to give a return value in the signature. This will ignore the last result and return Nil instead: sub foo ( $_ --> Nil ) {…} This only works with lit
114.
▲
by
b2gills
7y ago
In Perl6 <= is equivalent to ≤ say 4 ≤ 5; # True say 4 ≤ 4; # True say 4 ≤ 3; # False say 4 <= 5; # True say 4 <= 4; # True say 4 <= 3; # False Specifically they are the exact same subroutine. (The
115.
▲
by
b2gills
8y ago
And today Perl is declining but still in serious use. It's percentage has dropped by a significant amount, but I would bet the amount of new code has not dropped nearly as much. Also I'm fairly certain that Go is close to a 10 yea
116.
▲
by
b2gills
8y ago
You mean 2015. Specifically December 25th 2015.
117.
▲
by
b2gills
8y ago
It's pretty much a given that no language will ever be able to achieve that again.
118.
▲
by
b2gills
8y ago
If we are going to golf, here is a small Perl6 version: sub print-maybe ( $_ ) { say $_ // "nothing" } Or to translate your code: my &print-maybe = { say $_ // "nothing" }
119.
▲
by
b2gills
8y ago
In Perl6 multiple dispatch is a fundamental feature. Even the infix numeric addition operator is handled by 27 multi subs. (They usually get inlined or even optimised out entirely.) say &infix:«+».candidates.elems; # 27 Here is
120.
▲
by
b2gills
8y ago
Perl5 has some design features that are not as good as they could have been if it broke backwards compatibility. So there were a lot of limitations on how things could get added. (Code written in 1987 will most likely still work on the late
More ›