Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Advent of q 2022 (github.com/qbists)
116 points by todsacerdoti on Dec 8, 2022 | hide | past | favorite | 21 comments


Other array language AoC collections, although they don't come with explanations like the OP:

- K: https://k.miraheze.org/wiki/Advent_of_Code

- APL: https://aplwiki.com/wiki/Advent_of_Code

- BQN: https://mlochbaum.github.io/BQN/community/aoc.html


I've tried to use AoC and Project Euler to learn k, but I've given up in the past because there are multiple versions of k interpreters & tutorials out there with subtly different language behavior. And running code from one version of the language in another interpreter results in obscure errors or crashes.

It would be nice if this repo specified the exact binaries used so that the results would be reproducible.


There's only one Q.

Open source K is likely compatible with ngn/k or oK, both of which are based on k6. There are minor differences between these 2 implementations (one is browser-native, the other isn't) but for the most part code should work identically on both.

Q: https://code.kx.com/q/

ngn/k: https://codeberg.org/ngn/k

oK: https://github.com/JohnEarnest/ok/


I found the most recent episode of array cast[0] to be pretty illuminating regarding what’s what with k. I too found it pretty difficult to know which k is the right k to use.

0: https://www.arraycast.com/episodes/episode41-john-earnest


As far as I know, there's only one q, which is the query language of kdb+, implemented in k4.


This will be for kdb+. (Nick Parsis wrote a very good book on it, Stephen Taylor is the Librarian at KX)


try J


I've created a similar repo of puzzles, including Advent of Code, but solved in the Whitespace programming language. Even otherwise easy puzzles are made significantly more difficult in Whitespace, as it is a quite low-level language. The control flow feels like coding in assembly and the stack paradigm feels like a Forth. The challenge is fun, though, and I'm filling in the gaps of my (unofficial) standard library as I go.

https://github.com/andrewarchi/ws-challenges


Is there an open-source implementation of Q? Syntactically, it seems more approachable than other array languages, especially due to the use of identifiers instead bespoke symbols for non-standard operators.


Apparently "AOC" is also this electronics warfare advocacy org, and definitely not a Batman archenemy secret society.

https://en.wikipedia.org/wiki/Association_of_Old_Crows


They have published some really interesting books on EW during the cold war. The volume I have has a lot of info that I've been unable to find anywhere else.


Yes, the acronym could use expanding in the title


To be clear, the submission title used to be something like "AOC 2022 in q"


It is no Q, but I really like Wolfram Language for its expressive power. Look for example at this solution[1] for problem 8 - highlights the fact that Parts 1 and 2 are essentially the same.

[1] https://twitter.com/vkryukov/status/1600726415778775042


Rumor has it, a young Arthur Witney's cat once walked across his keyboard. He jumped out of his chair in great joy and exclaimed "By God, Senor Mittens! This is it! This is how my programming language will look!"


The operator space of TECO was apparently sufficiently dense that hackers of yore could ask each other "what does your name/handle do as a TECO command?"


This cat only knew K, q is much more readable ;)


I thought AOC is the congresswoman and Q was either a queue or Qanon. None of it was correct.


I thought it is going to be Q#


I thought this was gonna be a political post about progressive politicians and far-right conspiracies


I had to click the link because I sadly thought the same thing as well.




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

Search: