lunes, 18 de abril de 2016

miniKanren

Chapter 6 of the book Seven More Languages in Seven Weeks written by Jack Moffitt talks about the magic you can do with logic programming. Literal the author refers to this paradigm as a kind of magic (much like Harry Potter), where we should not worry about the implementation details.

As I mentioned in previous posts, initially, it was a little difficult to me understand how to program in Clojure and everything related to the functional paradigm. Most programs are very short, since Clojure uses very few instructions unlike other languages like Java which codes are very extensive.

miniKanren is a family of programming languages for logic programming and provides a variety of functions that we can use to simplify our lives. Most of the examples that the author writes in the book are not so difficult to understand, however, I consider that you must have some knowledge base on functional programming.

At the beginning of the chapter, Jack Moffitt mentioned that we can spend a lifetime telling the computer what they should do, rather than this "imagine" (somehow) the solution to the problem, given the constraints and relations . Many times we can find programmers who have years of experience in the area, but his experience is based on the paradigms that are more common and that most programmers use, like Object Oriented.

From personal experience I can say that the learning curve of languages like Clojure is a bit steep as it gets us out of our comfort zone and makes us reason the problems of a different and much simpler (though not seems).

Finally, I think it is a good challenge to learn in just three days something new from this style because it helps us to improve our reasoning skills and increase the capacity of analysis.

0

martes, 22 de marzo de 2016

Language as the Ultimate Weapon


Why is the Nineteen Eighty-Four novel by George Orwell relevant to a student taking the Programming Language course?


Nineteen Eighty-Four is definitely one of my favorite books, I think that George Orwell imagined perfectly how human beings can be manipulated in a rather sophisticated way, what I mean is that not only through violence or torture can be broken a person.

The language is considered a tool of human communication, thus it is able to convey and express thoughts, feelings, ideas, etc. If the government decides to mold the people's thoughts, obviously he should start by language. The purpose of Newspeak was create a tool to limit freedom of thought, so that people could shorten most of his thoughts. The result of a poor vocabulary is that people would not have the ability to imagine acts of rebellion or fighting against the government.

George Orwell shows that language can be a powerful weapon against human consciousness. Just think how difficult is communication when we do not know another language, our ideas are not fully expressed and we feel that something is missing.

If we translate the novel to a programming environment, then we see that as programmers, we suffer directly what is know only one programming language and not being able to do many things, due the limitations of that language. However, we learn a new language each semester, so we expand our options and ability to solve problems.

It is important to know different languages to appreciate the differences and characteristics of each. Programming languages are used to communicate with the computer, which gives us great power to develop applications that will be used by many people.

Finally I can say that a student taking the course of programming languages must read Nineteen Eighty-Four to understand the great power of language in our lives. We began to think in different paradigms and although at first it is difficult, we got used to switch between different languages without limitations and we have more options when deciding what is best for coding an application.

References
Berkes, J. (2000). Language as the Ultimate Weapon. Retrieved March 22nd, 2016 from http://www.berkes.ca/archives/berkes_1984_language.html

0

lunes, 21 de marzo de 2016

Triumph of the Nerds Part III

Great artist steal

In this last part of the documentary it is possible to see the evolution of Apple and Microsoft and its battle to revolutionize the software and hardware industry.

Within this competition, we have IBM with the release of PC in the early 80s. In second place, Microsoft was positioned in the global market thanks to its DOS operating system, which was the main system for personal computers compatible with IBM PC. Finally, Apple gained popularity for its Apple II computer.

