Hacker News new | past | comments | ask | show | jobs | submit login

Some context often missing form these "code golf" showcases:

Domain specific languages have syntax optimized towards specific tasks. This often means very compact symbolic expressions which looks completely inscrutable to outsiders but are highly efficient when you know the language. String processing in Perl, pointer arithmetic in C, selectors in jQuery. Nobody can guess what the code does by looking at it, you have to learn the language. But it is worth the investment when the task in question is often used.

So the question is, are you working in a domain where the investment in learning a particular DSL will pay off?

But this context is completely absent in the article. By comparing the K syntax for "reduce" with a for-loop, it assumed the competition is systems languages like C or Go where a for-loop is idiomatic. But then the question is, how often do you use "reduce"-like operations in this domain anyway? It is really worth optimizing the langauge towards?

If on the other hand the article admitted K is a domain specific language optimized for numerical processing, then a reasonable comparison would be against Numpy or Matlab, perhaps Haskell, not for-loops.




I don't think he was actually arguing that K is domain-specific, he was just observing that it seems that way to outsiders.

If anything, the most successful applications seem to be with databases (not math), but it's also pretty great for interactive graphics:

https://github.com/JohnEarnest/ok/tree/gh-pages/ike

I work at the same company as the author, and we use K3 for all kinds of things -- system administration, network servers, interactive web apps.

It's a pretty general purpose language. And you can even do old-school loops if you want. It's just very concise.

Also, in K, there's a whole set of one-or-two-character symbols that allow you to express other uses of loops in traditional languages.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: