+Larry #1 Posted November 30, 2006 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 Quote Share this post Link to post Share on other sites
cas #2 Posted November 30, 2006 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 Quote Share this post Link to post Share on other sites
DanBoris #3 Posted November 30, 2006 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 Quote Share this post Link to post Share on other sites
Avram #4 Posted December 3, 2006 What about the compiler that came with Turbo Basic? http://en.wikipedia.org/wiki/Turbo_Basic_XL Quote Share this post Link to post Share on other sites
Gury #5 Posted December 4, 2006 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... Quote Share this post Link to post Share on other sites
+Larry #6 Posted December 13, 2006 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 Quote Share this post Link to post Share on other sites