News for hackers. Stuff that matters.
Re:How much can a Clojure developer do alone? by jimbokun on Tuesday March 30, 2021 @02:58PM (#26638812)
> [1] Why aren't we all writing in APL/K/J if it matters that much?

Because most programmers aren't nearly as productive as we could be.

And because "concise" should be measure in the number of tokens needed to achieve certain functionality, not by excessive use of single character tokens.

Re:How much can a Clojure developer do alone? by CraigJPerry on Tuesday March 30, 2021 @03:28PM (#26639219)
I wonder if there’s a sweet spot for verbosity or if it doesn’t really correlate with bugs or productivity. I end up thinking about this pretty regularly.

For example Kdb/q has always fascinated me, my initial reaction was that encoding meaning into fewer symbols surely causes cognitive overload and promotes programmer failure, and yet i saw some python code written by a quant converted to q by a kdb developer. The original python was well written, it relied on pandas and numpy but all fairly garden variety stuff.

The q had exactly the same behaviour except some small changes for data ingestion. Around 500 lines of python, 16, not a typo, 16 lines of q. The performance comparison was absurd too.

Re:How much can a Clojure developer do alone? by arabelladonna on Tuesday March 30, 2021 @03:50PM (#26639497)
> The q had exactly the same behaviour except some small changes for data ingestion. Around 500 lines of python, 16, not a typo, 16 lines of q. The performance comparison was absurd too.

I think this comes down to every symbol having a defined behavior that can be optimized around, rather than building a framework for creating your own symbols (functions). Dyalog APL has some similarly insane "beating C"-type benchmarks.

However, if you were to branch out into the more traditional constructs in Dyalog APL or J (K/Q have less of them due to being much, much less generalized), you'd probably see some significant performance decreases simply because they're more generalized. Eg. I doubt that Dyalog APL objects are as optimized as C++ objects.

Note: I have no experience designing languages or building compilers/interpreters. I just wanted to put my two cents in, rather than leave this on the somewhat vague and "mystical" note.

Re:How much can a Clojure developer do alone? by anonu on Tuesday March 30, 2021 @03:58PM (#26639608)
This has been my experience as well. 10x factor reduction in LOCs and increase in performance when moving to kdb/q
Re:How much can a Clojure developer do alone? by roninhacker on Tuesday March 30, 2021 @03:34PM (#26639278)
>And because "concise" should be measure in the number of tokens needed to achieve certain functionality, not by excessive use of single character tokens.

I am totally nitpicking here, but as a longtime Clojure programmer, I do have a bit of APL envy. Aaron Hsu (noted APL guy) made the point that brevity (in the linear, #-of-characters sense) let's you decrease complexity by avoiding indirection---when the body of a function is shorter than any name you might give it, you can just...write it...rather than writing it somewhere else and calling it.

I don't plan to switch away from Clojure any time soon, but I definitely want to play around with the APLs.

Re:How much can a Clojure developer do alone? by mlochbaum on Tuesday March 30, 2021 @03:51PM (#26639522)
You may be interested in April[0], a version of APL embedded in Common Lisp so that it can be called as part of a CL program. Also, my own language BQN[1] is a rework of APL that comes much closer to Lisp in that it has first-class functions and closures. It's self-hosted (using a compiler that follows Aaron's strategy), allowing it to be embedded in other languages with relatively little effort, but currently poor performance. There are Javascript and C VMs with another programmer working on one in Erlang; Clojure could definitely be a possibility.

[0] https://github.com/phantomics/april

[1] https://mlochbaum.github.io/BQN/

Re:How much can a Clojure developer do alone? by roninhacker on Tuesday March 30, 2021 @04:04PM (#26639690)
Wow, this is totally cool, thank you!
Re:How much can a Clojure developer do alone? by philwelch on Wednesday March 31, 2021 @04:04PM (#26652385)
> And because "concise" should be measure in the number of tokens needed to achieve certain functionality, not by excessive use of single character tokens.

That makes me wonder how this would shake out differently if we didn’t use Latin-based writing as the foundation of our programming languages. If you had a programming language that used Chinese characters, would that be fundamentally more usable, assuming that you understood Chinese characters to begin with?

Re:How much can a Clojure developer do alone? by arabelladonna on Tuesday March 30, 2021 @03:55PM (#26639566)
> And because "concise" should be measure in the number of tokens needed to achieve certain functionality, not by excessive use of single character tokens.

What's the difference if the symbols were meant to have specific mathematical meanings and are really meant to be the only representation?

Plus, readability is subjective.