lunes, 18 de abril de 2016

Logic Programming

Day 1: Unified Theories of Code
Three days is all we have to get you using logic productively, but because core.logic is embedded in Clojure, the more familiar functional programming is always nearby to help.

On the first day we’ll learn about unification and the basic logic operations. We’ll build a database of facts and see how core.logic can reason about them. Finally we’ll take a peek at conditionals in logic.

Logic programs are like puzzles where only some information is given and the solution to the puzzle is to find the rest of the information. Imagine a Sudoku square where at the start of the puzzle only the rules and a few numbers are known. Or think of a jigsaw puzzle, where only pieces of the picture and shapes are visible.

Programming with logic means providing some starting data and the rules of the puzzle. Core.logic does the actual work of solving the puzzle and provides the resulting solutions.

Day 2: Mixing the Logical and Functional
Day 2 will add some pattern matching and other macro sugar to the previous day’s topics. We’ll see how to unify and work with maps as well.

 common feature of functional programming languages is pattern matching, and while Clojure has a limited form of this feature in its destructuring syntax, there are libraries that provide powerful pattern matching macros. David Nolen, who wrote core.logic, also wrote core.match, one of the best of these pattern matching macros, and it should come as no surprise that core.logic has pattern matching built in.

The languages you are probably familiar with have a single kind of conditional. Tests are run in order and whichever test passes, the code for the corresponding branch is run. It may surprise you to learn that core.logic has multiple types of conditionals. You saw the first of these, conde, yesterday, but now we’ll learn about two more, conda and condu.

Day 3: Writing Stories with Logic
Finally, on the last day we’ll wrap up by learning about finite domains. By then you’ll be ready for some more complex examples too.
Logic programming is implemented behind the scenes with directed search algorithms. You specify constraints and the language searches for solutions that satisfy the criteria.

Referencias: 
- “Seven More Languages in Seven Weeks” by Jack Moffitt.

sábado, 26 de marzo de 2016

Triumph of the Nerds Part III: Great Artists Steal

"Triumph of the Nerds Part III: Great Artists Steal" is a documental created in 1996 which premise is exactly the creation of the GUI and how this change the world of the computation forever. Now, the documental is mainly about the creation of the concept of GUI which originally was first created for Xerox and later was a concept that Apple took (by inspiration of Xerox) in order to implement a GUI in their inventions, being the Apple Macintosh the best invention that used the GUI created by Apple in that time, telling us that Apple had as "killer software" in that time, a software created by Adobe which gave to the company fame of create hardware dedicated for the computer artists, but that unfortunately wasn't enough to ensure the domain of the competition of Apple in the 90's because all of this was affected by the creation of Windows, the most popular GUI in the history of the computation, which was created for being used in the IBM computers, the most popular computers in the 90's, which turned Microsoft in the powerful company that nowadays is and the strongest competitor for Apple till the date.

Now, the GUI was really the difference that change the world of the computers for good and made that the computers were the great success that are nowadays, because nowadays all the computer systems from PCs to tablets use GUI's for everything doing possible that the use of the applications be more friendly and intuitive to use for anyone.

With this documental we can see that it doesn't matter if you are the first one to have a potential idea just like XEROX did, because if you don't take advantage of it, you will lose against other rivals that see your idea or also have the idea and do take advantage of it just like Apple or Microsoft.

If you are interested in watching this vides: here's the link: Triumph of the Nerds Part III: Great Artists Steal.

Language as the “Ultimate Weapon” in Nineteen Eighty-Four

The article "Language as the 'Ultimate Weapon' in Nineteen Eighty-Four" written by Jem Berkes tell us that in this novel a very important weapon that the government use to control the society is the language because this important tool that the people use to express their ideas is the one that allows us as humans think and express freely about all the things and situations that take place in our lives, the ones that can be positive for us and for the other people and also the negatives, the latter being very destructive for the government in the "1984" novel because the government here have to be praised and never judged.

Jem Berkes (2000) says in his article that the language is something that allows us as humans communicate our ideas in different ways, characteristic that is very beneficent for us because this help us to think in a more free and creative way, this being supported by Myers (1986) who said that "expanding our language is expanding the ability to think" and that "different languages impose different conceptions of reality", ideas that are clearly logic because between more words and ways to express we have, more ways of thinking and reason the situations we can use in order to attach the idea in a clearly and existent way that other people can understand easily. 

