November 08, 2024, 06:11:35 PM

News:

IWBasic runs in Windows 11!


Early alpha release available

Started by Ionic Wind Support Team, November 03, 2005, 11:21:06 PM

Previous topic - Next topic

0 Members and 9 Guests are viewing this topic.

Ionic Wind Support Team

November 03, 2005, 11:21:06 PM Last Edit: May 21, 2011, 04:30:31 PM by LarryMc
The early alpha release is now ready for purchase/download.

Notes:
- It is an alpha so many things are not working yet.
- There are no docs, none whatsoever yet.  
- Look for example programs in your 'examples' directory.  c:\program files\adev\examples

The following function libraries are included:
- console, strings, math, fileio and acommon.  

The GUI library isn't ready yet.  Afterall I am only a few weeks into this project, gotta sleep once in a while.

The IDE is just a rough draft.  It works, you can compile programs, and it uses Scintilla.  A few menu options either won't do anything or won't make sense at this early stage of the project.

I'll list the available functions in the next few posts.


I will be adding it to my ShareIt! account when we get just a bit further along with the main website.

- Ionic Wizard
Ionic Wind Support Team

Ionic Wind Support Team

List of functions in the various libraries.  They are only in upper case because thats the way they are in the include files.  The compiler is case insensitve for functions.

Console functions
CLOSECONSOLE();
CLS();
CONSOLECOLOR(int fg,int bg);
GETKEY(OPT int raw=0),string;
GETKEYSTATE(int num),int;
LOCATE(int y,int x);
OPENCONSOLE();
READLN(),string;
WRITELN(string out);

String funcitons
ASC(string str),unsigned byte;
CHR$(int num),HEAP;
DATE$(OPT string strFormat),HEAP;
GETSTARTPATH(),string;
HEX$(unsigned int64 num),HEAP;
INSTR(string target,string search,OPT unsigned int pos = 1),unsigned int;
LCASE$(string str),HEAP;
LEFT$(string str,int length),HEAP;
LTRIM$(string str),HEAP;
MID$(string str,int start,OPT int count=-1),HEAP;
RIGHT$(string str,int count),HEAP;
RTRIM$(STRING str),HEAP;
SPACE$(int num),HEAP;
STRING$(int num,unsigned byte c),HEAP;
STR$(double num,OPT int prec = 2),HEAP;
TIME$(),HEAP;
UCASE$(STRING str),HEAP;
USING(STRING format,...),STRING;
VAL(STRING str),double;

Math library
ABS(num as double),double;
ACOS(num as double),double;
FACOS(num as float),float;
ACOSD(num as double),double;
FACOSD(num as float),float;
ASIN(num as double),double;
FASIN(num as float),float;
ASIND(num as double),double;
FASIND(num as float),float;
ATAN(num as double),double;
ATAND(num as double),double;
FATAN(num as float),float;
FATAND(num as float),float;
CEIL(num as double),double;
COS(num as double),double;
FCOS(num as FLOAT),float;
COSD(num as double),double;
FCOSD(num as FLOAT),float;
COSH(num as double),double;
FCOSH(num as float),float;
COSHD(num as double),double;
FCOSHD(num as float),float;
EXP(num as double),double;
FLOOR(num as double),double;
LOG(num as double),double;
LOG10(num as double),double;
RND(num as float,opt max=0 as FLOAT),float;
RAND(num as unsigned int,opt max=0 as INT),unsigned int;
SEEDRND(num as int);
SGN(num as double),int;
SIN(num as double),double;
FSIN(num as FLOAT),float;
SIND(num as double),double;
FSIND(num as FLOAT),float;
SINH(num as double),double;
FSINH(num as float),float;
SINHD(num as double),double;
FSINHD(num as float),float;
SQRT(num as double),double;
TAN(num as double),double;
FTAN(num as float),float;
TAND(num as double),double;
FTAND(num as float),float;
TANH(num as double),double;
FTANH(num as float),float;
TANHD(num as double),double;
FTANHD(num as float),float;

File library
OPENFILE(string filename,int mode),unsigned int;
CLOSEFILE(unsigned int file);
COPYFILE(string src,string dest,int bFail),int;
CREATEDIR(string path),int;
DELETEFILE(string name),int;
READ(unsigned int file,pointer buffer,int cread),int;
WRITE(unsigned int file,pointer buffer,int cwrite),int;
SEEK(unsigned int file,OPT position=-1q as INT64),int64;
READSTRING(unsigned int file,string out,int max),int;
FINDOPEN(STRING dir),unsigned int;
FINDNEXT(unsigned int handle,OPT pointer attrib),string;
FINDCLOSE(unsigned int handle);
GETFILELENGTH(unsigned int handle),int64;
FILEREQUEST(title as STRING,parent as unsigned int,nOpen as INT,OPT filter as STRING,OPT ext as STRING,OPT flags as INT,OPT initdir as STRING),HEAP;