Xerox (the world's largest provider of photocopiers) made a big mistake by inviting Steve Jobs to the research center at Palo Alto, California. Probably the story would be different had it not been the case. Xerox was the first to introduce the concept of GUI and Steve Jobs stole and improved the idea. I do not want to detract from Steve Jobs work, since he was a great visionary that knew how to seize the opportunity and exploit it to the maximum to succeed. Thanks to his high quality standards we can see how the products of the company he founded are truly amazing, the aesthetic features make the difference with other products.

Good artist copy. Great artist steal

Regarding this phrase, I believe that the great inventions are created through the influence of the ideas we receive from our environment. The fact of copying an idea does not "benefit" anyone, since it is not adding anything of value. When an artist copy we found a lack of creativity, but when he rob, then he transform the idea into something new, something that belongs to him. I think that this is the same with the productos that are launched every year, between the same companies the features are copied and only add small differences, however, are not vital differences.

Obviously I disagree with the kind of practices that companies often come to have for the simple fact of wanting to position themselves above the competition. In this video we can see the thin line between copying and theft products, Xerox unfortunately lost the legal battle that he fought against Apple. Apple did the same with Microsoft, as saying that each new feature that he added was similar to the Mac, also the way it looked and felt the graphical interface was a copy.

Finally, the most interesting of the video is the tenacity that had both Steve Jobs and Bill Gates. I think a good entrepreneur is always looking for ways to innovate and not be left behind in what refers to technological advances. The good entrepeneur does not expect the launch of something new to try to reach the competition.

0

domingo, 13 de marzo de 2016

Rich Hickey on Clojure

In this new blog entry I will talk about the episode of Software Engineering Radio, which was a conversation with Rich Hickey, creator of the dialect of Lisp programming language called Clojure. In recent weeks I have been talking about the many advantages of programming in Clojure, but I had never heard the point of view of the creator.

The truth is that I really liked program in Clojure, as it makes the code much simpler. At first it cost me a lot of work the paradigm shift, because in other languages the result is many lines of code.

I must admit that before this course of Programming Languages, I had not heard anything about Lisp or Clojure. As the author says, certainly Lisp is not a mainstream language, since it was created for research purposes and only super-users or very smart people used it.

However, when the radio announcer asked to Rich what is the target audience of Clojure, Hickey simply answered: open-minded programmers. I can say that I totally agree with this statement, because you have to leave a little aside what we know about other languages. Usually we try to write programs in Clojure in the same way we would in C, but Clojure is part of a totally different paradigm.

Apart from the simplicity, Clojure has the advantage that its data structures are immutable, so it is a very good choice for concurrency.

Despite Clojure is no a very popular language, we know that startups have begun to occupy it because it gives them a competitive advantage (for more information see Beating the Averages), which I think is good because in this way goes up in the ranking of popularity and more and more people will discover (as I am doing <3) all things that can be done with Clojure.

Finally, I think it is good to know Clojure because we learn to appreciate some of its features that make our life easier.

0

sábado, 27 de febrero de 2016

The Promises of Functional Programming

The article written by Konrad Hinsen talks about the many advantages of functional programming, specifically focusing on the Clojure language, which as we know is a dialect of Lisp, it was designed for the Java Virtual Machine and supports concurrency without problem.

After several weeks of programming with Clojure, I think that it is a very interesting and different language to what I am used to. As the author of the article says, functional programming varies greatly from traditional or imperative (as many people refer). From experience I can say that it is shocking change imperative languages like Python, Java or C (which are the most I have used in my courses) to a language like Clojure.

Clojure has important differences as the fact the lack of variables, the reason is that the programs are composed of functions and they do not change the state of variables because they are used to map input values to output values. In this way, we can say that the functions are the core <3 of this type of paradigm.

Another important difference is the use of recursion as a substitute for loops. The first time I heard the concept of recursion I found it very interesting and challenging at the same time, because it invites you to think in a non-traditional way, ie, using the definition of the problem go calling it with smaller instances. At first it may seem strange solve problems that had never thought recursively in other languages, however with Clojure can be very easy to solve and written in a few lines of code.

Probably concurrency and parallelism are the most important advantages, since with the evolution of technology we should take advantage of the power that computers provide us, for that reason, functional programming is considered a promise, because being a technique different then there are no coherence issues in data.

In conclusion, I hope to go slowly discovering all the wonders of this language that everyone speaks and can be the next step in evolution.

0

domingo, 21 de febrero de 2016

Triumph of the Nerds Part II

Riding the Bear

In this second part of the documentary entitled "Riding the Bear" we can see the events that follow the Apple's creation by Steve Jobs and Steve Wozniak, which revolutionized the IT and software industry to enter the global market that generates millions of dollars each year.

One of the most interesting facts is IBM's entry into this market, the company that is known for being conservative and rigorous had to choose between an experienced computer PhD and a Harvard drop out, this latter person was the largest software provider in the industry and his name was Bill Gates. At Microsoft, Steve Ballmer and Bill Gates knew the importance of IBM's visit, since at that time were the largest company that dominated the market. Bill Gates always took advantage of the opportunities presented to him, so that might have helped the growth of the company.

IBM created something that revolutionized the world, however, there were soon other companies that would be its competition. Besides that, I think IBM is very focused on being a rigid and conservative company, always concerned about making high-level business unlike other younger and flexibles companies as Microsoft.

I think one of the reasons why Microsoft grew very quickly, is the great vision that Bill Gates has, so despite growing up in a wealthy family, he is an entrepreneur and would not give up so easily. Their need to meet the needs of adolescents and adults inspired much of his ideas.

It was easier to create a new culture with people who are fresh out of school rather than people who came from other companies and other cultures (Charles Simonyi, Chief Programmer at Microsoft)

Finally, I was very surprised by the comments of Bill Gates in the final minutes of the documentary. What he is trying to tell us is that we should not rely on the luck we have, because we do not know how durable our success, there is no guarantee in the software industry to always be number one, so we must be concerned for always be innovating and go away from our comfort zone.


References
Mitchell, J. [Jamila Mitchell]. (2015, may 21). Triumph of the Nerds Part 2. [Video file]. Retrieved from https://vimeo.com/124201870

0

domingo, 7 de febrero de 2016

Revenge of the Nerds

As I have said since January in this blog, we know that Lisp has several characteristics that make it a powerful programming language and not so easy to understand.

The article written (once again) by Paul Graham starts talking about that the programming languages are not equivalent to each other (as many would believe or think). As programmers we know that this statement is true, since not all were created for the same purpose, for example, Lisp was accidentally created as an alternative to the Turing Machine.

From a business standpoint (as well as in the "Beating the Averages" article), choosing a project's technology is not an easy decision, so we can not leave this decision to any person who:
  1. is not an expert in the area,
  2. does not have deep knowledge or
  3. is not updated in regard to the newest and most convenient approaches.

Although I've never programmed in Lisp I can understand the differences over other languages. I find interesting the idea that language is different to what I'm used and I turn away from my comfort zone, because the beginning is not so easy. I agree that it is a language that departs from the "conventional" so it can be so powerful, because every programmer implements its own data structures, macros, etc.

I share the idea -just as the author of the article- that in order to excel in the IT world, it is important to implement approaches that are not fashionable or that everyone uses. Notably obviously it seeks not to waste time and effort using a less powerful language.

Not in all projects matter the language used to program, however, is a decision that we must study carefully to get more sophisticated programs that solve hard problems.

0