Pompidou 4 hours ago

R is also an array language, but a non-iversonian one. Another good ressource for array languages is https://aplwiki.com/.

r/apljk on reddit is also active.

  • countrymile an hour ago

    That's my understanding too. R never seems to make these lists.

seanhunter 3 hours ago

At one time I briefly spent a bunch of time learning kdb/q. I remember one particular day when I wrote a non-trivial program and it worked first time. I was so shocked I thought I must have suffered some kind of brain aneurism or something.

gcanyon 5 hours ago

Array languages are such a mind twist and so fun. I dabbled in J at one point, and I love explaining

+/%#

to people. But the real expressive power comes when you start to get into tacit expressions yourself, understand function exponents, and "get" under.

Hmmm... maybe I need a refresher...

thristian 4 hours ago

APL and K are still pretty daunting, but I've recently been dabbling in Lil[1], which is something like a cross between K and Lua. I can fall back on regular procedural code when I need to, but I appreciate being able to do things like:

    127 * sin (range sample_rate)*2*pi*freq_hz/sample_rate
This produces one second audio-clip of a "freq_hz" sine-wave, at the given sample-rate. The "range sample_rate" produces a list of integers from 0 to sample_rate, and all the other multiplications and divisions vectorise to apply to every item in the list. Even the "sin" operator transparently works on a list.

It also took me a little while to get used to the operator precedence (always right-to-left, no matter what), but it does indeed make expressions (and the compiler) simpler. The other thing that impresses me is being able to say:

    maximum:if x > y x else y end
...without grouping symbols around the condition or the statements. Well, I guess "end" is kind of a grouping symbol, but the language feels very clean and concise and fluent.

[1]: https://beyondloom.com/decker/lil.html

  • fainpul 4 hours ago

    I assume this is the same as this?

      # python
      [127 * sin(x * tau * freq / samplerate) for x in range(samplerate)]
    • zahlman 3 hours ago

      For that matter,

        # python
        from numpy import sin, arange, pi
        127 * sin(arange(samplerate) * 2 * pi * freq / samplerate)
    • thristian 3 hours ago

      Pretty much, yeah! The difference is that in Python the function that calculates a single value looks like:

          foo(x)
      
      ...while the function that calculates a batch of values looks like:

          [foo(x) for x in somelist]
      
      Meanwhile in Lil (and I'd guess APL and K), the one function works in both situations.

      You can get some nice speed-ups in Python by pushing iteration into a list comprehension, because it's more specialised in the byte-code than a for loop. It's a lot easier in Lil, since it often Just Works.

marcentusch 5 hours ago

This is cool. Wish there was more examples for jtye/k so I would have a better chance of learning to use it.

Also missing Uiua.

veridianCrest 3 hours ago

Array languages: where your first working program feels like a happy accident.

  • OneDeuxTriSeiGo 3 hours ago

    Programming in an array lang "should" generally feel like using a calculator.

    You are working in a REPL, starting with small expressions to verify they are roughly doing what you want and then composing them to build up until you can plug it all together and now have a formula you can plug into the calculator to plug and chug all the rest of your data.

    So in that sense yeah it does kind of replicate the magic of the first time you got a complex equation or BASIC program to run on your TI back in your school days.

feraloink 5 hours ago

This is wonderful: APL is there! And a visual APL keyboard too.

ludsan 5 hours ago

no uiua :(

  • evnu 4 hours ago

    Uiua is the first one that made array languages "click" for me due to the formatter.

  • etatoby 4 hours ago

    Came here to say the same thing. Uiua is my favorite language by far. BQN is also a cool "Nu-APL" but Uiua is just a full generation ahead.

srean 5 hours ago

It's missing Nial I think.

nathell 5 hours ago

Is this written by Arthur Whitney himself?

JoshGG 5 hours ago

MATLAB is an array language.

  • radiator 4 hours ago

    it is one of their cousins