Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There's a very elegant Haskell quicksort implementation that misses out on performance because it's not in-place. It's frequently used as a demonstration. The performant version looks as bad as C.

I'd be more interested in a J/K demonstration that plays to the language's strengths. How about live-commentating e-sports?

* Player gets first blood. Commentator executes search query in J across DB. *

"We've seen $PLAYER_NAME contribute to 65% of first blood situations across their last 10 matches."



Idiomatic K solutions (and from what I hear, J as well) tend to be faster than idiomatic C solutions to the same problems.

It originally seemed like magic to me, but really - there is no magic. It is simpler in K and J to process more things, in more stages, but with completely predictable and very pipelineable operations. The J/K program often does 2 or 4 times as many operations, but has virtually everything prefetched to L1 before it’s needed so it runs as fast or even faster.

CPUs are constantly converging towards the K model (GPUs were always there).


If there was a time for array languages, it would be now. I would argue that most programming nowadays is about manipulating arrays of data.




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

Search: