[Vala] Potential Vala build system change (switch to Meson)

2017-08-17 Thread Dmitry Golovin
Hi all!

As far as I know, Meson support building Vala code and it should not be too 
difficult to change the build system to Meson. Anyone working on it already? Is 
there a bug open for build system migration?

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


Re: [Vala] Vala++

2017-04-05 Thread Dmitry Golovin
04.04.2017, 15:29, "Al Thomas via vala-list" :
>>  From: Alessandro Pellizzari 
>>  Sent: Tuesday, 4 April 2017, 10:27
>>  Subject: Re: [Vala] Vala++
>
> You seem to over talking Rust and under talking Vala.
>
>>  Rust, on the other hand, is a general language, that can be used for
>>  many things: CLI apps, OS kernels, C-compatible libraries, GUI apps,
>>  servers, web apps, etc. etc.
>
> The https://www.rust-lang.org/ website still labels Rust as a "systems
>
> programming language", but going through your list and applying Vala:
>
> CLI apps, for Vala see:
> https://valadoc.org/glib-2.0/GLib.OptionEntry.html - for handling args
>
> https://wiki.gnome.org/Projects/Vala/IoChannelsSample - for handling pipes
> https://valadoc.org/curses/Curses.html - although an ncurses binding would
> be good
>
> OS kernels, well that's not a good use of Vala
>
> C-compatible libraries, surprisingly the Vala compiler is mainly in a
> C compatible library called libvala. If you want to write a library in
> Vala then a few tips:
> --hide-internal switch of valac controls symbol visibility with GLib's
> G_GNUC_INTERNAL macro
> Producing a GIR with valac and then using g-ir-compiler allows bindings
> to be produced that can be used in many languages
> There is the beginnings of a tutorial at
>
> https://wiki.gnome.org/Projects/Vala/LibraryWriting
>
> GUI apps, hmmm GTK+3 anyone? Vala includes excellent bindings and also
> composite template code generation routines with the use of the
> [GtkTemplate] attribute.
>
> Servers, web apps, etc. :
> [DBus] attribute for code generation
> https://valadoc.org/gio-2.0/GLib.Socket.html
> https://github.com/arteymix/valum/ and importantly work on Vala Server
> Gateway Interface (VSGI)
> http://www.ambitionframework.org/
> Maybe all of these don't fit with your needs, but there is an active Vala
>
> community and I hope these examples have broadened your outlook a little.
>
>>  Bacause of this, the ecosystem is many times bigger, so it's easier to
>>  find skilled devs, but also crates (linkable libraries), bindings for
>
>>  current libraries, etc.
>
> There are certainly more resources put in to Rust. Remember it is sponsored
> by Mozilla. There is a core team:
> https://www.rust-lang.org/en-US/team.html
> and some of them are paid to work full team, e.g.:
> https://news.ycombinator.com/item?id=13324458
>
> Mozilla's audited financial statement for 2015 (
> https://static.mozilla.com/moco/en-US/pdf/2015_Mozilla_Audited_Financial_Statement.pdf)
>  shows $414,380,000 in royalty revenue and $214,187,000 software development
> expenditure. Whereas the GNOME Fiscal Report for 2015 (
> https://www.gnome.org/wp-content/uploads/2016/08/GAR2015-web.pdf ) shows an 
> income of $644,174. Notice the missing zeros at the end there.
>
> Vala follows a very different development model. What is amazing that after
> a decade from the initial release Vala is still going strong. Look at the
> latest release notes (
> https://mail.gnome.org/archives/ftp-release-list/2017-March/msg00119.html ) 
> and you see at the end 31 people credited with contributions.
>
> Vala/Genie is a very useful tool for producing performant native binaries for
> a wide range of applications. Including embedded systems, command line and 
> text
> based user interfaces and graphical user interfaces.
>
> Vala certainly has some rough edges that need smoothing off before any
> 1.0 release - but that is another thread :-) If you wish to participate
> then great, otherwise good luck with your chosen development platform.
>
> Al
>
> P.S. for a more critical view of Rust one article is
> http://esr.ibiblio.org/?p=7294&cpage=1
> ___
> vala-list mailing list
> vala-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/vala-list

Hello,

> OS kernels, well that's not a good use of Vala

Well, maybe it is not the best use of Vala, but it is definitely possible to 
have kernel written in Vala.

Here are some links:

- Multiboot kernel written in Vala: 
http://sites.google.com/site/mfpuentear/Home/multiboot-vala.tar.bz2
- Linux kernel module written in Vala: (sorry, can't find the link but it 
exists)
- posixvala: https://github.com/radare/posixvala
- Vala for AVR microcontrollers: https://github.com/apmasell/avr-vala

But the majority is using Vala for graphical applications.

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


Re: [Vala] Starting with Vala

2017-04-03 Thread Dmitry Golovin
03.04.2017, 18:01, "Sascha Manns" :
> Hello list,
>
> i would like to learn Vala and plan to port a Mono-GNOME-App to Vala. I
> already seen the documentation.
>
> Maybe you know some small Vala apps where i can see the code in action?
>
> Greetings
>
> Sascha
>
> --
> Sascha Manns
> Maifeldstraße 10
> 56727 Mayen
>
> P: +49-2651-4014045
> W: http://saigkill.tuxfamily.org
>
> ,
>
> ___
> vala-list mailing list
> vala-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/vala-list

Hi Sascha,
 
Check out the official Vala Documentation: 
https://wiki.gnome.org/Projects/Vala/Documentation
 
Probably, you will be interested in Sample Code section: 
https://wiki.gnome.org/Projects/Vala/Documentation#Sample_Code
 
Regards,
Dmitry
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] .me cast resurrection on "Re: The future of Vala"

2017-03-05 Thread Dmitry Golovin
Do we really still need a Vala to JS converter? I didn't try, but I think it's 
possible to compile the whole GLib to WebAssembly with only slight 
modifications, so Vala can run in browser natively after being built for wasm32 
target.

Did anyone investigate it?

Regards,
Dmitry

05.03.2017, 08:06, "Ben Iofel" :
> Here is an old Vala to JavaScript compiler
>
> https://github.com/lethalman/maja
>
> On Sat, Mar 4, 2017 at 7:34 PM Guillaume Poirier-Morency <
> guillaumepoiriermore...@gmail.com> wrote:
>
>>  It would be quite a challenge in terms of implementation, but I like
>>  the idea.
>>
>>  Maybe having a Web-based compiler for embedding and running snippets
>>  would be a good start. It could be integrated in valadoc.org :)
>>
>>  Le samedi 04 mars 2017 à 15:43 +0100, Dev_NIX a écrit :
>>  > I would take a look to WebAssembly. The next few years could be
>>  > amazing for the concept of isomorphic web frameworks! (just imagine
>>  > Valum running in a web browser as on the server side).
>>  >
>>  > > Exactly, I thought Vala has good and strong asynchronous
>>  > > "mechanics" which made Vala a good choice for webapps. So we should
>>  > > keep an eye on frameworks which could be the key to success for
>>  > > Vala (or at least better recognition). Thanks for informations,
>>  > > pending march for the next release ;-) Regards
>>  >
>>  > ___
>>  > 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
>>  Chercheur boursier à l'IRIC
>>
>>  Mon blog: https://arteymix.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
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] How to check if string is empty

2017-01-17 Thread Dmitry Golovin
My mistake. Thanks for correcting me.

17.01.2017, 10:55, "Jens Georg" :
>>  In Vala you can simply just check for str != "", this is enough.
>
> No, if str is nullable it's semantically different, because str != ""
> will be generated as
>
> if (g_strcmp0 (_tmp1_, "") != 0) {
>    ..
> }
>
> This will be TRUE for _tmp1_ being NULL because NULL isn't "" ( and
> g_strcmp0 will return -1 because NULL is < everything)
> so if str is nullable, str != "" means NULL or not empty.
> ___
> 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] How to check if string is empty

2017-01-16 Thread Dmitry Golovin
Hi Alexandre,

In Vala you can simply just check for str != "", this is enough.

Regards,
Dmitry

16.01.2017, 21:28, "Alexandre Oliveira" :
> I tried this in my method, even replacing 'string' for 'string?', but I
> still get the same message in my terminal.
>
> What is your suggestion to suppress these messages?
>
> On 16/01/2017 17:23, Guillaume Poirier-Morency wrote:
>>  You should test for nullity before addressing the string.
>>
>>  return str == null || str.length == 0;
>>
>>  If you expect the string to be potentially 'null', use the 'string?'
>>  type instead.
>>
>>  2017-01-16 14:09 GMT-05:00 Alexandre Oliveira >  >:
>>
>>  Hello!
>>
>>  I've just heard about Vala and I've been messing around with it these
>>  past days.
>>
>>  However, I came across a problem. I need to check if some strings aren't
>>  empty, and I realized there's no method in Vala that's equivalent to
>>  C#'s `string.IsNullOrEmpty(string)`.
>>
>>  I tried setting up a static method to check if the given string is
>>  empty:
>>  ```
>>  static bool is_empty(string str) {
>>  return str[0] == '\0' || str == null;
>>  }
>>  ```
>>
>>  However, running my code, I get the following message repeatedly in my
>>  terminal: ** (main.exe:2288): CRITICAL **: is_empty: assertion 'str !=
>>  NULL' failed
>>
>>  What am I doing wrong?
>>
>>  Thanks!
>>  --
>>  Alexandre Oliveira
>>    167F D82F 514A E8D1 2E9E
>>    C62D 1B63 9D4A 7E9D DA9D
>>  ___
>>  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:* arteymix.github.io 
>>  *Mon projet de coopérative:* pittoresque.github.io
>>  
>>  *Clé PGP:* B1AD6EA5
>>  
>
> --
> Alexandre Oliveira
>   167F D82F 514A E8D1 2E9E
>   C62D 1B63 9D4A 7E9D DA9D
> ___
> 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] Valadoc.org is fully operational again

