Re: [Vala] How to ignore exceptions?

2011-10-31 Thread Aleksander Wabik
f you >> have to choose between a ";" or a "catch", the probability of >> "forgetting" it is greatly reduced. >> >> El 31/10/11 23:22, pancake escribió: >> > Hi >> > >> > On 31/10/2011, at 20:16, Aleksander Wabik wrote:

Re: [Vala] How to ignore exceptions?

2011-10-31 Thread Aleksander Wabik
My 2 pennies: >What about adding a code attribute like [IgnoreException] ? that would perform >better than trycatching It seems the most logical option to me. Vala is a language that allows ignoring exceptions, and (as far as I remember, it was a while ago when I was writing my vala code) it gen

Re: [Vala] Blitzen source code

2011-08-17 Thread Aleksander Wabik
>http://www.blitzen.org/ > Is this site having some technical problems now? I'm trying with Opera and Firefox, but no urls on the main site are working. best regards, AW. -- Mój klucz publiczny o identyfikatorze 1024D/E12C5A4C znajduje się na serwerze hkp://keys.gnupg.net My public key with si

Re: [Vala] An array of Delegations?

2011-06-01 Thread Aleksander Wabik
But keep in mind that glib signals are not good if you care about performance. best regards, >I know it's not exactly what you want, but you can use signals to obtain >something similar. Since signals can contain parameters and return values, >they function more or less like delegates when connec

Re: [Vala] valac can read a typelib in place of a vapi binding

