SlideShare a Scribd company logo
1 of 19
Download to read offline
Haxe: What Makes It Cool
 Dev Ideas, episode 1


Brought to you by Chicken Wing Software
Hello, my name is...
 Eddie Sullivan
Founder, Chicken Wing Software
www.chickenwingsw.com
www.devideas.com
See also: UX Ideas
Haxe
     ≈
    JavaScript
               +   static types
                               +   Java-style classes
                                                        +
    type inference
                    +  algebraic types
www.haxe.org
Compiles to JavaScript, Flash, NekoVM, PHP, C++
Standard library
                + platform libs
                                +  RPC
Haxe is like JavaScript
(really ActionScript)
 Similar syntax and keywords (like function)
 Entire DOM-tree available
 Flash API available (no timeline)
 Can compile to .js file
 Can compile to .swf file
 Closures
 Regular expressions
DOM example
                             Example:
// Change an HTML element to a random color.
static function changeToRandomColor(id)
{
    var el = Lib.document.getElementById(id);
    var color = '#' + StringTools.hex(Std.random(0x1000000), 6);
    el.style.backgroundColor = color;
}
Haxe is like... Java
                             Example:
import js.Lib;
import StringTools;

class HaxeExample {
    // Required "main" function - called at startup.
    static function main() { }

    // Change an HTML element to a random color.
    static function changeToRandomColor(id)
    {
        var el = Lib.document.getElementById(id);
        var color = '#' + StringTools.hex(Std.random(0x1000000), 6);
        el.style.backgroundColor = color;
    }
}
Similarities to Java
 Java-style classes & inheritance
 Statically & strongly typed
 Single inheritance & interfaces
 Can compile to NekoVM, PHP, or C++
Some familiar keywords
      if/else          do/while
      true/false       new
      var              this
      try/catch        finally
      return           switch*
      enum*            for*

* Different behavior
Haxe is like... ML

 Type inference
     Types with less typing
 var x = "hello"; // x is a String
 var y:String;    // y is also a String
 x = 3;          // ERROR!

 Algebraic types (With enum and switch)
Haxe's enums
Defining the enum:
enum Command {
  sit;
  speak(word:String);
  move(x:Int, y:Int);
}
// ... inside a function
var cmd = Command.speak("Arf!");
Haxe's switch
Using the enum:
// ... inside a function:
switch (cmd) {
  case sit:
    this.sitting = true;
    case speak(text):
      trace(text);
    case move(x, y):
      this.location = new Point(x, y);
}
Haxe's for
More like "foreach" in C#
// ... inside a function:

var names = ['Ed', 'Fred', 'Ned', 'Ted'];
// Could have written:
// var names:Array<String> = ...

for(name in names) {
  trace("Hello " + name);
}
Other features
 Local functions/closures
 Type parameters (generics)
 Exceptions
 Dynamic & untyped values
 "Batteries Included"
      Remoting
     XML parsing/validation
     Sandboxing
     ...and much more!
Flash example (part 1)
import flash.display.Sprite;
import caurina.transitions.Tweener;
class Happy extends Sprite
{
    public function new(size:Float = 50)
    {
        super();
        graphics.lineStyle(1.0, 0x000000);
        graphics.beginFill(0xffff00);
        graphics.drawCircle(0, 0, size);
        graphics.endFill();
        graphics.moveTo(size * 0.3, size * 0.3);
        graphics.curveTo(0, size * 0.75, -size * 0.3, size * 0.3);
        graphics.drawCircle(-size * 0.225, -size * 0.3, size * 0.1);
        graphics.drawCircle(size * 0.225, -size * 0.3, size * 0.1);
    }
    // class continues on next slide...
Flash example (part 2)
   // ... continued from last slide
   public function start()
   {
       var that = this;
       Tweener.addTween(this, { rotation:360, time:2,
                                transition:"linear",
                                onComplete: start } );
       Tweener.addTween(this, { scaleX:.75, scaleY:.75, time:1 });
       Tweener.addTween(this, { scaleX:1, scaleY:1, time:1,
                                delay:1 } );
   }

    public function stop()
    {
        Tweener.removeTweens(this);
    }
} // End of class Happy
Flash example (part 3)
import flash.external.ExternalInterface;
import flash.Lib;

class Main
{
  static var happy = new Happy(25.0);
    static function main()
    {
      happy.x = 50;
      happy.y = 50;
      Lib.current.addChild(happy);
      ExternalInterface.addCallback("startHappy", happy.start);
      ExternalInterface.addCallback("stopHappy", happy.stop);
      happy.start();
    }
}
Flash example (part 4)
What it looks like:


Stop   -   Start
The Haxe Community
 Mailing list
 Forum
 Wiki
 Libraries / haxelib (lib.haxe.org)
 FlashDevelop
 More...
Thank you!
Chicken Wing Software - chickenwingsw.com
Dev Ideas - devideas.com
Follow me on Twitter: @eddieSullivan
Sign up for the newsletter to hear what's coming next
UX Ideas - uxideas.com

More Related Content

What's hot

... now write an interpreter (PHPem 2016)
... now write an interpreter (PHPem 2016)... now write an interpreter (PHPem 2016)
... now write an interpreter (PHPem 2016)James Titcumb
 
Scala: Devnology - Learn A Language Scala
Scala: Devnology - Learn A Language ScalaScala: Devnology - Learn A Language Scala
Scala: Devnology - Learn A Language ScalaJan Willem Tulp
 
Improving Dev Assistant
Improving Dev AssistantImproving Dev Assistant
Improving Dev AssistantDave Cross
 
07 Introduction to PHP #burningkeyboards
07 Introduction to PHP #burningkeyboards07 Introduction to PHP #burningkeyboards
07 Introduction to PHP #burningkeyboardsDenis Ristic
 
(Parameterized) Roles
(Parameterized) Roles(Parameterized) Roles
(Parameterized) Rolessartak
 
Why TypeScript?
Why TypeScript?Why TypeScript?
Why TypeScript?FITC
 
Introduction to Scala for Java Developers
Introduction to Scala for Java DevelopersIntroduction to Scala for Java Developers
Introduction to Scala for Java DevelopersMichael Galpin
 
Presentation on php string function part-1
Presentation on php string function part-1Presentation on php string function part-1
Presentation on php string function part-1Mysoftheaven (BD) Ltd.
 
Web Application Development using PHP Chapter 3
Web Application Development using PHP Chapter 3Web Application Development using PHP Chapter 3
Web Application Development using PHP Chapter 3Mohd Harris Ahmad Jaal
 
From Java To Clojure (English version)
From Java To Clojure (English version)From Java To Clojure (English version)
From Java To Clojure (English version)Kent Ohashi
 
10. session 10 loops and arrays
10. session 10   loops and arrays10. session 10   loops and arrays
10. session 10 loops and arraysPhúc Đỗ
 

What's hot (20)

Go Java, Go!
Go Java, Go!Go Java, Go!
Go Java, Go!
 
... now write an interpreter (PHPem 2016)
... now write an interpreter (PHPem 2016)... now write an interpreter (PHPem 2016)
... now write an interpreter (PHPem 2016)
 
Go Java, Go!
Go Java, Go!Go Java, Go!
Go Java, Go!
 
Introduction in php
Introduction in phpIntroduction in php
Introduction in php
 
Scala: Devnology - Learn A Language Scala
Scala: Devnology - Learn A Language ScalaScala: Devnology - Learn A Language Scala
Scala: Devnology - Learn A Language Scala
 
Love Twig
Love TwigLove Twig
Love Twig
 
PHP PPT FILE
PHP PPT FILEPHP PPT FILE
PHP PPT FILE
 
Introduction in php part 2
Introduction in php part 2Introduction in php part 2
Introduction in php part 2
 
Improving Dev Assistant
Improving Dev AssistantImproving Dev Assistant
Improving Dev Assistant
 
PHP for hacks
PHP for hacksPHP for hacks
PHP for hacks
 
07 Introduction to PHP #burningkeyboards
07 Introduction to PHP #burningkeyboards07 Introduction to PHP #burningkeyboards
07 Introduction to PHP #burningkeyboards
 
(Parameterized) Roles
(Parameterized) Roles(Parameterized) Roles
(Parameterized) Roles
 
Why TypeScript?
Why TypeScript?Why TypeScript?
Why TypeScript?
 
Using PHP
Using PHPUsing PHP
Using PHP
 
Introduction to Scala for Java Developers
Introduction to Scala for Java DevelopersIntroduction to Scala for Java Developers
Introduction to Scala for Java Developers
 
