Live data from Hacker News

Taskfile: A Modern Alternative to Makefile

cloudnativeengineer.substack.com

91–100 of 223 posts

Re: Taskfile: A Modern Alternative to Makefile

#92
post #90

Earlier quoted context omitted.

Because Make is too stable and well documented, because it's just one tool and not 3, because it isn't written in Go and because you don't have to scratch you head at another YAML hell. Because 47 years of proven track record is nothing compared to "modern". Need I go on?

If you think there’s nothing to fix with make, you’re severely mistaken. The differences between GNU Make and BSD Make are for me a big reason to be extra careful when using it. Make also relies a lot on cleverness so it comes with lots of idiosyncrasies (like having to add .PHONY to all the targets not representing files, which in itself proves Make was not thought to be used like we use it). Some basic conventions…

What if you use `embed`? Why rebuild the binary if you've only touched test files? Make at least theoretically gives you tools to deal with these (but between Make and Go they're quite hard to use), but Task gives you no chance.

Re: Taskfile: A Modern Alternative to Makefile

#93
post #53

Earlier quoted context omitted.

No need to apologise, I don't like YAML, I like Python, and I agree: I'd rather have a domain specific library than a DSL anyday. The best of both worlds is a good programming language that allows expressing domain specific libraries almost as if they were domain specific languages, without going so declarative that people don't know how to script anything anymore. I don't know if Python/doit really achieved that, bu…

Yes. I said it in another comment as well, but I'm rooting for a solid non turing complete conf language like CUElang ( https://cuelang.org ) to become popular. For now we can already use it to check and generate regular JSON or YAML, which is a good compat story. But imagine having this in CI instead of YAML files.

I prefer Jsonnet for JSON and YAML

Re: Taskfile: A Modern Alternative to Makefile

#94
Make is ubiquitous, it’s simple. Everybody knows it. That’s the reason to use it.

Just add a makefile to your repo and anybody is able it get started. I would have no clue what todo with a project in the structure proposed.

Note: I just makefiles as an entry point to the underlying build tool such as gradle or npm or go build

Re: Taskfile: A Modern Alternative to Makefile

#95
post #89

I wanted to see what was wrong with Makefile and how Taskfile solved the issue, but the post doesn't explain; it's more a tutorial on how to use Taskfile. If the author reads this, I think we'd love to know what's wrong with make. Also, a lot of those look like artificial complexity over a shell script sourcing another one containing only variables export, and running the required scripts.

If you don't know what's wrong with make, just use make. But it probably means you probably don't USE make.

If your Makefiles look like this:

    build:
       go build -o dist/app
You might as well just use make, it's fine. It's less fine when you want to avoid rebuilding if sources didn't change, or if you want to use environment variables, maybe from a dotenv file, or if you want to do conditions (like adding a debug flag to a build command if a make variable is set), or if you need to use make incantations (hoping they'll work with both BSD Make and GNU Make), then a Taskfile might help solving some issues, including legibility.

Re: Taskfile: A Modern Alternative to Makefile

#96
post #4

Earlier quoted context omitted.

Taskfile looks heavily inspired by terraform and other "cloud native tooling (read: lots of yaml)

horrible

Because Makefiles are so clean and legible. Taskfiles have the benefit of being very explicit and easy to understand.

Re: Taskfile: A Modern Alternative to Makefile

#97
post #95
post #89

I wanted to see what was wrong with Makefile and how Taskfile solved the issue, but the post doesn't explain; it's more a tutorial on how to use Taskfile. If the author reads this, I think we'd love to know what's wrong with make. Also, a lot of those look like artificial complexity over a shell script sourcing another one containing only variables export, and running the required scripts.

If you don't know what's wrong with make, just use make. But it probably means you probably don't USE make. If your Makefiles look like this: build: go build -o dist/app You might as well just use make, it's fine. It's less fine when you want to avoid rebuilding if sources didn't change, or if you want to use environment variables, maybe from a dotenv file, or if you want to do conditions (like adding a debug flag to…

I don't use make, so I wanted to see what was wrong with it, and the author's argument is that it's old. Not very convincing.

Your description starts to be more interesting, and I feel like mk (the successor of make from the Plan 9 people: https://plan9.io/sys/doc/mk.html) might address those, but again, I don't have a need for it.

Re: Taskfile: A Modern Alternative to Makefile

#98

Earlier quoted context omitted.

Yes. I said it in another comment as well, but I'm rooting for a solid non turing complete conf language like CUElang ( https://cuelang.org ) to become popular. For now we can already use it to check and generate regular JSON or YAML, which is a good compat story. But imagine having this in CI instead of YAML files.

I prefer Jsonnet for JSON and YAML

There is also Dhall.

I've tried the 3 of them, eventually I found CUElang was the best balance between expressiveness, ability to enforce and check for constraints, and easy of use.

But I would welcome any of them replacing the YAML mess we currently have in sysadmin.

Re: Taskfile: A Modern Alternative to Makefile

#99
One day after writing a complex Makefile and getting frustrated because 1) it was hard to read and reason about because of make weird syntax, 2) it didn't run on CI because it uses GNU Make instead of BSD Make on my MacBook, I thought of writing a "modern" alternative:

I wanted it easy to read, write, parse and use, so I'd use YAML. You guys all shit on YAML because it's extremely badly used by, say, Helm charts, but it's a good markup language in itself. StrictYAML is anyway.

So I started writing a toy Makefile in YAML with these requirements: I need to run a command, with variables, it needs to depend on another command, and shouldn't run if the "output" file is already present and newer than the "source" files. So something like this:

    env:
        APPNAME: app
    clean:
        run: rm -rf ./dist

    build:
        depends:
            - clean
        input:
            - **/*.go
        run:
            - go build -o dist/$APPNAME
        output:
            - dist/$APPNAME
At this point I realized I had written exactly the same things proposed by Taskfile (which I heard of but thought "meh it sucks, Makefiles are great).

So yeah, Taskfiles are just Makefiles with a sane syntax and better tooling (JSON schema, auto generated doc, real default target...). I have no idea why the comments are so hostile towards it, because clearly Makefiles are not perfect (it's even a pretty bad format)

Re: Taskfile: A Modern Alternative to Makefile

#100
post #99

One day after writing a complex Makefile and getting frustrated because 1) it was hard to read and reason about because of make weird syntax, 2) it didn't run on CI because it uses GNU Make instead of BSD Make on my MacBook, I thought of writing a "modern" alternative: I wanted it easy to read, write, parse and use, so I'd use YAML. You guys all shit on YAML because it's extremely badly used by, say, Helm charts, but…

   it didn't run on CI because it uses GNU Make instead of BSD Make on my MacBook
What?

  $ /usr/bin/make --version
  GNU Make 3.81
  Copyright (C) 2006  Free Software Foundation, Inc.
  This is free software; see the source for copying conditions.
  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
  PARTICULAR PURPOSE.

  This program built for i386-apple-darwin11.3.0
Post reply on HN