Re: [Vala] Complex number support?



On 12/13/10 19:30, Aleksander Wabik wrote:
-1 portability is VERY important if we want to use vala outside gnu/linux.
I understand your point of view (the whole idea of sticking to
glib as a layer between vala and everything else is good). I'd then
propose to create c99 bindings: c99.vapi or something. It would not be
portable, just as such apis like posix aren't. Complex numbers would
not be part of vala language. But you would not have to use mpfr to get
the functionality that is available at the language level for 10 years.

On the other hand, again: I personally think that the whole idea of
sticking to glib as a layer between vala and everything else is good;
the idea of maintaining glib compatibility with 20-years old tools is
awful (well, that should go to the glib list). Compatibility?

icc: supports c99
rvct: yes, but without complex numbers (in version 3, I don't know what
about 4, but I hope that this will be implemented)
openwatcom: work in progress

I don't want to start a flamewar here, but if by "portability" you mean
"compiling with microsoft compiler", I can not agree with this. From my
point of view, you just can not create a good, modern product using
non-modern tools. Not to mention that microsoft support for C language
is... unclear. I did not touch visual studio for a year, but in the
last version that I've seen there were no C compiler at all, only C++.

Well, these were my 2 pennies.

best regards,

I don't like visual studio, but is what you get if you work for a company
that wants their product on windows. Actually all vala code compiles
in clang, gcc, msvc, tcc, icc and forte. which is pretty good.

I know that VisualStudio C compiler is pretty broken, but I would like
to have Vala fit with the same C standard as GLIB does. Just for
coherence.

The features c99 adds to the language are not really useful and most
of them (apart complex numbers) can be handled by the vala compiler
(defining vars in the middle of the code, switch cases with ranges, ..)

I have never need to use complex numbers.. so i dont see it as an
important feature.

But I understand that if you do stuff with maths you need complex, rational
and big numbers .. and having the language support this can hardly
benefit the development of apps in Vala for such tasks.

What i'm proposing is just simpler. It keeps compatiblity with compiler and
allows to use different backends to implement such kind of types. But requires
to add support for operator overloading in vapis, which requires some
discussion (as I already talk about this a year ago with Jürg).

The use of complex numbers can be defined in a vapi file which make it use
the C99-gcc magic you like, but it will also support other kind of backends,
like native one or based on OpenSSL, GMP or MPFR.

--pancake



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]