HN user

co_dh

89 karma
Posts1
Comments90
View on HN

I used Claude that created a terminal based table viewer from rust first, to lean , and finally to Haskell. https://github.com/co-dh/tv-hask/tree/main

I give up rust because it’s not functional enough. There aren’t many things Claude can prove about a table viewer, and Haskell fits very well, and have enough libraries. Claude is pretty good at Haskell. I barely write Haskell before but I do know monad.

But why do you need serialization? Because the data structure on disk is not the same as in memory. Arthur Whitney's k/q/kdb+ solved this problem by making them the same. An array has the same format in memory and on disk, so there is no serialization, and even better, you can mmap files into memory, so you don't need cache!

He also removed the capability to define a structure, and force you to use dictionary(structure) of array, instead of array of structure.

916 Days of Emacs 3 years ago

A single threaded OS. I remember that sometimes I launched a slow process in emacs, and then can do nothing but wait.

Group is actually like inverse a mapping. Given an array A which map index to value, group A map value to index. A common idiom is: desc count each group A , which list most frequent element first

Human makes a lot of inconsistent thing: We usually think the 1st floor, and the basement as 1st underground floor ( -1), but the floor jumps from 1 to -1!

Also, the time jump from 11AM to 12PM to 1PM! So I think more human friendly sometimes means more confusing.

The unix command is a module system without import, and is very convenient.

It is only possible when 1) you have very simple data structure. line of text in this case. 2) each command has a lot of options, thus reduces the number of commands.

Assembly Nights 5 years ago

I think you might like Color Forth, which is another rabbit hole, but interesting.

Assembly Nights 5 years ago

github? I like the idea of using Nim to write a kernel, and is curious on what the code looks like. Especially, how do you avoid malloc?

In q/kdb, bracket for unary function application is optional, that is, f[x] is the same as f x. I found it very convenient after a while, and wish other language follows. It is very convenient to write f g h x, than f[g[h[x]]]