Premise Go is great. Scala is great. Scala has Try s. Go doesn’t. Motivation I’m a horrible person. ¯\_(ツ)_/¯ Horribleness In Go it’s typical to return error s as soon as they happen and handle them locally, or wrap them with some additional context and pass them back up the stack. In Scala however it’s idiomatic to wrap an error into a Try which represents either a successfully computed value or…
Concurrency has many different abstractions: There are the classic processes and threads , the older but newly-new actor-based concurrency , CSP style concurrency (looking at you Go), and the quite popular future/promise. There are more, but one thing they all have in common is the goal to create a better way to achieve concurrent computation. This is great, if we understand what we’re…
Every Scala development team should be writing their own SBT plugins. If you’re not then you’re doing it wrong . This is an assertion assumption I am making based on what I’ve seen so far in my limited experience working on/with various teams and their Scala applications. Standards Organizations (not just large ones) typically have standards. Standards for various things including code style…
So you have a static site in Jekyll that you want to deploy to Heroku . Lucky for you, this is a relatively easy task and does not require anything as complex as a deployment server as mentioned in the Jekyll docs. You can support this with a simple Rack script. For those not familiar, Rack is a bare-bones web-server adapter in Ruby. Most Ruby web-frameworks sit on “top” of Rack while the Ruby…
Sometimes you need to inspect some heterogeneous JSON documents. When it comes to working with JSON there are a lot of great libraries out there. However, there aren’t many tools out there that allow me to work with JSON in the shell without resorting to writing small custom bits of Python or Ruby each time. And even this doesn’t always get me as far as I’d like it to without writing larger blocks…
Actors are a fantastic way to model concurrency and a much easier mental model than when working with plain threads and shared memory. However let’s say that you’re writing a very simple library that needs to run some simple background tasks. You could pull in one of the popular Actor implementation libraries out there, but they don’t come for free and can sometimes be heavy-weight. There is a…
When building web services we need to define a contract of how the service will operate and how the client should communicate with the service. One important piece to this is the data that the service returns (usually on read operations) and the data the service expects to receive (usually on write operations). One really fantastic way to do this, especially when working in a language like Scala,…
This relates to my other post “ Typed Actions In Play ”. You may want to skim it to understand my aim in all this madness. I’m on quest. I am attempting to create some abstractions that allow me to work solely with well-typed models for the purpose of developing web services. I am primarily working in JSON which means I just need to come up with a sound data-model for the JSON that I expect to…
This is just something I was playing around with when discussing how to build proper tooling for our teams at work. Play has the idea of an Action which is basically a function that takes a Request object and returns a Result object. Each of those can be parameterized for the content type being transmitted. However, when you’re working in an API, you typically work with some exchange format (e.g.…
I’ve been doing a bit of Jenkins plugin development lately and I have found that documentation can be a bit scarce. Like many projects out there, they show you how to drive a nail and then expect you to go off and build a house. I’m posting a little bit of what I have created in hopes of either sharing some much needed documentation or being shown a better way to do things. While building my…