K is a concise and powerful array-oriented programming language designed for speed and expressiveness. It prioritizes right-to-left evaluation, uses a small set of built-in symbols for a wide range of operations, and features implicit iteration over arrays. This allows complex data transformations to be expressed with minimal code. K leverages a dictionary-like structure called an associative array as its core data type, facilitating easy handling of key-value pairs. The language is intended for building high-performance applications, particularly in domains like finance where efficient data manipulation is crucial. Its terse syntax and powerful primitives make it ideal for rapid prototyping and concise expression of algorithms.
This paper chronicles the adoption and adaptation of APL in the Soviet Union up to 1991. Initially hampered by hardware limitations and the lack of official support, APL gained a foothold through enthusiastic individuals who saw its potential for scientific computing and education. The development of Soviet APL interpreters, notably on ES EVM mainframes and personal computers like the Iskra-226, fostered a growing user community. Despite challenges like Cyrillic character adaptation and limited access to Western resources, Soviet APL users formed active groups, organized conferences, and developed specialized applications in various fields, demonstrating a distinct and resilient APL subculture. The arrival of perestroika further facilitated collaboration and exchange with the international APL community.
HN commenters discuss the fascinating history of APL's adoption and adaptation within the Soviet Union, highlighting the ingenuity required to implement it on limited hardware. Several share personal anecdotes about using APL on Soviet computers, recalling its unique characteristics and the challenges of working with its specialized keyboard. Some commenters delve into the technical details of Soviet hardware limitations and the creative solutions employed to overcome them, including modifying character sets and developing custom input methods. The discussion also touches on the broader context of computing in the USSR, with mentions of other languages and the impact of restricted access to Western technology. A few commenters express interest in learning more about the specific dialects of APL developed in the Soviet Union and the influence of these adaptations on later versions of the language.
The blog post explores two practical applications of the K programming language in data science. First, it demonstrates K's conciseness and efficiency for calculating quantiles on large datasets, outperforming Python's NumPy in both speed and code brevity. Second, it showcases K's ability to elegantly express the k-nearest neighbors algorithm, highlighting its expressive power for complex calculations within a limited space. The author argues that despite its steep learning curve, K's unique strengths make it a valuable tool for certain data science tasks where performance and compact code are paramount.
The Hacker News comments generally praise the elegance and conciseness of K for data manipulation, with several users highlighting its power and expressiveness, especially for exploratory analysis. Some express familiarity with K and APL, noting the steep learning curve but appreciating the resulting efficiency. A few commenters mention the practical limitations of K's proprietary nature and the scarcity of available learning resources compared to more mainstream languages like Python. Others suggest that the article serves as a good introduction to the paradigm shift required to think in array-oriented languages. The licensing costs and limited community support are pointed out as potential drawbacks, while the article's clarity and engaging examples are commended.
Summary of Comments ( 97 )
https://news.ycombinator.com/item?id=42999650
HN users discuss K's terse syntax, powerful array-oriented programming, and steep learning curve. Some find its conciseness appealing, comparing it favorably to APL and J, while others find it overly cryptic. Several commenters mention its historical influence on other languages and databases like kdb+. Performance is a recurring theme, with users noting K's speed and efficiency. The lack of free, readily available learning resources is also highlighted as a barrier to entry, though some point to the "K Book" mentioned in the submission as a useful starting point. The community appears small but dedicated, with experienced K programmers offering insights and resources to those curious about the language.
The Hacker News post "What about K?" discussing the linked K language tutorial sparked a lively conversation with several compelling comments. Many commenters focused on the language's unique characteristics, both positive and negative.
Several users pointed out the extreme terseness and symbolic nature of K, acknowledging its power for concise expression but also its steep learning curve and difficulty in reading and understanding code written by others. One commenter compared it to APL, another array-oriented language known for its symbolic nature, and described K as "APL taken to its logical extreme." Another user highlighted its connection to functional programming, noting that K's focus on composition and tacit programming aligns with functional programming principles.
The discussion also touched upon the practical applications of K, with some commenters mentioning its use in finance, particularly for high-performance computing and data analysis. One commenter specifically noted its prevalence in high-frequency trading due to its efficiency. However, other commenters questioned its broader applicability outside of niche domains, citing the difficulty of learning and maintaining K code as potential barriers to wider adoption.
Performance was another recurring theme, with several users highlighting K's speed and efficiency. This ties back to its use in finance, where performance is critical. However, this performance comes at the cost of readability and maintainability, as noted by other commenters.
The thread also included discussion of K's history and evolution, with mentions of Arthur Whitney, the creator of K, and its relationship to other array-oriented languages like APL and J. One comment explored the lineage from APL to A+ to K, providing context for K's design and philosophy.
A few commenters expressed skepticism about K's long-term relevance, questioning whether its benefits outweigh its drawbacks in the context of modern software development practices. The challenging syntax and limited community support were cited as potential reasons for its niche status.
Overall, the comments on Hacker News paint a picture of K as a powerful but esoteric language with a dedicated following in specific domains. While its performance and conciseness are attractive features, its steep learning curve and challenging syntax present significant barriers to wider adoption. The discussion highlights the trade-offs between performance, expressiveness, and maintainability inherent in different programming language paradigms.