All pastes #89588 Raw Edit

Someone

public text v1 · immutable
#89588 ·published 2006-07-16 20:05 UTC
rendered paste body
Jul 16 17:16:58 <herzi> juergbi: geiles zeug euer vala
Jul 16 17:18:09 <juergbi>       herzi: thx, ist noch ziemlich lustig, damit zu programmieren :)
Jul 16 17:19:02 <herzi> juergbi: wie mache ich denn api-bindings für meine c-sachen?
Jul 16 17:19:33 <juergbi>       herzi: gobject-basierte oder andere?
Jul 16 17:21:47 <herzi> gobject
Jul 16 17:22:21 <herzi> (ich will ja nicht auf mein canvas verzichten)
Jul 16 17:22:28 <juergbi>       da kannst du einfach das public interface der klassen in vala-syntax deklarieren
Jul 16 17:22:45 <juergbi>       bei methoden ersetzt du den body einfach durch nen semikolon
Jul 16 17:23:16 <juergbi>       und beim namespace und/oder der klasse kannst du mit hilfe eines attributs angeben, welche(s) header file(s) benötigt werden
Jul 16 17:23:48 <juergbi>       hm, ich sehe gerade, dass das gtk beispiel ja gar nicht am tarball ist, grml
Jul 16 17:24:36 <juergbi>       herzi: siehe z.b. hier http://paldo.org/vala/gtk+-2.0.vala
Jul 16 17:32:38 <herzi> cool, ich glaub damit spiele ich die tage mal rum
Jul 16 17:33:29 <juergbi>       yep, bin offen für feedback, ist noch nichts fixiert


