Hacker News new | ask | show | jobs
by torlok 749 days ago
It's just a way to keep the code size in check, make sure it can be read and understood relatively easily. Don't overthink it. I doubt much, if any, research went into picking the limit. The line width is over 120 in many places, and the code inevitably ends up looking like

  cache_key = (device, st, dtype, op, arg, tuple(ref(x) for x in srcs)) if base is None else (st, ref(base))
2 comments

Seems the code sample contradicts your first statement
I think this might be an example of https://en.m.wikipedia.org/wiki/Goodhart's_law

The line count probably does still act as a limit on complexity overall but perhaps less than hoped for.

Indeed, I was making a point.
This is truly depressing because the aspirations of tinygrad are so appealing in terms of being concise, effective and maintainable. Then, instead, they throw comprehensibility entirely out of the window.