News for hackers. Stuff that matters.
Re:Klong: a Simple Array Language by e12e on Sunday December 22, 2019 @06:57AM (#21856688)
> The only reason you find the c-style version simpler is because that's what you are used to.

Well, yes. But we're taught infix notation early (x+y), and function application quite early too (y=f(x) - and in combiation (also note short-hand eliding multiplication): f(x) = 2x + 1).

I still find array languages to be too dense for me - but I do understand that they are simple from a certain point of view.

Re:Klong: a Simple Array Language by smabie on Sunday December 22, 2019 @08:06AM (#21856934)
I did too, but just try them out for a week, you’ll love it. Moreover array based language like Q do have infix notation.

f(x)=2x+1

In Q is

f:{1+2*x}

You could call it with: f 5 or f[5]. It’s really not any different.

Re:Klong: a Simple Array Language by e12e on Sunday December 22, 2019 @08:15AM (#21856962)
Hm, I could see myself playing with it - but I'm not quite seeing how I'd fit it into my day job. I do occasionally work with some simple aggregation and filtering - but usually in an sql db - and barring embedding an array language, I'd have to fetch all the data into eg: klong first, then process. It's hard to imagine a scenario where that would make sense.

Otoh, I'm still considering working through advent of code - such domains should be well suited, I guess.

Re:Klong: a Simple Array Language by smabie on Sunday December 22, 2019 @10:07AM (#21857478)
If you're writing business logic, I'm not sure how helpful array-based languages are. The code would look very similar to a normal language, but without the classes or methods or objects.

For advent of code, it really shines though. Read in some big chunk of data, do a bunch of matrix and list operations to get the answer.

Re:Klong: a Simple Array Language by e12e on Sunday December 22, 2019 @08:09AM (#21856941)
Really like the introduction by the way, it reads better than most I've read on apl/k - with a suitable mix of motivation and explanation - and not too much "pride" (like, lisp pride, or apl pride, where authors cannot imagine any reason why other languages exist. Seems especially common when run-times are written in such a language; namely C...).

To be clear, a little language pride is always warranted :-)

Other than that, I find it a bit funny that the factorial function is singled out as an example of why naming (short) functions are redundant - seeing as how it's one of the first "complex" functions/operands thaught/named in mathematics, and heavily used to shorten notation for for example combinatorics (that is "n!").

But I think this just reflects on the (for me) somewhat alien culture of array languages - its not wrong, but it is different.