Earlier quoted context omitted.
Thinking about problems and data manipulation in the way array languages enable is hard but, once you have pushed through the what feels like a barrier of mainstream programming language thinking that is stopping you from “grokking” it, it is a sudden moment of clarity and then you “get it”. Perhaps a half way house is sql. The difference between ORM-style CRUD and a power user using window functions to make the data…
Agreed. Pushing through until you can think in array languages is well worth it! In my experience one of the top 30 highest ROI mental circuits you can develop. That being said, I'm not convinced that the extremely minimal syntax is essential. I think it can be done another way ;)
Arthur Whitney releases an open-source subset of K with MIT license
131–140 of 234 posts
Re: Arthur Whitney releases an open-source subset of K with MIT license
#132If you'd like an antidote, have a read of Gerald Jay Sussman's books, where you'll see profound concepts from maths and physics captured in succinct and expressive (as opposed to merely terse) code, accompanied by eloquent explanations devoid of boasts or name dropping and provided free of charge online. That will change the way you think about computing too, but it will be a more pleasant experience.
Re: Arthur Whitney releases an open-source subset of K with MIT license
#133I think the link for k.zip was just removed. EDIT: shakti.com/k/k.zip is now returning 404.
Re: Arthur Whitney releases an open-source subset of K with MIT license
#134> K is a proprietary array processing programming language developed by Arthur Whitney and commercialized by Kx Systems. The language serves as the foundation for kdb+, an in-memory, column-based database, and other related financial products. The language, originally developed in 1993, is a variant of APL and contains elements of Scheme. Advocates of the language emphasize its speed, facility in handling arrays, and expressive syntax.
There was also a great thread on HN about it as well[2].
Re: Arthur Whitney releases an open-source subset of K with MIT license
#135FYI: This only implements a subset of K (I'd estimate 1/3). Calling it a 'release' is an overstatement. The docs state that it is a work in progress. It's also quite buggy (it's easy to get a segmentation fault). The version I saw in January was about 1/3 the size of this version, and also buggy. I hope that the final version of this code is less buggy and more usable. If you want to learn the K language, don't use t…
One thing that puzzles me, about array languages, is that despite several open source implementations already existing, like J, its surprisingly difficult to find them packaged in Linux repositories. For example, you can't just "apt install J", or "apt install gnu-apl" on Ubuntu. In J case, it seems the default is just compiling it from source. Is there something tricky about packaging them?
The closest to a repository-friendly array language I could find was the klongpy implementation of klong[0], that is pip installable.
Re: Arthur Whitney releases an open-source subset of K with MIT license
#136If you're looking for a practical k implementation, I recommend ngn/k, and several other implementations are listed at https://k.miraheze.org/wiki/Running_K .
Re: Arthur Whitney releases an open-source subset of K with MIT license
#137Re: Arthur Whitney releases an open-source subset of K with MIT license
#138The code looks heavily obfuscated. It's more like "source available" than open source. E.g. g(_M,W-=1 i?_M(i,M_(i+1))+(2*n0 Edit: Looking at it a bit more, I can't tell if the code is obfuscated or if the author really wrote it like this...
That's the "Whitney style". See: https://code.jsoftware.com/wiki/Essays/Incunabulum It's writing C in array-language style rather than intentional obfuscation.
I can totally believe that he didn't intentionally obfuscate it, but its incomprehensibility made it harder for other people to make a knockoff and thats why it survived and became successful.
Re: Arthur Whitney releases an open-source subset of K with MIT license
#139Earlier quoted context omitted.
And to be clear, in many, if not most cases, settling for "good enough" is the right call, and spending hours upon hours chasing performance is the wrong call.
Sure, but not in the case of maximising performance if that is your goal. Which is what we are talking about here… wringing every ounce of overhead from it is basically the business case; at least one of them.
In other cases, especially in my sector, it's simply that the customer values lower cost over absolute performance.
Of course, not saying you shouldn't be mindful of introducing an O(n^2) algorithm when an O(n log n) can trivially be used, or similar.
Re: Arthur Whitney releases an open-source subset of K with MIT license
#140Earlier quoted context omitted.
Thanks for that link. The comments there help a lot. If I understand them, this is a minimal implementation of K with a lot of limitations, such as: "the only supported atom/vector type is 8bit integer, so beware of overflows" Still, it's fascinating how an interpreter can be written with such a small amount of code.
An interpreter for BLC, including tokenizing, parsing, and evaluation, can be written in as few as 29 bytes of BLC (and 650 bytes of C).