sábado, 12 de noviembre de 2016

The Hitchhiker’s Guide to the Galaxy


"I refuse to prove that I exist," says God, "for proof denies faith, and without faith I am nothing."
"But," says Man, "the Babel fish is a dead giveaway, isn't it? It could not have evolved by chance. It proves that You exist, and so therefore, by Your own arguments, You don't. QED"
"Oh dear," says God, "I hadn't thought of that," and promptly vanishes in a puff of logic.
"Oh, that was easy," says Man, and for an encore goes on to prove that black is white and gets himself killed on the next zebra crossing.

Throughout the Compilers Design course we've been reading the Hitchhiker's Guide to the Galaxy by Douglas Adams. I found the book quite interesting because I've listen to several references of this book in many sci-fi TV Series.

The story goes around Arthur Dent who happened to be the only earthling left after Earth's destruction by the Vogons, with the help of  Ford Prefect he manages to scape and his journey begins.

He meets Zaphod Beeblebrox aka The President of the Galaxy which goal is to find Magrathea, an ancient planet which build custom planets. In the way to this planet it is revealed that there was a machine millions of years ago which was supposed to give the ultimate answer to the universe. When the time has come the machines gives the result which happen to be 42. The machine "Deep-thought" explains that they don't know how to interpret the the answer because they never knew the question, so it prints the plains to build a new machine that can give the question to the given answer. this machine turns out to be the Earth, but ironically was destroyed seconds before it gave the question.

Eventually they found Magrathea and discover they're rebuilding planet Earth, but since one earthling continues alive, they can dissect his brain and get the questions, forcing them to flee.

In general it was a good book, but I wasn't expecting it to be comic. I understand why it is so popular in the sci-fi universes, it has a lot of important elements in the space story-telling like ships and aliens which ironically happen to be similar to us.

Technical Overview of the CLR

This week article was written by Erik Meijer and Jim Miller. Both worked at Microsoft and form important part of developing the Common Language Runtime (CLR).

The text compares some of the things offered by the Common Language Infrastructure(CLI) with the Java Virtual Machine (JVM). The main difference is that the CLI is a platform that supports a wide range of languages. Microsoft developers work closely with the implementers of these languages so that programs compiled efficiently and smoothly.

The CLI has a lot of primitive types which makes it powerful and very flexible. There are a lot of instructions available to modify and manage the evaluation and argument stack. You can do arithmentic operations, reference alterations to build for example a swap function, reference types and also value types. Something interesting is that it is mentioned in the article that one important feature is the tailcall function in order to support languages that only have recursion as a method for looping.

I consider important to take into account the functionality offered by both the JVM and the CLR of .NET when implementing a programming language, because if it is object oriented, obviously should the JVM is better and for imperatives paradigms the CLR.

The architecture that makes up the CLI are the instruction pointer, the evaluation stack, an array of the local variables, local memory pool, among other things. The CLI easily manages multiple concurrent threads, which can be seen as a list of stack frames. Also, the CLI handles different types of data, that is, has a set of primitives which in turn can be combined with different types of constructors allowing the size value be mapped. The natural size has more benefits on how the JVM defines the storage locations, because 64-bit formats occupy two locations.

If you are interested in reading this article, here's the link: Technical Overview of the CLR.