SlideShare a Scribd company logo
ROME 24-25 MARCH 2017
haxe language
my ten favorite
features
francis bourre
haxe
❤ story ?
why we chose haxe?
● Cross compiler for 10 targets (C++, JS, PHP, Java, Python, Lua…)
why we chose haxe?
● cross compiler for 10 targets (C++, JS, PHP, Java, Python, Lua…)
● free and open source toolkit
why we chose haxe?
● cross compiler for 10 targets (C++, JS, PHP, Java, Python, Lua…)
● free and open source toolkit
● statically typed programming language
And we discovered it was a
● cross compiler for 10 targets (C++, JS, PHP, Java, Python, Lua…)
● free and open source toolkit
● statically typed programming language
language features
So, what should I expect from a
GOOD programming language?
language features
● Great syntax/semantics
● Code readable and easily maintainable
● Compile time optimizations
● … And fun/intuitive to use :)
But, let’s start with...
Let’s start with
hello world
http://try.haxe.org/#8737E
My 10 favorite Haxe language features - Francis Bourre - Codemotion Rome 2017
conditional compiling
works in pair with compiler arguments
conditional compiling
works in pair with compiler arguments
inlining
Allows code blocks
to be directly inserted
instead of calling them
inlining
dry
http://try.haxe.org/#30082
inlining
constructor inlining
http://try.haxe.org/#B150C
● unused variables
● unreachable code
● and more...
http://try.haxe.org/#05485
dce and static analyser
code optimization
dce and static analyser
dce and static analyser
code optimization
type inference
strict typing without verbosity
automatic deduction of the data type
of an expression
type inference
type inference
http://try.haxe.org/#42127
type inference
how does it work?
type inference
works with composite types
static extension
augmenting types
static extension
augmenting types
static extension
augmenting types
array comprehension
initialize arrays with ease
abstract
modify/augment concrete type behaviors
abstract
example
abstract
Operators overloading
abstract
implicit casting
abstract
implicit casting
http://try.haxe.org/#859e3
metadata
@nnotations at runtime and compile-time
metadata
annotations @runtime and @compile-time
● class declaration
● any class field
● enum declaration and constructors
metadata
allowed values
● constants
● array declarations
● object declarations
metadata
example on class fields
metadata
example on method arguments
metadata
constant identifier
pattern matching
pattern matching
switch expression
Process of branching depending
on a value matching
pattern matching
match against values
pattern matching
match against fields
pattern matching
| operator
pattern matching
with guards
pattern matching
with extractors
Allows to check if transformations
match values
pattern matching
with extractors
pattern matching
with extractors
macros
macros
black magic @compile-time
macros
black magic @compile-time
● Initialization macro
macros
black magic @compile-time
● Initialization macro
● Build macro
macros
black magic @compile-time
● Initialization macro
● Build macro
● Expression macro
macros
expression example
macros
build example
macros
simple build example
macros
annotation/reflection parser example
hexMachina reflection builder
real macro use case
DSL compilation
DSL PARSING/ASSEMBLING FLOW
Xml Parser
parses
DSL PARSING/ASSEMBLING FLOW
Xml Parser Assembler
parses translates
DSL PARSING/ASSEMBLING FLOW
Xml Parser Assembler
Context
Factory
parses translates
Runtime @pplication
builds
DSL PARSING/COMPILING FLOW
Xml Parser Assembler
CompileTime
Factory
parses translates
Generated Code
generates
After compilation
JavaScript is generated
DSL CHECKING @compile time
type not found
and to conclude...
best feature ever
guess what
best feature ever
❤
haxe community
● haxelang - google group
● twitter - #haxe
● stack overflow
● HaxeFoundation - github
● haxe.io
questions ?

More Related Content

PPT
A First Look at Google's Go Programming Language
PDF
F# for Scala developers
ODP
PDF
PDF
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
PDF
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
PDF
Go language presentation
A First Look at Google's Go Programming Language
F# for Scala developers
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
Go language presentation

What's hot (20)

PDF
Static vs dynamic types
PPTX
Static typing vs dynamic typing languages
PDF
My 10 favorite haxe language features in 30 mins
PPTX
difference between c c++ c#
PDF
Golang 101
PDF
Getting Started with PHP Extensions
PDF
Lets Go - An introduction to Google's Go Programming Language
PDF
FregeDay: Design and Implementation of the language (Ingo Wechsung)
PDF
Integrated Language Definition Testing: Enabling Test-Driven Language Develop...
KEY
Remix Your Language Tooling (JSConf.eu 2012)
PDF
Difference between c# generics and c++ templates
PDF
On component interface
PPT
Programming Methodology
PPTX
Learn To Code: Introduction to c
PDF
Python for Swift
PDF
Difference between c, c++ and java
PDF
Swift Tutorial Part 2. The complete guide for Swift programming language
PPTX
A simple tool for debug (tap>)
PPTX
Dart PPT.pptx
PPTX
Switch case and looping
Static vs dynamic types
Static typing vs dynamic typing languages
My 10 favorite haxe language features in 30 mins
difference between c c++ c#
Golang 101
Getting Started with PHP Extensions
Lets Go - An introduction to Google's Go Programming Language
FregeDay: Design and Implementation of the language (Ingo Wechsung)
Integrated Language Definition Testing: Enabling Test-Driven Language Develop...
Remix Your Language Tooling (JSConf.eu 2012)
Difference between c# generics and c++ templates
On component interface
Programming Methodology
Learn To Code: Introduction to c
Python for Swift
Difference between c, c++ and java
Swift Tutorial Part 2. The complete guide for Swift programming language
A simple tool for debug (tap>)
Dart PPT.pptx
Switch case and looping
Ad

Similar to My 10 favorite Haxe language features - Francis Bourre - Codemotion Rome 2017 (20)

PDF
Haxe by sergei egorov
PDF
Haxe: What Makes It Cool
PPT
Introduction of Reach3dx
PPTX
haXe - One codebase to rule'em all
PDF
DTS s03e04 Typing
PDF
Programming Languages: some news for the last N years
PDF
Understanding Typing. Understanding Ruby.
PDF
Paulking dlp
PDF
Haskell Tour (Part 1)
PDF
DEVCON1 - BooJs
PDF
An Intro to Static/Compiled Languages
PDF
Dynamic Language Practices
PPTX
A Comparison of .NET Framework vs. Java Virtual Machine
PPTX
Basics of object oriented programming
PDF
Haxe Toolkit and Game Development
DOC
Maintenance of Dynamically vs. Statically typed Languages
PDF
Introducing haXe
PDF
Programming Languages #devcon2013
PDF
Software Engineering Thailand: Programming with Scala
PDF
Tech Talks @NSU: DLang: возможности языка и его применение
Haxe by sergei egorov
Haxe: What Makes It Cool
Introduction of Reach3dx
haXe - One codebase to rule'em all
DTS s03e04 Typing
Programming Languages: some news for the last N years
Understanding Typing. Understanding Ruby.
Paulking dlp
Haskell Tour (Part 1)
DEVCON1 - BooJs
An Intro to Static/Compiled Languages
Dynamic Language Practices
A Comparison of .NET Framework vs. Java Virtual Machine
Basics of object oriented programming
Haxe Toolkit and Game Development
Maintenance of Dynamically vs. Statically typed Languages
Introducing haXe
Programming Languages #devcon2013
Software Engineering Thailand: Programming with Scala
Tech Talks @NSU: DLang: возможности языка и его применение
Ad

More from Codemotion (20)

PDF
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
PDF
Pompili - From hero to_zero: The FatalNoise neverending story
PPTX
Pastore - Commodore 65 - La storia
PPTX
Pennisi - Essere Richard Altwasser
PPTX
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
PPTX
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
PPTX
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
PPTX
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
PDF
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
PDF
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
PDF
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
PDF
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
PDF
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
PDF
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
PPTX
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
PPTX
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
PDF
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
PDF
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
PDF
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
PDF
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Pompili - From hero to_zero: The FatalNoise neverending story
Pastore - Commodore 65 - La storia
Pennisi - Essere Richard Altwasser
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019

Recently uploaded (20)

PDF
Electronic commerce courselecture one. Pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Big Data Technologies - Introduction.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Encapsulation theory and applications.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
Electronic commerce courselecture one. Pdf
Machine learning based COVID-19 study performance prediction
Dropbox Q2 2025 Financial Results & Investor Presentation
Building Integrated photovoltaic BIPV_UPV.pdf
cuic standard and advanced reporting.pdf
Network Security Unit 5.pdf for BCA BBA.
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Empathic Computing: Creating Shared Understanding
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
The Rise and Fall of 3GPP – Time for a Sabbatical?
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Big Data Technologies - Introduction.pptx
NewMind AI Weekly Chronicles - August'25 Week I
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Unlocking AI with Model Context Protocol (MCP)
Encapsulation_ Review paper, used for researhc scholars
Encapsulation theory and applications.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Review of recent advances in non-invasive hemoglobin estimation

My 10 favorite Haxe language features - Francis Bourre - Codemotion Rome 2017