DEV Community

Discussion on: 100 Languages Speedrun: Episode 47: Raku (Perl 6) Regular Expressions

Collapse
 
lizmat profile image
Elizabeth Mattijsen

Actually, Raku is flexible enough to allow for Roman Numerals in a module: Slang::Roman. And who knows, it might actually make it into the language at some point.

Showing a Tamil language page that does not use Tamil numerals is only proof of the fact that at least some Tamil pages do not use Tamil numerals. It does not proof there aren't any other pages that do use Tamil numerals. And there are other uses of text beside the Web :-)

Also, Tamil was just an example. There are about 50 languages in the Unicode standard with their own numeric representation.

Re "二十", yes, perhaps we should make a slang for that as well. Anyone up for Slang::CJK?

Comparing a well thought out behaviour of a feature in Raku with a mistake made in the past, feels like a disservice. You can disagree with the decision of this behaviour, but considering it a bug is wrong:

From Wikipedia: "A software bug is an error, flaw or fault in a computer program or system that causes it to produce an incorrect or unexpected result, or to behave in unintended ways'. The result is not incorrect, nor unexpected, nor unintended.

Pardon the analogy, you're like a driver used to drive on the right side of the road, suddenly needing to drive a car with the steering wheel on the right-hand side of the car. And then wondering why the window-wipers switch on in the very first turn that you need to make.

Thread Thread
 
taw profile image
Tomasz Wegrzanowski

docs.raku.org/language/regexes thinks "௩.௩.௩.௩" is a valid IP address, and good luck pinging that.

Even people who wrote the page explaining the Raku \d can't actually follow how the broken \d works and assume it works on ASCII only in the rest of the document.

Thread Thread
 
lizmat profile image
Elizabeth Mattijsen

Then the documentation is where the error is.

Thread Thread
 
taw profile image
Tomasz Wegrzanowski

Can you find even a single actual Raku program out there, where \d is used, and it intentionally means <:Nd> and it would break the program if \d was changed to match <[0..9]>?

Unfortunately Github code search can't handle special characters like backslash so it can't search for \d directly, and it confuses Raku with Perl 5 when filtering, but here's a start: https://github.com/search?q=filename%3A%22*.raku%22+language%3ARaku&type=Code

Just clicking randomly I see a lot of \d, and ALL of them assume that \d will be ASCII digits is everywhere. Explicit <[0..9]> are very rare. Anyone wanting <:Nd>? I haven't found a single case yet.

Thread Thread
 
vrurg profile image
Vadim Belman

All I could say about pinging the IP is that your parser is just not able to convert the representation into an unsigned 32 bit integer. But it doesn't mean that no other parser is capable of this. Enough to say that dotted notation is a convention. Network addresses are just numbers in their nature.