Alpha Features

Object-oriented language features

Like our initial pre-alpha, Milescript offers the typical features seen in object-oriented languages. We chose to implement them with a very Java-like syntax, as it's awfully well-known and familiar to most developers. Typical features like classes, interfaces, abstract classes, and virtual functions are largely identical to Java's notions of these things. In addition, we support .NET's notion of delegates - which are essentially strongly-typed function pointers - along with a generics feature quite similar to .NET's generics (but with a Java-inspired constraint syntax).

Bi-directional interop with JavaScript

Two non-Java features we support are easy usage of existing JavaScript code from within Milescript code, and easy usage of Milescript-generated JavaScript code from raw JavaScript. See external classes for information regarding usage of JavaScript from Milescript, and see exporting classes for information regarding usage of Milescript-generated JavaScript from raw JavaScript that doesn't know or care about Milescript.

Identifier condensation (makes generated JavaScript code smaller)

The Milescript compiler can replace your meaningful - but long-winded - identifier names for types, member functions, member variables, and function-local variables with tiny identifier names (usually no more than 3 or 4 characters per identifier). This is done automatically and transparently, and is applied only to the generated JavaScript (it doesn't mess with your Milescript source code one bit). This feature also works in conjunction with the export feature, letting you 'have your cake and eat it too' when it comes to identifier condensation.

Eclipse plugin

We have also created the beginnings of an Eclipse plugin for Milescript?. It currently lacks advanced features like code-completion and refactoring, but it does some fantastic things:

  • Create and build Milescript projects
  • Build integration
  • Syntax hilighting
  • Reporting of compilation errors (including hilighting code involved in the error) in Eclipse's typical manner.
  • Running unit tests (just use Eclipse's built-in JUnit runner!)
  • Setting Milescript compiler options (debug, condense, documentation generation, etc...)

Automated JUnit test generation

Milescript can automatically generate runnable JUnit code corresponding to all test cases you define in Milescript. This is done by generating Java code that uses The Frontside.net's cool CrossCheck tool and injecting your compiled Milescript code into its JavaScript environment. You can run the generated unit tests in Eclipse's JUnit runner if you're working with the Milescript Eclipse plugin?, or you can run them from the command-line using the automatically-generated Ant build script.

All that is required is that you have your test classes implement the core.TestSuite interface, have your test functions in this class begin with test, and tell the compiler into what directory your generated JUnit tests should be placed. The test generator is structured such that you can have multiple Milescript projects generate their tests into the same directory, and they won't collide or interfere with each other.

Automated API documentation generation

Milescript can automatically generate JavaDoc-style API documentation for you if you wish. It uses comments you place in your Milescript code to do so, much like JavaDoc. In addition, it also leaves information about your types and comments in xml files much like .NET's documentation facilities. This means that, in addition to the HTML documentation, you can also use the .xml files to create and style your own API documentation using a bit of CSS and XSLT. Even the regular HTML documentation that's automatically generated for you can be styled by modifying the default CSS stylesheet.

All of the API documentation for mscore, libdom, libutil, and libcrosscheck on the milescript.org website were generated by the Milescript compiler. All we had to do was comment the code and tell the compiler where to place the documentation.