miércoles, 28 de octubre de 2020

Some Tcl

Wanna spend an afternoon learning a scripting language that you didn't know about?

 

Tcl has appeared in HN recently a couple of times, and every time I read about it I remember that great article by antirez showing some very cool features of Tcl. So The link that appeared in HN today was a book by Hal Abelson and Philip Greenspun. 

 

In the intro, It's funny how they compare Tcl and Lisp.

 

Anyway, the links: 

  • http://antirez.com/articoli/tclmisunderstood.html
  • https://philip.greenspun.com/tcl/index.adp

miércoles, 14 de octubre de 2020

An emacs' Feature Development

So, in https://lists.gnu.org/archive/html/emacs-devel/2020-10/msg00691.html there's a proposal for an optimization in emacs, adding empty-directory-p so that elisp users don't have to (null (directory-files dir-name nil 'nodots t))).

And it makes sense to have a faster way. The person that proposed this improvement proposed a solution too. And it was a good one!

Then, Eli proposed something else. Some alternative implementation that:

  • Allows to solve the problem at hand, 
  • Reuses existing code by adding a 'limit' to directory-files
  • Easier to implement
  • Makes the implementation more stratified. You can still create empty-dir-p by calling directory-files
  • in case of passing that limit count to directory-files, we still get a list of files instead of a boolean. It's richer information, in case we need it.

After that, the conversation goes on by trying to figure out if the partial list of files will be useful at some point, or it's adding indeterminism and no value, and finding a balance on simplicity and usefulness. 

All in all, a very good end-to-end conversation about a feature, its implications and its implementations with its corner cases and usability. Every time I see these conversations happening I feel this joy... I love when they happen in my team.


PS: Needless to say, this is a "simple" feature compared to bigger and more complex discussions going on in emacs-devel (which are hard problems that have no perfect solutions). But it's a good case study and there's something to be learned there about approaches, discussions, and building together.

Thanks to everyone involved!


sábado, 5 de septiembre de 2020

Radicle: Secure peer-to-peer code collaboration without intermediaries

That's a pretty neat project I've stumbled upon. Radicle.

It tries to do a really distributed code management solution by building upon a few concepts I consider super interesting and rock solid. 

I'm gonna be throwing a few keywords that lighted up when reading about it (they might or might not appear as direct references in radicle's articles).: 

  • Git 
  • Merkle trees 
  • P2P 
  • gossip protocols 
  • IPFS 
  • Scuttlebut 
  • pijul 
  • nix 
  • Rust 

 

That's a lot of cool stuff! I wish I had a bit more time, but lately I'm so much into Red language that I devote 80% of my free time to it. Still learning the basics of its toolchain, but it seems very impressive to me so far.

 

And here is something totally unrelated, but I enjoyed it so much I have to post it somewhere. A reverse engineering video of Contra (NES videogame from the 80's), with explanation of the konami code.

lunes, 20 de julio de 2020

tangling files with org-mode

I've been inspecting this repo https://github.com/kinnala/nixpkgs, and it was the first time I looked at the org tangling. Quite simple to do so:

Mostly using ":mkdirp yes :tangle path", is like doing a "cat block >>path". And you use (org-babel-tangle) as the exporter

#+begin_src elisp :mkdirp yes :tangle ~/.emacs
(org-babel-tangle)
#+end_src

jueves, 16 de julio de 2020

export all variables in bash

If you have a prefix, the coolest way is like the following:

export ${!KONG_*}

If you want everything:

eval $(printenv | awk -F= '{ print "export " $1 }')

miércoles, 8 de julio de 2020

so JIT, WOW

This is so amazing I don't want to lose it:


A Smalltalk-80 VM written in LuaJIT, that boots the images from the eighties:
https://github.com/rochus-keller/Smalltalk#a-smalltalk-80-interpreted-virtual-machine-on-luajit

Approachable tutorial on JITs. The second part talks about metatracing.
https://news.ycombinator.com/item?id=23740655

I recently discovered this guy and he's awesome. Haven't particularly examined this repo, but please, also check out his other stuff.
https://github.com/spencertipping/jit-tutorial