News for hackers. Stuff that matters.
Re:K: We need to talk about group by pavlov on Friday March 31, 2023 @03:24PM (#35392132)
It’s awe-inspiring to see a K program where the comments are in another APL variant (I can’t pretend to know which):

  {d:~1=':s:^x             / s‿e←1⊸»⊸(>⋈<)' '=𝕩
   c:^"aeiou"?_x@&d&~s     / c←¬(s/𝕩)∊"aeiou"
   x,:,/$`pig`dog c        / ins←⥊c⊏["pig","dog"]
   x@<(+\d),{3}#c+2*!#c}   / ((+`s+e)∾3/c+2×↕≠c) ⍋⊸⊏ 𝕩∾ins
This program implements a Pigdog Latin translator, bien sûr.
Re:K: We need to talk about group by warent on Friday March 31, 2023 @03:27PM (#35392171)
this looks like some compiled program's binary viewed as unicode WTF
Re:K: We need to talk about group by qsort on Friday March 31, 2023 @04:00PM (#35392700)
I... just can't. I work a lot with data, so it sounds like it should be a good fit for what I do, but I find that writing the damn code in a normal language is much more productive. Maybe it's my brain that's wired wrong, but I fail to see how the entire construction is supposed to help.
Re:K: We need to talk about group by mandevil on Friday March 31, 2023 @05:41PM (#35394053)
A friend worked on a project in 2005 that had lots of K code in production. They had a contract with Kx Systems and Arthur Whitney in particular because, in my friend's opinion, only Whitney could really understand K code well enough to debug it. Friend's description was it took my friend two days just to comment the code into something grokkable by a normal developer, whereas AW didn't need to do that. Of course, it took Whitney those same two days of staring at the code before he said "Oh, of course, how silly of me." and found the bug and all resolved.

Part of those two days of commenting was that since K is interpreted all of the developers would hand-obfuscate all of the code so that the variables were a, b, c, etc. so that they would be slightly faster to parse than a multi-character string. This sort of thing is done all the time now, with JS to make it load faster, but his team at least didn't have any scripts to automatically turn developer-friendly code into interpreter-friendly code, they worked with the interpreter-friendly code version.

Re:K: We need to talk about group by twoodfin on Friday March 31, 2023 @09:56PM (#35396247)
In my experience this practice isn’t obfuscation or for performance. The whole point of array processing languages is to amortize any fixed operation cost over the span of the array.

The notation-as-a-tool-of-thought camp prefers short identifiers on the principle that the more concise the expression, the easier it is to comprehend in total. This is not at all dissimilar from the general practices of mathematics.

Re:K: We need to talk about group by tluyben2 on Saturday April 01, 2023 @04:35AM (#35398456)
Once you get used to it, it's just faster and stop noticing the 'oh line noise' thing. But like learning a natural language, you need to get to the point where you stop translating in your head and you think in the operators. Once you reach that, it is very hard to go back.
Re:K: We need to talk about group by therein on Saturday April 01, 2023 @05:17AM (#35398646)
And Whitney is into being able to see the whole code at a single glance as far as I know.
Re:K: We need to talk about group by chongli on Friday March 31, 2023 @07:07PM (#35394992)
I think the main use for K and the other APL family languages is programmer lock-in. If you can get your employer to buy in and write the entire codebase in one of these languages, you can establish yourself as essentially irreplaceable and then demand large raises to retain you.
Re:K: We need to talk about group by Avshalom on Friday March 31, 2023 @08:13PM (#35395541)
what was your first programming language?

mine was matlab. thinking of everything as an array, especially things that aren't arrays, was the first pattern I ever learned. I've never used APL in anger but for the most part it comes very easily to me. Maybe not the code golfing and/or idiomatic APL style that people like to post but, like, using the primitives to create increasingly elaborate arrays before discarding anything I don't want, that part has always felt very straight forward.

Re:K: We need to talk about group by userbinator on Friday March 31, 2023 @10:07PM (#35396320)
Chinese is a "normal language" to over a billion people.
Re:K: We need to talk about group by tluyben2 on Saturday April 01, 2023 @03:59AM (#35398227)
How long did you try? And what languages do you use?
Re:K: We need to talk about group by semi-extrinsic on Friday March 31, 2023 @04:13PM (#35392909)
Isn't the original APL the only lang that uses actual Unicode symbols for operators?
Re:K: We need to talk about group by remexre on Friday March 31, 2023 @04:40PM (#35393329)
Agda does too! https://plfa.github.io/ for examples
Re:K: We need to talk about group by ksherlock on Friday March 31, 2023 @04:32PM (#35393218)
There are esoteric code golf languages that use unicode. MPW (shell, assembler) used extended characters (MacRoman, not unicode but then again, APL also predates unicode) for some operations.

eg, instead of "echo yo >> file" you would "echo yo ≥ file"

Re:K: We need to talk about group by messe on Friday March 31, 2023 @08:16PM (#35395566)
Julia has support for Unicode operators. Most editor plugins for Julia allow you to enter the characters using (La)Tex syntax, so it’s quite common to see.
Re:K: We need to talk about group by sli on Friday March 31, 2023 @09:31PM (#35396092)
Unicode support doesn't really seem that uncommon, in the grand scheme. Rosetta Code's wiki has a page for languages that support Unicode variable names[0] and some of them were surprising to me (e.g. AppleScript).

Of course, supporting Unicode variable names doesn't mean a language supports Unicode anywhere, but it's a starting point for historical research at least.

[0]: https://rosettacode.org/wiki/Unicode_variable_names

Re:K: We need to talk about group by pavlov on Friday March 31, 2023 @04:20PM (#35393034)
There’s also at least BQN, which I suspect is the language used in those comments:

https://mlochbaum.github.io/BQN/

Re:K: We need to talk about group by chrispsn on Friday March 31, 2023 @05:28PM (#35393920)
Yep, the comments are the BQN version.
Re:K: We need to talk about group by thechao on Friday March 31, 2023 @05:25PM (#35393882)
Fortress.
Re:K: We need to talk about group by Jasper_ on Friday March 31, 2023 @05:25PM (#35393887)
APL predates Unicode! You used to have to use special APL keyboards to write it. The symbols were included in Unicode as a way to try and make APL more palatable.
Re:K: We need to talk about group by jdlshore on Saturday April 01, 2023 @02:16PM (#35402573)
> The symbols were included in Unicode as a way to try and make APL more palatable.

That seems highly unlikely. Do you have a source, or are you sharing speculation as fact?

It’s more likely that APL symbols were included in Unicode as part of its mission to unify all the world’s scripts into single code set.

Re:K: We need to talk about group by shrubble on Sunday April 02, 2023 @03:32AM (#35408123)
They weren't included to make it more palatable, but because APL was being actively used in larger systems.
Re:K: We need to talk about group by mostlylurks on Friday March 31, 2023 @05:54PM (#35394183)
Haskell allows defining unicode operators, and has an extension that allows you to use unicode symbols instead of ascii sequences in various parts of the syntax.
Re:K: We need to talk about group by jlg23 on Friday March 31, 2023 @06:13PM (#35394417)
APL predates the first documented thoughts (not specification/implementation) of unicode by roughly 20 years.
Re:K: We need to talk about group by bbarnett on Friday March 31, 2023 @09:35PM (#35396130)
APL predates the first documented thoughts

I used to think that Lisp was bad, with its "God coded the universe in Lisp", then I read only the first part of your sentence, and was "Woha, so APL predates thought?!"

https://www.youtube.com/watch?v=5-OjTPj7K54

Re:K: We need to talk about group by dan-robertson on Friday March 31, 2023 @06:33PM (#35394660)
Raku (fka perl6) has some, eg you can use <atom emoji>+= to atomically increment a value.
Re:K: We need to talk about group by Avshalom on Friday March 31, 2023 @09:09PM (#35395942)
this is a bit obscure but Trealla Prolog allows for full unicode in the source and user defined operators, which is nice.
Re:K: We need to talk about group by lizmat on Saturday April 01, 2023 @10:36AM (#35400613)
No.

In the Raku Programming Language there are several non-ASCII operators, although each of them has a pure ASCII equivalent. Some examples: ≤ vs <=, ≠ vs !=, ∈ vs (elem), etc.

The full list: https://docs.raku.org/language/unicode_ascii.html

Re:K: We need to talk about group by tempaway45722 on Friday March 31, 2023 @04:24PM (#35393094)
k
Re:K: We need to talk about group by krick on Friday March 31, 2023 @05:34PM (#35393966)
Amazingly, APL is more readable. Actually, it's even pretty intuitive. Which proves again, that restricting code to ASCII when every competent programmer (and PC-user in general) can enter almost any unicode symbols just fine is simply stupid.
Re:K: We need to talk about group by scrawl on Friday March 31, 2023 @09:10PM (#35395945)
i don't think it's stupid. i also find k more readable. 2 reasons why:

- k has much fewer primitives. it's easier to remember a smaller set of operations.

- k is statically parsable. APL is not. we know the program structure simply by reading the code.

this is completely subjective. because you find APL more intuitive doesn't prove anything. to each their own.

Re:K: We need to talk about group by habitue on Friday March 31, 2023 @10:34PM (#35396465)
You can enter any symbol but not quickly unless you set up some hotkeys or something. There is a key on the keyboard for e. Whatever you have to do for a unicode set symbol, it's going to be harder than hitting the e key.

And with regards to hotkeys, let's say you do Ctrl+alt+shift+esc+e to insert a unicode symbol, is that really better than just having a programming language where the common hotkeys are spelled out with a few ASCII characters?

Re:K: We need to talk about group by magicalhippo on Saturday April 01, 2023 @08:43AM (#35399843)
> There is a key on the keyboard for e. Whatever you have to do for a unicode set symbol, it's going to be harder than hitting the e key.

Seems https://fluxkeyboard.com/ might be a great fit for programming in APL and similar.

Re:K: We need to talk about group by Avshalom on Saturday April 01, 2023 @09:24AM (#35400135)
I have the apl keyboard set to super so ∊ is exactly as hard as E.
Re:K: We need to talk about group by habitue on Saturday April 01, 2023 @02:32PM (#35402738)
That's the reason the apl keyboard is good!
Re:K: We need to talk about group by wruza on Saturday April 01, 2023 @10:33AM (#35400585)
←⥊c⊏∾×

Yeah, I’d love to discuss with colleagues how square-c works together with right double crowbar.

No, thanks.

Re:K: We need to talk about group by pavlov on Saturday April 01, 2023 @12:26PM (#35401539)
If you see the following:

x = √y

… would you pronounce it as “x, two parallel horizontal lines, V with a left hook, y”?

The symbols have a meaning that’s unrelated to their appearance. It’s the same in APL. The “square c” is just like “V with a left hook”.

Re:K: We need to talk about group by wruza on Sunday April 02, 2023 @09:06AM (#35410106)
And octothorp (#) is “eight-something”. Circumflex (^) is “bent around”. Names of most characters only sound academic because we don’t know Latin and Greek too good.

“√” isn’t even a natural character, it’s a graphical delineator between an index and a radicand, similar to ÷ or % forms of division. By “obelus” (sharpened stick) do you mean dot above and below a line, a percent, a dagger or just a line?

Sure there will be enough confusion with ~10-30 extra symbols that aren’t even on a keyboard and may not have a single meaning or a name.

Re:K: We need to talk about group by jazzyjackson on Sunday April 02, 2023 @03:04PM (#35413962)
???

The point is, within the programming language, they do have a single meaning and a a name.

Re:K: We need to talk about group by adregan on Friday March 31, 2023 @07:42PM (#35395287)