HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
darius
cant
Tree-sitter Query2022–2024
darius / cant

cant

A programming argot

2Distinct people
6Mentions
0Explicit recommenders
57GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A programming argot

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:03:16 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by month6 dated mentions

Observed mentions: 2022-05-09 03:47:09 UTC to 2024-10-16 23:21:24 UTC.

012022-05-01 00:00:00 UTC to 2022-06-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsMay 20222022-06-01 00:00:00 UTC to 2022-07-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-07-01 00:00:00 UTC to 2022-08-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-08-01 00:00:00 UTC to 2022-09-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-09-01 00:00:00 UTC to 2022-10-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-10-01 00:00:00 UTC to 2022-11-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2022-11-01 00:00:00 UTC to 2022-12-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-12-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2023-01-01 00:00:00 UTC to 2023-02-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-02-01 00:00:00 UTC to 2023-03-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2023-03-01 00:00:00 UTC to 2023-04-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-04-01 00:00:00 UTC to 2023-05-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-05-01 00:00:00 UTC to 2023-06-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-06-01 00:00:00 UTC to 2023-07-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-07-01 00:00:00 UTC to 2023-08-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsJul 20232023-08-01 00:00:00 UTC to 2023-09-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-09-01 00:00:00 UTC to 2023-10-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2023-10-01 00:00:00 UTC to 2023-11-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-11-01 00:00:00 UTC to 2023-12-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-12-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-01-01 00:00:00 UTC to 2024-02-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-02-01 00:00:00 UTC to 2024-03-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-03-01 00:00:00 UTC to 2024-04-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-04-01 00:00:00 UTC to 2024-05-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-05-01 00:00:00 UTC to 2024-06-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-06-01 00:00:00 UTC to 2024-07-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-07-01 00:00:00 UTC to 2024-08-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-08-01 00:00:00 UTC to 2024-09-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-09-01 00:00:00 UTC to 2024-10-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-10-01 00:00:00 UTC to 2024-11-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsOct 2024

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
May 20222022-05-01 00:00:00 UTC2022-06-01 00:00:00 UTC101
Jun 20222022-06-01 00:00:00 UTC2022-07-01 00:00:00 UTC000
Jul 20222022-07-01 00:00:00 UTC2022-08-01 00:00:00 UTC000
Aug 20222022-08-01 00:00:00 UTC2022-09-01 00:00:00 UTC000
Sep 20222022-09-01 00:00:00 UTC2022-10-01 00:00:00 UTC000
Oct 20222022-10-01 00:00:00 UTC2022-11-01 00:00:00 UTC101
Nov 20222022-11-01 00:00:00 UTC2022-12-01 00:00:00 UTC000
Dec 20222022-12-01 00:00:00 UTC2023-01-01 00:00:00 UTC101
Jan 20232023-01-01 00:00:00 UTC2023-02-01 00:00:00 UTC000
Feb 20232023-02-01 00:00:00 UTC2023-03-01 00:00:00 UTC101
Mar 20232023-03-01 00:00:00 UTC2023-04-01 00:00:00 UTC000
Apr 20232023-04-01 00:00:00 UTC2023-05-01 00:00:00 UTC000
May 20232023-05-01 00:00:00 UTC2023-06-01 00:00:00 UTC000
Jun 20232023-06-01 00:00:00 UTC2023-07-01 00:00:00 UTC000
Jul 20232023-07-01 00:00:00 UTC2023-08-01 00:00:00 UTC000
Aug 20232023-08-01 00:00:00 UTC2023-09-01 00:00:00 UTC000
Sep 20232023-09-01 00:00:00 UTC2023-10-01 00:00:00 UTC101
Oct 20232023-10-01 00:00:00 UTC2023-11-01 00:00:00 UTC000
Nov 20232023-11-01 00:00:00 UTC2023-12-01 00:00:00 UTC000
Dec 20232023-12-01 00:00:00 UTC2024-01-01 00:00:00 UTC000
Jan 20242024-01-01 00:00:00 UTC2024-02-01 00:00:00 UTC000
Feb 20242024-02-01 00:00:00 UTC2024-03-01 00:00:00 UTC000
Mar 20242024-03-01 00:00:00 UTC2024-04-01 00:00:00 UTC000
Apr 20242024-04-01 00:00:00 UTC2024-05-01 00:00:00 UTC000
May 20242024-05-01 00:00:00 UTC2024-06-01 00:00:00 UTC000
Jun 20242024-06-01 00:00:00 UTC2024-07-01 00:00:00 UTC000
Jul 20242024-07-01 00:00:00 UTC2024-08-01 00:00:00 UTC000
Aug 20242024-08-01 00:00:00 UTC2024-09-01 00:00:00 UTC000
Sep 20242024-09-01 00:00:00 UTC2024-10-01 00:00:00 UTC000
Oct 20242024-10-01 00:00:00 UTC2024-11-01 00:00:00 UTC101

What Hacker News says

6 sources
> figure out a way to do upward movement that doesn’t require annoying special casing. If you figure it out, don’t tell me since it means I’ll have to make more levels. Don't read this, then (from a 2048 game instead of Sokoban, but same principle): https://github.com/darius/cant/blob/master/examples/games/20... As long as I'm commenting, here are some links to other Sokobans I thought were fun (listed in the source code to mine). The sed one is nuts -- I had no idea it could do that: https://github.com/darius/cant/blob/master/examples/games/so...
In Squeezing a Sokoban game into 10 lines of Haskell
I've done AoC using my own language before. As a task it's at a sweet spot for finding weaknesses in the language/library/implementation: real and varied enough to exercise your system, small chunks of work, lots of code to compare yours to, with fun and competitive juices. The first time I did it it forced me to fix some major problems. My language would still be a handicap for me now, albeit a comfy one. fwiw: https://github.com/darius/cant/tree/master/examples/advent-o... (haven't done this year's so far)
In Noulith: A new programming language by the current Advent of Code leader
I've been thinking about how to do an efficient Sieve of Eratosthenes for a while. One approach that had occurred to me was to sieve one block at a time (say, 16 KiB) and "park" one "rider" for each prime in a priority queue, maybe a binary heap, ordered by the next composite they were going to eliminate. Also you can special-case even numbers, so 16 KiB is 262'144 numbers using bit-size bools. So, after going through the first block, your rider for 3 is parked in the heap at 262'149, your rider for 5 is parked at 262'145, your rider for 7 is parked at 262'157 (because 262'150 is even and thus not considered), your rider for 11 is parked at 262'163, your rider for 13 is also parked at 262'145, and so on. So you start by picking 5 off the heap, marking off all the multiples of 5 in the block (262'145, 262'155, etc.) and when it runs off
Read the rest
the end of the block you park it at 524'295, at which point it tumbles to near the bottom of the heap. Then you pick 13 off the heap, mark off all the multiples of 13, etc. Once you're done striking off all the composites in the block, you iterate over its primes, inserting a rider for each of them into the heap (at their square, so for example the rider for 262'147 starts running at 68'721'049'609), maybe outputting them to a file, and then you can discard the block. That means you only need to keep the heap of known primes in RAM, not the bitmap of all the numbers you contemplate testing for primality. This not only allows you to change your mind about how many you want, it reduces your space by a factor of the natural logarithm. But this doesn't beat the constant factor for a long time; https://en.wikipedia.org/wiki/Prime-counting_function says π(10¹¹) = 4'118'054'813, so 64 GiB of RAM should be enough to calculate all the primes up to 10¹¹ if each heap element is two 64-bit integers; while, without a heap of riders, with one bit each, you would only need 12 GiB. Well, 6 GiB skipping the evens. If, instead of discarding the already finished blocks, you lazily add riders for their primes when you reach those primes' squares, you can do a lot better up to a much higher sieve size: at 10¹¹ you've just passed 316'271², so your heap only needs to contain the 27'296 primes p such that 2 < p ≤ 316'271, thus occupying only 436'736 bytes. Moreover, if you do know ahead of time where you're going to stop, you can still discard the finished blocks whose primes will never spawn riders in the heap. This approach should allow you to sieve out the 201'467'286'689'315'906'290 prime numbers up to 10²² in those same 64 GiB of RAM, but an earlier obstacle is that striking off 10²² composites at one per nanosecond would take you several hundred millennia. You don't want to use a standard bin-heap at gigabyte sizes on a cached machine because you'll have one cache miss per access once you get outside the top few levels of the heap. Instead, you probably want to block it into a heap of heaps, staggered so their roots aren't a large power of 2 apart. Or possibly use a Fibonacci heap, if you can understand it. It might make sense to bundle the first few primes into a "wheel", with, say, period 15'015 (3 · 5 · 7 · 11 · 13 · 17), where you just OR an appropriately shifted bitmap into the block to strike off all their multiples at once (9255 out of every 15'015 numbers in this case), instead of striking off their multiples one by one with the rider mechanism. Better still would be if you can work out an efficient addressing scheme which doesn't even assign a bit index to numbers that are divisible by one of these small primes, a generalization of the just-skip-the-evens trick. These are just some things that have occurred to me (though I'm pretty sure I read about the wheel trick somewhere), so probably there are already more efficient implementations known of the Sieve of Eratosthenes, and I just haven't heard of them. Edit: Darius Bacon wrote a version of this approach in https://github.com/darius/cant/blob/master/library/factoring... where the "frontier" of active riders is stored in a hash table rather than a bin heap, which is almost certainly a more efficient approach. But he's not doing the bitmaps, and the overhead of Cant makes it hard to measure the absolute efficiency of the approach.
In UnixBench is the original BYTE Unix benchmark suite
Thank you! I dislike style nazis too, e.g. carping when Peter Norvig's code won't pass PEP 8. I'm just leery of the expected cost in this kind of case. It can go on working for years until some new complication or some change in the ecosystem makes it suddenly create a really weird problem. Or when you want to try moving to a fancy new Python implementation, you find you have this friction. Matter of judgement where some chance of such messes is paid for by what it can do for you. (Of course when it's less "load bearing" the balance shifts.) With https://coverage.readthedocs.io/en/stable/ for example, it used bytecode hacks to do something you couldn't do otherwise, and that's unlikely to mess you up. I have had old C programs go crazy years later in a really hard to debug way because newer compilers may interpret your code like your ex-w
Read the rest
ife's divorce lawyer (as Kragen put it). Back in the day a lot of us thought we had a different kind of relationship with C compilers, and it'd be fine to code to that informal social contract. (Just a loose analogy.) I'm piddling away at https://github.com/darius/cant these days. (Some of the motivation was feeling too confined by Python, actually.) No Wasm, but I'm happy it exists! I tried to make a system like it 20 years ago (Idel) and gave up too soon.
In Multiple assignment and tuple unpacking improve Python code readability (2018)

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.