Presentation on php string function part-1
Presentation on php string function part-1Presentation on php string function part-1
Presentation on php string function part-1
 
Sa
SaSa
Sa
 
Web Application Development using PHP Chapter 3
Web Application Development using PHP Chapter 3Web Application Development using PHP Chapter 3
Web Application Development using PHP Chapter 3
 
From Java To Clojure (English version)
From Java To Clojure (English version)From Java To Clojure (English version)
From Java To Clojure (English version)
 
10. session 10 loops and arrays
10. session 10   loops and arrays10. session 10   loops and arrays
10. session 10 loops and arrays
 

Viewers also liked

Chicken Wing Dissection
Chicken Wing DissectionChicken Wing Dissection
Chicken Wing Dissectionchuckiecalsado
 
Grade11 life sciences practical task
Grade11 life sciences practical taskGrade11 life sciences practical task
Grade11 life sciences practical taskMbongiseni Ndaba
 
Chicken Leg Dissection PowerPoint, Muscular System, Skeletal System,
Chicken Leg Dissection PowerPoint, Muscular System, Skeletal System,Chicken Leg Dissection PowerPoint, Muscular System, Skeletal System,
Chicken Leg Dissection PowerPoint, Muscular System, Skeletal System,www.sciencepowerpoint.com
 
Ch10 muscle tissue
Ch10 muscle tissueCh10 muscle tissue
Ch10 muscle tissueKemUnited
 
Chickenwingdissection
ChickenwingdissectionChickenwingdissection
Chickenwingdissectionmsali_aphs
 
UNIT 3 JOINTS-LIGAMENTS-TENDONS & CARTILAGES
UNIT 3 JOINTS-LIGAMENTS-TENDONS & CARTILAGESUNIT 3 JOINTS-LIGAMENTS-TENDONS & CARTILAGES
UNIT 3 JOINTS-LIGAMENTS-TENDONS & CARTILAGESPatricia Castro
 
Chicken wing dissection
Chicken wing dissectionChicken wing dissection
Chicken wing dissectionJenny Dixon
 
Lesson 2 tendons, ligaments, cartilage and joints
Lesson 2   tendons, ligaments, cartilage and jointsLesson 2   tendons, ligaments, cartilage and joints
Lesson 2 tendons, ligaments, cartilage and jointsnmcquade
 

Viewers also liked (13)

Chicken wing prac hands 0n
Chicken wing prac hands 0nChicken wing prac hands 0n
Chicken wing prac hands 0n
 
Chicken Wing Dissection
Chicken Wing DissectionChicken Wing Dissection
Chicken Wing Dissection
 
Grade11 life sciences practical task
Grade11 life sciences practical taskGrade11 life sciences practical task
Grade11 life sciences practical task
 
Chicken Leg Dissection PowerPoint, Muscular System, Skeletal System,
Chicken Leg Dissection PowerPoint, Muscular System, Skeletal System,Chicken Leg Dissection PowerPoint, Muscular System, Skeletal System,
Chicken Leg Dissection PowerPoint, Muscular System, Skeletal System,
 
Ch10 muscle tissue
Ch10 muscle tissueCh10 muscle tissue
Ch10 muscle tissue
 
Life science grade 10
Life science grade 10Life science grade 10
Life science grade 10
 
Chickenwingdissection
ChickenwingdissectionChickenwingdissection
Chickenwingdissection
 
Exemplars tests, practicals & projects
Exemplars tests, practicals & projectsExemplars tests, practicals & projects
Exemplars tests, practicals & projects
 
UNIT 3 JOINTS-LIGAMENTS-TENDONS & CARTILAGES
UNIT 3 JOINTS-LIGAMENTS-TENDONS & CARTILAGESUNIT 3 JOINTS-LIGAMENTS-TENDONS & CARTILAGES
UNIT 3 JOINTS-LIGAMENTS-TENDONS & CARTILAGES
 
Revision
RevisionRevision
Revision
 
Chicken wing dissection
Chicken wing dissectionChicken wing dissection
Chicken wing dissection
 
Lesson 2 tendons, ligaments, cartilage and joints
Lesson 2   tendons, ligaments, cartilage and jointsLesson 2   tendons, ligaments, cartilage and joints
Lesson 2 tendons, ligaments, cartilage and joints
 
Chicken Anatomy & Physiology
Chicken Anatomy & Physiology Chicken Anatomy & Physiology
Chicken Anatomy & Physiology
 

Similar to Haxe: What Makes It Cool

Introduction to clojure
Introduction to clojureIntroduction to clojure
Introduction to clojureAbbas Raza
 
Haxe by sergei egorov
Haxe by sergei egorovHaxe by sergei egorov
Haxe by sergei egorovSergei Egorov
 
Clojure - A new Lisp
Clojure - A new LispClojure - A new Lisp
Clojure - A new Lispelliando dias
 
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...Domenic Denicola
 
PHP-03-Functions.ppt
PHP-03-Functions.pptPHP-03-Functions.ppt
PHP-03-Functions.pptJamers2
 
Svcc Building Rich Applications with Groovy's SwingBuilder
Svcc Building Rich Applications with Groovy's SwingBuilderSvcc Building Rich Applications with Groovy's SwingBuilder
Svcc Building Rich Applications with Groovy's SwingBuilderAndres Almiray
 
ES6 - Next Generation Javascript
ES6 - Next Generation JavascriptES6 - Next Generation Javascript
ES6 - Next Generation JavascriptRamesh Nair
 
Javascript variables and datatypes
Javascript variables and datatypesJavascript variables and datatypes
Javascript variables and datatypesVarun C M
 
T3chFest 2016 - The polyglot programmer
T3chFest 2016 - The polyglot programmerT3chFest 2016 - The polyglot programmer
T3chFest 2016 - The polyglot programmerDavid Muñoz Díaz
 
Intro to Javascript
Intro to JavascriptIntro to Javascript
Intro to JavascriptAnjan Banda
 
Xopus Application Framework
Xopus Application FrameworkXopus Application Framework
Xopus Application FrameworkJady Yang
 

Similar to Haxe: What Makes It Cool (20)

Introduction to clojure
Introduction to clojureIntroduction to clojure
Introduction to clojure
 
Haxe by sergei egorov
Haxe by sergei egorovHaxe by sergei egorov
Haxe by sergei egorov
 
Clojure - A new Lisp
Clojure - A new LispClojure - A new Lisp
Clojure - A new Lisp
 
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...
 
JavaScript Lessons 2023
JavaScript Lessons 2023JavaScript Lessons 2023
JavaScript Lessons 2023
 
Scala - brief intro
Scala - brief introScala - brief intro
Scala - brief intro
 
PHP-03-Functions.ppt
PHP-03-Functions.pptPHP-03-Functions.ppt
PHP-03-Functions.ppt
 
PHP-03-Functions.ppt
PHP-03-Functions.pptPHP-03-Functions.ppt
PHP-03-Functions.ppt
 
Svcc Building Rich Applications with Groovy's SwingBuilder
Svcc Building Rich Applications with Groovy's SwingBuilderSvcc Building Rich Applications with Groovy's SwingBuilder
Svcc Building Rich Applications with Groovy's SwingBuilder
 
ECMAScript 2015
ECMAScript 2015ECMAScript 2015
ECMAScript 2015
 
ES6 - Next Generation Javascript
ES6 - Next Generation JavascriptES6 - Next Generation Javascript
ES6 - Next Generation Javascript
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
jQuery introduction
jQuery introductionjQuery introduction
jQuery introduction
 
Javascript variables and datatypes
Javascript variables and datatypesJavascript variables and datatypes
Javascript variables and datatypes
 
T3chFest 2016 - The polyglot programmer
T3chFest 2016 - The polyglot programmerT3chFest 2016 - The polyglot programmer
T3chFest 2016 - The polyglot programmer
 
Intro to Javascript
Intro to JavascriptIntro to Javascript
Intro to Javascript
 
Xopus Application Framework
Xopus Application FrameworkXopus Application Framework
Xopus Application Framework
 
C Tutorials
C TutorialsC Tutorials
C Tutorials
 
Clean Code
Clean CodeClean Code
Clean Code
 
Object-oriented Basics
Object-oriented BasicsObject-oriented Basics
Object-oriented Basics
 

Recently uploaded

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 

Recently uploaded (20)

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 

