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
, 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 serge.hu...@gmail.com написал:
Nope !
Here is the equivalent version in C:
#include stdio.h
#include stdlib.h
#include string.h
int
On Mon, Jun 6, 2011 at 3:57 PM, Alexandre Rosenfeld
alexandre.rosenf...@gmail.com 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
2011/6/6 Гаврилов Максим ull...@gmail.com:
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
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)
On Mon, Jun 6, 2011 at 5:35 PM, Fabian Deutsch fabian.deut...@gmx.de 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
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.
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.
, Serge Hulne serge.hu...@gmail.com wrote:
___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list
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
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
me here.
Serge.
On Sat, Jun 11, 2011 at 11:30 AM, Serge Hulne serge.hu...@gmail.com 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
issspace
On Mon, Jun 13, 2011 at 4:10 AM, Nor Jaidi Tuah
norjaidi.t...@ubd.edu.bn 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
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
norjaidi.t...@ubd.edu.bn
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
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;
}
//---
On Tue, Jun 14, 2011 at 12:52 AM, Serge Hulne
14, 2011 at 2:54 PM, Reid Thompson reid.thomp...@ateb.com 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 List
is= 1000,000 .
var L
(self-next);
(gdb)
Serge.
On Tue, Jun 14, 2011 at 4:22 PM, Reid Thompson reid.thomp...@ateb.com 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 not (yet)
entirely
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)
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:
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 and b
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
-- Forwarded message --
From: Serge Hulne serge.hu...@gmail.com
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 tecywiz...@hotmail.com
I am not sure. The following:
///
using
How can it be checked ?
Serge.
-- Forwarded message --
From: tecywiz121 tecywiz...@hotmail.com
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 serge.hu...@gmail.com
Cc: vala
to an existing
instance is just a reference to the same instance.
Best regards.
El dilluns 20 de juny de 2011, Serge Hulne serge.hu...@gmail.com ha escrit:
How can it be checked ?
Serge.
-- Forwarded message --
From: tecywiz121 tecywiz...@hotmail.com
Date: Mon, Jun 20, 2011 at 9
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
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)
) {
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 = a;
Serge.
On Tue, Jun 21, 2011 at 9:05 AM, Serge Hulne
, 2011 at 8:02 PM, Serge Hulne serge.hu...@gmail.com 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;
string * b = a;
As illustrated in the following
I stand corrected !
Thank you Abderrahim for this detailed explanation.
Serge.
On Tue, Jun 21, 2011 at 8:56 PM, Abderrahim Kitouni a.kito...@gmail.comwrote:
Hello,
على 21 يون, 2011 م 07:18, كتب Serge Hulne:
Apparently
string a = hello;
string * b = a;
and :
string
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
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 symbol
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
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,
i.e.
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 Done
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 scanner case-study (with the naive list-based
:
On Sat, 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.
I've just published a generators example
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
= g_strdup (hello);
a = _tmp0_;
29a33
_g_free0 (a);
2011/7/11 Гаврилов Максим ull...@gmail.com:
Strings are passed by value. To avoid this use unowned keyword.
11.07.2011 1:36 пользователь Serge Hulne serge.hu...@gmail.com написал:
The Vala tutorial says:
*Parameter Directions
).
- 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@gnome.org
http
.
Sincerely,
Serge.
On Mon, Jul 11, 2011 at 8:34 AM, Luca Bruno lethalma...@gmail.com 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 keyword has no influence
:
On 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).
- Valadoc does not seem
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
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 undeconstruc...@gmail.comwrote:
On 11 July 2011 13:03, Serge Hulne serge.hu...@gmail.com wrote:
A string in Vala is a *reference* type
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
) {
if (i10) Posix.stdout.printf(%i\n, item);
i++;
}
return 0;
}
/
On Tue, July 12, 2011 at 5:55 AM, Serge Hulne serge.hu...@gmail.com wrote:
Here is a further development of the idea of Luca Bruno about a Vala
implementation for Generators
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 serge.hu...@gmail.com 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
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 j...@uazu.net wrote:
Serge Hulne wrote:
Here is a further development of the idea of Luca Bruno about a Vala
implementation
.
On Wed, Jul 13, 2011 at 3:02 PM, Jim Peters j...@uazu.net 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:
Basically the idea is to start as many threads
it by attempting to combine Luca's generator with threads).
:)
Serge.
On Wed, Jul 13, 2011 at 3:02 PM, Jim Peters j...@uazu.net wrote:
Serge Hulne wrote:
Here is a further development of the idea of Luca Bruno about a Vala
implementation for Generators:
Simulating
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
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, the
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
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
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
at 8:05 AM, Luca Bruno lethalma...@gmail.com 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) and a revamped
version of '90
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
, 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 seje...@tin.it wrote:
Hi Serge,
I'm Andrea the developer of vala toys,
On Mon, 2011-08-01 at 14:27 +0200, Serge Hulne wrote:
Which
the plugin.
Serge.
On Thu, Aug 11, 2011 at 4:41 PM, bsquared bwcod...@gmail.com wrote:
On Wed, Aug 10, 2011 at 10:36 PM, Serge Hulne serge.hu...@gmail.com
wrote:
-- Forwarded message --
From: Serge Hulne serge.hu...@gmail.com
Date: Wed, Aug 10, 2011 at 10:30 PM
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,
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:
HashSetchar
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 )
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,
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 serge.hu...@gmail.com wrote:
I haven't managed to make a single graphical IDE for Vala work under Mac
OS X.
- Under Linux, I use
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
. 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
On Sun, Aug 28, 2011 at 11:16 PM, Serge Hulne serge.hu...@gmail.com
wrote:
Hi Damien,
I agree with Brian
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
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 !
. server.add_handler (/, default_handler);
48. stdout.printf(Serving on http://localhost:%d\n;, port);
49. server.run ();
50.
51. return 0;
52. }
*Alexandre Rosenfeld*
On Sat, Nov 12, 2011 at 21:50, Serge Hulne serge.hu...@gmail.com wrote:
Hi,
I am looking
https://code.google.com/p/vala-win32/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%
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
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)
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
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
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 23, 2011 3:31 a.m., Serge Hulne serge.hu...@gmail.com
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
Great news from Ubuntu : vtg and Valencia (Vala plugins for gedit) are
available as packages in Ubuntu 12.04 LTS :
Vtg link http://code.google.com/p/vtg/
Valencia link http://yorba.org/valencia/
Ubuntu Link http://www.ubuntu.com/
Serge.
___
vala-list
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
,
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.
PS: The code as plain text:
using GLib;
using Posix;
class Stemmer
79 matches
Mail list logo