extern class Button {Would that help?
ᅵᅵᅵ
ᅵᅵᅵ public function new(myName, myColor) {
ᅵᅵᅵ ᅵᅵᅵ // whatever JS is required to setup new Button object...
ᅵᅵᅵ ᅵᅵᅵ return ButtonFactory.create({name:myName, color:myColor});
ᅵᅵᅵ }
ᅵᅵᅵ public var externProperty:Int;
ᅵᅵᅵ public function externMethod();
ᅵᅵᅵ
}
I also believe many JS developers are looking for support for existing libraries.
The problem with Enyo, Sencha or possibly Ext.JS is the "factory" model, which is incompatible with a class structure.
In order to create an object, it prefers a generic, definition object:
{ kind: "Button", label: "Hello World" }
...then at "runtime", you access the "real" instance:
$.button.setLabel ("HELLO WORLD!");
This has caused me to use two sets of classes for each object, like Button or ButtonInstance, but it is still somewhat uncomfortable. At first I tried to define both sets of values in one object, but then you have the problem of calling constructors when the initial object (the generic one) should be extra simple. Any additional methods or values on the prototype have a tendency to blow things up and cause silent failures at runtime.
I have also worked with Javascript libraries that use a more traditional approach to inheritance. Jo, for example, is not the most popular mobile framework, but it works perfectly with Haxe.
On Mon, 28 May 2012 02:59:00 -0700, Nicolas Cannasse <ncan...@motion-twin.com> wrote:
Le 28/05/2012 09:41, Jason O'Neil a ᅵcrit :
[...]
*Javascript*
There is also the path of using externs, (ExtJS, angular, ember,
backbone etc), but I find that for anything more complex than jQuery,
the extern system becomes quite difficult to setup and maintain.ᅵ I was
able to get some basic externs working for ExtJS, but the moment you try
to do anything too complicated you begin hitting issues where the Haxe
way of doing things doesn't fit with the Ext way of doing things.
Hi Jason,
I might be interested in knowing more about that. For instance this is because we wanted to use JQuery with strict typing that I added the @:overload feature.
There might be some additional tricks possible to do as well for other libraries.
I think that's very important that JS developers "feel at home" with Haxe. Not maybe the most hardcore ones, since they will mostly likely prefer JS itself, but the ones that feel like they lost some great things while moving to JS - such as completion and static typing.
It's nice to propose pure Haxe-oriented solutions such as DomTools, but OTOH I think that - when it's relevant - having the most popular/useful JS libraries directly accessible (and typed) with Haxe is also very important.
*Server Side[...]
So is it NodeJS, or PHP/Neko?ᅵ The paradigms are pretty different and I
don't know how well a single framework would span across both.ᅵ Happy to
be proved wrong though.
That's an interesting question :)
- PHP is nice for "backward compatibility" : a lot of shared hosting, people know how to setup/maintain it, you feel "at home" if you've already used it (and most people did I guess)
- Neko is quite powerful, integrates very nicely with Haxe, but I guess it would require a lot more efforts to promote it as a new platform. One of the selling points of Haxe is the ability to run on existing "proven" platforms. Bringing our "own new platform" somehow negates this argument.
- NodeJS is interesting, and while I question some parts of its architecture, I still can understand it has a lot of buzz right now. However seems like one of the big part of this success is about using JS.
People coming from server-side programming are usually more interested in structured programs than others. I guess we first need a good framework that would assemble all the tools already available (Spod, Temploc/Erazor, Dispatcher, etc.) with documentation and examples, and that would run on PHP/Neko/Java/C#, that would already be a nice selling point :)
I think Ufront is probably the strongest candidate so far, but it's
pretty evident from the mailing list that not many people are using it.
Whenever someone has asked about a problem the replies are few and far
between.ᅵ If we can make it easier for existing Haxe users to start with
it then we might get a few more users and more support.
UFront is nice, but is only a part of the framework. For instance I think there's almost no relation between UFront and Spod.
Again I agree that making installation easy and having multiple people
supporting it will be important.ᅵ If I'm going to be part of it I think
I'll need to use it myself for a project so I have a vested interest in
it.ᅵ Maybe even some of the haxe community sites could experiment with
running this (eg tryhaxe.org).ᅵ That would make a good
real-world-example that we can possibly share to expand the number of
people using it.
Hey Richard,
Not sure you read that third point properly ;-) Personally, I think we can target those last points by providing companies with the knowledge to overcome them. Companies like Influxis, essentially, where the language is used in the workplace to make things happen and where a good corporate image is portrayed.
Lee
1. Does it have good IDE?
2. How peculiar code it produces?