cross-platform question

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

cross-platform question

Raoul Duke
hi,

when i try to use -lib polygonal with a neko target, i get compilation
errors of the polygonal code. is it the case that haxe code has to
really know what targets it is being compiled for? and does the
polygonal stuff not support neko? in general, how does one know what
platforms a library supports? e.g. does polygonal support c++?

thanks,
-a perpetual n00b.

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: cross-platform question

Baluta Cristian
it's your job to know if a library supports the target, or the creator job to inform about it.

On Sun, Mar 20, 2011 at 5:51 AM, Raoul Duke <[hidden email]> wrote:
hi,

when i try to use -lib polygonal with a neko target, i get compilation
errors of the polygonal code. is it the case that haxe code has to
really know what targets it is being compiled for? and does the
polygonal stuff not support neko? in general, how does one know what
platforms a library supports? e.g. does polygonal support c++?

thanks,
-a perpetual n00b.

--
haXe - an open source web programming language
http://haxe.org



--
Băluță Cristian
http://ralcr.com
http://imagin.ro

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: cross-platform question

Tarwin Stroh-Spijer
I think there are flags/meta data you can now add to your source that
will warn you that a specific class (method?) is only for specific
target platforms.

This is from http://haxe.org/manual/metadata

@:require(xxx) : will only allow to access the given field if the xxx
compiler condition variable is set (for instance with -D xxx). Can
also be set on a whole class, in that case the class can still be
referenced but all its statics and its constructor accesses are
forbidden if the xxx var is not set.

My understanding is that these -D (compiler directives) are
automatically set for the specific language ie "flash", "flash10",
"cpp", "js" etc

http://haxe.org/doc/compiler


On Saturday, March 19, 2011, Baluta Cristian <[hidden email]> wrote:

> it's your job to know if a library supports the target, or the creator job to inform about it.
>
> On Sun, Mar 20, 2011 at 5:51 AM, Raoul Duke <[hidden email]> wrote:
> hi,
>
> when i try to use -lib polygonal with a neko target, i get compilation
> errors of the polygonal code. is it the case that haxe code has to
> really know what targets it is being compiled for? and does the
> polygonal stuff not support neko? in general, how does one know what
> platforms a library supports? e.g. does polygonal support c++?
>
> thanks,
> -a perpetual n00b.
>
> --
> haXe - an open source web programming language
> http://haxe.org
>
>
> --
> Băluță Cristian
> http://ralcr.com
> http://imagin.ro
>

--


Tarwin Stroh-Spijer
_______________________

Touch My Pixel
http://www.touchmypixel.com/
phone: +61 3 8060 5321
_______________________

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: cross-platform question

Niel Drummond-3
Theoretically, library authors can use following:

#if neko
#error
#end

which will cause a generic failure "not supported on this platform".
Though using this idiom precludes others from writing --remap wrappers
around the missing functionality.

- Niel

On 03/20/11 09:39, Tarwin Stroh-Spijer wrote:

> I think there are flags/meta data you can now add to your source that
> will warn you that a specific class (method?) is only for specific
> target platforms.
>
> This is from http://haxe.org/manual/metadata
>
> @:require(xxx) : will only allow to access the given field if the xxx
> compiler condition variable is set (for instance with -D xxx). Can
> also be set on a whole class, in that case the class can still be
> referenced but all its statics and its constructor accesses are
> forbidden if the xxx var is not set.
>
> My understanding is that these -D (compiler directives) are
> automatically set for the specific language ie "flash", "flash10",
> "cpp", "js" etc
>
> http://haxe.org/doc/compiler
>
>
> On Saturday, March 19, 2011, Baluta Cristian <[hidden email]> wrote:
>> it's your job to know if a library supports the target, or the creator job to inform about it.
>>
>> On Sun, Mar 20, 2011 at 5:51 AM, Raoul Duke <[hidden email]> wrote:
>> hi,
>>
>> when i try to use -lib polygonal with a neko target, i get compilation
>> errors of the polygonal code. is it the case that haxe code has to
>> really know what targets it is being compiled for? and does the
>> polygonal stuff not support neko? in general, how does one know what
>> platforms a library supports? e.g. does polygonal support c++?
>>
>> thanks,
>> -a perpetual n00b.
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>>
>>
>> --
>> Băluță Cristian
>> http://ralcr.com
>> http://imagin.ro
>>


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: cross-platform question

Tony Polinelli
So would this work:

#if !neko
#error
#end

or even

#if !(neko || php)
#error
#end

If so, maybe this would be good practice to put in libraries, as a guide to usage. 



On Sun, Mar 20, 2011 at 9:29 PM, Niel Drummond <[hidden email]> wrote:
Theoretically, library authors can use following:

#if neko
#error
#end

which will cause a generic failure "not supported on this platform".
Though using this idiom precludes others from writing --remap wrappers
around the missing functionality.

- Niel

On 03/20/11 09:39, Tarwin Stroh-Spijer wrote:
> I think there are flags/meta data you can now add to your source that
> will warn you that a specific class (method?) is only for specific
> target platforms.
>
> This is from http://haxe.org/manual/metadata
>
> @:require(xxx) : will only allow to access the given field if the xxx
> compiler condition variable is set (for instance with -D xxx). Can
> also be set on a whole class, in that case the class can still be
> referenced but all its statics and its constructor accesses are
> forbidden if the xxx var is not set.
>
> My understanding is that these -D (compiler directives) are
> automatically set for the specific language ie "flash", "flash10",
> "cpp", "js" etc
>
> http://haxe.org/doc/compiler
>
>
> On Saturday, March 19, 2011, Baluta Cristian <[hidden email]> wrote:
>> it's your job to know if a library supports the target, or the creator job to inform about it.
>>
>> On Sun, Mar 20, 2011 at 5:51 AM, Raoul Duke <[hidden email]> wrote:
>> hi,
>>
>> when i try to use -lib polygonal with a neko target, i get compilation
>> errors of the polygonal code. is it the case that haxe code has to
>> really know what targets it is being compiled for? and does the
>> polygonal stuff not support neko? in general, how does one know what
>> platforms a library supports? e.g. does polygonal support c++?
>>
>> thanks,
>> -a perpetual n00b.
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>>
>>
>> --
>> Băluță Cristian
>> http://ralcr.com
>> http://imagin.ro
>>


--
haXe - an open source web programming language
http://haxe.org



--
Tony Polinelli
http://touchmypixel.com

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: cross-platform question

Adrian Cowan
In reply to this post by Niel Drummond-3
To make it nicer to people  writing --remap wrappers could you do something like this:

#if !(cpp || mylib_remaped)
#error
#end


Where cpp is the expected target and if someone wanted to remap you code they could define mylib_remap to _unlock_ the code.
(Assuming what Tony proposed works)

Best,
Adrian Cowan (othrayte)

On Sun, Mar 20, 2011 at 9:29 PM, Niel Drummond <[hidden email]> wrote:)
Theoretically, library authors can use following:

#if neko
#error
#end

which will cause a generic failure "not supported on this platform".
Though using this idiom precludes others from writing --remap wrappers
around the missing functionality.

- Niel

On 03/20/11 09:39, Tarwin Stroh-Spijer wrote:
> I think there are flags/meta data you can now add to your source that
> will warn you that a specific class (method?) is only for specific
> target platforms.
>
> This is from http://haxe.org/manual/metadata
>
> @:require(xxx) : will only allow to access the given field if the xxx
> compiler condition variable is set (for instance with -D xxx). Can
> also be set on a whole class, in that case the class can still be
> referenced but all its statics and its constructor accesses are
> forbidden if the xxx var is not set.
>
> My understanding is that these -D (compiler directives) are
> automatically set for the specific language ie "flash", "flash10",
> "cpp", "js" etc
>
> http://haxe.org/doc/compiler
>
>
> On Saturday, March 19, 2011, Baluta Cristian <[hidden email]> wrote:
>> it's your job to know if a library supports the target, or the creator job to inform about it.
>>
>> On Sun, Mar 20, 2011 at 5:51 AM, Raoul Duke <[hidden email]> wrote:
>> hi,
>>
>> when i try to use -lib polygonal with a neko target, i get compilation
>> errors of the polygonal code. is it the case that haxe code has to
>> really know what targets it is being compiled for? and does the
>> polygonal stuff not support neko? in general, how does one know what
>> platforms a library supports? e.g. does polygonal support c++?
>>
>> thanks,
>> -a perpetual n00b.
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>>
>>
>> --
>> Băluță Cristian
>> http://ralcr.com
>> http://imagin.ro
>>


--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: cross-platform question

Niel Drummond-3
yes you could, though it's usually the case that conditionals are poorly documented, so IMO an #error conditional directive only makes sense if you are using non-portable native APIs. In other cases, it's often unknown if the library works on other platforms, as some knowledge on the target language is needed to use --remap wrappers - it should be up to the community to provide this feedback.

- Niel

