|
Portal to the Milescript open-source development community.
Milescript is a strongly-typed language similar to C# and Java, but which compiles to Javascript. Milescript works with any legacy Javascript and any server framework available to Javascript, and provides many additional features.
The 'Parent' class to the right, together with the 'Child' class below, demonstrate specialized generics, function virtualization,
inheritance and abstract classes.
When compiled, linked against LibDom and run, with Child as
the 'main class,' these two classes alert "Hello World!"
|
|
1package com.milescript.test;
2
3import com.milescript.dom.*;
4
5public abstract class Parent {
6protected Array<String> messages =
7new Array<String>();
8
9protected void
assembleMessage(){
10messages.push("Hello ");
11}
12
13protected void
alertMessage(){
14assembleMessage();
15String finalMessage = "";
16for(String message in messages)
17finalMessage += message;
18window.alert(finalMessage);
19}
20}
|
|
|
|
1package com.milescript.test;
2
3public class Child extends Parent {
4
5protected void
assembleMessage(){
6super.assembleMessage();
7messages.push("World!");
8}
9
10public static void main() {
11Child c = new Child();
12c.alertMessage();
13}
14}
Eclipse Plugin Screenshot
|
Milescript brings the robustness and structure of
a high-level language to the client-side environment. It
incorporates a set of tools which facilitate the development and
distribution of Javascript programs.
- Compile time error checking
- Integrated unit testing
- Automatically generated documentation
- Distributable libraries which can provide Javascript hooks
- External classes for interfacing with legacy Javascript
- Code Condensation to reduce download size
- Provides Generic Types, Logger API, and much more...
Interested? Look around our site to learn more; and welcome to the Milescript community.
|
|
|
- Unit Testing
- Code Condensation
- Generated Documentation
- Distributable Libraries
- External Libraries
- Eclipse Plugin
|
The Compiler can generate condensed Javascript code which is significantly smaller than the original source.
|
The Compiler generates inline documentation to XML. You can transform the XML to HTML or other formats via XSLT.
An XSLT is provided by default to generate HTML documentation. This XSLT can be modified to create custom tags.
|
The Compiler utilizes the CrossCheck open source project to provide browser-less unit testing.
Units tests can be run in the Eclipse JUnit testing framework so you can see the green bar of programming happiness.
|
Several Javascript libraries have already been wrapped using Milescript external classes.
- Ext 2.0
- Dojo 0.4.3 Charting
- Google Base
We are busy wrapping more Javascript libraries and we welcome any contributions to the project.
|
|
|
|
|