Live data from Hacker News

Mk: A Successor to Make (1987) [pdf]

doc.cat-v.org

31–40 of 54 posts

Re: Mk: A Successor to Make (1987) [pdf]

#31
post #30

It seems to me that all build systems are just DAGs with syntactic sugar and functions. You could do away with build systems entirely if there were some Unix commands that manage an arbitrary DAG, where the state is kept out of band (in a file, in a database, etc) so you can operate on the DAG from any process. That way the shell (or any program, really) becomes your build system and you can compose any kind of logic…

Programs are just DAGS with syntactic sugar

Not sure I follow.

  0001 GOTO 0002
  0002 GOTO 0001
How would that be a DAG?

Re: Mk: A Successor to Make (1987) [pdf]

#32
post #30

Earlier quoted context omitted.

Programs are just DAGS with syntactic sugar

Not sure I follow. 0001 GOTO 0002 0002 GOTO 0001 How would that be a DAG?

I think they meant more the syntactic representation, rather than the control flow. If you rewrite the program using s-expressions, the DAG becomes a little more clear

    (begin
        (0001 GOTO 0002)
        (0002 GOTO 0001))
The DAG has two branches, each with three leaves. There are no cycles in the syntax, even if there is in the execution.

Re: Mk: A Successor to Make (1987) [pdf]

#33

It seems to me that all build systems are just DAGs with syntactic sugar and functions. You could do away with build systems entirely if there were some Unix commands that manage an arbitrary DAG, where the state is kept out of band (in a file, in a database, etc) so you can operate on the DAG from any process. That way the shell (or any program, really) becomes your build system and you can compose any kind of logic…

There are a few more components. In particular, how the build system decides what needs to be done, and how tasks are ordered, are significant.

For an excellent synthesis of what Makes a build system, I can't recommend the 2018 paper "Build Systems A La Carte" enough:

https://www.microsoft.com/en-us/research/uploads/prod/2018/0...

By Andrey Mokhov, Neil Mitchell (now working at Meta on the Buck2 build system) and Simon Peyton Jones (one of the founders of Haskell)

Re: Mk: A Successor to Make (1987) [pdf]

#34
post #3

Funny how building tools are reinvented again and again, with all the same culprits. I'm a programmer since the mid-90's, there are countless tools to do the job, and they are just as cumbersome and complicated the more they evolve. I'm personally sticking to the good old configure/make for my own C projects, but I understand that's a matter of taste and habits. I've written some CMakeLists.txt from time to time, any…

Plan 9’s mk isn’t really a radical departure from Make, it is more of an adaptation of it to the (decidedly non-POSIX) Plan 9 shell, rc, with modest extensions. One design mistake in make that mk fixes is variables in recipes: those are now passed as environment variables, with no prior substitution, so no more writing $$$$ to get the current PID in a recipe (and it’s written $pid in rc anyway). Unfortunately, mk inh…

> at which point Tcl starts to look like a Lisp-2 with a slight propensity for stringiness and a mildly unusual syntax.

I always saw Tcl as a bastard child of Lisp and sh. It's beautiful in its own quirky way.

Re: Mk: A Successor to Make (1987) [pdf]

#35
post #30

Earlier quoted context omitted.

Programs are just DAGS with syntactic sugar

Not sure I follow. 0001 GOTO 0002 0002 GOTO 0001 How would that be a DAG?

More of just a graph like:

V: (0001, 0002) E: ([0001, 0002], [0002, 0001])

But really I was just being sarcastic. Builds are "just" DAGs with syntactic sugar just like programs are "just" DAGs with syntactic sugar. That's one possible abstraction and one that is inherently lossy, because what "sugar" is available is the actual meat that makes one build system useful and another terrible. And one actually awful limitation is acylicity, since any build system will eventually deal with it (and outright forbidding of it makes your build system incapable of representing certain builds, just like acyclicity fundamentally limits a program's execution)

You can represent pretty much any data model as a graph, that doesn't really address the problem.

Re: Mk: A Successor to Make (1987) [pdf]

#36
post #24

Earlier quoted context omitted.

I agree with you about that statement, but why don’t you commit to an unstable branch? Why risk losing something or pass up having a better development history?

The way the warning is worded suggests that any invocation of tup has a risk of deleting your files, implying that to be entirely safe you should commit before every single build , which would be ludicrous.

git commit --amend, rebase with squash/fixup, etc. I easily make a dozen commits per hour, it's like undo on steroids and you can always clean it up later.

Re: Mk: A Successor to Make (1987) [pdf]

#37
post #3

Funny how building tools are reinvented again and again, with all the same culprits. I'm a programmer since the mid-90's, there are countless tools to do the job, and they are just as cumbersome and complicated the more they evolve. I'm personally sticking to the good old configure/make for my own C projects, but I understand that's a matter of taste and habits. I've written some CMakeLists.txt from time to time, any…

Plan 9’s mk isn’t really a radical departure from Make, it is more of an adaptation of it to the (decidedly non-POSIX) Plan 9 shell, rc, with modest extensions. One design mistake in make that mk fixes is variables in recipes: those are now passed as environment variables, with no prior substitution, so no more writing $$$$ to get the current PID in a recipe (and it’s written $pid in rc anyway). Unfortunately, mk inh…

Both Mk and Rc started out with Research Unix, some years before Plan 9.

Re: Mk: A Successor to Make (1987) [pdf]

#38
post #27

It seems to me that all build systems are just DAGs with syntactic sugar and functions. You could do away with build systems entirely if there were some Unix commands that manage an arbitrary DAG, where the state is kept out of band (in a file, in a database, etc) so you can operate on the DAG from any process. That way the shell (or any program, really) becomes your build system and you can compose any kind of logic…

> if there were some Unix commands that manage an arbitrary DAG There is: tsort. It's a POSIX utility, even, not just a GNU or BSD utility.

It's from Seventh Edition Unix, actually. So a decade before Mk, for example.

Re: Mk: A Successor to Make (1987) [pdf]

#39

I like the simplified syntax of this mk, anyone know why it didn't catch on?

Research Unix wasn't easily available, AFAIK Bell Labs were trying to sell it as a product, so it lost to more free alternatives. It only got open-sourced recently AFAIK, years after being abandoned.

Re: Mk: A Successor to Make (1987) [pdf]

#40
post #39

I like the simplified syntax of this mk, anyone know why it didn't catch on?

Research Unix wasn't easily available, AFAIK Bell Labs were trying to sell it as a product, so it lost to more free alternatives. It only got open-sourced recently AFAIK, years after being abandoned.

Also, and with no implied criticism, the people involved set the bar higher to capture their mindshare. I know, because I failed the bar (amicably I might add)

Which meant they cared less about "winning" in some non-valuable game of "whose code is winning" and had less irritating conversations, "no thats not how it works, no I don't have to explain this idea called the plumber to you, yes rc is very different to other shells no thats not how it works"... ad infinitum.

Post reply on HN