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 is surprisingly works! Don't try it at home...


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

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

sábado, 9 de noviembre de 2019

J's awesome

So here are a couple of nice reads that, although they're not new, they somehow teached me something new today about J.


First one is this 9 minute video on the "i." integers monadic verb.  It's super simple. So simple I almost dismissed it as trivial. "Monadic verb that returns an array from 0 to the parameter you pass it", right? Well... There's more than meets they eye.  The trick is that for non-array programmers it's not obvious that the parameter can have many dimensions. And what zeroes mean? and negative numbers?

Next is this super nice interactive J demo.

And a classical: Loopless programming.