Alcides Fonseca

40.197958, -8.408312

TigerBeetle Code Style

  • Declare variables at the smallest possible scope, and minimize the number of variables in scope, to reduce the probability that variables are misused.
  • There’s a sharp discontinuity between a function fitting on a screen, and having to scroll to see how long it is. For this physical reason we enforce a hard limit of 70 lines per function. Art is born of constraints. There are many ways to cut a wall of code into chunks of 70 lines, but only a few splits will feel right.

TigerBeetle codestyle

I remember when getting into Haskell, back in 2010: “If your function has more than 4 lines, it is wrong”. For me, that is more meaningful than the 80 character limit. Soft-wrap exists to adapt lines of any length to your own screen. However, managing the complexity of functions and code-blocks is way more important in my book.

I know you have larger functions in Haskell (especially with monads), but keeping functions within 4 lines makes it an interesting trade-off between badly-named functions and the complexity of each function.

I know when to break this rule, as do most senior programmers. However, junior programmers lack the sensitivity to make such decision. I love having a rule-of-thumb for newcomers who are not familiar with the ecosystem or programming in general.

Btw, the rest of the style guide is quite good! Except for the number of columns thing.

Foundations for hacking on OCaml

How do you acquire the fundamental computer skills to hack on a complex systems project like OCaml? What’s missing and how do you go about bridging the gap?

KC Sivaramakrishnan

KC gives several resources for students to get up to speed with contributing to OCaml.

One of the interesting resources is MIT’s the Missing Semester. This semester I created our own version of this course, covering git, docker, VMs, terminal/bash, testing, static analysis and LLMs for code.

While we cover how to do a Pull Request, I don’t believe students are ready to actually contribute. Reading large codebases is a skill that even our graduate MSc students don’t have. Courses are designed to be contained, with projects that need to be graded with few human effort, resulting in standard assignments for all the students.

I would love to run something like the Fix a real-world bug course Nuno Lopes runs. But being able to review so many PRs is a bottleneck in a regular course.

To understand, you have to invent

To really understand a concept, you have to “invent” it yourself in some capacity. Understanding doesn’t come from passive content consumption. It is always self-built. It is an active, high-agency, self-directed process of creating and debugging your own mental models.

François Chollet (via Simon Willison)

It’s a rephrasing of our “The best way to understand something is to teach it to someone else”. And that’s why I still love my job.

My 2025 HN wrapped

I use Hacker News as a tech and economy news feed, but I don’t necessarily comment or upvote a lot.

Just like Youtube or Spotify’s wrapped (I personally use Last.FM), there is this fun HN wrapped that was done with a tongue-in-cheek style that I particularly love.

2025 in Music

Like last year, my 2025 music trends are quite steady:

My Last.FM shows me that I did not listen to a lot of new music. Here are the 2025 albums I have added to my library:

  • Avantasia – Here be Dragons. In the same line of the previous trilogy of albums, with a callback to the original fantasy sounds. However, I still miss the opera style of the first couple of albums, while these latest 6 albums are more of a Tobias album with a few guests. I wanted more of Sign of the Cross epic song with several singers.
  • Arjen Anthony Lucassen — “Songs No One Will Hear”. Ayreon has been my fix to this epic opera song. This is clearly not an epic Ayreon album, but Dr Slumber’s Blue Bus is a happy song that I just can’t enough.
  • Halestorm – Everest It’s not one of the older albums “every song is a banger”, but it has a slower, more mellow tonality to it. In particular, my favorite song, Darkness Always Wins, gives me a déjà vu feeling, as if it was a song from my teens.
  • Majestica – Power Train I mostly listen to it because of No Pain, No Gain which is one of the songs that I wake up to if I want energy right in the morning.
  • Dynasty – Game of Faces Nills still has time to record with his original band (I love him in Amaranthe, despite having a slight preference for Jake’s era songs), but despite generally good, it does not have a really over-the-top song like earlier albums.

