Hacker News

New stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. The First Nolan Movie: The Odyssey and the world after men change it(firstrand.co.za ↗)
    discuss
  2. The Shaky Evidence That Flock Cameras Reduce Crime Rates(reason.com ↗)
    discuss
  3. Claude Code is getting native AGENTS.md support(github.com/anthropics ↗)
    discuss
  4. Open-source AI PR reviewer that helps you ship(nitpicker.dev ↗)
    discuss
  5. An Agent's Breath. The Heart Beats by Itself, Breathing Is a Choice(piotrzientara.pl ↗)
    discuss
  6. If you are browsing in Chrome / Firefox in desktop you should try this extension(chromewebstore.google.com ↗)
    1comments
  7. The Cornetto Ice Cream Cone Framework for Prompting(hazn.com ↗)
    discuss
  8. Ternary-Bonsai-8B-Gguf(huggingface.co ↗)
    discuss
  9. How Efficient Is Each Type of EV Charger? (2024)(insideevs.com ↗)
    discuss
  10. Show Your Work(jagasantagostino.com ↗)
    discuss
  11. Tactile controls in a digital world (2024)(jenson.org ↗)
    discuss
  12. Ask HN: What to focus on in this age of AI
    1comments
  13. If AI coding is lowering your code quality, you're not managing quality right(i-kh.net ↗)
    5comments
  14. Humans Are the Only Real Agents(aboard.com ↗)
    discuss
  15. velocity content marketing(briefiq.io ↗)
    discuss
  16. The Ma of a New Machine(jenson.org ↗)
    discuss
  17. Germany's green developers hit a wall: Insolvencies, tighter credit(briefs.co ↗)
    discuss
  18. Apache Cassandra 6 Accord transactions: What you need to know(instaclustr.com ↗)
    discuss
  19. Underclass: An OpenAI-compatible pooling proxy that pins sessions to one account(github.com/ghuntley ↗)
    discuss
  20. Romanian Crime Rings Are Draining U.S. Welfare Accounts(wsj.com ↗)
    1comments
  21. Scott Jenson: Are we going to use the same Desktop UX forever? [video](youtube.com ↗)
    1comments
  22. Post Messages via Get(swarmmemo.com ↗)
    1comments
  23. Doomsday: Friday, 13 November, A.D. 2026 (1960)(science.org ↗)
    1comments
  24. DQuic: Extending QUIC for P2P and Multipath Transport(dhttp.net ↗)
    1comments
  25. Ask HN: If frontier models were free, would we produce better or worse software?
    discuss
  26. I'm Tired of the AI Tone(sagivo.com ↗)
    12comments
  27. The Many Faces of Information Geometry [2023](chinougea.medium.com ↗)
    discuss
  28. Fastest Coding Agent (5x faster than Codex)(cotyper.com ↗)
    discuss
  29. Do you need a technical cofounder?(ivelum.com ↗)
    discuss
  30. A MySQL plugin that filters rows by meaning (built on TypeSafe Jev)(github.com/maayanlevy ↗)
    discuss

Telling a Computer to Do Things

43 pointsby 6h agowill-keleher.com
18 comments
5h agoHN ↗

Nice article about actually learning stuff and putting this knowledge to use together. Not with AI but with one’s own brain.

1h agoHN ↗

in what case jq, a specialized json tool, is more limiting than sql?

4h agoHN ↗

Good advice. I've gotten a ton of utility out of my shell without learning very many tools particularly well.

If you take nothing else away from this, memorize the syntax of one-liner for loops, it has saved me so many times.

4h agoHN ↗

Why are we assuming using the terminal is the only way of "telling a computer to do things"? Every way you interact with a machine, you are telling it to do things in theory.

For example

At a fundamental level, I wasn’t able to tell my computer to accomplish anything that involved logic or stitching together multiple programs

How can that be true if you are telling it to boot on into a os? It doesn't involve logic? Or stiching together multiple programs?

