far away
from
the flock
Extending JS
Context importance
Use the right TOOL for the right THING
Find the context
Define the TARGET
List your NEEDS
Which kind of application?
Which kind of tools?
Tailor-made
solution
keep the LEAD
and properly answers to your NEEDS
Define the target
Define the target
long lifecycle
Define the target
long lifecycle
scalable/configurable
Define the target
long lifecycle
scalable/configurable
cross-platform
List our needs (toys)
universal code
List our needs (toys)
universal code
high performance
List our needs (toys)
universal code
high performance
errors at compile-time
List our needs (toys)
universal code
high performance
errors at compile-time
smart tools chain
List our needs (toys)
in the web apps
jungle
pixLib adventures
@2003
pixLib adventures
“Let’s grab knowledge from other Tech
eco-systems”
in the web apps jungles
@tweenpix.net 2003
2015 ...
Six Feet Under
How can I target
the browser now?
with a statically typed language
No interface @compile time
@2012
with extra benefits
@2004
what is ?
● free and open source toolkit
● free and open source toolkit
● statically typed programming language
what is ?
● free and open source toolkit
● statically typed programming language
● cross compiler for 10 targets (C++, JS, PHP, Java, Python, Lua…)
what is ?
● free and open source toolkit
● statically typed programming language
● cross compiler for 10 targets (C++, JS, PHP, Java, Python, Lua…)
● inlining, DCE, code optimization, meta-programming...
what is ?
DCE with
So, we went for Haxe and
developed
hexMachina
So, we went for Haxe and
developed
The golden trilogy
★ secure collaboration
★ code reusability
★ low coupling
Secure collaboration
design roles with contracts
Interfacedefine contracts @compile time
modular system with
configurable components
Code
reusability
Code reusability
every module is a micro-application
Hi dude!
I’m a module.
Code reusability
each module belongs to an unique domain
My domain is
“red”.
Code reusability
any MODULE can be added at anytime
Guess what,
mine is “green”.
Code reusability
every MODULE is configurable...
I was scaled.
What happened
to you dude?
Code reusability
Use composition to make new modules
I’m ready for v2.0
now… With more
features.
[Sigh…]
★ Low coupling
Use messaging
Use messaging
Let’s bring some communication now
message from “green” domain
Use messaging
Let’s bring some communication now
Am new here.
How we can talk
together?
Use messaging
At anytime...
Send a message.
It will be adapted for
me.
Use messaging
… with polymorph event flow
yellow
Adapter
adaptsmessages
MODULE micro-application
Each module can have its own
architecture
Yup!
I love
that shit.
★ Low coupling
prefer runtime coupling - USE IoC
Jimmy!
Answer me!
" Don’t call us, we will call you "
Hollywood principle
Dependency Injection
automatic injection with annotations
hexAnnotation
Do dirty reflection job @compile time
hexAnnotation
build reflection value objects
ClassDescription
instance
hexInject
for fast performances @runtime
{ properties : [
{ name: "photosService", type : hex_di_IGetPhotosService, injectionName : "", isOptional : false},
{ name : "galleryModel", type : hex_di_IGalleryModel, injectionName : "", isOptional : false}
],
constructorInjection : { args : []},
methods : [], postConstruct : [], preDestroy : [] };
ClassDescription
instance
Injection
Build configurable architecture
use Domain Specific Language
IMPERATIVE
and DECLARATIVE
programming mixed together
Use DSL with metaprogramming
hexIoC
Injection with DSL
DSL PARSING/ASSEMBLING FLOW
Xml Parser
parses
DSL PARSING/ASSEMBLING FLOW
Xml Parser Assembler
parses translates
DSL PARSING/COMPILING FLOW
Xml Parser Assembler
CompileTime
Factory
parses translates
generates
DSL PARSING/COMPILING FLOW
Xml Parser Assembler
CompileTime
Factory
parses translates
Generated Code
generates
DSL PARSING/RUNTIME FLOW
Xml Parser Assembler
Context
Factory
parses translates
Runtime @pplication
builds
DSL
hello world
DSL
hello world
DSL
hello world
Type declaration
String is default type
SERVICES
mapping
Module
constructor injection
After compilation
JavaScript is generated
INCLUDE
recursive files inclusion
INCLUDE
isomorphic applications
Fail early, fail loudly
DSL CHECKING
@compile time
DSL CHECKING @compile time
type not found
DSL CHECKING @compile time
missing ID
DSL CHECKING @compile time
file missing
DSL edition with
hexMachina
What’s next?
Recursive composition
context agregates contexts, that agregates contexts, that...
Contexts hierarchy
hierarchy is handled by DSL
DSL visual editor
@francisbourre / kid forever
member of @DoclerLabs

Extending JS WU2016 Toronto