Haxe language specification

140 views
Skip to first unread message

HaxeL

unread,
Nov 4, 2016, 6:28:52 AM11/4/16
to Haxe
Hi,

I'm a newbie trying to learn and evaluate Haxe for a new project at our company. I've background in C++, Ada, some knowledge of Java.

Does Haxe have a language specification where one can learn about its syntax, understand what the keywords mean and do? I'd also like to understand the Haxe compiler internals. Please point me to a document which is similar to what exists for other languages like C++, Java, Ada etc.

Thanks for your help.

Regards
HaxeL

Justin L Mills

unread,
Nov 4, 2016, 6:53:07 AM11/4/16
to haxe...@googlegroups.com
HaxeL

The 'manual' is intended to provide language specification of the sort
you require.

http://haxe.org/manual/types.html

and

http://code.haxe.org/

http://api.haxe.org/

will help, you may find via google that the old.haxe site has more full
but less upto date additional useful information.

The Haxe compiler internals are always evolving and I am not sure they
are documented in one place, there are some details on the old.haxe site
but they may now be outdated, a good place to look are the blogs of Haxe
foundation and Hugh the gamehaxe.com. For instance this video linked
from the Haxe blog.

https://www.youtube.com/watch?feature=player_embedded&v=wE26yH7AYNo

I hope that helps, but the best way to learn about Haxe is to read
HaxeLib source code maybe thx, tink, polygonal and format might be
interesting libraries to explore, since they probably provide lots of
useful base features although there are probably others.

https://github.com/fponticelli/thx.core

https://github.com/haxetink/tink_core

https://github.com/polygonal/ds

https://github.com/HaxeFoundation/format

Best Regards

Justin
> --
> To post to this group haxe...@googlegroups.com
> http://groups.google.com/group/haxelang?hl=en
> ---
> You received this message because you are subscribed to the Google
> Groups "Haxe" group.
> For more options, visit https://groups.google.com/d/optout.

HaxeL

unread,
Nov 4, 2016, 7:44:04 AM11/4/16
to Haxe
Hi Justin,

Thanks for the quick response. That's a lot of information.
In fact I did start reading and watched some videos about the language but didn't know where to start. I guess the Manual seems to be the right starting point.

On the other hand, I find it strange at the starting point to directly jump to its source code to understand when I don't know the syntax and on the first look at the source, it looks cryptic with things like "@:...". Anyway, it will take some time to figure this out.

I'm looking at C++ and Javascript targets to be used. Any suggestions for an IDE that can help develop a project? Certainly debugging features would be handy.

Thanks!

Kind Regards,
HaxeL

Justin L Mills

unread,
Nov 4, 2016, 8:20:03 AM11/4/16
to haxe...@googlegroups.com

HaxeL

FlashDevelop on PC seems one of the best and most popular editors, probably what Nicolas uses for Heaps.

If you need games/app stuff then it can depend on the cross target library used as communities preferences differ, some possible ...

For Kha, Kode is nice it has Kha and Haxe built in so simple to setup and use - https://github.com/KTXSoftware/KodeStudio/releases

For Luxe/SnowKit, Atom is quite nice - https://github.com/snowkit/atom-flow

For Fixel with OpenFL/NME seems templates for a few https://github.com/HaxeFlixel/flixel-templates

etc...

Really you have to explore the options and try them out. My biggest advise with Haxe is to just start using it, most libraries and approaches have active communities that are happy to help.  Perhaps someone else wants to pitch in on debugging options, on js normally you can debug from within Chrome.

Best Regards

Justin

Tarwin Stroh-Spijer

unread,
Nov 4, 2016, 4:21:02 PM11/4/16
to haxe...@googlegroups.com
I'd also suggest Visual Studio Code: https://marketplace.visualstudio.com/items?itemName=nadako.vshaxe

The @ stuff is metadata, and generally to start you probably don't have to worry about it.

Also, playing around with try.haxe.org would probably help to start with too.

Welcome !



Tarwin Stroh-Spijer
_______________________

phone: +1 650 842 0920

Developer at Fanplayr Inc. (Palo Alto)
Original at Touch My Pixel (touchmypixel.com)
_______________________

Raoul Duke

unread,
Nov 4, 2016, 4:58:39 PM11/4/16
to haxe...@googlegroups.com

hah. good luck even finding out e.g. what 'equals' is. :-)

Justin Donaldson

unread,
Nov 4, 2016, 5:42:19 PM11/4/16
to Haxe
Definitely start with the manual.   Haxe gives a lot of flexibility and control, but it's sometimes at the loss of a complete and succinct formal spec.

For instance, Haxe doesn't allow operator overloading*.  It also uses strict equality*, whereas other targets like js use a "truthy" scheme.

*However, that's not completely true.  You can overload operators on "abstract" types, and potentially through a macro.   That's not something I would introduce right away though.

Rather than a language spec, I would start with an overview of the language features:

You don't have to use all of those right away, but each one you learn helps you get more out of Haxe.

Next, I would go through the code cookbook, and see how you can use those features on common coding tasks:

I wrote up a small "5 minute" guide to haxe as well:




On Fri, Nov 4, 2016 at 1:58 PM, Raoul Duke <rao...@gmail.com> wrote:

hah. good luck even finding out e.g. what 'equals' is. :-)

--

Tarwin Stroh-Spijer

unread,
Nov 4, 2016, 6:02:41 PM11/4/16
to haxe...@googlegroups.com
@Justin. Awesome introduction. Can I suggest that with "switch" you show that it also returns a value which is different than some languages?



Tarwin Stroh-Spijer
_______________________

phone: +1 650 842 0920

Developer at Fanplayr Inc. (Palo Alto)
Original at Touch My Pixel (touchmypixel.com)
_______________________

Justin Donaldson

unread,
Nov 4, 2016, 6:06:19 PM11/4/16
to Haxe
If you're talking about the "5 minute guide", I have two examples of switch statements, and one returns a value.

There's probably a way to simplify that guide, here's the repo where I send pull requests:

HaxeL

unread,
Nov 5, 2016, 4:07:29 AM11/5/16
to Haxe
Thanks everyone for the help !

Kind Regards,
HaxeL

Todor Angelov

unread,
Nov 6, 2016, 4:38:13 AM11/6/16
to haxe...@googlegroups.com
they are actually 3 languages :)
1. source code filter for specific target
#if flash
blahblah
#elseif js
mjau
#else
ahaa
#end
including @:magick

2. macro execution, everything that begin with a word "macro"

3. haxe language itself

1&2 are like C++ preprocessor directives

so, haxe manual is good starting point and every haxe api topic has a
link to its source. haxe std is written in haxe.

good luck :)
Reply all
Reply to author
Forward
0 new messages