Setting up an Erlang development environment - ide

I'm interested in looking at Erlang and want to follow the path of least resistance in getting up and running.
At present, I'm planning on installing Erlang R12B-3 and Erlide (Eclipse plugin). This is largely a Google-result-based decision. Initially this will be on a Windows XP system, though I am likely to reproduce the environment on Ubuntu shortly after.
Is there a significantly better choice? Even if it is tied to one platform.
Please share your experiences.

I highly recommend the Erlang mode shipped with the standard Erlang distribution. I've put together a "works out of the box" Emacs configuration which includes:
Syntax highlighting & context-sensitive indentation
Dynamic compilation with on-the-fly error highlighting
Integrated Erlang shell
And more....
You can browse my GitHub repo here:
http://github.com/kevsmith/hl-emacs

I've only done a small bit of coding in Erlang but I found the most useful method was just to write the code in a text editor and have a terminal open ready to build my code as I need to (this was in Linux, but a similar idea would work in Windows, I'm sure).
Your question didn't mention it, but if you're looking for a good book on Erlang, try this one by O'Reilly.

You could also try NetBeans there's a very nice Erlang module available: ErlyBird
Install Erlang: sudo aptitude install erlang
Install a recent JDK: sudo aptitute install sun-java6-jdk
Download and install (the smallest) NetBeans edition (e.g. the PHP one): www.netbeans.org/downloads
download the erlang module ErlyBird: sourceforge.net/projects/erlybird
manually install the modules via NetBeans
ErlyBird features:
syntax checking
syntax highlighting
auto-completion
pretty formatter
occurrences mark
brace matching
indentation
code folding
function navigator
go to declaration
project management
Erlang shell console

I'm using Erlang in a few production systems personally as well at the office. For client side testing, documentation and development I use a MacBook Pro as the OS/platform and TextMate with the Erlang bundle as an editor.
For sever side development and deployment we use RHEL 4.x/5.x in production and for editing I use VIM. Personally, I've got 4 machines (slices on slicehost.com) running Debian using Erlang for a few websites and jobs.
I try to go with the smallest 'engineering environment possible', usually the one with the fewest dependencies from apt or yum.

To add to the Emacs suggestions, I would also recommend that you look at the advantages of distel when running the Emacs erlang-mode.

I've seen answers suggesting TextMate here, so I wanted to add another good Mac OSX tool:
ErlangXCode plugin to XCode.
I've been using this since I started with Erlang and really do like it.
The download link on his blog is broken, here's the real download:
http://github.com/JonGretar/erlangxcode/tree/master

You could also try a virtual server on demand service like this one from CohesiveFT
Select the components you want (e.g. erlangrb12 + yaws + MySQL + erlyweb) and it will build a vm image for you to download or to put onto ec2.
Rolling you own locally is quite straightforward too if you follow the instructions in the pragmatic programmers book Programming Erlang

Just a quick note:
The Erlang "compiling" process described in Ciaran's post (described for Ubuntu 6.10 btw) can be easily skipped using apt command in any Debian based distro:
apt-get install erlang
Do not forget to install these packages if you see it fit:
erlang-doc-html - Erlang HTML document pages
erlang-examples - Some application examples
erlang-manpages - Erlang MAN pages
erlang-mode - editing mode for Emacs
Good Luck!

I like Justin's suggestion, but I'll add to it: this solution is great for learning a language. If you don't rely on something like code-completion, then it forces you to learn the language better. (If you are working with something with a huge API, like Java or Cocoa, then you'll want the code completion, however!)
It's also language-agnostic, and in the case of an interpreted language, particularly one that has an interactive interpreter, you'll probably spend just as much time in the shell/interpreter typing in commands. Even in a large-ish python project, I still work in an editor and 4 or 5 terminal windows.
So, the trick is more about getting an editor which works for you. I'm not about to suggest one, as that's heading towards evangelism!

I just use Scite. Type something and press f5 to see the results.

