Hacker News new | ask | show | jobs
by fa 4009 days ago
Your experience with Q is really a satisfying read! Should I abandon my tepid attempts to get into J and throw myself on Q, despite its hefty pricetag for 64-bit version? Would you be able to do as much with Kona instead of Q?
1 comments

Glad to hear my useless observations benefited someone!

Getting into J: I like J a lot. I like how professional the software is, their excellent docs, and their amazing community on IRC. But for some darn reason, the syntax just doesn't make sense to me. I know that sounds silly when we're talking about Q or K which are pretty unreadable, but I kinda-sorta grok the latter a lot more easily (the difficult part is adverbs, etc). I get why they chose the ascii chars they chose; with J, I feel totally lost. "NB."?! Cmonnnn.. :)

Kona is based on an earlier version of K, the language that underlies Q, and though I am sure you could learn a ton from it, I need something that's been vetted a bit more because I intend to put it into production (crazy as that sounds) and Kona is still developing much of their HTTP and database support. I also wanted to learn the latest iteration, Q, which Kona hasn't implemented a dialect of just yet. Still a cool project that I follow actively on Github.

I'm struggling with the 32bit vs 64bit thing now. I know I couldn't ever justify the 64bit version with my pathetic budget. The great thing about the 32bit version is that you can easily spawn multiple copies of the interpreter, and IPC is incredibly fast (1mil sync messages to localhost in 52sec on my SurfacePro3, 607msec async). So theoretically you could easily build "microservices" that each live in 4gb and pass messages back in forth[1].

At least in theory. I'll be documenting my experiments soon if all goes as planned. Already seeing big benefits.

[1] That sounds hacky as hell coming from most platforms, but IPC in K/Q is baked in as a fundamental, powerful primitive, a bit like how Erlang's messages underlie the entire system. For instance, their Tick system (http://code.kx.com/wiki/Startingkdbplus/tick) used for insane volume is an ingenious way to feed out tons of data to tons of clients (firehose) and let them pick their own views of it.

Had a kind of opposite experience with K.

J seems quite reasonable - intuitively - after reading very good "J for C programmers" (http://jsoftware.com/help/jforc/contents.htm) . And symbols in J chosen for most operations also seem good - at least after some small use. "NB." is immediately "nota bene" (I guess knowing some Latin doesn't hurt - it's "note well", but I always understand it as "note that") - don't some other languages use this acronym for comments as well?

What is IMO particularly good in K is the small size of the interpreter. J is "for the whole math", while K is "for practical 99% of cases" - at least it feels like that. Having small interpreter which fits in CPU cache allows potentially to run faster than with assembler, because K code is packed densely - so less time to wait for slow memory.

I'm in.

In a Previous Age, there were “rumors that there would be interest in opening up the language if there would be enough community response around it”—wonder if they amounted to anything [1]. Interest in k is only growing it appears.

[1] http://www.kuro5hin.org/story/2002/11/14/22741/791

The 32 bit version of k4/q is free from Kx (the original K people) is now free from http://kx.com

There's a GPL implementation of K3 called Kona at https://github.com/kevinlawler/kona ; kevin lawler also has a language called kerf (not open source) that is based on the same principles with a different syntax (JSON+SQL+more).

John Earnest has a Javascript implementation of K5 called oK at https://github.com/JohnEarnest/oK

Andrey Zholos has a JITing implementation of a K-like language at https://github.com/zholos/kuc