Lately, largely in response to exposure to some refactoring and programming style books, programming videos, and recent experiences at a code retreat, I’ve been beginning to reconsider my editor of choice.
As another Erlang experiment (and as a Lisp fan), I figured I would try to give Lisp Flavored Erlang (LFE) a try. However, per my normal requirements for learning new programming languages, I had to establish that it would not only work on Linux, but also on Windows.
I searched StackOverflow and found this post which indicates at least one other person has tried to get this working, however that person was not able to do so. Attempts to find other posts on the subject on Stack Overflow met with failure.
This was a little discouraging, but the post in question was over 5 years old, so I figured I would give it a try using MSYS2 and Mingw-w64.
The good news is this: I seem to have successfully built and got LFE running on Windows. I can’t say I can get it working in the exact same method as for Linux, and not without some tweaks to the scripts provided, but nonetheless, it is possible. It’s not even really that hard. In this post I will detail how.
This is a follow-up to my previous post about Erlang and Cowboy, except this time covering it with the rebar3 build tool.
First, let me predicate this a little bit. rebar3 is a cool build tool, and I like it because it’s pure Erlang (no special build environment needed on Windows) and because it supports hex.pm, the new package index for Erlang and Elixir. As I come from a heavy Python background, I love Python’s PyPI, and having something similar in Erlang seems like The Way To Go™. However, if your goal is simply to get up with Erlang and Cowboy in the quickest way possible, read my other post. Cowboy is set up to work with Erlang.mk and will require less set up in that environment (especially the Cowboy-specific templates) compared to the rebar3 approach.
Also be aware that there seem to be some intermittent certificate errors with hex.pm’s package server which causes TLS-related errors and may prevent you from pulling from the package manager server via rebar3. Hopefully this will be resolved soon…
This is the first in a series of posts on getting up and running writing microservices using Erlang and Cowboy, for those of us who chose to (or are required to) develop in a Windows environment.
Of course, one could get snarky and say “Install VirtualBox – done.” But let’s be a little more polite to the Windows users here. Windows is a supported platform for Erlang, so I want to provide assistance for those who choose, or need to use, Erlang in this way.
Without further ado…