Future of Gnucash (Javascript?)

Donald Allen donaldcallen at gmail.com
Wed Dec 29 12:12:19 EST 2010


On Wed, Dec 29, 2010 at 11:31 AM, John Ralls <jralls at ceridwen.us> wrote:
>
> On Dec 29, 2010, at 7:18 AM, Donald Allen wrote:
>
>> On Wed, Dec 29, 2010 at 10:00 AM, Anthony Dardis <adardis at gmail.com> wrote:
>>> On Wed, 29 Dec 2010 04:32:44 -0500, Herbert Thoma
>>> <herbert.thoma at iis.fraunhofer.de> wrote:
>>>
>>>> On 28.12.2010 22:35, Christian Stimming wrote:
>>>>>
>>>>> Am Dienstag, 28. Dezember 2010 schrieb Jeff Warnica:
>>>
>>> <snip>
>>>
>>>> I am not that sure that an interpreted language is a good idea. But I am
>>>> an electrical engineer not a computer scientist. So I tend to prefer
>>>> languages that are closer to the hardware ...
>>>>
>>>>  Herbert.
>>>>
>>>
>>> My recent programming experience is a lot of little number-theory puzzles
>>> from the Euler Project, 40 or 50 in Python, the last 10 or so in c. I have
>>> something of the same feeling of wanting to be close to the metal. But I
>>> have to say that Python is a real joy. It is syntactically beautiful. It is
>>> semantically amazingly powerful: all those basic data structure types
>>> (lists, trees, ...) are mostly transparently available (for example: I'm
>>> pretty sure that the set type is implemented as a balanced tree, since
>>> random access is incredibly fast even for sets with millions of members).
>>> Since it encourages functional style programming, it's possible to write
>>> astonishingly elegant code. (Of course, it's also possible not to, but that
>>> goes without saying.) For computation, Python is really really fast: agreed,
>>> the programs I've tried run about 10 times faster in c than in Python, but
>>> on modern hardware we're still talking hundreds of milliseconds. For
>>> GnuCash, computation speed is irrelevant. The GUI will be handled by GTK (or
>>> whatever).
>>>
>>> And coding a solution in Python, I suspect, is always going to be a lot
>>> faster than in c, assuming equivalent levels of experience in both.
>>
>> Amen to everything you've said here. And coding in Python is going to
>> be faster than c++ as well. And finding people who can write good
>> Python is always going to be an easier task than c or c++. Another
>> issue is readability. I would assert that it is far easier to read and
>> understand someone else's Python than someone else's c++, especially a
>> factor in a volunteer project like this one, where people can wander
>> off without jeopardizing their paycheck.
>
> The only advantage that C++ has over Python is that one can mix C and C++ code. That would allow smaller, safer changes as code is reworked. It's only a short-term advantage for all of the reasons Mike gave.
>
> I'm not enthusiastic about using Javascript for the core code (engine, backends, business, etc.) but I think that it makes a lot of sense to make it possible to write reports with Javascript instead of Guile. With the switch to WebKit from Gtkhtml, we have a Javascript interpreter built in and already integrated with the HTML display. Yes, it's a short jump from there to having a Javascript-based web app version of Gnucash.
>
> (I disagree with you about readability, but I like C++ and you don't.)

I think it is possible to write readable code in C++ (and perhaps you
do), and also possible to write unreadable code in Python. But in my
experience, it is far more likely to get readable Python code from
programmers of average skill than is the case with C++.  My point is
that C++ is a tremendously demanding language, perhaps the most
demanding in anything like wide use today. By "demanding", I mean hard
to learn and hard to use well. We live in a time when it is usually
more sensible to optimize the time and effort to obtain good working
code than it is to worry about writing the fastest code. As Anthony
Dardis put it so well, even an order-of-magnitude frequently doesn't
matter, because it can be a difference between a response time of 10
milliseconds vs. 1. This isn't always true, of course, but it's true a
lot more frequently with today's hardware than when I wrote my first
code (50 years ago! On the ever-popular IBM 1620, in assembly
language. I'd have taken C++ over that had it been available :-)

/Don

>
> Regards,
> John Ralls
>
>


More information about the gnucash-devel mailing list