Those that follow my twitter @sadache , me @infoQ or my blog have certainly already noticed that I am quite interested in Scala on languages’ axis and in Domain Context Interaction DCI pattern on architecture axis. I always search new ways for delivering quality code which is modular and concise. Modularity offers the opportunity to think about the problem in parts, which is typical of the way brains work, whereas conciseness makes use of imaginary system (reading code blocks like images).
Recently, I’ve been working on a Web Api system where, thanks to support of @jeanlaurent http://morlhon.net/blog/, I used Scala applying DCI architecture in a real world project. This post is about reporting benefits of using this approach. Other posts will follow that will be more focused on the use of Scala and Functional Programming in that project. Code included is a bit simplified and parts of the system that are not of interest are omitted.
(more…)
from Rich Hickey on Clojure’s Features and Implementation
Clojure multimethods are just another level of that same logic, in fact they are a realization of the last sentence I just said. They are dispatch based upon an arbitrary function of the arguments. You define a multimethod and you say “Here is a function of the arguments I’d like you to use” You could look at the first argument, you could look at the 5th, you could look at all of them, you could look inside them, some member of an argument, it could look at the types or not or the values. Now, you could look at relationships between arguments, you have dispatch based upon an arbitrary function of the arguments and you have a vastly wider set of polymorphic possibilities than you had before and it’s quite powerful. In particular, it allows you to do Runtime dispatch on Runtime attributes. You don’t usually represent something like being hungry as part of something’s type, it’s some attribute that it acquires while the program is running or being outdated or things like that. Now you can access those things and you can do things polymorphically based upon that and take a lot of switch statements out of your code.
Should I call it first class Pattern Matching? or Pattern Matching in disguise?
A great discussion I had with Don Syme at QCon SF. Don is one of the heroes to thank for .Net generics and he is a major contributor to F# design, Thanks Don!
http://www.infoq.com/interviews/F-Sharp-Don-Syme
In the beginning of last year, Ehud Lamm launched on Lamba the Ultimate a thread about programming languages predictions for 2008. Several subjects popped up: concurrency, functional programming, future of Java, Ruby, C++, and many others… What really happened in 2008 and what are the prospects for 2009? Bloggers have addressed these questions on demand of James Iry, echoing at last year thread.
(more…)
In the rapidly spanning world of programming languages, I find myself buying and reading a lot of books about new and old programming languages. There are a few interesting concepts in each language, and if you think about employing more than one language in your projects then you better know about the existence of these concepts (see Paradigm based Polyglot Programming).
One thing that annoys me though about most programming language books is how raw they often are.
(more…)
Programming languages that offer more power and flexibility have been lately gaining momentum. Johnatan Tang highlights, however, the flexibility vs. productivity tradeoff in terms of program structure. Whereas multi-dispatch languages provide more flexibility in arranging code, traditional object orientation makes organizing programs easier.
(more…)
Having worked with several Object-Relational mapping frameworks in the last few years, I got to a point where I couldn’t justify their complexity in my project. We often talk about the mismatch between the database and the object worlds, and that is where ORMs are often stated and referenced for “bridging the gap”!
Well I prefer to call it lifting the gap, or highering the gap, to have it now between DAOs and the rest of the code than having it between database and code.But I wouldn’t call this in any way reducing the gap.
(more…)
This is an interview I did at QCon with Ted Neward. Talking to Ted was very interesting even though arguing with him turned to be not easy at all :)
Erlang virtual machine – BEAM – hosts an increasing number of languages. Reia, a Python/Ruby like scripting language and Lisp Flavoured Erlang have recently been released. Debasish Ghosh reflects on this trend while other authors try to outline other possible language variants inspired by Ruby or Haskell.
(more…)
How many languages are you using on the same project? If you go counting you will see that they are many. I mean XML, Java, XSLT, HTML, CSS… etc. But the reason why you are using almost all of them is that they happen to be mainstream and, oftentimes, they are the only language choice for a needed framework. You are actually almost obliged to use them. The choice is done for you. Style? CSS. Configuration? Often XML. Web interface description? Html. However, if you want to adopt true polyglot programming, you will have to face inevitable decision of language choice.
(more…)