Just wrote a guide on this on my blog, heres the abridged version:
Part 1: Download what needs to be downloaded.
Download and install the Erlang run-time.
Download and install TextPad.
Download a .syn file for Erlang and place it in the system folder of TextPad. For me, this folder was C:\Program Files\TextPad 5\system. I'm not quite sure who did this syn file (the site is in another language), but they did a good enough job.
Part 2: Set up syntax highlighting.
Open up TextPad. Ensure no files are opened. Go to the 'Configure' menu, and select 'Preferences'. In the preferences window, click 'Document Classes'. There should be a list of currently recognized languages. Click the 'New' button (it is right under the list of languages), and type 'Erlang'. Click apply.
Click the '+' button next to 'Document Classes'. This should expand the list, and Erlang should now be on it. Click Erlang. You should see a list of file extensions associated with Erlang, click 'New', and type '*.erl'.
Now click the '+' button next to 'Erlang' on the left. This should expand a list of several more menus. Click on 'Syntax'. Click the drop down menu and select erlang.syn. If erlang.syn is not there, then the .syn file was not properly placed.
Feel free to edit some other syntax options to customize TextPad to your liking.
Part 3: Compiling from TextPad.
Note: as of 12/05/08 there are severe problems with compiling in textpad. The Erlang shell somehow ignores new compilation when it is done in text pad. This is only useful for checking for errors, when you want to actually run the code, compile it in the Erlang Shell.
In the preferences menu again, click 'tools' on the left.
Click the 'Add' button and select 'Program...'. Navigate to the erl5.6.5\erts-5.6.5\bin\ folder and select erlc.exe. Select and single click the new entry in the list to rename it. Click 'Apply'.
Now click the '+' button next to Tools on the left. Select erlc, or whatever you have named the new tool (I named mine 'Compile Erlang'). The parameters field needs to read '$File', and the initial folder field should read '$FileDir'.

I have had good success with Erlide.

