Live data from Hacker News

Create an internal CLI using Just

blog.chay.dev

1–10 of 20 posts

Re: Create an internal CLI using Just

#3

What is the benefit of using shiny new `just` instead of an industry-standard `make`?

‘just’ is command-oriented, not target-oriented; this allows you to have:

- two ways of producing the same file

- a command with no side effects

- not having to draw up a state machine

just can enumerate its own commands, which is minor but helpful

just can execute in multiple directories, and can descend directories

just treats spaces and tabs identically for indention, rather than space-indented for shell scripts and tab-indented for make commands

Re: Create an internal CLI using Just

#4

What is the benefit of using shiny new `just` instead of an industry-standard `make`?

‘just’ is command-oriented, not target-oriented; this allows you to have: - two ways of producing the same file - a command with no side effects - not having to draw up a state machine just can enumerate its own commands, which is minor but helpful just can execute in multiple directories, and can descend directories just treats spaces and tabs identically for indention, rather than space-indented for shell scripts a…

Make can do all of those, easily, even eliminating TABs if you really care that much (I don't, my IDE handles them and it's really not a big deal). Have you ever taken the time to learn how to use it?

Make targets can be whatever you want, and don't have to produce files.

Make -n TARGET will list everything that Make thinks it needs to do to achieve TARGET, including anything that has to happen for any expressed dependencies (which can be tasks, and don't have to produce files).

Make recipes are arbitrary shell scripts that can do whatever you want, including changing directory. Make can also include other Makefiles, or call other Makefiles.

At its core, Make is a way to express "snippets of shell scripts, with a dependency graph between them". It can track files as dependency input and output -if you want-, but Make does not care if you don't. Call your targets whatever, and don't have them produce files. Boom, command runner. Make also has a powerful design, with a lot that you can do at parse-time.

And as it turns out, most tasks -do- have some amount of file dependencies. Maybe they need to consume a key file. Maybe they download a tarball. Maybe they produce a logfile that another task uploads. Being able to express as much (or as little) of that dependency graph as I want is a feature, not a bug.

Re: Create an internal CLI using Just

#6
post #4

Earlier quoted context omitted.

‘just’ is command-oriented, not target-oriented; this allows you to have: - two ways of producing the same file - a command with no side effects - not having to draw up a state machine just can enumerate its own commands, which is minor but helpful just can execute in multiple directories, and can descend directories just treats spaces and tabs identically for indention, rather than space-indented for shell scripts a…

Make can do all of those, easily, even eliminating TABs if you really care that much (I don't, my IDE handles them and it's really not a big deal). Have you ever taken the time to learn how to use it? Make targets can be whatever you want, and don't have to produce files. Make -n TARGET will list everything that Make thinks it needs to do to achieve TARGET, including anything that has to happen for any expressed depe…

Give just a try, or don't.

But it's simply not true that Make does all of that.

I moved from make about 5 years ago, never been happier.

Re: Create an internal CLI using Just

#7
post #4

Earlier quoted context omitted.

‘just’ is command-oriented, not target-oriented; this allows you to have: - two ways of producing the same file - a command with no side effects - not having to draw up a state machine just can enumerate its own commands, which is minor but helpful just can execute in multiple directories, and can descend directories just treats spaces and tabs identically for indention, rather than space-indented for shell scripts a…

Make can do all of those, easily, even eliminating TABs if you really care that much (I don't, my IDE handles them and it's really not a big deal). Have you ever taken the time to learn how to use it? Make targets can be whatever you want, and don't have to produce files. Make -n TARGET will list everything that Make thinks it needs to do to achieve TARGET, including anything that has to happen for any expressed depe…

Make is painful to use unless you're producing C object files. And even then it's painful to use.

But we get it, you don't want to try anything new.

Re: Create an internal CLI using Just

#8
> What about org-wide things, like installing useful tools, generating boilerplate code, or running complex AWS commands that no one remembers?

You can do all of this with make and make includes.

Re: Create an internal CLI using Just

#9
post #6
post #4

Earlier quoted context omitted.

Make can do all of those, easily, even eliminating TABs if you really care that much (I don't, my IDE handles them and it's really not a big deal). Have you ever taken the time to learn how to use it? Make targets can be whatever you want, and don't have to produce files. Make -n TARGET will list everything that Make thinks it needs to do to achieve TARGET, including anything that has to happen for any expressed depe…

Give just a try, or don't. But it's simply not true that Make does all of that. I moved from make about 5 years ago, never been happier.

Can you give me a specific example of what I said that's incorrect?

Re: Create an internal CLI using Just

#10
post #7
post #4

Earlier quoted context omitted.

Make can do all of those, easily, even eliminating TABs if you really care that much (I don't, my IDE handles them and it's really not a big deal). Have you ever taken the time to learn how to use it? Make targets can be whatever you want, and don't have to produce files. Make -n TARGET will list everything that Make thinks it needs to do to achieve TARGET, including anything that has to happen for any expressed depe…

Make is painful to use unless you're producing C object files. And even then it's painful to use. But we get it, you don't want to try anything new.

There's no reason to reinvent a tool that has literally decades of development behind it, is included in pretty much every Linux distro, and does what you need.

Dismissing it as being for olds is short-sighted.

Post reply on HN