Ir al contenido principal

Fast test on simplified english

In this post I'd like to do a brief (and not scientific at all) test on how easy is to write English in a simple way, and indirectly to personally understand how wordy I am, hopefully it can be interesting to you too.

The reason for this is that some time ago, when writing Plaza's documentation, a friend which helped me writing it expressed concern on the documentation's use of words being too complex for someone whose first language is not English. That criticism made a lot of sense as the goal of the documentation was (and is) to be an easy way for people to understand the goal and technical structure of the project, so they can contribute to its development.

For the purposes of this post, the criteria used to check if the text is "simple" or not will be the ones of the Simple English Wikipedia.

Leer más…

A Kubernetes concept map

Kubernetes is a tool which is now apparently everywhere. It addresses a lot of the problems related with running microservice, container-based infrastructures and does so in a very flexible way.

But a downside of this technology is that it requires getting used to so many concepts before anything makes sense, that the initial learning curve might be a bit too steep.

As my 2 cents to help with this (and as a sort of follow-up for the last post), here is a rough map, showing most of the resources available to a Kubernetes user and how everything relates.

It's certainly not complete, and there's probably bugs (pull requests appreciated). There's not much to explain about it... most importantly, links are clickable, arrows goint into the Pod resource are purple and those going out of it are brown-red so it isn't too messy, but it doesn't have a special meaning.

Kubernetes concept map Click the image to see it properly

Graphviz: fast and simple diagrams

Lately I've been looking for tools that take plain-text and generate a representation useful for humans. These are generally easy to use with git, and to build scripts around. Also, because they are operated from plain-text, they usually can be treated as a distraction-free way of organizing data.

Graphviz is one of such tools, it allows us to define this:

digraph {
  rankdir=LR;  // Set orientation as horizontal

  // And just define the connections.
  one -> two -> three;
  three -> four;
  four -> two;

And obtain this image:

Render of the sample code

Leer más…

Matrix operators as stack languages 2: closing maps

On the last post we saw how some matrix operations can be considered as forth-like operations over a stack of dimensions.

  • To do a swap add a transpose(mat) and continue on the left of it.
  • To move from dimension stack to the auxiliary one, open a map( (don't close it) and continue on inside the map.
  • New operations can be performed inside the map as long as they are done over the map lambda parameter.

Now, let's try to extend the process to allow exiting a MAP (moving from the auxiliary stack back into the dimensions one).

Leer más…

Matrix operators as stack languages

On the last post we explored how some program written on APL can be translated to Futhark.

Both Futhark and APL can be considered array programming languages.

A difference between them is that APL can express inner or outer operations when handling a multidimensional array, meaning that having an array 3×3×5×7 we can sum the values when only the first dimension is different, converting it into a 3×5×7 matrix (see the operation demonstrated here). By the way, the sizes come from the example on last post and don't have any special meaning.

Leer más…

Writing the game of life in Futhark

Some time ago I found a found a video of someone implementing the Game of Life on APL (you should take a look at it, the rest of the post will make more sense afterwards). APL is famous for being both expressive and unreadable for the non initiated. For example this Game of Life can be expressed as (code from

life{                                  ⍝ John Conway's "Game of Life".
    1 .3 4=+/,¯1 0 1∘.¯1 0 1∘.⌽⊂  ⍝ Expression for next generation.

The video linked above is quite interesting as it explains what all that symbols mean.

Some time later I was fiddling with the Futhark programming language and found a blog post titled "Futhark as target language for an APL compiler". This made me realize that APL and Futhark operate over (mostly) the same base concepts, and that replicating the same process on Futhark will be a good way to get to learn the basic operations of the language.

As an side note that this Game of Life is already implemented as a benchmark sample program for Futhark, so if you're interested in a useful implementation you should probably consider that one ;)

What is Futhark?

Futhark website describes the language as a "High-performance purely functional data-parallel array programming on the GPU". You could think it's something like a Haskell (with no recursion) which compiles its programs to something that a GPU can run (or anything OpenCL-enabled).

Leer más…

Writing a browser extension in typescript

Every once in a while I write some small web browser extension to do little things. You could, for example, write an extension for showing the ID's of elements in a web or replacing AI with "a bunch of dudes", and after firefox adopting WebExtensions as the way to write these plugins we can make it so the same code works with Firefox and Chrome!

While we're at it, let's see which extra steps we have to take to write these extensions on Typescript, after we have a running Javascript version.

So let's go ahead and write a simple extension which allows us show the ID's of elements on a web. This could be used, for example, to generate links which end with #id-of-element which when opened will make the browser scroll to that element. We won't go in depth, let's make it fast.

Extension popup

Leer más…

Clone this wiki

Wow, a post after almost two years!

I'm going to be brief to avoid taking hours to make a single post and going back to not writing.

First things first, I setup a wiki for personal references/notes it's not thought to have refined or complete content, just fast tips to solve situations I encountered. It might be handy, it might not, it's your decision.

I had a bit of fun making it as minimalistic as possible, and now it should run with only sh and a markdown to html compiler. All of this while being fully version-controlled by git. You can take a look at it on my gitea or on github. (Yep, content and "code" shares version control as there's really little code)

Ok, with that out of the way...

Lots of things happened lately, but in summary

  • I'll start writting back, now in english. It's not harder and saves me the effort of translating every post, which was what made me stop in the first place.

  • Posts will get smaller, and i'll cover mostly my own projects. Doing comprehensive writeups take a loooong time so (unless something is very interesting) I won't be doing more. Also, tips and how-to's will go to the wiki but i'll try to add an entry here just to link back.

That is the plan anyway ¯\_(ツ)_/¯

Saw that? A post written in ~30 minutes, that's much better that 2 days for a writeup :D!