jueves, 10 de noviembre de 2016

The Hitchhiker’s Guide to the Galaxy



Hi everyone, in this new and last blog post I will talk about the book that I read during this semester in the Compiler Design course. The book is titled The Hitchhiker's Guide to the Galaxy and was written by Douglas Adams in 1979.

The book begins with the arrival of a workmen at Arthur Dent's house in order to warn him that they are going to demolish his house to build a bypass. After a long negotiation Arthur's friend, Ford Prefect takes him to the nearest pub to tell him that the end of the world has arrived. That Thursday at lunchtime, the Earth is demolished to build a new hyperspace highway. Arthur flees from the Earth along with his friend in a ship that passes by the Earth. Ford Prefect, is not a human, but an alien who stayed on the planet longer than he should... Along with Zaphod Beeblebrox - the President of the Galaxy and semi-cousin of Ford -, a depressive robot named Marvin and a human woman whose name is Trillian, they will travel the galaxy in search of the legendary planet Magrathea...

The book did not become one of my favorite, but I found it very interesting and quick to read. The story is unusual, however, the way the author combines the personalities of the characters becomes fun. Although there are certain parts a little confusing, you want to know the end of the story.

I already knew the book, but I had not had the opportunity to read it and the truth is that I enjoyed the reading very much. I think it is a book for those who like science fiction and comedy. I recommend it totally, with the warning to be open minded and be willing to continue with the chapters although some of these are not fully understood.

Finally, I consider it a good cultural reference, since many of the situations faced by the protagonists of the book happen in real life on Earth, despite the fact that they encounter with aliens and in other planets.

The Answer to the Great Question... Of Life, the Universe and Everything... Is... Forty-two,' said Deep Thought, with infinite majesty and calm.
― Douglas Adams, The Hitchhiker's Guide to the Galaxy

martes, 1 de noviembre de 2016

Technical Overview of the CLR

Today I will talk about article that I just recently read, which is titled Technical Overview of the Common Language Runtime and was written by Erik Meijer and Jim Miller. Both worked at Microsoft and form important part of developing the Common Language Runtime (CLR).

Basically, 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 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.

Throughout the whole paper is shown as the CLI it is much more powerful than the JVM, and although I can not say for sure that it is true, I recommend reading the article so that each pose their own opinions and can see the benefits of using each one. Something that struck me is that the article was written in 2001, so today we are able to appreciate the advances that have been made in both the CLR and the Java Virtual Machine, each taking advantage of recent progress.

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.

sábado, 15 de octubre de 2016

Ruby and the Interpreter Pattern



Today, I will talk about the article Language Design and Implementation using Ruby and the Interpreter Pattern by Ariel Ortiz. The paper describes in detail the S-expression Interpreter Framework (SIF), which aims to implement this design pattern and show some programming styles.

Although the relationship of the paper's title with the Compiler Design course may seem distant (because not even Ruby is used in the subject as a programming language), I can say that if we remember a little of what Saumya Debray said about compilers is that we have to consider them as mere translators, so although they are not built in the traditional way, the interpreter pattern basically performs the same function.

The central idea of the framework is based on the following:
For any special form being defined, identify its syntax and semantics.
The syntax must be checked in the initialize method,
while the semantics must be implemented in the interpret method.

Within the phases of a compiler we have the Lexical Analysis in which through the use of a scanner the tokens are obtained and these represent a stream of characters converted into meaningful lexemes, then the Syntax Analysis uses a parser to check if the expression made by the tokens is syntactically correct and the Semantic phase checks whether the parse tree constructed follows the rules of language. On the other hand, the Interpreter Pattern provides a way to evaluate language grammar or expression. And so as we can see the relationship they have both.

I found it quite interesting using the framework as a simple way to translate simple expressions with a specific context. It is possible to treat expressions with a very particular syntax as Clojure using Ruby. We have the possibility to extend the functionality of the framework and design languages with more complex functionality that was seen in the examples.

Finally, I think that the notion of compilers extends to many areas such as the Software Architecture, plus they are seen as translators or interpreters greatly facilitates their understanding.

References

Ortiz, A. (2008). Language Design and Implementation using Ruby and the Interpreter Pattern. Webcem. Retrieved 16 October 2016, from http://webcem01.cem.itesm.mx:8005/publicaciones/sif.pdf

jueves, 6 de octubre de 2016

Compile-Time Metaprogramming



In this new post for my blog I will talk about the podcast I just heard which is titled Compile-Time Metaprogramming and Laurence Tratt was the special guest. He is a programmer and researcher of programming languages, so that explains the general idea of the topic using Converge.

Unlike the topics I discussed in the last blog posts, DSL (domain specific language) is not new to me, because in the course of Software Design and Architecture we did a programming practice using this design pattern. What I understand is that focuses on language design and allows you to adapt the syntax used to solve problems of any kind.

The main topic of the podcast is Compile-time metaprogramming. This feature allow the user of a programming language a mechanism to Interact with the compiler. Also it related to the creation of a "domain-specific language" which is a way to improve the programming language and perform a specific task. Lisp, Clojure and many other languages have something called a macro, which allows the compiler to be extended by user code.

Reading a little bit about description of macro-like functionality in Converge. Compile-Time Meta-Programming (CTMP) is described as the most powerful cousin of macros, because unlike traditional macros, Converge works at the abstract syntax tree level.

In conclusion, I believe that if macros are already considered as a highly powerful tool because they modify and adapt the language to our convenience, then to manipulate the abstract syntax tree, is working on a deeper level of the compiler, where it is created a temporary module that is compiled and then injected into what is running at the time. From what I understand, the abstract syntax tree is not only used to check the proper use of language elements but is built at compile time.

References

Guide to compile-time metaprogramming. (n.d) Converge. Retrieved 6 October 2016, from http://convergepl.org/documentation/2.0/ctmp/

jueves, 22 de septiembre de 2016

Mother of Compilers

Grace Hopper. (2016). S-media-cache-ak0.pinimg.com. Retrieved 22 September 2016, from https://s-media-cache-ak0.pinimg.com/236x/3e/c1/4b/3ec14b7411cc9c9d395e236223ac595f.jpg



In this new blog post I will talk about Grace Hopper, the Queen of Code. Although Ada Lovelace is often consider the first programmer in history, Grace is part of an important group of IT women who changed the world completely.

Both the article Grace Hopper - The Mother of Cobol and the video documentary The Queen Of Code (directed by Gillian Jacobs) tell us how she started in the world of computer science and all their contributions to this science. The Grace Hopper case is not fortuitous, since a very early age she began to show curiosity about technology, so that led her to study mathematics and physics at Vassar College in New York.

It should be kept in mind that it was not common at that time that women were developed in fields of study where men predominated. However, with the onset of World War II many opportunities for women were opened and they began to be more involved in different areas, where important discoveries and progress were made.

With a PhD in mathematics from Yale University it was evident that Grace was more than qualified not only to teach, but also to assist her country in its wartime challenges; thus, she decided to join to armed forces where after her training she was assigned to a project at Harvard next to Howard Aiken, chief engineer of computer Mark I.

It was during her stay in that place that she realized that computers have great potential, which was not taking full advantage since the calculations took a long time. It also raises the need to create high-level languages, so that language is independent of the architecture where running. Thus compilers were born.

In addition to the technical contributions that he made, I think Grace Hopper is a role model because she urged the young generations to take risks and try everything they propose.

The most important thing I've accomplished, other than building the compiler, is training young people. They come to me, you know, and say, 'Do you think we can do this?' I say, "Try it." And I back 'em up. They need that. I keep track of them as they get older and I stir 'em up at intervals so they don't forget to take chances.

References

HSTRY for Education. (2016). Edu.hstry.co. Retrieved 22 September 2016, from https://edu.hstry.co/item/30027

jueves, 1 de septiembre de 2016

Internals of GCC

GCC compiler. (n.d.). Itjungle.com. Retrieved September 1 2016, from http://www.itjungle.com/tfh/tfh101415-story01-fig01.png


Today I will talk about the episode entitled Internals of GCC I heard in the Software Engineering Radio. Morgan Deters was the guest of that day in order to talk about some issues of compilers, for example, why are relevant? how compilers work? among other things.

In 2007, the year it was recorded that episode, Morgan Deters was still a phd student at the University of Washington and had extensive experience in programming languages area, compilers, optimization and everything related to these issues, unfortunately he passed away a year ago.

Continuing the theme of the episode, Morgan Deters tells us that GCC is a compiler for C, C ++, Objective C and Fortran; which is capable of receiving a source program in any of these languages and generate a binary executable program in the machine language which is to run. Also he mentioned that GCC is flexible and can run on any platform, supports different architectures and most importantly produce effective code. Internally GCC is modular. GCC has a structure which is divided into three parts: front, middle and back end, I think where code optimization is done is the most powerful phase of the compiler, since you can significantly improve the running time of the target program.

In conclusion, compilers are relevant and interesting, because they help an efficient implementation of our programs. When programming languages implement new features, compilers must meet these demands, however, should not only be updated to function properly, but also to get the full potential of hardware capabilities. Basically compilers should be able to translate an indeterminate number of programs, at the same time it evaluates whether it can be optimized. The compiler must make a balance between the time it takes to build and how long the program will run, ie how long take the phase to complete and whether it will produce efficient code.

jueves, 25 de agosto de 2016

The Hundred-Year Language

5 Most Popular Programming Languages You Must Learn in 2015. (2016). Eduonix.com. Retrieved 25 August 2016,
from https://www.eduonix.com/blog/wp-content/uploads/2015/04/15-Most-Popular-Programming-Languages-You-Must-Learn-in-2015.png


In this blog post I will talk about a future vision about programming languages. As we know, evolution is an inevitable change that all things in the world suffer. If we focus on a technological aspect, there is a marked difference between hardware and software, we can see that for the entire collection of physical elements that constitutes a computer system has been significant changes making machines faster and more efficient, however, programming languages (used to control logical aspects and physicists) have had a slower progression.

The author explains that programming languages are not related to technology, but these can be seen as a set of symbols and syntactic and semantic rules that allow communication with the computer. The same happens in the real world, mathematical notation and even each of the languages are not transformed over the years very significantly.

Although it is impossible to predict the future, it is possible to see trends in the world today and make an approximation of what the world will be in a hundred years. The trend is that languages are disappearing as the years pass, and new languages are emerging with features that take advantage of their ancestors and implement others that become the most powerful. However, how to program in a long time cannot be the same as now, despite the fact that there are very fast machines, its capacity will be wasted if we do not change the way we do things.

Will we even be writing programs in a hundred years? Won't we just tell computers what we want them to do? (The Hundred-Year Language, 2016)

Advances in parallel computing machines have allowed increase their potential like never before, however, much greater effort is needed by programmers and researchers to create a language that is richer in abstraction without taking up complex expressions. Finally, I believe that both parties can contribute significant elements in this development because programmers are who use them and researchers have expertise in computer science area.

References

The Hundred-Year Language. (2016). Paulgraham.com. Retrieved 26 August 2016, from http://www.paulgraham.com/hundred.html

jueves, 18 de agosto de 2016

Making Compiler Design Relevant for Students

Term-Compiler. S3.amazonaws.com. Retrieved 18 August 2016,
from http://s3.amazonaws.com/media.skillcrush.com/skillcrush/wp-content/uploads/2012/06/term-compiler.jpg


The article Making Compiler Design Relevant for Studentes written by Saumya Debray I found it very interesting as it explains very simply the definition of a compiler so anyone in the world be able to understand what a compiler is, also the author talks about the importance that represents design one of these.

Debray mentions that the student experience in the design of compilers is zero, and the truth is that I agree with that statement. Since the beginning of the career, the subject of compilers is mentioned, however, until after several semesters most of us had a more specific idea of the aims of the matter.

Throughout my reading I realized what a compiler represents, the author just need to start by saying that the idea is to consider a compiler a simple translator. Based on this idea of a translator, you can better understand the phases that needs execute to obtain a result.

Probably, we have more idea of do a compiler of what we believe, for example, the initial phase called Lexical Analysis and Parsing is related to the use of finite state machines to specify the structure of tokens through regular expressions. Although in the past we learned automata, now we know another practical use in computer science. Then in the next phase of Semantic Analysis these tokens are ordered to disseminate information and visualize the flow that follows. After, as the name implies, the phase of Code Generation turns out in a program written in assembly language or a language that is understandable to the machine, and the last phase of Optimization aims to make programs more efficient.

In conclusion, we note that no complex definitions are required to explain compiler design and understand the objectives that aims. It is obviously not same explain what a compiler that program one, however, if we start from a good base of understanding of what we make, we will be able to continue without many problems.

jueves, 11 de agosto de 2016

About me


Hi! My name is Miryam Elizabeth. My expectations for this course are understand how programming languages work and be able to design a compiler applying what I learn in class.

My hobbies are reading, watching movies or series and listening music. I like to play frisbee and go to the movie theater. The books that I read in the summer are One Thousand and One Nights and The Devil's Violin by Joseph Gelinek.

TV programs that I have recently enjoyed:
  • Pretty Little Liars
  • Friends

Singers and bands that I like:
  • Josh Groban
  • David Garret
  • Katy Perry
  • Within Temptation
  • Amaranthe

That's all folks! :)