Something Same

Language, Expression and Design

Thursday

28

August 2014

rethinking clojure.contrib

by Chris Zheng,

I used to be a huge fanboy of the c++ boost library even though I used probably 2% of the actual functionality provided (and understood even less than that). In the end, I chose python instead because I got sick of waiting half a day for boost to build. However, what amazed me about boost was the way the code was organised. At the time, I was fascinated by just how intricately all the libraries were linked to one another. Exploring the boost modules was more or less like exploring a finely weaved lattice. It was very beautiful (for c++ anyways) in the way these modules fit and depended upon…

Wednesday

27

August 2014

auto-documentation through tests

by Chris Zheng,

Those that have worked with me know that I love my tests and my documentation. I'm one of those developers that work best whilst lounging around on a tropical island somewhere. I'm not fond of repetitive work, I write only when I'm inspired and I'm not great with details once the code has been written. As such, I am very forgetful and so implementing tests and documentation have been my backup plan to manage large amounts of code without forgetting it all at a later point in time. Working with my limitations, I require all my functions to have tests containing of valid inputs and outputs. This means that it…

Monday

25

August 2014

cronj 1.4.0 released

by Chris Zheng,

I'm very excited to release version 1.4.0 of cronj, a timing library. More information can be found in the article immutability, time, and task schedulers. The current cronj has been updated to use version 2.1.2 of hara.ova. Not that much has changed in terms of functionality but its very exciting to be able to show an example of how the hara can be used to simplify the building of concurrent systems. Please have a play!…

Monday

25

August 2014

hara 2.1.2 - concurrency structures

by Chris Zheng,

I've merged two existing projects - ova and kiran into hara for the library's 2.1.2 release. In this version, I've focused on building up lower-level constructs that work well under concurrency: hara.concurrent.notification, useful for testing whether multithreaded functions have run or not hara.concurrent.latch, a general way to let one ref follow what another is doing. hara.concurrent.propagate , a simplified implementation of Sussman's propagators. hara.ova which provides a general purpose mutable array of refs. Other new namespaces in this release are: hara.data.map. It was common functions for dealing with nils in maps. hara.string.path for converting between vector [:a :b…

Monday

18

August 2014

hara documentation published

by Chris Zheng,

I've been chipping away at a small utility library called hara (in the spirit of useful, clojure-utils and medley) for the last 2.5 years. After much trial and error, two major rewrites as well as structural changes to the project, I'm now confident enough to release documentation to cover at least part of the functionality that won't change. It's also made me appreciate just how difficult it is to achieve simplicity. The documentation can be found here. There are a four highlights of the library that I would like to point out: The first is that you can use as little or as much of the library as you…

Sunday

03

August 2014

A more refined vinyasa.inject

by Chris Zheng,

vinyasa.inject has been made a little bit more user friendly following the advice of mascip, Version 0.2.2 has quite a few breaking changes: Instead of injecting directly into clojure.core with a prefix, we can get the same effect with a short namespace. For example, instead of typing >pprint, we inject into the > namespace and type >/pprint. By default, vars will be exported to the . namespace, ie: ./pprint, ./doc, ./source etc... Secondly, there is now an vinyasa.inject/in which provides similar semantics as the ns macro. Here is an example of a typical profiles.clj configuration: {:user {:plugins [...] :dependencies [[org.clojure/tools.namespace…

Saturday

26

July 2014

Cassandra as a big nested map

by Chris Zheng,

I'm stoked to announce that our team at MyPost has open sourced a library that has been used by our development team for the past couple of months. The repository is here. The whole release was quite unexpected and very exciting. It's not a common occurance at all to have a big government-owned corporation (in Australia anyway) allow developers to use emacs and lisp, let alone allow work to be open sourced. Thanks to all who waded through a whole bunch of bureaucratic and legal hurdles, helping to streamline the next set of potential projects that we can open source. I quote Andy our technology lead: This is the first…

Thursday

24

July 2014

representation and reflection

by Chris Zheng,

I've published a little library called korra which is used for jar and maven introspection. This is an extension of what I was working on with iroh in terms of creating utilities that give the developer greater visibility within a live-repl environment. The two libraries can be described as metaprogramming tools - libraries that are used by the developer for interacting with the environment and reasoning about how to go about programming. An example of such tools would be the doc and source functions in the clojure.repl namespace. While iroh provides introspection at the class level, korra introspects at the jar and packaging level. The library was extracted out…

Saturday

14

June 2014

The abstract container pattern

by Chris Zheng,

Clojure has very powerful tooling for working with native java objects and classes. It has numerous ways to take advantage of the java inheritence model. However, one feature that is missing from the language is the ability to define abstract classes. Therefore there is no built-in construct for building multi-tiered class abstraction hierachies in clojure as it is done in java. In my own transititon from thinking in terms of objects to thinking in terms of dataflow, I have not really missed this particular feature that much. However now that I have more experience building bigger and more complex programs using clojure, I have come back to revisit the importance…

Thursday

03

April 2014

Finding a middle ground

by Chris Zheng,

A Dilemma I've always been happy writing clojure code. The only issue I had was around my dislike of bringing in general purpose utility libraries. clojure.core itself is already quite big. As much as I liked the functionality in libraries like useful, clojure-utils and medley, it just didn't seem right to bring in a who lot of dependencies for a couple of utility functions. It was easier to just copy and paste a couple of functions that I needed. The trouble was, as I started writing more code, I started putting commonly used code into my own general purpose library. In time, I also grew a general purpose utility…

comments powered by Disqus