Haxe: What Makes It Cool

  • 1. Haxe: What Makes It Cool Dev Ideas, episode 1 Brought to you by Chicken Wing Software
  • 2. Hello, my name is... Eddie Sullivan Founder, Chicken Wing Software www.chickenwingsw.com www.devideas.com See also: UX Ideas
  • 3. Haxe ≈ JavaScript + static types + Java-style classes + type inference + algebraic types www.haxe.org Compiles to JavaScript, Flash, NekoVM, PHP, C++ Standard library + platform libs + RPC
  • 4. Haxe is like JavaScript (really ActionScript) Similar syntax and keywords (like function) Entire DOM-tree available Flash API available (no timeline) Can compile to .js file Can compile to .swf file Closures Regular expressions
  • 5. DOM example Example: // Change an HTML element to a random color. static function changeToRandomColor(id) { var el = Lib.document.getElementById(id); var color = '#' + StringTools.hex(Std.random(0x1000000), 6); el.style.backgroundColor = color; }
  • 6. Haxe is like... Java Example: import js.Lib; import StringTools; class HaxeExample { // Required "main" function - called at startup. static function main() { } // Change an HTML element to a random color. static function changeToRandomColor(id) { var el = Lib.document.getElementById(id); var color = '#' + StringTools.hex(Std.random(0x1000000), 6); el.style.backgroundColor = color; } }
  • 7. Similarities to Java Java-style classes & inheritance Statically & strongly typed Single inheritance & interfaces Can compile to NekoVM, PHP, or C++
  • 8. Some familiar keywords if/else do/while true/false new var this try/catch finally return switch* enum* for* * Different behavior
  • 9. Haxe is like... ML Type inference Types with less typing var x = "hello"; // x is a String var y:String; // y is also a String x = 3; // ERROR! Algebraic types (With enum and switch)
  • 10. Haxe's enums Defining the enum: enum Command { sit; speak(word:String); move(x:Int, y:Int); } // ... inside a function var cmd = Command.speak("Arf!");
  • 11. Haxe's switch Using the enum: // ... inside a function: switch (cmd) { case sit: this.sitting = true; case speak(text): trace(text); case move(x, y): this.location = new Point(x, y); }
  • 12. Haxe's for More like "foreach" in C# // ... inside a function: var names = ['Ed', 'Fred', 'Ned', 'Ted']; // Could have written: // var names:Array<String> = ... for(name in names) { trace("Hello " + name); }
  • 13. Other features Local functions/closures Type parameters (generics) Exceptions Dynamic & untyped values "Batteries Included" Remoting XML parsing/validation Sandboxing ...and much more!
  • 14. Flash example (part 1) import flash.display.Sprite; import caurina.transitions.Tweener; class Happy extends Sprite { public function new(size:Float = 50) { super(); graphics.lineStyle(1.0, 0x000000); graphics.beginFill(0xffff00); graphics.drawCircle(0, 0, size); graphics.endFill(); graphics.moveTo(size * 0.3, size * 0.3); graphics.curveTo(0, size * 0.75, -size * 0.3, size * 0.3); graphics.drawCircle(-size * 0.225, -size * 0.3, size * 0.1); graphics.drawCircle(size * 0.225, -size * 0.3, size * 0.1); } // class continues on next slide...
  • 15. Flash example (part 2) // ... continued from last slide public function start() { var that = this; Tweener.addTween(this, { rotation:360, time:2, transition:"linear", onComplete: start } ); Tweener.addTween(this, { scaleX:.75, scaleY:.75, time:1 }); Tweener.addTween(this, { scaleX:1, scaleY:1, time:1, delay:1 } ); } public function stop() { Tweener.removeTweens(this); } } // End of class Happy
  • 16. Flash example (part 3) import flash.external.ExternalInterface; import flash.Lib; class Main { static var happy = new Happy(25.0); static function main() { happy.x = 50; happy.y = 50; Lib.current.addChild(happy); ExternalInterface.addCallback("startHappy", happy.start); ExternalInterface.addCallback("stopHappy", happy.stop); happy.start(); } }
  • 17. Flash example (part 4) What it looks like: Stop - Start
  • 18. The Haxe Community Mailing list Forum Wiki Libraries / haxelib (lib.haxe.org) FlashDevelop More...
  • 19. Thank you! Chicken Wing Software - chickenwingsw.com Dev Ideas - devideas.com Follow me on Twitter: @eddieSullivan Sign up for the newsletter to hear what's coming next UX Ideas - uxideas.com