The Raku Programming Language
-
@Gurth said in The Raku Programming Language:
@Gąska said in The Raku Programming Language:
@pie_flavor said in The Raku Programming Language:
「a9」++
gives「b0」
.Wait what? Does it mean
"image9"++
gives"imagf0"
? That's way more retarded than I initially thought.That is stupid, and I would guess programmer-oriented again, yes. I think it sees
e9
as a hex number and so increments it tof0
. I wonder what"imagf0"++
produces.imagf1
, probably. So keep going, and atimagf9
, do we then getimagf10
next?But then someone showed that
"image-9.txt"++
produces"image-10.txt"
.
-
This language looks pretty mental.
I don't have a problem with using symbols for functions. I have worked with APL and a lot of those symbolic assignments make sense. Forcing it to ASCII means you end up with diglpyhs and no symbolic association with the action, and ... well, https://en.wikipedia.org/wiki/J_(programming_language). J is the only language I know (that is actually a serious language) less readable than Perl.
(Nor do any of you if you understand "1+1". Most programming languages only using the ASCII symbols is just a relic of the past - I defy you to give a good argument as to why "var x = 5 * y" is better than "var x = 5 × y" now that the latter character is supported everywhere, for example.)
But arbitrary string delimeters and non-human parsable stuff like that Q: and qq: and regexes not being the same as anyone else's? There's just no reason for that kind of thing.
-
@dcon said in The Raku Programming Language:
@Gurth said in The Raku Programming Language:
@Gąska said in The Raku Programming Language:
@pie_flavor said in The Raku Programming Language:
「a9」++
gives「b0」
.Wait what? Does it mean
"image9"++
gives"imagf0"
? That's way more retarded than I initially thought.That is stupid, and I would guess programmer-oriented again, yes. I think it sees
e9
as a hex number and so increments it tof0
. I wonder what"imagf0"++
produces.imagf1
, probably. So keep going, and atimagf9
, do we then getimagf10
next?But then someone showed that
"image-9.txt"++
produces"image-10.txt"
.I don't know whether that's more or less intelligent than
image-8.txt
.
-
@bobjanova said in The Raku Programming Language:
This language looks
prettytotally mental.Now it's accurate.
-
@bobjanova said in The Raku Programming Language:
J is the only language I know (that is actually a serious language) less readable than Perl.
The configuration file format for sendmail had that reputation as well.
-
@Steve_The_Cynic said in The Raku Programming Language:
Fair dooze, but I was thinking of actual line noise, like you'd see with a 300 baud modem talking over a noisy phone line. (Worse still, a 300 baud modem using an acoustic coupler.)
Or maybe I'm showing my age again.
Ah, that old Silent 700... (at least it talked faster than 300baud) Of course, since that was thermal paper, all the printouts are now illegible...
-
@Steve_The_Cynic said in The Raku Programming Language:
I wonder how many of the younger members of the audience have ever seen the results of line noise.
I've not seen it since I stopped using a genuine serial line connection. All the modems I ever had included enough error correction to make line noise not be a thing worthy of note. Except that you could pick up another phone, make a noise a bit like an angry snake or steam engine relief valve, and stop your brother from occupying the line so you could make an important call as the noise level suddenly exceeded the level that the modem supported and it hung up…
-
@bobjanova said in The Raku Programming Language:
J is the only language I know (that is actually a serious language) less readable than Perl.
I guess you've never seen the transform step for Conway's Life in APL, then...
life←{↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵}
-
@Steve_The_Cynic I have seen that. But that kind of 'program in one line' is programmers having fun, you would no more actually write that in a production APL system than write the whole thing as a LINQ expression in C#. (Not least because the two outer products are a huge memory grab. Any 'clever' expression with an outer product in it probably isn't clever at all in the real world.)
And that function is still 1000 times more readable than the J equivalent. In fact (unlike the Raku stuff) I can probably explain it roughly to even a non APLer.
The main WTF in APL is that it evaluates right to left, tbh. So ...
¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵
Make an expansion of all the neighbours (including the cell itself) by shifting the grid in all the combinations of left/none/right and up/none/down3 4=+/, ...
Mark the ones that have 3 or 4 neighbours1 ⍵∨.∧ ...
Well okay to be fair I forget how that works.There's a little bit of data type manipulation in that expression too (the ⊂ and ↑) and you'd probably write it differently in different dialects for that part. Arrays of arrays vs matrices are a complicated area for a parallel language.
-
@bobjanova said in The Raku Programming Language:
I defy you to give a good argument as to why "var x = 5 * y" is better than "var x = 5 × y" now that the latter character is supported everywhere, for example.
Show me how I can type that as fast as *.
Right now I wouldn’t know how to type that at all other than googling Unicode characters and copy-pasting, but spending more than half a second is already too slow.
Also, what is the upside? * means exactly multiply for me. It is, after all, the character printed on the numpad key for multiplication, not just something those weird programmer types reused to means something else.
-
@topspin said in The Raku Programming Language:
@bobjanova said in The Raku Programming Language:
I defy you to give a good argument as to why "var x = 5 * y" is better than "var x = 5 × y" now that the latter character is supported everywhere, for example.
Show me how I can type that as fast as *.
I’ve got a keyboard shortcut defined for it, as I need (want) to type a real multiplication symbol quite a lot. However, I can’t do it here because CtrlM submits this message, and all my custom keystrokes begin with that sequence for a reason lost to the mists of time.
Also, what is the upside? * means exactly multiply for me. It is, after all, the character printed on the numpad key for multiplication, not just something those weird programmer types reused to means something else.
Doesn’t change that, like @bobjanova said, it’s a relic of ASCII’s limited character set. Most keyboards have several characters that hardly ever get used except for special occasions (note: programming is a special occasion, since the vast majority of computer users do not engage in it), and which appear to only be there because they were useful to programmers when that wasn’t a special occasion. Of course, trying to get symbols that would actually be useful for real life on them instead, like a proper multiplication symbol, would be wasted effort. (Also: people would be bound to confuse it with the letter <x>, like there are already plenty of people who apparently can’t tell the difference between a comma, an apostrophe and a backtick. Do they not look at what they,ve typed and think’ that doesn,t look quite right …)
-
@Gurth said in The Raku Programming Language:
a real multiplication symbol
Doesn’t change that, like @bobjanova said, it’s a relic of ASCII’s limited character set. Most keyboards have several characters that hardly ever get used except for special occasions (note: programming is a special occasion, since the vast majority of computer users do not engage in it), and which appear to only be there because they were useful to programmers when that wasn’t a special occasion. Of course, trying to get symbols that would actually be useful for real life on them instead, like a proper multiplication symbol, would be wasted effort. (Also: people would be bound to confuse it with the letter <x>, like there are already plenty of people who apparently can’t tell the difference between a comma, an apostrophe and a backtick. Do they not look at what they,ve typed and think’ that doesn,t look quite right …)
Actually, I'd argue that while
*
clearly means multipliation,×
would rather confuse me. That's a cross product to me, a normal scalar multiplication would be·
.
-
@topspin said in The Raku Programming Language:
Show me how I can type that as fast as *.
Certainly nothing convenient for × using a Mac UK Laptop keyboard layout. But ÷ is right there (Option+/). This is dumb.
-
@dkf said in The Raku Programming Language:
(Option+/).
/ is actually Shift7 for me, so depending on if that translates to OptionShift7 or just Option7 I get either
\
or|
.It's also labeled Alt, too.
-
@topspin said in The Raku Programming Language:
@dkf said in The Raku Programming Language:
(Option+/).
/ is actually Shift7 for me, so depending on if that translates to OptionShift7 or just Option7 I get either
\
or|
.It's also labeled Alt, too.
Not on this machine it isn't.
-
@bobjanova said in The Raku Programming Language:
(Nor do any of you if you understand "1+1". Most programming languages only using the ASCII symbols is just a relic of the past - I defy you to give a good argument as to why "var x = 5 * y" is better than "var x = 5 × y" now that the latter character is supported everywhere, for example.)
Everywhere my ass.
The "software not supporting Unicode" thread is
-
@dkf said in The Raku Programming Language:
The configuration file format for sendmail had that reputation as well.
I still cannot decide whether it's better or worse than the sudo configuration. Apache and rsnapshot are also pretty bad.
I guess it's fair to say that in general, UNIX services and command-line tools tend to have crazy configuration files.
-
@topspin said in The Raku Programming Language:
Show me how I can type that as fast as *.
A smart IDE might auto-replace a suitable ASCII sequence with the Unicode symbol. Just like Microsoft word automatically replaces three dots with an ellipsis. If the language supplies such an IDE, I wouldn't be opposed to Unicode operators in principle.
-
@bobjanova said in The Raku Programming Language:
Most programming languages only using the ASCII symbols is just a relic of the past
If you consider common keyboard layouts to be relics of the past then sure. People often forget that languages are tools, and tools are meant to be used.
-
@Gurth said in The Raku Programming Language:
(note: programming is a special occasion, since the vast majority of computer users do not engage in it)
Aside from the ones that use Excel and therefore know that
=4*B47
means to make this cell equal to four times the value in B47. They are programming just as much as a C or C++ or C-dièse or Perl or Python or whatever programmer is programming, what with Excel being the most widely-deployed IDE in the world.
-
@Steve_The_Cynic said in The Raku Programming Language:
Excel being the most widely-deployed IDE
-
@dfdub said in The Raku Programming Language:
I still cannot decide whether it's better or worse than the sudo configuration. Apache and rsnapshot are also pretty bad.
Those are all just tricky and retarded. Sendmail was all that, but with regexps too…
-
@marczellm said in The Raku Programming Language:
@pie_flavor said in The Raku Programming Language:
You must have missed it in the text-wall.
Yes. Initiating countdown until someone also misses that flag and writes another PCRE library for Raku.
@pie_flavor said in The Raku Programming Language:
Right, you'd definitely want a more robust system for proper parsing. Like a grammar language.
Good thing Raku has those built directly into the language, à la ANTLR.That actually looks useful. Does it have parser combinators?
Sort-of! You can interpolate regexes in other regexes:
/ <rx1> <rx2> <rx3> /
And, because of being able to insert code in regexes, and being able to return new regexes to interpolate from that code, this means you can dynamically construct them at runtime, and then use them as grammar Rule objects.
-
@dfdub said in The Raku Programming Language:
@topspin said in The Raku Programming Language:
Show me how I can type that as fast as *.
A smart IDE might auto-replace a suitable ASCII sequence with the Unicode symbol. Just like Microsoft word automatically replaces three dots with an ellipsis. If the language supplies such an IDE, I wouldn't be opposed to Unicode operators in principle.
Or, alternatively, a program that doesn't need IDE integration but does it just as well.
@pie_flavor said in The Raku Programming Language:
(The docs strongly recommend you install WinCompose.)
I get
×
by typing🔹xx
, and≠
by typing🔹/=
, and there isn't one for「」
but I've made one so that it's🔹"[
and🔹"]
, etc. (🔹
here being the character used to signify the compose key, which is AltGr by default.
-
And
🔹,a
to type @gaska's name properly?
-
@PleegWat I was about to say 'no, that's
🔹a,
', but then I tested yours and it worked too. Fun!
-
@pie_flavor IIRC, if
🔹ab
is defined and🔹ba
is not, then typing🔹ba
has the effect of🔹ab
.
-
@dkf said in The Raku Programming Language:
@topspin said in The Raku Programming Language:
@dkf said in The Raku Programming Language:
(Option+/).
/ is actually Shift7 for me, so depending on if that translates to OptionShift7 or just Option7 I get either
\
or|
.It's also labeled Alt, too.
Not on this machine it isn't.
Mine's labelled like this:
-
@loopback0 Consistency!!1!
-
@topspin said in The Raku Programming Language:
@loopback0 Consistency!!1!
Apple does what it want anyway. Their "delete" key is still the backspace key which is super damn annoying when I'm working on my work MBP and don't have my standard keyboard hooked up with the full ten key and home, end, page up, page down, insert and delete keys.
-
@topspin said in The Raku Programming Language:
@loopback0 Consistency!!1!
My work laptop is the same as @dkf's - although it also looks like the same model (16" MBP) so that's hardly surprising.
-
@loopback0 said in The Raku Programming Language:
@dkf said in The Raku Programming Language:
@topspin said in The Raku Programming Language:
@dkf said in The Raku Programming Language:
(Option+/).
/ is actually Shift7 for me, so depending on if that translates to OptionShift7 or just Option7 I get either
\
or|
.It's also labeled Alt, too.
Not on this machine it isn't.
Mine's labelled like this:
And coming from a mostly Windows background, remembering which strange symbol is which (is that one shift? alt? option?) is annoying.
-
@HardwareGeek said in The Raku Programming Language:
@Steve_The_Cynic said in The Raku Programming Language:
Excel being the most widely-deployed IDE
It's scary because it's true.
-
@pie_flavor said in The Raku Programming Language:
@marczellm said in The Raku Programming Language:
@pie_flavor said in The Raku Programming Language:
You must have missed it in the text-wall.
Yes. Initiating countdown until someone also misses that flag and writes another PCRE library for Raku.
@pie_flavor said in The Raku Programming Language:
Right, you'd definitely want a more robust system for proper parsing. Like a grammar language.
Good thing Raku has those built directly into the language, à la ANTLR.That actually looks useful. Does it have parser combinators?
Sort-of! You can interpolate regexes in other regexes:
/ <rx1> <rx2> <rx3> /
And, because of being able to insert code in regexes, and being able to return new regexes to interpolate from that code, this means you can dynamically construct them at runtime, and then use them as grammar Rule objects.You had a problem. You decided to use
regexthat eldritch horror . Now you have2n! problems.
-
@Benjamin-Hall said in The Raku Programming Language:
And coming from a mostly Windows background, remembering which strange symbol is which (is that one shift? alt? option?) is annoying.
I use mine at work with a Windows keyboard so got used to it a long time ago.
-
@topspin said in The Raku Programming Language:
Actually, I'd argue that while
*
clearly means multipliation,×
would rather confuse me. That's a cross product to me, a normal scalar multiplication would be·
.Tell that to people who do not have a background in mathematics or related fields: in everyday life, people write
×
for a multiplication symbol. Like I said, programming is a niche field when it comes to computer use, but keyboards still reflect the time when it was the main use for computers.@dkf said in The Raku Programming Language:
@topspin said in The Raku Programming Language:
Show me how I can type that as fast as *.
Certainly nothing convenient for × using a Mac UK Laptop keyboard layout. But ÷ is right there (Option+/). This is dumb.
Hence my using Ctrl+M followed by x to type
×
. I’m sure I could have chosen a more convenient way, but after about fifteen years I’m not going to try changing my habitual shortcuts anymore.@dfdub said in The Raku Programming Language:
A smart IDE might auto-replace a suitable ASCII sequence with the Unicode symbol. Just like Microsoft word automatically replaces three dots with an ellipsis.
Here’s a better example, IMHO:
The
×
is typed by entering*
, but it also happily accepts×
entered directly.
-
@Benjamin-Hall said in The Raku Programming Language:
Mine's labelled like this:
And coming from a mostly Windows background, remembering which strange symbol is which (is that one shift? alt? option?) is annoying.
Which is why I find it strange that Apple prints the names on the keys in the US, but uses the same symbols as in the menus in Europe (I don’t know about elsewhere).
-
@Gurth said in The Raku Programming Language:
@topspin said in The Raku Programming Language:
Actually, I'd argue that while
*
clearly means multipliation,×
would rather confuse me. That's a cross product to me, a normal scalar multiplication would be·
.Tell that to people who do not have a background in mathematics or related fields: in everyday life, people write
×
for a multiplication symbol. Like I said, programming is a niche field when it comes to computer use, but keyboards still reflect the time when it was the main use for computers.I was taught
·
as the multiplication symbol from the very start in school, and using the×
from calculators would end up with the teacher telling you that that is wrong.
It wasn't till much later we were told what×
is used for. So most people in Sweden should recognise·
as the multiplication symbol at least, even if they don't use it and don't know what×
mean.
-
@Gurth said in The Raku Programming Language:
in everyday life, people write × for a multiplication symbol.
Except for everyday people in everyday life typing the letter
x
in Word documents, always.
-
@Gurth said in The Raku Programming Language:
@topspin said in The Raku Programming Language:
Actually, I'd argue that while
*
clearly means multipliation,×
would rather confuse me. That's a cross product to me, a normal scalar multiplication would be·
.in everyday life, people write
×
for a multiplication symbol.Over here they write
·
.Like I said, programming is a niche field when it comes to computer use, but keyboards still reflect the time when it was the main use for computers.
It never stops amazing me how condescending people can be while being so ignorant of the thing they talk about.
Computer keyboards have these symbols because typewriters had these symbols. Programming languages use these symbols because they were already available on keyboards, not the other way around.
-
@pie_flavor said in The Raku Programming Language:
Sort-of! You can interpolate regexes in other regexes:
/ <rx1> <rx2> <rx3> /
And, because of being able to insert code in regexes, and being able to return new regexes to interpolate from that code, this means you can dynamically construct them at runtime, and then use them as grammar Rule objects.That's not sounding like a regular expression engine any more, and rather like a general programmable turing machine.
@HardwareGeek said in The Raku Programming Language:
Now you have
2n! problems.I believe that is an underestimation.
-
@Gurth said in The Raku Programming Language:
@Benjamin-Hall said in The Raku Programming Language:
Mine's labelled like this:
And coming from a mostly Windows background, remembering which strange symbol is which (is that one shift? alt? option?) is annoying.
Which is why I find it strange that Apple prints the names on the keys in the US, but uses the same symbols as in the menus in Europe (I don’t know about elsewhere).
That image is from a UK Mac keyboard.
-
@dkf said in The Raku Programming Language:
a general programmable turing machine.
what's the difference between that and Raku itself?
-
@pie_flavor said in The Raku Programming Language:
@dkf said in The Raku Programming Language:
a general programmable turing machine.
what's the difference between that and Raku itself?
The word "programmable"?
-
@loopback0 said in The Raku Programming Language:
@Gurth said in The Raku Programming Language:
@Benjamin-Hall said in The Raku Programming Language:
Mine's labelled like this:
And coming from a mostly Windows background, remembering which strange symbol is which (is that one shift? alt? option?) is annoying.
Which is why I find it strange that Apple prints the names on the keys in the US, but uses the same symbols as in the menus in Europe (I don’t know about elsewhere).
That image is from a UK Mac keyboard.
Apple have changed their opinion on what exact text/symbols should be on a keyboard from time to time (I can't take photos of my old laptops or external keyboard as they're all at work and I'm at home), but they essentially put on 5 types of shiftstate keys (three of which are duplicated on the right hand side0:
- Shift (often ⇪) — You know, like every keyboard has.
- Command (often ⌘) — Positioned like a Windows key, used to do application and system keyboard shortcuts. (This role is a bit shared between Control and the Windows key in a standard PC keyboard.)
- Option (often ⎇ but in a very different font that flips it the other way up) — Very much like AltGr on a Windows keyboard. Mostly used for either character composition or picking alternate commands with Command shortcuts.
- Control (often ^, left side only) — It's a control key. It isn't used for many keyboard shortcuts (except in combination with Command or the arrow keys) and that leaves it free for doing all sorts of things in applications.
- Function (no special symbol I've ever seen, left side only) — Originated with laptop keyboards (where it is vital), but still present on full keyboards where it switches a few keys' functions (notably the Function keys).
There's so many of these things there's almost enough to be able to use Emacs conveniently…
-
@dkf said in The Raku Programming Language:
Apple have changed their opinion on what exact text/symbols should be on a keyboard from time to time
Here I've got my old work laptop, my new work laptop and my personal laptop. 3 different generations of MBP covering just 5 years.
Shift is ⇧ on all 3.
Control is ctrl (2014), control (2016) and control with ^ (2019 16").
Option is alt with ⌥ (2014), option with alt (2016) and option with ⌥ (2019).
Command is cmd with ⌘ (2014), and command with ⌘ (2016+2019).As I use an external Windows keyboard at work, to me they're mostly just Ctrl, , Alt.
@dkf said in The Raku Programming Language:
use Emacs
No-one should do that though.
-
@bobjanova said in The Raku Programming Language:
I defy you to give a good argument as to why "var x = 5 * y" is better than "var x = 5 × y" now that the latter character is supported everywhere, for example
It's not supported on any keyboard I've ever used, for instance. I'm sure that point's already been made but it's worth making again. I have no idea how I'd type that other than copying and pasting.
-
@pie_flavor said in The Raku Programming Language:
@dfdub said in The Raku Programming Language:
@topspin said in The Raku Programming Language:
Show me how I can type that as fast as *.
A smart IDE might auto-replace a suitable ASCII sequence with the Unicode symbol. Just like Microsoft word automatically replaces three dots with an ellipsis. If the language supplies such an IDE, I wouldn't be opposed to Unicode operators in principle.
Or, alternatively, a program that doesn't need IDE integration but does it just as well.
@pie_flavor said in The Raku Programming Language:
(The docs strongly recommend you install WinCompose.)
I get
×
by typing🔹xx
, and≠
by typing🔹/=
, and there isn't one for「」
but I've made one so that it's🔹"[
and🔹"]
, etc. (🔹
here being the character used to signify the compose key, which is AltGr by default.TIL.
-
@Carnage said in The Raku Programming Language:
@Gurth said in The Raku Programming Language:
@topspin said in The Raku Programming Language:
Actually, I'd argue that while
*
clearly means multipliation,×
would rather confuse me. That's a cross product to me, a normal scalar multiplication would be·
.Tell that to people who do not have a background in mathematics or related fields: in everyday life, people write
×
for a multiplication symbol. Like I said, programming is a niche field when it comes to computer use, but keyboards still reflect the time when it was the main use for computers.I was taught
·
as the multiplication symbol from the very start in school, and using the×
from calculators would end up with the teacher telling you that that is wrong.
It wasn't till much later we were told what×
is used for. So most people in Sweden should recognise·
as the multiplication symbol at least, even if they don't use it and don't know what×
mean.I think we started using
×
(in 2nd grade or so) but moved to the·
once we hit (pre)algebra when you're likely to have actualx
s hanging around.
-
@topspin said in The Raku Programming Language:
@dkf said in The Raku Programming Language:
(Option+/).
/ is actually Shift7 for me, so depending on if that translates to OptionShift7 or just Option7 I get either
\
or|
.is the german keyboard - or rather, the custom of labelling them ONLY for german layout. My company-issued laptop has one of those...
- Shift7 is / (slash), which means that & (ampersand) is... Shift6
- but that means that ^ (caret, quite useful for xor) is somewhere else... ah, just left of 1
- at least I never actually need § (paragraph), so I don't need Shift3
- but wait, that is how I normally white # (Sharp)! where is it... hmm, just between Ä and Enter, above shift (where the \ normally is)
- which means that to write backslash, I need to google... and filter results by OS, because it's (of course) completely different on Windows (AltGr+ß) and Mac (ShiftAlt7) and Linux (AltGr+# if the AltGr is configured as temporary switch to US layout)
Of course, I use the US layout and external keyboard (with US layout). When forced to actually use the laptop keyboard, I need to make sure to never, EVER look at the keyboard. Blind typing is ok, but the muscle memory completely breaks if I get even quick glance at the key labels.
Btw, I should not leave out the parenthesis pair, which is typed as Shift 8 and Shift9.
Yes. Shifted by exactly one position to the left.
That's just evil!... and some people seriously suggest we should start writing × ?