What does HackerNews think of just?

🤖 Just a command runner

Language: Rust

Reminds me of `just`. I love `just`. (Although I've never used make...)

https://github.com/casey/just

I saw this further down in the thread: https://github.com/casey/just

Looks like a version of make optimized for running commands instead of builds.

My number one reason to use make is to have a single centralized location for project commands. If I see a Makefile at the root, I can quickly scan it and have an overview of what high level actions I might execute.

Note that I have recently switched to Just (https://github.com/casey/just). While not technically the exact feature set as make, it covers all of the ground for what I typically do. It gets the benefit of history and discards a lot of make cruft to make a more predictable experience.

Just is already 'taken' in the Rust community as it is a command runner utility like make: https://github.com/casey/just
An alternative I quite like is “just”.

https://github.com/casey/just

How does this compare with `just`[0]? I've never written a Makefile but I'm a big fan of `just`.

[0] https://github.com/casey/just

Most (all?) of your Makefile targets don't represent actual files to 'make'.

You're using make to run a bunch of tasks, including where tasks may depend on other tasks having been run before.

A task-runner tool like `just` is better suited to this task. https://github.com/casey/just

`just` has some nice UX improvements over `make`. (e.g. doesn't require soft tabs, can list recipes out of the box, recipes can take command line arguments, supports .env files, can be run from any subdirectory).

I end up using Makefiles for many projects that have even trivial stages in their execution (e.g. manual/one-off ETL pipelines). I do feel like I bastardize it sometimes as a convenient command runner or brain augmentation: sure makes it easy to remember how to run something if you can just type "make" or look at the top of the file, a cool intersection between "can get it working in 5 minutes" and "will be readable in 5 months".

The Just command runner [1] is good, but is not as ubiquitous.

[1]: https://github.com/casey/just

Using `make` with `.PHONY` targets is what I'd call a "task runner". -- In NodeJS, a package.json's "scripts" serve a similar task.

I think the main/only reason to go out of your way to use `make` as a task runner is its ubiquity.

However, if you're already using nix, it's probably not much of an issue to use a better task runner.

I'd recommend 'just' instead https://github.com/casey/just -- It has a nicer UX, with a few significant quality-of-life improvements out-of-the-box compared to `make`. e.g.

- you can get a list of tasks, and select one using `fzf` with `just --choose`.

- can inline use of bash, or python, etc.

- `just` automatically searches up a directory tree for a `justfile`.

Man I love Make. But recently started a new job and we decided to use Just* and it's been fantastic. I doubt I would use Make again unless I was planning to use it as a real build system (which has been the minority use case of my use cases in the last 5 or so years).

* https://github.com/casey/just

I've seen a few, but the only one I can remember off the top of my head is just[0].

[0]: https://github.com/casey/just

Everything I can. Building docs, checking health of prod, deploying to dev/prod (which has real+phony dependencies), starting the development web server with watchexec, running lint, tests, etc. Some of these might have real artifacts, but I typically have more phony than not.

Make has quite a few flaws, but it is near universal and a good location to centralize all required project work. Even if the entire task is defined in a shell script elsewhere. That being said, I have being looking longingly at just[0] which is not just concerned with compiling C, but has task automation builtin from the beginning.

[0] https://github.com/casey/just

After using https://github.com/casey/just in a medium sized project, I wholly recommend anyone even slightly frustrated with Makefiles to switch to this.

C++ : C :: Just : Make

More sensible defaults, fewer footguns, just as expressive (pardon the pun), but still nearly the same syntax and paradigms so you don't have to learn a completely new scripting language.

The biggest downside, however, is that it's not installed by default on many systems and it's not in the official repos of some major distros. If that's a dealbreaker, stick with Make.

    PHONY: comment
    comment:
      TEXT=“yes, I also wonder why people don’t use simple makefiles” $(MAKE) publish
    publish:
      echo “$(TEXT)”
Some “simple” things like passing arguments to a task become incredibly complex.

I’ve been playing around with https://github.com/casey/just and so far it’s been very pleasant.

Gonna plug our setup which is Justfiles[1] and turborepo.

Just is a task runner (with full shell integration) that calls our turborepo tasks.

We define all of our tasks in one justfile (things like repo setup, syncing env vars, and compiling dependencies) and then link them to turbo processes which cache the result.

Massively reduced our cognitive load working with our monorepo, and is lightning fast.

If we ever want to change it will be simple to remove both, so we're not tied to the ecosystem.

[1]https://github.com/casey/just

The [Just] task runner can be what you want: it's simpler than Make, with less magic, but it allows to declare task dependencies.

[Just]: https://github.com/casey/just

I believe this is just due to how they're parsing the README.md on https://github.com/casey/just. (Though this should probably still be updated)

The installation section has no direct body, but there are subheaders with the actual instructions.

Ex. https://just.systems/man/en/chapter_3.html

For simple command-based automations, I've found just [0] to be a good replacement for makefiles with .PHONY targets. It has a cleaner syntax and fewer pitfalls compared to makefiles.

[0] https://github.com/casey/just

I've found the script runner "just" to be worth using. https://github.com/casey/just

just (at a glance) is like a Makefile, but with some nice UX improvements that make it worth using. e.g. with `just --choose`, it runs fzf against the targets.

Throwing my hat in the ring for Justfile. It's basically a streamlined make.

https://github.com/casey/just

Where it really shines are in places like monorepos where you may have many inter-related setup scripts, build commands or helper utilities.

You define all of your commands in one file (or multiple if you want a hierarchy) and can run commands from any subdirectory.

eg. You have a monorepo with a web server, and also a react-native app in separate directories, you can call `just build-app` in the web directory, or call just `start-server` when your terminal's current directory is 7 diretories deep in the mobile directory.

The amount of time I have saved cd'ing around has honestly been amazing. It's worth it's weight in gold, especially on large projects.

Aaarg, I hate to always be the person that points out "naming issues", but there is already a pretty popular command runner with the name just: https://github.com/casey/just
+1 for Justfiles[1]! They're a much saner alternative to makefiles with great shell support

[1] https://github.com/casey/just

Hey HN,

I built randomneo.city since people didn't like my comment on the randomgeo.city post[0]. Clearly I don't take downvotes well.

That said, the code is powered by SvelteKit, SQLite and open source:

https://gitlab.com/mrman/randomneocity

I have to say, I'm really starting to like building everything with SvelteKit -- I'm a huge 3-tier architecture fan, and it just doesn't make sense these days to add an API repo for most small projects now. Node + TS + SvelteKit does most (to be fair, so would Nuxt or Next). It's been a fantastically productive stack for me.

Things I still need to do:

- Add automatic scraping of neocities' sites so the site can stay up to date

- Filter out sites which aren't done (they all have the same text)

- Add chat/social features (???)

This was also a great chance to try out Just[1] which strives to replace make[2] -- it's been nice!

In classic distracted style I use just[3], make with good defaults[4][5] and my usual flavor of makefile[6][7] in the repo.

[0]: https://news.ycombinator.com/item?id=32305300

[1]: https://github.com/casey/just

[2]: https://www.gnu.org/software/make/

[3]: https://gitlab.com/mrman/randomneocity/-/blob/main/Justfile

[4]: https://tech.davis-hansson.com/p/make/

[5]: https://gitlab.com/mrman/randomneocity/-/blob/main/infra/Mak...

[6]: https://vadosware.io/post/setting-up-mailtrain-on-k8s/#step-...

[7]: https://gitlab.com/mrman/randomneocity/-/blob/main/infra/kub...

I think the `.RECIPEPREFIX = >` bit triggered a lot of people here in the comments, and I agree. That would make drafting newlines a huge pain in any editor. Just enable "Show Whitespace" in your editor if you want this.

That said, I'm more concerned about the guidance to not use .PHONY and instead do this:

    # Tests - re-ran if any file under src has been changed since tmp/.tests-passed.sentinel was last touched
    tmp/.tests-passed.sentinel: $(shell find src -type f)
    > mkdir -p $(@D)
    > node run test
    > touch $@ 
The author is right, that does use make in a more more idiomatic way by relying on a real file, but I see 2 major problems:

* That's a lot of logic for something that should just be super simple.

* When I say `make test` I want it to run the tests. I don't care if they've passed before and the files haven't changed.

Really though, make just isn't a great tool for build scripts. The syntax is horrific and it's hard to scale it into something readable.

If I started a new project I'd probably consider Just: https://github.com/casey/just (though I haven't had a chance to use it myself yet).

True, that's where Make shines. Though given the popularity of so many Make alternatives (the strictly subset of command runner variety, like just[1]) who keep its syntax but not this mechanism, I wonder if for command runner unnecessarily re-running dependencies is really a big deal. Because quite often the tasks are simple and idempotent anyway, and then it's a bit of a hassle to artificially back the target by a dummy file in Make (which your example doesn't do here e.g.).

[1] https://github.com/casey/just