I was just thinking about how my Erlang dev environment has evolved, along with learning Erlang, over the past few months (As best as I can recollect):
1st Generation: Build and install Erlang OTP source on Raspberry Pi. Type short scripts into Erlang shell and execute. Edit small Erlang source files using the nano editor. Compile and run in the Erlang shell. Also, create an Emakefile to compile multiple source files. All via SSH from WinPC. Good for learning the basics of Erlang, but not much else.
2nd Generation: Inspired by Fred Herbert’s post, Install rebar3 on RaspPi, Try to learn the vim editor with Erlang plug-ins. I tried, I really tried, but in the end, I just had to give up on vim (and nano for that matter).
3rd Generation: Use Notepad++ (Including installing syntax highlighting for Erlang) to edit Erlang source on WinPC. Use WinSCP to transfer files to RaspPi to compile and run. I like Notepad++, and I use it in my day job quite often.
4th Generation: Installed Eclipse on WinPC. Installed Erlang plug-in Erlide. Required Erlang OTP to be installed on the PC too. Has syntax highlighting, and continuous compiling, so bugs show up as you save source files. Includes templates for application, supervisor, gen_server, basic modules, etc. I’m starting to get away from the RaspPi now. I really only need to execute on RaspPi, to for hardware dependent features, like reading switches and turning on LEDs. There was something I didn’t like about Erlide though. Maybe because I couldn’t see how the Eclipse/Erlide project structure jibed with rebar?. Maybe I just didn’t give it a chance.
5th Generation: Installed Vagrant on WinPC to create a virtual Ubuntu box, with the Erlang OTP and rebar3 installed, of course. I’m not going to try and describe Vagrant. Just check it out for yourself, if you haven’t already. You will not be disappointed. Mostly forget about the RaspPi now. Transfer and run the Erlang Beam files on the RaspPi when I need to. Edit source with Notepad++ on the Windows side, while compiling and running the Erlang applications on the Unix side via Vagrant’s synchronized folder. Now we’re getting somewhere. Erlang development really started to take off here. Hat tip to Garrett Smith for the suggestion to use Vagrant at Chicago Erlang.
6th Generation? I’ve been following Microsoft’s Visual Studio Code project since they released it in April, Didn’t think too much of it at the time, but MS continues to release updates. I just noticed that plugins are becoming available including a syntax highligter for Erlang. I’m going to switch to that editor for awhile, still using Vagrant, of course, and see how it goes. I’m not sure, but it should be possible to run VS Code in the Vagrant environment. I will have to give that a try.
How about you? Already got the perfect Erlang dev environment? Let me know. I need all the help I can get. Thanks.