lunes, 23 de diciembre de 2019

Do not delete tmux dead panes

I've been using tmux for about a year. tmux-fingers and the feature that I helped add of instant pasting was what triggered the move.

Even I can't exactly replicate my screen workflow in tmux, I'm more than happy with the tradeoff.

Here's a nice option I didn't know about tmux: "remain-on-exit"

By default, tmux (like screen) kills the panes (or frames, or windows, or however they are called) when the process inside them dies. And usually, that's what you want.

But there's a case when you probably don't want this: "parallell --tmux"

I use GNU parallel as much as I can. I find it an awesome tool. Very hacker friendly and composable with everything you're already doing.

So I was recently using it to build packages for multiple distros. The command was something like  "parallel ./packager.sh --tmux {} ::: alpine ubuntu".  But when the processes finish (both successfully or not), the pane disappears, and doesn't let you review and debug the outputs.

Setting "set-option -g remain-on-exit on" on tmux, leaves every pane opened for your inspection.


viernes, 6 de diciembre de 2019

Making "docker run ... bash" Remember

Here's a small docker+shell hack I've never seen around and feel it makes a difference if you're getting in and out different (but related) containers. Very hackish, but works surprisingly well! Don't try it at home or rely on anything from it for other tools, as it doesn't compose very well, but hey... it's free :)

It's shell monkeypatching, and some kind of command parsing that looks like tcl/lisp-y list munging. Enjoy!

miércoles, 4 de diciembre de 2019

Software Like Scrabble

I don't know where did I read this one but talking about how development is not linear, someone was comparing it with scrabble, where you could add words only connecting one letter, and be "ok", but if you really want to get the max scoring, you have to think of synergies (gasp), and symetries, and how to reuse components in multiple subsystems.

I don't remember the exact quote, but I like to think it as well. Although iterating is THE WAY, focus and review of greater goals help you reuse in non-obvious ways. I'm not sure if this goes against TDD, or some other methodology (but it really shouldn't)

lunes, 25 de noviembre de 2019

Git from the ground up

There's this recent amazing video about org-mode, that happens to use git internals as the topic of the org mode document. And I just remembered the Aha moments I got when I started grasping git internals.  Here's what made stuff click to me.

- https://www.youtube.com/watch?v=ig5E8CcdM9g
- https://www.youtube.com/watch?v=MYP56QJpDr4
- https://www.youtube.com/watch?v=1ffBJ4sVUb4
- http://ftp.newartisans.com/pub/git.from.bottom.up.pdf


Also, https://initialcommit.io/#baby-git seems like a very nice deep dive into git internals from its core ideas.  I haven't had the time to dig into those articles yet, but worth mentioning them.
And last but not least: A very plain but smart way to investigate git: https://www.reddit.com/r/git/comments/eel2cf/how_does_gitstash_work_under_the_hood/fbubxvz/ . Kinda emacs' "c-h k", but for git.

sábado, 23 de noviembre de 2019

On the expressiveness of programming languages (and other stuff)

Here's this interesting talk about which features add expressivity to given languages, and which don't.  It's an interesting way of looking at this problem.

The pdf (and ps which is extended). It goes in the same fashion of operational semantics I love so much on the lisp culture. The same as in Baker's MetaCircular article that mentions many CL special operators that can be written already with the rest of CL and macros.

martes, 12 de noviembre de 2019

very proud of my history

So now that I'm transforming this blog in a twitter account (for my ~15 followers), I just wanted to mention that when I type 'pdf' in my firefox, the suggestions I get are the following:


And I'm extremely proud of that :)

lunes, 11 de noviembre de 2019

Some Forth Implementations

To finish up one of the geekiest weekends in the last months, I just wanted to point to a few Forth implementations, from where I learned some nice tricks (from both forth and the implementation languages)

- Bashforth/Perlforth
- Rubyforth
- Miniforth
- ItsyForth

I spent a lot of time grasping Bashforth, with its usage of some smart tricks that you don't usually see in bash scripts. Also, the fact that array indices are used as a sort of pointers makes total sense, but it wasn't obvious to me at first (I had to research a bit about "delcare"). Perlforth is done by the same guy, so it uses a similar approach.

Miniforth is Lua, and uses a different kind of implementation, and gets to bootstrap something forthish in 40 lines of lua.  Not bad :)

Rubyforth is the one I touched less, but looks like a variation of miniforth with more Forth compliance.

Now a quick bash quiz: What does it echo? AnswerHere

#!/bin/bash
fun() {
        local var="local value of var"
        echo "$ref";
}
var="global var"
declare -n ref=var
fun 

Well, there are two more canonical forth implementations that is worth mentioning them here, because if you're gonna just look at one implementation, you should take these ones as more "de facto" implementations.
- pforth
- jonesforth