Newer posts are loading.
You are at the newest post.
Click here to check if anything new just came in.

February 08 2013

Distributed resilience with functional programming

Functional programming has a long and distinguished heritage of great work — that was only used by a small group of programmers. In a world dominated by individual computers running single processors, the extra cost of thinking functionally limited its appeal. Lately, as more projects require distributed systems that must always be available, functional programming approaches suddenly look a lot more appealing.

Steve Vinoski, an architect at Basho Technologies, has been working with distributed systems and complex projects for a long time, first as a tentative explorer and then leaping across to Erlang when it seemed right. Seventeen years as a columnist on C, C++, and functional languages have given him a unique viewpoint on how developers and companies are deciding whether and how to take the plunge.

Highlights from our recent interview include:

  • From CORBA/C++ to Erlang — “Every time I looked at it, it seemed to have an answer.” [Discussed at the 3:14 mark]
  • Everything old is new again — “Seeing people accidentally or by having to work through the problems, stumbling upon these old research papers and old ideas.” [7:20]
  • Erlang is not hugely fast — “It’s more for control, not for data streaming.” [16:58]
  • Webmachine — “[It's what you would get] If you took HTTP and made a flowchart of it … and then implement that flowchart.” [23:50]

  • Is Erlang syntax a barrier? [28:39]

Even if functional programming isn’t something you want to do now, keep an eye on it: there’s a lot more coming. There are many options besides Erlang, too!

You can view the entire conversation in the following video:

Related:

July 12 2011

Four short links: 12 July 2011

  1. Slopegraphs -- a nifty Tufte visualization which conveys rank, value, and delta over time. Includes pointers to how to make them, and guidelines for when and how they work. (via Avi Bryant)
  2. Ask Me Anything: A Technical Lead on the Google+ Team -- lots of juicy details about technology and dev process. A couple nifty tricks we do: we use the HTML5 History API to maintain pretty-looking URLs even though it's an AJAX app (falling back on hash-fragments for older browsers); and we often render our Closure templates server-side so the page renders before any JavaScript is loaded, then the JavaScript finds the right DOM nodes and hooks up event handlers, etc. to make it responsive (as a result, if you're on a slow connection and you click on stuff really fast, you may notice a lag before it does anything, but luckily most people don't run into this in practice). (via Nahum Wild)
  3. scalang (github) -- a Scala wrapper that makes it easy to interface with Erlang, so you can use two hipster-compliant built-to-scale technologies in the same project. (via Justin Sheehy)
  4. Madlib -- an open-source library for scalable in-database analytics. It provides data-parallel implementations of mathematical, statistical and machine learning methods for structured and unstructured data. (via Mike Loukides)

June 28 2011

Clojure: Lisp meets Java, with a side of Erlang

ClojureClojure seems to be the hot new language of the moment, attracting both Java developers and hackers who remember Lisp with fond memories. To see what all the buzz was about, I talked to Stuart Sierra (@stuartsierra), a Clojure developer and author of "Practical Clojure." Sierra will be speaking about Clojure in next month's OSCON Java track.

What is Clojure? How does it differ from functional languages like Erlang?

Stuart SierraStuart Sierra: Clojure is a new programming language that runs on the Java Virtual Machine. It's in the Lisp family of languages and it's a general purpose language, but it emphasizes a functional programming style with tools to manage shared state in large multi-threaded programs.

It's similar to Erlang with its emphasis on functional programming, but whereas Erlang is designed for systems distributed across many machines, Clojure focuses on many threads within a single machine. Erlang is trying to solve the very difficult problem of making everything parellelizable across multiple machines. Clojure is doing something different. It's trying to make sure that many threads in the same machine can safely share state.

How similar is Clojure to the syntax of traditional Lisp-like languages?

Stuart Sierra: Clojure is probably a little bit closer to Common Lisp than Scheme in style. It would not be particularly difficult for someone with Lisp experience to pick it up, although they would have to learn about some of the differences in the syntax. Clojure has a little bit more syntax than Common Lisp or Scheme, so it's actually a little easier to read and it has fewer parentheses than Lisp-like languages typically do. We've done examples where we put Java code and the equivalent Clojure code side-by-side and there are the same number or fewer parenthesis in the Clojure code because it's so much shorter.

OSCON Java 2011, being held July 25-27 in Portland, Ore., is focused on open source technologies that make up the Java ecosystem. (This event is co-located with OSCON.)

Save 20% on registration with the code OS11RAD

Some developers have a visceral negative reaction to Lisp. Why do you think that is?

Stuart Sierra: I think the problem people often have with Lisp is based on first encountering it in an academic setting, and the particular Lisp language they were using was designed for academic purposes. Scheme, in particular, came out of academia, and that focus has often made it more difficult to use for real-world applications. Clojure, on the other hand, is a very pragmatic language. It was designed by a career programmer, Rich Hickey, who wanted to solve real problems that he had with other programming languages. So if you can get over the initial similarities with Lisps that you might have seen before, I think you'll find that Clojure is a very productive language to work with.

Is Clojure being used in large-scale production?

Stuart Sierra: Yes, there are many "success stories" listed on the Clojure website and more on our wiki. I work for a company, Relevance, that does consulting for enterprise software, and we've had several client projects written in Clojure that have been quite successful. It's also been used in production by Akamai, financial companies, big data companies that are doing large data processing, and in a variety of other places.

The Java Virtual Machine (JVM) seems to be the language platform of choice for developing languages. What makes the JVM so attractive, and how does Clojure leverage it?

Stuart Sierra: The JVM makes an excellent platform for language development, and that's why we've seen so many new languages show up. It's actually much better as a target for languages than some lower-level assembly-type languages for the simple reason that it provides a way for all of those different languages to interoperate. So now you can have Clojure code, JRuby code, Scala code and Java code all making use of the same libraries and all calling back and forth to one another. So a Java method call in Clojure looks like a Clojure function call, but you're calling a Java method call by name. That compiles to a normal Java method call that has all of the performance benefits that the JVM can provide. You can define classes in Clojure that will be available to Java programs and accessible to Java programmers through the standard calling conventions that they're used to. All of Clojure's built-in data types implement the standard Java collection interfaces, so they can be passed directly into Java code without changes.

What's the IDE situation for Clojure?

Stuart Sierra: IDE support is evolving. There are plug-ins available now in varying states of sophistication for all of the major IDEs: Eclipse, IntelliJ, NetBeans. A lot of people are also using Emacs or another sophisticated text editor with good support for writing Lisp-like languages.



Related:


Older posts are this way If this message doesn't go away, click anywhere on the page to continue loading posts.
Could not load more posts
Maybe Soup is currently being updated? I'll try again automatically in a few seconds...
Just a second, loading more posts...
You've reached the end.

Don't be the product, buy the product!

Schweinderl