remix logo

Hacker Remix

Show HN: Werk, a simple build tool and command runner

93 points by simonask 6 days ago | 17 comments

I made this for my personal workflow, but I'd love to get feedback from the community.

snowe2010 4 days ago

We've been using Taskfile, which is fantastic and super understandable, but it's only a task-runner and as such wouldn't meet OP's needs. I hated `just` and did not find it at all intuitive.

Only problem I have with the article is saying that Ruby doesn't work on Windows is just categorically false. It's one of the easiest languages to install and use on Windows, even easier than C# and Java, and I'm a Java/Kotlin dev, so that's saying something. It's literally just a single exe/msi installer.

But you wouldn't want to be using Rake anyway, it's not really that good, and is only useful if you're working in an environment where you don't want to install anything and you hate Make. Then Ruby is very often installed by default with Rake and so you get a 'free' build tool. Rake was good 10 years ago, but not so much anymore.

Anyway, if you needed a specific kind of tool and built it then all the power to you. Can't blame you for not wanting to use the other options!

neonsunset 4 days ago

> It's literally just a single exe/msi installer.

And so is .NET. Just install SDK from a single exe (or, on macOS, do 'brew install dotnet'), open VSCode, maybe get the C# extension. That's it. dotnet run, dotnet build, etc.

For scripting, there is 'dotnet fsi' for F# interactive. And you can also compile F# scripts directly into native executables with community tooling if you wish to make them full standalone programs.

anbotero 4 days ago

What in particular tips the balance to Taskfile compared to just(file)? With one of my clients I’ve been using just for months, so I’m curious. Thanks!

TheTaytay 4 days ago

I wish you success with this! I really was surprised to see that there isn’t a modern make replacement that actually does what make does, and does it well: build /compile things with a notion of inputs and outputs and out-of-date checks. Most appear to be “just” command runners. That’s a very useful thing to have, but it’s not really a make replacement. Then again, many “build tools” do get very large and unwieldy eventually, so maybe it’s more a case of the good make replacements simply getting too much traction…

jdxcode 4 days ago

what about meson?

braggerxyz 4 days ago

OP wanted speed. You don't get that with Meson.

jdxcode 4 days ago

that's not how meson describes itself:

> Meson is an open source build system meant to be both extremely fast, and, even more importantly, as user friendly as possible.

now I've never used it, so I can't directly defend that claim. I have heard good things about meson though and it would seem strange to me such a headline would make sense on a project that I also hear good things about.

mdaniel 5 days ago

> Why a new language?

In my opinion, Starlark (in rust, Apache 2: <https://github.com/facebook/starlark-rust/blob/v0.13.0/LICEN...>) is the way since it is designed for sandboxed environments and also (AIUI) was initially designed to support Bazel, a build tool

Now, I'm totally on board that people can hate on whitespace sensitive languages, but if my choice was "make my own language that no one has ever heard of" or "delete the Python hater's emails" ...

It also would mean that you could tag your Werkfile in .gitattributes with linguist annotations[1] and they'd syntax highlight, which isn't the case with your own language https://github.com/simonask/werk/blob/5990c8a9536a1a76c3da59...

1: https://github.com/github-linguist/linguist/blob/v9.0.0/docs...

mplanchard 5 days ago

This seems pretty much in line with my ideals for a make replacement, which is a project I have been thinking about starting for ages. The only major use-cases I have that don't seem to be covered are "tasks" in werk parlance that only run given changes in some "from" files, and just-once tasks. For both of these in Make I use empty files as targets, e.g. `make/foo`, which I `touch` at the end of the recipes.

An example of a just-once task might be running some setup script on dev machines when setting up a work environment. An example of a task with prereqs might be running a nix command to source things into the local environment whenever a `shell.nix` or other file changes.

I also wasn't able to immediately find documentation on what the available config options are (referenced in the language documentation). Is it possible to set a shell to use for run statements?