Skip to content

Comment on Taking PHP Seriouslyparent

Comments

The internal source code of PHP was often a mess of macros everywhere

My understanding, from people here that seemed to know what they are talking about, is that generally macros are how these languages are implemented when done in C, for various reasons. So much so in fact, that you are really writing a DSL layered over C. I doubt Python, Ruby or Perl are any different (actually I know Perl relies heavily on macros in the source for its interpreter).

Edit: s/Rudy/Ruby/. duh.

Lua is proper C code, and readable too. Macros are not necessary.

Lua has a much smaller codebase and is simpler than PHP, so I'm not sure the comparison is apt.

The Ruby source code is also a DSL build on top of a bunch of macros.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.