Monday, August 9, 2010

Better than make?

As mentioned earlier, I have switched from bash to rc.  To avoid a problem with the Mac Ports version, I installed it from User Space, which also provides mk, a replacement for make.

There are many good reasons to prefer mk, but for me the strongest is to avoid vfork().  Here is the comment thread from reddit:
uriel says:

I suspect the 'rc' in MacPorts is an old re-implementation which has some serious flaws.
cdunn2001 says:
Can you be more specific? I got version 1.7.1. How can I know which implementation I got? The description says it's the Rakitzis re-implementation, but maybe it's been properly patched.
I will look into mk and Plan 9 from User Space. I am a fan of Go, though I ran into minor flaws in the installation process last time I installed it a few months ago (under RedHat Linux).
One problem I've had with traditional make is that it uses vfork() instead of fork() (for speed, I think) which breaks strace. This may be too technical a question for a reddit forum, but do you have any idea whether strace would work on mk?
I certainly will not switch to general scripting with rc. That seems like a giant step backward.
uriel says:

The flaws in Rakitzis's re-implementation are too fundamental to be fixed, some of the syntax is just incompatible with the real rc, and I don't think anyone is using it anymore (I certainly hope that nobody is using it, as it creates great confusion).
No idea why on earth any make or make-like program would use vfork(), mk certainly doesn't use it as there is no vfork in Plan 9. vfork as far as I can tell is just a hideous hack in systems where fork() is too badly broken and slow.
As for general scripting, rc is a huge step backwards perhaps compared to for example Perl, but it is a step backwards from a not very good direction and back to what made Unix awesome. The power of combining small specialized tools using pipes is amazing, specially when you have a shell that is simple enough not to get in the way while providing everything you need to glue things together.

No comments:

Post a Comment