[comp.sys.apple2] MD Basic and a little hint re rom5 GS

delaneyg@wnre.aecl.ca (Grant Delaney) (03/23/90)

This is a quite interesting interview that was held with morgan davis 
about MD basic on Genie
 ------------------------------------------------

  Apple II Programmers and Developers RoundTable
  ==============================================

        Real Time Conference Transcript
        -------------------------------

 Guest  : Morgan Davis
        : Morgan Davis Group
 Date   : March 12th, 1990

 Copyright 1990 GEnie         All rights reserved
 ------------------------------------------------

<A2PRO.ERIC> I'd like to thank everyone for being here tonight. Our guest is none other than Morgan Davis, of the Morgan Davis Group. Morgan is the author of MD-BASIC, a slick new package that allows you to write code that resembles C, using many features 
that BASIC _doesn't_ normally have... and then turn around and write out regular Applesoft code. But, I'll let Morgan tell you more. :) Without further delay, let me ask Mr. Davis for any opening comments.

<[Morgan] A2PRO.GUEST> Thanks for having me here tonight, Eric. Quickly, here is my life story. I've been programming Apple computers since 1983, and was a co-founder of Living Legends Software. I started my own company last year. I have developed the Mode
mWorks telecommunications language and the ProLine message system. I've also written a lot of PD and shareware stuff over the years. I am also responsible for two IIGS programming books, and author of MouseTalk (from United Software). I've written for A+ (
RIP), and am the moderator for the "Apple II" conference on BIX. Lastly, I'm calling from Beagle Bros from my lonely little cubicle.

<A2PRO.ERIC> Okay... thanks Morgan! I forgot to mention one thing, later in the conference, we're going to have a short (one question) Applesoft quiz. The first person to answer correctly will win a free copy of MD-BASIC from Morgan!

<[ Bryan ] B.PIETRZAK1> First, I really learned a lot from IIGS advanced prog. techniques. Any plans for revised editions? Second, what kind of support does MD-Basic have for variables? Arrays, etc...? And what about extended memory?

<[Morgan] A2PRO.GUEST> If COMPUTE! Publications wants me to revise my books, I'd love to do it. (I'm not here to plug them, but if anyone is interested in what we're talking about, the books are _Mastering the Apple IIGS Toolbox_ and _Advanced Programming 
Techniques for the IIGS Toolbox_.) Now, for the second question. MD-BASIC does some nifty
things with variables. You can use really long and descriptive variables...

<[ Bryan ] B.PIETRZAK1> Yea!

<[Morgan] A2PRO.GUEST> ...in your source code, and MD-BASIC will rename them to shorter ones that Applesoft likes. For example, you can use User_Response$ in your source code, but the MD-BASIC compiler might translate it to something like A$. BTW, that is 
an option -- you don't have to have your variables renamed.

<[ Bryan ] B.PIETRZAK1> Ok...one problem with Applesoft is in the limited amount of memory for variables, like arrays, and so forth. Does MD-BASIC have any support for extended memory? Or is it similar to programming Applesoft? Basically, what are the adva
ntages of MD-BASIC over Applesoft and BASIC.SYSTEM? The editor??!?

<[Morgan] A2PRO.GUEST> Let me take this time to briefly define what MD-BASIC is and is not. First and foremost, MD-BASIC is NOT a IIGS BASIC "compiler". It does not generate IIGS 16-bit applications from source written in BASIC. MD-BASIC is a tool for crea
ting and organizing Applesoft programs. It allows you to create Applesoft programs in structured pseudo-language, with commands for modular programming, #include files for subroutine libraries, constants, and other pre-processing functions and directives. 
It then generates a ProDOS 8 BASIC.SYSTEM executable Applesoft tokenized file. In a sense, it is a translator, and adds nothing to your BAS program that Applesoft would not like.

<[ Bryan ] B.PIETRZAK1> I _like_ the #include capability. Ok, that's what I wanted to know...so, in essence, it just makes it _really_ easy and comfortable to program Applesoft. Ok, last question: how much?

<[Morgan] A2PRO.GUEST> I bet many of you are saying, "okay, so what's so great about it?" The advantage is that it allows you to create programs in structured BASIC with extra goodies like IF-THEN-ELSE, WHILE-WEND, REPEAT-UNTIL, and other such commands tha
t Applesoft does not have. It allows you to use monstrous variable names, and no more line numbers -- you can use labels like: GOSUB Print_Routine. You use ANY text editor or word processor to manage your source code. So far, so good? Here's more: comment 
your code all you want without bloating the programs with massive REM statements that waste memory. The compiler generates the most efficient output for you, renaming long variables to short ones and packing lots of statements on a single line. The output 
it generates is compatible with *ALL* Applesoft utilities, including Alan Bird's Beagle BASIC Compiler, if you really need a TOP SPEED program. The disk comes with
lots of sample programs (useful ones), #include interface files FOR ALL Apple II related coding projects, and (drum roll) a FREE copy of AmperWorks! A major ampersand extension to Applesoft. Okay, the price. Make sure you're sitting down. -> JUST $49.95 <-
 :-) (No steak knives, however.)

