Re: [Gimp-developer] Example: Vala as code generator

2011-05-03 Thread Martin Nordholts
2011/5/3 Simon Budig si...@budig.de:
 Martin Nordholts (ense...@gmail.com) wrote:
 I'm trying hard to find time hacking on GIMP, and not having to waste
 time on GObject C boiler plate means a lot to me. At first I was
 thinking what the hell, I'll just come up with the the damn
 boilerplate code manually then. But right after I began doing that I
 started to feel like I was wasting my time, and I can't stand that
 feeling.

 Hm. This paragraphs leaves me a bit perplexed, because it gives the
 impression that the most important thing about including vala is to make
 you more comfortable with our codebase. You blame mitch for a blunt
 dismissal, but this reads a lot like bluntly forcing down something
 through mitchs throat. Not sure if that is any better.

You are right, that isn't any better. I should just give up on these
patches, I clearly don't have the support for them I hoped for.

Obviously, in my opinion we increase the quality of our codebase by
using Vala for this helper class mostly because the number of readable
and documented version controlled lines of code is less than if we
would also version control the GObject C boiler plate. That is not the
only measurement of code quality however and we are simply weighting
the pros and cons differently.

 / Martin


-- 

My GIMP Blog:
http://www.chromecode.com/
GIMP 2.8 schedule on tasktaste.com
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] Example: Vala as code generator

2011-05-02 Thread Michael Natterer
On Sun, 2011-05-01 at 17:15 +0200, ense...@gmail.com wrote:
 Hi all,
 
 We have discussed the possibility to use Vala as a code
 generator. What follows is a set of patches so we all can see what
 that would look like. Any objections to me pushing these commits?

Yes, and I'm currently on vacation and can't respond in detail,
but IIRC I have made myself very clear about vala.

 I want a helper class in the implementation of single-window mode
 session management, and this is in my opinion a perfect example of
 when to use Vala: a small utility class at the bottom of the
 architecture with only GLib as a dependency.
 
 These patches do not add any additional tarball build time
 dependencies, valac is only required when building from git.
 
  / Martin
 
 


___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] Example: Vala as code generator

2011-05-02 Thread Nicolas Robidoux
The following statement of Mich's unfortunately describes most of
nowadays C.S. students [1]

  And this is *exactly* the problem. We would end up with programmers
  that quickly learnt vala, having no clue about GObject. That's
  absolutely horrible. Just like the people who only know how
  to write java or #C code. They know how to use all the fancy
  classes, but they have never implemented a list or anything
  lowlevel themselves. I don't want people who know vala, but
  don't had to learn GObject.

One way of viewing the issue is:

Do you want to cater to the programmers you want, or the programmers you have?
(With the hope of turning the latter into the former.)

Nicolas Robidoux

[1] 
research.cs.queensu.ca/~cisc422/2010f/readings/papers/whereAreTheSoftwareEngineersOfTomorrow.pdf
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] Example: Vala as code generator

2011-05-02 Thread Christopher Curtis
On Mon, May 2, 2011 at 9:15 AM, Nicolas Robidoux nicolas.robid...@gmail.com
 wrote:

One way of viewing the issue is:

 Do you want to cater to the programmers you want, or the programmers you
 have?
 (With the hope of turning the latter into the former.)


It's worse than that, even.  This is a perpetual argument.

People were railing against C in the 70s because people who weren't
programming in assembler weren't intimate with the stack, heap, or
registers.  They hated the subroutine call inefficiency.  They hated losing
the ability to dynamically change executing code, or freely use instructions
as data.

Software development - all engineering, really - is about trades.  C imposed
a base level of inefficiency for a higher level of productivity.

Today, C is a hindrance to even greater productivity (GObject itself is
evidence of this).  It's less useful to know how to write a hash table
interface with its own unique API than it is to know how or when to use one.
 If a hash table is part of the language, then it becomes the One True
Implementation and Everybody knows it and uses it, and does so
mostly-correctly.

FWIW, to me, Vala seems like a reasonable choice for GObject based systems.
 I don't think it's going to expand the developer base now because Vala
prefers an understanding of GObject, which is little used outside OSS
systems.  The syntax should be familiar to C/C++/C# users, but the trade
here is for productivity.

While another language (C++, C# or Java) may have more developers, that
language would require an object system be built around GObject, which just
raises the question: Why not Vala?  One would assume that a stable Vala
compiler exists or is currently stable enough to use on all target
platforms.

Chris
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] Example: Vala as code generator

2011-05-02 Thread Martin Nordholts
2011/5/2 Michael Natterer mi...@gimp.org:
 On Sun, 2011-05-01 at 17:15 +0200, ense...@gmail.com wrote:
 Hi all,

 We have discussed the possibility to use Vala as a code
 generator. What follows is a set of patches so we all can see what
 that would look like. Any objections to me pushing these commits?

 Yes, and I'm currently on vacation and can't respond in detail,
 but IIRC I have made myself very clear about vala.

Hi Michael,

I'm trying hard to find time hacking on GIMP, and not having to waste
time on GObject C boiler plate means a lot to me. At first I was
thinking what the hell, I'll just come up with the the damn
boilerplate code manually then. But right after I began doing that I
started to feel like I was wasting my time, and I can't stand that
feeling. I find your blunt dismissal of these two patches really
discouraging. Can't we at least push them to master and have them in
for a while and see if we can discover some real problems? If it
really doesn't work out, we can just reformat the generated .h and .c
files and discard the .vala file.

If you are on vacation and don't have time to properly review or test
these patches, please take your time to do so. I'm not going to push
these patches without your OK, and if you're busy for a few weeks,
then I'll have to wait. I can work on other items on the GIMP 2.8
schedule in the meantime...

Regards,
Martin


-- 

My GIMP Blog:
http://www.chromecode.com/
GIMP 2.8 schedule on tasktaste.com
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] Example: Vala as code generator

2011-05-02 Thread Simon Budig
Martin Nordholts (ense...@gmail.com) wrote:
 I'm trying hard to find time hacking on GIMP, and not having to waste
 time on GObject C boiler plate means a lot to me. At first I was
 thinking what the hell, I'll just come up with the the damn
 boilerplate code manually then. But right after I began doing that I
 started to feel like I was wasting my time, and I can't stand that
 feeling.

Hm. This paragraphs leaves me a bit perplexed, because it gives the
impression that the most important thing about including vala is to make
you more comfortable with our codebase. You blame mitch for a blunt
dismissal, but this reads a lot like bluntly forcing down something
through mitchs throat. Not sure if that is any better.

I must say that - while I have my share of frustrations with the gobject
boilerplate code - I don't think that adding vala helps the quality of
the Gimp codebase. And this is IMHO what should be in our focus.

From reading a lot of code in a lot of different free software projects
I have to say, that Gimp still is one of the shining examples regarding
consistency and quality of the source code. This has a lot to do with
mainly Sven and Mitch investing countless hours into refactoring and
restructuring the code, enforcing a common code structure and generally
fighting against sloppiness.

I don't see how mixing this code with code written in a new language
will help the quality of the source. Vala code will inherently develop a
set of patterns that differs from the C code (and don't underestimate
the value of grepping through the code base). Also new contributors will
not only have to learn about GObject and GTK+, they have to learn vala
as well. And adding vala *is* adding a new entry barrier, vala is by no
means a lingua franca.

Bye,
Simon

-- 
  si...@budig.de  http://simon.budig.de/
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer