Re: [Vala] Port of the Porter stemmer to Vala (more detailed description)

2013-09-17 Thread Serge Hulne
> > Bests, > Giulio. > > On 17/09/2013 11:33, Serge Hulne wrote: >> A more detailed description: >> >> http://tartarus.org/martin/PorterStemmer/ >> >> http://tartarus.org/martin/PorterStemmer/def.txt >> >> >> Serge Hulne. >>

[Vala] Port of the Porter stemmer to Vala (more detailed description)

2013-09-17 Thread Serge Hulne
A more detailed description: http://tartarus.org/martin/PorterStemmer/ http://tartarus.org/martin/PorterStemmer/def.txt Serge Hulne. PS: The code as plain text: using GLib; using Posix; class Stemmer { private char[] b; private int i

[Vala] Port of the Porter stemmer to Vala

2013-09-17 Thread Serge Hulne
Hi, Here is a port of the Poter stemmer to Vala Serge Hulne porter_lib.vala Description: Binary data ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list

[Vala] Great news from Ubuntu : vtg and Valencia (Vala plugins for gedit) are available as packages in Ubuntu 12.04 LTS

2012-05-04 Thread Serge Hulne
Great news from Ubuntu : vtg and Valencia (Vala plugins for gedit) are available as packages in Ubuntu 12.04 LTS : Vtg link Valencia link Ubuntu Link Serge. ___ vala-l

[Vala] Vala on Windows

2012-04-03 Thread Serge Hulne
In the worst-case scenario, you could try with Cygwin instead of Mingw. Whatever compiles under Linux usually also compiles under Windows using Cygwin (the only problem is that it won't compile statically, you will have to ship it with a few DLLs if you want to distribute the resulting executable

[Vala] Is there a Linux distribution in which vtg (vala tools for gedit) works out-of the box ?

2012-03-08 Thread Serge Hulne
Is there a Linux distribution in which vtg (vala tools for gedit) works out-of the box ? In other words, is there a version of Linux which provides Vala, vtg as ready-to install packages ? I am asking this question because, if on one hand quite easy to install Vala from source under Linux, on th

[Vala] Some info about the Vala programming language in relation to the TIOBE index:

2012-02-25 Thread Serge Hulne
: Serge Hulne Hi Serge, Thanks for your feedback on our TIOBE index. We have been monitoring Vala now since April 2010, grouped together with Genie. It is currently at position 131. One year ago it was at position 129. Please find attached the trend graph for Vala/Genie. As far as I can see it is

Re: [Vala] DataBase as a Gee Collection of Collections

2011-12-24 Thread Serge Hulne
plementation of Gee Collection for GdaDataModel > and some interfaces to model a database in Gee Collections, but using > GdaMetaData to retrieve info from any Gda supported database. > > Also hope to model queries in a way that in feature Vala could gain LinQ > like suport. > El dic

[Vala] DataBase as a Gee Collection of Collections

2011-12-23 Thread Serge Hulne
I assume that you are considering developing a database system in RAM (since you mentioned Gee). Also I am assuming that you are considering a relational model (with tables and relationship between tables, etc..., possibly with SQL). 1. Here is an example of an implementation in Java. http://hsq

[Vala] How to create bindings from arbitrary C code which does not use GObject ?

2011-12-18 Thread Serge Hulne
The binding tutorial (http://live.gnome.org/Vala/Bindings) says: Vala is designed to allow access to existing C libraries, especially GObject-based libraries, without the need for runtime bindings and further: The binding generation requires several steps: - generating GObject Introspect

Re: [Vala] C Integration, it's cool

2011-12-17 Thread Serge Hulne
The following example seems to indicate that it is safe to call an external function written in C, from a Vala source code, as long as the calling Vala code knows how to free the memory associated with type of the return value yielded by the C function. I am not sure this is true irrespectively of

Re: [Vala] C Integration, it's cool

2011-12-17 Thread Serge Hulne
isn't that a source of memory leak? In the example provided by Rodrigo, where a C external function is called directly from Vala code as such, (i.e. without ensuring that the (memory allocated to the) string returned by the external function is automatically managed by the glib Object model) will

[Vala] What is required to make vtg (vala tools for gedit) under Ubuntu 11.10 ?

2011-12-13 Thread Serge Hulne
The gedit plugin vtg works under Ubuntu 11.04, but not under Ubuntu 11.10. I guess it could be because the plugin API for gedit has changed ? It compiles, but does not register under the list of plugins of gedit after installation. Has anybody managed to get it to work ? If yes, I would be glad

[Vala] Can vala-win32 be run from a portable drive (e.g. usb stick)

2011-11-22 Thread Serge Hulne
Can vala-win32 ( https://code.google.com/p/vala-win32/ ) be run from a portable drive (e.g. usb stick). If yes, what has to be changed to take into account the fact that it is not running from the C:\ drive: I tried to do it by simply modifying the %PATH%

Re: [Vala] Looking for an example on how to get the data from a web form (when using a Soup-based server)

2011-11-17 Thread Serge Hulne
r/admin/item/edit.vala#L55 > > As a big note libsoup's way of handling Post/Get is horrible. > Uploading files and getting the post as well as get parameters is > blah. > > On Sat, Nov 12, 2011 at 11:42 PM, Serge Hulne > wrote: > > Thanks a lot ! > > > >

Re: [Vala] Looking for an example on how to get the data from a web form (when using a Soup-based server)

2011-11-12 Thread Serge Hulne
= new Soup.Server (Soup.SERVER_PORT, port); >47. server.add_handler ("/", default_handler); >48. stdout.printf("Serving on http://localhost:%d\n";, port); >49. server.run (); >50. >51. return 0; >52. } > > > *A

[Vala] Looking for an example on how to get the data from a web form (when using a Soup-based server)

2011-11-12 Thread Serge Hulne
Hi, I am looking for a slightly more complete example than the one from the Vala tutorials on "Soup". More particularly, I am looking for a snippet that would show how to get (and possibly decode) the data sent via HTTP from an HTML web form (in a browser) to a (Soup-based) server. Thanks ! Ser

[Vala] How to lift the ambiguity between Gee.List and Glib.List ?

2011-11-08 Thread Serge Hulne
In the snippet hereunder, if I want to use Gee along with Glib, I have to qualify the List with the namespace Glib to lift the ambiguity between Gee.List and Glib.List. However when doing it this way, I get the following error message at compile time: array.vala:2.7-2.10: error: The namespace nam

Re: [Vala] Vala completion support for vim

2011-08-30 Thread Serge Hulne
still show up), returning from main then results in a > segmentation fault. Removing the CodeDom object fixes it. > > I would appreciate it if someone could help get these problems solved > so that Vim can get its completion plugin as soon as possible. =) > > ~Damien > >