Jul 16 18:52:28 <juergbi>       pvanhoof: i've released vala 0.0.1 :) http://www.paldo.org/vala/
Jul 16 18:52:40 <pvanhoof>      juergbi, interesting. I will take a look :)
Jul 16 18:52:41 <wasabi_>       I see the value of gnome in the software the community around it produces, not in the blessing of certain applications.
Jul 16 18:52:48 <desrt> juergbi; diff gob vala?
Jul 16 18:53:06 <hub>   juergbi: if I understand you want vala to be for Gtk what Moc is to Qt?
Jul 16 18:53:09 <hub>   :-)
Jul 16 18:53:14 <gicmo> juergbi: /me looks 8-)
Jul 16 18:53:26 <juergbi>       desrt: vala actually compiles code, not just declarations
Jul 16 18:53:43 <pvanhoof>      juergbi, cooooooowll
Jul 16 18:53:45 <desrt> so it's closer to say, ghc
Jul 16 18:53:48 <jdub>  juergbi: what's your "how vala is different to gob" answer? :)
Jul 16 18:53:52 <desrt> a compiler that just happens to use C code generation as a backend
Jul 16 18:54:29 <juergbi>       all the same. moc and gob don't interpret the actual code, only declarations
Jul 16 18:54:32 <pvanhoof>      juergbi, will it use gcc (and can it therefore compile to for example ARM?)
Jul 16 18:54:44 <pvanhoof>      I should read
Jul 16 18:54:59 <gicmo> juergbi: WOW! .. vala rocks!
Jul 16 18:55:01 <juergbi>       it doesn't invoke gcc by itself but you can compile the generated source files with gcc, of course
Jul 16 18:55:01 <pvanhoof>      nah, I'm just going to check out the subversion
Jul 16 18:55:03 <hub>   juergbi: moc generate code too
Jul 16 18:55:06 <desrt> juergbi; i recommend a "why this is better than gob" section on the page since i think just about everyone will ask :)
Jul 16 18:55:17 <pvanhoof>      juergbi, so it generates .S files?
Jul 16 18:55:23 <desrt> pvanhoof; no.  .c
Jul 16 18:55:25 <juergbi>       pvanhoof: no, .c and .h
Jul 16 18:55:28 <pvanhoof>      aha I see
Jul 16 18:55:50 <pvanhoof>      how will that work with gdb?
Jul 16 18:55:53 <juergbi>       hub: yes, moc generates code but it only looks at declarations in the source files. vala compiles the whole code
Jul 16 18:55:55 <desrt> generics!  whee
Jul 16 18:56:25 *       desrt imagines genericified GList and wonders if it's even worth binding a linked list library rather than just reimplementing it
Jul 16 18:56:27 <juergbi>       pvanhoof: it's planned to add line nr mappings (#file, #line) and somewhen maybe a graphical frontend ;)
Jul 16 18:57:00 <pvanhoof>      ok
Jul 16 18:57:03 <desrt> juergbi; just as a metric of how close to C you are.... is it possible to give vala an input which will cause it to output a non-valid C program?
Jul 16 18:57:17 <juergbi>       desrt: at the moment, yes but that are bugs
Jul 16 18:58:32 <desrt> is it more like "compiler gets insanely confused and does very weird stuff" or more like "it doesn't do as much consistency checking as it should"?
Jul 16 18:59:13 <jdub>  desrt: something that would be cool -> gobjectified glib
Jul 16 18:59:29 <desrt> like lists that are gobjects?
Jul 16 18:59:30 <juergbi>       desrt: the latter
Jul 16 18:59:31 <pvanhoof>      libcrack? :)
Jul 16 18:59:46 <jdub>  desrt: hopefully all primitives and collections
Jul 16 18:59:53 <pvanhoof>      jdub, Robot101, me and robtaylor have been discussing exactly that under the name libcrack :)
Jul 16 19:00:06 <pvanhoof>      or libglib-crack or :)
Jul 16 19:00:23 <jdub>  pvanhoof: oh cool - that discussion at fosdem got me thinking about it pretty regularly
Jul 16 19:00:32 <desrt> jdub; overhead and can you tell me a reason that i might want to subclass a hash table?
Jul 16 19:00:48 <jdub>  always with the subclassing
Jul 16 19:01:09 <desrt> ok.  fine.  tell me a reason that a hash table might throw a signal or want virtual methods defined on itself?
Jul 16 19:01:13 <pvanhoof>      libcrack would mostly be interfaces .. and maybe a few implementations that could be subclassed
Jul 16 19:01:29 <jdub>  ^ desrt
Jul 16 19:01:42 <desrt> hm
Jul 16 19:02:04 <desrt> ContainerInterface implemented by (lists, hashes, trees, etc)
Jul 16 19:02:17 <desrt> add, remove, search, whatever
Jul 16 19:02:19 <jdub>  imagine a glist object that you could use as a model for a treeview
Jul 16 19:02:30 <pvanhoof>      oh, I already have that jdub  :)
Jul 16 19:02:33 <jdub>  and do mvc with a glist model
Jul 16 19:02:41 <pvanhoof>      check out TnyListIface in tinymail
Jul 16 19:02:42 <desrt> ya.  that would be nice
Jul 16 19:02:51 <jdub>  imagine it bound, so you could diddle with it
Jul 16 19:02:59 <pvanhoof>      and how I implemented a TnyMsgHeaderListModel by implementing both TnyListIface and GtkTreeModelIface
Jul 16 19:03:01 <desrt> the almost complete lack of implementors of GtkTreeModel is sort of annoying
Jul 16 19:03:07 <jdub>  imagine grabbing sets of gconf attributes as a glist
Jul 16 19:03:31 <juergbi>       pvanhoof: i'd definitively help with something like libcrack but i'd prefer writing it in vala :)
Jul 16 19:03:36 <jdub>  (look to xcode, objc for lots of examples where we could be doing excellent shit)
Jul 16 19:03:46 <pvanhoof>      juergbi, yeah I might actually agree with you on that
Jul 16 19:04:03 <pvanhoof>      we should definitely talk about it. With Robot101 , robtaylor , me etc etc ..
Jul 16 19:04:24 <jdub>  desrt: imagine the simple gnome-vfs api being a standardised model you could attach to a treeview
Jul 16 19:04:25 <pvanhoof>      I'm just not yet saying: indeed. I really have to in-depth check vala out first

