Archive for the ‘Clojure’ Category
Thursday, April 11th, 2013
Clojure Data Analysis Cookbook by Eric Rochester.
I don’t have a copy of Clojure Data Analysis Cookbook but strongly suggest that you read the sample chapter before deciding to buy it.
You will find that two chapters, Chapter 6, Working with Incanter Datasets and Chapter 7, Preparing for and Performing Statistical Data Analysis with Incanter out of eleven are focused on Incanter.
The Incanter site, incanter.org, bills itself as “Incanter Data Sorcery.”
If you go to the blog tab, you will find the most recent entry is December 29, 2010.
Twitter tab shows the most recent tweet as July 21, 2012.
The discussion tab does point to recent discussions but since the first of the year (2013) it has been lite.
I am concerned that a March, 2013 title would have two chapters on what appears to not be a very active project.
Particularly in a rapidly moving area like data analysis.
Posted in Clojure, Data Analysis | 4 Comments »
Wednesday, March 20th, 2013
“Functional Programming for optimization problems in Big Data” by Paco Nathan.
Interesting slide deck, even if it doesn’t start with high drama.
Covers:
- Data Science
- Functional Programming
- Workflow Abstraction
- Typical Use Cases
- Open Data Example
The reading list mentioned in these slides makes a nice self-review course in data science.
The Open Data Example is for Palo Alto but you can substitute a city with open data closer to home.
Posted in BigData, Cascading, Cascalog, Clojure, Functional Programming, Scala, Scalding | No Comments »
Sunday, February 24th, 2013
Purely Functional Data Structures in Clojure: Leftist Heaps by Leonardo Borges.
From the post:
Last year I started reading a book called Purely Functional Data Structures. It’s a fascinating book and if you’ve ever wondered how Clojure’s persistent data structures work, it’s mandatory reading.
However, all code samples in the book are written in ML – with Haskell versions in the end of the book. This means I got stuck in Chapter 3, where the ML snippets start.
I had no clue about Haskell’s – much less ML’s! – syntax and I was finding it very difficult to follow along. What I did notice is that their syntaxes are not so different from each other.
So I put the book down and read Learn You a Haskell For Great Good! with the hopes that learning more about haskell’s syntax – in particular, learning how to read its type signatures – would help me get going with Puretly Functional Data Structures.
Luckily, I was right – and I recommend you do the same if you’re not familiar with either of those languages. Learn You a Haskell For Great Good! is a great book and I got a lot out of it. My series on Monads is a product of reading it.
Enough background though.
The purpose of this post is two-fold: One is to share the github repository I created and that will contain the Clojure versions of the data structures in the book as well as most solutions to the exercises – or at least as many as my time-poor life allows me to implement.
The other is to walk you through some of the code and get a discussion going. Hopefully we will all learn something – as I certainly have when implementing these. Today, we’ll start with Leftist Heaps.
This sounds like a wonderful resource in the making!
I first saw this at Christophe Lalanne’s A bag of tweets / February 2013.
Posted in Clojure, Functional Programming, Haskell | No Comments »
Wednesday, February 13th, 2013
Streaming Histograms for Clojure and Java
From the post:
We’re happy to announce that we’ve open-sourced our “fancy” streaming histograms. We’ve talked about them before, but now the project has been tidied up and is ready to share.
PDF & CDF for a 32-bin histogram approximating a multimodal distribution.
The histograms are a handy way to compress streams of numeric data. When you want to summarize a stream using limited memory there are two general options. You can either store a sample of data in hopes that it is representative of the whole (such as a reservoir sample) or you can construct some summary statistics, updating as data arrives. The histogram library provides a tool for the latter approach.
The project is a Clojure/Java library. Since we use a lot of Clojure at BigML, the readme’s examples are all Clojure oriented. However, Java developers can still find documentation for the histogram’s public methods.
A tool for visualizing/exploring large amounts of numeric data.
Posted in Clojure, Graphics, Java, Visualization | No Comments »
Monday, January 28th, 2013
Building a grammar for statistical graphics in Clojure by Kevin Lynagh.
From the description:
Our data is typically optimized for use by computers; what would it be like if we optimized for humans? This talk introduces a grammar of graphics for concisely expressing rich data visualizations. The grammar, implemented in Clojure, consists of simple data structures and can be used across the JVM and via JSON. This talk will cover principles of effective data visualization and the benefits of using data structures as an “API”. There will be lots of pictures and a touch of code.
Fear not! It isn’t dull at all.
Part 1 starts with a quick overview of visualization followed by aesthetic rules for graphics and short discussion of D3 and solutions.
Part 2 is starts with mentions of: The Grammar of Graphics by Leland Wilkinson and Ggplot2 : elegant graphics for data analysis by Hadley Wickham. Kein doesn’t like the R logo (I don’t guess you can please everyone) and R in general.
Suggests that a more modern language, Clojure, which is based on Lisp (another modern language?)
, is easier to use. I leave religious debates about languages to others.
I do think he has a good point about decomplecting functions.
More materials:
Handout for the presentation. Useful additional references.
Slides for the presentation.
C2PO (in private alpha). The Clojure library demonstrated in the presentation.
Posted in Clojure, Graphics | No Comments »
Tuesday, December 4th, 2012
Functional Composition by Chris Ford.
From the webpage:
A live-coding presentation on music theory and Bach’s “Canone alla Quarta” by @ctford.
Based on Overtone:
Overtone is an open source audio environment being created to explore musical ideas from synthesis and sampling to instrument building, live-coding and collaborative jamming. We use the SuperCollider synth server as the audio engine, with Clojure being used to develop the APIs and the application. Synthesizers, effects, analyzers and musical generators can be programmed in Clojure.
Come and join the Overtone Google Group if you want to get involved in the project or have any questions about how you can use Overtone to make cool sounds and music.
An inducement to learn Clojure and to better understand the influence of music on the second edition of HyTime.
I first saw this in Christophe Lalanne’s A bag of tweets / November 2012.
Posted in Clojure, Functional Programming, Music | No Comments »
Saturday, November 10th, 2012
Behind the Mirror by Chris Granger.
Summary:
Chris Granger discusses the need for enhancing the learning tools starting from his own experience watching through a mirror people trying to solve problems at Microsoft.
A compelling presentation about principles for IDEs via TECO, through Visual Studio and ending up with Clojure.
Chris argues we should be able to hide, foreground and manipulate abstractions as part of an IDE.
I see potential for interactive topic map authoring where the state of the map only a round trip to the server behind the user.
Posted in Clojure, Editor | No Comments »
Friday, October 5th, 2012
Memobot
From the webpage:
Memobot is a data structure server written in clojure. It speaks Redis protocol, so any standard redis client can work with it.
For interests in data structures, Clojure or both.
Posted in Clojure, Data Structures, Redis | No Comments »
Monday, October 1st, 2012
Clojure Koans
You may find this useful.
Note that you get a direct link to the site. I don’t try to trap you in a frame for my site.
I first saw this at DZone.
Posted in Clojure | No Comments »
Wednesday, September 26th, 2012
Clojure Mindmap by Siva Jagadeesan.
Impressive graphic but I suspect the task of building it was more instructive than the result.
Something about slowing down enough to write information down and to plot its relationship(s) to other information that makes it “sticky.”
Or it is not so much a question of speed as it is of the effort required to write it down and plot?
Do you remember information you have to look up and then type in a text longer/better than grabbing a quote for a quick cut-n-paste?
I first saw this at DZone.
Posted in Clojure, Mind Maps | No Comments »
Friday, August 31st, 2012
Adventures In Declarative Programming: Conway’s Game Of Life by Manuel Rotter.
From the post:
My first blog post about declarative programming explained how to write a Sudoku solver in the logic programming language Prolog. This time I’ll show you how to implement Conway’s Game of Life in the functional programming language Clojure.
But before that, let me explain a few general things. The first three paragraphs are for readers who are not familiar with certain concepts. People who already know what Clojure or Conway’s Game of Life is, may feel free to skip those paragraphs. It starts getting serious at “Game of Life in Clojure”.
Having a result that interests me makes learning something new easier.
Here it is “Conway’s Game of Life,” a two dimensional type of Cellular Automata.
You may also find the following of interest:
Game of Life 3D
The Game of Life in 3D (using three.js)
If you have heard of Wolfram’s A New Kind of Science, be aware the full text is online for free viewing with other materials at: Wolfram Science.
Posted in Cellular Automata, Clojure, Game of Life | No Comments »
Saturday, August 25th, 2012
Clojure/Datomic creator Rich Hickey on Deconstructing the Database
From the description:
Rich Hickey, author of Clojure, and designer of Datomic presents a new way to look at database architectures in this talk from JaxConf 2012. What happens when you deconstruct the traditional monolithic database – separating transaction processing, storage and query into independent cooperating services? Coupled with a data model based around atomic facts and awareness of time, you get a significantly different set of capabilities and tradeoffs. This talk with discuss how these ideas play out in the design and architecture of Datomic, a new database for the JVM.
I truly appreciate the description of database updates as “a miracle occurs.”
There is much to enjoy and consider here.
Posted in Clojure, Datomic | No Comments »
Sunday, August 5th, 2012
Elastisch, a Clojure client for ElasticSearch
From about this guide:
This guide covers ElasticSearch indexing capabilities in depth, explains how Elastisch presents them in the API and how some of the key features are commonly used.
This guide covers:
- What is indexing in the context of full text search
- What kind of features ElasticSearch has w.r.t. indexing, how Elastisch exposes them in the API
- Mapping types and how they define how the data is indexed by ElasticSearch
- How to define mapping types with Elastisch
- Lucene built-in analyzers, their characteristics, what different kind of analyzers are good for.
- Other topics related to indexing and working with indexes
An extensive introduction to ElasticSearch.
If you are not familiar with ElasticSearch already, now might be a good time.
Posted in Clojure, ElasticSearch | No Comments »
Tuesday, March 6th, 2012
Extending the GATK for custom variant comparisons using Clojure by Brad Chapman.
From the post:
The Genome Analysis Toolkit (GATK) is a full-featured library for dealing with next-generation sequencing data. The open-source Java code base, written by the Genome Sequencing and Analysis Group at the Broad Institute, exposes a Map/Reduce framework allowing developers to code custom tools taking advantage of support for: BAM Alignment files through Picard, BED and other interval file formats through Tribble, and variant data in VCF format.
Here I’ll show how to utilize the GATK API from Clojure, a functional, dynamic programming language that targets the Java Virtual Machine. We’ll:
- Write a GATK walker that plots variant quality scores using the Map/Reduce API.
- Create a custom annotation that adds a mean neighboring base quality metric using the GATK VariantAnnotator.
- Use the VariantContext API to parse and access variant information in a VCF file.
The Clojure variation library is freely available and is part of a larger project to provide variant assessment capabilities for the Archon Genomics XPRIZE competition.
Interesting data, commercial potential, cutting edge technology and subject identity issues galore. What more could you want?
Posted in Bioinformatics, Biomedical, Clojure, MapReduce | No Comments »
Sunday, February 19th, 2012
Neocons, a Clojure client for the Neo4J REST API
From the webpage:
Neocons is a young idiomatic Clojure client for the Neo4J REST API.
Supported Features
Neocons currently supports the following features (all via REST API, so you can use open source Neo4J Server edition for commercial projects):
- Create, read, update and delete nodes
- Create, read, update and delete relationships
- Fetch relationships for given node
- Create and delete indexes
- Index nodes
- Query node indexes for exact matches and using full text search queries
- Query automatic node index
- Traverse nodes, relationships and paths
- Find shortest path or all paths between nodes
- Predicates over paths, for example, if they include specific nodes/relationships
- Cypher queries (with Neo4J Server 1.6 and later)
Another client for Neo4j! Which one do you use?
Posted in Clojure, Neo4j, Neocons | No Comments »
Saturday, February 18th, 2012
An invitation to FP for Clojure noobs
From the post:
I’ve heard newcomers to Clojure ask how to get started with functional programming. I believe that learning to program in the functional style is mostly a matter of practice. The newcomer needs to become familiar with a handful of higher order functions, and how they are used in common idioms. This can be done by practice with simple, well defined problems. I assume that the prospective reader already has a grasp of the rudiments of Clojure, and can operate the Leiningen build tool.
Here is what I propose. I have prepared a set of annotated exercises illustrating typical Clojure fp idioms. The exercises are the first 31 Project Euler problems, one for each day of the month. I believe these problems are ideal for the purpose at hand. Each problem is succinctly stated, interesting, and well defined. Each lends itself to a natural functional solution.
Sounds like an interesting approach to learning Clojure.
Would be interesting if processor speed and virtually unlimited storage tips the scales in favor of write-only memory and functional programming.
Where even mis-typed keystrokes are recorded, it being easier to record the next try than to correct the previous one. Will appear in secure facilities first but won’t remain there.
Posted in Clojure, Functional Programming | No Comments »
Sunday, February 5th, 2012
First Conj 2011 Videos Available
Alan Dipert writes:
Five videos from Clojure Conj 2011 are now available. Clojure Conj 2011 recordings are available at Clojure’s blip.tv page and are also directly accessible via the links below.
We will continue to release Conj 2011 talks as they become available.
Thank you to all of the speakers and attendees for making Clojure Conj 2011 a great event! Watch this space for information about Clojure Conj 2012, which is being planned.
What has been posted so far will keep you going back to see if more videos have been posted. Top notch stuff.
Posted in Clojure, Conferences | No Comments »
Saturday, February 4th, 2012
Functional Relational Programming with Cascalog by Stuart Sierra.
From the post:
In 2006, Ben Mosely and Peter Marks published a paper, Out of the Tar Pit, in which they coined the term Functional Relational Programming. “Out of the Tar Pit” was influential on Clojure’s design, particularly its emphasis on immutability and the separation of state from behavior. Mosely and Marks went further, however, in recommending that data be manipulated as relations. Relations are the abstract concept behind tables in a relational database or “facts” in some logic programming systems. Clojure does not enforce a relational model, but Clojure can be used for relational programming. For example, the clojure.set namespace defines relational algebra operations such as project and join.
In the early aughts, Jeffrey Dean and Sanjay Ghemawat developed the MapReduce programming model at Google to optimize the process of ranking web pages. MapReduce works well for I/O-bound problems where the computation on each record is small but the number of records is large. It specifically addresses the performance characteristics of modern commodity hardware, especially “disk is the new tape.”
Stuart briefly traces the development of Cascalog and says it is an implementation of Functional Relational Programming.
What do you think?
Posted in Cascalog, Clojure, Functional Programming | No Comments »
Saturday, February 4th, 2012
Clojure and XNAT: Introduction
Over the last two years, I’ve been using Clojure quite a bit for managing, testing, and exploratory development in XNAT. Clojure is a new member of the Lisp family of languages that runs in the Java Virtual Machine. Two features of Clojure that I’ve found particularly useful are seamless Java interoperability and good support for interactive development.
“Interactive development” is a term that may need some explanation: With many languages — Java, C, and C++ come to mind — you write your code, compile it, and then run your program to test. Most Lisps, including Clojure, have a different model: you start the environment, write some code, test a function, make changes, and rerun your test with the new code. Any state necessary for the test stays in memory, so each write/compile/test iteration is fast. Developing in Clojure feels a lot like running an interpreted environment like Matlab, Mathematica, or R, but Clojure is a general-purpose language that compiles to JVM bytecode, with performance comparable to plain old Java.
One problem that comes up again and again on the XNAT discussion group and in our local XNAT support is that received DICOM files land in the unassigned prearchive rather than the intended project. Usually when this happens, there’s a custom rule for project identification where the regular expression doesn’t quite match what’s in the DICOM headers. Regular expressions are a wonderfully concise way of representing text patterns, but this sentence is equally true if you replace “wonderfully concise” with “maddeningly cryptic.”
Interesting “introduction” that focuses on regular expressions.
If you don’t know XNAT (I didn’t):
XNAT is an open source imaging informatics platform, developed by the Neuroinformatics Research Group at Washington University. It facilitates common management, productivity, and quality assurance tasks for imaging and associated data. Thanks to its extensibility, XNAT can be used to support a wide range of imaging-based projects.
Important neuroinformatics project based at Washington University, which has a history of very successful public technology projects.
Never hurts to learn more about any informatics project, particularly one in the medical sciences. With an introduction to Clojure as well, what more could you want?
Posted in Bioinformatics, Clojure, Neuroinformatics, Regexes, XNAT | No Comments »
Thursday, January 19th, 2012
All Your HBase Are Belong to Clojure by
I’m sure you’ve heard a variation on this story before…
So I have this web crawler and it generates these super-detailed log files, which is great ‘cause then we know what it’s doing but it’s also kind of bad ‘cause when someone wants to know why the crawler did this thing but not that thing I have, like, literally gajigabytes of log files and I’m using grep and awk and, well, it’s not working out. Plus what we really want is a nice web application the client can use.
I’ve never really had a good solution for this. One time I crammed this data into a big Lucene index and slapped a web interface on it. One time I turned the data into JSON and pushed it into CouchDB and slapped a web interface on that. Neither solution left me with a great feeling although both worked okay at the time.
This time I already had a Hadoop cluster up and running, I didn’t have any experience with HBase but it looked interesting. After hunting around the internet, thought this might be the solution I had been seeking. Indeed, loading the data into HBase was fairly straightforward and HBase has been very responsive. I mean, very responsive now that I’ve structured my data in such a way that HBase can be responsive.
And that’s the thing: if you are loading literally gajigabytes of data into HBase you need to be pretty sure that it’s going to be able to answer your questions in a reasonable amount of time. Simply cramming it in there probably won’t work (indeed, that approach probably won’t work great for anything). I loaded and re-loaded a test set of twenty thousand rows until I had something that worked.
An excellent tutorial on Hadoop, HBase and Clojure!
First seen at myNoSQL but the URL is not longer working at in my Google Reader.
Posted in Clojure, HBase, Hadoop | 2 Comments »
Tuesday, December 20th, 2011
The Mapping Dilemma by David Nolen.
Description:
Almost all problems of Computer Science can be summarized as being some form of mapping dilemma, whether that means taking the results of proof theory and constructing an expressive type system or taking a graphical user experience and constructing a scalable model-view-controller architecture. Finding solutions to these challenges can be incredibly rewarding, yet as implementations solidify it often turns out we didn’t solve the mapping dilemma at all! The beautiful generality of the abstract idea becomes lost in the brittle specificity of concrete implementations.
In this talk we’ll discuss a library that attempts to solve the mapping dilemma – an optimizing pattern match compiler in the spirit of OCaml and Haskell targeting the Clojure programming language. The library attempts to provide the exact same general abstraction whether the user wishes to pattern match persistent data structures or the individual bits in a byte.
This controversial talk critiques our fundamental choice of tools, programming languages, and software methodologies from the perspective of how well they help us solve mapping dilemmas.
Not what I usually think of as the “mapping dilemma” but an interesting and possibly quite useful presentation none the less.
Posted in Clojure | No Comments »
Monday, November 14th, 2011
Single Build Tool for Clojure
Cake and Leningen are going to merge for the Leningen 2.0 release.
From the post by Justin Balthrop:
Please join the Leiningen mailing list if you haven’t already (http://groups.google.com/group/leiningen) and join us in #leiningen on irc.freenode.com too. Phil also set up a wiki page for brainstorming version 2.0 changes (https://github.com/technomancy/leiningen/wiki/VersionTwo).
As I told those of you I talked to at the Conj, I feel really positive about this transition. For those of us who have contributed to Cake, it means our contributions will have a bigger impact and user base than they previously did. I’m also really excited to be working with Phil. He’s done a terrific job on Leiningen, and he has an amazing ability to organize and motivate open-source contributors.
One more note: I’m planning to rename the Cake mailing list to Flatland as I did for the IRC channel (#cake.clj -> #flatland). Feel free to unsubscribe if you aren’t interested in http://flatland.org open source projects, but we’d love for you to stay
Must be nice to have a small enough body of highly motivated people to make this sort of merger work.
Will be a nice advantage for Clojure programmers in general. And for those wanting to take a functional approach to topic map engines.
Posted in Clojure, Functional Programming | No Comments »
Friday, November 11th, 2011
Clojure on Hadoop: A New Hope by Chun Kuk.
From the post:
Factual’s U.S. Places dataset is built from tens of billions of signals. Our raw data is stored in HDFS and processed using Hadoop.
We’re big fans of the core Hadoop stack, however there is a dark side to using Hadoop. The traditional approach to building and running Hadoop jobs can be cumbersome. As our Director of Engineering once said, “there’s no such thing as an ad-hoc Hadoop job written in Java”.
Factual is a Clojure friendly shop, and the Clojure community led us to Cascalog. We were intrigued by its strength as an agile query language and data processing framework. It was easy to get started, which is a testament to Cascalog’s creator, Nathan Marz.
We were able to leverage Cascalog’s high-level features such as built-in joins and aggregators to abstract away the complexity of commonly performed queries and QA operations.
This article aims to illustrate Cascalog basics and core strengths. We’ll focus on how easy it is to run useful queries against data stored with different text formats such as csv, json, and even raw text.
Somehow, after that lead in, I was disappointed by what followed.
Curious what others think? As far as it goes, a good article on Clojure but doesn’t really reach the “core strengths” of Cacalog does it?
Posted in Cascalog, Clojure, Hadoop | No Comments »
Monday, November 7th, 2011
Using Lucene and Cascalog for Fast Text Processing at Scale
From the post:
Here at Yieldbot we do a lot of text processing of analytics data. In order to accomplish this in a reasonable amount of time, we use Cascalog, a data processing and querying library for Hadoop; written in Clojure. Since Cascalog is Clojure, you can develop and test queries right inside of the Clojure REPL. This allows you to iteratively develop processing workflows with extreme speed. Because Cascalog queries are just Clojure code, you can access everything Clojure has to offer, without having to implement any domain specific APIs or interfaces for custom processing functions. When combined with Clojure’s awesome Java Interop, you can do quite complex things very simply and succinctly.
Many great Java libraries already exist for text processing, e.g., Lucene, OpenNLP, LingPipe, Stanford NLP. Using Cascalog allows you take advantage of these existing libraries with very little effort, leading to much shorter development cycles.
By way of example, I will show how easy it is to combine Lucene and Cascalog to do some (simple) text processing. You can find the entire code used in the examples over on Github.
The world of text exploration just gets better all the time!
Posted in Cascalog, Clojure, LingPipe, Lucene, Natural Language Processing, OpenNLP, Stanford NLP | No Comments »
Tuesday, October 11th, 2011
4Clojure
From the webpage:
4Clojure is a resource to help fledgling clojurians learn the language through interactive problems. The first few problems are easy enough that even someone with no prior experience should find the learning curve forgiving. See ‘Help’ for more information.
Problem based approach to learning Clojure.
I have seen this sort of thing before for other programming languages.
Wonder if something like this would work for semantic representation? Such that common problems are generally solved by all new contenders? Might be a basis for conversation if nothing else.
Posted in Clojure, Programming | No Comments »
Tuesday, October 11th, 2011
Writing Tetris in Clojure
From the post:
Good evening to everyone. Today I want to guide you step-by-step through the process of writing a game of Tetris in Clojure. My goal was not to write the shortest version possible but the concisest one and the one that would use idiomatic Clojure techniques (like relying on the sequence processing functions and making a clear distinction between purely functional and side-effect code). The result I got is about 300 lines of code in size but it is very comprehensible and simple. If you are interested then fire up your editor_of_choice and let’s get our hands dirty.
Not that I really think you need a personal clone of Tetris but it looks like a very good way to explore Clojure.
Posted in Clojure | No Comments »
Wednesday, September 14th, 2011
Clojure Zippers
Loke VanderHart on zippers in Clojure.
From the website:
An introduction to the Clojure zip data structure, which supports fully functional tree navigation and editing. Includes a discussion of how to use the data structure effectively, as well as an overview of its performance characteristics.
I would supplement this presentation with:
“Editing” trees in Clojure with clojure.zip by Brian Marick.
Zippers – Functional Tree Editing (its under Other Included Libraries)
From the webpage:
Clojure includes purely functional, generic tree walking and editing, using a technique called a zipper (in namespace zip) . For background, see the paper by Huet. A zipper is a data structure representing a location in a hierarchical data structure, and the path it took to get there. It provides down/up/left/right navigation, and localized functional ‘editing’, insertion and removal of nodes. With zippers you can write code that looks like an imperative, destructive walk through a tree, call root when you are done and get a new tree reflecting all the changes, when in fact nothing at all is mutated – it’s all thread safe and shareable.
Oh, and the library documentation: API for Clojure.zip
Posted in Clojure, Functional Programming | No Comments »
Thursday, September 1st, 2011
An Introduction to Clojure and Its Capabilities for Data Manipulation by Jean-François “Jeff” Héon.
From the post:
I mainly use Java at work in an enterprise setting, but I’ve been using Clojure at work for small tasks like extracting data from log files or generating or transforming Java code. What I do could be done with more traditional tools like Perl, but I like the readability of Clojure combined with its Java interoperability. I particularly like the different ways functions can be used in Clojure to manipulate data.
I will only be skimming the surface of Clojure in this short article and so will present a simplified view of the concepts. My goal is for the reader to get to know enough about Clojure to decide if it is worth pursuing further using longer and more complete introduction material already available.
I will start with a mini introduction to Clojure, followed by an overview of sequences and functions combination, and finish off with a real-world example.
You will encounter immutable data structures so be forewarned.
I wonder to what degree mutable data structures arose originally due to lack of storage space and processor limitations? Will have to make a note to check that out.
Posted in Clojure, Data Structures | 1 Comment »
Monday, August 29th, 2011
Persistent Data Structures and Managed References: Clojure’s approach to Identity and State by Rich Hickey.
From the summary:
Rich Hickey’ presentation is organized around a number of programming concepts: identity, state and values. He explains how to represent composite objects as values and how to deal with change and state, as it is implemented in Clojure.
OK, it’s not recent, circa 2009, but it is quite interesting.
Some tidbits to entice you to watch the presentation:
Identity – A logical entity we associate with a series of causally related values (states) over time.
Represent objects as composite values
Persistent Data Structures preserves old values as immutable
Bit-partitioned hash tries 32-bit
Structural sharing – path copying
Persistent data structures provide efficient immutable composite values
When I saw the path copying operations that efficiently maintain immutable values I immediately thought of Steve Newcomb and Versavant.
Posted in Clojure, Identity | No Comments »
Thursday, August 25th, 2011
Growing a DSL with Clojure: Clojure Makes DSL Writing Straightforward by by Ambrose Bonnaire-Sergeant.
From the post:
From seed to full bloom, Ambrose takes us through the steps to grow a domain-specific language in Clojure.
Lisps like Clojure are well suited to creating rich DSLs that integrate seamlessly into the language.
You may have heard Lisps boasting about code being data and data being code. In this article we will define a DSL that benefits handsomely from this fact.
We will see our DSL evolve from humble beginnings, using successively more of Clojure’s powerful and unique means of abstraction.
Is a DSL in your subject identity future?
Posted in Clojure, DSL | No Comments »