Weather / Spam / www |
Lyon Weather
aldweb against spam
|
|
|
|
|
|
|
- Forum - iziBasic
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257
Topic # 1241 |
iziBasic missing features |
07/08/2005 @ 15:49 by Guido Ostkamp
|
Hello,
I was recently looking around for a simple programming language on the Palm and came to know 'iziBasic'.
I was really impressed about the quality of the documentation and that is is a real compiler ... until I found some problems:
- There appears to be only 1 (!) numeric and 1 string array.
Each basic dialect which I am aware of (and I started with TRS80 Level II basic back in the late 70's) has been able to 'dim' any variable as an array of strings or numbers mostly in at least 2 dimensions until running out of memory.
Why is this not possible in iziBasic?
And then the strange mapping of A(1) to A, A(2) to B etc. Never seen this before. Everyone needs a loop counter for iterating over array elements. And if I use the usual variables, 'i', 'j', 'k' etc. I will not be able to use A(1)...A(n) at the same time. Weird.
- Strings can only hold 63 characters. What's that, we have plenty of RAM (several MB free) and I can't have a string with at least the number of characters of a full line (80 chars)? I know of MegaString, but that's only one string variable.
There should be no such limitation.
- Less important, but also missing is a kind of grid form item (with or w/o scrollbars) to display data.
Maybe the author of 'iziBasic' can shed some light on these points.
I would definitely like to see an update that fixes them.
Regards,
Guido |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 1 -------- 07/08/2005 @ 22:48 by aldweb
visitor |
Hello Guido,
First, let me precise that iziBasic is not a "real" compiler. It compiles the code to some intermediate code which will then be executed in a virtual machine.
Yes, there is only 1 numeric array and 1 string array in iziBasic.
I can give you an example of one device which addresses/maps its memory with arrays in a very similar way to the one used in iziBasic, look here: http://www.aldweb.com/articles.php?lng=en&pg=26 Same thing with this one here: http://www.aldweb.com/articles.php?lng=en&pg=27 Having been a BASIC developer since ages, just like you I liked this feature a lot and I knew right from the beginning of the iziBasic project that I would implement something similar.
The use of the A() and A$() arrays are indeed quite unusual in iziBasic. The very smart and original point is that they allow to address all of the numeric and string stacks. The counterpart is indeed that their index manipulation is a little bit more difficult.
There are the first step towards other arrays DIMensinoning which I have somewhere in my to do list. They are not implemented yet, because [whatever explanation you wish] and also because I just believed they were other more important things to implement first.
You maybe have MB of RAM free, depending on your device you maybe also have MB of DYNAMIC RAM free or maybe just a few KB instead. So, when designing iziBasic, I had to deal with some compromises to have its virtual machine run in an old Palm OS 3.x device or a newer 5.x one. 64 characters strings was a decision I made (including CHR$(0) final character, so 63 chars max) at that time. 128 characters strings would have provided half the number of strings to the developers... I am currently studying how to have iziBasic be more flexible in this area without slowing it down too much...
About the grid form object, please see my answer to the following thread: Topic #1240 - Palm Tables
Cheers
@+ aldweb |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 2 -------- 08/08/2005 @ 22:30 by Guido Ostkamp
visitor |
Hello Laurent (or aldweb),
thanks for your answer.
You said:
"The counterpart is indeed that their index manipulation is a little bit more difficult."
Yes and without at least more dim-able variables you still have the problems of overwriting the normal variables.
I wanted to have a short program for maintaining my working times that would need a structure like this:
dim work_begin(365) dim work_end(365) dim work_time(365) dim lunch_time(365) dim daily_diff(365) dim balance(365)
which would probably use up to 9-18k depending on whether int's or float's are used internally.
It turned out to be impossible to do in iziBasic. With the trial version I cannot dimension a numeric array larger than 247 elements. So this little program
'test.ibas {CreatorID "HELO"} {Version "2.0"} DIM A(248) BEGIN PRINT "Hello" EN
doesn't work. It raises a 'syntax error' in Palm OS5.2 Simulator. On the real machine I got similar results or something like 'number stack exceeded' depending on the number used - the behaviour changed with increasing numbers to 'syntax error'. The simulator had 16 MB RAM configured, my real system a T2, even more.
Even if I get through (with highest possible number), then, on execution a "number stack overflow" is generated.
So, I cannot even have 250 simple elements in an array?
This appears very limited to me. Why not let the user decide how many space he wants to assign to which stack?
I wonder whether there is a difference between the trial version (which I used) and the registered one.
There is a competitors product (I will not mention the name here to stay fair) which is an entirely Palm based Basic interpreter, which deals with my initially above mentioned script without any problems (it also supports the long variable names, btw.). I'm telling you only so that you know there is work left to get on par in this area.
By the way:
When starting iziBasic in the Simulator, I get several errors:
- form.c line 1767, Object #1019 in form #1000 is missing - form.c line 1767, Object #1018 in form #1000 is missing - form.c line 1767, Object #1014 in form #1000 is missing - form.c line 1767, Object #1013 in form #1000 is missing
If I choose 'continue' I finally get through, but it doesn't sound ok. This should be fixed.
Regards,
Guido |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 3 -------- 08/08/2005 @ 23:46 by aldweb
visitor |
Hello Guido,
Palm programming should not be considered as PC programming, even today with the new devices full of memory that are less and less a PDA and more and more a small PC!
There are indeed several technical limitations/considerations to have in mind when programming on a Palm device:
One is that a memory segment is 64 KB (minus a few bytes for the OS purposes) maximum. So, in a 64 KB segment, you may put up to roughly 16000 real numbers, up to roughly 1000 strings of 64 characters or 500 strings of 128 characters (I chose fixed size strings to ease the pointing of those variables in iziBasic's virtual machine). iziBasic deals with the available memory on the different devices and with a limited number of stack segments. I could have linked several segments for numbers/strings storage but this would have been extra & difficult work... The demo version of iziBasic is limited to a single partial segment which lets it work without any trouble on a Palm OS 3.0 device. The difference between full and trial versions is explained in the user manual, look for the MINOSVERSION compiling directive (Your request for 6x365=2190 numbers storage would be covered in the full version ).
Another consideration is that database accesses are very fast because the data memory storage is in RAM not on a hard drive or some other slow access peripheral (that was one of the surprises with the new LifeDrive from Palm...).
Having these 2 facts in mind, Palm developers usually try to minimize the "dynamic memory" usage and to work on pieces of data at one time, not on the whole data. By the way, this is one of the exciting aspects on programming on this platform Then, your example should typically be coded using a database on a Palm device. With a pointer (the given day of the year) to scan/update the right days in the database.
I have no trouble with competition, all development tools have their pros and cons. Developing an interpreter is just a little bit easier than developing a compiler I set the priorities in the GUI part for iziBasic. As time goes on, and as I find some free time to dedicate to this hobby project, I will try to improve different areas, among which those you cleverly highlighted. But, this should not stop you from "thrifty coding"
About the errors you report in the Simulator, I am very surprised because I test all versions of iziBasic in the Simulator, especially when working on tough parts of the source code when I get a lot of crashes And I never got these errors for these objects. So, thank you for the information, I will try to change some parameters in the Simulator to check.
Cheers
@+ aldweb |
|
|
topic active
topic closed
Sticky
New message -
Correct message
Close topic
Make sticky
|
|
|
|
|
|