Posts for the month of December 2007

The Year That Was, The Year That Will Be


It reached 36,000 download. I use AIOTrade for my trading, via my Neural Network prediction. For 2007, I invested 1 and got almost 300%, not bad. For trading in 2008, I'm now on opened position, let me see what another year will be. For AIOTrade itself in 2008, you may have guessed (or not), I'm planning to rewrite AIOTrade in Scala.


ErlyBird is now 0.15.2. It reached 2,500 downlaod. For 2008, I hope to integrate more features into NetBeans Schliemann project. For 2008, Erlang as a programming language will not be the choice for AIOTrade, I may tell why some day.

Scala for NetBeans

I'm a such lazy man, that I have to write some helpful tools before I do something. That's why, before trade, I had to write AIOTrade, before rewrite AIOTrade (Plan A - in Erlang, now dropped), I have to write ErlyBird, before rewrite AIOTrade (Plan B - in Scala) I have to write Scala for NetBeans. That's the cause-chain. Thanks God, I do not need to invent another language, there has been Scala.

Well, Scala looks very powerful and interesting, it's what in my eyes, a clean mix of Java + Ruby + Erlang, or, the JRE (Just Running Environment).

But it's so powerful in syntax, that is so difficult for a truly IDE supporting, that is so important to have an IDE as assistant (which will help writing Scala a lot). And, since I'm going to build things upon NetBeans as NetBeans' modules, the IDE of course has to be based upon NetBeans. I really hope there had been a good Scala supporting for NetBeans, but for 2007, there was none. So, how about 2008?

Happy New Year, everybody.

Happy New Year, especially to Beijing, the 2008 Olympic Game, although Life Is Always Elsewhere.

Scala for NetBeans Screenshot#4: Basic Completion

Scala for NetBeans now supports basic completion for keywords, functions of Predef, local var/val/function etc.

The screenshot shows the popup with candidate items when you typed "s" and pressed Ctrl+Space, including functions: scalProd(), sum() and val: scope in context of for.scala

Click on the picture to enlarge it


Scala for NetBeans Screenshot#3: Preliminary Marking Occurrences and Goto Declaration

When you put the caret on a var, val, or function id, for example, "userName" on the below screenshot, the occurrences of this var/val/function will be highlighting, and, on the right side bar, there are colored indicators telling you where are these occurrences.

You can also go to declaration of var/val/function too (only in same source file currently).

What does this mean? It means I've begun to do some semantic analysis on parsed AST.

Click on the picture to enlarge it


First Experimental Scala Supporting for NetBeans is Available

>>> Updated Dec 23: There is an updated Editing module at:


  • "{" of class/object/trait declarations can be put on new line
  • Some broken syntax fixed.



  • Syntax checking, highlighting, code folding, navigator, basic indent
  • Interactive Scala shell. [Windows] -> [Interactive Scala Shell]
  • Basic Scala project management with file locator for compile Errors

  • Requires NetBeans 6.0 Release
  • Don't forget to set your SCALA_HOME environment first, or append "-J-Dscala.home=scalahomepath" to the end of "netbeans_default_options" in your netbeans.conf file, where, "scalahomepath" is your Scala home's absolute path. For example: /Users/dcaoyuan/apps/scala/share/scala/
    The netbeans.conf is located at "pathToNetBeansInstallationDirectory/etc", in Mac OSX, it could be:

Know Issues:

  • Embedded /* */ comment is not supported yet.
  • Do not write old-style ForComprehension "for (val i <- ...)", instead, use "for(i <- ...)". Please see Scala Spec 2.6.0+
  • Do not put infix/postfix operator at the beginning of new line even in a parenthesis expression
  • When "<" is an operator, put a space after "<" to identify it from a xml element




  1. Upzip to some where, there will be several *.nbm files
  2. Run NetBeans, install these *.nbm files via [Tools] -> [Plugins] -> "Downloaded"

Scala for Netbeans Screenshot#2: Scala Console and File Locator for Compile Errors

The interactive Scala shell console works now, with 'up'/'down' key for command history.

And as ant based Scala project, the project building just works fine, in the building output window, you can click on the compiler error message to jump to the corresponding location of source file.

You may have also noticed, if an id is used as operator, it's highlighting in special color.

The case clauses are listed in the outline window.

Click on the picture to enlarge it


ErlyBird 0.15.2 Released - An Erlang IDE based on NetBeans

I'm pleased to announce ErlyBird 0.15.2, an Erlang IDE based on NetBeans. This is an important feature release in size of 17.9M.


  • Supported OTP/Erlang R12B new syntax.
  • A new Emacs standard color theme.
  • Fixed some formatter bugs.
  • Better syntax error message.
  • Various bugs fixes.

To switch color theme, open [Tools]->[Options], click on 'Fonts & Colors', choose 'Profile' drop-down box.

Java JRE 5.0+ is required.

To download, please go to:

To install:

  1. Unzip to somewhere.
  2. Make sure 'erl.exe' or 'erl' is under your environment path
  3. For Windows user, execute 'bin/erlybird.exe'. For *nix user, 'bin/erlybird'.
  4. Check/set your OTP path. From [Tools]->[Options], click on 'Erlang', then 'Erlang Installation' tab, fill in the full path of your 'erl.exe' or 'erl' file. For instance: "C:/erl/bin/erl.exe"
  5. The default -Xmx option for jvm is set to 256M, ErlyBird now works good with less memory, such as -Xmx128M. If you want to increase/decrease it, please open the config file that is located at etc/erlybird.conf, set -J-Xmx of 'default_options'.

When run ErlyBird first time, the OTP libs will be indexed. The indexing time varies from 10 to 30 minutes deponding on your computer.

Notice: If you have previous version ErlyBird installed, it's recommended to delete the old cache files which are located at:

  • *nix: "${HOME}/.erlybird/dev"
  • mac os x: "${HOME}/Library/Application Support/erlybird/dev"
  • windows: "C:\Documents and Settings\yourusername\.erlybird\dev" or some where

The status of ErlyBird is still Alpha, feedbacks and bug reports are welcome.

Scala Support for NetBeans Screenshot#1: Syntax Highlighting and Scala Project

Scala editor module has been integrated with existing Scala Project module. The xml syntax is almost supported. There are still a little bit complex syntax not be supported yet.

I hope a downloadable Scala modules package can be ready in one week, so you can get it from the NetBeans update center.

BTW, new version of ErlyBird is not ready yet, I'm waiting for fixing of some issues in NetBeans' Generic Languages Framework module.

Screen snapshot: (Click to enlarge)


Scala Editor for NetBeans

>>> Updated Dec 10: I've been granted developer role for netbeans' languages project, and committed the basic editing support code.

I wrote another NetBeans language supporting module, A Scala Editor. I've got most syntax working with syntax checking, highlighting, fold, navigator etc, except the xml syntax.

Since Scala is a newline aware language, the LL(k) grammar definitions is a challenge, I spent all my 2 days of this weekend to reach here.

There are a lot of works left for a full featured editor, after that, I'll release it to public, and contribute to NetBeans community.

Here's a screen snapshot: (Click to enlarge)