# When is dropping down to K necessary?

**URL:** <https://forum.kx.com/t/when-is-dropping-down-to-k-necessary/10337>\
**Category:** Community Support\
**Tags:** kdb-and-q\
**Created:** [September 3, 2015, 9:20pm UTC](https://forum.kx.com/t/when-is-dropping-down-to-k-necessary/10337 "2015-09-03T21:20:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![i3text](https://avatars.discourse-cdn.com/v4/letter/i/e274bd/32.png) [@i3text](https://forum.kx.com/u/i3text)\
**Post date:** [September 3, 2015, 9:20pm UTC](https://forum.kx.com/t/when-is-dropping-down-to-k-necessary/10337/1 "2015-09-03T21:20:00Z")

</div>

As I understand it, q is to some extent a subset of K4. Since resources for q are rather meager, I’m also drawing on stuff I can find related to K3 and J. When translating code from these languages to q, I’d like to know for what kinds of tasks I would need to make use of K4 directly.

Cheers

---

<div class="post-metadata">

**Author:** ![wp1](https://avatars.discourse-cdn.com/v4/letter/w/db5fbb/32.png) [@wp1](https://forum.kx.com/u/wp1)\
**Post date:** [September 3, 2015, 10:59pm UTC](https://forum.kx.com/t/when-is-dropping-down-to-k-necessary/10337/2 "2015-09-03T22:59:00Z")

</div>

\>q is to some extent a subset of K4

q sits on top of k4, i.e. most q functions are implemented in k4, some straight in c (e.g. avg)

i would stay with q for all tasks you want to translate your code to, as most people on this list will know q, all docs/resources on code.kx.com are q related etc.

---

<div class="post-metadata">

**Author:** ![jay\_han](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@jay\_han](https://forum.kx.com/u/jay_han)\
**Post date:** [September 4, 2015, 3:31pm UTC](https://forum.kx.com/t/when-is-dropping-down-to-k-necessary/10337/3 "2015-09-04T15:31:00Z")

</div>

I wrote this years ago: old k idioms and their q translations &nbsp;– http://code.kx.com/wiki/Qidioms

HTH

-jay

---

<div class="post-metadata">

**Author:** ![i3text](https://avatars.discourse-cdn.com/v4/letter/i/e274bd/32.png) [@i3text](https://forum.kx.com/u/i3text)\
**Post date:** [September 4, 2015, 10:19pm UTC](https://forum.kx.com/t/when-is-dropping-down-to-k-necessary/10337/4 "2015-09-04T22:19:00Z")

</div>

On Thursday, September 3, 2015 at 2:59:09 PM UTC-7, wp wrote:

> \>q is to some extent a subset of K4
> 
> q sits on top of k4, i.e. most q functions are implemented in k4, some straight in c (e.g. avg)

&nbsp;It seems the information I want is not officially documented. Still, since there is functionality accessible in k but not in q and vice versa, such documentation would be useful.

---

<div class="post-metadata">

**Author:** ![i3text](https://avatars.discourse-cdn.com/v4/letter/i/e274bd/32.png) [@i3text](https://forum.kx.com/u/i3text)\
**Post date:** [September 4, 2015, 10:22pm UTC](https://forum.kx.com/t/when-is-dropping-down-to-k-necessary/10337/5 "2015-09-04T22:22:00Z")

</div>

On Friday, September 4, 2015 at 7:31:28 AM UTC-7, [jay...@gmail.com](mailto:jay...@gmail.com) wrote:

> I wrote this years ago: old k idioms and their q translations &nbsp;– http://code.kx.com/wiki/Qidioms
> 
> >

---

<div class="post-metadata">

**Author:** ![jay\_han](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@jay\_han](https://forum.kx.com/u/jay_han)\
**Post date:** [September 5, 2015, 11:14pm UTC](https://forum.kx.com/t/when-is-dropping-down-to-k-necessary/10337/6 "2015-09-05T23:14:00Z")

</div>

There are more than 1000 examples now and several have missing bits because of probably one or more of these reasons:

- forgetfulness (I didn’t do translations in strict linear order), and …

- … I probably skipped a few, thinking I’ll figure them out later (but didn’t :-)

- language changes/deprecation across k2, k3 and k4/q. See examples with “not quite the same”.

I wrote the most of the page originally, Simon Garland corrected/formatted it as the current wiki page, and other people have corrected/edited/added more examples to it over the last eight years.
