A Bourne-style shell built from scratch in 35 minutes [video]
destroyallsoftware.com
destroyallsoftware.com
I can Google like ya'll - I'm just asking if there are any favorite resources :)
Thanks
Could you elaborate on this? Tmux uses the screen terminfo entry? Is it not actually 256?
The TERM environment variable must be set to “screen” for all programs running inside tmux. New windows will automatically have “TERM=screen” added to their environment, but care must be taken not to reset this in shell start-up files.
So, yes, Tmux uses the GNU screen terminfo entry.
I've seen claims that current command line tools are standardizing around the ECMA-48/ISO 6429/ANSI X3.64 escape code protocol
In hindsight I should have done what the rest of the class did and took the Blackjack option but there was the option to do our own project instead, I demonstrated it worked by connecting it to my Linux laptop (this was '98, I was a strange 18yo).
I was into LambdaMoo and mtrek at the time and I wanted to understand how they worked better :).
i'm not trying to say it's not worth building your own, i'm just curious.
Yes, to learn the tech - but also to toy with ideas. I've been using Kakoune recently after years of Vim and while I enjoy it, it makes me wonder many things. After much speculation to myself, I decided to try implementing my ideas. I mainly expect them to fail, in the UX department at least, but I have to use it to really flesh it out.
This may sound more editor oriented, and you'd be right, but for a simplest explanation a self made multiplexer like tmux/etc will be involved.
It's an interesting resource to learn how shells work and are implemented. It doesn't cover absolutely everything, but it was never meant too.
Wouldn't the size of the arguments be limited by sysconf(_SC_ARG_MAX) as explained here? http://man7.org/linux/man-pages/man2/execve.2.html
PS: Is the code available somewhere? I can't play the video on Firefox on CentOS 6.
(extend-parser "!"
(mac (cmd) `(apply run (map to-string ',cmd))))
!(sed "s/foo/bar/" README)"That's not writing, that's typing", as someone once put it.
(Not to mention, of course, that a Unix shell is very cumbersome to use without pipes and redirection. EDIT: Pipes are implemented, but not redirection?)
If it was insufficiently pedagogical, or failed to give people the impression that shells are just software and They Can Do It Too, then I would understand the critique more, as those are clearly the goals.
Sure, if all you’re doing is implementing a program with a command line interface like ftp(1), kermit(1), sftp(1), etc. that do not run arbitrary subprocesses, and do not need to handle being arbitrarily interrupted, then sure, implement away. I would suggest the Python “cmd” library as a good way to get started quickly. But for a login shell, used to run other programs, there are more complex considerations.
How was this video made? Imagine trying to make it. What would you do? You need to write the code, but do you do it before or after you write the script? Or do you write the script after you write up the code so you know how to produce it?
Everything flows so smoothly. It's mesmerizing to watch. It's like code appears as fast as he can talk. But in a natural way, where it seems like it's typed as he's talking. But he certainly isn't typing it in realtime.
I'd like to make videos like this too, so I'd like to learn more about how to produce one.
I do edit out pauses to breathe, to drink water, sometimes to double-check my thinking about what to do next, and occasionally to open a second terminal and check something.
Destroy All Software is six years old, so I've had a lot of practice. Most DAS screencasts require a couple hours of initial silent prep, then around 10 full runs from beginning to end. When it starts to flow well (run #5, give or take), I fire up ScreenFlow and start doing each run as if it might be the final published version (because it might actually be). With these longer "from scratch" screencasts, I only make one or two attempts per day; by then my throat and brain are both pretty tired.
I also live stream these on Twitch before making the final version, so you can see the sausage being made if you like! It's basically the same as what you saw in this video, but the pauses are there, you get to hear me become confused sometimes and comment on my mistakes, and there's a bit of Q&A afterward. The schedule isn't fixed, but I try to tweet with a couple hours' notice (https://twitter.com/garybernhardt).
I think it really speaks to how software development happens. The premeditated thinking takes up most of the time, and typing it out is often the easiest part when the architecture is crystal clear in the mind. Combining that with succinct explanations might be like putting both hands together while playing piano.
I am not downplaying the difficulty of what you're doing at all, just appreciating the process. Thanks for the material!
I've never seen anybody else who is able to do that. It's truly mind blowing.
— Eric Allman
I also just learned Bash was developed by Brian Fox after Stallman became dissatisfied with progress on it in 1988 as a free software replacement for the Bourne shell.
We don't celebrate these guys enough, I wish there was more recognition, more of a public face and profile for all these pioneers.
The value I've personally got out of DAS is incredible.