Like O’Brien say "People can't commit crimes if there's not a world or concept who describe it". We need words in order to imagine and create new things.

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

The novel is the perfect counterexample of our reality speaking of programming languages. Imagine you want to solve a problem which use an object oriented approach and there's only ONE programming language to use, not a very rich one, and it is also a functional language. Then you are in problems, that's why the variety in languages is important so you can express anything you want in the best way possible.

If you're interested in reading this article: here's the link: Language as the “Ultimate Weapon” in Nineteen Eighty-Four.

If you're interested in reading George Orwell's: 1984's novel, here's the link: Nineteen Eighty-Four.

martes, 15 de marzo de 2016

Rich Hickey on Clojure

Rich Hickey is the creator of the Clojure programming language and in the podcast "Rich Hickey on Clojure" produced by Software Engineering Radio in the year 2010, he precisely talks about what is the main differences between his programming language and the rest of the languages that are based on Lisp, telling to the audience the benefits that Clojure has and also how Clojure can be a good tool in the world of programming thanks to its particular characteristics. 

Clojure is a dynamic program language for the VJM that between his attributes has inmutability and pure functions with a functional focus and concurrency which makes of Clojure a good option for the parallel programming, also this programming language has data literals as lists, maps and vectors contrasting with the single use of the nested lists in Lisp, which is a great characteristic that in the world of the Lisp makes Clojure a alternative with many options to choose. 

Also, Clojure as a Lisp language programming have the characteristic of  "programming in metaprogramming" which makes Clojure a different language type to use in situations like for example as scientists or researcher which makes Clojure a good element for the singular use and not for mainstream activities. In the case of Clojure, the target public can be the ordinary programmers that works with Java or C++ because in the core Clojure is more simpler and powerful that Java. This can be false because in my opinion Java is more easy to use because it have more tools which as a programmer can use in a more easy way because Java is more easy to learn if you are used to program declarative languages but maybe everything is a situation of get better with practice and Clojure can be a good example of this if as a programmers we can learn to use this language.

Another characteristic of Clojure is that it permits the use of libraries that can do the work more easy with the different data structures that Clojure allow to use which is a great because with these libraries the use of lists and collections is more easy to implement and also a very important characteristic of Clojure is that with in this tool the values don't change because the data structures are immutable and this makes that the data structure has a great performance warranty because this characteristic makes possible that the values don't have to be locked and with this the language can be used in situations where the concurrence and parallelism programation is important. 

All the previous information is a small sample of the power that Clojure can offer to the programmers that search a new way of programming and more if this new way includes concurrent programming that make use of the data structures as lists which handling is more easy to do with a Lisp programming language. 

domingo, 28 de febrero de 2016

The Promises of Functional Programming

Doing for the first time a program is an activity that in many cases can be very difficult for some people, all of this depending on which is the problem that the program is trying to solve and which is the language that the programmer is using to create the solution because the truth is that the language in this case can be the difference between have a good experience in the programming or to have a nightmare trying to solve a problem that is not really difficult in itself but that the language doesn't allowed you to solve it in an easy way. Now the language despite of being different to the other languages, specially the most popular languages like Java or Python, share an important characteristic between them that is that they belong to the family of "imperative programming " instead of the family of the "functional programming". 

The "functional programming" as Hinsen says in his article is a form of programming that allows to write a program using functions, like the mathematical expression, which change the way in which most of the programmers know how to do a program, all of this because the "functional programming" have characteristics like the absence of variables or loops and the extremely use of the recursion which makes the activity of programming with a functional language a task that involves a high learning curve and a different way of thinking, different of how the "imperative world" works. 

Now, like we programmers can say that if "functional programming" is not very popular in the industry it is not necessary to learn how to manage the tools of this form of programming which maybe can be a huge mistake because in the present the technology has advanced so fast that the same has created forms in which a program can be executed talking about the parallelism and concurrence programming which is an application area that the "functional programming" serves very well and for the same is important that as a programmers give to this way of thinking and programming a chance because in the technology world anything have an static position.

In functional programming it is common to write functions that take functions an parameters and yet return another function, they are called high-order functions.

