Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
raiph
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
25 ms
·
181.
▲
by
raiph
10y ago
From https://docs.perl6.org/type/Date : "A Date is an immutable object identifying a day in the Gregorian calendar." (It's proleptic.) The days used in DateTime, which is compatible with the Date class, a
182.
▲
by
raiph
10y ago
Perl 6 supports arbitrary run-time predicates as "subset" types: subset Foo where /foo/; subset Bar where 0 .. 99; subset Baz where * > rand; my Foo \foovar = 'Some food'; my Bar \barv
183.
▲
by
raiph
10y ago
The Perl 6 student begins: sub add(\number1, \number2) { number1 + number2 } If you call `add` with simple numbers it works: say add(1, 2) # 3 Other types of number too: say add(0.1, 0.2) == 0.3 # True It works ev
184.
▲
by
raiph
10y ago
> false distinction between static versus dynamic typing This is the Perl 6 view. See "Getting beyond static vs. dynamic" http://www.jnthn.net/papers/2015-fosdem-static-dynamic.pdf In Perl 6: > 1. A val
185.
▲
by
raiph
10y ago
To be pedantic it's guaranteed to be fully reality compliant in regard to how many EXTRA LINES of code are required (which was the context of the all caps assertion you've quoted). As Zoffix showed, it takes zero extra lines. Clea
186.
▲
by
raiph
10y ago
Perl 6 regexes are parsed at compile-time (i.e. they're code just like any other code) so using incorrect regex syntax, eg unknown characters, results in a compile-time syntax error.
187.
▲
by
raiph
10y ago
> Perl is absolutely terrible for basic oo. To clarify for readers who might not know... * Perl 5 (the language this comment appears to focus on) and Perl 6 (the language the OP is about) are different languages in the same family, like
188.
▲
by
raiph
10y ago
> Swift is the only language I know of that has grapheme clusters as the default unit of character Also Elixir and Perl 6. For a bit more info see https://news.ycombinator.com/item?id=
189.
▲
Schrödinger's cat in code
(youtube.com)
1 points
by
raiph
10y ago
|
0 comments
190.
▲
by
raiph
10y ago
Fwiw, adapted from "Parsing an ipv4 address"[1]: / ( (\d ** 1..3) <?{ 0 < $0 < 255 }> ) ** 4 % '.' /; [1]: https://perl6advent.wordpress.com/2012/12
191.
▲
by
raiph
10y ago
What do you think of the Perl 6 approach of providing both DWIM (weaker) and DWIS (stronger) typing? * Numeric and string operators are kept distinct. For example `+` means numeric addition, never concatenation or some other string operatio
192.
▲
by
raiph
10y ago
> Works .. Doesn't I question some details in your lists but imagine you'd agree that the Works vs Doesn't split approximates to whole string level vs sub-string/character level operations.
193.
▲
by
raiph
10y ago
Do you consider this definition to be nothing but absurd? I think it has a lot of merit. What impact does one or other way of thinking (absurd vs has merit) about this (a potential break in backward compatibility between language versions d
194.
▲
by
raiph
10y ago
Perl 6 Rules reframe parsing along the lines you suggest. https://en.wikipedia.org/wiki/Perl_6_rules contains the grammar used to define Perl's sprintf string formatting notation: grammar Str::SprintfFormat {
195.
▲
by
raiph
10y ago
Aiui you can have any checks you want. Aiui, simplifying, every operation is a function call so you just write a function body that corresponds to what you want the operation to be with the checks you want.
196.
▲
by
raiph
10y ago
Aiui Perl6's module related design elements allow for this though I don't know if anyone has implemented what you describe. I'll be happy to discuss this further if anyone shows interest.
197.
▲
by
raiph
10y ago
I think I misunderstood your comment about CL vs Julia/Dylan in regard to generic "by default". In Perl 6 this function definition implies a generic function: multi concatenate (\foo, \bar) { foo ~ bar } This functio
198.
▲
by
raiph
10y ago
> Are basic operations like `+` generic in Perl 6? Yes.
199.
▲
by
raiph
10y ago
I thought that, while Perl 6 can dispatch based on runtime types, it does candidate resolution at compile-time for functions (and thus operators) and private methods. It only adds in run-time overhead for these cases if the code uses a ru
200.
▲
by
raiph
10y ago
> Dylan and Julia both have functions which are generic by default And Perl 6. > in CL you cannot use multiple dispatch on parametric types. You can in Perl 6. > In Julia even something as basic as mixed-type addition – e.g. `1 + 2
201.
▲
by
raiph
10y ago
MD in Perl 6 is beyond "occasionally handy". A glance at the Perl 6 setting modules[1] revealed something like a 50/50 break down of SD vs MD. Operators in Perl 6 are all MD, so that's likely a significant factor. Additi
202.
▲
by
raiph
10y ago
I wonder if you noticed the language which just shipped its first official version with: * a typing system some call "gradual typing" (loosely similar to optional typing); * a condition system; * "grammars/actions"
203.
▲
by
raiph
11y ago
> 1) It's the same, just with finer control in C#. `await` means you're waiting for the result of a method but not blocking the thread/CPU from doing something else. Thanks. `await` in Perl 6 is blocking. I'm guessing
204.
▲
by
raiph
11y ago
I think this may be one of those situations where the outcome is odious to some even though no individual action was itself odious. The author of the blog post has said she* wrote the title to mimic the sort of bro-ish thing she was hearing
205.
▲
by
raiph
11y ago
What's the C# equivalent of the concurrency features listed in the OP: 1 `await` (iiuc this is fundamentally not the same as the C# feature that uses an `await` keyword) and `start`. 2 "transforming ordinary code in to concurren
206.
▲
by
raiph
11y ago
Most recent simple comparisons I've tried or seen others try between the code/compilers of Perls 5 and 6 show the latter starting and executing about one or two orders of magnitude slower. Regardless, Perl 6 is fast enough for s
207.
▲
by
raiph
11y ago
`start`ing Promises, `race`ing pipelines, and `say`ing are all frequently used Perl 6 features. So we want nice simple short words for them. I think the ones we've got are well chosen but it's clearly a taste thing. You could alwa
208.
▲
by
raiph
11y ago
"private" is used in several major programming languages to mark private instance variables. But all instance variables are private in Perl 6 so the keyword is unnecessary. Using it instead for what "my" is used for in P
209.
▲
by
raiph
11y ago
What words would you pick? say This function is loosely similar to `print` in the sense it sends a version of its arguments to an output handle (STDOUT by default). But `say` is emphatically casual and human oriented in stark contr
210.
▲
by
raiph
11y ago
I still recall reading ECOOP papers in the 80s that made it very clear that composition is a much better approach for most things than inheritance (and that a single inheritance mechanism is generally much simpler than a multiple inheritanc
More ›