Page 1 of 1

Stages 0125 - 0131: Reals, Arrays, etc...

Posted: Fri May 23, 2025 6:32 am
by frank
Due to lack of time, it's been two years since the last update on the compiler.

At this stage the left, mid and right string functions have been improved and optimized. Traditional BASIC functions MKx and CVx have been added: cvd, cvi, cvl, cvs, mkd, mki, mkl, mks.

Basic support for real numbers (real4, real8) has been added, including conversion from number to string.

The keyword LOCAL has been added, initially only to prevent unnecessary exposure of identifiers in the library. If a header or include file is pulled in as global or extern, the local keyword will override the scope:

Code: Select all

' pulled in as a global / extern header file
global is
  ' ...
  ' exclude helper routines from global access
  local decl is
     sub _sb_cstrd_get(_high:uint32, _low:uint32, _daddr:ptr);
     sub _sb_cstrs_get(_value:real32, _daddr:ptr);
  end

end
Consistently, the keywords global, extern and local remain flexible, like global is... end, global decl is .. end

Added cdecl and pdecl keywords to support calling external C and Pascal routines.

Added experimental optimization (level 1) to see its place and impact on the compiler.

Changed keyword WHEN (statement) to BY and OTHER to ANY.

Focus is currently on adding array support and finishing structures. When these features are implemented, it should be possible for the compiler to become independent (no external libraries) and self-hosting. Several features will benefit from the compiler being self hosting due to SharpBASIC's flexible low-level capabilities, in particular block types (previously buffer types).