logoalt Hacker News

shoo • today at 12:57 AM • 1 reply • view on HN

another approach could be to support strings, of length exactly 1. would 256 unique strings be enough to name all the variables (& functions?) in an interesting program?


Replies

epestr • today at 1:28 AM

Yup.

> rg var ray.dsl | wc -l

142

> rg func ray.dsl | wc -l

6

+28 for opcodes, bringing it to 176. So it works for this interesting program, the raytracer, but the compiler likely requires way more. Maybe not the 4 cells I've been using, but 2^16 = 65k would be enough buckets but unique names.