On 03/20/11 12:46, Adrian Cowan wrote:
To make it nicer to people  writing --remap wrappers could you do something like this:

#if !(cpp || mylib_remaped)
#error
#end


Where cpp is the expected target and if someone wanted to remap you code they could define mylib_remap to _unlock_ the code.
(Assuming what Tony proposed works)

Best,
Adrian Cowan (othrayte)

On Sun, Mar 20, 2011 at 9:29 PM, Niel Drummond <[hidden email]> wrote:)
Theoretically, library authors can use following:

#if neko
#error
#end

which will cause a generic failure "not supported on this platform".
Though using this idiom precludes others from writing --remap wrappers
around the missing functionality.

- Niel

On 03/20/11 09:39, Tarwin Stroh-Spijer wrote:
> I think there are flags/meta data you can now add to your source that
> will warn you that a specific class (method?) is only for specific
> target platforms.
>
> This is from http://haxe.org/manual/metadata
>
> @:require(xxx) : will only allow to access the given field if the xxx
> compiler condition variable is set (for instance with -D xxx). Can
> also be set on a whole class, in that case the class can still be
> referenced but all its statics and its constructor accesses are
> forbidden if the xxx var is not set.
>
> My understanding is that these -D (compiler directives) are
> automatically set for the specific language ie "flash", "flash10",
> "cpp", "js" etc
>
> http://haxe.org/doc/compiler
>
>
> On Saturday, March 19, 2011, Baluta Cristian <[hidden email]> wrote:
>> it's your job to know if a library supports the target, or the creator job to inform about it.
>>
>> On Sun, Mar 20, 2011 at 5:51 AM, Raoul Duke <[hidden email]> wrote:
>> hi,
>>
>> when i try to use -lib polygonal with a neko target, i get compilation
>> errors of the polygonal code. is it the case that haxe code has to
>> really know what targets it is being compiled for? and does the
>> polygonal stuff not support neko? in general, how does one know what
>> platforms a library supports? e.g. does polygonal support c++?
>>
>> thanks,
>> -a perpetual n00b.
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>>
>>
>> --
>> Băluță Cristian
>> http://ralcr.com
>> http://imagin.ro
>>


--
haXe - an open source web programming language
http://haxe.org



--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: cross-platform question

Dion Whitehead Amago
In reply to this post by Raoul Duke
I also have had problems compiling polygonal to the neko target.  However, I have made some modifications and gotten polygonal to run on js (specifically Node.js) and to compile on cpp (running not
yet tested).

I can create a fork of polygonal for these platforms if there is any interest.

Dion

Raoul Duke wrote:

> hi,
>
> when i try to use -lib polygonal with a neko target, i get compilation
> errors of the polygonal code. is it the case that haxe code has to
> really know what targets it is being compiled for? and does the
> polygonal stuff not support neko? in general, how does one know what
> platforms a library supports? e.g. does polygonal support c++?
>
> thanks,
> -a perpetual n00b.
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: cross-platform question

Paul Zirkle
Personally, I'd rather see the haxelib.xml file have supported targets requirement; this way the haxe compiler could check the library against the targets and give a compiler error (meaning that remap would work as it would only check the library after the remap). To avoid having to specify every target, the requirements section could support  "all" and "!neko".

Of course this solution affects an entire library, and does not help libraries with partial platform support.

On Sun, Mar 20, 2011 at 8:04 AM, Dion Amago <[hidden email]> wrote:
I also have had problems compiling polygonal to the neko target.  However, I have made some modifications and gotten polygonal to run on js (specifically Node.js) and to compile on cpp (running not
yet tested).

I can create a fork of polygonal for these platforms if there is any interest.

Dion

Raoul Duke wrote:
> hi,
>
> when i try to use -lib polygonal with a neko target, i get compilation
> errors of the polygonal code. is it the case that haxe code has to
> really know what targets it is being compiled for? and does the
> polygonal stuff not support neko? in general, how does one know what
> platforms a library supports? e.g. does polygonal support c++?
>
> thanks,
> -a perpetual n00b.
>

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: cross-platform question

Raoul Duke
In reply to this post by Dion Whitehead Amago
be nice to submit it back somehow?

On Sun, Mar 20, 2011 at 8:04 AM, Dion Amago <[hidden email]> wrote:
> I also have had problems compiling polygonal to the neko target.  However, I have made some modifications and gotten polygonal to run on js (specifically Node.js) and to compile on cpp (running not
> yet tested).
>
> I can create a fork of polygonal for these platforms if there is any interest.
>
> Dion
>

--
haXe - an open source web programming language
http://haxe.org