IonicWind Software

Aurora Compiler => General Discussion => Topic started by: Ionic Wind Support Team on November 01, 2005, 01:22:58 PM

Title: Design of included libraries
Post by: Ionic Wind Support Team on November 01, 2005, 01:22:58 PM
As we get closer to an alpha release I thought I would mention my design methodology of the Aurora standard libraries.

Aurora itself is a compiler with only 20 or so keywords.  Additional functionality is provided by static libraries of functions.  Much like the C runtime library.  These libraries are included on each build automatically and don't add any code to your executable unless you use any of the included functions.  Actually the compiler scans a directory for '.inc' files and those .inc files has whatever #use statement is necessary to automatically add the static library to the build.  Similar to the Pro compiler include files, but less esoteric.

This was also done for portability.  The "console.lib" library provides a basic set of functions for dealing with shell programs.


cls();
writeln("enter your name >");
name = readln();
writeln("hello " + name + "\n");
writeln("Press any key\n");
while GetKey() = "";


Keeping it simple is key here.   'writeln' for example does just what it implies..writes a string to the console exactly as written.  The problem with a generic PRINT statement is it is up to the designer to guess at all possible forms of output, and how that output shuld be presented.  Formatting output should be the job of more specialized functions like 'using'

writlln(using("###.##\n",myvar));

Which then gives us more control.  Such as when to insert a newline character or not.

All of the Aurora standard library functions follow this methodology.  If there is a function where output, or input, can be represented in multiple forms, then the decision is left up to the programmer, and not the compiler.

Paul.

Title: Re: Design of included libraries
Post by: Steven Picard on November 01, 2005, 02:12:54 PM
I am not sure what kind of string and date functions you plan on having.  One thing I did at work back when I first learned JAVA and JavaScript was to write functions that mimiced VB's.  So I would create MID, LEFT, RIGHT, TRIM, LTRIM, RTRIM, REPLACE, INSTR, DateAdd, DateDiff, etc.  They were very popular and are still used by other programmers to this day (I used the creation of those functions as a learning tool.)  I'd be happy to do the same thing for Aurora and just release it as an .inc file for the benefit of others.
Title: Re: Design of included libraries
Post by: Ionic Wind Support Team on November 01, 2005, 03:12:58 PM
The string library is at least as complete as Pro's.

Still finalizing funciton names.

Paul.