2011-04-01 Thread Aleksander Wabik
INAVD (I'm not a Vala developer ;)) >I realized to my surprise today that valac (0.11.7) can read a GObject >introspection type library in place of a VAPI file! For example, I can >specify '--pkg PeasGtk-1.0' on the command line and valac will read >types from /usr/lib/girepository-1.0/PeasGtk

Re: [Vala] "as" word

2011-03-18 Thread Aleksander Wabik
>var window = builder.get_object("window") as Gtk.Window; > >what means this word in this string? Dynamic cast: if the object returned by builder.get_object() is inheriting Gtk.Window, window will be of type Gtk.Window; if not, window will be null (and of type Gtk.Window). best regards, -- Mój

Re: [Vala] Problem with the locale

2011-03-18 Thread Aleksander Wabik
>Hello, > >I am using the GLib.DateTime .format() to display a date. But the problem is >that the date format is not showed in the correct locale format (in my case >spanish: es_ES.utf8). I have check the settings (locale) also generated the >locale (locale-gen) but nothing. In the Gnome clock appe

Re: [Vala] Vala vs Mono performance benchmark project

2011-02-26 Thread Aleksander Wabik
>On 30/01/11 19:55, Aleksander Wabik wrote: >> Hi All, >> >> I've prepared a little benchmark measuring Vala object system >> performance ( http://gitorious.org/vala-object-benchmarks ) >> >> - object creation and destruction >> - method,

[Vala] Vala 0.11.6 glib bindings bug

2011-02-25 Thread Aleksander Wabik
Hi, I just noticed that valac fails to compile anything if --enable-experimental-non-null is used. Just create empty file (test.vala) and try to compile it: $ valac --enable-experimental-non-null test.vala glib-2.0.vapi:1337.15-1337.24: error: Access to instance member `string.length' from nulla

Re: [Vala] Vala vs Mono performance benchmark project

2011-02-22 Thread Aleksander Wabik
>I've made a patch against vala git for getting this directly with valac >(but only when it's possible), please test it http://go.3v1n0.net/euaIxh >and let me know how it works for you ;) Hi Marco, I appreciate your patch - it is really good and I can't wait for it included in mainline Vala :) I

Re: [Vala] Vala vs Mono performance benchmark project

2011-02-17 Thread Aleksander Wabik
Hi Marco, > >I've made a patch against vala git for getting this directly with valac >(but only when it's possible), please test it http://go.3v1n0.net/euaIxh >and let me know how it works for you ;) > I'll run benchmarks with patched valac, but I don't know if I'll have time until Sunday. I'll l

Re: [Vala] Ctags support?

2011-02-13 Thread Aleksander Wabik
>Does anyone know if there's a ctags build that supports vala? http://aur.archlinux.org/packages.php?ID=36285 ? regards, -- Mój klucz publiczny o identyfikatorze 1024D/E12C5A4C znajduje się na serwerze hkp://keys.gnupg.net My public key with signature 1024D/E12C5A4C is on the server hkp://keys.

Re: [Vala] dova and glib

2011-02-05 Thread Aleksander Wabik
Hi, >Thank you all for the answers. Creating Dova binding for the GObject library >is fine, but I would like to narrow my original question. > >We're planing to create some set of a libraries using Vala and I think that >it would be great if we can compile from one source code two libraries for >t

Re: [Vala] dova and glib

2011-01-31 Thread Aleksander Wabik
Hi, >Hi guys! I really respect you'r effort for the Vala. > >I have a question about Dova and it's future. At this moment Dova is in the >experimental state and incompatible with glib. Is there any real compelling >reason that makes dova incompatible with glib? > >If we could base a program on dov

Re: [Vala] Vala vs Mono performance benchmark project

2011-01-31 Thread Aleksander Wabik
>the ref/unref performance penalty can only be fixed with a garbage collector, >or just delegating all these tasks to a separated thread, or use slices to >alloc/free.. but this is more or less what a decent gc does. > >--pancake > >On Jan 30, 2011, at 7:55 PM, Aleksander Wabik

Re: [Vala] Vala for everyone

2011-01-31 Thread Aleksander Wabik
>On Mon, Jan 31, 2011 at 17:40:50 +0000, Aleksander Wabik wrote: >> But if you're targetting BREW or Symbian, it would be probably not working >> - Symbian AFAIK disallows global static data in shared libraries > >I am certain there were glib sources in Symbian SDK (9.

Re: [Vala] Vala vs Mono performance benchmark project

2011-01-31 Thread Aleksander Wabik
ls working in dova yet, but I'm a couple of weaks lagged with my dova & vala updates. best regards, > >On Mon, Jan 31, 2011 at 11:14 AM, Jan Hudec wrote: >> On Mon, Jan 31, 2011 at 17:35:09 +, Aleksander Wabik wrote: >>> Hi Pancake, >>> >>> I

Re: [Vala] Vala for everyone

2011-01-31 Thread Aleksander Wabik
Hi, >Hi all, > >I'm not a GNOME developer but I'm interrested in Vala because for me it would >be a perfect C frontend. C is virtually platform independent because C >compilers exist for nearly every processor / controller. >So my question is: >Why is Vala that hardly bound to the Gnom

Re: [Vala] Vala vs Mono performance benchmark project

2011-01-31 Thread Aleksander Wabik
garbage collector, >or just delegating all these tasks to a separated thread, or use slices to >alloc/free.. but this is more or less what a decent gc does. > >--pancake > >On Jan 30, 2011, at 7:55 PM, Aleksander Wabik wrote: > >> Hi All, >> >> I've prepa

[Vala] Vala vs Mono performance benchmark project

2011-01-30 Thread Aleksander Wabik
Hi All, I've prepared a little benchmark measuring Vala object system performance ( http://gitorious.org/vala-object-benchmarks ) - object creation and destruction - method, virtual method, interface method, signal, delegate, delegate from a closure calling times - type checking - threading loc

Re: [Vala] benchmarks on Vala?

2011-01-16 Thread Aleksander Wabik
Hi, >Hi all, > >I'm new to the language and the community. > >I'm wondering if anyone here have benchmarked Vala against Mono, for example. >In particular: performance of basic types and garbage collection. > >- Didip - The only benchmark that I've seen is: http://code.google.com/p/vala-benchmark

Re: [Vala] Behavior on null pointers

2011-01-16 Thread Aleksander Wabik
Hi, >Executing it results in: > >** (process:19834): CRITICAL **: thing_set_property: assertion `self != >NULL' failed > >Apparently the c-version of Thing.set_property makes a call to >g_return_if_fail, which prints the critical message as thing is null. >Shouldn't a programming language, that of

Re: [Vala] GObject allocation / referencing... Why is so slow?

2011-01-15 Thread Aleksander Wabik
>No more comments on what you said below, I agree, maybe with an >exception to the garbage collector thing - I made all possible >references in my master's degree work program unowned, so that the >bookkeeping should be reduced to minimum, and I gained 5% of >performance. Well, I don't know if any

Re: [Vala] GObject allocation / referencing... Why is so slow?

2011-01-15 Thread Aleksander Wabik
Hi, please see some thinks inline, >On Sat, Jan 15, 2011 at 22:53:25 +0100, Jiří Zárevúcky wrote: >> 2011/1/15 Aleksander Wabik : >> >> There are other relevant reasons to choose Vala over >> >> C#, but speed is not one of them. :) >> > This is... very

Re: [Vala] GObject allocation / referencing... Why is so slow?

2011-01-15 Thread Aleksander Wabik
> There are other relevant reasons to choose Vala over > C#, but speed is not one of them. :) This is... very sad. JIT is cool, because it helps to get rid of performance problems introduced by some features of OOP, but if we are compiling to C, should we not try to solve these problems on another

Re: [Vala] GObject allocation / referencing... Why is so slow?

2011-01-14 Thread Aleksander Wabik
>You're C code doesn't use GObject, so why are you comparing it to >GObject? GObject provides more functionality than your code, including >thread safe reference counting, which is also taking time up in the profile. AFAIK Gobject objects creation in Vala is using the general method of calling g

Re: [Vala] Unnecessary g_strdup and compile error.

2010-12-31 Thread Aleksander Wabik
Hi, please see a comment inline, >Hello, >(sorry, my English is not so good ;) > >I often write the following codes. > >void main () { >var home = Environment.get_home_dir (); >print ("%s\n", home); >} >--

Re: [Vala] Name clashes in generated C code

2010-12-27 Thread Aleksander Wabik
Hi, this sort of problems existed for ever in vala, another example: // cut here class Test { int one_method() { return 0; } } class TestOne { int method() { return 1; } } // cut here My way of a

Re: [Vala] Superinterface inheritance

2010-12-26 Thread Aleksander Wabik
This is by design. The interface does not inherit another interface, but is dependent on another intefrace (or class) - it means that to implement an interface, you have to ensure that all interfaces and a proper base class are implemented/inherited. best regards, -- Mój klucz publiczny o identy

Re: [Vala] How to write float and double values into a binary file?

2010-12-18 Thread Aleksander Wabik
>Phil Housley writes: > >> Aside: The following doesn't work: >> >> public void main() { >> float flt = 9.12f; >> var output = FileStream.open("./data.txt","w"); >> output.printf("%f", flt); >> float in_flt = 5f; >> var input = FileStream.open("./data.txt", "r"); >> i

Re: [Vala] Complex number support?

2010-12-13 Thread Aleksander Wabik
>-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 su

Re: [Vala] Complex number support?

2010-12-11 Thread Aleksander Wabik
>when i talked about the complex numbers was because it's interesting to use >the C99 spec to reduce the code size in many programs +1. I'm for every change in vala that let's it use more and more gcc features, and give more control over C code generation. best regards, AW. -- Mój klucz public

Re: [Vala] Array.length

2010-12-06 Thread Aleksander Wabik
Seems like https://bugzilla.gnome.org/show_bug.cgi?id=585847 , but it is claimed to be fixed. Maybe some corner case? best regards, >It seems you found an error in vala. >However, this code works as expected: > >{ >string cadena = "uno,dos,tres,cuatro"; >string[] cadenas = cadena.split(",

Re: [Vala] Interfaces - why do they must have prerequisites?

2010-12-06 Thread Aleksander Wabik
Hi, >On Mon, 2010-12-06 at 01:25 +0100, Aleksander Wabik wrote: >> As classes not inheriting from Object have different ref and unref >> functions (Foo will have foo_ref, and foo_unref, Bar will have bar_ref >> and bar_unref), if an object is referenced by the reference

Re: [Vala] Interfaces - why do they must have prerequisites?

2010-12-05 Thread Aleksander Wabik
I am really sorry for flood, but it just came into my mind: (CCing Jürg , as I think I've found a bug in the object system design) >>On Sun, Dec 05, 2010 at 17:32:17 +0100, Aleksander Wabik wrote: >>> I'm having class Foo, that is _NOT_ inheriting Object, but it'

Re: [Vala] Interfaces - why do they must have prerequisites?

2010-12-05 Thread Aleksander Wabik
>On Sun, Dec 05, 2010 at 17:32:17 +0100, Aleksander Wabik wrote: >> I'm having class Foo, that is _NOT_ inheriting Object, but it's still >> a typed class, and it's implementing interface IFoo. This is (or used to >> be) legal. > >No, it is not and nev

Re: [Vala] Interfaces - why do they must have prerequisites?

2010-12-05 Thread Aleksander Wabik
>On Sun, Dec 05, 2010 at 17:32:17 +0100, Aleksander Wabik wrote: >> I'm having class Foo, that is _NOT_ inheriting Object, but it's still >> a typed class, and it's implementing interface IFoo. This is (or used to >> be) legal. > >No, it is not and nev

Re: [Vala] Interfaces - why do they must have prerequisites?

2010-12-05 Thread Aleksander Wabik
Hi, no, you did not understand: I'm not trying to create object from an interface. I'm having class Foo, that is _NOT_ inheriting Object, but it's still a typed class, and it's implementing interface IFoo. This is (or used to be) legal. I'm creating instances of that class, but the reference is of

[Vala] Interfaces - why do they must have prerequisites?

2010-12-04 Thread Aleksander Wabik
Hi all, I'm using valac 0.11.2, and when I compile the following code, it fails: // --- test.vala --- namespace Test { public interface IFoo { public abstract bool run(); } public class Foo : IFoo { public vi

Re: [Vala] Cannot have field and method with the same name

2010-12-03 Thread Aleksander Wabik
One more note (sorry for flood): >You have to use () for method so you know whether >you access method or field. It's not so simple, because you can assign this function as a callback (delegate or signal) somewhere: object1.delegate_instance = object2.stop; object1.signal_instance.connect(object

Re: [Vala] Cannot have field and method with the same name

2010-12-03 Thread Aleksander Wabik
>I have a class that contains a field and method with the same name, >and Valac does not like it. Generally Vala does not have any usable symbol mangling engine. It's good, because Vala generates a C api and you obviously don't want to have obfuscated symbols there (the way that C++ does it is jus

Re: [Vala] DBus and Zeitgeist namespaces

2010-11-27 Thread Aleksander Wabik
>I recently installed the DBus Vala bindings, but when I use "using DBus;" it >tells me the namespace cannot be found. The same thing happened for "using >Zeitgeist;". Are these the real namespaces for these libraries? > >Thanks in advance. You can look into the vapis for Dbus and Zeitgeist to see

Re: [Vala] Microsoft patents & Vala

2010-11-23 Thread Aleksander Wabik
>No offense to the author of the blog post, but articles like that >are pure and unadulterated FUD. Yes, that's exactly what I thought. I just wanted you people to know about it. I'd not stop using vala even if it truly infringed some patents, because I don't acknowledge software patents at all

[Vala] Microsoft patents & Vala

2010-11-22 Thread Aleksander Wabik
Hi, I've found similar thread in the list archive, I'd answer to that thread but it's old - I only found it in the archive, don't have in my mail client. The old thread is here: http://www.mail-archive.com/v...@paldo.org/msg00121.html The question about how much microsoft patents (especially for

Re: [Vala] Define constant at compile time

2010-11-16 Thread Aleksander Wabik
Hi, macros are a very useful thing, but of course if you don't use your brain, they can do a lot of harm. Here's how I see it: >The easiest way is to tell vala to emit the symbols that will then be defined >when compiling the generated C code. That way vala will guard you from name >conflicts and

Re: [Vala] Define constant at compile time

2010-11-16 Thread Aleksander Wabik
>Hi all, > >I'm new to Vala and I'd like to have some help to solve a small but >frustrating problem. Basically, I have a Gtk.UIManager that I want to >initialize in this way: > > var ui_manager = new Gtk.UIManager(); > ui_manager.add_ui_from_file(UI_FILE); > >I want to specify the constant UI_FI

Re: [Vala] Bug or feature? ***sorry for incomplete first message

2010-10-14 Thread Aleksander Wabik
Hi, I can only speak for myself as I'm vala user, not developer, but I'd say that you should just pay attention to the code that you're writing. Vala is not a dynamically typed language, 'var' still has strictly defined type. When some 'var' represents object, it is possible that the object that

Re: [Vala] Bug or feature

2010-10-14 Thread Aleksander Wabik
>since i'm not versed in vala i'm kinda troubled with this since it differs >from any other language. > >simplified example useless in real code > >string s = "a"; >var a = s; >if (a is string) > But where's he actual question? Do you mean the following error? test.vala:5.5-5.15: error: type chec

Re: [Vala] Question about Gtk.Builder

2010-10-09 Thread Aleksander Wabik
>Why do you bother about closing mainwindow ? In 99% of cases, your >application will end when you close (really, not miniminzing) your >mainwindow. And here that is the case. >Then, OS will reclaim resources ending the application ; so, Why bother ? >Destroying mainwindow is a very special case.

Re: [Vala] valgrind or something similar

2010-09-26 Thread Aleksander Wabik
Hi, > Is there something like a valgrind or method for debugging memory > leaks and mismanagement? valgrind will work for vala programs, you just have to use it as with glib programs - set G_DEBUG=gc_friendly, G_SLICE=always_malloc. best regards, -- Mój klucz publiczny o identyfika

Re: [Vala] Proposed Vala Logo

2010-08-30 Thread Aleksander Wabik
To me it looks great :) regards, >Hello, >I'm no good in graphics. I thought about the colors >(like gtk, gstreamer, fluendo, flumotion, ...) to be red/green/blue and >finding a cool font (LMMathSymbols9). >I ended up to this: http://tinyurl.com/353vbwy > >It's not perfect but I wanted to launch t

[Vala] _get_type() and G_GNUC_CONST

2010-08-18 Thread Aleksander Wabik
Hi all, I've today compiled my program with recent valac (from git master), and just from curiosity I've compared generated C sources with my previous ones. Vala now makes all *get_type() functions const using G_GNUC_CONST. I don't know at which version was this feature added (previously I used 0.

Re: [Vala] [ANNOUNCE] Vala 0.9.6 - Compiler for the GObject type system

2010-08-18 Thread Aleksander Wabik
Well, I compiled vala from git, and it indeed depends on 0.10 version of solib, but this library is also built. Are you sure that your build does not contain libvala-0.10.so.0? best regards, >Hello > >There seems to be a problem with the current release. Typing valac into >the terminal gives: >

Re: [Vala] C# conditional attributes in vala?

2010-08-04 Thread Aleksander Wabik
It is possible to define a macro in C, and crwate a vapi binding for it, so that the C macro is treated as a method in Vala. It's a dirty hack though. You can see here how it's to be done: http://gitorious.org/bnpe/bnpe/blobs/8eb4522f67948f02269359d706126a327869f18d/src/low_level_utils_test.h htt

Re: [Vala] non-null broken in vala 0.9.3

2010-07-16 Thread Aleksander Wabik
Hi all, I'll answer a few things that came up in the discussion: >> Why do I think that enforcing nullchecking by assignment 'non-null = >> (!)nullable' is good, and enforcing checking when accessing members >> is bad? Well: the first one is a contract programming technique, the >> second is not.

[Vala] non-null broken in vala 0.9.3

2010-07-15 Thread Aleksander Wabik
Hi all, to my surprise, I've observed today a bug in vala 0.9.3 bindings: compilation of anything fails when using --enable-experimental-non-null. The error that I'm observing is: glib-2.0.vapi:1134.15-1134.22: error: Access to instance member `string.size' from nullable reference denied