Currently browsing

Gear Tune

Stairs, Cakes and Injections

Dependency Injection is a design pattern meant to increase decoupling, readability and testability by wiring together component implementations so that: All their dependencies on other components’ contracts are satisfied The wiring logic doesn’t belong to any component being wired but to injectors instead Injectors can evaluate wiring rules at runtime Multiple, different injectors can coexist in a single execution Scala supports typesafe Dependency Injection and there are even several ways to implement it. Possibly the most popular one is based on the cake-pattern, which leverages Scala’s self type annotations; yet again I couldn’t find an explanation of it that was crystal clear to me, so I decided to build my own. There are four distinct conceptual layers to this Scala DI implementation strategy …

Monads for Software Engineers

The term monad could sound weird to a software engineer because it comes from category theory. There’s plenty of related maths material around but let’s just forget about it and about the choice of that word (BTW am I the only one being triggered Leibniz memories from high-school philosophy classes?): I’m interested in a software engineering perspective on the topic and, since I couldn’t find an introductory one that was clear enough for me, I decided to take a dive in and build my own. What is a monad? Very, very shortly: a data structure implements a monad interface iff it defines some “lifted-up” functions sequencing operator (think of a functional “;“-like sequencing). So a monad itself is basically …

On Being “Functional”

There is more and more talk going on about functional programming nowadays; the paradigm is finally understood, accepted, implemented in most runtimes and used by many software engineers, in a more or less aware fashion (just think of JavaScript) and in a more or less hybrid form (just think of Scala). I say “finally” because functional programming has many useful properties, among which: It enables building and reusing components at the level of computation logic, which is a more fine-grained one than objects or modules. It enables a more declarative style that can reduce code size, enhance readability and improve maintainability. With its emphasis on pure functions, values and stateless logic, It helps reasoning and getting more aware about when state and …

Blazar: another pill to relieve Asyncmania

I’ve been ranting already about today’s non-thread-blocking needs (here: Efficient I/O: working smart with slow byte movers) and the fact that some of the most prominent runtimes (e.g. JVM…) lack support for fibers, causing everyone to shelter in asynchronous programming models instead of looking for ways to complement the runtime. Actually Ron Pressler has been writing about this issue quite extensively in Parallel Universe’s blog , for example a very fine post is Little’s Law, Scalability and Fault Tolerance: The OS is your bottleneck (and what you can do about it) but I warmly recommend reading everything in there as there’s a lot of insight and great architectural and even day-to-day suggestions are provided. Let me call this syndrome …

Computer Science, Information Technology, Software Engineering: what is this all about?

They’re different facets of the same constructive and creative discipline dealing with information flow: the mathematical study and literature, the technical knowledge and the actual designing and writing respectively. Information is a sequence of conventional signs that convey ideas; big amounts of information and dedicated machinery can be also used to encode, transmit and reproduce sensorial objects such as images, video and audio. So, information flow design is all about creating abstract worlds: playgrounds and tools for, and about, the abstract mind (or small mind as it is called in some traditions), which is the only one current computing machines can deal with fast enough for our needs. Being essentially constructive (it …

Words, facts and tea

Words and thoughts are conventional signs. They can help represent and share our own personal experience, our mind map. Of course they can be invaluable in practical daily matters, like for example counting things; still, we should avoid mistaking them for what they represent. When someone does something nice for us, be it preparing a tea when we’re cold or bringing a gift, we think “kindness”; nevertheless, the real “kindness” is not something asbtract beyond the facts but it is the action, it is the tea. Without action, without tea, there’s no “kindness”. When someone says: “let’s work together” what does it mean? It really depends. If it comes after teamwork, then …

Reality? There ain’t such stuff: science, art and spirituality melt back into creative living

You might know already a young, western-originated curious man’s practical reasoning discipline called “science”. Well, its “physics” offspring in its modern “quantum” dress is basically telling us, in a new disguise, a few key things that have been long known to several elder “mind sciences”, spiritual traditions or “ways”: The way we think about things (call it “model”) molds the reality we’re going to experience. This can be true to such an extent that when we setup experiments for one physical model about light’s behaviour, say the “particle” one, then for another incompatible model, say the “wave” one, we’ll get a “yes it matches” answer in both cases (I suggest reading, …

Efficient I/O: working smart with slow byte movers

These days I feel deeply puzzled with (not to say troubled by) a few aspects of our contemporary software architecture & development machinery. There’s a lot of gossiping going on about efficient runtime & programming models in the context of contemporary operating systems’ support for so-called “non-blocking I/O” (read: vert.x, node.js, netty & the like), which basically means “tell what you’re interested in and where, then I’ll call you back so you don’t have to stand up waiting for a slow guy like I am”. Actually, some smart people got the topic right in a clever way long time before this trend started to get hot: they are the Erlang guys. …

Goodbye Mac OS X, Welcome Arch Linux!

  Hi friend! Before you go on on please take a second to match a few statements with your profile for the benefit of your reading time. You: Do not own the latest and greatest filled-with-bells-and-whistles Apple machine and, most importantly, you don’t intend to, at all: there’s just enough garbage in this world and you’re dead-tired of producers that don’t take care of their product’s lifecycle in a planet-preserving fashion Are fed up with the latest Apple computer OSs and their puzzling resource black holes Can proudly assert that you’re not quite a technology illiterate but, on the other hand, you’d rather create than hack and don’t intend to spend …

Wordpress

How to Paint Dreamtime Circles: a Journey in Web Technologies

Once upon a time, there was a guy that loved writing. He loved anything related to writing: languages, alphabets, typefaces and he loved poetry as much as stories and scientific papers. He was into computers for a living and he was spending most of his day writing as well. So one day he told himself: “I love writing, so why not sharing my passion with others? I could create something and give it to people in addition to rely and enjoy other’s work”. He loved trees and he was into computers as we said, so the most natural, cheap, and paper-free way for him to start writing was obvious: creating …