The time now is Sat 18 May 2013, 01:56
All times are UTC - 4 |
|
Page 30 of 35 [514 Posts] |
Goto page: Previous 1, 2, 3, ..., 28, 29, 30, 31, 32, 33, 34, 35 Next |
| Author |
Message |
rarsa

Joined: 29 May 2005 Posts: 3053 Location: Kitchener, Ontario, Canada
|
Posted: Sun 01 Nov 2009, 23:23 Post subject:
|
|
| disciple wrote: | | And how much easier do you think it would be to learn vala than C? | C : Pretty easy to learn, and there are a lot of resources. The problem is that it is not easy to program well. It's very easy to write crappy code that's difficult to understand and maintain.
Vala : Although the language is simple, documentation is still lacking so you must resort to look at examples in other languages to understand how to do some things in Vala. It is easier to write maintainable programs. Vala is a more modern language which takes care of many of C pitfalls (e.g. memory management) but to use it properly you better have an Object Oriented background. (most of the examples I've seen are spaghetti code)
_________________ http://rarsa.blogspot.com Covering my eclectic thoughts
http://www.kwlug.org/blog/48 Covering my Linux How-to
Last edited by rarsa on Sun 01 Nov 2009, 23:39; edited 1 time in total
|
|
Back to top
|
|
 |
rarsa

Joined: 29 May 2005 Posts: 3053 Location: Kitchener, Ontario, Canada
|
Posted: Sun 01 Nov 2009, 23:37 Post subject:
|
|
OK, I'm jumping into the Vala wagon.
I started today with Genie but found several little annoyances which, without proper documentation, gave me a headache.
So I moved to Vala and it just feels natural.
I wrote a little test application that uses Gtk, Glade, and SQLite. Creating multiple windows defined in separate classes and source files. Some of those things are not well documented but I drew from experiences from other languages.
I know I'm at the bottom of the learning curve but I hope to put my new learnings to a good use. (time permitting)
_________________ http://rarsa.blogspot.com Covering my eclectic thoughts
http://www.kwlug.org/blog/48 Covering my Linux How-to
|
|
Back to top
|
|
 |
BarryK
Puppy Master

Joined: 09 May 2005 Posts: 6854 Location: Perth, Western Australia
|
Posted: Mon 02 Nov 2009, 19:13 Post subject:
|
|
rarsa,
Great to "hear" from you again!
Ah yes, I always remember your statement that anything with the name "Basic" in it makes you break out in a rash!
_________________ http://bkhome.org/blog2/
|
|
Back to top
|
|
 |
rarsa

Joined: 29 May 2005 Posts: 3053 Location: Kitchener, Ontario, Canada
|
Posted: Thu 05 Nov 2009, 20:14 Post subject:
|
|
| BarryK wrote: | | Great to "hear" from you again! | Thanks!
| BarryK wrote: | Ah yes, I always remember your statement that anything with the name "Basic" in it makes you break out in a rash!  | Oh, I wouldn't put Genie in the same leage as Basic.
I think it is a nice language which I will surely get into once I get my head around Vala which is better documented.
I am also a python guy so Genie seemed familiar just that I wasted time with some very basic things:
I mixed tabs and spaces and the interpreted got confused until I added the [indent..].
When setting an object method as the event handler I had to do
| Code: | | button.clicked += def () myMethod() |
But if it was a global method
| Code: | | button.clicked += myMethod() |
which wasn't documented anywhere. In Vala the def() is not required.
Most examples use global methods, not classes so it was quite an experience.
So this combined with the indent issue was quite confusing: The myMethod() looked indented as other class methods (4 spaces), but it really wasn't due to using tabs (1 tab) so it was interpreted as a global method outside the class but without visibility to the private members of the class.
enough rambling, I like both languages, I just decided to start with Vala to understand the programing model and then try Genie.
_________________ http://rarsa.blogspot.com Covering my eclectic thoughts
http://www.kwlug.org/blog/48 Covering my Linux How-to
|
|
Back to top
|
|
 |
BarryK
Puppy Master

Joined: 09 May 2005 Posts: 6854 Location: Perth, Western Australia
|
Posted: Fri 06 Nov 2009, 06:43 Post subject:
|
|
Oh, I didn't want to imply that Basic and Genie are in the same league. It is just that my memory was jogged, about the comment you made about "anything with Basic in the name" long ago -- or I think it was you, maybe my memory is faulty.
It is probably unwise to stir up that tabs versus spaces thing again. It is interesting that Jamie decided to use tabs as the default.
Personally, I like tab indents. Very easy to indent consistently, also easy when editing existing text. As long as nobody opens/edits my code in a text editor configured to convert tabs to spaces...
_________________ http://bkhome.org/blog2/
|
|
Back to top
|
|
 |
BarryK
Puppy Master

Joined: 09 May 2005 Posts: 6854 Location: Perth, Western Australia
|
Posted: Fri 06 Nov 2009, 06:49 Post subject:
|
|
Double post
_________________ http://bkhome.org/blog2/
|
|
Back to top
|
|
 |
rarsa

Joined: 29 May 2005 Posts: 3053 Location: Kitchener, Ontario, Canada
|
Posted: Fri 06 Nov 2009, 09:32 Post subject:
|
|
| BarryK wrote: | | "anything with Basic in the name" | Yep, it was me. I'm scratching already.
And no, no intention to stir any debates . Once I understood the [indent=...] things were clear.
Its clearly a matter of preference.
Well, back to Vala/Genie
_________________ http://rarsa.blogspot.com Covering my eclectic thoughts
http://www.kwlug.org/blog/48 Covering my Linux How-to
|
|
Back to top
|
|
 |
gyro
Joined: 28 Oct 2008 Posts: 289 Location: Brisbane, Australia
|
Posted: Mon 16 Nov 2009, 08:53 Post subject:
vala 0.7.8 pet?? |
|
Hi,
Is there a .pet of vala 0.7.8 anywhere?
I wish to install it on pup-431.
There seems to be omissions in Xlib.vapi in vala 0.7.4.
gyro
Edit: It is x11.vapi not Xlib.vapi.
Last edited by gyro on Tue 17 Nov 2009, 03:36; edited 1 time in total
|
|
Back to top
|
|
 |
ttuuxxx

Joined: 05 May 2007 Posts: 10720 Location: Ontario Canada,Sydney Australia
|
Posted: Mon 16 Nov 2009, 10:02 Post subject:
Re: vala 0.7.8 pet?? |
|
| gyro wrote: | Hi,
Is there a .pet of vala 0.7.8 anywhere?
I wish to install it on pup-431.
There seems to be omissions in Xlib.vapi in vala 0.7.4.
gyro |
here try this
ttuuxxx
| Description |
vala-0.7.8-i386|vala|0.7.8-i386||BuildingBlock|6100K|pet_packages-4|vala-0.7.8-i386.pet||vala|puppy|4|official|
|

Download |
| Filename |
vala-0.7.8-i386.pet |
| Filesize |
1.26 MB |
| Downloaded |
498 Time(s) |
_________________ http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games

|
|
Back to top
|
|
 |
gyro
Joined: 28 Oct 2008 Posts: 289 Location: Brisbane, Australia
|
Posted: Tue 17 Nov 2009, 03:34 Post subject:
Re: vala 0.7.8 pet - works |
|
| ttuuxxx wrote: | here try this
ttuuxxx | Thanks
The updated x11.vapi looks good
gyro
Edit: Works fine, thanks ttuuxxx
|
|
Back to top
|
|
 |
tsura
Joined: 01 Dec 2009 Posts: 3
|
Posted: Tue 01 Dec 2009, 04:33 Post subject:
|
|
| disciple wrote: | Hi guys, I haven't really looked at Vala yet, but I'm wondering - does anyone have any idea how hard it would be to convert a simple-ish gtk program from c to vala? And how much easier do you think it would be to learn vala than C? Is Vala:
0. No easier than C
1. A little easier than C
2. Quite a bit easier than C
3. A lot easier than C
4. So much easier than C that there's no comparison.
Any thoughts? |
Hmm. It's a whole lot easier, but I wouldn't say there's no comparison. It has its similarities, but at least you don't have to deal with header files, having to put functions in certain places, funky less-readable syntax and all that other stuff. Plus you get some nice string functions, such as up(), down(), strip() and split() out of the box. Making a GUI in Vala is easy, too, and although there's not a whole lot of extensively commented-on documentation, you can always look at Gtk documentation for other languages and often figure out the Vala method with ease.
I highly recommend learning Vala. It's worth it, I'd say.
Here are some helpful links:
• http://references.valadoc.org/
• http://live.gnome.org/Vala
• http://www.pygtk.org/docs/pygtk/
• etc.
Anyway, other, non-Vala sites on Gtk often give information that the Vala sites don't give, so that's why I list a few others. Even the C documentation on Gtk can be quite helpful, actually. Vala is one of the few languages that seems quite easy to use documentation from other languages with.
I like to ask questions on the programming forum at Ubuntuforums. People don't always answer, but they do often enough that it's worth it.
|
|
Back to top
|
|
 |
ljfr
Joined: 23 Apr 2009 Posts: 176
|
Posted: Mon 01 Feb 2010, 09:28 Post subject:
JWM shortcut manager |
|
Hi,
Note:Some objects of the bellow examples are not freed correctly, some function to do that are missing in the current libxml bindings (reported to gnome bugzilla).
following Caleb72 example, I attached a jwm shortcut manager (similar to the one in jwmconfigmgr) in vala using libxml, using xpath to find desired nodes.
To compile and run it:
| Code: | valac -X -Os --pkg libxml-2.0 --pkg gtk+-2.0 jwmshortcut.vala
strip --strip-unneeded jwmshortcut
./jwmshortcut |
As libxml provide an easy way to handle jwm configuration files, a full jwmconfigmgr in genie/vala might not be so big and ... improved.
Regarding compilation, is there a better way to decrease executable size?
regards,
| Description |
|

Download |
| Filename |
jwmshortcut.tar.gz |
| Filesize |
5.28 KB |
| Downloaded |
381 Time(s) |
Last edited by ljfr on Mon 08 Mar 2010, 07:20; edited 1 time in total
|
|
Back to top
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 3843
|
Posted: Tue 02 Feb 2010, 00:16 Post subject:
|
|
the compile scripts that were packaged with nicoedit first generate the "C" code and then compile it
if you add this after gcc
gcc -Os -fomit-framepointer -momit-leaf-frame-pointer -fmerge-all-constants -march=i486 -mtune=i686 ... rest of stuff
then better stripping
strip --strip-all --remove-section=.comment --remove-section=.note *
_________________ Puppy Web Desktop Now with pet packages - Pet Packaging 100 & 101
|
|
Back to top
|
|
 |
Lobster
Official Crustacean

Joined: 04 May 2005 Posts: 15109 Location: Paradox Realm
|
Posted: Tue 02 Feb 2010, 01:12 Post subject:
|
|
Hi rarsa
This is quite a technical question
- so make the answer fit for an idiot (me)
Is Vala more secure than C?
Or is it how the code is written?
As you know some languages such as javascript are very useful but insecure (so let's base the whole Cloud thing on them )
Is Vala pronounced valour
and suitable for the brave?
_________________ Puppy WIKI
|
|
Back to top
|
|
 |
DMcCunney
Joined: 02 Feb 2009 Posts: 894
|
Posted: Tue 02 Feb 2010, 20:54 Post subject:
|
|
| Lobster wrote: |
Is Vala more secure than C?
Or is it how the code is written?
|
It is always how the code is written.
| Quote: | As you know some languages such as javascript are very useful but insecure (so let's base the whole Cloud thing on them ) |
And your vast knowledge of how insecure JavaScript is comes from where, exactly?
See above about it always being how the code is written.
(And while you're at it, define just what you mean by "security".)
______
Dennis
|
|
Back to top
|
|
 |
|
|
Page 30 of 35 [514 Posts] |
Goto page: Previous 1, 2, 3, ..., 28, 29, 30, 31, 32, 33, 34, 35 Next |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|