[Vala] Vala completion support for vim

2011-08-28 Thread Serge Hulne
Hi Damien, I agree with Brian: > Vala Toys for GEdit uses a good module. You may want to kook at it. > http://code.google.com/p/vtg/ Here is a hint on how to use it: vtg contains a module called afrodite which parses the vala source to process. Said module contains a file named test-basic.va

Re: [Vala] vala IDE on OSX

2011-08-22 Thread Serge Hulne
table and I doubt any of the > Vala IDEs are regularly tested on OSX. Your best bet is probably to fix the > issues you find yourself. > > Alexandre Rosenfeld > > On Mon, Aug 22, 2011 at 02:00, Serge Hulne wrote: >> >> I haven't managed to make a single graphical ID

[Vala] vala IDE on OSX

2011-08-21 Thread Serge Hulne
I haven't managed to make a single graphical IDE for Vala work under Mac OS X. - Under Linux, I use a deprecated (*) version of vtg and valencia (two plugins for gedit) - Under Mac, I use vim + Vala plugin for Vim. The Vim plugin is fine, but it does not provide auto-completion (for methods, whic

[Vala] Vala 0.13.1 for Windows: How is the Vala documentation generated ?

2011-08-21 Thread Serge Hulne
Hi, I see that Carl has managed to make valadoc work under Windows. ( There seems to be a minor glitch, though : At the highest level of the tree of the HTML pages, the links to lower levels uses a backslash instead of a slah Example : file:///Users/serge2/Downloads/vala-doc/glib-2.0\index.htm )

[Vala] Suggestion : Replace case/switch-based tests (for the type of a token) by Gee maps-based (or multimaps-based) tests in Vala scanners e.g. (valaparser.vala).

2011-08-13 Thread Serge Hulne
Suggestion : Replace case/switch-based tests (for the type of a token) by Gee maps-based (or multimaps-based) tests in Vala scanners e.g. (valaparser.vala). Goal: - Render the lookup O(1) instead of O(N). - Make vala-based scanners, parsers, tokenizers faster. Example: HashSet stopC

[Vala] A pragmatic combination of gedit plugins for Vala.

2011-08-12 Thread Serge Hulne
Hi All, I have been experimenting with Gedit plugins for Vala lately. I have compared the latest version of vtg (vala programming toys for Gedit) under Debian Sid (0.12 version) and the 0.10.2 which is available on Ubuntu 11.04 ("natty narwhal"). My conclusion is as follows: They both work ok,

Re: [Vala] Fwd: Problem installing vtg under Debian Sid (The solution)

2011-08-11 Thread Serge Hulne
the plugin. Serge. On Thu, Aug 11, 2011 at 4:41 PM, bsquared wrote: > On Wed, Aug 10, 2011 at 10:36 PM, Serge Hulne > wrote: > > -- Forwarded message -- > > From: Serge Hulne > > Date: Wed, Aug 10, 2011 at 10:30 PM > > Subject: Re: Problem i

[Vala] Fwd: Problem installing vtg under Debian Sid

2011-08-10 Thread Serge Hulne
-- Forwarded message -- From: Serge Hulne Date: Wed, Aug 10, 2011 at 10:30 PM Subject: Re: Problem installing vtg under Debian Sid To: Andrea Del Signore Thanks ! I have installed the 0.12 version. vtg compiles, but does not show up in the list of available plugins for gedit

[Vala] Problem installing vtg under Debian Sid

2011-08-10 Thread Serge Hulne
When attempting to install vtg under Debian Sid , I get the following error message: afrodite library dependencies not met: libvala-0.12 >= 0.11.0: not found configure: error: afrodite library dependencies not met: please install the required packages and run configure again Yet the I have i

[Vala] Please keep the Vala Toys for gEdit version 0.10.3 available from the repository, for backwards compatibility with stable versions of Linux.

2011-08-02 Thread Serge Hulne
itory, for backwards compatibility with stable (and "Long-Time-Services") versions of Linux distributions. Thanks, Serge. On Tue, Aug 2, 2011 at 12:25 AM, Andrea Del Signore wrote: > Hi Serge, > > I'm Andrea the developer of vala toys, > > On Mon, 2011-08-01 at 14:27 +

[Vala] Which Linux distribution is used for developing vtg (Vala toys for gedit) ?

2011-08-01 Thread Serge Hulne
Which Linux distibution is used for developing vtg (Vala toys for gedit) ? Personally, I prefer Ubuntu, and more specifically Ubuntu LTS ("long time service", since it is supported for a couple of years and is therefore ideal for servers). - Using Ubuntu 10.04 LTS, I managed to install the ve

Re: [Vala] Vala logo suggestion(s)

2011-07-30 Thread Serge Hulne
cool. Serge. On Sat, Jul 30, 2011 at 8:05 AM, Luca Bruno wrote: > On Sat, Jul 30, 2011 at 03:09:06AM +0200, Serge Hulne wrote: >> http://www.clipartof.com/portfolio/cidepix/illustration/letter-v-logo-icons-1067737.html > > I think they are a little complex (too much work on the V

[Vala] Vala logo suggestion(s)

2011-07-29 Thread Serge Hulne
http://www.clipartof.com/portfolio/cidepix/illustration/letter-v-logo-icons-1067737.html Serge. ___ vala-list mailing list vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list

[Vala] Vala Toys for gEdit 0.12.0 requires : glib-compile-schemas

2011-07-27 Thread Serge Hulne
It seems that Vala Toys for gEdit 0.12.0 requires : glib-compile-schemas . However glib-compile-schemas does not seem to be available in Ubuntu 10.04 LTS. (at least so it seems from : http://packages.ubuntu.com/ ) Is this correct or this a bug ? Is there a way around this to install Vala Toys

Re: [Vala] Documenting 'async' / WAS: Further speculations on couroutines, generators and threads : Emulating Go's goroutines and channels in Vala

2011-07-15 Thread Serge Hulne
Just a small suggestion for the async examples. It would be worth while for absolute beginners to add a line on how to compile the examples (with the --pkg gio-2.0 --pkg threads options etc,,, ) so that the examples can be compiled right away. Serge. On Sat, Jul 16, 2011 at 8:28 AM, Luca Bruno

Re: [Vala] Documenting 'async' / WAS: Further speculations on couroutines, generators and threads : Emulating Go's goroutines and channels in Vala

2011-07-15 Thread Serge Hulne
Congratulations to Jim Peters on his excellent job about documenting async methods in Vala ! Thank you very much ! Question about combining async and threads in the "generator example": - Would it be possible to combine the last two examples for the following purpose: - In the last example, th

Re: [Vala] Documenting 'async' / WAS: Further speculations on couroutines, generators and threads : Emulating Go's goroutines and channels in Vala

2011-07-14 Thread Serge Hulne
On Fri, Jul 15, 2011 at 8:16 AM, Serge Hulne wrote: > I am right in assuming that: > > > 2. Async methods have virtually no use outside the scope of event-driven > GTK+ applications (except perhaps as a way to implement additional Vala > features like Luca Bruno's genera

Re: [Vala] Documenting 'async' / WAS: Further speculations on couroutines, generators and threads : Emulating Go's goroutines and channels in Vala

2011-07-14 Thread Serge Hulne
I am right in assuming that: 2. Async methods have virtually no use outside the scope of event-driven GTK+ applications (except perhaps as a way to implement additional Vala features like Luca Bruno's generator, but at the cost of runtime-performance). 3. There is always a way to write an equiva

Re: [Vala] Further speculations on couroutines, generators and threads : Emulating Go's goroutines and channels in Vala

2011-07-14 Thread Serge Hulne
m the guilty party to blame for the naive idea to try to add threads > to > > it : I had the Goroutine/channel concept of Go in mind and was trying to > > emulate it by attempting to combine Luca's generator with threads). > > > > :) > > > &

Re: [Vala] Further speculations on couroutines, generators and threads : Emulating Go's goroutines and channels in Vala

2011-07-13 Thread Serge Hulne
rge. On Wed, Jul 13, 2011 at 3:02 PM, Jim Peters wrote: > Serge Hulne wrote: > > Here is a further development of the idea of Luca Bruno about a Vala > > implementation for Generators: > > > > Simulating Go's goroutines and channels in Vala: > > >

Re: [Vala] Further speculations on couroutines, generators and threads : Emulating Go's goroutines and channels in Vala

2011-07-12 Thread Serge Hulne
ore lightweight than threads (they use threads but they are not threads). So basically it was just for convenience (and for fun) ! Serge. On Tue, Jul 12, 2011 at 2:43 PM, Jim Peters wrote: > Serge Hulne wrote: > > Here is a further development of the idea of Luca Bruno about a Val

Re: [Vala] [Erratum]Further speculations on couroutines, generators and threads : Emulating Go's goroutines and channels in Vala

2011-07-12 Thread Serge Hulne
Erratum, there was a omission in my previous post, here is the complete snippet: On Tue, Jul 12, 2011 at 9:25 AM, Serge Hulne wrote: > If the code proposed by Luca was stored separately in its own file (or > library), then all one would have to to to use use this > goroutine/chann

Re: [Vala] Further speculations on couroutines, generators and threads : Emulating Go's goroutines and channels in Vala

2011-07-12 Thread Serge Hulne
ond thread\n\n"); i=0; foreach (var item in gen_1) { if (i<10) Posix.stdout.printf("%i\n", item); i++; } return 0; } / On Tue, July 12, 2011 at 5:55 AM, Serge Hulne wrote: > Here is a further development of the idea of Luca Brun

[Vala] Further speculations on couroutines, generators and threads : Emulating Go's goroutines and channels in Vala

2011-07-11 Thread Serge Hulne
Here is a further development of the idea of Luca Bruno about a Vala implementation for Generators: Simulating Go's goroutines and channels in Vala: Basically the idea is to start as many threads as needed (which play the role of Go' goroutines) and to recuperate their output from a "Generator"

Re: [Vala] Question regarding passing a strings as arguments to a method

2011-07-11 Thread Serge Hulne
nce in a function call. Since the string class, seems to behave unlike any other class, perhaps its singular behaviour ought to be emphasized in the documentation. Serge. On Mon, Jul 11, 2011 at 5:45 PM, Phil Housley wrote: > On 11 July 2011 13:03, Serge Hulne wrote: > >> >

Re: [Vala] Question regarding passing a strings as arguments to a method

2011-07-11 Thread Serge Hulne
> > A string in Vala is a *reference* type [1] and therefore passed by Not according to the documentation: Cf Vala tutorial: "Reference Types The reference types are all types declared as a class, regardless of whether they are descended from GLib's Object or not. Vala will ensure that when you

Re: [Vala] My first (very positive) impressions of Vala

2011-07-10 Thread Serge Hulne
n Mon, Jul 11, 2011 at 08:09:15AM +0200, Serge Hulne wrote: >>    1. More examples (I intend to contribute actively to that aspect). > > The wiki is open fore contributions. > >>    2. Provide a way to generate the documentation locally (like Javadoc or >>    Pydoc or godoc

Re: [Vala] Question regarding passing a strings as arguments to a method

2011-07-10 Thread Serge Hulne
ift the ambiguity. Sincerely, Serge. On Mon, Jul 11, 2011 at 8:34 AM, Luca Bruno wrote: > > On Mon, Jul 11, 2011 at 07:10:45AM +0200, Serge Hulne wrote: > > If one has a look at the C code generated by Vala for the following > > two examples, it appears that the "unowned&

[Vala] My first (very positive) impressions of Vala

2011-07-10 Thread Serge Hulne
with lynx). - I tried Doxygen, but the result is not useful. 3. Perhaps the entire Vala documentation, should be available a compressed file (to avoid having to get is with wget) Serge Hulne. ___ vala-list mailing list vala-list@gnom

Re: [Vala] Question regarding passing a strings as arguments to a method

2011-07-10 Thread Serge Hulne
r* a; --- > gchar* _tmp0_; > gchar* a; 27c29,30 < a = "hello"; --- > _tmp0_ = g_strdup ("hello"); > a = _tmp0_; 29a33 > _g_free0 (a); 2011/7/11 Гаврилов Максим : > Strings are passed by value. To avoid this use "uno

[Vala] Question regarding passing a strings as arguments to a method

2011-07-10 Thread Serge Hulne
The Vala tutorial says: "*Parameter Directions* ** *A method in Vala is passed zero or more arguments. The default behaviour when a method is called is as follows: * - *Any value type parameters are copied to a location local to the method as it executes. * - *Any reference type paramete

Re: [Vala] Is there a way to use the Vala coroutines to achieve the same effect as in the following Python snippet (coroutines returning partial results in an iterator-like way) ?

2011-07-09 Thread Serge Hulne
Jul 09, 2011 at 09:01:42AM +0200, Serge Hulne wrote: > > In the meantime, tried the "scanner" example (my last entry in the Vala > > maling list with an iterator. > > > > Of course, since the vala iterator returns one item at a time it does the > > trick

Re: [Vala] Is there a way to use the Vala coroutines to achieve the same effect as in the following Python snippet (coroutines returning partial results in an iterator-like way) ?

2011-07-09 Thread Serge Hulne
lot of memory (compared to returning all the elements at once, as a list), is extremely slow (many orders of magnitude). Perhaps there are other alternatives: - Sockets (probably too slow and overkill). - Threads ? All suggestions welcome ! Sincerely, Serge Hulne. Ref. : Hereunder : The scann

Re: [Vala] Is there a way to use the Vala coroutines to achieve the same effect as in the following Python snippet (coroutines returning partial results in an iterator-like way) ?

2011-07-08 Thread Serge Hulne
I stand corrected ! Serge. On Fri, Jul 8, 2011 at 5:55 PM, Luca Bruno wrote: > On Fri, Jul 08, 2011 at 05:49:32PM +0200, Serge Hulne wrote: >> It‘s a generator using a coroutine (at least using “yield“). > > The yield keyword itself doesn't mean coroutine. It'

Re: [Vala] Is there a way to use the Vala coroutines to achieve the same effect as in the following Python snippet (coroutines returning partial results in an iterator-like way) ?

2011-07-08 Thread Serge Hulne
It‘s a generator using a coroutine (at least using “yield“). Serge. Le 2011-07-08 17:41, "Luca Bruno" a écrit : > On Fri, Jul 08, 2011 at 02:43:46PM +0200, Serge Hulne wrote: >> Is there a way to use the Vala coroutines to achieve the same effect >> as in the

[Vala] Looking for an alternative to returning a large list of data in one chunk in Vala : Example in Vala

2011-07-08 Thread Serge Hulne
Hi Vala people, I am trying to find a way to code the example hereunder in a better way in Vala. I assume that instead of storing the resulting tokens in a list and then returning the list, there must be a way to kind of iterate over the partial results (the individual tokens : the "words in thi

[Vala] Is there a way to use the Vala coroutines to achieve the same effect as in the following Python snippet (coroutines returning partial results in an iterator-like way) ?

2011-07-08 Thread Serge Hulne
Is there a way to use the Vala coroutines to achieve the same effect as in the following Python snippet: / # Python coroutine ###* def countdown(n): print "Counting down from", n while n > 0: yield n n -= 1 print "D

[Vala] Question about a basic coroutine example

2011-07-07 Thread Serge Hulne
In the snippet hereunder, I expected the respective value of the argument of the sleep() method, in the methods foo0() and foo1(), to have an influence on which one of said coroutines completes first. Apparently it is not the case, so I am assuming that foo0 and foo1 run, in fact, sequentially (a

Re: [Vala] Support for coroutines in Vala

2011-07-06 Thread Serge Hulne
> If you need something more flexible then GIO asynchronous functions, > look at GNU Pth. > http://www.gnu.org/software/pth/ > > If pth is what you need, I have written a vapi for it. Let me know. > Yes please, I am interested ! Basically the only feature of Go I miss in Vala are the "Goroutines",

[Vala] Support for coroutines in Vala

2011-07-05 Thread Serge Hulne
Support for coroutines in Vala: Has it been dropped ? otherwise how does one compile examples like: / void foo () yields { message ("hello"); yield; message ("world"); } void main () { foo.begin (); message ("vala"); var loop = new

[Vala] Proposal for a an alias (a symbol) for the keyword "unowned"

2011-06-22 Thread Serge Hulne
Since it appears that: string a = "hello"; unowned string b = a; and string a = "hello"; string *b = a; are not exactly the same. I would like to propose basically a symbolic alias for unowned, namely: string a = "hello"; string ^ b = a; // equivalent for: unowned string b = a; ("^" is a

[Vala] What is the vala way to assess how much memory is being used by an application.

2011-06-22 Thread Serge Hulne
Is there a dedicated function allowing the application to print out (from time to time, in a separate thread or coroutine) how much memory is being used by said application, say from second to second, for instance ? Serge. ___ vala-list mailing list vala

Re: [Vala] Vala : Suggestion for improvement : String Class wrapper for strings in Vala : Erratum (2)

2011-06-21 Thread Serge Hulne
I stand corrected ! Thank you Abderrahim for this detailed explanation. Serge. On Tue, Jun 21, 2011 at 8:56 PM, Abderrahim Kitouni wrote: > Hello, > > على 21 يون, 2011 م 07:18, كتب Serge Hulne: > > Apparently >> >> string a = "hello"; >> st

Re: [Vala] Vala : Suggestion for improvement : String Class wrapper for strings in Vala : Addendum

2011-06-21 Thread Serge Hulne
e. On Tue, Jun 21, 2011 at 8:02 PM, Serge Hulne wrote: > Erratum: > === > > As Alexandre Rosenfeld correctly pointed out, the easy (and correct) > way to get a reference on a Vala string is simply to declare it as > follows: > >string a = "hello"; &g

Re: [Vala] Vala : Suggestion for improvement : String Class wrapper for strings in Vala : Erratum

2011-06-21 Thread Serge Hulne
free0 (a); } int main (int argc, char ** argv) { g_type_init (); _vala_main (argv, argc); return 0; } ///- In which there is indeed no duplication of memory allocation. as can be seen from: _tmp0_ = g_strdup ("hello"); a = _tmp0_; b =

[Vala] Vala : Suggestion for improvement : String Class wrapper for strings in Vala

2011-06-21 Thread Serge Hulne
Suggestion: = A class wrapper for the string type in Vala, in order to avoid duplication of data in assignments (which would yield an unnecessarily huge memory usage when processing a large amount of text with a lot of assignments). if you compare the C code generated by Vala for: 1) ///

Re: [Vala] What is the right syntax for defining pointers or references or "aliases" in Vala ?

2011-06-20 Thread Serge Hulne
Brilliant !!! Thanks a lot Alexandre, this is exactly the idea I was looking for. - Mystery solveed ! - By simply looking at the C code (using the --save-temps option), I can see exactly what is going on under the hood and how references are managed by Vala. This also underlines that Vala is (

Re: [Vala] What is the right syntax for defining pointers or references or "aliases" in Vala ?

2011-06-20 Thread Serge Hulne
the "new" operator in order to create a new >> instance of a class. Any assignment of a variable to an existing >> instance is just a reference to the same instance. >> >> Best regards. >> >> El dilluns 20 de juny de 2011, Serge Hulne ha escrit: >>> H

[Vala] Fwd: What is the right syntax for defining pointers or references or "aliases" in Vala ?

2011-06-20 Thread Serge Hulne
How can it be checked ? Serge. -- Forwarded message -- From: tecywiz121 Date: Mon, Jun 20, 2011 at 9:55 PM Subject: Re: [Vala] What is the right syntax for defining pointers or references or "aliases" in Vala ? To: Serge Hulne Cc: vala-list I'm not an

[Vala] Fwd: What is the right syntax for defining pointers or references or "aliases" in Vala ?

2011-06-20 Thread Serge Hulne
-- Forwarded message -- From: Serge Hulne Date: Mon, Jun 20, 2011 at 10:02 PM Subject: Re: [Vala] What is the right syntax for defining pointers or references or "aliases" in Vala ? To: tecywiz121 I am not sure. The following: /// using Posix; void main (str

[Vala] What is the right syntax for defining pointers or references or "aliases" in Vala ?

2011-06-20 Thread Serge Hulne
What is the Vala syntax to express that : b is a alias of a (or b points to the same address that a or b is a reference to a). Is there a way to express this in vala or does *assignment always mean memory allocation* in Vala. In other terms : How do you store references to variables (or pointers

[Vala] Is this the right syntax for defining pointers in Vala ?

2011-06-20 Thread Serge Hulne
Is this the right syntax for defining pointers in Vala ? //-- using Posix; void main (string[] argv) { string a = "hello"; var b = &a; strcpy(*b, "bye"); Posix.stdout.printf("a = %s\n", a); Posix.stdout.printf("b = %s\n", *b); } //- If not, how does one declare that a

[Vala] How to duplicate the vala documentation locally, using Valadoc

2011-06-19 Thread Serge Hulne
Hi, I have tried to guess from the man page and the help of valadoc how to generate documentation from vala sources. What I would like to do is to recreate locally the complete documentation of Vala so as to be able to access it faster than trough the web page: http://www.valadoc.org/references.

Re: [Vala] lexical analysis using libvala

2011-06-18 Thread Serge Hulne
I am new to Vala, so my remarks might be naive, but: 1) Is there not some kind of source code parser already included in Valadoc that you could reuse (as opposed to writing something from scratch). 2) Is there not and AST parser somewhere in Vala anyway ? 3) Why not parse the vapi files ? 4) Wh

Re: [Vala] Gee LinkedList Problem : Memory allocation fails when list size > 1000000

2011-06-14 Thread Serge Hulne
(self->next); (gdb) Serge. On Tue, Jun 14, 2011 at 4:22 PM, Reid Thompson wrote: > On 06/14/2011 09:17 AM, Serge Hulne wrote: >> >> No : my Mac Mini has 2GB of RAM, 1.5 of which are currently free. >> >> My guess is that the code of linkedlist.c (from libgee) is

Re: [Vala] Gee LinkedList Problem : Memory allocation fails when list size > 1000000

2011-06-14 Thread Serge Hulne
14, 2011 at 2:54 PM, Reid Thompson wrote: > > On 06/14/2011 02:30 AM, Serge Hulne wrote: >> >> Example: >> >> NB : The example hereunder works perfectly with a number of elements<= >> 100,000 but crashes if one when the number of elements to insert in the Li

Re: [Vala] Gee LinkedList Problem : Memory allocation fails when list size > 1000000

2011-06-13 Thread Serge Hulne
dd(p); } // Sort list L.sort( (CompareFunc)comp ); // Freq distribution var i = 0; foreach (var item in L) { Posix.printf("(%u,\t '%s')\n", item.freq, item.word); i++; if (i > 10) break; } return 0; } //---

Re: [Vala] Problem with Posix.isspace() : Memory leak ?

2011-06-13 Thread Serge Hulne
the result of the run with gdb is: Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_PROTECTION_FAILURE at address: 0x7fff5f38 0x0001001500c4 in gee_linked_list_node_free (self=0x103ff67a0) at linkedlist.c:1182 1182static void gee_linked_list_node_free

Re: [Vala] Problem with Posix.isspace() : Memory leak ?

2011-06-13 Thread Serge Hulne
Thanks, I will try that as soon as I can get my hands on a Linux box, i.e. by next week-end (installing "nemiver" on a Mac, results in too many unmet dependencies). I' ll keep you posted. Thanks a lot for the help, Serge. On Mon, Jun 13, 2011 at 8:37 AM, Nor Jaidi Tuah wrote: > >> So it must

Re: [Vala] Problem with Posix.isspace() : Memory leak ?

2011-06-12 Thread Serge Hulne
On Mon, Jun 13, 2011 at 4:10 AM, Nor Jaidi Tuah wrote: > I suspect there is a very long "word" that StringBuilder > cannot handle. My guess is the crash happens here: >> word.append_c(c); > It seemed like a possible explanation, so I checked it. I added a "word" length counter which

Re: [Vala] is there a valgrind-like tool specific to Vala ?

2011-06-11 Thread Serge Hulne
me here. Serge. On Sat, Jun 11, 2011 at 11:30 AM, Serge Hulne wrote: > I mentioned earlier on this mailing  list a problem ("segmentation > fault": usually the sign of a memory allocation gone wrong) which > occurs when merely substituting > > isalnum() > for >

[Vala] is there a valgrind-like tool specific to Vala ?

2011-06-11 Thread Serge Hulne
I mentioned earlier on this mailing list a problem ("segmentation fault": usually the sign of a memory allocation gone wrong) which occurs when merely substituting isalnum() for issspace () in a simplistic scanner, see: http://mail.gnome.org/archives/vala-list/2011-June/msg00062.html This sim

[Vala] Problem with Posix.isspace() : Memory leak ?

2011-06-09 Thread Serge Hulne
In the code hereunder, in the while loop (simple scanner), when I substitute !isalnum() by Posix.isspace(), the application crashes when given a very large text file (170 MB) as argument. Yet it works with !isalnum() instead of isspace(). Also it the application does not crash in either cases whe

Re: [Vala] Text-processing performance test : Vala vs Go

2011-06-08 Thread Serge Hulne
, 'of') (48750, 'to') (39590, 'a') (34340, 'you') (29510, 'in') (28010, 'my') (25150, 'is') (0, 'that') real0m1.888s user0m1.822s sys 0m0.039s On Wed, Jun 8, 2011 at 2:35 PM, Dmitry Romanov

[Vala] Does Vala have a command-line documentation tool like pydoc or godoc ? (Not a HTML doc generator like valadoc)

2011-06-08 Thread Serge Hulne
Does Vala have a command-line documentation tool like pydoc or godoc ? which could instantly list all the methods associated with a given class or module ? (I am not talking about HTML doc generators like Javadoc, Valadoc etc ...) Alternatively, is there an autocomplete plugin for Vim or Emacs.

[Vala] Warning or Bug ?

2011-06-08 Thread Serge Hulne
Does anybody know why the following snippet produces a warning: // // Struct to hold key, values pairs: struct pair { public intfreq; public string word; } // Equality function for structs : bool equals (pair a, pair b) { return (Posix.strcmp(a.word, b.w

[Vala] Text-processing performance test : Vala vs Go

2011-06-07 Thread Serge Hulne
The test consisted in determining the words with the highest occurrence frequency in Shakespeare' s complete work. Here is the result: The resp. codes are attached herewith. IMHO there isn't a significant difference. Serge. 1) Vala : -- localhost$:test_1 serge2$ time ./vwc ../../sha

[Vala] Unused imports do not generate warnings

2011-06-06 Thread Serge Hulne
External library declarations such as: using Gee; do not generate a warning when said library is unused I was surprised by this fact. If a lot of modifications have been done to a piece of code, a lot of unused : "using" ... might be left around. Serge.

[Vala] Vala text processing performance

2011-06-06 Thread Serge Hulne
On Mon, Jun 6, 2011 at 5:35 PM, Fabian Deutsch wrote: > The attached code produces the following: > > $ time wc shaks12.txt ; time ./vwc shaks12.txt >  124456  901325 5582655 shaks12.txt > > real    0m0.144s > user    0m0.139s > sys     0m0.004s > lc = 124456. wc = 1293934 > > real    0m0.161s > u

Re: [Vala] Fwd: Why is Vala 10 times slower than C ?

2011-06-06 Thread Serge Hulne
> Hint: Luca already told you why the vala version is slower... > >        Emmanuel. > > Luca said: --- read_line() is not as cheap as a getline() str.split() is not as cheap as strtok() --- In other words : text processing in *pure Vala* is a lot slower than in C (or C++ for that matter) Conse

Re: [Vala] Fwd: Why is Vala 10 times slower than C ?

2011-06-06 Thread Serge Hulne
2011/6/6 Гаврилов Максим : > You can benefit reducing code writing time from months to weeks and > forgetting about memory leaks, pure-procedure programming and other pretty > things you used to do in C. ... at the cost of a huge runtime performance penalty. A similar claim was made by the deve

