clj.orcery

Language, Expression and Design

Thursday

15

September 2016

develop, test, communicate

by Chris Zheng,

hara version 2.4.4 has been pushed to clojars with documentation added for hara.io.file and hara.test. I want to focus a little bit on the test framework, having previously written a little bit concerning the initial release. I feel that this sits somewhere in between midje and clojure.test in terms of clarity and feature count. midje comes with it's own test runner as well as it's file watcher/reloading mechanism and countless other features. As much as I liked working with lein midje :autotest, I felt that the library could be pushed further. What I was working on was a way to manage function metadata…

Tuesday

13

September 2016

hara.io.file - nio for clojure

by Chris Zheng,

For the longest time, I detested writing the delete function for file system manipulation. It really bothered me that to delete a folder, there was serious pain. A comparison of how a folder was deleted in various environments: Desktop: <CLICK>, <SHIFT>-<BACKSPACE> Shell: rm -R <FOLDER> Clojure: from https://gist.github.com/edw/5128978 (defn delete-recursively [fname] (let [func (fn [func f] (when (.isDirectory f) (doseq [f2 (.listFiles f)] (func func f2))) (clojure.java.io/delete-file f))] (func func (clojure.java.io/file fname)))) Firstly, that's too much code to write. I also like to point out that the code uses…

Friday

02

September 2016

hara 2.4.0 released

by Chris Zheng,

I've just pushed version 2.4.0 of hara to clojars. I haven't done much open source in the last couple of months so not much old code has changed. There is a fix to maintain clojure 1.9 compatibility. No bug fixes. I think it's mostly good. The biggest change is me. To be more specific - my outlook. The 'new' parts of the library are replacements for two canonical workhorses - fs and midje. I have mixed feelings about this - hara used to be a bunch of namespaces that were purely utility - to provide methods that other libraries lacked. I wanted to respect the canon and…

Wednesday

01

June 2016

klipse is magic

by Chris Zheng,

Just last month, I sat down with the klipse guys and told them that because I'm super lazy, I didn't even want to use cljs-build/figwheel and just edit code directly on github/gists and have it be pulled and compiled directly on the browser. A month later... thanks to viebel's awesome work: http://blog.klipse.tech/clojure/2016/05/30/spec.html What people saw was the clojure.spec examples running live. What most may not realise is that the klipse editor is pulling code from github on the fly and resolving dependencies within the browser itself. This changes the game completely. It completely removes the requirement of a…

Wednesday

18

May 2016

live documentation with klipse

by Chris Zheng,

I've been in Tel Aviv for the last 3 weeks and have been lucky to be hanging out/hacking with some amazing clojurists - i.e danielsz of system fame, madlan and the klipse project. Now that cljs-in-cljs is a reality, klipse is a real treat to work with. I really like this project because it's essentially a repl in the browser. Well... it's alot more than that but what these guys plan to do is to create a no-install environment for clojurescript evaluation. I worked with cljs-build in the past and was severely traumatised by the development experience as well as the constantly changing landscape of cljs at the…

Monday

11

April 2016

fudje - a sweeter test framework

by Chris Zheng,

I'm been one of the biggest fans of midje ever since I laid eyes on the beautiful syntax and watched the amazing TDD videos by Brian Marick. The library changed my perception of testing to be THE means of development as opposed to being relegated to just "part" of the development cycle. Having the => input/output forms meant that midje tests were as readable as documentation. It led to my own explorations in how design and testing should be done and I am so thankful for the initial inspiration. However, midje has been a victim of it's own success and the initial flurry of code, pull-requests, and commits has…

Sunday

03

April 2016

one.love - an inspired rethink

by Chris Zheng,

I've been wanting to play around with rethinkdb ever since two years ago, when I had a really memorable conversation with Mark Mandel about developer communities and how open the rethinkdb brand is (as compared to datomic which has amazing functionality, but because of it's closed source, has not been as widely adopted). (map inc [1 2 3]) rethinkdb is super cool. I've been looking at it for the past two weeks, and pestering apa512, the author of clj-rethinkdb about how it's implemented. I've reached the following conclusion: It's like mongodb but better. rethinkdb is a document store with change notification and server side functions built in, sitting inbetween datomic…

Monday

21

March 2016

adi - data modelling for the ambitious

by Chris Zheng,

I've finally managed to sit down and write out the use cases for all the options available for adi, a project I've been working on and off now for the past 3 years. The library has been inspired by firebase - to have a simple interface around datomic, and to allow customisable security to the CRUD interface around databases. I wanted to have a backend that empowers the frontend and so a data processing pipeline was built around the query mechanism to enable more declarative hooks into the system: So what is adi? Document and graph hybrid database. Conversion of relational data to maps and vice-versa Data-centric, declarative CRUD Schema…

Monday

07

March 2016

hara.time - time as a clojure map

by Chris Zheng,

cronj was the first real world project I ever wrote with clojure and my first library that was properly concurrent. I remember sitting there in my living room about 4 years watching Rich Hickey's ants demo thinking to myself: "this guy's got 100 threads running simultaneously and I can't even get 2 threads to coordinate properly". As much as I despaired back then, it provided the impetus to start learning about concurrency. I set my sights high. What better way to do it than to build a task scheduler? Although the code for cronj has evolved, the architecture has not. Each part of the system has been kept very clean…

Wednesday

17

February 2016

oren - os and hardware information

by Chris Zheng,

Having been a big fan of system monitoring, I started looking into alternatives to sigar and found oshi - a JNA-based (native) operating system information library for Java. While it's functionality is much less than sigar, I spent some time experimenting with wrapping the functionity with hara.object. The result is oren: (require '[oren.core :as oren]) (oren/all) => {:operating-system {:family "Mac OS X", :manufacturer "Apple", :version {:build-number "15D21", :code-name "El Capitan", :version "10.11.3"}} :hardware {:file-stores [{:description "Local Disk", :name "Macintosh HD (/)", :total-space 249821663232, :usable-space 6691004416}], :memory {:available 5489655808, :total 17179869184}, :power-sources [{:name "InternalBattery-0", :remaining-capacity 1.0, :time-remaining -2.0}], :displays [{:edid [... ]}], :processor {:vendor "GenuineIntel", ... ... :model…

comments powered by Disqus