maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Vala for Maemo development (https://talk.maemo.org/showthread.php?t=18968)

Jaffa 2008-07-26 23:30

Re: Vala for Maemo development
 
It's still a bit of a hack (I've made progress on interfacing in an OO way to libvala from Java, but it's not usable yet), but code complete now contains local variables, type information, restrict-as-you-type and restrict-based-on-preceding-characters and pretty icons as you get in Java:

http://bleb.org/software/valable/valable-4.png

All pushed up to my branch, and this'll probably become the trunk of Valable in the next couple of days once some Launchpad admin gets taken care of.

Jaffa 2008-07-27 16:52

Re: Vala for Maemo development
 
More spam from me about the latest push up to my branch. Some bugs fixed with the recompilation of projects on start-up, and I've done a first pass over the implementation of the sparkling new outline view:

http://bleb.org/software/valable/valable-5.png

Bundyo, since I couldn't get Monodevelop working - what's missing from Valable which monodevelop does? Would be good to have feature parity before polishing the features ;-)

PS. Interestingly (FSVO "interesting"), that screenshot also shows a minor issue with keyword detection, in that "set_contents" should be just "set_contents"; but "set" is a keyword in Vala.

brontide 2008-07-27 17:39

Re: Vala for Maemo development
 
Like you don't have enough to do, but...

What about a 15 minute vala intro session at the summit?

Bundyo 2008-07-27 18:42

Re: Vala for Maemo development
 
Probably nothing :) Though Monodevelop didn't got fully working anyway (no working code completion if there are big VAPI files in there). The code browser is a little strange - it doesn't show the current file but instead the VAPI files. I'm using it more like a reference :)

Jaffa 2008-07-27 19:08

Re: Vala for Maemo development
 
Quote:

Originally Posted by brontide (Post 207606)
Like you don't have enough to do, but...

What about a 15 minute vala intro session at the summit?

It's a good idea. I don't know the language well enough myself at the moment, and my Hildon-based apps with it have been too noddy to release; however I'd be happy to help out anyone (Bundyo? Tak?) who does lots of Vala development with a tooling demo.

darklajid 2008-07-27 19:19

Re: Vala for Maemo development
 
Seconded. I'm currently trying to learn/use vala as well and imho this would be the killer language for the tablet (python fans keep calm..).
I'd volunteer, but I'm a java/C# guy. Related, but different in too much things and I'll probably fail to become a guru in the next 2 month..

Any takers though?

Bundyo 2008-07-27 19:21

Re: Vala for Maemo development
 
I don't do lots :) I have two small apps, veeery small :). I'm foreign to GTK too and i keep meeting with the need of a X VAPI. However, this can't be done without a simple additional parser to at least specify which function is in which header (since vapigen doesn't bother to specify it). So I'm just beginning :) Maybe I'll have something to talk about in September, but i can't tell for sure now. :(

EDIT: Forgot to tell i'm all for a Vala talk and how it can help the tablet development evolve (not by me though :)).

hircus 2008-08-26 05:25

Re: Vala for Maemo development
 
Quote:

Originally Posted by fpp (Post 202878)
It would be great (at least for brace-challenged coders :-) to have a python-to-vala translator+compiler. Doesn't look totally impossible, either...

Check out Genie. It's an alternate front-end language to Vala, compiled using the same compiler, with a Python-esque syntax.

TA-t3 2008-08-26 09:37

Re: Vala for Maemo development
 
Woo, I have genie without even knowing it - my vala compiler turned out to be new enough, so I can write Genie programs without installing anything extra! Just start writing code with a .gs file extension.

BoxOfSnoo 2008-08-27 16:40

Re: Vala for Maemo development
 
Ok, help? Monodevelop failed miserably on Ubuntu. Eclipse has no clue how to plug in valable. vala won't install on the tablet 'cause it needs c-compiler which isn't available.

Any clues or should I start learning in joe and valac on the desktop?

Bundyo 2008-08-27 18:38

Re: Vala for Maemo development
 
Vala needs C compiler, you won't get away with that :) Also it will be probably too slow on the tablet (it is slowish in the emulator too). Monodevelop is easier to get running on openSUSE for sure, probably best for you is to try harder with Valable and compile in scratchbox.

BoxOfSnoo 2008-08-27 19:00

Re: Vala for Maemo development
 
Try harder... Let me clarify. I have no idea where to GET it.

Launchpad is like Sourceforge without the files. There's just a bunch of announcements, developer's names and so on.

Where should I look?

Bundyo 2008-08-27 19:17

Re: Vala for Maemo development
 
I think Andrew should be answering this one :)

lcuk 2008-08-27 19:33

Re: Vala for Maemo development
 
Bundyo,
Compilation time on the tablet for even the barest hello world (in performance mode) was over 30 seconds.

I did not go further.

for reference, each module in liqbase takes about 3-5 seconds for raw c.

c++ modules of similar length take about 20 seconds

Bundyo 2008-08-27 19:39

Re: Vala for Maemo development
 
I was suspecting numbers like these :(

BoxOfSnoo 2008-08-27 19:41

Re: Vala for Maemo development
 
Well my desktop compilation time has been so far 2 full days for 0 lines of code. I think the tablet wins! :D

Jaffa 2008-08-28 15:44

Re: Vala for Maemo development
 
Right, to get Valable:
  1. Install Vala
  2. Install ctags
  3. Get Valable: bzr branch lp:valable - this should give you a 'valable' directory.
  4. Open Eclipse
  5. Select File > Import... > General > Existing Projects into Workspace
  6. Set root directory to the 'valable' directory from step 2.
  7. Project should compile :-)
  8. Right click on the project and select Run as > Eclipse application - a new Eclipse should open
  9. Select File > New > Project... > Vala > Vala Project, enter some details, and create a new Vala file in it.

I've not yet looked at exporting the plugin for installation into Eclipse - it's a while off that yet. Let me know if this doesn't work.

BoxOfSnoo 2008-08-28 16:01

Re: Vala for Maemo development
 
Quote:

Originally Posted by Jaffa (Post 218548)
Right, to get Valable:

bzr branch lp:valable - this should give you a 'valable' directory.

Note for others :) : this is a command you have to type: you may need bzr installed also, it's a program similar to cvs or svn.

...sorry, it may be blindingly obvious but took me a while to realize this.

Quote:

Originally Posted by Jaffa (Post 218548)
Project should compile :-)

Right now I have 22 errors and 2 warnings. Obviously I am missing some libraries (Where is Scanner located?).

Great help so far! Getting the code was the first real roadblock.

EDIT: I needed to do a couple of things: 1) make sure I had Sun's Java installed, not just OpenJDK 2) Make sure the Workspace properties are set to compiler compliance level of 6.0.

And so far, it works! Now I have to get cracking I suppose.

Jaffa 2008-08-28 16:35

Re: Vala for Maemo development
 
Quote:

Originally Posted by BoxOfSnoo (Post 218553)
Note for others :) : this is a command you have to type: you may need bzr installed also, it's a program similar to cvs or svn.

Yup.

Quote:

Right now I have 22 errors and 2 warnings. Obviously I am missing some libraries (Where is Scanner located?).
As you found, Java 6 :-)

Quote:

EDIT: I needed to do a couple of things: 1) make sure I had Sun's Java installed, not just OpenJDK 2) Make sure the Workspace properties are set to compiler compliance level of 6.0.

And so far, it works! Now I have to get cracking I suppose.
Excellent!

Benson 2008-09-03 23:22

Re: Vala for Maemo development
 
Quote:

Originally Posted by Bundyo (Post 207632)
I don't do lots :) I have two small apps, veeery small :). I'm foreign to GTK too and i keep meeting with the need of a X VAPI. However, this can't be done without a simple additional parser to at least specify which function is in which header (since vapigen doesn't bother to specify it). So I'm just beginning :) Maybe I'll have something to talk about in September, but i can't tell for sure now. :(