For the OpenFile command the possible values for 'mode' are one or more :
MODE_READ
MODE_WRITE
MODE_APPEND
MODE_CREATE

So for example to create a new file and open it for reading/writing the mode would be
MODE_CREATE | MODE_READ | MODE_WRITE

More later...
Ionic Wind Support Team

Doc

 8) 8) Cool!  8) 8)
I've got it installed and have compiled and tested both of the samples. Made a couple of changes to each, then re-compiled...

...everything seems to work exactly as described. Yay!

It's getting pretty late and I do have to go to work in the morning  :P  so I'll likely not be able to do any additonal testing until tomorrow when I get home...

Thanks Paul!

-Doc-

Ionic Wind Support Team

November 03, 2005, 11:53:04 PM #3 Last Edit: November 03, 2005, 11:56:02 PM by Ionic Wizard
Not everything that shows up in blue in the IDE actually does something yet.  Some keywords are just leftovers from the scintilla C lexer I used, and subsequently modified.   In anyevent the following list shows which ones are currently working, or at least are implimented but not fully tested.

Compiler Keywords
and
or
def
if
else
sub
return
do
until
while
goto
declare
import
extern
export
global
const
for
alias
as
struct
select
case
case&
default
not
cdecl
len
va_start

Preprocessor commands
#define
#ifdef
#ifndef
#else
#endif
#typedef
#asm
#endasm
#include
#use

Intrinsic variable types
byte
word
int
float
double
int64
string
dstring
pointer

Integer types are signed by default.  Prefix with 'unsigned' to create an unsigned variable such as:

unsigned int myvariable;

Commonly used types can be made with #typedef For example:
#typedef UINT unsigned int
#typedef CHAR unsigned byte
#typedef UINT64 unsigned int64

String escapes are pretty much the same used in other languages:
\n - newline
\\ - single forward slash
\" - embedded quote
\t - tab character
\xnn - character specified in hex

More later...
Ionic Wind Support Team

Ionic Wind Support Team

November 04, 2005, 12:35:39 AM #4 Last Edit: November 04, 2005, 12:46:57 AM by Ionic Wizard
Another example program for testing. It shows a bit more of the syntax.


//Aurora heapsort demo
//Compile as a CONSOLE target

#typedef CHAR unsigned byte

declare import,GetTickCount(),int;
declare import,GlobalAlloc(unsigned int flags,int size),unsigned int;
declare import,GlobalFree(unsigned int handle);

