[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Interest in GS Applesoft compiler?
Nathan Mates (nathan@cco.caltech.edu) wrote:
> I haven't written a compiler yet. Utilities, games, screen savers, the
> like, yes. A compiler, no. Maybe I'm just a little deluded, but I've
> been thinking for quite some time (almost 8 months) that a GS
> Applesoft compiler would be a neat thing to have. Mostly, it's because
> I like those old Eamon adventures occasionally, and would love to get
> a bunch running on the GS. If you have a compiler & disk i/o manager,
> you could convert a ProDOS adventure over in less than an hour.
I have also thought about this project, a little. Before, though, I
didn't have the expertise for it. Now, though, I'm taking a compiler
class, and one result is that I'm starting to see how this might work.
> Since other projects I keep on various burners (Swatdisk, psieve)
> have mostly been completed, the Asoft compiler has reached the
> advanced vaporware stage, and I might start coding rsn. This would be
> a fairly brain-dead compiler, no optimizations or anything else that
> suck a lot of time and effort to make things not work right. (I'm not
> just talking about Orca/*; I work with grad turkeys hacking compilers,
> and took part of a compiler class here).
This sounds reasonable. Add anything like this later... it's hard enough
to get it working in the first place.
> Since I don't want to deal with building OMF stuff, and I don't
> mind a little extra stange for now, I envision my compiler generating
> an assembly file of the compiled code (which is easier to debug), and
> then executable could be built by assembling that and linking in a set
> of runtime stuff written in c/pascal/asm. This will likely make the
> executable much bigger than the equivalent basic program, but it
> should run _much_ faster. :)
> Here are a few issues that sorta crossed my mind while thinking
> about it:
> - 40/80 Text, Lores/Double Lores- trivial with my really fast text
> i/o routines, but that would toast over GNO compatability. The sticky
> part about GNO/etc compatability is that there doesn't seem to be
> an easy way to read the cursor position. [Say you HTAB #5. Texttools
> wants you to give an X and Y position; you need a Y position before
> you can go anywhere]
Well, if you assume that the program is the only thing that's writing to
the screen, you could just store the x and y position for yourself...
maybe someone else knows how to access this info? maybe just write i/o as
general libraries and then call the libraries--then, if you figure out
what's happening, GNO compatible versions can be generated.
> - Hires stuff. Emulate over to Shires? Shapes will definitely be very
> far back onthe burner :)
> - Peek, Poke, call. Only allow a few known ones.
> - FP math. Use Asoft's internal routines (faster, but maybe harder
> to use), or SANE?
> - Debugger. Talk to Mike Hackett for info.
> - Basic.System emulation. The worst part. Some commands like "PR#6"
> should obviously not be allowed. But, if any disk i/o is to be allowed,
> then all sorts of stuff like OPEN, READ, WRITE, CLOSE will have to be
> emulated. BLOAD/BSAVE will be much harder to do, esp. for pictures,
> shape tables, and the like.
One possibility--a binary page?
BLOAD and BSAVE load/save stuff into the binary page which is different
than the 64K area of code for the compiled program. Then, you can
implement CALL for "real", and CALL 768 might work, with some rewriting.
However, as I think about this more, this sounds like a big pain. It
would let people implement GS programs with sections written in
Applesoft, but other than that, it's not so good.
One question: Were you thinking about taking Applesoft program (type
BAS) files as input, or text file "printouts" of the Applesoft program as
input? I was thinking that the first option might make some things
easier (you might not have to generate as much of a grammar for Applesoft?)
> Since I've thought about it for so long, it should be ovbious that
> I'll actually be starting this. Not too sure why I'm posting all this
> gunk; maybe it's because I want some guage of opinion before I start
> or something. Beta copies would be at least a month or few down the
> road, I think; I'd have to get this somewhat useful (starting would
> probably be integer only, no arrays, 80-col text) before I let this
> out.
Hey... I hope you succeed. This sounds cool.
> Nathan Mates
> --
> <*> Nathan Mates http://www.ugcs.caltech.edu/~nathan/ <*>
> # And he said to them, "To you has been given the secret of the
> # Kingdom of God, but for those outside, everything comes in
> # parables" Mark 4:11, NRSV
--
Bryan K. Ogawa Computer Science & Engineering, UCLA II Infinitum <><