Live data from Hacker News

Making Hard Things Easy

jvns.ca

121–130 of 202 posts

Re: Making Hard Things Easy

#122

The part that resonated most with me is "Show things that are normally hidden". Tools that do this make things clearer almost immediately. Consider the developer tools in a web browser. Do you remember the "dark ages" before such things existed? It was awful because you had to guess instead of seeing what was going on. Tools like Wireshark that show you every last byte of network packets that it has access to AND par…

My dream is to make everything visualizable at runtime. I think all of computing becomes very simple and much less complex if we can do this.

We are visualizing things in our head already. And any explanation of anything in computing is a diagram. But we have zero diagrams when coding.

Just dynamically instrument all code to send messages to a GUI.

Re: Making Hard Things Easy

#123

To make hard things easy you have to find the right way to abstract them so you hold only some bits of the hard things in your head and all the frequently-used details too (maybe), and everything else you have to look up as needed. That's what I do, and that's roughly what TFA says. The problem is that people don't necessarily bother to form a cognitive compression of a large topic until they really have to. That's b…

Yes, `set -e` is broken

The need to quote everything (default splitting on $IFS) is broken

Globbing should be something one has to explicitly ask for

By the way OSH runs existing shell scripts and ALSO fixes those 3 pitfalls, and more. Just add

    shopt --set ysh:upgrade
to the top of your script, and those 3 things will go away.

If anyone wants to help the project, download a tarball, test our claims, and write a blog post about it :)

Details:

https://www.oilshell.org/release/latest/doc/error-handling.h...

https://www.oilshell.org/release/latest/doc/simple-word-eval...

These docs are comprehensive, but most people don't want that level of detail, so having someone else test it and write something short would help!

For awhile I didn't "push" Oils because it still had a Python dependency. But it's now in pure C++, and good news: as of this week, we're beating bash on some compute-bound benchmarks!

(I/O bound scripts have always been the same speed, which is most shell scripts)

(Also, we still need to rename Oil -> YSH in those docs, that will probably cause some confusion for awhile - https://www.oilshell.org/blog/2023/03/rename.html )

Re: Making Hard Things Easy

#124

To make hard things easy you have to find the right way to abstract them so you hold only some bits of the hard things in your head and all the frequently-used details too (maybe), and everything else you have to look up as needed. That's what I do, and that's roughly what TFA says. The problem is that people don't necessarily bother to form a cognitive compression of a large topic until they really have to. That's b…

> As for SQL

We should peel off SQL and get access to the underlying layers.

Re: Making Hard Things Easy

#125
post #2

Excellent talk. She seems to be a very likable person. She is right about Bash being full of "gotchas" and trivia and memorizing them all is very hard, but I think it is nice to memorize some trivia. For instance, I tended to forget the order of the arguments of the find command, and I would lose time trying to remember its syntax when I'm in front of a machine with no readily available internet connection. So I comm…

We should stop using Bash, and use TypeScript instead.

Bash is terrible.

Re: Making Hard Things Easy

#126
On a side note, I use GPT-4 to help me create simple Bash scripts. Haven't run into a problem yet, but I double/triple check they won't do anything strange and most of the time, it works quite well.

Don't understand the script, but this is only for personal use. I wouldn't do the same in a work setting (obviously).

And in this specific example, it's been quite a powerful tool to make many parts of my life easier.

Re: Making Hard Things Easy

#127
post #106
post #17

Earlier quoted context omitted.

Right. I don't think you're supposed to read them top-to-bottom. Use `/` and search for the things of interest (keywords, arguments, options, etc...). Use n/N to quickly jump forward/back.

Find has a particularly bad man page to find things that way.

AFAIK there is a find replacement with sane defaults: https://github.com/sharkdp/fd , a lot of people I know love it.

However, I already have this in my muscle memory: find -name '' -type f(file)/d(directory)

Works in 90% of situations when searching for some file in terminal, ie: find / -name 'stuff*'

The rest of the time is spent figuring out exec/xargs. :)

And once you master that, swap xargs for GNU parallel. I bet your machine has a ton of cores, don't let then sit idly. ;)

Re: Making Hard Things Easy

#129

The part that resonated most with me is "Show things that are normally hidden". Tools that do this make things clearer almost immediately. Consider the developer tools in a web browser. Do you remember the "dark ages" before such things existed? It was awful because you had to guess instead of seeing what was going on. Tools like Wireshark that show you every last byte of network packets that it has access to AND par…

My dream is to make everything visualizable at runtime. I think all of computing becomes very simple and much less complex if we can do this. We are visualizing things in our head already. And any explanation of anything in computing is a diagram. But we have zero diagrams when coding. Just dynamically instrument all code to send messages to a GUI.

Clojure does pretty well. See https://github.com/nubank/morse, https://docs.datomic.com/cloud/other-tools/REBL.html, and https://vlaaad.github.io/reveal/.

It's one of the areas that homoiconicity helps: code is data, data is code, so visualization tools can work on both sides.

Post reply on HN