[GNC-dev] Starting to work on C++ conversion in xml backend?

2020-11-02 Thread Glenn Serre
Good morning,

My name is Glenn Serre, and I have recently retired from paid software
development work, which I had been doing since near the end of the
last millennium.

I have been using gnucash on Linux for many years and would like to
contribute.  I intend to start by doing some conversion to C++ as that
will help me learn the system, fits well with my experience, and will
incent me to update my C++ skills (yet again).  I have read the C++
wiki page and intend to start with the xml backend.

Initial questions:
Is there a better place to start than the xml backend?
Are we still limiting things to what is supported in C++ 11 and Boost?
Any gotchas, etc. that are not documented in the wiki?

Thanks!
-- Glenn S.
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: [GNC-dev] Starting to work on C++ conversion in xml backend?

2020-11-02 Thread John Ralls



> On Nov 2, 2020, at 9:22 AM, Glenn Serre  wrote:
> 
> Good morning,
> 
> My name is Glenn Serre, and I have recently retired from paid software
> development work, which I had been doing since near the end of the
> last millennium.
> 
> I have been using gnucash on Linux for many years and would like to
> contribute.  I intend to start by doing some conversion to C++ as that
> will help me learn the system, fits well with my experience, and will
> incent me to update my C++ skills (yet again).  I have read the C++
> wiki page and intend to start with the xml backend.
> 
> Initial questions:
> Is there a better place to start than the xml backend?
> Are we still limiting things to what is supported in C++ 11 and Boost?
> Any gotchas, etc. that are not documented in the wiki?


Welcome!

I think you'll learn the Gnucash innards more quickly by taking on some engine 
bugs and rewriting some engine code to C++; that's where the business logic 
lives and it's the key to understanding the spaghetti pot; understanding the 
engine is a necessary prerequisite for understanding the backends. I personally 
find writing tests to be an excellent way of understanding how code works and 
there's plenty of code that isn't well tested.

Regarding the XML backend, the medium-term plan is to convert the XML backend 
from creating engine objects directly to creating an in-memory SQLite3 database 
so that we can replace QOFQuery with SQL queries and towards loading engine 
objects as needed instead of all of them at startup. That plan argues against 
putting much effort into a straight functional rewrite.

As for C++, we're up to C++17 now for new work. We do still want to limit 
external dependencies to Boost (although we've decided on Googletest instead of 
Boost::testing for the unit test framework). That doesn't mean that something 
else is off limits if there's a really compelling case for it, but you would 
need to make that case.

Undocumented gotchas? You bet, including plenty of what Rumsfield famously 
named "unknown unknowns". Gnucash spaghetti has been cooking for 23 years now, 
it's thoroughly tangled!

BTW, consider connecting on the IRC channel as a more conversational and 
(depending on your timezone) immediate channel for discussing code. 
https://wiki.gnucash.org/wiki/IRC

Regards,
John Ralls

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: [GNC-dev] Starting to work on C++ conversion in xml backend?

2020-11-02 Thread Glenn Serre
Good afternoon,

On Mon, Nov 2, 2020 at 11:56 AM John Ralls  wrote:
>
>
>
> > On Nov 2, 2020, at 9:22 AM, Glenn Serre  wrote:
> >
> > Good morning,
> >
> > My name is Glenn Serre, and I have recently retired from paid software
> > development work, which I had been doing since near the end of the
> > last millennium.
> >
> > I have been using gnucash on Linux for many years and would like to
> > contribute.  I intend to start by doing some conversion to C++ as that
> > will help me learn the system, fits well with my experience, and will
> > incent me to update my C++ skills (yet again).  I have read the C++
> > wiki page and intend to start with the xml backend.
> >
> > Initial questions:
> > Is there a better place to start than the xml backend?
> > Are we still limiting things to what is supported in C++ 11 and Boost?
> > Any gotchas, etc. that are not documented in the wiki?
>
>
> Welcome!
>
> I think you'll learn the Gnucash innards more quickly by taking on some 
> engine bugs and rewriting some engine code to C++; that's where the business 
> logic lives and it's the key to understanding the spaghetti pot; 
> understanding the engine is a necessary prerequisite for understanding the 
> backends. I personally find writing tests to be an excellent way of 
> understanding how code works and there's plenty of code that isn't well 
> tested.
>
> Regarding the XML backend, the medium-term plan is to convert the XML backend 
> from creating engine objects directly to creating an in-memory SQLite3 
> database so that we can replace QOFQuery with SQL queries and towards loading 
> engine objects as needed instead of all of them at startup. That plan argues 
> against putting much effort into a straight functional rewrite.
>

OK.  I will look at libgnucash/engine C files and engine bugs.

> As for C++, we're up to C++17 now for new work. We do still want to limit 
> external dependencies to Boost (although we've decided on Googletest instead 
> of Boost::testing for the unit test framework). That doesn't mean that 
> something else is off limits if there's a really compelling case for it, but 
> you would need to make that case.
>

OK.  I would not expect to be arguing for additional dependencies
(fewer is better) and certainly not in the near term.

> Undocumented gotchas? You bet, including plenty of what Rumsfield famously 
> named "unknown unknowns". Gnucash spaghetti has been cooking for 23 years 
> now, it's thoroughly tangled!
>
> BTW, consider connecting on the IRC channel as a more conversational and 
> (depending on your timezone) immediate channel for discussing code. 
> https://wiki.gnucash.org/wiki/IRC

Done, but I expect to be just lurking for a while.

Thanks!
-- Glenn S.

>
> Regards,
> John Ralls
>
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: [GNC-dev] Starting to work on C++ conversion in xml backend?

2020-11-02 Thread John Ralls



> On Nov 2, 2020, at 10:43 AM, Glenn Serre  wrote:
> 
> Done, but I expect to be just lurking for a while.

At least say hi so we can connect the handle to the name...

Regards,
John Ralls

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


[GNC-dev] Finance::Quote approaching 1.50 release - some API changes for GnuCash to consider

2020-11-02 Thread Vincent Lucarelli
Dear GnuCash Developers,

It has been a slow effort, but we are finally approaching a 1.50 Finance::Quote 
release.

First, the intent is to maintain backwards compatibility, so if nothing changes 
in GnuCash, users should still be able to fetch quotes.

There are two new features that GnuCash could expose to users:

1. Module specific options 
2. Multiple sources for currency conversion rates

Both features are documented in the README at 
https://github.com/finance-quote/finance-quote 


Instead of adding a new environment variable for each module that requires an 
API key, Finance::Quote->new now takes a configuration hash:

$q = Finance::Quote->new('IEXCloud’, iexcloud => {API_KEY => ‘pk_0...'});
%quotes = $q->iexcloud(@symbols);

AlphaVantage will still use an environment variable, but the intent going 
forward is to limit environment variables.


Previously, currency conversion was handled only by AlphaVantage and required 
an API key.  We have added the European Central Bank as one key-free source 
(but it is limited) and several other sources with API keys that avoid the 
AlphaVantage throttling.

 $q = Finance::Quote->new('currency_rates' => {order => ['ECB', 'Fixer'],
 fixer => {API_KEY => ‘0…'}});


I thought a bit about how GnuCash might expose this to users, but we haven’t 
finalized 1.50 yet so there is still time for change.


Best,

Vince

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel