background preloader

Clojure language

Facebook Twitter

Oubiwann/jlfe. Puppetlabs/trapperkeeper. Blog - Using Datomic as a Graph Database. Datomic is a database that changes the way that you think about databases.

Blog - Using Datomic as a Graph Database

It also happens to be effective at modeling graph data and was a great fit for performing graph traversal in a recent project I built. I started out building kevinbacon.us using Neo4j, a popular open-source graph database. It worked very well for actors that were a few hops away, but finding paths between actors with more than 5 hops proved problematic. The cypher query language gave me little visibility into the graph algorithms actually being executed. I wanted more. Despite not being explicitly labeled as such, Datomic proved to be an effective graph database. Quick aside: this post assumes a cursory understanding of Datomic. 6 Degrees Kevin == Cool; 6 Degrees Kelvin == Cold The problem domain should be fairly familiar: the 6 degrees of Kevin Bacon. Using information freely available from IMDb, I developed the following schema: In a nutshell, movies have titles and years.

Using datalog queries Performance Source. Benwbooth/quick-clojure. Fast Clojure/Java Web Apps on Nginx Without Any Java Web Server. Nginx-clojure/nginx-clojure. SnootyMonkey/coming-soon. SnootyMonkey/coming-soon. Sqlkorma. Tonsky/datascript.

Clojure tooling

Clojure libraries. Daniel Szmulewicz's homepage ← Lisp: more is less. There’s recently been a resurgence of interest in Lisp (specifically, Clojure) in my neighborhood.

Lisp: more is less

I have some kind of a fondness for Lisp, but I think some of its characteristics make it poorly suited for use in large programming efforts. Indeed many of the unique properties that Lisp devotees (myself once included) tout over other languages, like homoiconicity, make Lisp into an unweidly, conceptual sledgehammer that’s often out of scale with the problem being solved. I liked Lisp At some point in college, I began following a charismatic AI professor around who was very knowledgeable and enthusiastic about Lisp.

He described it in a way that made it seems like some sort of remarkably powerful, higher form of expression. I eagerly read through ANSI Common Lisp, Practical Common Lisp, and SICP; all great reads. And frankly, I got a lot of mileage out of that pursuit. But that doesn’t make Lisp an appropriate tool for large software projects. Remember “less is more?” Unix wisdom. Clojure from the ground up. We’ve learned the basics of Clojure’s syntax and evaluation model.

Clojure from the ground up

Now we’ll take a tour of the basic nouns in the language. Types We’ve seen a few different values already–for instance, nil, true, false, 1, 2.34, and "meow". Clearly all these things are different values, but some of them seem more alike than others. For instance, 1 and 2 are very similar numbers; both can be added, divided, multiplied, and subtracted. 2.34 is also a number, and acts very much like 1 and 2, but it’s not quite the same. We say that a type is a group of values which work in the same way. Types can overlap and intersect each other. Other types completely subsume one another. Every language has a type system; a particular way of organizing nouns into types, figuring out which verbs make sense on which types, and relating types to one another.

We’ll learn more about the formal relationships between types later, but for now, keep this in the back of your head. Integers Let’s find the type of the number 3: By edd dumbill, A busy person's introduction to Clojure. Have a few hours spare and fancy getting to know Clojure and ClojureScript?

by edd dumbill, A busy person's introduction to Clojure

Sometimes all you need to get learning a new programming language is the right size problem. Nothing too trivial or too daunting. Fortunately, while reading NN Taleb’s book “The Black Swan”, I got a right-sized idea. Taleb describes a coin-tossing game you can play to derive a Gaussian distribution for yourself.

If the coin lands heads, you win $1. I decided to implement a simulation of this game in Clojure. The coin toss demo running in ClojureScript Buckle up, the whole thing will take a few hours, but by the end you’ll have an idea of what a Clojure program looks like, and how they’re run and compiled. Install Clojure I’m not going to reproduce installation instructions here, but you can find them on the Clojure Wiki. This is a conversation You really can’t learn a new language without trying to converse in it.

The same goes for programming. Tackling the problem (defn coin-toss [] (= 1 (rand-int 2))) Truthy? Hitchhiker's Guide to Clojure. Macromancy. Clojure for the Brave and True, an Online Book for Beginners. Learning Clojure through the REPL.