Jul 16 18:57:02 <gicmo> Alter, du bist mein persoenlicher Held des tages
Jul 16 18:57:44 <juergbi>       hehe, mal schauen, wie es allgemein so ankommt :)
Jul 16 18:57:53 <gicmo> Bei mir: Gut
Jul 16 19:00:32 *       gicmo hat mal vala compiled
Jul 16 19:00:34 <gicmo> *rumspiel*
Jul 16 19:00:39 <gicmo> Das muss ins gnome cvs
Jul 16 19:00:41 <gicmo> ;-D
Jul 16 19:01:03 <juergbi>       werd ich wohl beantragen, aber erst nachdem svn-umstellung erfolgt ist....
Jul 16 19:01:39 <gicmo> da braucht man nicht viel beantragen .. einfach importieren!
Jul 16 19:02:08 <juergbi>       spätestens bei svn wohl nicht mehr... modul creation geht nicht mit normalem account, afaik
Jul 16 19:02:21 <juergbi>       und zuerst in cvs umwandeln will ich jetzt nicht. repo auf paldo.org ist ja problemlos erreichbar
Jul 16 19:03:47 <gicmo> error: glib-2.0 not found in specified Vala API directories
Jul 16 19:03:48 <gicmo> ?
Jul 16 19:04:02 <gicmo> ahh axo
Jul 16 19:04:03 <gicmo> :)
Jul 16 19:04:03 <juergbi>       If you install in a prefix different from /usr and /usr/local, you currently have to specify the path to the VAPI bindings on the command line, i.e.
Jul 16 19:04:03 <juergbi>       valac --vapidir $PREFIX/share/vala/vapi SOURCES...
Jul 16 19:04:07 <juergbi>       ;)
Jul 16 19:04:13 <gicmo> axo
Jul 16 19:04:15 <gicmo> RTFM
Jul 16 19:04:26 <juergbi>       gibt im moment nichts, was defines ersetzen würde, deshalb einfach mal hardcoded
Jul 16 19:04:39 <juergbi>       werd das dann schon mal besser lösen
Jul 16 19:05:14 <gicmo> kewl
Jul 16 19:05:57 <gicmo> Ich hab das sample c&p'ed und er gibt 2 errors
Jul 16 19:06:10 <gicmo> foo.vala:8.4-8.9: error: The name `stdout' does not exist in the context of `Sample.run
Jul 16 19:06:19 <juergbi>       oh, da fehlt ne zeile im sample
Jul 16 19:06:22 <juergbi>       *schäm*
Jul 16 19:06:30 <juergbi>       füg noch "using GLib;" zuoberst ein
Jul 16 19:06:37 <gicmo> hehe
Jul 16 19:09:12 <gicmo> DUDE, alle Dateien die das erzeugt haben (c) auf DICH
Jul 16 19:09:19 <gicmo> Jetzt verstehe ich das! :-D
Jul 16 19:10:32 <juergbi>       hehe, ne, das ist ein bekannter bug, nimmt den filecomment vom glib-2.0.vala oder anderem vapi file, falls im source code kein comment drin ist
Jul 16 19:11:11 <juergbi>       so, sample gleich korrigiert ;)
Jul 16 19:11:40 <gicmo> (self->priv->_name == NULL ? NULL : (self->priv->_name = (g_free (self->priv->_name), NULL)));
Jul 16 19:11:43 <gicmo> aehh!
Jul 16 19:11:52 <juergbi>       ich habe nicht behauptet, dass der code perfekt lesbar ist ;)
Jul 16 19:11:53 <gicmo> g_free kannst auch auf NULL machen 
Jul 16 19:12:06 <juergbi>       ja, weiss schon, aber g_object_unref nicht und das wird ähnlich generiert :)
Jul 16 19:12:10 <gicmo> Sehr geil, trotzdem, sehr geil
Jul 16 19:12:19 <juergbi>       thx