25 June 2013

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. With Frinj I tried to marry some of the joys of one of my favorite programming languages (Frink) with the Clojure REPL. I was quite pleased with the results, and the response was encouraging.

Recently I started reading Odersky (again) and when I came to the chapter on implicit conversions I got the idea of trying to create a Frinj style DSL for the Scala interpreter. I could leverage some of the efforts made in Frinj (like parsing the Frink unit database) and the result is quite cool.

It’s indeed possible to create a very fluent and powerful DSL using some of Scala’s core language constructs!


Categories

Tags

Share this post


blog comments powered by Disqus