Record of experiments, readings, links, videos and other things that I find on the long road.
Registro de experimentos, lecturas, links, vídeos y otras cosas que voy encontrando en el largo camino.
Showing posts with label Programming Languages. Show all posts
Showing posts with label Programming Languages. Show all posts
Monday, October 3, 2016
Interesting Interview: "Objects, Functions, Virtual Machines, IDEs and More"
I've just watched this very interesting interview with Dave Thomas and Erik Meijer
Sunday, August 10, 2014
Some home-made implementations of map
This post originated in a conversation we had during the last Barcelona Software Craftsmanship event.
We talked about a technique to recursively processing list elements once at a time in which you have to focus on two things:
It uses the following list functions:
We can use a similar approach to write map in Racket:
Here the name of the functions are a bit more expressive: first, rest and empty?.
The cons function adds an element at the beginning of a list.
A more idiomatic way to write map in SML would be using pattern matching:
This version is using the same approach but pattern matching makes the code more concise and expressive.
As a bonus here is a beautiful way to append two lists in SML using the same technique and pattern matching:
This is very well explained in the first unit of of the Programming Languages course from Washington University at Coursera that I completed last year.
There is going to be a new edition starting up Oct 2. I cannot recommend it highly enough.
We talked about a technique to recursively processing list elements once at a time in which you have to focus on two things:
- How to process an empty list (the base case of the recursion)
- How to process a non empty list in terms of the result of processing the tail of the list (the list except the first element)
It uses the following list functions:
- hd to extract the head of the list (its first element)
- tl to extract the tail of the list (the list except the first element)
- null that returns true if the list is empty and false otherwise
We can use a similar approach to write map in Racket:
Here the name of the functions are a bit more expressive: first, rest and empty?.
The cons function adds an element at the beginning of a list.
A more idiomatic way to write map in SML would be using pattern matching:
This version is using the same approach but pattern matching makes the code more concise and expressive.
As a bonus here is a beautiful way to append two lists in SML using the same technique and pattern matching:
This is very well explained in the first unit of of the Programming Languages course from Washington University at Coursera that I completed last year.
There is going to be a new edition starting up Oct 2. I cannot recommend it highly enough.
Monday, January 6, 2014
Interesting Talk: "Ground Control to Major Tom (Notes On Control)"
I've just watched this interesting talk by David Nolen:
He talks about how different approaches to control in programming languages can make simplicity or complexity arise.
He talks about how different approaches to control in programming languages can make simplicity or complexity arise.
Subscribe to:
Posts (Atom)