sábado, 20 de octubre de 2018

Language as the Ultimate Weapon


Why is the 1984 novel by George Orwell relevant to a student taking the Programming Language course?, this is a question that can be answered using the article written by Jem Berkes, Language as the ultimate weapon in 1984.

The novel told us what happen today in the media, talking about the use of languages, we are manipulated subtly to a certain way of thought. A language is a social construct, but also a human thing, one thing that the novel and the article have in common is the Power concept.

Language is a very powerful weapon that can be better than torture because it can be continuously applied to the public without raising great public opposition or fear. Society is being bombarded with oppression without feeling it directly.
“Media is powerful as a tool for manipulation both because the public is widely exposed to it, and because the public trusts it”. (Berkey)

A comparison between the 1984 novel and the article is that in the novel there is a dystopian language called Newspeak where English is reduced to fool the nation so as to obey a party and just use certain words that might never affect them, and this is like a Lisp dialect, Clojure.
In an ordinary context, language is a weapon that can be used for good, in 1984 novel, Orwell shows us how it can also be used to control an entire society and make it think as we want to.

Now, trying to answer the main question I think that we are studying programming languages, and even if programming languages and natural languages are not the same, they have a great number of things in common. We expand our vision of programming and we understand easily implementations in languages beyond our knowledge. We must fight the ignorance imposed to us as the novel recommend us

sábado, 13 de octubre de 2018

The Roots of LISP


This article explained us that John McCarthy published a paper where he showed how, given a handful of simple operators and a notation for functions, you can build a whole programming language. Its name was Lisp (List processing).

The article shows us a definition for expressions, which is an atom, a sequence of letters, or a list of zero or more expressions, separated by whitespace and enclosed by parentheses.
If an expression is a list, we call the first element the operator and the remaining are called the arguments.

A Function contains atoms and expressions, where in a function call each expression is evaluated. Parameters can be used as operators in expressions as well as arguments.
Adding periods at the end distinguishes primitive function from those defined in terms of them and avoids clashes with existing Common Lisp functions.
We can define functions that concatenate lists, substitute one expression for another, etc. We can also write a function that acts as an interpreter for our language. It means a function that takes as an argument any Lisp expression and returns its value.

Using quote,atom,eq,car,cdr, cons, and cond we can define a function that actually implements our language, and then using that we can define any additional function we want.

If we want a language for describing algorithms, we might want something more abstract, and that was one of McCarthy´s aims in defining Lisp. Lisp does not have side effects, no sequential execution, no practical numbers, and dynamic scope. But these limitations are remedied with surprisingly little additional code.

In this paper, McCarthy´s falsity is represented by f, not the empty list. If we can understand the McCarthy´s eval, we understand more than just a stage in the history of languages. Lisp is not something that McCarthy designed so much as something he discovered




sábado, 6 de octubre de 2018

THE PROMISES OF FUNCTIONAL PROGRAMMING


This blog talks about the advantages of functional programming. It helps the reader to understand what makes Clojure language a powerful tool for parallelizing and dealing with concurrency.
 To use functional programming, we must compute functions, a mapping from input values to output values, the function returns the same output when given the same input and it´s only task is to return a value without side effects. As a function, does not change anything in memory, variables are not needed, this makes a great advantage because unlike traditional programming, you can trace the function call chain to know where a value came from.

Functional programming uses abstraction, so we can use a higher-order function as a result. This kind of functions uses another function as a parameter and return a function as a result, with these functions is easier to implement patterns that occur repeatedly inside an algorithm.
Clojure is a Lisp derivation, it is a functional in terms that it deals with the mathematical definition of a function, every new function defined by the opening of a parenthesis returns either a value, or another function.

Clojure uses recursion, and lazy sequences instead of typical loops to manage concurrency. It also talks about that we must make use of this kind of functional languages to take advantage from non-stopping technological world.

Concurrency and parallelism are gaining importance because single threaded performance is not improving as it used to, and computer hardware is getting more powerful and to take advantage of this power, concurrency and parallelism are to be used.
Concurrency is difficult to use because several threads need to coordinate to not use data at the same time to avoid errors in the result, this is currently solved by locks, semaphores, etc.
Functional programming offers regarding concurrency and parallelism, there is a long way until parallel programming is possible as it is imagined