EDIT: Forgot to tell i'm all for a Vala talk and how it can help the tablet development evolve (not by me though :)).

Hmmm... Any progress on the X VAPI? The hostwin source you sent me seems to depend on it, so presumably you've got something. Might it be tar-worthy?

(And I'm all for a Vala talk, too. I won't be there, though, so I hope it gets videoed, or at least slides posted and maybe audio recordings.)

Benson 2008-09-03 23:55

Re: Vala for Maemo development
 
Quote:

Originally Posted by BoxOfSnoo (Post 218140)
Ok, help? Monodevelop failed miserably on Ubuntu. Eclipse has no clue how to plug in valable. vala won't install on the tablet 'cause it needs c-compiler which isn't available.

Any clues or should I start learning in joe and valac on the desktop?

So I'm not the only one mad enough to try that?

As far as vala on the tablet, it works. You have to set up the SDK repo (which contains some packages that require removal of large chunks of your system to install, and thus is hazardous; you've been warned), and then apt-get install gcc, libgtk2.0-dev, and probably some other *-dev packages.
But that's not as easy as it sounds, if you've been keeping up with SSU, because the *-dev packages in the SDK repo are not updated to new versions, and depend on the * packages of the same version; several of these wound up a revision or patch level behind the installed version. No sweat; just a
Code:

apt-get install problem-package=1.1.1
will install version 1.1.1, even though it's a downgrade. Then you can carry on.
But, that's not as easy as it sounds either, because osso-software-version-rx34-unlocked depends on the new versions, and you don't want to remove that. (Though apt-get will be happy to suggest it when you give the downgrade command.)
So, I put lies in /var/lib/dpkg/status, which is as easy as it sounds (finally!); edit /var/lib/dpkg/status, search for osso-software, and change the versions in Depends as needed. Do that each time you catch a new dependency problem that way.
Now this probably broke future SSUs; I guess I'll have to manually patch the new osso-software-version-rx34-unlocked to permit the old versions of the problematic packages. But anyone still reading this far should be able to do that, or live without SSU on one boot image.

Another option might be to start from a clean diablo flash, and not do the SSU; I think the versions would match then, and everything would install without incident. You'd still be unable to perform any SSUs until the SDK repo is up-to-date.
Bottom line: If you're scared, don't do any of this!

If you're not scared, clone to an SD if you haven't yet (you'll probably need the extra room anyway), and back up your entire ext2/3 partition before you add the SDK repo. (Oh, and if you're not scared, you're crazy. Just so you know. :cool:)

The GTK hello-world example in waf works fine, so I know Vala is working; as seen in my post above, I don't quite have it building what I want to build, but I think my trouble is platform-irrelevant.

BoxOfSnoo 2008-09-04 19:39

Re: Vala for Maemo development
 
I just tried out something much simpler: installing in deblet. It's chrooted already, so I could keep the systems separate.

I just finished testing this basic sample: http://live.gnome.org/Vala/BasicSample and it compiled in 12.260s on my tablet, to a final binary. To generate the C and header file it took 10.364s

So, yes, C is considerably faster, but I'd call 12 seconds acceptable! I'm going to have to try out some projects that are more complex and see how it scales...

More info: I tried building the Hildon sample on the same page; it wouldn't build, it doesn't seem to like either Gtk or Hildon packages. I have to surf around in the VAPI files and see if they're there or not.

Bundyo 2008-10-08 19:45

Re: Vala for Maemo development
 
Quote:

Originally Posted by Benson (Post 220635)
Hmmm... Any progress on the X VAPI? The hostwin source you sent me seems to depend on it, so presumably you've got something. Might it be tar-worthy?

(And I'm all for a Vala talk, too. I won't be there, though, so I hope it gets videoed, or at least slides posted and maybe audio recordings.)

Ah, c**p, didn't see that before... No, X VAPI is dead end for now, maybe i'll resurrect it later, however the good news is that hostwin shouldn't be dependent on it, maybe i tried something, so feel free to remove any mentions of it :)

EDIT: Removing mentions of X in src/wscript should be enough.

Updated the source - removed X. At the old place:
http://www.internettablettalk.com/fo...&postcount=122

Benson 2008-10-08 20:01

Re: Vala for Maemo development
 
I tried something like that, but it seemed to break worse. Like I said, I think I did something wrong. Maybe time for another go at it, though, now I know I was at least apparently on the right track...

Bundyo 2008-10-08 20:09

Re: Vala for Maemo development
 
You just need to run

./waf configure
./waf build (or just ./waf)

in the root dir of the project :)

Bundyo 2008-10-23 22:30

Re: Vala for Maemo development
 
Vala 0.4.0 was released some days ago. Has the following new things/changes:
  • Support more flexible constructors.
  • Partial support for reading and writing .gir files.
  • Improve compiler performance.
  • Copy arrays where necessary.
  • Basic support for static properties.
  • Partial support for struct holding object references.
  • Add tracker indexer bindings (Roberto Majadas)
  • Updates to the GLib, GTK+, and GStreamer bindings.
  • Many bug fixes.

Some things i discovered:

They apparently rushed Vala 0.4 without updating all VAPIs with their new syntax additions (which seem to be required) (or maybe they didn't intend to update them all :)).

So if you happen across an error message in the C compile stage that says something about not declared something_construct, be sure to add [CCode (has_construct_function = false)] right above the class constructor in the vapi file. I don't know which ones don't have constructor, so better fix them on sight :)

For instance Hildon.Window was without one, so it should be fixed like this in the vapi:

Code:

    [CCode (cheader_filename = "hildon/hildon.h")]
    public class Window : Gtk.Window, Atk.Implementor, Gtk.Buildable {
        public void add_toolbar (Gtk.Toolbar toolbar);
        public void add_with_scrollbar (Gtk.Widget child);
        public bool get_is_topmost ();
        public weak Gtk.Menu get_menu ();
->      [CCode (has_construct_function = false)]
        public Window ();
        public void remove_toolbar (Gtk.Toolbar toolbar);
        public void set_menu (Gtk.Menu menu);
        public bool is_topmost { get; }
        public virtual signal void clipboard_operation (int operation);
    }

The good thing is that Vala 0.4 compiles much faster.

Also be wary of their fix for the UIManager's new_merge_id - doesn't seem to work as intended (or at all :)

Patches upstream are probably encouraged.

hns 2009-03-04 11:27

Re: Vala for Maemo development
 
Quote:

Originally Posted by Jaffa (Post 218548)
Right, to get Valable:
  1. Install Vala
  2. Install ctags
  3. Get Valable: bzr branch lp:valable - this should give you a 'valable' directory.
  4. Open Eclipse
  5. Select File > Import... > General > Existing Projects into Workspace
  6. Set root directory to the 'valable' directory from step 2.
  7. Project should compile :-)
  8. Right click on the project and select Run as > Eclipse application - a new Eclipse should open
  9. Select File > New > Project... > Vala > Vala Project, enter some details, and create a new Vala file in it.

