#Erlang #rebar3

Rebar3 Features (part 1): Local install and upgrade

Update January 22, 2016: The original post has been modified to reflect that the commands install and upgrade were moved from the unstable namespace to the local namespace. Also added is use of the environment variable $REBAR3_ERL_ARGS in the run script which allows the user to specify custom Erlang VM arguments like: REBAR3_ERL_ARGS="+A10" rebar3 shell. Rebar3 comes with a lot of new and improved features. I’ll be publishing posts here to highlight some of these features over the coming weeks. ...

#Databases #Erlang #Postgres

Erlang Postgres Connection Pool with Episcina

Almost exactly a year ago I was looking to merge the many forks of Will Glozer’s Postgres client for use in a project at Heroku. Instead Semiocast released their client, I gave it a try and never looked back. (But note that David Welton, a braver person than me, is working on merging the forks of epgsql at this time). I found Semiocast’s client to be clean, stable and I liked the interface better. ...

#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. ...

#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. ...