Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
b2gills
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
22 ms
·
151.
▲
by
b2gills
8y ago
MoarVM has had a JIT since 2014. (MoarVM was announced in January 2014, got a type specializer in March of that year and got the beginnings of a JIT in August of that year) What it just got recently is a pluggable specializer that allows
152.
▲
by
b2gills
8y ago
And people think Perl 6 is slow time perl6 -e 'say [1, 2, 3; 4, 5, 6; 7, 8, 9] >>**>> 2' [(1 4 9) (16 25 36) (49 64 81)] real 0m0.170s Note that the majority of that time is just loading Perl 6. time
153.
▲
by
b2gills
8y ago
The whole point of Perl 6 was to break compatibility, as the implementation of Perl 5 was deemed good enough to keep existing code running. In the meantime, Perl 5 keeps getting better while mostly maintaining backwards compatibility. So ba
154.
▲
by
b2gills
8y ago
Rakudo Perl 6 no longer supports Parrot, and hasn't since before the first official release of the Perl 6 specification tests on 2015-12-25. Most people run Rakudo Perl 6 on MoarVM, but it also runs on the JVM (with some caveats) and t
155.
▲
by
b2gills
8y ago
Unicode has APL characters, so create the operators using them. If there is a conflict with an existing feature you could always create a Slang. A Slang is a module that changes the parser. (It could be argued that with this feature all pro
156.
▲
by
b2gills
8y ago
Perl 5 does have an object system, one that was based in no small part on Python. About the biggest difference is the built-in constructor `bless` is simplistic, and should be wrapped in a method. class Person: def __init__(self, name)
157.
▲
by
b2gills
8y ago
With one main difference being that we are perfectly content to let people continue to use Perl 5. (Most of us anyway) Another is that Perl 6 brings in many features from other very disparate languages while making them seem as if they alwa
158.
▲
by
b2gills
8y ago
Perl 6 removes very few language features. About the only notable ones I can think of is fork and format. Since Perl 6 has built-in multithreading, fork is not needed. And hardly anyone uses format anymore (it is great for directly printing
159.
▲
by
b2gills
8y ago
A similar situation to Python 2->3 in Perl is from Perl 5.6 to Perl 5.26 with the difference being that Perl maintains mostly backwards compatible. If you are talking about Perl 5->6 that is more like going from C++ to D. (With a touc
160.
▲
by
b2gills
9y ago
An example would be helpful so here is one https://github.com/moritz/json/blob/master/lib/JSON/Tiny/Gra...
161.
▲
by
b2gills
9y ago
Perl is not an acronym, Larry wanted to call it Pearl, but there was already a language by that name. Also we tend to prefer Perl 6 to be spelled with a non-breaking space before the 6. [U+A0] Perl 6 has features from many sources, so it is
162.
▲
by
b2gills
9y ago
In general languages tend to focus on one thing, where Perl tend to focus on many things. So it is difficult to classify. In addition almost everything that is easy in Perl 5 is also easy in Perl 6, but it also makes a wide variety of addit
163.
▲
by
b2gills
9y ago
Looking at a page about list comprehensions in Python. S = {x² : x in {0 ... 9}} V = (1, 2, 4, 8, ..., 2¹²) M = {x | x in S and x even} Python (from that page) S = [x**2 for x in range(10)] V = [2**i for i in range(13)] M
164.
▲
by
b2gills
9y ago
I would say that smugness has almost nothing to do with knowledge, and everything to do with attitude. I have seen people being smug that they know nothing about a given subject. That is smugness is almost exclusively about “thinking you&#x
165.
▲
by
b2gills
9y ago
In Perl 6 regexes are a type of method, and you can use them in grammars which are a type of class. (You can use them on their own as well) Which means you can subclass grammars, compose in regexes with roles, and have parameterized regexes
166.
▲
by
b2gills
9y ago
I remember someone posting some Perl 6 code and C code that did the same thing. The Perl 6 code was shorter, easier to understand, more correct (Unicode), and was reported to be faster for what they were doing. There are things which are sl
167.
▲
by
b2gills
9y ago
sub infix:<d> ( $count, $faces ) { (1..$faces).roll($count) } # from this point on the language has changed to have a # new infix operator say 5 d 20; # (13 5 3 3 14) The Rakudo implementation also has macros
168.
▲
by
b2gills
9y ago
There is a slide in there where he makes something like 5 mistakes, and yet most people think he knows what he is talking about. I will grant that he found a problem where DBI and CGI was used together carelessly. I think I remember him say
169.
▲
by
b2gills
9y ago
I think using some sort of construct that topicallizes the object is a good middle ground between the two. For example this Perl 6 code: with turtle { # store in topic variable $_ (if it's defined) .rotate(90); # implic
170.
▲
by
b2gills
9y ago
No it doesn't have the same flexibility. Perl 6's string quoting sub language has various feature flags that you can turn on or off. Here are a few of the basic ones shown in valid code (comments and newlines included) # start
171.
▲
by
b2gills
9y ago
Actually I think you have that backwards, as far as front-loading. For just about everything you do in Perl 5 there is an equivalent in Perl 6 that is simpler to remember and is more general in its use. For example using an iterator variabl
172.
▲
by
b2gills
9y ago
It mixes in additional features to a given instance my $old = 0; my $val = $old but True; say $old.Bool; # False say $val.Bool; # True say $val.Numeric; # 0 Which can be thought of as short for my $old = 0;
173.
▲
by
b2gills
9y ago
To be fair Perl 6 returns structured data from regexes, whereas Perl 5 returns flat data. That has huge implications on how different the regex sub-languages gets parsed. It also has a significantly different syntax, and integrates more int
174.
▲
by
b2gills
9y ago
Actually if you define the COBOL slang well, you can add a construct which will allow dropping back down into Perl 6 so that you can intermix both languages and use each to their strengths in the same file. That is how the string literal an
175.
▲
by
b2gills
9y ago
You're right it can't be done (Perl 6 does that a lot). The feature could be made to start a new mapping of synthetic characters before it runs out, and throw away the mapping when the last of the old strands gets GCed. Basically
176.
▲
by
b2gills
9y ago
It is different, all of the differences between Python 2 & 3 seem like the difference from one version of Perl 5 to another as far as I can tell. The main thing is Perl 5 tries to remain mostly backward compatible. I have heard of one c
177.
▲
by
b2gills
9y ago
「Man is amazing, but he is not a masterpiece」 Is different than the other two, it can be thought of as short for Q 「Man is amazing, but he is not a masterpiece」 While the others are short for qq “Man is amazing, but
178.
▲
by
b2gills
9y ago
Also I would use ( Male | Female ) in Perl 6, as it tries to match both in parallel. The reason the version with || is in P5-to-p6 is that is how | works in Perl 5.
179.
▲
by
b2gills
9y ago
The author of the article likely hasn't dug much into the VM code yet. https://github.com/MoarVM/MoarVM/#feature-overview
180.
▲
by
b2gills
9y ago
Perl 6 has M:N thread multiplexing along with normal thread support. It's just that M:N thread multiplexing is easier to use because all of the hard work is done for you.
More ›