Hacker News new | ask | show | jobs
by TrayKnots 443 days ago
Well, I have in essence nothing against this post. I agree with the notion that too many dependencies are not necessary. That we can keep lots of things simpler.

I have nothing against directly implementing this in C or just writing markdown files and have the auto-translated into HTML.

I just don't like his arguments about it must be fast to recompile everything. I am writing this comment, and this is going to take me a few minutes. After all, I am thinking about what I am writing, typing it out, thinking some more. And then, the deploy is the thing that go the author? Really? Time to server is an important metric?

Let's be real, nothing would be lost if it took 5 minutes. He would send it off and 5 minutes later, his phone buzzes, notifying him that it is done.

Alright, he found a way to do it in under 10 seconds. Cool. Good for him. Now that it is built, there is nothing bad about it. I just don't see how this was ever an important KPI.

3 comments

Yeah I use Pandoc markdown to HTML for my site and it's easily fast enough. Especially if you use a Makefile.

I think this was just a fun challenge rather than to get any kind of useful advantage.

Having the MD file and the website open side by side and being able to see immediate updates as you write is valuable.
You don't need to actually generate HTML for that though. VSCode will show a markdown preview, and there are tons of other markdown editors that can do that too.
> I just don't like his arguments about it must be fast to recompile everything.

C isn't necessarily fast to recompile everything. Too much preprocessor magic and the compilation can slow down a lot.

And a lot of the reason for that, is that C's preprocessor is inherently weak – e.g. it doesn't explicitly have support for basic stuff like conditionals inside macros – but you can emulate it with deeply nested recursion – which blows up compilation times enormously. If C's preprocessor was a bit stronger and natively had support for conditionals/etc, one wouldn't need these expensive hacks and it would be a lot faster.

Example of real world project where C preprocessor slowed things down a lot is the Linux kernel: https://lwn.net/Articles/983965/

I think the part you quoted is about it needing to be fast to compile from markdown to html, not compiling the C program.
yep