background preloader

Clojure

Facebook Twitter

Bbatsov/clojure-style-guide. Clojure Cheat Sheet (Clojure 1.3 - 1.6, sheet v13) A simpler way to program the web with Clojure and ClojureScript. Overview Hoplon in a nutshell.

A simpler way to program the web with Clojure and ClojureScript

Ho­plon pro­vides a num­ber of li­braries pro­mot­ing a sim­pler model for web ap­pli­ca­tions. The pro­ject can be di­vided into three main com­po­nents: the HTML eval­u­a­tor, the clientside state ma­chine, and server­side RPC mid­dle­ware. These com­po­nents can be used to­gether as a full stack, or in­di­vid­u­ally as a part of an­other stack. More con­cretely, Ho­plon ships with a com­piler for com­pil­ing Ho­plon pages into HTML and JavaScript (im­ple­mented as a build task for the boot build tool), Clo­jure­Script li­braries for cre­at­ing spread­sheet-like dataflow pro­grams and wiring them to the DOM, and Clo­jure­Script and Clo­jure li­braries for RPC in­ter­ac­tion be­tween client and server.

The source code for Ho­plon is hosted on GitHub and Maven ar­ti­facts are de­ployed to Clo­jars. Web Apps Single-page applications, not documents. Web ap­pli­ca­tions are not doc­u­ments. Ho­plon web apps are or­ga­nized like ap­pli­ca­tions. Data Structures in Clojure: Binary Search Trees – Macromancy. Trees Everywhere So far we have talked about two fundamental and pervasive data structures: linked lists and hash tables.

Data Structures in Clojure: Binary Search Trees – Macromancy

Here again we discuss another important data structure and one that you will find is quite common: trees. Clojure - Is there a software-engineering methodology for functional programming. Clojure on Semaphore. We’re very excited to announce official support for testing and deploying Clojure projects.

Clojure on Semaphore

Clojure is the third official language supported by Semaphore. Continuous integration for Clojure projects in 1 minute The steps for setting up your Clojure project on Semaphore are as simple as for a Ruby or JavaScript project. If you don’t already have a Semaphore account, sign up for a free 30-day trial for unlimited builds, unlimited number of collaborators, unlimited deployment and two processors for parallel testing. New accounts will need to authorize Semaphore to access GitHub repositories, in order to be able to pull and receive notifications about code changes, post commit status in pull requests etc. On your dashboard, click on “Build a New project”.

Clojure at a Newspaper. Let’s be frank about it; the MailOnline isn’t to everyone’s taste.

Clojure at a Newspaper

As the worlds biggest newspaper website it is a guilty past time for many. It has some decent editorial content but it can also be distressingly shallow. I worked for there for a year. I was lured by the opportunity to rebuild the old website system in Clojure. Whilst some in my circle have been furthering mankind over at the Guardian, I’ve been working for alternative forces. There is a thread of arrogance in my desire to join a big media company and petition the building of a new system. When I first joined this project Fred George had been extolling the values of Programmer Anarchy. I arrived as “anarchy” was rife and the continents had yet to form.

The reality was that I was fortuitous. Before Clojure (BC) the CTO had the idea that competing teams would trial a Node Vs Ruby Vs X solution as to best appropriate the data for building the next generation website. There was nothing onerous about what we had achieved.

Om

Conceptual overview · swannodette/om Wiki. What follows is an Om conceptual guide.

Conceptual overview · swannodette/om Wiki

Tangible Data Object Oriented programming as a paradigm has many real benefits but one of the worst plagues it has inflicted on programming culture is obscuring data. Functional programming is not a silver bullet but its emphasis on unadorned data is a guiding light. No models. Rather than introducing a middle man, Om allows programmers to build user interfaces over unadorned data. Components Om offers an approach more or less analogous to React's, but we do not actually pass raw React props or states to implementers of the life cycle protocols.

While it may not seem so at first, it's useful to preserve something like React's component local state for two reasons. Application State. Om Experience Report. A few weeks ago David Nolen announced Om: a thin ClojureScript wrapper over Facebook’s React, which provides a functional API for building interactive browser apps.

Om Experience Report

I spent a few hours scattered over my Christmas vacation building a sample app in Om and have really enjoyed it. What I learned: Om is a practical way to build web user interfaces in a functional style, and a lot of fun. Below are a few impressions and tips. I’m not an experienced Clojurian nor do I have any private information about the design and future of Om, so I suspect David will shake his head at various parts of this post and my code. And that’s fine. What I built CartoCrayon is an early experiment in styling geojson data. Right now it only has one baked-in dataset and only works with a specific map, but you can select geographic features and style them manually or based on data.

Working in ClojureScript I’ve been excited about ClojureScript ever since I heard the announcement. How to start. Jalehman/omtut-starter. Ckirkendall/kioo. Reagent: Minimalistic React for ClojureScript. Introduction to Reagent Reagent provides a minimalistic interface between ClojureScript and React.

Reagent: Minimalistic React for ClojureScript

It allows you to define efficient React components using nothing but plain ClojureScript functions and data, that describe your UI using a Hiccup-like syntax. The goal of Reagent is to make it possible to define arbitrarily complex UIs using just a couple of basic concepts, and to be fast enough by default that you rarely have to care about performance. A very basic Reagent component may look something like this: hide Example.