HAXEOne codebase to rule ‘em all
GETTING AQUAINTED• Created by Nicolas Cannasse (who also created the MTASC-compiler) in  2005• First Beta released on 2006...
LANGUAGE FEATURES• Multi-platform: write haXe source code and deploy to  => mobile (Windows Phone, iOS, Android, webOS all...
LANGUAGE FEATURES• Macro’s allow you to write code that executes against your application at  compile-time. This allows fo...
LANGUAGE FEATURES• Rich Type system  => Void, Null, Dynamic, untyped (bypass type-checking)  => Array, List, Hash with nat...
LANGUAGE FEATURES• SPOD Macro’s: Simple Persistent Objects Database Library  => similar to an ultra-lightweight version of...
THAT’S COOL!
IT COMPENSATES A LITTLE FOR EVERYDAY REALITY FOR MOST OFUS…
SO, IS IT ALL GREAT?Actually: YES! BUT:• Writing cross-platform code is not always easy• It takes some practice and exper...
CROSS-PLATFORM TIPSAbstract display hierarchy through composition
CROSS-PLATFORM TIPSEncapsulate low-level drawing and styling
CROSS-PLATFORM TIPSSeparate domain and presentation layers=> application logic is universal=> presentation logic can diffe...
CROSS-PLATFORM TIPSImplement a device-agnostic UI=> the number of devices that applications can (and will!) run on increas...
CROSS-PLATFORM TIPS
CROSS-PLATFORM TIPS
CROSS-PLATFORM TIPS
CROSS-PLATFORM TIPSCriticise yourself• Just because you have the power to do a lot of things doesn’t mean you  always shou...
CROSS-PLATFORM TIPSGet started easily using NME• NME stands for Neko Media Engine• It’s an SDL-like wrapper for the haXe a...
DEMO TIME
RESOURCESBooks:• Professional haXe and Neko (Wrox)• haXe 2 Beginner’s Guide (Packt Publishing)Online:•    http://haxe.org ...
MY CONTACT DATA@sventunusfacebook.com/sventunushttp://be.linkedin.com/in/svendenssven.dens@gmail.comsven.dens@thesedays.com
THANK YOUA BIG thank you also goes out to all my friends and fellow-haXe-coders on themailinglist for inspiring me and all...
Upcoming SlideShare
Loading in …5
×

haXe - One codebase to rule'em all

2,643 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,643
On SlideShare
0
From Embeds
0
Number of Embeds
1,173
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

haXe - One codebase to rule'em all

  1. 1. HAXEOne codebase to rule ‘em all
  2. 2. GETTING AQUAINTED• Created by Nicolas Cannasse (who also created the MTASC-compiler) in 2005• First Beta released on 2006/02/04 => only Neko and SWF8 targets available• 2006/05/01: version 1.0 released => JavaScript target added• Today: version 2.08 => Neko, SWF8, SWF9, JS, C++, PHP targets available => C# and Java targets under heavy development• Open Source• Very active and bright community• Mature and fast compiler
  3. 3. LANGUAGE FEATURES• Multi-platform: write haXe source code and deploy to => mobile (Windows Phone, iOS, Android, webOS all using native code) => desktop (native code, AIR) => server (NekoVM, PHP, NodeJS) => web (Flash 6-11/HTML-Canvas-WebGL/JavaScript/PHP) => command line (C++, Neko)• Elegant remoting across all platforms: compiling the same remoting classes source code to different targets allows for successful and fast deserialization between different platforms• Syntax based on ECMAScript: easy switching for AS/JS developers, easy to learn for new developers or developers coming from other platforms• Strictly typed: compile-time checking across all targets, even for non- compiled languages like JS and PHP• Very fast compiler, blazing-fast serialization.
  4. 4. LANGUAGE FEATURES• Macro’s allow you to write code that executes against your application at compile-time. This allows for advanced code generation/customisation/optimization.• Use conditional compilation to handle different platforms• Type inference allows for less and more beautiful code• Function and constants inlining makes fast code faster• Enrich types and fields with metadata => accessible at runtime through the haxe.rtti.Meta API => or to be used by the compiler internals at compile-time• Fantastic Reflection API: using Reflect and Type allows for painless runtime type-checking and variable instantiation• Standard libraries work across all client and server targets (Math, Xml, Date, Http, …)
  5. 5. LANGUAGE FEATURES• Rich Type system => Void, Null, Dynamic, untyped (bypass type-checking) => Array, List, Hash with native iterators => Generics (with optional constraints), Typedefs, Enums• Function type inference• Dynamic functions: execute function logic on different data types using the Dynamic type for parameters and return type• Local functions: functions that exist as the value of a variable => e.g.: var functionVariable : ParamOne [[- > ParamTwo] ...]- > ReturnValue ;• Advanced cross-platform debugging with CallStack and ExceptionStack• Cross-platform logging and tracing
  6. 6. LANGUAGE FEATURES• SPOD Macro’s: Simple Persistent Objects Database Library => similar to an ultra-lightweight version of Hibernate => write haXe expressions instead of SQL => benefit from type-safety => supports metadata• Duck typing using type inference and anonymous types• Access full target platform API’s• Interface with existing platform libraries using Extern classes or use haxelib• Generated code is 100% compatible with existing target platform native code• Excellent runtime performance on all target platforms
  7. 7. THAT’S COOL!
  8. 8. IT COMPENSATES A LITTLE FOR EVERYDAY REALITY FOR MOST OFUS…
  9. 9. SO, IS IT ALL GREAT?Actually: YES! BUT:• Writing cross-platform code is not always easy• It takes some practice and experience to use it right• A solid IDE is only available for Windows (FlashDevelop). IDE’s for Mac and Linux exist, but they are not nearly a match for FD.• “PR” could be better: not always easy to find what you’re looking for on the website, most valuable info & help only available through the mailing list => BUT, big improvement: community moved to Google Groups last week• Unknown == often not loved: not always easy to convince your bosses/clients to move to a little-known platform
  10. 10. CROSS-PLATFORM TIPSAbstract display hierarchy through composition
  11. 11. CROSS-PLATFORM TIPSEncapsulate low-level drawing and styling
  12. 12. CROSS-PLATFORM TIPSSeparate domain and presentation layers=> application logic is universal=> presentation logic can differ greatly between targets and devices
  13. 13. CROSS-PLATFORM TIPSImplement a device-agnostic UI=> the number of devices that applications can (and will!) run on increasesvery fast
  14. 14. CROSS-PLATFORM TIPS
  15. 15. CROSS-PLATFORM TIPS
  16. 16. CROSS-PLATFORM TIPS
  17. 17. CROSS-PLATFORM TIPSCriticise yourself• Just because you have the power to do a lot of things doesn’t mean you always should• Make sense when writing your code and try to keep it maintainable• With great power comes great responsability
  18. 18. CROSS-PLATFORM TIPSGet started easily using NME• NME stands for Neko Media Engine• It’s an SDL-like wrapper for the haXe and Neko platform• Abstract away low-level stuff, deal with the funky juice
  19. 19. DEMO TIME
  20. 20. RESOURCESBooks:• Professional haXe and Neko (Wrox)• haXe 2 Beginner’s Guide (Packt Publishing)Online:• http://haxe.org (official haXe website)• http://groups.google.com/group/haxelang (new Google Group)• http://lists.motion-twin.com/mailman/listinfo/haxe (old mailing list)• http://www.haxenme.org (official haXe NME website)• http://www.joshuagranick.com/blog/Twitter: @haxelang, @ncannasse, @fponticelli, @tarwin, @internetsurfing,@cwaneck, @brunofonzi, @gamehaxe, @polygonal, @leesylvester
  21. 21. MY CONTACT DATA@sventunusfacebook.com/sventunushttp://be.linkedin.com/in/svendenssven.dens@gmail.comsven.dens@thesedays.com
  22. 22. THANK YOUA BIG thank you also goes out to all my friends and fellow-haXe-coders on themailinglist for inspiring me and allowing me to use/demo some of their stuff!

×