Re:C Macro Magic
by AnaniasAnanas on Thursday February 28, 2019 @01:35AM
(#19269437)
C is far from simple, a simple language would be something like Scheme, Forth, or even SML. It so happens that the C standard (which is nearly 1k pages long nowadays) hides a lot of pitfalls, making the job of optimisers, implementators, and regular programmers miserable.
[ Parent
| on HN ]
Generating performant code from Scheme, Forth or SML is far more difficult compared to the C family of languages.
Re:C Macro Magic
by AnaniasAnanas on Thursday February 28, 2019 @03:09AM
(#19269822)
Are you sure about that? Forth is famous for being extremely fast. As for SML, assuming a variant with manual memory management (which I do not consider to add complexity in C), I can't think of any reason on why it would be more difficult to optimise.
> Forth is famous for being extremely fast.
Have you seen that claim backed up by any evidence produced within the last 25 years?
> I can't think of any reason on why it would be more difficult to optimise.
https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
The main reason a language like SML or Haskell is difficult to optimize is because it is incredibly difficult to canonicalize for the purpose of making peephole optimizations and abstract interpretation effective. https://sunfishcode.github.io/blog/2018/10/22/Canonicalizati...