zlacker

[parent] [thread] 1 comments
1. Smaug1+(OP)[view] [source] 2026-01-12 09:01:31
Is that statement about C based on anything in particular? C was 18th of all the languages in the article's chart (the worst!), which I'd guess was due to the absence of a standard library.
replies(1): >>johnis+57
2. johnis+57[view] [source] 2026-01-12 10:00:03
>>Smaug1+(OP)
Fair point. There is a distinction between syntactic efficiency (C is terse) and task-completion efficiency (what the benchmark likely measured). If the tasks involved string manipulation, hash maps, JSON, etc. then C pays a massive token tax because you are implementing what other languages provide in stdlib. Python has dict and json.loads(), C has malloc and strcmp.

So: C tokenizes efficiently for equivalent logic, but stdlib poverty makes it expensive for typical benchmark tasks. Same applies to Factor/Forth, arguably worse.

[go to top]