<[ Bryan ] B.PIETRZAK1> Well...I had a question about editors, but you answered it! Sounds _really_ neat. Is the compiler an 8-bit or 16-bit program?

<[Morgan] A2PRO.GUEST> The compiler is a 16-bit EXE program that you run from the APW or ORCA/M shell environments. It acts like a real compiler from the shell. You would use it like this: "bc sample.bas". BC is the name of the compiler, and sample.bas wou
ld be the name of a source file. The output would be written to "sample" (or you can tell the compiler where it should compile to).

<[ Bryan ] B.PIETRZAK1> Great!!! I'm really happy to hear that it will mesh with ORCA!

<[Morgan] A2PRO.GUEST> BTW -- everyone stick around to win a FREE copy at the end of the session.

<[Tyler] A2.TYLER> Morgan, welcome back to GEnie, I hope we will be seeing more of you here.

<[Morgan] A2PRO.GUEST> Me, too!

<[Tyler] A2.TYLER> Since I know you are very involved with the industry, I thought I throw some questions at you that might lead to what we might see from your creations in the future.

<[Morgan] A2PRO.GUEST> Fire away.

<[Tyler] A2.TYLER> For instance, do you know of any commercial programs that have been released or will be that have made use of MD-BASIC?

<[Morgan] A2PRO.GUEST> Sure. ProLine. But there are quite a few more. For example, Beagle Bros uses a lot of Applesoft programs with their programs. Since Applesoft compared to something like C or Pascal is a terrible eye-sore, MD-BASIC lets Beagle maintai
n all their BASIC programs in an easy to read format which can be picked up months and years later by other programs to work on. Also, some companies, like HowardSoft, write ENTIRE APPLICATIONS (tax packages) in Applesoft which they must maintain year afte
r year. MD-BASIC is PERFECT for this sort of thing.

<[Tyler] A2.TYLER> Thank you. I have some other questions about the rest of your work, but I will hold off until we conclude the questions on MD-BASIC.

<[Morgan] A2PRO.GUEST> Thanks, Tyler.

<[Nick] N.LENZ> So I guess I'm up, okay...you mentioned that MD-Basic is run as a shell command (bc) does that mean I could use it in an alternative shell environment? i.e ECP or ProSel?

<[Morgan] A2PRO.GUEST> MD-BASIC runs *under* a shell environment -- it isn't one itself. So, no, you couldn't use it in place of ECP or ProSel.

<[Nick] N.LENZ> I meant that, if I didn't have the ORCA or APW shell, will MD-Basic work just as a normal shell command. I can use other shell commands that way.

<[Morgan] A2PRO.GUEST> Ah. Not really. You need a shell command line to specify arguments and flags that the compiler would need.

<[Nick] N.LENZ> But both ECP and the ProSel shell will pass arguments.

<[Morgan] A2PRO.GUEST> Are you talking about ECP-16 and ProSel 16? If they can run EXE type files, and pass arguments like APW does, then it would work.

<[Nick] N.LENZ> Yes, I am... I have ORCA, so it's not that much of an issue, but I'm just curious if it WOULD work. Are you using any shell calls in MD-Basic? That's one of the few things that could cause problems (beside differences in screen output).

<[Morgan] A2PRO.GUEST> Yes. I call INIT_WILDCARD and NEXT_WILDCARD. Oh, and STOP, too.

<[Nick] N.LENZ> Okay. I think ECP supports those, but that leaves ProSel out. Okay, that's all.

<[Morgan] A2PRO.GUEST> Great! Thanks for the info.

<[Eric] E.MERRILL> What's the real advantage of using MD-BASIC as compared to a compiled language?

<[Morgan] A2PRO.GUEST> If you *have* to (or want to, or even LIKE to) write in Applesoft then MD-BASIC is for you. It also allows you to write BASIC programs for *ALL* incarnations of the Apple II with Applesoft in ROM. It definitely is not meant to be in 
any competition with something like Micol or TML BASIC. It is a completely different program.

<[Eric] E.MERRILL> But if a program is being written in Applesoft, what would be the advantage of eliminating all the REM statements, stacking lots of commands on single
lines, etc, except for speed? It seems like it's kind of counter-productive to me. (Don't get me wrong...I understand why some things _have_ to be written in Applesoft.)  :-)

<[Morgan] A2PRO.GUEST> That's easy to answer: MEMORY and SPEED. Ah, but why would it be counter productive? You never have to LIST or look at the raw Applesoft code because you have really PRETTY source code in your text file! Applesoft is ugly. Plain and 
simple. MD-BASIC just gives you the ability to express Applesoft programs in modern-day BASIC format.

<[Eric] E.MERRILL> So basically, it would be great for projects like Apple-Net and Eamon and similar projects where other people might want to modify the code without getting a compiler?

<[Morgan] A2PRO.GUEST> Sure, that's just one reason. There are many others. You know, it just occurred to me that without being able to see what an MD-BASIC source file looks like, you won't really be able to appreciate all that it is and does. I think a D
EMO version of the program and disk is in order for information service distribution. Hmmm?

<A2PRO.ERIC> Morgan, if you can get one to me, I'll be happy to put it in the library here, and it's accompanying source code. (Or you can upload it from your account.)

<[Morgan] A2PRO.GUEST> Great. Will do.

<[ DTS Meanie ] M.DEATHERAGE> Don't wimp out, Morgan: write an MD-BASIC Mandlebrot generator on-line while we watch you! :)

<[Morgan] A2PRO.GUEST> One quick note. This thought is for those of you who have had experience with both Applesoft and high level languages like C and Pascal. If you're like me, Applesoft is frustrating to use because of its arcane limitations on the prog
rammer. You end up fighting with immediate mode (escape key editing? excuse me??), and weirdness with Applesoft's parser, like not being able to use certain variable names like RATE, DIME, TOTAL, etc, because BASIC butchers them into its tokens (R AT E,  D
IM E, TO TAL, and so on). Programmers who have had a taste of C or Pascal must do some work in Applesoft to really appreciate a better environment. One more tolerable. I wish I had it YEARS ago. In fact, it's been a dream for years.

<[Ron L] MICOL.SYSTEM> Hi Morgan...

<[Morgan] A2PRO.GUEST> Hi, Ron!

<[Ron L] MICOL.SYSTEM> I don't know if this is possible but do you think in the future we'll see a way to use Applesoft
from APW? It seems like it would be difficult to do debugging with MD-BASIC when you have to jump from APW (under GS/OS) to BASICSYSTEM (under ProDOS 8) to test the program and back again to make changes.

<[Morgan] A2PRO.GUEST> Being able to use Applesoft from APW would be great for Applesoft. The switching is a pain. I have often thought of writing a 16-bit version of BASIC.SYSTEM and Applesoft interpreter so that you could run the old tokenized BAS progra
ms under a 16-bit environment. The extensibility would be desirable, too. I think GS BASIC portended to do this, but it pretty much flopped.

<[Ron L] MICOL.SYSTEM> It would be great if somebody could just figure out a way to enter Applesoft from APW, without even having to write a 16-bit interpreter.

<[ DTS Meanie ] M.DEATHERAGE> Dave Lyons has written a CDA that allows you to drop into AppleSoft even while under GS/OS. It sets up about a 4K area to play with. It's great fun to type "GHGR" and watch the system die with fatal system error 681 if any hea
rtbeat tasks were in the hi-res space. (That's supposed to be "HGR". Really.)

<[Morgan] A2PRO.GUEST> Matt just leaked about the new "GREAT HGR" mode in the ROM 05 IIGS.

<[Ron L] MICOL.SYSTEM> That would be great! It would be better than Applesoft under APW, it would be Applesoft anytime! But Matt, is it just the basic Applesoft interpreter, or does it include the ProDOS 8 extensions?

<[ DTS Meanie ] M.DEATHERAGE> It's just ROM AppleSoft. Extensions may be unreasonable.

<[Ron L] MICOL.SYSTEM> Ok, thanks Morgan & Matt.

<[Morgan] A2PRO.GUEST> I think the real solution is just to write something for the '816 which can process BAS files.

<[Gee Ess] A2.JERRY> Since I just got my IIgs today, I'm not too familiar with APW/ORCA. Are you saying you can't launch 8-bit programs from APW? Or you can't pass a startup pathname to them? (Stupid question, maybe, but I've got some better ones too.)

<[Morgan] A2PRO.GUEST> You can launch 8-bit SYS files from APW and ORCA/M and ECP-16 and ProSel. Not to worry. Some of the environments allow you to pass a startup name, too.

<[Gee Ess] A2.JERRY> OK, then what's the problem? You could just rename a copy of BASIC.SYSTEM to RUN and then type RUN xxxxxx, right?

<[Morgan] A2PRO.GUEST> (Chuckle) I suppose you could!

<[Gee Ess] A2.JERRY> OK. Sorry for showing my ignorance. (grin) OK, why did you decide to do it as a 16-bit program to begin with? Is it worth the inconvenience? Also, it seems to me you're limiting your market to people who 1) own IIgs computers, and 2) a
re still interested in writing 8-bit Applesoft programs.

<[Morgan] A2PRO.GUEST> It is hard to write a full-fledged high level compiler under an 8-bit processor like the 6502, since you'd have to do the whole thing in assembler. And I'd also have to write an editor to support it, and various file utilities. Perha
ps a whole shell. I didn't see it being worth all that trouble. BC is a 60 block EXE program written in highly optimized APW C. It really does EVERYTHING a real compiler does (conditional compilation, etc.), except doesn't produce processor-executable code