Hacker News new | past | comments | ask | show | jobs | submit login

Yeah, because using preprocessor macros would do the trick. /s



It actually would! There are a handful of base-10 arbitrary precision arithmetic implementations in the preprocessor[1], and modern continuation-passing style macro metaprogramming[2] makes it straightforward to write a function like factorial once you get the syntax and semantics down.

Libraries like Boost.Preprocessor can’t be taken as an example of “cutting edge” preprocessor metaprogramming. It set a very low bar, and IMO has stifled a lot of developer creativity.

[1] https://github.com/rofl0r/chaos-pp/tree/master/chaos/preproc... [2] https://github.com/rofl0r/order-pp/blob/master/example/fibon...


I Remember Chaos and Order (20 years ago... now I feel old).

The reason that they remained niche is that at the time MSVC had an extremely non confirming preprocessor and advanced PP libraries just weren't viable there.

Boos.PP was the most advanced you could get while staying portable.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: