TURBO parameter names

Anything QL Software or Programming Related.
User avatar
tofro
Font of All Knowledge
Posts: 2686
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: TURBO parameter names

Post by tofro »

pjw wrote: Steve, I dont understand why Turbo has these limitations. QLiberator can use the full 32k indices, memory permitting, that the interpreter allows. Still, there are times when you need more than 32k items in an array, so your project will be useful even when you dont use Turbo.
Per
Turbo can very well handle the full signed word (i.e. 32767) index size - The only thing that needs to be done is adapting the dataspace size (obviously). I guess that was Steve's omission.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
stevepoole
Super Gold Card
Posts: 712
Joined: Mon Nov 24, 2014 2:03 pm

Re: TURBO parameter names

Post by stevepoole »

Hi tofro,
On the Turbo front_screen, you can set the Data size to 9999ko before calling CHARGE. (The DATA_AREA command is limited to 850ko). I have no idea what size DATASPACE_TASK can handle, as I don't have a working copy of it available yet.
George Gwilt reports that Turbo can't handle very big arrays because of the way the internal stacks move up and down...
The new MATRIX$(x,y) function will be printed in the next Quanta issue. It can access 10,000,000 floating point cells depending on the ammount of memory your computer can access, using ALLOCATION or ALCHP. I will try the program on a 10gig PC soon...
Steve.


EmmBee
Trump Card
Posts: 240
Joined: Fri Jan 13, 2012 5:29 pm
Location: Kent

Re: TURBO parameter names

Post by EmmBee »

Hi Per,

Do you know that LINK_LOAD can be used to share arrays between Turbo tasks? Link_load is used to start the tasks running. The GLOBAL and EXTERNAL directives are used within each module to declare what is to be shared. This is not only for arrays; tasks can also share variables, procedures and functions. There is a rule imposed for arrays such that they can only be re-dimensioned by the module in which they are declared GLOBAL.

Another idea is to use Steve’s Matrix$ combined with the use of environment variables.

Michael


User avatar
pjw
QL Wafer Drive
Posts: 1286
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: TURBO parameter names

Post by pjw »

Gents,

If its true that Turbo limits the size of arrays to the program's data space, that seems very inefficient. A program will then always devour the max memory, defined at compile time, whether its needed or not*. This cant be correct, surely?

QLib allocates space for arrays on the common heap, I believe, as large arrays dont require extra data space. I cant confirm at this moment that this dynamical allocation works in reverse, ie that memory first allocated to a large array will be released again if the array is re-dimensioned to a smaller size, which would seem the natural requirement.

*It may be that LINK_LOAD resolves, or works around, the memory problem, with the extra mess and effort that involves.

This has always been the great divide between Turbo and QLib: Speed versus compatibility.

Since I already own QLib, and am deeply committed, due to the tools I find useful and the toolkits I have developed, Ill stick with it for now. Speed is not critical for most GUIs and the like - ease of use and compatibility are more important. Where theres a requirement to shuffle around a lot of data, such as moving, sorting and searching, it is usually possible to revert to assembler.

If one doesnt have QLib, or is just starting out with QL compilers, or one's requirements are for speed-critical code that doesnt lend itself to assembler, Turbo is the obvious choice. However, ultimately it was due to Turbo's handling of arrays (as it was some 25 or more years ago) that forced me to abandon it in favour of, as I thought at the time, the inferior competition. Sadly, not enough has changed in that respect to tempt me back again for anything Im working on, or even dreaming of, at the moment.

Apologies for the voluminous verbiage. Even so I feel I havent done justice to all the comments and suggestions given, for which too I apologise :)

Per


Per
dont be happy. worry
- ?
Post Reply