The article then talks us about concurrency and parallelism. The big issue with concurrency is the difficulty of maintaining the data in a coherent state. And for parallelism the difficulties are to identify independent computations inside a program and coordinating them with the required communication operations so that the resulting program always produces the correct result and does this efficiently for typical input parameters.

If you're interested in reading this article, here is the link: The Promises of Functional Programming.

domingo, 21 de febrero de 2016

Triumph of the Nerds Part II

The second part of the documentary "The triumph of the nerds" talks about the fight that all the computer companies had to remain at the top of the food chain, an example of this is IBM, that at the time were mostly focused on the creation of mainframes, but at the time the boom was the personal computer so if they took more time they were going to lose a lot of ground that they could not get back.

After seeing "Triumph of the Nerds Part II" and knowing the history between IBM and Microsoft, its very amazing see that thanks to the disruption between IBM and Microsoft caused for the discussion related with the OS of IBM computers (where IBM doesn't want to use "Windows" like instead of its own OS called "OS/2") IBM went of the glory to the hell which proof that the PC world is not an easy context for the business thanks to the velocity in which this context changes with technological advances that are presented faster and faster.

Its not a surprise that Microsoft is a giant in the IT industry in our days where this company covers since software development to hardware development all of this thanks to the "good" decisions that the company has made over the time and its important to mention that all this decisions were unleashed since the company discovered that the software is the essential tool for a PC because the software and specially a good OS can be the difference between a computer that is easy to use for the average person and a computer that is hard to use which is synonym of a failure in all the aspects.

This was a very interesting episode to watch because of all the information and history background that we learned from it, all the decisions that have lead the market to what it is today and all the repercussions of the proposals that were rejected and the individuals that after learning what could have been are most likely crying themselves to sleep every night. Further confirming the idea that in the computer and software industry (or world if you may), you don't only need the idea, but you also need to have the necessary means and the drive to implement them, because otherwise you will have to watch as the competition steals all the glory (and the moneys), as you get to be forgotten as a mere whisper in the wind without any other thing that a mention on a documentary in years to come (only to be forgotten later).

If you are interested in watching this video, here is the link: Triumph of the Nerds Part II

martes, 9 de febrero de 2016

Revenge of the Nerds

Nowadays, when we talk about the different programming languages that exist in the market for different purposes is inevitable thinking in more than a couple of options that we like programmers can use to solve the same problem with the tools that the language in that moment is offering us. Now, like Paul Graham says in his article called "Revenge of the Nerds", is truth that some languages are better for certain problems than others, all of this because some of these languages can bring to us like programmers a set of many tools or exclusive characteristics that can handle the solution for the same problem in a better way, which can be a solution that is more direct, optimal and efficient than the others solutions that can be reached with the other languages. 

Supporting in a certain way the point of view that Graham express in his article, is amazing that in the industry world where the majority of the actual students of IT engineering careers want to work exist people called the "pointy-haired boss" that decide what is the best technology and language that a team can use to build a project when this person doesn't know how the world of technology is really changing outside and how all the tools that are available in the market work, because the decisions that this "boss" is taking is inspired in what is mainstream in the moment, not the best option in all the cases. 

The previous can make us think that Lisp, in this case, can be the optimal tool to reach the solutions for many problems that exist outside in a better way, being this an alternative that may be very difficult to see because this language (despite of having characteristics that are implemented in many popular languages like Java, Python or Pearl) doesn't enjoy the same level of popularity that other languages have, which makes it unable to be a realistic option for the "pointy-haired boss" because this language doesn't have the same support in the industry that the other options thanks to its "low level of popularity" and as a personal opinion, our obligation as new IT professionals should be break down this obstacles taking risks in the moment when we have to choose a tool to develop something as Graham says "using the most powerful language that exist for our problem and wait for our competitors' pointy-haired bosses to revert to the mean" doing with this action a positive change in the industry generating more ways in which the IT specialists can find and develop new tools and solutions that can be the future breakpoint in the industry.

What I learned here is that despite what the bosses say, when we are startups, always design the products to please the users, not them, because in the end, the users are the ones who are gonna buy them. Also always try to use more powerful languages to get shorter programs, and with that you will reduce the time it takes to write it. This also helps us when resolving too complicated programs.


If you're interested in reading this article, here is the link: Revenge of the Nerds.