k or q ? That is the question !

Hi,I’ve gotten deep into learning q, for the past 1 month, but time andagain, I am strongly, very severely tempted to look at k, and hack atit. Is that a good choice?In that light, I have a few questions:1. How do I write K(k4) code, inside the 32 bit evaluation download ofKDB+? is it a simple task of saving to a foo.k and loading using qfoo.k?2. Do I need to download the K4 interpreter from somewhere? Googlethrows up nothing…:(3. Also, old installations of KDB in the industry, must have used k1,k2, and k3. Is it possible to get a interpreter for those, somewhere?4. I read one posting about a “K mode” inside KDB+, can someoneplease explain a little more, about that?Should I then be learning K first, over q?Please advise,Thanks,Krishna

I don’t know how you could learn k without learning q at the same time.? I’ve found little to none documentation on the k language online.? The only way I’ve been able to learn k is to look at how q functions are implemented, and try out the different operators.

If you are at the q prompt then a single \ will put you into k mode.? Another \ will bring you back to the q prompt.

If you are inside a script, preface a line with k).? The rest of the line needs to be k code.

X-Mailtags: { “mailTagsMessageColor” : “255 255 255 100”}To: personal-kdbplus@googlegroups.comX-Mailer: Apple Mail (2.1076)On 10.10.2009, at 20:10, Krishna wrote:> Hi,> I’ve gotten deep into learning q, for the past 1 month, but time and> again, I am strongly, very severely tempted to look at k, and hack at> it. Is that a good choice?> In that light, I have a few questions:> 1. How do I write K(k4) code, inside the 32 bit evaluation download of> KDB+? is it a simple task of saving to a foo.k and loading using q> foo.k?yes, you can do it that way> 2. Do I need to download the K4 interpreter from somewhere? Google> throws up nothing…:(it’s part of q> 3. Also, old installations of KDB in the industry, must have used k1,> k2, and k3. Is it possible to get a interpreter for those, somewhere?yes they didno, older versions are no longer available> 4. I read one posting about a “K mode” inside KDB+, can someone> please explain a little more, about that?\at the q prompt to get you to k mode\again to get you back to q> Should I then be learning K first, over q?given that the documentation is all about q I don’t see much point

X-Mailer: Apple Mail (2.936)k4 is mostly useful for understanding the underpinnings of q, and sometimes for customizing iteveryone should learn at least enough k4 to understand the error prompts that often pop up when using functions from .qbeyond that, it can help you do things like customize the behavior of the .Q functions like hdpf or dsftg, or, if you’re really ambitious, understand how partitions or joins really workthe k4 interpreter is built into the q binaryk[1-3] are no longer availablea file with a .x extension is read by q as a program in language x, so .k is read as ka line with a “x)” prefix is read as a line in language x, regardless of the filename, so k can be included in q files and q can be included in k filesa bare "" in the interpreter (but not in a script file, where it’s a terminating comment) drops you into k mode, where the prompt is two spacesnote that a function can be in only one language: this doesn’t work:% cat foo.qfoo:{a:1; k)-:a}fooair:~ :) % q foo.qKDB+ 2.6 2009.09.15 Copyright (C) 1993-2009 Kx Systemsm32/ 2()core 2048MBk){0N!x y}')@"q""foo:{a:1;\n k)-:a}"q))this does ("-:" is k4 for "neg")% cat bar.qk)foo:{a:1; -:a}fooair:~ :) % q bar.qKDB+ 2.6 2009.09.15 Copyright (C) 1993-2009 Kx Systemsm32/ 2()core 2048MB-1q)

User-Agent: G2/1.0X-Google-Token: vB_0yAwAAACp_k7nInUMGXpmO-_cAkcrX-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_1; en-us) AppleWebKit/531.9 (KHTML, like Gecko) Version/4.0.3 Safari/531.9,gzip(gfe),gzip(gfe)Message-ID: Subject: Re: k or q ? That is the question !From: Phil Harling To: “Kdb+ Personal Developers” X-Google-Approved: simon.garland@gmail.com via web at 2009-10-13 11:16:08On Oct 12, 2:01?pm, Aaron Davies <aaron.dav…> wrote:> k4 is mostly useful for understanding the underpinnings of q, and ?> sometimes for customizing itThis is good advice. You will especially need to have anunderstanding of k if you ever wish to use functional selects andupdates.</aaron.dav…>

Sorry for the late reply, guys, I was travelling(backpacking, andLOVED it !!), just got back, and checked my mail.Many many thanks for the detailed replies, all you guys rock !Thanks,KrishnaOn Oct 10, 11:10?pm, Krishna <kumar.ramanat…> wrote:> Hi,> I’ve gotten deep into learning q, for the past 1 month, but time and> again, I am strongly, very severely tempted to look at k, and hack at> it. Is that a good choice?> In that light, I have a few questions:> 1. How do I write K(k4) code, inside the 32 bit evaluation download of> KDB+? is it a simple task of saving to a foo.k and loading using q> foo.k?> 2. Do I need to download the K4 interpreter from somewhere? Google> throws up nothing…:(> 3. Also, old installations of KDB in the industry, must have used k1,> k2, and k3. Is it possible to get a interpreter for those, somewhere?> 4. I ?read one posting about a “K mode” inside KDB+, can someone> please explain a little more, about that?>> Should I then be learning K first, over q?>> Please advise,> Thanks,> Krishna</kumar.ramanat…>