===================
== Martin Trojer ==
Programming Blog

===================

Retrofitting the Reloaded pattern into Clojure projects

clojure
Stuart Sierra has done a great job with clojure.tools.namespace and the reloaded leiningen template. If you haven’t heard about this before please have a look at c.t.n readme and watch this presentation. I’ve have retrofitted this pattern into two rather big clojure projects (20k and 5k lines) with several modules and here are some of my findings. Removing global state The first step is to find all resources that needs to be “lifecycled”. Read more...

Non tail-recursive functions in core.async go blocks

clojure core.async go
I’ve been using various Go examples / tutorials to take a deeper look into core.async. The CSP pattern is a very interesting and powerful, it’s good move for Clojure to “throw in” with Go and push this style of programming. core.sync works at s-expression level, where some other JVM solutions (Kilim, Pulsar) do the same on byte code level. The main benefit of doing these transforms on s-expression level is that they are applicable to ClojureScript, where CSP can be a very neat way out of callback hell. Read more...

core.async and Blocking IO

clojure core.async go
Some time ago I wrote about Asynchronous workflows in Clojure. With the recent release and excitement of core.async, I though it a good time to revisit that post. While there are already some good example and comparison-with-go posts out there, I’d like to focus on an area often misunderstood, namely async frameworks and blocking APIs (most commonly blocking IO). It’s important to understand the implications of blocking IO and it’s effects on ‘async code’, in this case core. Read more...

Datomic Bootstrap

clojure datomic

A simple SQL scenario;

Read more...

Announcing Frins, a practical unit of measure calculator DSL for Scala

scala frinj frins
I am proud to announce a new Scala project called “Frins”. Frins is a practical unit-of-measure calculator DSL for Scala. Key features; Tracks units of measure through all calculations allowing you to mix units of measure transparently Comes with a huge database of units and conversion factors Inspired by the Frink project Full source code available on github. To wet your appetite head straight over to the example calculations. How Frins came about About a year ago I created Frinj. Read more...

EDN Parser in Scala

scala

Taken from edn-scala

Read more...

Scheme in Scala

scala lisp
In this post I present some of my experiences writing a Scheme interpreter in Scala (as an external DSL) and compare it with my recent similar experiences in Clojure and F#. Overall, the Scala solution is very similar to the F# one. Not very surprising, since the problem lends itself well to case classes / discriminated union types and pattern matching. One difference is more type declarations in Scala, due to the lack of a Hindley-Milner type inference. Read more...

Comparing FP REPL Sessions

scala clojure fsharp
Functional programming is great; higher-order functions, closures, immutable data-structures, lazy sequences etc. Most languages comes with a REPL (or ‘interactive’ prompt), where you can play with these features at your leisure. Dynamically typed languages are a bit more convenient in the REPL, but not by as much as you might think. Also, F# type providers closes the gap even further. Here’s a typical, hit-a-JSON-endpoint-and-look-at-the-data session in Clojure; $ lein repl user=> (def res (slurp "http://www. Read more...

Scala and me

fsharp scala clojure sicp
This epic journey (yeah right) began at Uni with discovering the mighty SICP, still the best book on programming I’ve read (and let’s face it, the best I will ever read). After that profound experience I kept an eye on the Lisp/FP world and wrote some toys in Scheme, ELisp, OCaml every now and then. One thing that dawned on me was that none of these languages had much practical use, they weren’t very applicable to real-world software problems. Read more...

Clojure Hacking on the Samsung ARM Chromebook

clojure chrome arm rpi
I recently switched to the Samsung ARM Chromebook for all my laptop needs. The pitch it’s quite appealing, 200 quid, dual core ARM CortexA15s, good keyboard, totally fan-less (CPU is passively cooled), good battery life, 1kg weight. The one downside is it’s quite limited RAM size, just 2GB. But with a decent swap file, I’m running multiple JVMs (with Datomic, Elasicsearch, CLJS compiler etc without any hickups). Out of the box it runs ChromeOS, which I have to say is pretty stellar for browsing and consuming content on the web. Read more...
Previous Page 3 of 7 Next Page