Remove XML files for keywords
Closed, ResolvedPublic

Description

Some backends use XML files to store and load keywords. It is a static content and the XML processing add more dependencies to Cantor (QtXML).

This task is verify if the programming language supported by the backend has some command to print all keywords. Case yes, use it to load the keywords (scilab backend implements this approach). Case not, hard coded the keywords directly in source code to reduce this XML parser dependence.

filipesaraiva renamed this task from Remove the XML files for keywords to Remove XML files for keywords.Jan 7 2017, 2:53 PM
arieder added a subscriber: arieder.Jan 7 2017, 4:24 PM

Hi Filipe,
just a short heads up, we used to have "hard coded keywords", but that lead to some problems if the list was long, most notably the maxima backend ended up literally taking forever to compile on some systems (or more precisely it didn't compile at all; see https://github.com/KDE/cantor/commit/4832ed51197695c34fd2e0516237934d750783f5 for the commit that changed this). Is QtXml relly this big a dependence nowadays?
Getting the keywords on runtime if possible does sound like a great idea though.

asemke added a subscriber: asemke.Jan 7 2017, 6:43 PM

Hi Alexander,

it's not only the dependency on QtXml but also a longer startup since you need to parse that xml file during the startup. The problem with the previous solution in maximakeywords.cpp was probably that you added all the strings in one single statement to QStringList - m_keywords<<"k1"<<"k2"<<... Maybe some compilers have a problem with this. But instead of this one could try to split it into
QStringList m_keywords;
m_keywords << "k1";
m_keywords << "k2";
etc.

If it's QStringList's operator << that causes a problem for the compiler(s) one should use an array of char* maybe. Those keywords are plain latin1 strings anyway....

Hi,
I guess don't know enough to judge where the problems really came from. So go ahead and see how it goes, just keep an eye on compilation times.

Dear @arieder, thank you for your tips. I will consider your advice when I start the work in this task. Please, continue to follow the development of Cantor and let us know if you have more advice or questions. :)

filipesaraiva moved this task from To-Do to Work in Progress on the Cantor board.Jan 29 2017, 1:38 PM
filipesaraiva moved this task from Work in Progress to Done on the Cantor board.Feb 18 2017, 3:55 PM