Using a shell =\= telling a machine what to do on a broad level. You are just using the abstractions provided by the os. If you mean get better at shell so you can use it more efficiently than okay cool but that doesn't someone who uses a GUI doesn't "tell" the machine what to do as much as you.

3h agoHN ↗

I was sure this article would be about how we tell computers to do things now (writing prompts to an AI in plain English). I was wrong. Interesting nonetheless.

1h agoHN ↗

LLMs solved this exact problem. Not perfectly (they can sneak in some malicious commands) but good enough for everyone. This is also mostly what non-developers mean by "vibe-coding". They can "tell the computer to do the things" they want. Previously they were limited to existing GUI applications. Now they can automate and customize their workflows as they wish and think they're a 'coder'.

3h agoHN ↗

I was pretty close in guessing what they believe was "wrong" (or really, superfluous) with their initial shell script example.

I'd even drop the "if" from their footnote version, and go with simply

  npm install || (echo "boom" && exit)

(Not exactly equivalent because there won't be an "exit" if echo fails, but it's my preferred instict over ";") Also, "(" starts a subshell, if we are being pedantic.

1h agoHN ↗

I wonder if there’s some obscure syntax for "do this if the last command fails and propagate its exit code". For just returning some error you can of course have something like `die("boom")` (though not as a builtin?) but sometimes it’s useful to know the exact code.

20m agoHN ↗

if table --warble farble; then :; else table_ec=$?; echo "Garble warble farble! :(" >&2; exit $table_ec; fi

Works in dash/bash/zsh at least; not 100% sure whether the behavior of $? on the command in an if test is mandated by POSIX and/or portable. Note that you can't replace the empty then-branch with a negated condition because the negation also eats the return code.

Also, absolutely correct propagation is essentially impossible (but usually not useful anyway), because some errors might be unexpected signal exits or inability to find the command in the first place, and those will get punned onto other nonzero exit codes. I forget the exact conventions OTTOMH but generally they're in the high half (≥128).

3h agoHN ↗

On the higher level question in the article of why do people not use their main languages for basic file and command management?

I believe the answer is the same as to why Python remains hugely popular despite all the well-documented shortcomings: batteries included.

Shell languages include so many neat and concise ways to execute commands, deal with their input, output and exit codes, allow simple traversal of deep directory structures with globs and advanced tools like 'find' or 'xargs', that everything else is very unergonomic.

And niche by default (until it gets used widely enough), so even your LANG-OF-CHOICE-expert you recruit, they will not know a thing about that shell-focused library in LANG-OF-CHOICE.

3h agoHN ↗

That philosophical point about what it even means to "tell a computer to do things" is a good one. Sure, clicking around in a GUI is also telling the computer what to do. But there's a huge difference between using someone else's abstraction and building your own from scratch. The article is about that second part - the ability to throw stuff together however you want. With a GUI, you're stuck with whatever the designer thought of. With a shell, you can build just about anything

1h agoHN ↗

But you’re still limited by the designer of that shell? Or userspace? Or kernel? Or cpu architecture? I mean, how deep should you go before «it’s however YOU want»?

1h agoHN ↗

There are some really powerful UIs that are extremely flexible, like spreadsheets, or ComfyUI, or certain issue trackers. On the whole however I would say they all still are mostly their own interaction silos and integrations with other programs have to be explicitly built for each app.

The great thing about a shell is that you can glue together programs that don't know about each other. This is not a silver bullet, with shell programs being text oriented etc., but it does give rise to some powerful possibilities that don't really work with UIs.

2h agoHN ↗

Your next homework assignment is to write your own scripting language that emits asm. Then you'll be one step closer to understanding what it really means to tell your computer to do things!

1h agoHN ↗

There is, of course, a programming language designed to do shelly things as succinctly as a shell script: Perl.

1h agoHN ↗

I was amused to see DeepSeek using it recently, as I didn't realize it was installed on my machine (macos with brew).

Ruby is much, much prettier for similar purposes though, and so that's what I'll learn if I ever need to do this more frequently.