Hello,
I just joined here today (and just built an Apple1 Replica1 in this weekend, 4 days ago).
I have a question about the BASIC. Is there any compiler for Apple BASIC? If not, I will consider creating it...
Thank you.
Hello,
I just joined here today (and just built an Apple1 Replica1 in this weekend, 4 days ago).
I have a question about the BASIC. Is there any compiler for Apple BASIC? If not, I will consider creating it...
Thank you.
Please support the defense of Ukraine.
Direct or via Unclutter App
No Ads.
No Trackers.
No Social Media.
All Content Locally Hosted.
Built on Free Software.
We have complied with zero government requests for information.
~ Est. 1999 ~
A pillar of corporate stability since the second millenium.
© 1999-2999 Tom Owad
... But the Replica 1 already has BASIC (as it existed on the Apple 1) at E000R. It also has a reportably nice machine language compiler. Detail are available on the manual CD Rom Vince included with you kit.
.... Or do I owe you an apology?
It has a BASIC interpreter, not a compiler. I presume this is what he means.
> Is there any compiler for Apple BASIC?
I don't know.
In your "consideration" of creating an Apple BASIC Compiler, if one does not already exist, I have questions...
What language will you use to create the Apple BASIC Compiler? Will you use Apple BASIC to create the compiler? Once the Apple BASIC Compiler is created will you compile the compiler using the Apple BASIC Compiler? And, then will you then recompile the original compiler using the compiled compiler? And, what type of code will the code generator generate? Will there be a "runtime" included with the executable? Will the executable objects be larger than the original tokenized programs interpreted by Apple BASIC? Will the code be any faster? Will the code appear to run any faster given that the character output on an Apple-1 is usually limited to 60 characters per second?
Thank you, Kallikak.
Yes, what I want to make is compiler. You can create any BASIC code with the ordinally Apple BASIC, debug it by interpreter, and finally compile it. The compiled code runs 100 times faster than the interpreter except for video output.
The premitive version has been written in PHP (as a web apprecation) and compiles PRINT, END, and RETURN statements so far. After completing this web app version, I will convert it to Apple BASIC version (I mean BASIC compiler written in BASIC). don't know how many months I need this...
The compiler can be written in BASIC, and at the first time it can compile itself by BASIC interpreter. So, probably one hour will be required for the first compile. But, once the compiler itself will be compiled, it compile another code faster. (But I will use PHP in the beginning, because it's very hard to use Apple BASIC for such large programs.)
I won't probably use any runtime for the created code.
The executable objects will be probably larger than the source code, but 100 times faster than interpreter, I think.
Unfortunatelly, the speed for outputing characters cannot be faster. There is no way to change the speed by software. You need to change the hardware to do this.
You are welcome, Goddard.
I appliciate you making a web apprecation such as this.
Well, it may be difficult to imagine how the web application compiler works. I just created a demo site of web application version of BASIC compiler. Note that it now just works for PRINT "XXXXX", and RETURN statements. Please use RETURN instead of END if you want to go back to BASIC after executing it.
Use Pom1.1 (thanks Verhill and Ken!), enter "E000R" and make following BASIC program:
10 PRINT "HELLO WORLD!"
20 RETURN
Then save the memory from 0000 to 0FFF as text file, go to:
http://kandk.cafe.coocan.jp/blog/apple1/compiler/
and upload the saved text file. You will get the memory dump containg compiled code. Return to Pom1.1 and load the compiled code, then execute the machine code by entering "CALL 4096". You will see "HELLO WORLD!". I guess we can do the same thing by Replica1 using serial interface.