HackerTrans
热门最新趋势评论往期问答秀出招聘

healeycodes

no profile record

提交

A Tiny Compiler for Data-Parallel Kernels

healeycodes.com
52 分·作者 healeycodes·19天前·5 评论

Building a Shell

healeycodes.com
13 分·作者 healeycodes·4个月前·1 评论

A Fair, Cancelable Semaphore in Go

healeycodes.com
2 分·作者 healeycodes·7个月前·0 评论

Solving NYT's Pips Puzzle

healeycodes.com
2 分·作者 healeycodes·9个月前·0 评论

Compiling a Forth

healeycodes.com
70 分·作者 healeycodes·9个月前·9 评论

Icepath: A 2D Programming Language

healeycodes.com
3 分·作者 healeycodes·11个月前·0 评论

Counting Words at SIMD Speed

healeycodes.com
58 分·作者 healeycodes·11个月前·15 评论

Optimizing My Disk Usage Program

healeycodes.com
19 分·作者 healeycodes·11个月前·0 评论

Maybe the Fastest Disk Usage Program on macOS

healeycodes.com
3 分·作者 healeycodes·12个月前·0 评论

Filesystem Backed by an LLM

healeycodes.com
6 分·作者 healeycodes·去年·0 评论

Solving Queuedle

healeycodes.com
3 分·作者 healeycodes·去年·0 评论

评论

healeycodes
·17天前·讨论
You're right that my post's algo does not handle this case (it's more of a toy to explain the basic cases).

> When I read Allan and Kennedy my impression was that vectorising arbitrary imperative code is a much harder problem than designing a language that only allows for vectorisable constructs to be expressed in the first place.

Yeah, I buy this.

> In my example that would produce different code, requiring a multiplication:

  lambda i: table[(phase0 + i*inc) % TABLE_LEN]
I think some compilers may lower this without the multiplication.. (e.g. turning it back into an induction variable) but with floats they may not be allowed to, since repeated addition and "phase0 + i*inc" are not strictly equal.
healeycodes
·4个月前·讨论
Editing the current line works because I brought in https://man7.org/linux/man-pages/man3/readline.3.html towards the end so I could support editing, tab completion, and history.

IIRC readline uses a `char *` internally since the length of a user-edited line is fairly bounded.
healeycodes
·4个月前·讨论
Author here, and yeah, I agree. I skipped writing a parser altogether and just split on whitespace and `|` so that I could get to the interesting bits.

For side-projects, I have to ask myself if I'm writing a parser, or if I'm building something else; e.g. for a toy programming language, it's way more fun to start with an AST and play around, and come back to the parser if you really fall in love with it.
healeycodes
·11个月前·讨论
Author here, one of the fastest improvements I've seen is @cloud11665's idea here: https://x.com/cloud11665/status/1955958965046595699