Jump to content
Sign in to follow this  
Larry

BASIC to ACTION! Translator?

Recommended Posts

I've been thinking of a useful "winter project" for my A8, and this came to mind. The idea would be to allow a well-structured BASIC program to be machine translated into ACTION! format for compiling with a minimum of user intervention/changes. Sort of a BASIC compiler "on steroids." This may lead *nowhere*, but at least in its preliminary stages, it looks feasible. So the first step is to see if it has already been done -- I'm not about to re-invent the wheel. Has anyone seen anything like this or anything even written about such a utility? -Larry

Share this post


Link to post
Share on other sites

I've been thinking of a useful "winter project" for my A8, and this came to mind. The idea would be to allow a well-structured BASIC program to be machine translated into ACTION! format for compiling with a minimum of user intervention/changes. Sort of a BASIC compiler "on steroids." This may lead *nowhere*, but at least in its preliminary stages, it looks feasible. So the first step is to see if it has already been done -- I'm not about to re-invent the wheel. Has anyone seen anything like this or anything even written about such a utility? -Larry

 

I would say 80% of this project is easy, but the remaining 20% can be very hard to implement. Turning interpreted code into compiled code can be hard (calculated gotos, data lines etc)

 

You might want to take a look on existing Basic to /Pascal/C/Java converter available in sourcecode on the Internet (Google).

 

Carsten

Share this post


Link to post
Share on other sites

Yes, untangling the GOTOs in the basic program would probably be the hardest part of the conversion. In some cases the GOTOs could be so tangled up that you would have to manually re-structure the program to get it into the more structured Action language.

 

Dan

 

 

I've been thinking of a useful "winter project" for my A8, and this came to mind. The idea would be to allow a well-structured BASIC program to be machine translated into ACTION! format for compiling with a minimum of user intervention/changes. Sort of a BASIC compiler "on steroids." This may lead *nowhere*, but at least in its preliminary stages, it looks feasible. So the first step is to see if it has already been done -- I'm not about to re-invent the wheel. Has anyone seen anything like this or anything even written about such a utility? -Larry

 

I would say 80% of this project is easy, but the remaining 20% can be very hard to implement. Turning interpreted code into compiled code can be hard (calculated gotos, data lines etc)

 

You might want to take a look on existing Basic to /Pascal/C/Java converter available in sourcecode on the Internet (Google).

 

Carsten

Share this post


Link to post
Share on other sites

It would be better for you to try Turbo BASIC XL first, which has speed advantage against Atari BASIC. Using compiler, as mentioned above, its speed would be taken to the maximum. BASIC to Action! conversion would be hard for such statements like GOTO, because syntax is completely different. Action! is structured, and Turbo BASIC XL is closer to this nature of programming than Atari BASIC. But OSS already prepared core functions and procedures for old BASIC programmers, who have problems to adapt to new style of programming. Nearly every BASIC command has its similar command in Action!: Graphics, Print, Open, Close...

Share this post


Link to post
Share on other sites

It would be better for you to try Turbo BASIC XL first, which has speed advantage against Atari BASIC. Using compiler, as mentioned above, its speed would be taken to the maximum. BASIC to Action! conversion would be hard for such statements like GOTO, because syntax is completely different. Action! is structured, and Turbo BASIC XL is closer to this nature of programming than Atari BASIC. But OSS already prepared core functions and procedures for old BASIC programmers, who have problems to adapt to new style of programming. Nearly every BASIC command has its similar command in Action!: Graphics, Print, Open, Close...

 

I've already started this. It is a BIG project, but it appears that no one has heard of it being done already (or at least no one has indicated that in answer to my original question). While there are obvious difficulties, so far it is going well. As I mentioned in my original post, this translator will require a well-structured Basic program in order to be translated successfully. It will *not* be remotely close to as forgiving/flexible as ABC, etc. The Turbo Basic Compiler is a very fine piece of work, especially since it is now possible to create stand-alone programs, but based on regular benchmarks that I have seen, *IF* a program can be converted to Action! syntax and compiled, it should be significantly faster. The trade-off, of course, is restrictions as to what can be translated. -Larry

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...