Re: [Vala] Fwd: Why is Vala 10 times slower than C ?

2011-06-06 Thread Serge Hulne
On Mon, Jun 6, 2011 at 3:57 PM, Alexandre Rosenfeld wrote: > Or do a Vala program without GLib (using the posix profile for instance) and > it will probably be closer to the C version. Does that not kind of defeat the purpose ? How do I benefit from the object-oriented features then ? In parti

Re: [Vala] Fwd: Why is Vala 10 times slower than C ?

2011-06-06 Thread Serge Hulne
garbage > collection, etc. in this code? > > Just write a Glib-based wc in C, and it will be as fast as in Vala. > > 06.06.2011 17:07 пользователь "Serge Hulne" написал: >> Nope ! >> >> Here is the equivalent version in C: >> >> #include >&

[Vala] Fwd: Why is Vala 10 times slower than C ?

2011-06-06 Thread Serge Hulne
} } fclose(fp); printf("word count: %i words, lines = %d\n", wcnt, lcnt); return 0; } Serge. -- Forwarded message -- From: Qball Cow Date: Mon, Jun 6, 2011 at 2:15 PM Subject: Re: [Vala] Why is Vala 10 times slower than C ? To: Serge H

[Vala] Why is Vala 10 times slower than C ?

2011-06-06 Thread Serge Hulne
I used "wordcount" as a test to compare the processing speed of Vala against C: I obtained the following result: --- C: --- serge:vala serge2$ time wc ../shakespeare.txt 495200 2703240 15862370 ../shakespeare.txt real0m0.194s user0m0.176s sys0m0.015s --- Vala: --- serge:vala serg

[Vala] Question about valadoc (Newbie question)

2011-05-31 Thread Serge Hulne
Hi there, I just installed vala, valac and valadoc. I tried to use valadoc to generate the documentation from the vala classes which make up the code of vala (the one which come with the compiler). What exact options (apart from the path to the directory containing the core vala sources) should