Live data from Hacker News

Why LLMs Can't Write Q/Kdb+: Writing Code Right-to-Left

medium.com

151–154 of 154 posts

Re: Why LLMs Can't Write Q/Kdb+: Writing Code Right-to-Left

#151

Earlier quoted context omitted.

A human can deal with right-to-left evaluation by moving the cursor around to write in that direction. An LLM can’t do that on its own. A human given an editor that can only append would struggle too.

Idea: feed the language model the parse tree instead of the textual sequence.

Yep, that's exactly what my MCP server is doing -- write in a Python-like language (I called in Qython), parse into AST tree, write the q code.

Re: Why LLMs Can't Write Q/Kdb+: Writing Code Right-to-Left

#152

Earlier quoted context omitted.

Or, even better, also from the cookbook: {(2#x)#1,x#0} But this really borders on obfuscation :P

That does require someone to know that the take operator continues to treat the y list as circular when x is a list. I think this form might be a bit easier: {(x,x)#(x*x)#1,x#0}

But then you're not flexing your q muscles. Btw this is from the cookbook, these obfuscated patterns are actually recommended! https://code.kx.com/phrases/matrix/#identity-matrix-of-order...
Post reply on HN