I've not yet looked at exporting the plugin for installation into Eclipse - it's a while off that yet. Let me know if this doesn't work.

Thanks for these instructions. I found that installing valable as plug-in is actually quite simple. Once you have valable installed (step 7), choose File -> Export -> Deployable plug-ins and fragments, choose the output folder, and then copy the generated plug-in to the plugins folder in your eclipse installation.

Now for the bad part - the plug-in installs, but is currently broken for me. :(

Bundyo 2009-03-04 14:44

Re: Vala for Maemo development
 
BTW, since you opened this thread - MonoDevelop 2.0 is in beta now. Vala completion doesn't work reliably yet, but the editor is quite stable.

Jaffa 2009-03-16 22:12

Re: Vala for Maemo development
 
Vala 0.5.7 is now in Extras-Devel:

http://www.internettablettalk.com/fo...172#post272172

Bundyo 2009-03-29 22:20

Re: Vala for Maemo development
 
Monodevelop 2.0 beta 2. Has packages for Debian/Unstable now.

http://monodevelop.com/Download/Rele...lop_2.0_Beta_2
http://monodevelop.com/Download

ukki 2009-06-13 20:15

Re: Vala for Maemo development
 
Thanks Jaffa for the Vala 0.7.3, had lots of issues with bad c code with the older versions, but latest fixed them. Anyways, few questions:

What the heck can I use for IO? Only FileUtils seems to work for basic file reading, but I need better than that. Diablo GLib seems to be too old for gio/gio-unix that I need. I installed libgio-dev, but it fails to compile with:

Code:

/usr/lib/libgio-2.0.so: undefined reference to `IA__g_app_info_get_default_for_type'
Why is that in repos if it doesn't work or am I missing a lib it needs? Error seems to point to a newer GLib.

What about UDP? I need multicast udp and can't find a lib for that either. I had to do it C so I can add it to c code, but I'd rather use Vala for that too.

Also libsoup-2.2 seems to be buggy, I get all kinds of weird stuff in body like extra chars and even headers etc, so I had to add ugly separators to rule them out.

Vala ain't that bad once you get the hang of it and I do love the speed, but these issues are really making it unsuitable for my needs. Any advice especially for my io-problem?

Bundyo 2009-06-13 20:43

Re: Vala for Maemo development
 
You will also have those issues with C you know :) The problem is the old libraries on the NIT and Vala can't change that. At least in Frematle they updated at last.

What are you trying to do with files that requres GIO?

ukki 2009-06-13 21:04

Re: Vala for Maemo development
 
Quote:

Originally Posted by Bundyo (Post 296395)
What are you trying to do with files that requres GIO?

Actually I need it for this:

http://valadoc.org/?pkg=glib-2.0&ele...ync_with_pipes

Bundyo 2009-06-14 06:53

Re: Vala for Maemo development
 
I don't see anything related to GIO in Process.spawn_async_with_pipes?

ukki 2009-06-14 07:21

Re: Vala for Maemo development
 
Quote:

Originally Posted by Bundyo (Post 296532)
I don't see anything related to GIO in Process.spawn_async_with_pipes?

It returns a file descriptor for the input and I need a way to write to that.

Bundyo 2009-06-14 07:59

Re: Vala for Maemo development
 
http://library.gnome.org/devel/glib/...annel-unix-new

ukki 2009-06-14 11:51

Re: Vala for Maemo development
 
Thank you!!1

Bundyo 2009-06-21 21:53

Re: Vala for Maemo development
 
Okay Jaffa, I managed to get Tear compiling on 0.7.3 without any additional changes, I'm using WAF for building (and deb building), so how can I get mud builder to use WAF? :)

Jaffa 2009-06-22 13:17

Re: Vala for Maemo development
 
Quote:

Originally Posted by Bundyo (Post 298489)
Okay Jaffa, I managed to get Tear compiling on 0.7.3 without any additional changes, I'm using WAF for building (and deb building), so how can I get mud builder to use WAF? :)

You might not need to use mud-builder to use WAF. As long as you've got a debian/rules file in your tarball which has a number of simple targets (the vala-sample example is pretty minimal ;-)) you should be able to upload the tarball straight to the auto-builder.

Bundyo 2009-06-22 19:53

Re: Vala for Maemo development
 
That overall means that I shouldn't use WAF at all, eh? :) Because if I should have a Makefile and a rules file then I should do all the build config again, only this time through make/dpkg-buildpackage and a lot harder and confusing... :(


All times are GMT. The time now is 09:32.

vBulletin® Version 3.8.8