While not A-side, I have also enjoyed the two alternative releases by Linkin Park (“A Capella:https://consequence.net/2025/01/linkin-park-a-cappella-album-from-zero/) and The Mars Volta (Lucro Sucio; Los Ojos Del Vacio) but the original material still plays more on my speakers.

In hindsight, I have spent very little time searching for new bands, other than Majestica. One interesting Top40 source of recommendations is the Hitster boardgames, where you try to create a timeline of popular songs just by Spotify’s 30 second preview.

Simon Willison reinvents TDD

As software engineers we don’t just crank out code—in fact these days you could argue that’s what the LLMs are for. We need to deliver code that works—and we need to include proof that it works as well. Not doing that directly shifts the burden of the actual work to whoever is expected to review our code.

Simon defends that engineers should provide evidence of things working when pushing PRs onto other projects. I recently had random students from other countries pushing PRs onto my repos. However, I spent too much time reviewing and making sure it worked. I 100% agree with Simon on this, but I feel the blog post is a bit pessimistic in the sense that software engineers might only be verifiers of correctness.

Don’t be tempted to skip the manual test because you think the automated test has you covered already! Almost every time I’ve done this myself I’ve quickly regretted it.

This is my experience for user-facing software. But these days, I spend little time writing user-facing code other than compiler flags.

Needy programs

Notifications are the ultimate example of neediness: a program, a mechanical, lifeless thing, an unanimate object, is bothering its master about something the master didn’t ask for. Hey, who is more important here, a human or a machine?

Nikita Prokopov

Funny piece by Niki, reporting how the 2010+ software is needy, shown by subscriptions, notifications, what’s new panels, accounts. I wonder how much of this is because of the Facebook-inspired all-in VC-backed software. You need to collect statistics and pay server costs, even if your app could work perfectly offline.

VSCode started as an interesting alternative to IDEs. Now I can no longer use it in my classroom: notifications, status bars, sidebars, copilot all get in the way of showing (and navigating) code. I really want to go back to Textmate, but it lacks LSP support. Zed is the new kid in the block, but the collaborative aspect of it kinda of ruins it for me. I want a native editor that you pay once, and don’t get distracted by it. If I want to use AI, I want a second editor for that (Cursor 2.0 is moving in that direction, but still not there for me)

EU OpenSource Funding

The Portuguese government runs on top of OpenSource Software. There is a bunch of Java web applications, jQuery-powered websites, the Citizen Id Card runs on open source software and our public data instance also runs on OpenSource. Throughout many organizations, we use linux web servers, Android devices and many other server-side tools. The government even has a GitHub account where they publish some of their projects (and identify open-source dependencies). There is a report listing some of our dependance on Open Source Software.

So, OpenSource software is part of the necessary public infrastructure, just like roads or water sewage are. Both didn’t exist 200 years ago, but they are not expected by all citizens. Would you imagine a government that does not fund sewers? Well, ours does not fund OpenSource software.

But Germany does! Germany has invested more than 23 million euros into sixty projects. It’s time other countries follow the lead, and create a more sustainable environment for open source software.

Next-Cloud (an alternative to Office 365 or Google Apps that you can install within your company) are asking the EU to create an Europe-wide Sovereign Tech Fund.

If we want commercial and data independence from the US and China, we need to invest more in local-first alternatives, and promote the open source alternatives from which European companies can create their own products.

Peer Review is Dead

If ChatGPT can produce research papers that are indistinguishable from what most scientists can write, then maybe scientists can focus on actually advancing science—something that ChatGPT has thus far proven unable to do.

Beyond papers: rethinking science in the era of artificial intelligence by Daniel Lemire

Looking at the proceedings of our conferences over the past few years, I find that most of the papers are simply uninteresting. Moreover, it seems that every first-year PhD student is now required to write a systematic review on their topic — supposedly to learn about the field while producing a publication.

Let me be blunt: every systematic review I’ve read has felt like a waste of time. I want to read opinionated reviews written by experts — people who have seen enough to have perspective — not by PhD students who have just skimmed the past decade of papers on Google Scholar.

We need far fewer papers (I’m doing my best to contribute to that cause), and the ones we do publish should be bold, revolutionary, and even a little irreverent. We need innovation and the courage to break expectations. Incremental research has its place, but that doesn’t mean it always needs to be published.

To make this possible, evaluation committees — both nationally and within universities — must rethink their processes to move away from bean-counting metrics. Our current incentive system discourages genuine peer review, and even when proper reviews happen, they often waste effort on work that adds little value.

Otherwise, yes — the bean-counting-reinforcement-learning AIs will take our jobs.

Familiarity-Driven Design

Why do I run Prometheus on my own machines if I don’t recommend that you do so? I run it because I already know Prometheus (and Grafana)[…]
This has a flipside, where you use a tool because you know it even if there might be a significantly better option, one that would actually be easier overall even accounting for needing to learn the new option and build up the environment around it. What we could call “familiarity-driven design” is a thing, and it can even be a confining thing, one where you shape your problems to conform to the tools you already know.

Chris Siebenmann

I do exactly the same thing. There is so much technology in my life that I need to reduce the number of tools, languages and frameworks that I use.

ATProto vs Mastodon

Conceptually, Mastodon is a bunch of copies of the same webapp emailing each other. There is no realtime global aggregation across the network so it can only offer a fragmented user experience. While some people might like it, it can’t directly compete with closed social products because it doesn’t have a full view of the network like they do.

The goal of atproto is enable real competition with closed social products for a broader set of products (e.g. Tangled is like GitHub on atproto, Leaflet is like Medium on atproto, and so on). Because it enables global aggregation, every atproto app has a consistent state of the world. There’s no notion of “being on a different instance” and only seeing half the replies, or half the like counts, or other fragmentation artifacts as you have in Mastodon.

I don’t think they’re really comparable in scope, ambition, or performance characteristics.

Dan Abramov, Hacker News comment discussing his Open Social article (via Simon Willison)

I did not know about this huge difference. The reason why federated social networks will never work is because it is done at the cost of usability. Discovery and recommendation is done better when everything is centralized. atproto gives everyone a global view, which has scalability issues (if you care about recommendations for instance). FAANGs have been tackling these scalability issues for the last couple of decades in the centralized (but physically distributed) environment. I doubt it can be done completely federated.

On the other hand, I believe we need more players in their fields (Netflix is one of the few that does not have a monopoly), but other major tech companies are in one or at least a duopoly. Federation is a good solution to breaking those monopolies.

But I do not see that happening, unfortunately. The customers in this day and age care about low friction more than privacy or price (especially if you can pay with time or attention).

Rodney Brooks of iRobot fame

Om Malik interviews iRobot founder Rodney Brooks:

At MIT, I taught big classes with lots of students, so maybe that helped. I came here in an Uber this morning and asked the guy what street we were on. He had no clue. He said, “I just follow it.” (‘It’ being the GPS—Ed.) And that’s the issue—there’s human intervention, but people can’t figure out how to help when things go wrong.

Taxi drivers used to have to know every single street in the city to get their license issued. TVDE don’t even need to know street names. If you ask for the directions to a Portuguese-named hotel in Lisbon, they ask you to type it in their phones. Navigation apps have done a disservice in now being designed to teach POIs and navigation to humans. Let’s hope you have a power bank near you when you get lost in your own city!

We’re trying to put technology in the manual warehouses, whether it’s DHL—our biggest customer—or Amazon. It’s about putting robots in places where there are no robots. And it’s not saying it’s a humanoid that’s going to do everything.
You’re right, it’s not sexy. And you know what that means for me? It’s hard to raise money. “Why aren’t you doing something sexy?” the VCs ask. But this is a $4 trillion market that will be there for decades.

Software Companies (Microsoft, Google, Facebook) have shifted the mind of VCs. Due to how fast it spreads, it was much easier to obtain monopolies (and make a lot ton of money) than with previous life-changing inventions (phones, computers, cars). Everyone is looking for the next unicorn like it’s the Gold Rush.

I always say about a physical robot, the physical appearance makes a promise about what it can do. The Roomba was this little disc on the floor. It didn’t promise much—you saw it and thought, that’s not going to clean the windows. But you can imagine it cleaning the floor. But the human form sort of promises it can do anything a human can. And that’s why it’s so attractive to people—it’s selling a promise that is amazing.

This is what you get when you study interaction design. Physical affordances and skeuomorphisms. If you were a 18 century time-traveler you would be more likely to be able to use an early iPhone than the current Liquid Design ones.

I think we need multiple education approaches and not put everything in the same bucket. I see this in Australia—”What’s your bachelor’s degree?” “I’m doing a bachelor’s degree in tourism management.” That’s not an intellectual pursuit, that’s job training, and we should make that distinction. The German system has had this for a long time—job training being a very big part of their education, but it’s not the same as their elite universities.

In Portugal, the technical schools and universities are now offering the same courses (given in the same style), including PhDs, with no distinction. Diversity is healthy and should address the dichotomy of learning to get a job, and learning to change the world. Both need distinct methods and depths.

As 3D printing becomes more general, in the same way information technology and payment systems got adopted in the third world more quickly than in the US, 3D printing will become the engine of manufacturing.
Right now, the supply chain is the reason China is so effective. Chinese manufacturing companies realized they had to diversify and started building supply chains in places like Malaysia, Vietnam. But if 3D printing really gets to be effective, the supply chain becomes all about raw materials that get poured into the front of those 3D printers. It’ll be about certain chemicals, about raw materials, because then every item would ultimately be 3D printed. That completely breaks the dynamic of what made Chinese manufacturing so strong—the supply chain of components.

Brooks is the first person to provide me with an optimistic viewpoint of manufacturing and China’s upcoming world dominance.

Well worth the read!

Portal das Autárquicas

..

As pessoas em Portugal votam como fãs de partidos como se de clubes de futebol se tratasse. Parabéns à equipa do Lisboa Para Pessoas pelo trabalho nesta plataforma que agrega os programas dos vários partidos para os 18 municípios da zona de Lisboa.

Um sampling nada aleatório:

Nova Direita para Lisboa: Implementar mecanismos de dissuasão da criação de bairros de hegemonia religiosa.

Espero que não se esqueçam da religião católica. Vou adorar o baralhar e dar de novo que vai acontecer com a habitação em Lisboa!

CDU para Lisboa: Defender junto do Governo e da AR que os municípios devem poder, perante o reconhecimento da declaração de situação de carência habitacional, proceder à posse administrativa de fogos com uso habitacional, devolutos ou sem utilização há mais de um ano, após a notificação.

Uma pessoa faz uma sabática e fica sem casa. Que giro!

“Moedas para Lisboa:” 100% da frota da Carris com zero emissões até 2030.

Alguém que me explique como é possível ter zero emissões num transporte público. A matemática não faz sentido.

Wargames (1983)

I’ve always wanted to recommend a few movies for my students to think about societal impact of their work. This semester I am finally doing it, and I’m starting with Wargames, from 1983.

A very young Matthew Broderick plays a young “hacker” that learns about how computers talk to each other, and his curious mind leads him to play a game against an 80s style AI. This AI is realistic in the sense that it learns from different executions (min-maxing strategies, pre-Reinforcement Learning) to estimate the best course of action.

Early in the movie you see him using early modems and connecting directly to any machine in the world via phone number. Later you see him trying some phreaking with a payphone. Too bad he didn’t have a Cap’n Crunch whistle with him.

It also features one of the first uses of hallucination in AI, predating the 1995 origin material. I might be stretching it a little, but it makes whole sense to me.

Finally, there is a message in the movie that critical systems should have a human in the loop as a safeguard. I wonder how many companies and individuals today have the same urge to replace humans with machines in super-critical scenarios. Oh, but machines act immediately, without a second thought.

Google Workspace and Email Authentication

My employer added a new spam filtering system (Anubis), which blocks my own personal email. Since I have an old free account in Google Workspaces, I had to figure out what was going on. Apparently, I was not signing the emails with SPF, DKIM and DMARC.

I followed this very simple and direct guide on how to setup it up. And I tested my new configurations using DMARCly.

Now the problem is that I have my Gmail (for Google Workspaces) set up to send emails via my employer’s SMTP account. Yes, I like to have all my email accounts merged in one inbox. I tried to split it last year, but failed miserably as I have plenty of work stuff in my personal email, and I like a single search box for all my emails.

I’ll update this post when I am successful at signing SMTP outgoing emails as well.

Universidades contornam limites de propinas com taxas e taxinhas

No Politécnico de Coimbra subiram a taxa de matrícula de 30 para 125 euros. Alunos de Mestrado e Doutoramento pagam até 500 euros de taxa de entrega de tese.

No caso das licenciaturas, estas taxas servem para as universidades públicas receberem mais dinheiro do que a propinas que está definida por lei. A nível de doutoramento, serve para manter o valor da propina naquele que a FCT suporta nas suas bolsas (2750 euros).

A verdade é que os alunos vêem um preço anunciado, e depois é-lhes impossível acabarem o curso pagando apenas esse valor. É literalmente publicidade enganosa.

Precisamos de duas mudanças: eliminação das taxas por parte das Universidades e Politécnicos, englobando esse custo na propina. Um aluno pagando a propina, deve conseguir ter acesso a assistir às aulas, ser avaliado e obter o diploma, sem qualquer taxa.

E o estado precisa de majorar o financiamento das universidades, que claramente têm de recorrer a estas acções eticamente discutíveis para manter a sustentabilidade económica que lhes é exigida pelo Tribunal de Contas.

Reddit will block the Internet Archive

Reddit says that it has caught AI companies scraping its data from the Internet Archive’s Wayback Machine, so it’s going to start blocking the Internet Archive from indexing the vast majority of Reddit. The Wayback Machine will no longer be able to crawl post detail pages, comments, or profiles; instead, it will only be able to index the Reddit.com homepage, which effectively means Internet Archive will only be able to archive insights into which news headlines and posts were most popular on a given day.

Jay Peters for The Verge (via Simon Willison)

Next it will be google. And most of the post-2025 forum knowledge in the web will be lost. Imagine a web browser that cannot access StackOverflow or Reddit. How useful it is? LLMs will need new data to continue being relevant, and a new data monetization strategy will change the internet forever.