2016-11-24 Thread Dmitry Golovin
24.11.2016, 18:33, "Ben Iofel" :
> I'm working on a brand new valadoc by generating XML at
> https://github.com/eustasy/vala-docs.org/tree/generator . Currently
> valadoc.org generates html pages then extracts the parts it wants
>
> On Nov 24, 2016 9:16 AM, "Guillaume Poirier-Morency" <
> guillaumepoiriermore...@gmail.com> wrote:
>
>>  Le mercredi 23 novembre 2016 à 10:56 +, Al Thomas via vala-list a
>>  écrit :
>>  > In case anyone hadn't noticed valadoc.org is fully working again.
>>  >
>>  > Thanks to Elementary OS [1] who are hosting the site [2].
>>  >
>>  > Development is now being done at https://github.com/valadoc and
>>  > includes a number of recent updates, including better URIs for
>>  > bookmarking and external linking. There is also work started on
>>  > changing valadoc.org to use Valum [3].
>>
>>  The docs and static assets are served so far and I still have to
>>  reimplement the tooltip and search feature (which only require
>>  accessing a MySQL database with Gda).
>>
>>  If anyone would like to test it, I also provided a Vagrantfile to
>>  provision a VM and run the site.
>>
>>  vagrant up
>>  vagrant provision
>>  vagrant ssh
>>  cd valadoc-org
>>  make serve # or make serve-mini
>>
>>  It should be noticeably faster due to use of proactive caching with
>>  ETag headers.
>>
>>  The first transition will be drop-in, then we shall look into the
>>  possibility of serving and searching docs as a service.
>>
>>  >
>>  > The content is up to date. With Valum 0.3 [4] and libcolumbus [5]
>>  > recently being added.
>>  >
>>  > Thanks should also go out to Chris Daley of Valadate project for
>>  > hosting a mirror ( http://valadoc.valadate.org ) and the company
>>  > RooJSolutions ( http://valadoc.roojs.com ) for also hosting a mirror
>>  > while things got back to normal.
>>  >
>>  > [1] - https://elementary.io/
>>  > [2] - http://blog.elementary.io/post/152967321211/were-now-hosting-va
>>  > ladocorg
>>  > [3] - https://github.com/Valadoc/valadoc-org/pull/40
>>  > [4] - https://arteymix.github.io/valum/2016/11/11/announcing-valum-0-
>>  > 3.html
>>  > [5] - http://voices.canonical.com/jussi.pakkanen/2012/12/03/introduci
>>  > ng-libcolumbus-a-fast-online-approximate-matching-library/
>>  > ___
>>  > 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
>>  Chercheur boursier à l'IRIC
>>
>>  Mon blog: https://arteymix.github.io/
>>  Clé PGP: B1AD6EA5

That is a great idea! Possibly later it would be possible to use generated XML 
in GNOME Builder to show documentation for every used function (like it is done 
in most Java IDEs).

I think it is possible to add XML as an output format for valadoc utility.

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


[Vala] Vala logo

2016-10-16 Thread Dmitry Golovin
Hi all!

This topic was already discussed here on the mailing list and it even has it's 
own page on the wiki (https://wiki.gnome.org/Projects/Vala/Logo).

Now Vala doesn't have any official logo, but there were some suggestions. I 
particularly liked one of logo options suggested by Luca Bruno 
(https://picasaweb.google.com/lethalman88/ValaLogo). Unfortunately the link is 
now dead (404) and I can only find a low resolution version of this logo 
(http://i.imgur.com/0bvQFR5.jpg).

Does anyone have the original SVG/PNG version of it? Any chance that someday it 
will become the official Vala logo?

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


[Vala] Running Gtk.main() in a separate thread

2016-10-14 Thread Dmitry Golovin
Hi all!

I want to create a modular application with libpeas. One of it's modules is a 
GTK+ user interface. The problem is that the user interface should run in a 
separate thread, so the main application will continue it's execution. The 
threads should be managed in the extension code, not the main application's 
code.
So basically what I need is to start Gtk.main() in separate thread. Evan said 
yesterday that this would be a bad design, so if it is possible to make it 
better, please share your thoughts.
Here is a code example (excuse me for a long message, I could not make the 
example any smaller):

main.vala
-
using Peas;
public class Test {
private ExtensionSet extensions { get; set; }
public Test() {
var engine = Engine.get_default();
string dir = Environment.get_current_dir();
engine.add_search_path(dir, dir);
extensions = new ExtensionSet(engine, typeof(Gui));
extensions.extension_added.connect((info, extension) => {
(extension as Gui).activate();
});
extensions.extension_removed.connect((info, extension) => {
(extension as Gui).deactivate();
});
foreach (var plugin in engine.get_plugin_list()) {
if (engine.try_load_plugin(plugin)) {
print("Sucessfully loaded " + plugin.get_name() + "\n");
} else {
print("Error loading " + plugin.get_name() + "\n");
}
}
}
}
public interface Gui : Object {
public abstract void activate();
public abstract void deactivate();
}
-
gtk.vala
-
using Peas;
using Gtk;
public class GtkGui : Object, Gui {
public void activate() {
unowned string[]? a = null;
Gtk.init(ref a);
var window = new GuiWindow();
window.show();
print("activating gtk...\n");
// run this in a separate thread?
Gtk.main();
}
public void deactivate() {
if (Gtk.main_level() > 0)
Gtk.main_quit();
print("deactivating gtk...\n");
}
}
public class GuiWindow : Window {
public GuiWindow() {
this.title = "GtkGui";
this.destroy.connect(Gtk.main_quit);
}
}
[ModuleInit]
public void peas_register_types(TypeModule module) {
var objmodule = module as ObjectModule;
objmodule.register_extension_type(typeof(Gui), typeof(GtkGui));
}
-
launcher.vala
-
void main(string[] args) {
new Test();
}
-
gtk.plugin
-
[Plugin]
Module=gtk.so
Name=GTK+ UI
-
Makefile
-
all: main libgtk.so
main: libmain.so launcher.vala
valac -o main launcher.vala --vapidir . --pkg main -X -I. -X -L. -X 
-lmain
libmain.so: main.vala
valac -o libmain.so --library main -H main.h -X -shared -X -fPIC --pkg 
libpeas-1.0 main.vala
libgtk.so: libmain.so gtk.vala
valac -o libgtk.so --library gtk gtk.vala -X -shared -X -fPIC --vapidir 
. --thread --target-glib 2.32 --pkg gtk+-3.0 --pkg libpeas-1.0 --pkg main -X 
-I. -X -L. -X -lmain   
clean:
rm -f main libmain.so main.h main.vapi libgtk.so gtk.vapi
run: main libgtk.so
LD_LIBRARY_PATH=. ./main
-
Just save all 5 files under given filenames and execute `make run`.

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


Re: [Vala] The future of Vala

2016-09-14 Thread Dmitry Golovin
08.09.2016, 20:33, "Timm Bäder" :
> Hey,
>
> this is probably just a mail for Jürg and maybe Luca, but if you have a
> relevant opinion on the matter, that might be a fine reply as well.
>
> So, for quite a while the Vala project has seen very little activity.
> The three people most involved (Jürg, Luca and Flo) are barely on IRC
> and/or otherwise reachable which makes it hard to get an opinion or info
> from them. On the other hand, some people are still doing a great job,
> namely Rico with all the binding work, as well as Evan (I haven't kept
> up with what Al is doing other than replying to bugzilla issues that
> won't be fixed unless it's a binding issue).
>
> Lots of people are worried about how the project will stay alive (or
> if), and quite a lot of projects are written in Vala (including one I
> maintain) -- and people keep porting projects from C to Vala, mostly
> hoping for more contributions, hoping the Vala's C#-like syntax scares
> off less people.
>
> Now, we all know that Vala has enough bugs that need to get fixed, as
> well as lots of potential for improvements (I'll just disregard all the
> wishes for special syntax for fringe features on IRC, that's not what
> I'm talking about). Some of them are easy to fix but even if the patches
> are present in bugzilla and their author is willing to fix them after
> a review, the review just never happens. This doesn't just cause those
> bugs to stay unfixed, but those people will also never get accustomed
> to the internals of valac and so they will never work on anything more
> important than this simple fix.
>
> I have tried in the past to do exactly that and post some patches for
> simple fixes to get an understanding of valac internals but it's quite
> frankly huge and there's not a real high-level documentation one could
> work with (apart from a few very old blog posts form Luca) and neither
> working tools do debug it (I've once spent a few hours on fixing valag
> but then gave up...).
>
> So... what's the deal here? Is there any way forward one could look
> into? Is it wip/transform? IIRC there was some dbus stuff broken here?
> Are there any TODO items for cleaning up the compiler? Should we just
> tell people to not use Vala in the first place (which would be better
> for the in the long run)? All of these are fine, but the current
> situation not so much.
>
> Sincerely,
> Timm

Hi!

At first I didn't want to enter this discussion, because it targeted certain 
people, the Vala programmers, and I am not a programmer.

I use Vala in my own projects as well as in company's projects just because I 
have free choice of programming language and I like Vala, so why not? 

It would be very sad if Vala stopped being supported, but I don't think it 
would ever happen because a lot of GNOME applications are written in Vala, and 
now we also have elementaryOS and Budgie Desktop.

I really like Vala because it is designed to be cross-platform, but unlike Java 
or C# it is "write once, compile anywhere". I really like the simplicity of 
Vala and the fact that it did replace Mono at least for some users.

Vala is good for writing desktop apps with the best GTK+ bindings so far, Vala 
compete for server-side web with Valum, Vala can also handle client-side web 
with caja, Vala is suitable for embedded programming with posixvala, Vala is 
even okay for microcontrollers with avr-vala. I don't really know how abandoned 
the listed projects are, but the idea is very good.

What I'd like to see is more platforms support: Android, iOS, web-browser. I 
know that there is GLib port for Android, so it should not be a problem to 
support this platform, I remember there was a cross-compilation success story 
from 2013. There should also be a iOS port, I even remember seeing valac 0.15 
compiled for iOS. The browser should be a problem because GLib does not work 
with Emscripten, don't really know about WebAssembly.

The other thing that is missing is a place with good code examples. There are 
few examples on GNOME Wiki (some of them are pretty outdated), there are very 
nice Cairo drawing examples in related documentation, but if you want something 
else, you just search for code in real projects (usually GNOME apps). There 
should be a website with collection of all possible Vala examples that 
encourages more people to use Vala and has a StackOverflow-style forum. 

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


Re: [Vala] How small can you go with Vala? Was: Just a news I've read about popularity langage

2016-07-26 Thread Dmitry Golovin
22.07.2016, 18:38, "Al Thomas" :
>   From: Dr. Michael Lauer 
>  Sent: Friday, 22 July 2016, 15:42
>  Subject: Re: [Vala] Just a news I've read about popularity langage
>
>>  As an embedded system engineer I see huge potential using Vala in embedded
>>  Linux, it has not the runtime drawback of python and java, and is way
>>  simpler to use than C++, while C# has no porting to ARM.
>
> Yes. Unfortunately though the very useful POSIX profile has been removed from 
> VALA
> and no substitute has been added.
>
> With a bit of work you could code without any dependency on GLib/GObject.The 
> basic types, int, etc. , can be rebound in a new binding. See the 
> glib-2.0.vapifor how int is bound to gint, etc. and then chance those to 
> standard C.
>
> Last time I tried I seem to remember a problem with valac when using 
> --nostdpkgSo that may need to be fixed first.
> On IRC someone said they were using musl instead of glibc for Vala programs.
> Not using GLib would still have the advantages of namespaces, compact classes 
> andVala's assisted memory management for bindings. So the loss of the Posix 
> profileis not such a great loss, it depends on what you are trying to achieve.
>
> If you want more sophisticated features like async have a look 
> at:https://github.com/apmasell/avr-vala
> On the other hand a few megabytes for GLib is not a lot for modern
> "embedded" systems running a linux distro.
> Al

It is still possible to use POSIX profile with modern versions of Vala, have a 
look at this project: https://github.com/radare/posixvala

But there are some GLib features that can't be implemented with POSIX profile: 
abstract classes, interfaces, async methods, non-compact classes, regular 
expressions.

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


Re: [Vala] why valac says "error: Failed to execute child process (Exec format error)"

2016-06-21 Thread Dmitry Golovin
Hi,

Do you use (old, unmaintained) MinGW/MSYS or MSYS2 (https://msys2.github.io/)? 
It should not be a problem with MSYS2: just type

pacman -S mingw-w64-vala

It should be the latest version, so you don't need to compile it yourself.

Regards,
Dmitry

21.06.2016, 08:49, "oyster" :
>  $ file $(which valac)
> /opt/windows_32/vala-my-build/bin/valac.exe: PE32 executable for MS
> Windows (console) Intel 80386 32-bit
>
> $ file $(which pkg-config)
> /opt/windows_32/bin/pkg-config.exe: PE32 executable for MS Windows
> (console) Intel 80386 32-bit
> LOVLJIDY@LOVLJIDY-PC ~
>
> $ file $(which gcc)
> /opt/windows_32/bin/gcc.exe: PE32 executable for MS Windows (console)
> Intel 80386 32-bit
>
> $ file /e/msys/opt/windows_32/bin/libglib-2.0-0.dll
> /e/msys/opt/windows_32/bin/libglib-2.0-0.dll: PE32 executable for MS
> Windows (DLL) (console) Intel 80386 32-bit
>
> and this is a test on a 64bits application for comparation:
> $ file /e/greensoft/3d/blender/blender-2.77.1-git.9d431f1-AMD64/blender.exe
> /e/greensoft/3d/blender/blender-2.77.1-git.9d431f1-AMD64/blender.exe:
> PE32+ executable for MS Windows (console) Mono/.Net assembly
>
> 2016-06-21 5:27 GMT+08:00 Al Thomas :
>>  
>>  From: oyster 
>>  Sent: Monday, 20 June 2016, 16:08
>>  Subject: Re: [Vala] why valac says "error: Failed to execute child process
>>  (Exec format error)"
>>
>>  so what is the possible solution to find out which 32 and 64 bits DLLs
>>  are conflictive?
>>
>>  According to this Stack Overflow answer, if you have Visual Studio install
>>  "Dumpbin will report DLLs as machine (x86) or machine (x64)". See
>>  
>> http://stackoverflow.com/questions/197951/how-can-i-determine-for-which-platform-an-executable-is-compiled
>>  Otherwise
>>  
>> http://stackoverflow.com/questions/495244/how-can-i-test-a-windows-dll-to-determine-if-it-is-32bit-or-64bit
>>  may help.
>>
>>  You should check the format of valac, gcc and pkg-config
>>
>>  I am sure my GCC produces 32bits exe/dll files even on my 64 bits machine.
>>
>>  please note, as I have mentioned in
>>  https://mail.gnome.org/archives/vala-list/2016-June/msg00027.html
>>  1) vala-0.18.0-mingw32-bin.tar.xz from http://linbox.free.fr/vala/ can
>>  compile hello.vala without problem
>>  2) Then I compile vala-0.32 from source with vala-0.18.0. Then I
>>  overwrite vala-0.18.0 with my new compiled vala-0.32( which is for
>>  i386 and above, i.e. 32bits)
>>  3) my new compiled vala-0.32 complains "error: Failed to execute child
>>  process (Exec format error)" when it is used to compile hello.vala(
>>  which can be compiled by vala-0.18.0)
>
> ___
> 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] why valac says "error: Failed to execute child process (Exec format error)"

2016-06-17 Thread Dmitry Golovin
Hi,

I had similar problem and solved it just by first generating C code (valac -C 
...) and then compiling resulting code with GCC.

Regards,
Dmitry

15.06.2016, 18:42, "oyster" :
> I am using mingw + msys on win7 64bits. The gcc can compile to produce
> EXE file, and pkg-config can run no problem
>
> I can compile vala_0.32.0 without problem
>
> but when I try to use "valac -v hello.vala" to compile any vala source, I find
> [quote]
> Loaded package 
> `E:\msys\opt\windows_32\vala-my-build\share/vala-0.32/vapi/glib-2.0.vapi'
> Loaded package 
> `E:\msys\opt\windows_32\vala-my-build\share/vala-0.32/vapi/gobject-2.0.vapi'
> error: Failed to execute child process (Exec format error)
> ...
> Compilation failed: 3 error(s), 0 warning(s)
> [/quote]
>
> Any hints to find what is the problem? Thanks
> ___
> 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] Getting all the symbols from my code

2016-05-08 Thread Dmitry Golovin
07.05.2016, 15:35, "Al Thomas" :
>>  From: Dmitry Golovin 
>>  Sent: Saturday, 7 May 2016, 9:01
>>  Subject: [Vala] Getting all the symbols from my code
>>
>>  I want to have a list of all the symbols from my code.
>>
>>  First I create a CodeContext, then I add all the external packages and 
>> source
>>  files, then visit each file with a Parser.
>>
>>  I expect to get all the CodeNodes from my code, but I only get the top-level
>
>>  ones. Is it possible to get all the children of each CodeNode?
>
> You probably want to be looking at a CodeVisitor. So this file
>
> I think writes out Vala symbols for a VAPI:
> https://git.gnome.org/browse/vala/tree/vala/valacodewriter.vala
>
> I understand other tools have done similar to what you are attempting:
> https://git.gnome.org/browse/anjuta/tree/plugins/language-support-vala
> https://git.gnome.org/browse/gnome-builder/tree/plugins/vala-pack
>
> Given a lot of IDE tools are re-implementing this there is probably
> a case for a libvalaidetools that talks to libvala and provides a stable
> API. That would be a signifiant project. I would suggest the Vala build
> system also be switched to non-recursive make first so it is easier to
> add any new code.
>
> Al

Thanks for the code reference, Al! I will check it out.

For now I created some kind of Type detection, but I'm not sure if it is done 
right. Here is my code (please excuse formatting, I think it is more readable 
this way if you use monotype font):

foreach (var src in context.get_source_files()) {
print("\n" + src.get_relative_filename() + ":\n");
foreach (var node in src.get_nodes()) {
print(node.to_string() + " -- ");
if (node is Expression) {   print("Expression");
} else if (node is Symbol) {print("Symbol ");
if (node is Constant) { 
print("Constant");
} else if (node is Namespace) { 
print("Namespace");
} else if (node is Subroutine) {
print("Subroutine ");
if (node is Constructor) {  
print("Constructor");
} else if (node is Destructor) {
print("Destructor");
} else if (node is Method) {
print("Method");
} else if (node is PropertyAccessor) {  
print("PropertyAccessor");
} else {print("-"); 
}
} else if (node is TypeSymbol) {
print("TypeSymbol ");
if (node is Delegate) { 
print("Delegate");
} else if (node is Enum) {  
print("Enum");
} else if (node is ErrorCode) { 
print("ErrorCode");
} else if (node is ErrorDomain) {   
print("ErrorDomain");
} else if (node is ObjectTypeSymbol) {  
print("ObjectTypeSymbol ");
if (node is Class) {
print("Class");
} else if (node is Interface) { 
print("Interface");
} else {
print("-"); }
} else if (node is Struct) {
print("Struct");
} else {print("-"); 
}
} else if (node is Variable) {  print("Variable 
");
if (node is Field) {
print("Field");
} else if (node is LocalVariable) { 
print("LocalVariable");
} else if (node is Vala.Parameter) {
print("Parameter");
} else {print("-"); 
}
} else {print("-"); }
} else {print("-"); }
print("\n");
}
}

The idea of having somehow standardized libvalaidetools is great. This can be 
simple API library providing completion, code navigation, dependency 
management, some standard vala-project file format, etc. So that anyone could 
turn his favorite text editor into full-featured Vala IDE using this library.

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


[Vala] Getting all the symbols from my code

2016-05-07 Thread Dmitry Golovin
Hi!

I want to have a list of all the symbols from my code.

First I create a CodeContext, then I add all the external packages and source 
files, then visit each file with a Parser.

Then I do this:

foreach (var src in context.get_source_files()) {
print("\n" + src.get_relative_filename() + ":\n");
foreach (var node in src.get_nodes()) {
print(node.to_string() + "\n");
node.accept_children(parser);
}
}

I expect to get all the CodeNodes from my code, but I only get the top-level 
ones. Is it possible to get all the children of each CodeNode? Or maybe I just 
don't understand what CodeNode is?

It would be great to have more documentation describing the internal structure 
of Vala. Now I use valadoc generated from vala git, but comments are short and 
I don't get the whole picture of how it works. It would also be great if 
valadoc also generated some code map that shows relations of all the classes in 
one picture. 

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


[Vala] Incorrect C code generated

2016-03-22 Thread Dmitry Golovin
Hello!

Discussed today on the IRC channel, also posting it to the mailing list.

I don't know if it is a vala bug or I am just using things incorrectly.

Here is my code:

struct N {
  int i;
}
class ClassA : Object {
  public N a { get; set; }
  public ClassA(N a) {
this.a = a;
  }
}
class ClassB : Object {
  public Value b { get; set; }
  public ClassB(Value b) {
this.b = b;
  }
}
class Main {
  static void main() {
var a = new ClassA({ 1 });
var b = new ClassB(a.a);
b.notify["b"].connect((obj, prop) => { a.a = (N)b.b; });
  }
}

Here is what C compiler says:

Clang: test.vala.c:413:29: error: cannot take the address of an rvalue of type 
'N' (aka 'struct _N')
  ...&((G_VALUE_HOLDS (&_tmp1_, TYPE_N) && g_value_get_boxed (&_tmp1_)) ? 
(*((N*) g_value_get_boxed (&_tmp1_))) : (g_warning ("Invalid GValue unboxing 
(wrong type or NULL)"), _tmp2_)));

GCC: test.vala.c:413:29: error: lvalue required as unary ‘&’ operand
  class_a_set_a (_data1_->a, &((G_VALUE_HOLDS (&_tmp1_, TYPE_N) && 
g_value_get_boxed (&_tmp1_)) ? (*((N*) g_value_get_boxed (&_tmp1_))) : 
(g_warning ("Invalid GValue unboxing (wrong type or NULL)"), _tmp2_)));

This shorter code has similar problem (but it makes much less sense as this 
cast is impossible):

struct N {
  int i;
}
class Main {
  static void main() {
N n = { 42 };
Value v = n;
int i = (int)((N)v);
print("%d\n", i);
  }
}

In this code cast from Value to my struct works fine:

struct N {
  int i;
}
class Main {
  static void main() {
N n = { 42 };
Value v = n;
n = (N)v;
print("%d %d\n", n.i, ((N)v).i);
  }
}

Could you please make any suggestions on how do I fix the code from the very 
first examples, if it is terribly wrong?

While writing this message, also found this bug: 
https://bugzilla.gnome.org/show_bug.cgi?id=764041 

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


Re: [Vala] How to connect to signal if there's a property with the same name?

2015-12-10 Thread Dmitry Golovin
10.12.2015, 13:52, "mar...@saepia.net" :
> Hello,
>
> I need to connect to "closed" signal of GDBusConnection, but because there
> is a property with the same name, valac refuses to compile and throws the
> following error
>
> src/common/daemon/base.vala:63.11-63.35: error: The name `connect' does not
> exist in the context of `bool'
>   connection.closed.connect(on_dbus_connection_closed);
>   ^
>
> How can I overcome this?
>
> Marcin

I remember having similar problem with GTK+, but I don't recall if I solved it 
and how.

Probably, it is a bug and it should be reported (if not already).

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


Re: [Vala] Rewriting GLib C code in Vala

2015-07-27 Thread Dmitry Golovin
Thanks for your interest.

This turned out to be a bit more complicated than I expected.

I will go through your references and complete cogl-crate soon.

The new home for vapi is now here: http://blog.golovin.in/vala-cogl/vapi/
I also generated valadoc for it: http://blog.golovin.in/vala-cogl/doc/

I hope, there are people interested in it.

If you can compile and test the examples on different systems, please do. I 
want to receive some feedback on how cross-platform cogl really is.
I have already tested it on GNU/Linux+Xorg, GNU/Linux+Wayland and M$ Windows 
(not impressed).

Regards,
Dmitry

24.07.2015, 14:33, "Al Thomas" :
>>  From: Dmitry Golovin 
>>  Sent: Friday, 24 July 2015, 10:04
>>  Subject: [Vala] Rewriting GLib C code in Vala
>>
>>  I'm now transfering Cogl examples to Vala:
>>  https://github.com/tpimh/vala-cogl
>
> Interesting stuff. I also like the reference you've
> found where someone has written an image viewer in
> Genie :-) ( http://onagat.hatenablog.com/ )
>
>>  I'm a GLib newbie, so I need help with rewriting cogl-crate example:
>>  https://github.com/GNOME/cogl/blob/master/examples/cogl-crate.c
>>
>>  I don't fully understand what PollFD is and what function in Vala GLib
>>  binding should be used for g_poll.
>
> It is an event descriptor. From
> https://developer.gnome.org/cogl-2.0-experimental/stable/cogl-2.0-experimental-Main-loop-integration.html
> it is deliberately the same as the Unix pollfd struct ( 
> http://www.valadoc.org/#!api=posix/Posix.pollfd )
> So it may help if you look for Vala examples with that.
>
> I understand you are trying to replicate the example exactly, but as
> you progress you may want to read
> https://developer.gnome.org/cogl-2.0-experimental/stable/cogl-2.0-experimental-Main-loop-integration.html
> if you haven't already. This is suggesting using cogl_glib_source_new()
> to get a GSource event source that can then be integrated with GLib.MainLoop
>
> Some references:
> https://developer.gnome.org/glib/stable/glib-The-Main-Event-Loop.html
> http://valadoc.org/#!api=glib-2.0/GLib.MainLoop
> https://wiki.gnome.org/Projects/Vala/AsyncSamples
> https://sigquit.wordpress.com/2010/01/05/g_source_unref-and-g_source_destroy-are-your-friends/
> http://stackoverflow.com/questions/21434669/creating-a-new-gsource-in-glib
> https://tecnocode.co.uk/tag/gsource/
>
>>  You can find relevant vapi here:
>>  https://github.com/tpimh/vala-cogl/blob/master/vapi/cogl-2.0.vapi
>
> Thanks, I will add this to the list of bindings wiki page
> ( https://wiki.gnome.org/Projects/Vala/ListOfBindings )
>
> Al
> ___
> 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] Rewriting GLib C code in Vala

2015-07-24 Thread Dmitry Golovin
Hello!

I'm now transfering Cogl examples to Vala: https://github.com/tpimh/vala-cogl

I'm a GLib newbie, so I need help with rewriting cogl-crate example: 
https://github.com/GNOME/cogl/blob/master/examples/cogl-crate.c

Especially this part:

```c
  while (1)
{
  CoglPollFD *poll_fds;
  int n_poll_fds;
  int64_t timeout;

  if (data.swap_ready)
{
  paint (&data);
  cogl_onscreen_swap_buffers (COGL_ONSCREEN (fb));
}

  cogl_poll_renderer_get_info (cogl_context_get_renderer (ctx),
   &poll_fds, &n_poll_fds, &timeout);

  g_poll ((GPollFD *) poll_fds, n_poll_fds,
  timeout == -1 ? -1 : timeout / 1000);

  cogl_poll_renderer_dispatch (cogl_context_get_renderer (ctx),
   poll_fds, n_poll_fds);
}
```

What I now have is:

```vala
while (true) {
Cogl.PollFD poll_fds;
int n_poll_fds;
int64 timeout;

if (swap_ready) {
paint();
((Onscreen)fb).swap_buffers();
}

  poll_renderer_get_info(ctx.get_renderer(), poll_fds, n_poll_fds, 
timeout);

  /* poll? */

  poll_renderer_dispatch(ctx.get_renderer(), poll_fds, n_poll_fds);
}
```

I don't fully understand what PollFD is and what function in Vala GLib binding 
should be used for g_poll.

Probably, I'm doing something terribly wrong. Maybe vapi line "public static 
int poll_renderer_get_info (Cogl.Renderer renderer, Cogl.PollFD poll_fds, int 
n_poll_fds, int64 timeout);" is wrong. You can find relevant vapi here: 
https://github.com/tpimh/vala-cogl/blob/master/vapi/cogl-2.0.vapi

Thanks in advance!

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


Re: [Vala] Unmount disk using udisks2 objects in vala

2015-04-14 Thread Dmitry Golovin
Hi!

Please, see "filesystem" property of UDisks.Object.

Regards,
Dmitry

03.04.2015, 02:22, "rastersoft" :
> Hi all:
>
> I'm working with the udisks2 classes in Vala, and have the problem that
> I need to format a disk, but to do so, first I must unmount it. It seems
> that the only place where is an unmount method is in the Filesystem
> class, but I can't find how to create that class from a Block or Device
> class.
>
> Can someone help me?
>
> Thanks.
>
> --
> Nos leemos
>  RASTER    (Linux user #228804)
> ras...@rastersoft.com  http://www.rastersoft.com
>
> ___
> 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] Research project on the Vala compiler

2015-04-14 Thread Dmitry Golovin
Hi!

Check out those lists:
https://wiki.gnome.org/Projects/Vala/Documentation#Projects_Developed_in_Vala
https://github.com/search?l=Vala&q=stars%3A%3E%3D0&s=stars&type=Repositories
https://code.google.com/hosting/search?q=label%3avala
https://www.ohloh.net/tags/vala
http://freecode.com/tags/vala

Regards,
Dmitry

06.04.2015, 03:39, "Guillaume Poirier-Morency" 
:
> I will look further into git.gnome.org, it looks really promising.
>
> Also, I thought of just running per-language search on GitHub,
> Bitbucket and other hosting services.
>
> I am currently compiling meta-data of the projects in a YAML file so
> that the checkout, configure, build and computation processes can be
> easily automated and reproduced.
>
> Thank you for the suggestions! I am always open to more ideas.
>
> Le dimanche 05 avril 2015 à 06:17 -0500, Daniel Espinosa a écrit :
>>  You could add two projects in your list:
>>  GXml:  git.gnome.org/browse/gxml
>>  LibreSCL: github.com/pwmediaconsulting/librescl
>>  Both are written in Vala and generate C code to compile binaries.
>>  I'm the maintener  of both then I can help you and of course I'm one
>>  of the most interested.
>>  Both are LGPL and I've found lot of memory leaks and I start to
>>  investigate generated C source code.
>>  El abr 3, 2015 1:10 PM, "Guillaume Poirier-Morency" <
>>  guillaumepoiriermore...@gmail.com> escribió:
>>>  Hi everyone!
>>>
>>>  I am conducting a small research project on the Vala compiler that
>>>  would principally study how it affects different quality metrics
>>>  (size, complexity, etc...) during the implementation step of the
>>>  development.
>>>
>>>  My goal is to confirm the relevance of metrics measured in the
>>>  generated C code to evaluate the quality of the sources. This is
>>>  important considering the impressive amount of tools that have been
>>>  developed to measure the quality of C/C++ sources.
>>>
>>>  By the same time, I also want to provide an empirical model that
>>>  would
>>>  allow transformations of the measured metrics into significative
>>>  measures for the sources. For example we could be interested into
>>>  knowing the relationship between the size of input and output of
>>>  valac
>>>  or the impact on the cyclomatic complexity.
>>>
>>>  Therefore, I am interested in projects of all size written in Vala
>>>  that generates C code during the build process. It would also be
>>>  great
>>>  to have indications on how the sources are structured and how I can
>>>  extract them.
>>>
>>>  Ex. cloc $(find src -name '*.vala') $(find build -name '*.c')
>>>
>>>  Yet, I have these projects in mind:
>>>
>>>    * vala 30 KLOC
>>>    * valadoc 23.5 KLOC
>>>    * gnome-pomodoro 4.6 KLOC
>>>
>>>  I plan to use it as an empirical justification to setup a set of
>>>  measurements to control the quality of Valum, a web micro-
>>>  framework I
>>>  will work on this summer.
>>>
>>>  The results will be all released under a Creative Commons license.
>>>
>>>  Thanks in advance :)
>>>
>>>  --
>>>  Guillaume Poirier-Morency 
>>>  ___
>>>  vala-list mailing list
>>>  vala-list@gnome.org
>>>  https://mail.gnome.org/mailman/listinfo/vala-list
>
> --
> Guillaume Poirier-Morency 
> ,
>
> ___
> 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] acr 0.9.9

2014-12-12 Thread Dmitry Golovin
I really like you project and probably going to use it.

12.12.2014, 03:05, "pancake" :
> I'm almost ready to release a new version of ACR. My own autoconf
> replacement tool.
>
>    https://github.com/radare/acr
>
> In this release I have fixed some bugs and added support for Vala.
>
> The way to configure a Vala project with ACR is the following:
>
> $ cat configure.acr
> PKGNAME myvala
> VERSION 0.1
> CONTACT name ; m...@host.org
>
> LANG_VALA!
> VALAPKG posix
> VALAPKG gtk+-3.0
>
> PKGCFG CS_CFLAGS CS_LDFLAGS capstone
>
> SUBDIRS config.vala ;
>
> REPORT
>  HAVE_VALA
>  HAVE_VALAC
>  VALAC
>  HAVE_VALAPKG_POSIX
>  HAVE_VALAPKG_GTK_3_0
>  HAVE_LANG_VALA
>  VALA_VERSION ;
>
> $ cat config.vala.acr
> public static string VERSION = "@@VERSION@@";
>
> $ acr
>
> And now you have a fully functional ./configure script that behaves like the
> GNU one but its way smaller and faster. It's still a shellscript, so
> there are
> no portability issues or extra dependencies to build the project.
>
> $ ./configure
> checking build system type... x86_64-unknown-linux-gnu
> checking host system type... x86_64-unknown-linux-gnu
> checking target system type... x86_64-unknown-linux-gnu
> checking for working directories... current
> using prefix '/usr/local'
> checking vala compiler... valac
> checking vala... vala
> checking valac --pkg posix... yes
> checking valac --pkg gtk+-3.0... yes
> checking pkg-config flags for capstone... no
> creating config.vala
> cleaning temporally files... done
>
> Final report:
>   - HAVE_VALA = 1
>   - HAVE_VALAC = 1
>   - VALAC = valac
>   - HAVE_VALAPKG_POSIX = 1
>   - HAVE_VALAPKG_GTK_3_0 = 1
>   - HAVE_LANG_VALA = 1
>   - VALA_VERSION = 0.26
>
> $ ./configure --report
> PKGNAME:   myvala
> VERSION:   0.1
> LANGS: vala
> PKG-CONFIG:  posix gtk+-3.0 capstone
> FLAGS: --with-vala=vala --with-valac=valac
>
> The AMR (automake replacement) is still work in progress and doesnt yet
> supports
> Vala projects. But I think parvala can be used quite nicely here.
>
> I have also plans to add another keyword LICENSE to include the COPYRIGHT
> statements in the same directory, this makes maintaining projects
> easier, but
> the compilation part is what I'll try to address with amr in next versions.
>
> It is possible to extend the fucntionality of the configure.acr with
> conditionals
> or external scripts. But it tries to keep everything as compact as possible.
>
> Let me know if you try it and find any interesting task
>
> --pancake
> ___
> 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] Perfect Vala IDE

2014-12-02 Thread Dmitry Golovin
Hello all!

I don't want to start another vim vs emacs holywar. I want to know if there 
exist an all-in-one IDE (like Eclipse) for Vala.

I tried valama, but it is crashing all the time and I don't know how to fix it.
Gnome Builder is now in very early stage of development.

What IDE do you use for your vala code?

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


Re: [Vala] How to check if GLib.List is empty?

2014-12-02 Thread Dmitry Golovin
> var list = new List();
Looks nice and clean.
Thanks.

02.12.2014, 17:54, "Luca Bruno" :
> On 02/12/2014 16:51, Dmitry Golovin wrote:
>>  List list = new List<>();
>>  Would diamond operator be implemented in the future? Anyone needs it?
>
> var list = new List();
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] How to check if GLib.List is empty?

2014-12-02 Thread Dmitry Golovin
Hello all!

I just tried to compile this:

> int main(string[] argv)
> {
> List list = new List();
> assert( list == null );
> return 0;
> }

It compiles and runs. But this one doesn't compile:

> int main(string[] argv)
> {
> List list;
> assert( list == null );
> return 0;
> }

So, variable should be initialized, even thought it is null after the 
initialization.

And vala doesn't have so called diamond operator (am I right?), so this code is 
not valid:

> List list = new List<>();

Would diamond operator be implemented in the future? Anyone needs it?

Regards,
Dmitry

02.12.2014, 17:38, "Luca Bruno" :
> On 02/12/2014 16:34, Виталий Кирсанов wrote:
>>  Hm, indeed. The following piece of code works fine:
>>
>>  int main(string[] argv)
>>  {
>>  List list = new List();
>>  assert( list == null );
>>  return 0;
>>  }
>>
>>  So this seems to be the answer to my question. But still there are two
>>  weird things in my opinion:
>>
>> - Why I need to call operator new if the result value is still null?
>> Can't I simply declare a reference List list; and then call e.g.
>> append()?
>
> Yes, you can. "new List()" is just "null".
>> - I thought that only references appended with question mark sign (e.g.
>> List?) can be null, cant' they?
>
> There are several exceptions due to historical reasons. Null is quite
> weak in Vala by default in several places.
> There's an experimental non-null flag for valac, but that's not much
> worked on.
>
> Best regards,
> ___
> 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