3 ms·
From the coding conventions for Kona (http://github.com/kevinlawler/kona/wiki/Coding-Guidelines http://github.com/kevinlawler/kona/wiki/Coding-Guidelines), an o
by silentbicycle 16y ago
From the coding conventions for Kona (http://github.com/kevinlawler/kona/wiki/Coding-Guidelines http://github.com/kevinlawler/kona/wiki/Coding-Guidelines), an open-source implementation of K 3.2 that I've been contributing to lately:
This is a very unusual style of C
"The unusual appearance is a side effect of writing C as concisely as possible. There are great benefits to writing code as concisely as possible. Someone familiar with the style can read and comprehend the code much faster than they would be able to with traditional code. It also creates a discipline that reduces bugs. Some of the benefits will not be apparent until you try it. Some of the downsides of the style are inaccessibility and a steep learning curve."
You get used to code like that, and often, doing it that way makes sense. I first encountered it learning to read this short prototype interpreter (http://nsl.com/papers/origins.htm http://nsl.com/papers/origins.htm) by Arthur Whitney, which very strongly influenced the programming style in the J codebase.
As gruesom notes, this discussion has already happened numerous times in the HN archives. Your reaction is the APL equivalent of going, "OMG! Parens!!!!1!" when introduced to Lisp code.
- scott_s 16y agoFair enough, although I've read many threads on APL-derived languages over the years on HN, but I somehow missed the discussion of the C runtime implementation.
- silentbicycle 16y agoAFAICT, the implementations have usually been closed-source (with the exception of A+ (http://www.aplusdev.org/ http://www.aplusdev.org/), which is GPL'd; Arthur wrote it before K), and most research on APL implementation is locked behind the ACM paywall. I suspect part of the style comes from APLers typically being mathematicians as well as programmers, and drawing more from mathematics than typical "software engineering best practices" style.
- scott_s 16y agoThen, forgive me for harping on this, how could this discussion have already happened numerous times on HN? And by "this discussion" I mean the C style used to implement APL-derived languages, not the style one uses to write programs in APL-derived languages.
- silentbicycle 16y agoThey've mostly involved the "J Incunabulum" prototype and A+. See e.g. http://news.ycombinator.com/item?id=2178177 http://news.ycombinator.com/item?id=2178177 .
- deleted 16y ago[deleted]