by Dave Kruse | Apr 4, 2016 | Development, Haxe, Javascript
In this the third part, we will look at classes and how haxe code is organized with modules and packages. Then we’ll peek under the hood and see how that translates to JavaScript.
JavaScript is a very flexible object oriented language, but that flexibility combined with the lack of the typical class construct you will find in ruby, java, c#, etc. results in a lack of standard convention. Conventions and standards are crucially important when code needs to be touched by more than one developer (or even the author who has since forgotten exactly what he was thinking at the time). While we have any number of libraries and frameworks to help implement convention, Haxe and its cousins (CoffeeScript, Typescript, Dart, etc) are popular because they offer more standardized implementation of classes, interfaces, inheritance, and modules.
by Dave Kruse | Apr 4, 2016 | Development, Haxe, Javascript
The Haxe toolkit consists of the language, a standard library, and a compiler. Here’s an example that shows how to compile Haxe.
The Haxe compiler is a command line tool predictably named “haxe.” Instead of continually passing options to the compiler on the command line, the convention is to keep options in a .hxml file.
A typical setup might include a directory for haxe source code and directory for compiled javascript:
by Dave Kruse | Apr 1, 2016 | Development, Haxe, Javascript
Haxe is a lesser known but quickly ascending language + toolkit. Haxe is used to write games, apps, and web apps on multiple platforms. Haxe itself is not natively supported, but rather it compiles to other languages including ActionScript, Java, C++, C#, Python, PHP, Node.js, and plain JavaScript. The ability to target multiple platforms has helped Haxe earn its primary identity as a game development tool. As such, you can easily find Haxe for game development resources. I am going to focus this blog series on Haxe and JavaScript for web applications.