Author |
Topic: Dolphin: Syntax and Commands? (Read 144 times) |
|
Bill Williams
Administrator
    
member is offline



Gender: 
Posts: 160
|
 |
Re: Syntax and Commands?
« Reply #1 on: May 11th, 2007, 5:51pm » |
|
Syntax is basically identical to that for LB, with a few exceptions:
* Numeric variables are postfixed with % (like QBASIC) * 'ENDIF' is used instead of 'END IF', due to laziness on my part  * Most functions and some numeric operators are unsupported * String manipulation uses the ampersand instead of the plus sign.
As far as commands, I've implemented about all of LB's console functionality (except PRINT USING), and added the "COLOR" command, which sets the foreground and background color. DIM isn't supported, since arrays aren't supported either, and variables are implicitly dimensioned.
Also, I've completely implemented support for IF/THEN/ELSE/ENDIF blocks, including single-line blocks. FOR/NEXT loops are implemented, but not very well. I had to rewrite many things internally to get it to work, and I still haven't made it work. I'm doing work on other parts of it right now, like the IDE, command-line parser, and source analyzer. Once these changes are done, I can back-port it into the main codebase and really get cooking.
In the future, I'd like to add support for more operators (MOD, AND, OR, and the like), improve the function library, and add support for windowing. You should see how I plan to do it... it's pretty awesome.
|
|
Logged
|
- Bill Williams
|
|
|
JosephE
Member
 
member is offline


Gender: 
Posts: 18
|
 |
Re: Syntax and Commands?
« Reply #2 on: Aug 12th, 2007, 7:16pm » |
|
Wow. Why not make it as identical to LB as possible? It would be cool to have LB compile itself, or sort of...that's confusing... If that's not your vision for this project, then just ingnore this...
|
|
Logged
|
|
|
|
Bill Williams
Administrator
    
member is offline



Gender: 
Posts: 160
|
 |
Re: Syntax and Commands?
« Reply #3 on: Aug 17th, 2007, 7:11pm » |
|
on Aug 12th, 2007, 7:16pm, JosephE wrote:| Wow. Why not make it as identical to LB as possible? It would be cool to have LB compile itself, or sort of...that's confusing... If that's not your vision for this project, then just ingnore this... |
|
It'd be very interesting to have an open version of LB that could self-compile. I've re-worked some of the lower level parsing routines, so that sort of thing is actually possible.
The main problem with that is not the parsing, though.... it's implementing the back-end. Callbacks and DLL calls would be espescially difficult. Something that wouldn't be as difficult would be writing a pre-processor to add define and include functionality, and perhaps even pile new commands atop the language.
My eventual goal for this product is to provide a sucessor in spirit to LB. Cross-platform is a noble goal, but Windows is it right now, whether for better or for worse. Investing in cross-platform, instead of beefing up the features on one platform, is, IMO, a bad move.
BASIC was designed to sheild the user from the OS. So why are API calls used so often in LB? Because batteries are not included. We have to call APIs to make common controls like progressbars and sliders, not to mention treeviews and listviews. I'm sorry, but that's not shielding, that's a lack of investment.
So, in short, my goal with Dolphin is to create the BASIC equivalent of an SUV: Powerful enough to do big things, but also easy enough to do small things. Is that to much to ask from your programming language? I think not.
(This post is entirely my personal opinion - LB is still a great language, and I'm not giving up on it; I just think things can be done better.)
|
|
Logged
|
- Bill Williams
|
|
|
JosephE
Member
 
member is offline


Gender: 
Posts: 18
|
 |
Re: Syntax and Commands?
« Reply #4 on: Aug 21st, 2007, 10:54pm » |
|
Cool, I understand what you're doing now.
|
|
Logged
|
|
|
|
Yamato
Member
    
member is offline


Gender: 
Posts: 112
|
 |
Re: Dolphin: Syntax and Commands?
« Reply #5 on: Mar 23rd, 2008, 2:15pm » |
|
(Sorry if I'm not allowed to respond to REALLLY old threads).
I've tried something like: "BASIC was designed to sheild the user from the OS. So why are API calls used so often in LB? Because batteries are not included. We have to call APIs to make common controls like progressbars and sliders, not to mention treeviews and listviews. I'm sorry, but that's not shielding, that's a lack of investment."
It was called Simplicty BASIC, and I tried to make the syntax as close to LB as possible (except for those dreaded API calls...) For example to place a web browser control into your app you'd use the "WEBBROWSER" command, like you do with "BUTTON" and the like in LB. I was hoping to make a language that was syntax compatible with LB, but never had to use API calls. But I kinda lost interest in it. I don't even think I have the source anymore.
Hmm... I don't have much to do with my time. Why don't I start coding it again?
|
|
Logged
|
I LOL at AOL!
|
|
|
|