If you use Vim I recommend you Vimerl (http://github.com/jimenezrick/vimerl):
Features
Syntax highlighting
Code indenting
Code folding
Code omni completion
Syntax checking with quickfix support
Code skeletons for the OTP behaviours
Uses configuration from Rebar
Pathogen compatible (http://github.com/tpope/vim-pathogen)

From what i've tried (and are still up to do), a good addition to an erlang dev. environment would be a virtual machine running ubuntu/yaws/erlang. Perhaps Erlyweb (erlang/yaws framework) would be nice checking out too.
Ciaran's posts (this would be the first of his "series") about his erlang install is nice, as he details the steps in setting up the server (and other stuff like xmpp with jabberlang).

Since you're switching to Ubuntu eventually anyways, I highly recommend using erlang-mode for emacs (which comes bundled with the Erlang distribution). It is officially what all the core developers use and what many other developers use because of the many features it offers you.
Installing the Erlang distribution itself should be simple :)

Related

Bugzilla install on Windows 7 with Apache & Mysql

Environment:
Windows 7 Pro 64 bit.
Apache 2.2.25
ActivePerl 5.18.2 Build 1802 (64 bit)
Bugzilla 4.4.5 (extracted)
Okay, I have followed step-by-step instructions as indicated here: https://wiki.mozilla.org/Bugzilla:Win32Install
There's 1 major issue that I've researched all day and cannot find a solution. It's the "ppm install DBD-mysql" issue. There is no "DBD-mysql". When I use the ppm gui, there's a DBD-mysqlpp , but that's not what's needed.
When I run in a command window: C:\bugzilla\checksetup.pl , I get the only error:
Checking for DBD-mysql (v4.001) not found
For MySQL, Bugzilla requires that perl's DBD::mysql 4.001 or later be
installed. To install this module, run the following command (as Administrator):
ppm install DBD-mysql
Well, I found DBD-mysql 4.028 here: http://search.cpan.org/~capttofu/DBD-mysql-4.028
However, trying to get the perl ppm (perl package manager) gui to see it, but even pointing the link in the gui preferences it still wouldn't see it to download and install it. This sucks.
So, I manually downloaded it and saw some crap "makefile.pl" file. Look, I use WINDOWS not LINUX, so naturally I rolled my eyes but it quickly became clear that I HAD to do this. Well, after about an hour of screwing around I was finally able to make a mysql_config.pl file. Oh wow, great.... now what!? What do I do next with this??
Not only is this part aggravating, but now I need mod_perl in my Apache. Okay, so I look in my .conf file where I can uncomment:
#LoadModule perl_module modules/mod_perl.so
Guess what... it's not there. (facepalm)
So I researched and downloaded mod_perl 2.0.8 from: http://perl.apache.org/download/index.html
Heh, ... guess what... another damn "makefile" file!! Let me tell you, this is as bad as being a MAC user in the late 90's and trying to find a program to be compatible.
So, my 2 main questions are these:
How do I get DBD-mysql properly installed
How do I get the mod_perl properly installed
I have been working 12 hours non-stop trying to get Bugzilla installed. At this point, I'm so frustrated beyond believe I'm ready to scrap this and install flyspray or some other php/mysql bug tracking system.
For future reference in case anyone stumbles upon this item:
Most Perl modules have installation instructions, either in their .pod documentation or in a README or INSTALL file.
Most Perl modules follow a similar installation mechanism: create a makefile; run make; make test (which runs a set of tests, unsurprisingly), and then install the module. From the commandline, this looks like the following:
$ perl Makefile.PL
$ make
$ make test
$ make install
Both mod_perl and DBD::mysql have platform-specific installation information in the release notes.
DBD-mysql is a package that you can find in ActiveState Package Repository. That means that it should be installed at the time you installed ActivePerl, making your question really strange. I know it because I just did it yesterday, and everything worked just fine.
A possible solution for this issue is:
Open the command line in Windows;
Type ppm, press enter and wait. A GUI for the Perl Package Manager will be displayed;
Search for DBD-mysql. If you find it, schedule it for installation by right-clicking it and clicking on Install DBD-mysql 4.022;
Although, you probably won't find it. If you don't, press Ctrl+P and, in the dialog that appears, select the Repositories tab. Add a new repository:
Name: ActiveState-Package-Repository
Location: http://ppm4.activestate.com/MSWin32-x64/5.16/1604/package.xml
It will update the list of packages. Repeat steps 1 to 3.
If you prefer doing it by the command line, these are the instructions:
ppm repo add ActiveState-Package-Repository http://ppm4.activestate.com/MSWin32-x64/5.16/1604/package.xml
ppm install DBD-mysql

automate setup of IBM RAD and Websphere

In a project we a forced to use IBM RAD and Webspher Application Server (6.1).
Setting up the development environment is currently described in about 10 pages of wiki documentation and takes about a day if you don't do any mistake. The main parts are:
Installing the IBM Installer;
Use it to install RAD
Install a patch to the Installer;
use it to install half a dozen patches to RAD
create a network drive pointing to ...
checkout project source to ...
install WAS
configure the a WAS instance with two jdbc drivers, 6 datasources, a queue ...
I think you get the idea
I'd like to automate that process (or at lest 95% of it) to something like.
start script x.
On prompt enter a directory with at least yGB of memory available.
Get yourself a cup of coffee
start working.
What are the proper tools to get this working? Should I use something like puppet and chef? Or is that overkill and I can just zip the installation directory and change 2 registry entries?
Has anybody experience with this? Any pointers to get started?
You can script the configuration of WAS using wsadmin:
http://pic.dhe.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=%2Fcom.ibm.websphere.base.doc%2Finfo%2Faes%2Fae%2Fwelc6topscripting.html
It is some effort to learn how to do so but in the end it saves a lot of time. You need to use Jython or Jacl to do so.
WAS profiles can be created headless with a response file. Use manageprofiles.bat in bin directory of WAS to do so.
Regarding RAD installation you can install the IBM Installation Manager version you need to install the patches right away and then install everything in one shot. Add the fixes you need as Repositiories right from the beginning. The fixes will be installed instead of the old versions in this case. You should have the base images and all fixes on the local disk to do so.
The installation of RAD itself can also run in headless mode but I don't have any experience in doing this.
The configuration of the RAD workspace is the next thing you want to automate. This is not so simple to do. The simplest thing you can do is to export the workspace preferences of a workspace that contains all settings to an eclipse preference file (.epf). File -> Export
This is not a complete solution but may help you a bit. Be sure to keep all settings in just one file and import that into a fresh workspace.
Use Notepad++ TextFX plugin to sort the settings in the epf file. You can then figure out which settings you need just by looking at them.
More control over the workspace settings and automated conifiguration requires accessing eclipse internal APIs and some coding.
Regarding the the project sources it depends on the SCM you are using.

What is the difference between Lazarus and CodeTyphon

Firstly, I saw some topics about these two but weren't my answer.
I'm looking for a good FPC(Free Pascal Compiler) IDE on GNU/Linux.
There are some IDE's like Lazarus and CodeTyphon. I need suggestion to choose one of those.
I've tried Lazarus once but all windows was separated. It looks messy and not interesting.
I would like to know what are the distinguishes between these two ?
I would like to know advantages / disadvantages each of those. Thank you
CodeTyphon is a distro of Lazarus, like Ubuntu and Debian are distros of Linux.
CodeTyphon comes with a large package of components and plugins, that otherwise you would have to google and download and install.
CodeTyphon have their own idea what are stable versions and what are not stable yet for both of FPC (compiler) and Lazarus(IDE). Whether their assessment is better or worse than upstream's Lazarus Team's, I don't know.
What about one-single-window plugin, it is work-in-progress and it doesn't seems to me it is ready for production use, no matter would you get it as part of CT or download and add it to vanilla Lazarus. However maybe it better works on Linux than on Windows, I don't know.
There were however issues with code legality in CT grande bundle. It is widely believed that Orca (if I remember the name) violates copyrights of glScene/vgScene, which also happened in early Delphi FMX releases but was fixed by EMBA later. There also were disputes in FPC forums/wiki about CodeTyphon pirating some open-source components. See answer by Peter Dunne below.
Your question is akin to asking the difference between Linux and Ubuntu. Lazarus is an IDE/component library, based on FreePascal (FPC). And CodeTyphon is a distribution of Lazarus and FPC. So CodeTyphon is just one way to install a functioning installation of Lazarus.
Lazarus uses the same floating window design as older versions of Delphi. Installing from CodeTyphon won't change that.
Myself and several friends highlighted several licensing issues with codetyphon
most of which could have been corrected by sourcing the included files from known good source and ensuring the correct license headers were included
PirateLogic refused to correct the issues which means they are using code in direct violation of the original license terms
The fact its open source code does not change the fact they are pirating the code by not including the correct license even after the issue was highlighted
I also found several instances of copyright code included which appears to be proprietary and not FOSS at all
They also changed the path & file names on some libraries so that source is no longer compatible with standard lazarus/component installs
This in my view is totally illogical
These 2 factors heavily undermine what was potentially the best FPC/Lazarus distro
Hardly professional
Lazarus can be a daunting installation process due to it's nature as a cross compiling environment. You don't just download an installer and click ok. A typical "installation" is actually a bootstrap FPC compiler doing a three-pass compilation of an "install". There are plenty of good installation scripts/methods from the official Lazarus/FPC team and in the community for a . But, understandably, the installation process is a skill in itself.
CodeTyphon is a a different/separate branch of an installer system, which is more of a utility suite/tools/third party code compilation library. If you want the simplest installation experience go with CodeTyphon. It has the nice graphical front end for managing the compiler. You can conveniently do the fancy stuff like build "cross-compilers" for almost every "target" operating system out there. It also is jam packed with hundreds of the best components/libraries pre-installed. It is a very actively maintained project and very professional. A whole lot of work is done for you.
Even if you want to be learn the low level compiler capabilities, CodeTyphon is a good place to start. It is written in FCP/Lazarus and is open source. Simply study it as "working demo app" and the other info on the compiler details. If you crash it, at least you don't have to learn to climb the hill. You get to get to start from the top and lose control on the way down. Start from scratch (and a three hour reinstallation) Hahaha
Lazarus also has a package "AnchorDock" which allows you to dock all the windows into one. Either install the anchor dock design package after installing Lazarus, or install Lazarus using the script at getlazarus.org which will do it for you.

Cygwin & OCaml: OPAM + Batteries

I extensively use Cygwin on a Windows 8 environment (I do not want to go ahead and boot/load Linux directly on the machine). I use the OCamlIDE plug-in for Eclipse and have experienced relatively no problems using this workflow setup.
However, I would like to use Batteries so that I may make use of use of its dynamic arrays among a few other interesting features that will speed up my development process.
I have tried this method: http://ocaml.org/install.html, but I get the following error:
$ sh ./opam_installer.sh /usr/local/bin
No file yet for i686:CYGWIN_NT-6.2-WOW64
What am I missing and how would I configure Cygwin so that it can accept the Opam installer? When I tried yet a different way of building Opam, I got:
'i686-w64-mingw32-gcc' is not recognized as an internal or external command,
as a Makefile error and reason for building failure. It seems something is wrong related to mingw32-gcc, what do I need to install and/or configure for my Cygwin to get it to compile/build things properly. I have wget and curl installed as well.
My overall question: What is the best way to get Batteries installed on my system with the minimum of time spent tracing all of its dependencies by hand? Is there a way I can just build the library module, such as BatDynArray and the includes:
include BatEnum.Enumerable
include BatInterfaces.Mappable
That way I can just call them directly in my code with open...;; and/or include...;;;
OCaml works beautifully on Windows with WODI, which is a Cygwin-based distribution that includes Batteries and tons of other useful packages (which are a pain to install manually on Windows).
I urge you to take a shot at WODI, which I believe to be an indispensable tool for the
rest of us, the forgotten souls, who have to deal with Windows.
First of all, include does not do what you think it does. open Batteries should be exactly what you're looking for. OPAM is not yet solid on windows (maybe Thomas could give an update on where things stand).
Frankly, I would recommend to install a linux on a VM, you should be able to get started with OPAM instantly then. Otherwise, take a look at this package manager for OCaml which focuses on cross platform support: http://yypkg.forge.ocamlcore.org/. I've never tried it myself however. The last package manger you could try is GODI, I'm not sure about its windows support though.
Finally, if none of these options work then it should be possible to install batteries from the source. All you need is OCaml and make. And if there are problems with this approach then you should definitely follow up on them either here or on the bug tracker because batteries does intend to support windows AFAIK.

How to remotely develop software?

Suppose I have a server that runs on Linux on which I would like to develop software (mainly OCaml, C/C++ and Java).
Is there a way to "remote develop" these things? I mean an IDE that allows me to modify files remotely (they are then uploaded when modified and saved) and to compile through SSH (basically invoking make or omake).
I was looking for something that makes this process transparent to the developer, without caring of doing things by hand. I'm used to use Eclipse so I wonder if a plugin to achieve this exists or if are there other choices?
Mind that it may happen that the local machine it not able to build software I intend to (for example for OCaml) so it should rely just on remote connection.
Thanks in advance
You can use X11 forwarding. Even if you are connecting from a Windows machine.
If you are on Linux, connecting with ssh -Y might work right out of the box for you:
ssh -Y user#your_server
eclipse &
Well the simplest idea I can think of, though it is rather brute force would be to just open up a file share to the server and then edit the file directly through Eclipse.
If that doesn't work for Java at least you could make use of Maven to do some of those tasks. I am less certain about invoking Make though.
I think your answer is IDE-centric.
KDE's ioslaves support access over both SFTP and SSH (using fish, which uses a Perl script uploaded to the remote machine). I believe Gnome also has a virtual file system (gvfs) which supports remote filesystem access.
My recommendation, therefore, is to choose an IDE which supports a virtual filesystem that can operate over SSH/SFTP and allows you to specify the build command. You would then only need to specify the build command which would get its output from the remote make command (for example, vim has a makeprg option which can be set to any arbitrary command).
Depending on how 'remote' this is; why not ssh in and run the IDE remotely over X?
Using a build tool (Hudson for example) you could put a build agent on your remote server, check your changes into your repository as normal, and have it do a build when you check in changes (it will either do a repository hook or poll for changes, probably). Your build process will be the same, it will simply be automated. :-)
emacs has tramp, which lets you both open and save remote files, and open a shell on a remote system. Working with tramp is almost exactly like working with local files, except for the filename. To open 'foo.c' on the machine 'bork' as user 'joe' I open it with the standard emacs commands, giving it the pathname /joe#bork:foo.c
I use vim for remote development. (Well, I use vim also non-remote.)
If building is the problem, have you thought about simply using an automated build system where you commit to svn and the system then automatically builds the software? I've heard many good things about these sorts of systems, although I haven't quite tried any out myself.
As for remote development, a SVnDAV solution might be reasonable. It basically commits your every save and is completely transparent to the text editor you're using. However a probably much nicer solution would simply be to use a networked drive/directory and edit files remotely. On all unix-based systems this should work completely transparently to both the developer and the text editor.
Your choice of IDE will have the most impact on the answer to "can I?". If your IDE of choice is CLI based than you can always just SSH in, fire up screen (so that your CLI session is persistent across SSH sessions), and have at it!
Use vim or emacs since they will offer you speed. I know there is a learning curve associated with these editors; but once you get comfortable in any of them; you will be able to work on them as good as with Eclipse or any other IDE.
If you already have a linux server then I would suggest setting up a simple VPN server. I have done this in the past and it works pretty well. This way you can connect and modify/build your files with any "local" OS. I did this cause I use mac, pc and linux through various parts of the day and in multiple locations, so the VPN allowed me to edit files remotely w/out having to allow file sharing over the internet.
There are plenty of tutorials about how to achieve this even if you are newer to linux. I use ubuntu server on my linux box and here are the tutorial I have used.
http://www.ubuntugeek.com/howto-pptp-vpn-server-with-ubuntu-10-04-lucid-lynx.html
Netbeans 7.3 has a new feature which addresses your problem (and mine). Here's the tutorial.
https://netbeans.org/kb/docs/cnd/remotedev-tutorial.html
note: I realize it has been 3 years since this question was asked so the answer may be irrelevant to #Jack now.
One IDE that supports exactly your language set is Nuclide. It adds some packages to Atom and is used internally in Facebook exactly as you have described - full-fledged remote development in C++, Java, and Ocaml.
If a friendly file editor is enough for you then I'd recommend to use Jupyter.
Super fast installation
Built in server/file editor that starts with one command