Live data from Hacker News

Show HN: Minimal build system using just /bin/sh

notabug.org

11–20 of 65 posts

Re: Show HN: Minimal build system using just /bin/sh

#11
I applaud the effort, but is "pure /bin/sh" really a good feature in today's systems?

To my knowledge, today every Unix system has Python, usually at least 2.7, if not Python 3. Some even replaced most of their system shell scripts with Python scripts. (Formerly, Perl had this status, but never really caught on in that area.)

Python is a much cleaner language than any shell language, especially with regard to error handling. (yes, I'm aware of "set -eu") Also, if you occationally need some more elaborated data structures or algorithms, you can express these in a straight forward way, rather than a series of complicated (and usually very fragile) text processing steps.

Re: Show HN: Minimal build system using just /bin/sh

#12
post #11

I applaud the effort, but is "pure /bin/sh" really a good feature in today's systems? To my knowledge, today every Unix system has Python, usually at least 2.7, if not Python 3. Some even replaced most of their system shell scripts with Python scripts. (Formerly, Perl had this status, but never really caught on in that area.) Python is a much cleaner language than any shell language, especially with regard to error h…

Totally agreed; I'd use a different language if I needed even an array.

Re: Show HN: Minimal build system using just /bin/sh

#13
post #11

I applaud the effort, but is "pure /bin/sh" really a good feature in today's systems? To my knowledge, today every Unix system has Python, usually at least 2.7, if not Python 3. Some even replaced most of their system shell scripts with Python scripts. (Formerly, Perl had this status, but never really caught on in that area.) Python is a much cleaner language than any shell language, especially with regard to error h…

I'm having a hard time thinking of a use case for complex data structures in a build script. Can you give a real world example?

Array is the only one that I have found lacking, in my experience.

Re: Show HN: Minimal build system using just /bin/sh

#14
post #13
post #11

I applaud the effort, but is "pure /bin/sh" really a good feature in today's systems? To my knowledge, today every Unix system has Python, usually at least 2.7, if not Python 3. Some even replaced most of their system shell scripts with Python scripts. (Formerly, Perl had this status, but never really caught on in that area.) Python is a much cleaner language than any shell language, especially with regard to error h…

I'm having a hard time thinking of a use case for complex data structures in a build script. Can you give a real world example? Array is the only one that I have found lacking, in my experience.

If you aim for slightly larger projects and efficiency, you'd need at least a DAG (because that's the fundamental nature of a dependency graph).

You can find a nice explanation in the "tup" build tool, although there are of course many others: http://gittup.org/tup/

And yes, you can express DAGs with text and/or filesystem operations (plus symlinks), but not efficiently and writing code that operates on that level is cumbersome.

Re: Show HN: Minimal build system using just /bin/sh

#15
post #13
post #11

I applaud the effort, but is "pure /bin/sh" really a good feature in today's systems? To my knowledge, today every Unix system has Python, usually at least 2.7, if not Python 3. Some even replaced most of their system shell scripts with Python scripts. (Formerly, Perl had this status, but never really caught on in that area.) Python is a much cleaner language than any shell language, especially with regard to error h…

I'm having a hard time thinking of a use case for complex data structures in a build script. Can you give a real world example? Array is the only one that I have found lacking, in my experience.

I've used a project in the past that was a number of shell scripts that were written to handle cross-platform and (at least on Linux) various shells (bash, zsh, etc.). It can be done, but it becomes a complete kludge very quickly.

Re: Show HN: Minimal build system using just /bin/sh

#16
post #13
post #11

I applaud the effort, but is "pure /bin/sh" really a good feature in today's systems? To my knowledge, today every Unix system has Python, usually at least 2.7, if not Python 3. Some even replaced most of their system shell scripts with Python scripts. (Formerly, Perl had this status, but never really caught on in that area.) Python is a much cleaner language than any shell language, especially with regard to error h…

I'm having a hard time thinking of a use case for complex data structures in a build script. Can you give a real world example? Array is the only one that I have found lacking, in my experience.

Any large project needs a build system with complex data structures to express all the dependencies just due to sheer amount of them. Add various types of source generation, tooling, non-trivial build steps and simple build systems quickly become infeasible.

Re: Show HN: Minimal build system using just /bin/sh

#17
post #14
post #13

Earlier quoted context omitted.

I'm having a hard time thinking of a use case for complex data structures in a build script. Can you give a real world example? Array is the only one that I have found lacking, in my experience.

If you aim for slightly larger projects and efficiency, you'd need at least a DAG (because that's the fundamental nature of a dependency graph). You can find a nice explanation in the "tup" build tool, although there are of course many others: http://gittup.org/tup/ And yes, you can express DAGs with text and/or filesystem operations (plus symlinks), but not efficiently and writing code that operates on that level is…

Ah, thanks for the pointer to `tup`! I'd spent a while looking for it a few months ago but couldn't remember the name.

Re: Show HN: Minimal build system using just /bin/sh

#19
> This repo illustrates a way to manage a project using just plain Bourne sh, available on all Unix systems since 1977.

No, this code uses functions, which didn't exist in the original Bourne shell. They were introduced only in 1984.

Source: https://www.in-ulm.de/~mascheck/bourne/#variants

Re: Show HN: Minimal build system using just /bin/sh

#20
post #19

> This repo illustrates a way to manage a project using just plain Bourne sh, available on all Unix systems since 1977. No, this code uses functions, which didn't exist in the original Bourne shell. They were introduced only in 1984. Source: https://www.in-ulm.de/~mascheck/bourne/#variants

Thanks for the correction!
Post reply on HN