haXe Overview
What is this you might be asking yourself as i asked myself before we got Alan to explain this really interesting new programing language that is now supported and integrated in FDT 5. In this video Alan will talk about why use HaXe and its useful roles in a world where we need to know many programing languages.
Video Transcript
00:00All right, here it is, Hex.
00:03All right, so what I'll be going off
00:08is that this will be two parts here.
00:10This will be an overview of a really, again, crash course
00:15here on the overview of what Hex is.
00:18Again, it's a whole different language.
00:21So I'm not going to go into the syntaxes and that kind of stuff.
00:24There's data structures and whatnot,
00:27because there actually is plenty of information
00:29out there on the internet.
00:30But if you've never heard about Hex
00:32or you're curious about what Hex means to FTT,
00:35this is a really great way to get started and see.
00:38And I'll actually show Hex in action with FTT.
00:43Again, this is a part of FTT free.
00:45All of Hex is part of FTT free.
00:47So I'll build a simple JavaScript example here.
00:52So a little bit more about Hex.
00:55There's a lot of ways to talk about Hex
00:58and people describe it as multi-target, multi-platform,
01:03multi-language, script generators, compiler.
01:07There's a lot of words you can use to describe Hex.
01:11I like to use multi-platform.
01:15And that's because how it works is that you're right in Hex
01:21and then you have the option to output different targets.
01:25So you have output to different platforms.
01:29I use the same syntax and the same way
01:33of building my application.
01:34And I could choose to export a Swift.
01:38I can use it to export JavaScript code.
01:41So it'll actually be, in this case, it's a script generator.
01:45And the same thing for PHP.
01:47It can have it to generate PHP for me.
01:51And I can actually also have it generate C++ and Nico for me.
01:56The C++ and Nico, that's definitely
02:00all you can just tell.
02:01C++ is that everyone knows it's a lower level language, mostly
02:06for desktop applications.
02:08And Nico is actually a web server application
02:12that Nicholas has created, who is the creator of Hex,
02:16by the way.
02:17And that's kind of what he was using Hex for.
02:22But he also has expanded Hex to include
02:25these multiple platforms.
02:28One thing I will say before going on
02:31is that I have seen a lot of people talk about Hex.
02:35And there's a lot that can be said
02:37if you read it on the internet.
02:38And I will be totally honest here.
02:42And that is that it's definitely not a magic bullet.
02:45I feel like a lot of times it gets sold.
02:49It's going to find your car keys.
02:50It's going to change Coke to Pepsi.
02:53That's not really the case.
02:55It's not the case where I write some Hex code.
02:59And then I say, for example, I want
03:02to build an application that has a red ball bouncing around.
03:07So it's not going to be this scenario where you code in Hex
03:10and you make this red ball bouncing around.
03:13And I can now put a Swift.
03:15And so I'll just click some button and some magic happens
03:18and I have a Swift.
03:20And then without changing anything at all,
03:21I want JavaScript.
03:23So I maybe hit another little button
03:26and all of a sudden JavaScript pops out.
03:29And of course, for PHP, it doesn't make any sense
03:32because PHP is a server-side language.
03:34It's not going to automatically somehow come up
03:36with some way of generating red balls for me
03:40on the screen there.
03:41So it's definitely to keep in mind that from my experience
03:45and people out there actually using Hex
03:50in this kind of multi-platform way, what I see them do
03:54is I see them, it's all the same syntax.
03:58And they can share libraries.
04:00Like, for example, suppose you build a math library
04:03or a messaging, an event system library,
04:08like robot legs, you're sure about robot legs.
04:11Those kinds of things, yes.
04:12You could definitely share across all these platforms.
04:15But you're going to have to write platform-specific code,
04:20no matter what.
04:20It's going to be there.
04:24So for example, when I'm writing in Flash,
04:28I'm going to have to be using, they've actually
04:30mirrored the Flash API.
04:32So I will actually be writing Hex code,
04:34but it'll be a very similar Flash API
04:37that I'll be hooking into.
04:39And the same thing for JavaScript.
04:40When I'm writing for JavaScript,
04:41I have to know about how JavaScript works.
04:45And so you have to be familiar with those APIs, for example.
04:49And the same thing for PHP.
04:51So you actually have to be knowledgeable in each
04:54of these targets to output to these targets.
04:58So that's a very, very important distinction
05:00I want to make there.
05:02And so I believe it's demo time by using a simple JavaScript
05:07example.
