Re: [Vala] Extended floating types

2016-05-24 Thread Vitaly V. Ch
https://bugzilla.gnome.org/show_bug.cgi?id=766844

On Tue, May 24, 2016 at 6:59 PM, Daniel Espinosa  wrote:

> May this even better, by using a specialized math library written in C with
> bindings for Vala.
>
> We can wrap this library in GObject classes, then create Vala bindings and
> GObject Introspection ones for other languages like Python.
>
> If Vala bindings exists, we can create GObject wrappers written in Vala,
> like we do at GXml for libxml2.
> El may. 24, 2016 10:01 AM, "ben"  escribió:
>
> > This does not work. The C code has: typedef float float128_t;
> >
> > You could map it to gcc's 128 bit floating point type (https://gcc.gnu.
> > org/onlinedocs/gcc/Floating-Types.html) or use the 80-bit long double
> > type (https://stackoverflow.com/questions/13516476/long-double-gcc-spec
> > ific-and-float128)
> >
> > Neither of these options are standard. For arbitrary precision math in
> > C I like to use https://gmplib.org/.
> >
> >
> >
> > On Mon, 2016-05-23 at 21:26 -0500, Guillaume Poirier-Morency wrote:
> > > It's possible to declare these types if you need to use them.
> > >
> > > https://wiki.gnome.org/Projects/Vala/Manual/Attributes#FloatingType_A
> > > tt
> > > ribute
> > >
> > > [CCode (has_type_id = false)]
> > > [FloatingType (decimal = false, rank = 12, width = 128]
> > > struct float128_t {}
> > >
> > > Like Daniel said, Vala primitive types are mapped to GLib's type with
> > > the GType system, so it's not really the language's fault if there is
> > > no support for 128 bit floating points. It's not a common use case
> > > either way.
> > >
> > > With 'has_type_id = false', the compiler knows that there's no type
> > > information to retreive.
> > >
> > > Rank 12 does not really exist, but that would be the appropriate
> > > value
> > > since 10 and 11 are for signed and unsigned 64 bit types.
> > >
> > > It might be handy to have a VAPI for that in 'vala-extra-vapis'.
> > >
> > > Cheers and best luck,
> > >
> > > Le lundi 23 mai 2016 à 09:59 +0300, Vitaly V. Ch a écrit :
> > > > Ok, Thanks.
> > > >
> > > > It clarifies the situation.
> > > >
> > > > With best regards,
> > > >
> > > > Vitaly Chernooky
> > > >
> > > > On Mon, May 23, 2016 at 4:51 AM, Daniel Espinosa 
> > > > wrote:
> > > >
> > > > > May you should be able to create your own basic type.
> > > > >
> > > > > May should be a guide to do so.
> > > > >
> > > > > GLib should have this types too, before you are able to create
> > > > > your
> > > > > basic
> > > > > types. This means you should define a GType for a basic type, in
> > > > > this case
> > > > > your long double.
> > > > >
> > > > > May we can create a library to define this math basic types, to
> > > > > be
> > > > > used in
> > > > > other libraries. This is not a GLib interest, I think, because is
> > > > > not a
> > > > > primary Math library.
> > > > >
> > > > > I was working a little in that, but may you should ask to gtk-
> > > > > list
> > > > > for
> > > > > help on defining this new types.
> > > > >
> > > > > In other ideas, is required to use that types or is possible to
> > > > > use
> > > > > some
> > > > > structs holding your information in a way to be used in other
> > > > > methods, that
> > > > > may take that structs an do calculations using that types
> > > > > internally,
> > > > > written in C with Vala bindings [1], then return again that
> > > > > structs.
> > > > >
> > > > > [] See git.gnome.org/browse/gxml it uses simple C methods and
> > > > > Vala
> > > > > bindings to be used in Vala code for xlibxml
> > > > > El may. 22, 2016 3:23 PM, "Vitaly V. Ch" 
> > > > > escribió:
> > > > >
> > > > > Hi All!
> > > > >
> > > > > Some time ago Vala has pulled my attention as a way to solve some
> > > > > kind of
> > > > > math problems. But some time later I realized that this cozy and
> > > > > beautiful
> > > > > staff does not have extended floating datatypes such as long
> > > > > double
> > > > > or
> > > > > float128_t. This fact disappointed me and I'm interested in some
> > > > > comments.
> > > > >
> > > > > With best regards,
> > > > >
> > > > > Vitaly Chernooky
> > > > > ___
> > > > > vala-list mailing list
> > > > > vala-list@gnome.org
> > > > > https://mail.gnome.org/mailman/listinfo/vala-list
> > > > >
> > > > >
> > > > ___
> > > > vala-list mailing list
> > > > vala-list@gnome.org
> > > > https://mail.gnome.org/mailman/listinfo/vala-list
> > > ___
> > > vala-list mailing list
> > > vala-list@gnome.org
> > > https://mail.gnome.org/mailman/listinfo/vala-list
> > ___
> > vala-list mailing list
> > vala-list@gnome.org
> > https://mail.gnome.org/mailman/listinfo/vala-list
> >
> ___
> vala-list mailing list
> vala-list@gnome.org
> 

Re: [Vala] Extended floating types

2016-05-24 Thread Vitaly V. Ch
https://bugzilla.gnome.org/show_bug.cgi?id=766844

On Tue, May 24, 2016 at 6:59 PM, Daniel Espinosa  wrote:

> May this even better, by using a specialized math library written in C with
> bindings for Vala.
>
> We can wrap this library in GObject classes, then create Vala bindings and
> GObject Introspection ones for other languages like Python.
>
> If Vala bindings exists, we can create GObject wrappers written in Vala,
> like we do at GXml for libxml2.
> El may. 24, 2016 10:01 AM, "ben"  escribió:
>
> > This does not work. The C code has: typedef float float128_t;
> >
> > You could map it to gcc's 128 bit floating point type (https://gcc.gnu.
> > org/onlinedocs/gcc/Floating-Types.html) or use the 80-bit long double
> > type (https://stackoverflow.com/questions/13516476/long-double-gcc-spec
> > ific-and-float128)
> >
> > Neither of these options are standard. For arbitrary precision math in
> > C I like to use https://gmplib.org/.
> >
> >
> >
> > On Mon, 2016-05-23 at 21:26 -0500, Guillaume Poirier-Morency wrote:
> > > It's possible to declare these types if you need to use them.
> > >
> > > https://wiki.gnome.org/Projects/Vala/Manual/Attributes#FloatingType_A
> > > tt
> > > ribute
> > >
> > > [CCode (has_type_id = false)]
> > > [FloatingType (decimal = false, rank = 12, width = 128]
> > > struct float128_t {}
> > >
> > > Like Daniel said, Vala primitive types are mapped to GLib's type with
> > > the GType system, so it's not really the language's fault if there is
> > > no support for 128 bit floating points. It's not a common use case
> > > either way.
> > >
> > > With 'has_type_id = false', the compiler knows that there's no type
> > > information to retreive.
> > >
> > > Rank 12 does not really exist, but that would be the appropriate
> > > value
> > > since 10 and 11 are for signed and unsigned 64 bit types.
> > >
> > > It might be handy to have a VAPI for that in 'vala-extra-vapis'.
> > >
> > > Cheers and best luck,
> > >
> > > Le lundi 23 mai 2016 à 09:59 +0300, Vitaly V. Ch a écrit :
> > > > Ok, Thanks.
> > > >
> > > > It clarifies the situation.
> > > >
> > > > With best regards,
> > > >
> > > > Vitaly Chernooky
> > > >
> > > > On Mon, May 23, 2016 at 4:51 AM, Daniel Espinosa 
> > > > wrote:
> > > >
> > > > > May you should be able to create your own basic type.
> > > > >
> > > > > May should be a guide to do so.
> > > > >
> > > > > GLib should have this types too, before you are able to create
> > > > > your
> > > > > basic
> > > > > types. This means you should define a GType for a basic type, in
> > > > > this case
> > > > > your long double.
> > > > >
> > > > > May we can create a library to define this math basic types, to
> > > > > be
> > > > > used in
> > > > > other libraries. This is not a GLib interest, I think, because is
> > > > > not a
> > > > > primary Math library.
> > > > >
> > > > > I was working a little in that, but may you should ask to gtk-
> > > > > list
> > > > > for
> > > > > help on defining this new types.
> > > > >
> > > > > In other ideas, is required to use that types or is possible to
> > > > > use
> > > > > some
> > > > > structs holding your information in a way to be used in other
> > > > > methods, that
> > > > > may take that structs an do calculations using that types
> > > > > internally,
> > > > > written in C with Vala bindings [1], then return again that
> > > > > structs.
> > > > >
> > > > > [] See git.gnome.org/browse/gxml it uses simple C methods and
> > > > > Vala
> > > > > bindings to be used in Vala code for xlibxml
> > > > > El may. 22, 2016 3:23 PM, "Vitaly V. Ch" 
> > > > > escribió:
> > > > >
> > > > > Hi All!
> > > > >
> > > > > Some time ago Vala has pulled my attention as a way to solve some
> > > > > kind of
> > > > > math problems. But some time later I realized that this cozy and
> > > > > beautiful
> > > > > staff does not have extended floating datatypes such as long
> > > > > double
> > > > > or
> > > > > float128_t. This fact disappointed me and I'm interested in some
> > > > > comments.
> > > > >
> > > > > With best regards,
> > > > >
> > > > > Vitaly Chernooky
> > > > > ___
> > > > > vala-list mailing list
> > > > > vala-list@gnome.org
> > > > > https://mail.gnome.org/mailman/listinfo/vala-list
> > > > >
> > > > >
> > > > ___
> > > > vala-list mailing list
> > > > vala-list@gnome.org
> > > > https://mail.gnome.org/mailman/listinfo/vala-list
> > > ___
> > > vala-list mailing list
> > > vala-list@gnome.org
> > > https://mail.gnome.org/mailman/listinfo/vala-list
> > ___
> > vala-list mailing list
> > vala-list@gnome.org
> > https://mail.gnome.org/mailman/listinfo/vala-list
> >
> ___
> vala-list mailing list
> vala-list@gnome.org
> 

Re: [Vala] Extended floating types

2016-05-24 Thread Al Thomas




 
  From: Ben Iofel <iofel...@gmail.com>
 Sent: Tuesday, 24 May 2016, 16:20
 Subject: Re: [Vala] Extended floating types
   
error: structs cannot be empty: float128_t


I assumed you were going to put the definition in a VAPI file.If you are doing 
it from a program you need to use the extern keyword:
[SimpleType]
[CCode(cname="float128_t", cheader_filename="softfloat.h", has_type_id = false, 
default_value = "0")]
public extern struct float128_t {}

void main() {
    float128_t example = (float128_t)1.23;
}

You will find a problem converting the constant to be a float128_t.Not sure how 
to handle that. 
Also I haven't looked in to which library provides float128_t so the 
header probably won't be correct.
Al



On Tue, May 24, 2016 at 11:16 AM Al Thomas <astav...@yahoo.co.uk> wrote:




 
  From: ben <iofel...@gmail.com>
 Sent: Tuesday, 24 May 2016, 16:01
 Subject: Re: [Vala] Extended floating types
 

 
This does not work. The C code has: typedef float float128_t;




Try:
[SimpleType][CCode(has_type_id = false, default_value = "0")]public struct 
float128_t {}
The SimplyType makes it be passed by value rather than by reference when usedas 
an argument in a function call.I think the FloatingType, IntegerType, etc. does 
casting. As there is norank 12 it just casts to the default, i.e. float.

On the subject of binding exotic types. Bindings for C decimal typeswould be 
useful for financial data and transactions.



On Mon, 2016-05-23 at 21:26 -0500, Guillaume Poirier-Morency wrote:
> It's possible to declare these types if you need to use them.
> 
> https://wiki.gnome.org/Projects/Vala/Manual/Attributes#FloatingType_A
> tt
> ribute
> 
> [CCode (has_type_id = false)]
> [FloatingType (decimal = false, rank = 12, width = 128]
> struct float128_t {}
> 

   
 


   
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Extended floating types

2016-05-24 Thread Daniel Espinosa
May this even better, by using a specialized math library written in C with
bindings for Vala.

We can wrap this library in GObject classes, then create Vala bindings and
GObject Introspection ones for other languages like Python.

If Vala bindings exists, we can create GObject wrappers written in Vala,
like we do at GXml for libxml2.
El may. 24, 2016 10:01 AM, "ben"  escribió:

> This does not work. The C code has: typedef float float128_t;
>
> You could map it to gcc's 128 bit floating point type (https://gcc.gnu.
> org/onlinedocs/gcc/Floating-Types.html) or use the 80-bit long double
> type (https://stackoverflow.com/questions/13516476/long-double-gcc-spec
> ific-and-float128)
>
> Neither of these options are standard. For arbitrary precision math in
> C I like to use https://gmplib.org/.
>
>
>
> On Mon, 2016-05-23 at 21:26 -0500, Guillaume Poirier-Morency wrote:
> > It's possible to declare these types if you need to use them.
> >
> > https://wiki.gnome.org/Projects/Vala/Manual/Attributes#FloatingType_A
> > tt
> > ribute
> >
> > [CCode (has_type_id = false)]
> > [FloatingType (decimal = false, rank = 12, width = 128]
> > struct float128_t {}
> >
> > Like Daniel said, Vala primitive types are mapped to GLib's type with
> > the GType system, so it's not really the language's fault if there is
> > no support for 128 bit floating points. It's not a common use case
> > either way.
> >
> > With 'has_type_id = false', the compiler knows that there's no type
> > information to retreive.
> >
> > Rank 12 does not really exist, but that would be the appropriate
> > value
> > since 10 and 11 are for signed and unsigned 64 bit types.
> >
> > It might be handy to have a VAPI for that in 'vala-extra-vapis'.
> >
> > Cheers and best luck,
> >
> > Le lundi 23 mai 2016 à 09:59 +0300, Vitaly V. Ch a écrit :
> > > Ok, Thanks.
> > >
> > > It clarifies the situation.
> > >
> > > With best regards,
> > >
> > > Vitaly Chernooky
> > >
> > > On Mon, May 23, 2016 at 4:51 AM, Daniel Espinosa 
> > > wrote:
> > >
> > > > May you should be able to create your own basic type.
> > > >
> > > > May should be a guide to do so.
> > > >
> > > > GLib should have this types too, before you are able to create
> > > > your
> > > > basic
> > > > types. This means you should define a GType for a basic type, in
> > > > this case
> > > > your long double.
> > > >
> > > > May we can create a library to define this math basic types, to
> > > > be
> > > > used in
> > > > other libraries. This is not a GLib interest, I think, because is
> > > > not a
> > > > primary Math library.
> > > >
> > > > I was working a little in that, but may you should ask to gtk-
> > > > list
> > > > for
> > > > help on defining this new types.
> > > >
> > > > In other ideas, is required to use that types or is possible to
> > > > use
> > > > some
> > > > structs holding your information in a way to be used in other
> > > > methods, that
> > > > may take that structs an do calculations using that types
> > > > internally,
> > > > written in C with Vala bindings [1], then return again that
> > > > structs.
> > > >
> > > > [] See git.gnome.org/browse/gxml it uses simple C methods and
> > > > Vala
> > > > bindings to be used in Vala code for xlibxml
> > > > El may. 22, 2016 3:23 PM, "Vitaly V. Ch" 
> > > > escribió:
> > > >
> > > > Hi All!
> > > >
> > > > Some time ago Vala has pulled my attention as a way to solve some
> > > > kind of
> > > > math problems. But some time later I realized that this cozy and
> > > > beautiful
> > > > staff does not have extended floating datatypes such as long
> > > > double
> > > > or
> > > > float128_t. This fact disappointed me and I'm interested in some
> > > > comments.
> > > >
> > > > With best regards,
> > > >
> > > > Vitaly Chernooky
> > > > ___
> > > > vala-list mailing list
> > > > vala-list@gnome.org
> > > > https://mail.gnome.org/mailman/listinfo/vala-list
> > > >
> > > >
> > > ___
> > > vala-list mailing list
> > > vala-list@gnome.org
> > > https://mail.gnome.org/mailman/listinfo/vala-list
> > ___
> > vala-list mailing list
> > vala-list@gnome.org
> > https://mail.gnome.org/mailman/listinfo/vala-list
> ___
> vala-list mailing list
> vala-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/vala-list
>
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Extended floating types

2016-05-24 Thread Daniel Espinosa
Yes please, file a bug.

May discussion can continue on it.
El may. 24, 2016 6:55 AM, "Vitaly V. Ch" 
escribió:

> It will be good if I create a tiket in Bugzilla?
>
> With best regards,
>
> Vitaly
>
> On Tue, May 24, 2016 at 1:04 PM, Daniel Espinosa  wrote:
>
>> May we need to file a bug report against this issue, in order to help
>> others to use Vala in different applications when needed.
>> El may. 23, 2016 9:27 PM, "Guillaume Poirier-Morency" <
>> guillaumepoiriermore...@gmail.com> escribió:
>>
>> > It's possible to declare these types if you need to use them.
>> >
>> > https://wiki.gnome.org/Projects/Vala/Manual/Attributes#FloatingType_Att
>> > ribute
>> >
>> > [CCode (has_type_id = false)]
>> > [FloatingType (decimal = false, rank = 12, width = 128]
>> > struct float128_t {}
>> >
>> > Like Daniel said, Vala primitive types are mapped to GLib's type with
>> > the GType system, so it's not really the language's fault if there is
>> > no support for 128 bit floating points. It's not a common use case
>> > either way.
>> >
>> > With 'has_type_id = false', the compiler knows that there's no type
>> > information to retreive.
>> >
>> > Rank 12 does not really exist, but that would be the appropriate value
>> > since 10 and 11 are for signed and unsigned 64 bit types.
>> >
>> > It might be handy to have a VAPI for that in 'vala-extra-vapis'.
>> >
>> > Cheers and best luck,
>> >
>> > Le lundi 23 mai 2016 à 09:59 +0300, Vitaly V. Ch a écrit :
>> > > Ok, Thanks.
>> > >
>> > > It clarifies the situation.
>> > >
>> > > With best regards,
>> > >
>> > > Vitaly Chernooky
>> > >
>> > > On Mon, May 23, 2016 at 4:51 AM, Daniel Espinosa 
>> > > wrote:
>> > >
>> > > > May you should be able to create your own basic type.
>> > > >
>> > > > May should be a guide to do so.
>> > > >
>> > > > GLib should have this types too, before you are able to create your
>> > > > basic
>> > > > types. This means you should define a GType for a basic type, in
>> > > > this case
>> > > > your long double.
>> > > >
>> > > > May we can create a library to define this math basic types, to be
>> > > > used in
>> > > > other libraries. This is not a GLib interest, I think, because is
>> > > > not a
>> > > > primary Math library.
>> > > >
>> > > > I was working a little in that, but may you should ask to gtk-list
>> > > > for
>> > > > help on defining this new types.
>> > > >
>> > > > In other ideas, is required to use that types or is possible to use
>> > > > some
>> > > > structs holding your information in a way to be used in other
>> > > > methods, that
>> > > > may take that structs an do calculations using that types
>> > > > internally,
>> > > > written in C with Vala bindings [1], then return again that
>> > > > structs.
>> > > >
>> > > > [] See git.gnome.org/browse/gxml it uses simple C methods and Vala
>> > > > bindings to be used in Vala code for xlibxml
>> > > > El may. 22, 2016 3:23 PM, "Vitaly V. Ch" 
>> > > > escribió:
>> > > >
>> > > > Hi All!
>> > > >
>> > > > Some time ago Vala has pulled my attention as a way to solve some
>> > > > kind of
>> > > > math problems. But some time later I realized that this cozy and
>> > > > beautiful
>> > > > staff does not have extended floating datatypes such as long double
>> > > > or
>> > > > float128_t. This fact disappointed me and I'm interested in some
>> > > > comments.
>> > > >
>> > > > With best regards,
>> > > >
>> > > > Vitaly Chernooky
>> > > > ___
>> > > > vala-list mailing list
>> > > > vala-list@gnome.org
>> > > > https://mail.gnome.org/mailman/listinfo/vala-list
>> > > >
>> > > >
>> > > ___
>> > > vala-list mailing list
>> > > vala-list@gnome.org
>> > > https://mail.gnome.org/mailman/listinfo/vala-list
>> > --
>> > Guillaume Poirier-Morency 
>> >
>> > Étudiant au baccalauréat en Informatique à l'Université de Montréal
>> > Développeur d'application web
>> >
>> > Mon blog: https://arteymix.github.io/
>> > Mon projet de coopérative: https://pittoresque.github.io/
>> > Clé PGP: B1AD6EA5
>> > ___
>> > vala-list mailing list
>> > vala-list@gnome.org
>> > https://mail.gnome.org/mailman/listinfo/vala-list
>> >
>> >
>> ___
>> vala-list mailing list
>> vala-list@gnome.org
>> https://mail.gnome.org/mailman/listinfo/vala-list
>>
>
>
>
> --
> \\wbr Vitaly
>
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Extended floating types

2016-05-24 Thread Ben Iofel
error: structs cannot be empty: float128_t

On Tue, May 24, 2016 at 11:16 AM Al Thomas <astav...@yahoo.co.uk> wrote:

>
>
>
> --
> *From:* ben <iofel...@gmail.com>
> *Sent:* Tuesday, 24 May 2016, 16:01
> *Subject:* Re: [Vala] Extended floating types
>
>
> This does not work. The C code has: typedef float float128_t;
>
> Try:
>
> [SimpleType]
> [CCode(has_type_id = false, default_value = "0")]
> public struct float128_t {}
>
> The SimplyType makes it be passed by value rather than by reference when
> used
> as an argument in a function call.
> I think the FloatingType, IntegerType, etc. does casting. As there is no
> rank 12 it just casts to the default, i.e. float.
>
> On the subject of binding exotic types. Bindings for C decimal types
> would be useful for financial data and transactions.
>
>
> On Mon, 2016-05-23 at 21:26 -0500, Guillaume Poirier-Morency wrote:
> > It's possible to declare these types if you need to use them.
> >
> > https://wiki.gnome.org/Projects/Vala/Manual/Attributes#FloatingType_A
> > tt
> > ribute
> >
> > [CCode (has_type_id = false)]
> > [FloatingType (decimal = false, rank = 12, width = 128]
> > struct float128_t {}
> >
>
>
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Extended floating types

2016-05-24 Thread Al Thomas



 
  From: ben <iofel...@gmail.com>
 Sent: Tuesday, 24 May 2016, 16:01
 Subject: Re: [Vala] Extended floating types
   
This does not work. The C code has: typedef float float128_t;


Try:
[SimpleType][CCode(has_type_id = false, default_value = "0")]public struct 
float128_t {}
The SimplyType makes it be passed by value rather than by reference when usedas 
an argument in a function call.I think the FloatingType, IntegerType, etc. does 
casting. As there is norank 12 it just casts to the default, i.e. float.

On the subject of binding exotic types. Bindings for C decimal typeswould be 
useful for financial data and transactions.



On Mon, 2016-05-23 at 21:26 -0500, Guillaume Poirier-Morency wrote:
> It's possible to declare these types if you need to use them.
> 
> https://wiki.gnome.org/Projects/Vala/Manual/Attributes#FloatingType_A
> tt
> ribute
> 
> [CCode (has_type_id = false)]
> [FloatingType (decimal = false, rank = 12, width = 128]
> struct float128_t {}
> 

   
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Extended floating types

2016-05-24 Thread ben
This does not work. The C code has: typedef float float128_t;

You could map it to gcc's 128 bit floating point type (https://gcc.gnu.
org/onlinedocs/gcc/Floating-Types.html) or use the 80-bit long double
type (https://stackoverflow.com/questions/13516476/long-double-gcc-spec
ific-and-float128)

Neither of these options are standard. For arbitrary precision math in
C I like to use https://gmplib.org/.



On Mon, 2016-05-23 at 21:26 -0500, Guillaume Poirier-Morency wrote:
> It's possible to declare these types if you need to use them.
> 
> https://wiki.gnome.org/Projects/Vala/Manual/Attributes#FloatingType_A
> tt
> ribute
> 
> [CCode (has_type_id = false)]
> [FloatingType (decimal = false, rank = 12, width = 128]
> struct float128_t {}
> 
> Like Daniel said, Vala primitive types are mapped to GLib's type with
> the GType system, so it's not really the language's fault if there is
> no support for 128 bit floating points. It's not a common use case
> either way.
> 
> With 'has_type_id = false', the compiler knows that there's no type
> information to retreive.
> 
> Rank 12 does not really exist, but that would be the appropriate
> value
> since 10 and 11 are for signed and unsigned 64 bit types.
> 
> It might be handy to have a VAPI for that in 'vala-extra-vapis'.
> 
> Cheers and best luck,
> 
> Le lundi 23 mai 2016 à 09:59 +0300, Vitaly V. Ch a écrit :
> > Ok, Thanks.
> > 
> > It clarifies the situation.
> > 
> > With best regards,
> > 
> > Vitaly Chernooky
> > 
> > On Mon, May 23, 2016 at 4:51 AM, Daniel Espinosa 
> > wrote:
> > 
> > > May you should be able to create your own basic type.
> > > 
> > > May should be a guide to do so.
> > > 
> > > GLib should have this types too, before you are able to create
> > > your
> > > basic
> > > types. This means you should define a GType for a basic type, in
> > > this case
> > > your long double.
> > > 
> > > May we can create a library to define this math basic types, to
> > > be
> > > used in
> > > other libraries. This is not a GLib interest, I think, because is
> > > not a
> > > primary Math library.
> > > 
> > > I was working a little in that, but may you should ask to gtk-
> > > list
> > > for
> > > help on defining this new types.
> > > 
> > > In other ideas, is required to use that types or is possible to
> > > use
> > > some
> > > structs holding your information in a way to be used in other
> > > methods, that
> > > may take that structs an do calculations using that types
> > > internally,
> > > written in C with Vala bindings [1], then return again that
> > > structs.
> > > 
> > > [] See git.gnome.org/browse/gxml it uses simple C methods and
> > > Vala
> > > bindings to be used in Vala code for xlibxml
> > > El may. 22, 2016 3:23 PM, "Vitaly V. Ch" 
> > > escribió:
> > > 
> > > Hi All!
> > > 
> > > Some time ago Vala has pulled my attention as a way to solve some
> > > kind of
> > > math problems. But some time later I realized that this cozy and
> > > beautiful
> > > staff does not have extended floating datatypes such as long
> > > double
> > > or
> > > float128_t. This fact disappointed me and I'm interested in some
> > > comments.
> > > 
> > > With best regards,
> > > 
> > > Vitaly Chernooky
> > > ___
> > > vala-list mailing list
> > > vala-list@gnome.org
> > > https://mail.gnome.org/mailman/listinfo/vala-list
> > > 
> > > 
> > ___
> > vala-list mailing list
> > vala-list@gnome.org
> > https://mail.gnome.org/mailman/listinfo/vala-list
> ___
> vala-list mailing list
> vala-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/vala-list
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Extended floating types

2016-05-24 Thread Vitaly V. Ch
It will be good if I create a tiket in Bugzilla?

With best regards,

Vitaly

On Tue, May 24, 2016 at 1:04 PM, Daniel Espinosa  wrote:

> May we need to file a bug report against this issue, in order to help
> others to use Vala in different applications when needed.
> El may. 23, 2016 9:27 PM, "Guillaume Poirier-Morency" <
> guillaumepoiriermore...@gmail.com> escribió:
>
> > It's possible to declare these types if you need to use them.
> >
> > https://wiki.gnome.org/Projects/Vala/Manual/Attributes#FloatingType_Att
> > ribute
> >
> > [CCode (has_type_id = false)]
> > [FloatingType (decimal = false, rank = 12, width = 128]
> > struct float128_t {}
> >
> > Like Daniel said, Vala primitive types are mapped to GLib's type with
> > the GType system, so it's not really the language's fault if there is
> > no support for 128 bit floating points. It's not a common use case
> > either way.
> >
> > With 'has_type_id = false', the compiler knows that there's no type
> > information to retreive.
> >
> > Rank 12 does not really exist, but that would be the appropriate value
> > since 10 and 11 are for signed and unsigned 64 bit types.
> >
> > It might be handy to have a VAPI for that in 'vala-extra-vapis'.
> >
> > Cheers and best luck,
> >
> > Le lundi 23 mai 2016 à 09:59 +0300, Vitaly V. Ch a écrit :
> > > Ok, Thanks.
> > >
> > > It clarifies the situation.
> > >
> > > With best regards,
> > >
> > > Vitaly Chernooky
> > >
> > > On Mon, May 23, 2016 at 4:51 AM, Daniel Espinosa 
> > > wrote:
> > >
> > > > May you should be able to create your own basic type.
> > > >
> > > > May should be a guide to do so.
> > > >
> > > > GLib should have this types too, before you are able to create your
> > > > basic
> > > > types. This means you should define a GType for a basic type, in
> > > > this case
> > > > your long double.
> > > >
> > > > May we can create a library to define this math basic types, to be
> > > > used in
> > > > other libraries. This is not a GLib interest, I think, because is
> > > > not a
> > > > primary Math library.
> > > >
> > > > I was working a little in that, but may you should ask to gtk-list
> > > > for
> > > > help on defining this new types.
> > > >
> > > > In other ideas, is required to use that types or is possible to use
> > > > some
> > > > structs holding your information in a way to be used in other
> > > > methods, that
> > > > may take that structs an do calculations using that types
> > > > internally,
> > > > written in C with Vala bindings [1], then return again that
> > > > structs.
> > > >
> > > > [] See git.gnome.org/browse/gxml it uses simple C methods and Vala
> > > > bindings to be used in Vala code for xlibxml
> > > > El may. 22, 2016 3:23 PM, "Vitaly V. Ch" 
> > > > escribió:
> > > >
> > > > Hi All!
> > > >
> > > > Some time ago Vala has pulled my attention as a way to solve some
> > > > kind of
> > > > math problems. But some time later I realized that this cozy and
> > > > beautiful
> > > > staff does not have extended floating datatypes such as long double
> > > > or
> > > > float128_t. This fact disappointed me and I'm interested in some
> > > > comments.
> > > >
> > > > With best regards,
> > > >
> > > > Vitaly Chernooky
> > > > ___
> > > > vala-list mailing list
> > > > vala-list@gnome.org
> > > > https://mail.gnome.org/mailman/listinfo/vala-list
> > > >
> > > >
> > > ___
> > > vala-list mailing list
> > > vala-list@gnome.org
> > > https://mail.gnome.org/mailman/listinfo/vala-list
> > --
> > Guillaume Poirier-Morency 
> >
> > Étudiant au baccalauréat en Informatique à l'Université de Montréal
> > Développeur d'application web
> >
> > Mon blog: https://arteymix.github.io/
> > Mon projet de coopérative: https://pittoresque.github.io/
> > Clé PGP: B1AD6EA5
> > ___
> > vala-list mailing list
> > vala-list@gnome.org
> > https://mail.gnome.org/mailman/listinfo/vala-list
> >
> >
> ___
> vala-list mailing list
> vala-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/vala-list
>



-- 
\\wbr Vitaly
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Extended floating types

2016-05-24 Thread Daniel Espinosa
May we need to file a bug report against this issue, in order to help
others to use Vala in different applications when needed.
El may. 23, 2016 9:27 PM, "Guillaume Poirier-Morency" <
guillaumepoiriermore...@gmail.com> escribió:

> It's possible to declare these types if you need to use them.
>
> https://wiki.gnome.org/Projects/Vala/Manual/Attributes#FloatingType_Att
> ribute
>
> [CCode (has_type_id = false)]
> [FloatingType (decimal = false, rank = 12, width = 128]
> struct float128_t {}
>
> Like Daniel said, Vala primitive types are mapped to GLib's type with
> the GType system, so it's not really the language's fault if there is
> no support for 128 bit floating points. It's not a common use case
> either way.
>
> With 'has_type_id = false', the compiler knows that there's no type
> information to retreive.
>
> Rank 12 does not really exist, but that would be the appropriate value
> since 10 and 11 are for signed and unsigned 64 bit types.
>
> It might be handy to have a VAPI for that in 'vala-extra-vapis'.
>
> Cheers and best luck,
>
> Le lundi 23 mai 2016 à 09:59 +0300, Vitaly V. Ch a écrit :
> > Ok, Thanks.
> >
> > It clarifies the situation.
> >
> > With best regards,
> >
> > Vitaly Chernooky
> >
> > On Mon, May 23, 2016 at 4:51 AM, Daniel Espinosa 
> > wrote:
> >
> > > May you should be able to create your own basic type.
> > >
> > > May should be a guide to do so.
> > >
> > > GLib should have this types too, before you are able to create your
> > > basic
> > > types. This means you should define a GType for a basic type, in
> > > this case
> > > your long double.
> > >
> > > May we can create a library to define this math basic types, to be
> > > used in
> > > other libraries. This is not a GLib interest, I think, because is
> > > not a
> > > primary Math library.
> > >
> > > I was working a little in that, but may you should ask to gtk-list
> > > for
> > > help on defining this new types.
> > >
> > > In other ideas, is required to use that types or is possible to use
> > > some
> > > structs holding your information in a way to be used in other
> > > methods, that
> > > may take that structs an do calculations using that types
> > > internally,
> > > written in C with Vala bindings [1], then return again that
> > > structs.
> > >
> > > [] See git.gnome.org/browse/gxml it uses simple C methods and Vala
> > > bindings to be used in Vala code for xlibxml
> > > El may. 22, 2016 3:23 PM, "Vitaly V. Ch" 
> > > escribió:
> > >
> > > Hi All!
> > >
> > > Some time ago Vala has pulled my attention as a way to solve some
> > > kind of
> > > math problems. But some time later I realized that this cozy and
> > > beautiful
> > > staff does not have extended floating datatypes such as long double
> > > or
> > > float128_t. This fact disappointed me and I'm interested in some
> > > comments.
> > >
> > > With best regards,
> > >
> > > Vitaly Chernooky
> > > ___
> > > vala-list mailing list
> > > vala-list@gnome.org
> > > https://mail.gnome.org/mailman/listinfo/vala-list
> > >
> > >
> > ___
> > vala-list mailing list
> > vala-list@gnome.org
> > https://mail.gnome.org/mailman/listinfo/vala-list
> --
> Guillaume Poirier-Morency 
>
> Étudiant au baccalauréat en Informatique à l'Université de Montréal
> Développeur d'application web
>
> Mon blog: https://arteymix.github.io/
> Mon projet de coopérative: https://pittoresque.github.io/
> Clé PGP: B1AD6EA5
> ___
> vala-list mailing list
> vala-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/vala-list
>
>
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Extended floating types

2016-05-24 Thread Al Thomas



 
  From: Guillaume Poirier-Morency <guillaumepoiriermore...@gmail.com>
 Sent: Tuesday, 24 May 2016, 3:26
 Subject: Re: [Vala] Extended floating types
   
It's possible to declare these types if you need to use them.

https://wiki.gnome.org/Projects/Vala/Manual/Attributes#FloatingType_Att
ribute

    [CCode (has_type_id = false)]
    [FloatingType (decimal = false, rank = 12, width = 128]
    struct float128_t {}

Good idea! Probably better still:
[SimpleType]
[CCode (has_type_id = false)]
[FloatingType (decimal = false, rank = 12, width = 128]
public struct float128_t {}
I think the SimpleType tells Vala the usual struct syntax isn't needed.You may 
also need the cheader_filename in there as welll.
You could also play around with the name, e.g. use cname="float128_t"then call 
it:public struct float128 {}but maybe that should wait to see if it becomes 
bound in GLib first.
As an example, this is how double is bound to 
gdouble:https://git.gnome.org/browse/vala/tree/vapi/glib-2.0.vapi#n805



   
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Extended floating types

2016-05-23 Thread Guillaume Poirier-Morency
It's possible to declare these types if you need to use them.

https://wiki.gnome.org/Projects/Vala/Manual/Attributes#FloatingType_Att
ribute

[CCode (has_type_id = false)]
[FloatingType (decimal = false, rank = 12, width = 128]
struct float128_t {}

Like Daniel said, Vala primitive types are mapped to GLib's type with
the GType system, so it's not really the language's fault if there is
no support for 128 bit floating points. It's not a common use case
either way.

With 'has_type_id = false', the compiler knows that there's no type
information to retreive.

Rank 12 does not really exist, but that would be the appropriate value
since 10 and 11 are for signed and unsigned 64 bit types.

It might be handy to have a VAPI for that in 'vala-extra-vapis'.

Cheers and best luck,

Le lundi 23 mai 2016 à 09:59 +0300, Vitaly V. Ch a écrit :
> Ok, Thanks.
> 
> It clarifies the situation.
> 
> With best regards,
> 
> Vitaly Chernooky
> 
> On Mon, May 23, 2016 at 4:51 AM, Daniel Espinosa 
> wrote:
> 
> > May you should be able to create your own basic type.
> > 
> > May should be a guide to do so.
> > 
> > GLib should have this types too, before you are able to create your
> > basic
> > types. This means you should define a GType for a basic type, in
> > this case
> > your long double.
> > 
> > May we can create a library to define this math basic types, to be
> > used in
> > other libraries. This is not a GLib interest, I think, because is
> > not a
> > primary Math library.
> > 
> > I was working a little in that, but may you should ask to gtk-list
> > for
> > help on defining this new types.
> > 
> > In other ideas, is required to use that types or is possible to use
> > some
> > structs holding your information in a way to be used in other
> > methods, that
> > may take that structs an do calculations using that types
> > internally,
> > written in C with Vala bindings [1], then return again that
> > structs.
> > 
> > [] See git.gnome.org/browse/gxml it uses simple C methods and Vala
> > bindings to be used in Vala code for xlibxml
> > El may. 22, 2016 3:23 PM, "Vitaly V. Ch" 
> > escribió:
> > 
> > Hi All!
> > 
> > Some time ago Vala has pulled my attention as a way to solve some
> > kind of
> > math problems. But some time later I realized that this cozy and
> > beautiful
> > staff does not have extended floating datatypes such as long double
> > or
> > float128_t. This fact disappointed me and I'm interested in some
> > comments.
> > 
> > With best regards,
> > 
> > Vitaly Chernooky
> > ___
> > vala-list mailing list
> > vala-list@gnome.org
> > https://mail.gnome.org/mailman/listinfo/vala-list
> > 
> > 
> ___
> vala-list mailing list
> vala-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/vala-list
-- 
Guillaume Poirier-Morency 

Étudiant au baccalauréat en Informatique à l'Université de Montréal
Développeur d'application web

Mon blog: https://arteymix.github.io/
Mon projet de coopérative: https://pittoresque.github.io/
Clé PGP: B1AD6EA5

signature.asc
Description: This is a digitally signed message part
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Extended floating types

2016-05-23 Thread Vitaly V. Ch
Ok, Thanks.

It clarifies the situation.

With best regards,

Vitaly Chernooky

On Mon, May 23, 2016 at 4:51 AM, Daniel Espinosa  wrote:

> May you should be able to create your own basic type.
>
> May should be a guide to do so.
>
> GLib should have this types too, before you are able to create your basic
> types. This means you should define a GType for a basic type, in this case
> your long double.
>
> May we can create a library to define this math basic types, to be used in
> other libraries. This is not a GLib interest, I think, because is not a
> primary Math library.
>
> I was working a little in that, but may you should ask to gtk-list for
> help on defining this new types.
>
> In other ideas, is required to use that types or is possible to use some
> structs holding your information in a way to be used in other methods, that
> may take that structs an do calculations using that types internally,
> written in C with Vala bindings [1], then return again that structs.
>
> [] See git.gnome.org/browse/gxml it uses simple C methods and Vala
> bindings to be used in Vala code for xlibxml
> El may. 22, 2016 3:23 PM, "Vitaly V. Ch"  escribió:
>
> Hi All!
>
> Some time ago Vala has pulled my attention as a way to solve some kind of
> math problems. But some time later I realized that this cozy and beautiful
> staff does not have extended floating datatypes such as long double or
> float128_t. This fact disappointed me and I'm interested in some comments.
>
> With best regards,
>
> Vitaly Chernooky
> ___
> vala-list mailing list
> vala-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/vala-list
>
>
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Extended floating types

2016-05-22 Thread Daniel Espinosa
May you should be able to create your own basic type.

May should be a guide to do so.

GLib should have this types too, before you are able to create your basic
types. This means you should define a GType for a basic type, in this case
your long double.

May we can create a library to define this math basic types, to be used in
other libraries. This is not a GLib interest, I think, because is not a
primary Math library.

I was working a little in that, but may you should ask to gtk-list for help
on defining this new types.

In other ideas, is required to use that types or is possible to use some
structs holding your information in a way to be used in other methods, that
may take that structs an do calculations using that types internally,
written in C with Vala bindings [1], then return again that structs.

[] See git.gnome.org/browse/gxml it uses simple C methods and Vala bindings
to be used in Vala code for xlibxml
El may. 22, 2016 3:23 PM, "Vitaly V. Ch"  escribió:

Hi All!

Some time ago Vala has pulled my attention as a way to solve some kind of
math problems. But some time later I realized that this cozy and beautiful
staff does not have extended floating datatypes such as long double or
float128_t. This fact disappointed me and I'm interested in some comments.

With best regards,

Vitaly Chernooky
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list