global sub main()
{
int i;
int a,b;
CHAR display;

int maxsize;
string *testarray;
writeln( "Number of items to sort: ");maxsize = val(readln());
writeln( "Display sorted array (Y/N)?");display = ltrim$(readln());
testarray = GlobalAlloc(0x40,255 * maxsize+1);
writeln( "generating a random array with "+ str$(maxsize,0) + " elements\n" );
//fill an array with random integers -- array generator by David
for i = 1;i< MaxSize+1;i++
{
a = rand(25)+65; 
a$ = chr$(a);
b$ = "";
while len(b$) < (rand(3) + 4)
{
b = rand(25)+97; 
b$ = b$+chr$(b); 

rndStr$ = a$ + b$; 
*(string)(testarray + (i*255)) = rndStr$;

writeln( "Sorting...\n" );
aa = GetTickCount();
hsort(*testarray,maxsize);
bb = GetTickCount();

IF (display = ASC("Y")) | (display = ASC("y"))
{
FOR i = 1;i<maxsize+1;i++
{
IF i = maxsize
writeln( *(string)(testarray + (i*255)) + "\n")
ELSE
writeln( *(string)(testarray + (i*255)) + "," );
}
}
writeln("\n");
writeln("Sorted " + ltrim$(str$(maxsize,0)) + " items in " + ltrim$(str$((bb-aa)/1000.0,4)) + " seconds -------\n");
GlobalFree(testarray);
writeln("Press any key to close this window\n");
while GetKey() = "";
return 0;
}

//-----------------------------------------------
SUB hsort(string A[],int inr)
{
int ix;

//first phase -- build heap
ix=(inr/2);
while (ix >= 1)
{
heapify(A,ix,inr);
ix=ix-1;
}

//second phase -- put largest at end of array,
//use heapify to grab the next remaining largest
ix = inr;
while (ix > 1)
{
swap(A,1,ix);
heapify(A,1,ix-1);
ix=ix-1;
}
return;
}

//-----------------------------------------------
//instill heap condition
SUB heapify(string A[],int hleft,int hright)
{
int ic,ip;
ip = hleft;
ic = 2*ip;;
while (ic <= hright)
{
IF((ic < hright) & (A[ic+1] > A[ic])) ic = ic + 1;
IF (A[ip] < A[ic]) swap(A,ic,ip);
ip = ic;
ic=2*ip;
}
return;
}
//------------------------------------------------
SUB swap(string A[],int ij,int ik)
{
string t;
t=A[ij]; A[ij]=A[ik]; A[ik]=t;
return;
}


Ionic Wind Support Team

Jerry Muelver

Ah! The famous heapsort! Can associative arrays be far behind?  ::)

Doc

QuoteAh! The famous heapsort!
...and a speedy one at that!

On my 1.4Ghz it takes 60,000+ to break the one second barrier. One million sorted at only  23.44+ seconds.

-Doc-

mrainey

On average, how is the speed of an Aurora app expected to compare to one compiled with our "other" favorite language?
Software For Metalworking
http://closetolerancesoftware.com

Steven Picard

I think this is tremendous progress for such an early alpha.

Ionic Wind Support Team

Quote from: mrainey on November 04, 2005, 06:25:48 AM
On average, how is the speed of an Aurora app expected to compare to one compiled with our "other" favorite language?


Just as fast or faster.  Based on the same technology.

Ionic Wind Support Team

Ionic Wind Support Team

Quote from: Jerry Muelver on November 04, 2005, 05:10:33 AM
Ah! The famous heapsort! Can associative arrays be far behind?  ::)

Already on the list Jerry.  There will be a dictionary library by beta time.  Included with the package of course.
Ionic Wind Support Team

Ionic Wind Support Team

Quote from: stevenp on November 04, 2005, 08:06:43 AM
I think this is tremendous progress for such an early alpha.

Thanks.

Couple of weeks, not much sleep, new language ;)  It helps not being tied down to an earlier syntax as well.


Ionic Wind Support Team

Steven Picard

Paul, I think you should increase your alotted sleep time from 1/2 hour a night to 1 hour - for the sake of your health.  :D

I hope your wife is supportive of your new language.  My wife is supporting me for getting my software business going (less than a week and it's public  :)) but at the same time she resents me being on the computer so much.  She knows it can pay off in the end but she also wants my attention (don't blame her.)

Ionic Wind Support Team

Slept alot last night ;)

Just a heads up...there are a few bugs in the parser so if you get it to crash not to worry.  I already know about them.

There are also a few syntax conflicts which I am working to resolve for the next alpha.   Parenthesis are your friend when you run into one.

For example the parser doesn't choose the right path when it encounters this:

IF a > b *string = "hello";

Because it sees the '*' as both a multiplication operator and a pointer dereference operator.  The solution is

IF (a > b) *string  = "hello";

Trying not to force the parenthesis, but might have to.
Ionic Wind Support Team

GWS

I nearly always put a logical test in parentheses now 'cos I've had a few funny results in the past - then you can be sure it will workÂÃ,  :)

So I don't mind brackets in this case - even though it is more typingÂÃ,  ::)

Graham

Tomorrow may be too late ..

mrainey

My attitude about parentheses seem to have become "why use two when eight will do"?  maybe I should look into programming with LISP.
Software For Metalworking
http://closetolerancesoftware.com

Steven Picard

Quote from: GWS on November 04, 2005, 02:37:36 PMSo I don't mind brackets in this case - even though it is more typing  ::)
:D Yup! Two keystrokes extra.

Ionic Wind Support Team

I'll have an update of this alpha later today.  Solved the one crash bug and added some nifty things for testing.

Ionic Wind Support Team

Parker


Ionic Wind Support Team

Thanks,
Email sent with download location and key.

Ionic Wind Support Team

Zen

Hey hey. Money in the pay pal Paul.

Lewis

Zen

I went to bed just after my last post. Got an e-mail alert on my phone just gone 2am in the morning. I coult wait until i woke up in the morning as the excitment was to great.

Lewis

Steven Picard


Zen

Thanks a lot. Now time to get learning...

Lewis