#buildpacks #heroku #node.js #Opa #web development

Running Opa Applications on Heroku

TL;DR As I’ve mentioned before, Opa is a new web framework that introduces not only the framework itself but a whole new language. A lot has changed in Opa since I last posted about it. Now Opa has a Javascript-esque look and runs on Node.js. But it still has the amazing typing system that makes Opa a joy to code in. The currently available Heroku buildpack for Opa only supported the old, pre-Node, support. ...

#Emacs #Erlang #Functional Programming #OTP #rebar

Projmake-mode: Flymake Replacement

There is a great new Emacs plugin from Eric Merritt that like FlyMake builds your code and highlights within Emacs any errors or warnings, but unlike FlyMake builds across the whole project. You can clone the mode from here projmake-mode After cloning the repo to your desired location add this bit to your dot emacs file, replacing <PATH> with the path to where you cloned the repo. [gist]3794732[/gist] This Emacs code also uses add-hook to set projmake-mode to start for erlang-mode is loaded. ...

#Erlang

Maru Models: JSON to Erlang Record with Custom Types

Working with Erlang for writing RESTful interfaces JSON is the communication “language” of choice. For simplifying the process of JSON to a model the backend could work with efficiently I’ve created _marumodels. This app decodes the JSON with jiffy and uses functions generated by a modified version of Ulf’s exprecs to create an Erlang record. The generated functions are created with type information from the record definition and when a property is set for the record through these functions it is first passed to the convert function of _maru_modeltypes to do any necessary processing. ...

#Emacs #Erlang

Getting Flymake and Rebar to Play Nice

TLDR; Copy and paste the following into your elisp erlang-mode configuration to get flymake working with Rebar projects. (defun ebm-find-rebar-top-recr (dirname) (let* ((project-dir (locate-dominating-file dirname "rebar.config"))) (if project-dir (let* ((parent-dir (file-name-directory (directory-file-name project-dir))) (top-project-dir (if (and parent-dir (not (string= parent-dir "/"))) (ebm-find-rebar-top-recr parent-dir) nil))) (if top-project-dir top-project-dir project-dir)) project-dir))) (defun ebm-find-rebar-top () (interactive) (let* ((dirname (file-name-directory (buffer-file-name))) (project-dir (ebm-find-rebar-top-recr dirname))) (if project-dir project-dir (erlang-flymake-get-app-dir)))) (defun ebm-directory-dirs (dir name) "Find all directories in DIR. ...

Erlang Common Test Continuous Integration

Common Test is a well thought out integration testing framework for Erlang. If you are not using it you probably should be. However, it has one fault. It does not return non-negative exit status’ to the caller when the tests fail. This is a major oversight, and it makes it difficult to use as part of a continuous integration scheme or in a make based build system. The long term fix is for the OTP folks to resolve the issue in the ...

#Cowboy #Erlang #OTP #rebar #sinan

Sinan Releases and Being Right

Fred, of Learn You Some Erlang for Great Good, today posted on his blog about the problems around how rebar handles releases, Rebar Releases and Being Wrong. The problems he mentions and a few others are why, despite giving it a legitimate shot, I have found rebar unusable for my workflow to be efficient and stable while adhering to OTP standards at the same time. I suggest first reading his post, if you already use rebar, and then continuing on with the rest of this. ...

#batman.js #Cowboy #Erlang #Javascript #RESTful #web development #Webmachine

Cowboy and Batman.js for Erlang Web Development

Why Cowboy and Batman.js There are a lot of Erlang web frameworks out there today. Not all are modeled after the MVC model (see Nitrogen), but I think all of them are addressing the problem the wrong way. I recently gave a presentation, slides hereĀ and the code for this example here, describing my perferred method for using Erlang for web development and why I think it is the best way to go. ...