logoalt Hacker News

Insanityyesterday at 6:24 PM3 repliesview on HN

That's an interesting idea. But IMO the real 'token saver' isn't in the language keywords but it's in the naming of things like variables, classes, etc.

There are languages that are already pretty sparse with keywords. e.g in Go you can write 'func main() string', no need to define that it's public, or static etc. So combining a less verbose language with 'codegolfing' the variables might be enough.


Replies

danielvaughnyesterday at 7:59 PM

I'm not an expert in LLMs, but I don't think character length matters. Text is deterministically tokenized into byte sequences before being fed as context to the LLM, so in theory `mySuperLongVariableName` uses the same number of tokens as `a`. Happy to be corrected here.

coderenegadeyesterday at 11:17 PM

You're more likely to save tokens in the architecture than the language. A clean, extensible architecture will communicate intent more clearly, require fewer searches through the codebase, and take up less of the context window.

gf000yesterday at 7:06 PM

Go is one of the most verbose mainstream programming languages, so that's a pretty terrible example.

show 3 replies