Search found 40 matches

by frank
Sat Mar 05, 2022 10:10 am
Forum: Development
Topic: Stage 96: Shortcut Operators :++ / :--
Replies: 0
Views: 11291

Stage 96: Shortcut Operators :++ / :--

At this stage the operators :++ (increment) and :-- (decrement) were added. These operators always start with a colon to avoid ambiguity. Example of an increment statement: my_value:++; will increment my_value by 1. Some pointer specific built-in procedures accept a trailing increment / decrement op...
by frank
Tue Mar 01, 2022 6:42 pm
Forum: Development
Topic: Stage 94-95: Structures
Replies: 0
Views: 11612

Stage 94-95: Structures

Currently, structures (aka user-defined types) are being implemented. Structures in Sharp BASIC work the same as in most other languages. The following example has been compiled and run successfully. The next step is to implement nested structures. ' SharpBASIC structure 1 ' ---------------------- i...
by frank
Sun Feb 20, 2022 2:39 pm
Forum: Development
Topic: Stage 93: Let's jump!
Replies: 0
Views: 11503

Stage 93: Let's jump!

Sharp BASIC supports jump statements, which would be equivalent to BASIC's goto . However, in Sharp BASIC the keyword for this statement is jump . The statement allows for an immediate jump to a label, but only inside subroutines or functions. Labels start with the symbol @ immediately followed by ...
by frank
Sat Feb 19, 2022 4:22 pm
Forum: Development
Topic: Stage 92: let's concatenate!
Replies: 0
Views: 11611

Stage 92: let's concatenate!

This stage is a major milestone in the development of the Sharp BASIC compiler. After implementing string assignment and passing managed by a reference count system, the final step of string support is concatenation. With assignment and passing in place, this was relatively easy. Example of concaten...
by frank
Tue Feb 15, 2022 9:01 pm
Forum: Development
Topic: Stages 89-91
Replies: 0
Views: 9931

Stages 89-91

These stages were problematic. Due to a change in string reference counting, several string routines in the system library had to be partially rewritten. At the same time, support for the cref (constant reference) parameter qualifier was dropped because of too much complexity at the current stage. R...
by frank
Mon Jan 31, 2022 2:40 pm
Forum: Development
Topic: Stages 87-88 passing parameters
Replies: 0
Views: 10482

Stages 87-88 passing parameters

A lot of testing is currently being done, especially with passing strings to procedures. Sharp BASIC will support four different ways of explicitly passing parameters (default is implicitly by value, except string, array and struc, which are implicitly by reference): ref - explicitly by reference va...
by frank
Sat Jan 15, 2022 12:20 am
Forum: Development
Topic: Stages 81-86
Replies: 0
Views: 11068

Stages 81-86

Adding string support began in November and in the meantime, along the way several string functions have been added. Recently added are ucase (upper case), lcase (lower case), tcase (title case) and strep (string repeat). Also added (primarily for debugging purposes) is the function refc (reference ...
by frank
Sun Jan 02, 2022 6:07 pm
Forum: Development
Topic: Anonymous functions
Replies: 0
Views: 10577

Anonymous functions

Sharp BASIC supports anonymous functions, i.e. functions that do not need an identifier. This is particularly useful for isolating small, unique pieces of code. Anonymous functions have their own scope and cannot see identifiers directly outside their scope. However, identifiers can optionally be p...
by frank
Sat Jan 01, 2022 11:05 pm
Forum: Development
Topic: Stages 79-80
Replies: 0
Views: 10832

Stages 79-80

As reference counting is being implemented (not yet finished), small changes, additions and lots of testing are done. One small addition is the bitwise not operator (~). Sharp BASIC has both logical and bitwise operators. More on this will be added to the documentation soon. The bitwise operators cu...
by frank
Thu Dec 30, 2021 11:31 am
Forum: Development
Topic: Finishing string support: reference counting
Replies: 0
Views: 10308

Finishing string support: reference counting

Finishing string support takes longer due to the implementation of a reference count system, which will use the ownership model similar to what is proposed for the Lobster language . The advantage of this system is that the reference counting is mainly done during compile time, which should take awa...