Re: [Ql-Users] sBASIC overloading...

2018-06-20 Thread Dave Park via Ql-Users
My reason for asking was, I was wondering if an analysis of how frequently
functions were called, and from where, could affect how quickly they would
be stepped to. I have seen this behavior in SuperBASIC on JM/JS and
achieved often useful gains in improvements by placing the most frequently
called functions at the beginning or the program.

I was wondering if this was still true with the BASIC on SMSQ/Minerva.

That let to the overloading question, which would allow the collapsing of
many functions into a single function using polymorphism.

On Wed, Jun 20, 2018 at 5:10 PM, Jan Bredenbeek via Ql-Users <
ql-users@lists.q-v-d.com> wrote:

> On 20 June 2018 at 22:35, Dave Park via Ql-Users  >
> wrote:
>
> > Hi all,
> >
> > Separately, does the sBASIC in SMSQ or Minerva still scan for
> > procedures/functions from the beginning of the program, so earlier
> FN/PROCs
> > have a speed advantage over later ones like in JM/JS?
>
>
> SuperBASIC (JM/JS/Minerva) stores line numbers along with proc/fn names in
> the name table and can search backward and forward for them in the program.
> So it merely depends on how far away the proc/fn definition is from the
> calling code in terms of lines.
> I don't know how SBASIC handles this but as it is said to be more a
> compiler than an interpreter it could be very well different (the most
> efficient way would of course be to store addresses rather than line
> numbers but this could break if the program is changed and then
> CONTINUEd/RETRYd).
>
> Jan.
>
> --
> *Jan Bredenbeek* | Hilversum, NL | j...@bredenbeek.net
> ___
> QL-Users Mailing List
>



-- 
Dave Park
d...@sinclairql.com
___
QL-Users Mailing List


Re: [Ql-Users] sBASIC overloading...

2018-06-20 Thread Jan Bredenbeek via Ql-Users
On 20 June 2018 at 22:35, Dave Park via Ql-Users 
wrote:

> Hi all,
>
> Separately, does the sBASIC in SMSQ or Minerva still scan for
> procedures/functions from the beginning of the program, so earlier FN/PROCs
> have a speed advantage over later ones like in JM/JS?


SuperBASIC (JM/JS/Minerva) stores line numbers along with proc/fn names in
the name table and can search backward and forward for them in the program.
So it merely depends on how far away the proc/fn definition is from the
calling code in terms of lines.
I don't know how SBASIC handles this but as it is said to be more a
compiler than an interpreter it could be very well different (the most
efficient way would of course be to store addresses rather than line
numbers but this could break if the program is changed and then
CONTINUEd/RETRYd).

Jan.

-- 
*Jan Bredenbeek* | Hilversum, NL | j...@bredenbeek.net
___
QL-Users Mailing List


[Ql-Users] sBASIC overloading...

2018-06-20 Thread Dave Park via Ql-Users
Hi all,

How hard would it be to extend sBASIC functions to support C++ style
overloading?

Separately, does the sBASIC in SMSQ or Minerva still scan for
procedures/functions from the beginning of the program, so earlier FN/PROCs
have a speed advantage over later ones like in JM/JS?


-- 
Dave Park
d...@sinclairql.com
___
QL-Users Mailing List