Jump to content

BASIC 2? Why not get BASIC 7?


Recommended Posts

1 hour ago, paulscottrobson said:

Even if you can just write GOSUB update.display or something it improves readability of GOSUB 7730 so much it beggars belief.

It is a massive improvement in self-documenting code.  When I see

gosub {:display.update}

I know that not only is the display going to update, but that the subroutine can be found in the file module-display.list.

Edited by rje
Link to comment
Share on other sites

32 minutes ago, rje said:

It is a massive improvement in self-documenting code.  When I see


gosub {:display.update}

I know that not only is the display going to update, but that the subroutine can be found in the file module-display.list.

The problem with it is if you just crossdev you get away from the original point of the design - I thought - to replicate the learning environment we had on our Spectrums/C64/BBC Micros etc without the downsides (mostly storage before disk drives). You might as well design a console type design.

  • Like 1
Link to comment
Share on other sites

7 hours ago, paulscottrobson said:

The problem with it is if you just crossdev you get away from the original point of the design - I thought - to replicate the learning environment we had on our Spectrums/C64/BBC Micros etc without the downsides (mostly storage before disk drives). You might as well design a console type design.

To quote the great philosopher, The Dude, "That's just like, your opinion, man." 🙂

Cross-dev has been a thing for a long time.  Lots of MS-DOS dev work was reportedly done on UNIX until DOS was self hosting (was it *ever* self hosting?).  Quite often, initial development of new systems is done on the previous generation using simulators of the new components until the design is ready to be sent off for the next level of prototyping.

Yeah, a lot of dev work was done on the real hardware, but a lot of it was done on bigger/other systems and maybe only the fit, finish, and polish done closer to it being ready to release.

In any case, I see this transpiler being a modern & updated version of how I wrote stuff on the C-64 back in the 80s, start on paper with a general design/flow, maybe a few lines of hand-written code in a notebook, maybe even whole programs written out in long hand while away from the keyboard, surrounded by reference books.  Type it in, some parts work, some parts don't.  Looking at the code on the screen, we only had 40 columns and 25 lines, the program was probably longer than that, possibly much longer, and if it was in BASIC, no back-scroll, so, either LIST and hold down CTRL to slow down the output until you see what you're looking for and try and hit RUN/STOP before it scrolls past, or look at in chunks with LIST 100-200, nope, not there, LIST 200-300, ad nauseam.  Oh it might be in this chunk, or the chunk it calls, or somewhere inbetween. Print it out on the tractor feed dot-matrix, back to working with a pile of paper, your pencil, and the reference material.

Ah, the good ole days.

Here, instead of a bunch of paper and a pencil, you're getting closer to the code in a text-editor.  Working like this, your transpiled code might get you close enough to done that you do your final work on the end system and possibly back-port those fixes to the transpiler format for future versions/improvements.

Writing a transpiler/compiler is cool, and not a small task.  It requires knowledge of not only the target language and all of its idiosyncrasies, but of the language(s) you're writing the transpiler in.

Cross-dev doesn't magically make the target system do things it can't otherwise do, we're still dealing with the limitations of the target (hell, even the limitations of the system you're doing the dev work on, compilers/transpilers/etc aren't perfect either).

The only wrong way to do it is the way that doesn't work.

  • Like 3
Link to comment
Share on other sites

I don't have a problem with cross development, and I wrote a transpiler professionally thirty years ago (which could do way more complex things and had to generated readable editable code) for exactly the same reasons. Difficult to measure the exact speed up, but on a similar project French colleagues were doing 2 reports a day and I could do one in about half an hour :)

Cross development on an X16 is entirely sensible for the same reasons that it was when people were developing professionally for C64s and Sinclair Spectrums, after the first year or so, anyway. I've written a couple of X16 compilers which I'm not happy with for various reasons, mostly connected with having to downgrade the compiler to fit the system.

My 'opinion' is that almost nobody at all will program the system in any other way. I'm not actually convinced anyone will program it at all like the old cross dev systems where there was a physical download connection. I think they'll develop it on the emulator, and occasionally run it on the system.

  • Like 2
Link to comment
Share on other sites

7 hours ago, paulscottrobson said:

My 'opinion' is that almost nobody at all will program the system in any other way. I'm not actually convinced anyone will program it at all like the old cross dev systems where there was a physical download connection. I think they'll develop it on the emulator, and occasionally run it on the system.

That is a valid point.  And while I'm a HUGE fan of this project, and will probably buy one, honestly, I'm not sure how much I'll actually use it.  I've never been a huge video game player.  Over the years, I've built a collection of lots of games for most of the systems I've owned over the years, but only a handful of them ever got played repeatedly, and a small subset of them got any regular play. My Steam library has close to 300 games in it, mostly stuff I bought as part of HumbleBundle "Support the independent developers bundles," a few I bought individually from the Steam store directly, but I have only played less than a dozen of them, and maybe half of them repeatedly.

As it is, I'll have to do some re-arranging of stuff on my desk to even make room for a new system.

This is one of the reasons I like the MiSTer setup, it's small and doesn't take up a lot of room on my desk.  If it didn't have networking and required that I pull the SDdard out to change the contents, it would probably get less use than it does. If they ever get tun/tap or even SLiRP networking working to the point that we can use the networking from the running cores, I might use it even more.

Similarly, If the X-16 winds up with some sort of networking, or even a usable rs232 serial port that I can hang off the back of my Linux box, and can use a terminal emulator to connect to remote systems and do file transfers with, it will improve the odds of me using it more.

Even before I saw his channel, I had often fantasised about having a mini retro-computing museum in my house similar to Perifractic's.  Maybe once all the kids are grown and have moved out I can set it up in one of their rooms, though I'm not sure my wife would be as understanding as Ladyfractic. :)

  • Like 2
Link to comment
Share on other sites

The fact that this CPU and The Vera board are so powerful and widely used means that there's a host of honest practical applications for this computer for any enthusiast. I don't plan on replacing OpenOffice on my desktop, but I could see - for FUN - writing code or notepad style documents on my X-16 and using a SD card to ferry files to my desktop. Or - sometime in the future - using whatever might be cooked up to replace the old C64 modems (and some nice software) to use the modern internet to send myself some files.

That is what I would want as a user - a retrocomputer I could use for some set of practical purposes. Something that isn't just a nostalgic toy for an aging millennial.

As a programmer and game developer, I really just want some sort of functionality close to something like SmileBASIC, perhaps with a bit of careful thought about optimization or feature-usage. Any efforts to allow users to easily use the larger memory and banking/swapping system is a worthy endeavor, otherwise I imagine myself starting a github and asking for help and maybe providing a lot of free coffee to helpful souls.

For all those involved - please keep working hard, and keep aiming at continuous improvement.

 

  • Like 1
Link to comment
Share on other sites

3 hours ago, Starsickle said:

The fact that this CPU and The Vera board are so powerful and widely used means that there's a host of honest practical applications for this computer for any enthusiast. I don't plan on replacing OpenOffice on my desktop, but I could see - for FUN - writing code or notepad style documents on my X-16 and using a SD card to ferry files to my desktop. Or - sometime in the future - using whatever might be cooked up to replace the old C64 modems (and some nice software) to use the modern internet to send myself some files.

That is what I would want as a user - a retrocomputer I could use for some set of practical purposes. Something that isn't just a nostalgic toy for an aging millennial.

As a programmer and game developer, I really just want some sort of functionality close to something like SmileBASIC, perhaps with a bit of careful thought about optimization or feature-usage. Any efforts to allow users to easily use the larger memory and banking/swapping system is a worthy endeavor, otherwise I imagine myself starting a github and asking for help and maybe providing a lot of free coffee to helpful souls.

For all those involved - please keep working hard, and keep aiming at continuous improvement.

 

If someone showed up with a better BASIC interpreter that worked on 6502 and was willing to adapt it to the Commander X16, I bet David would be willing to listen. The problem is that there don't seem to be any suitable BASIC interpreters out there, which is why they went to the effort to license the ROM from Cloanto. 

Personally, I would like to see BBC BASIC running on the Commander. But, like other BASIC interpreters, it does not currently exist for 6502 under an open source license. 

 

Link to comment
Share on other sites

On 2/11/2021 at 7:14 AM, Cyber said:

It was not a question of money. X16 hardware is based on VIC-20, and BASIC V2 is designed to run on this hardware. BASIC 7 was designed to run on different hardware, and to run BASIC 7 on X16 would mean to rewrite a lot of source code of BASIC 7. On the other hand BASIC 2 runs on X16 with minimal source code changes.

So to save time and resources X16 team decided to start with using BASIC 2, planning to add new commands later (which they already partially did). Depending on the user demand, BASIC functionality might grow to the one similar in version 7 or version 10 or whatever.

BASIC V2 allowed X16 to have a fast project start and stable run, allowing team to concentrate on other more important features.

MS BASIC, almost all of them, is designed to run on any 6502 hardware. There is almost no hardware specific stuff.

Link to comment
Share on other sites

8 hours ago, TomXP411 said:

If someone showed up with a better BASIC interpreter that worked on 6502 and was willing to adapt it to the Commander X16, I bet David would be willing to listen. The problem is that there don't seem to be any suitable BASIC interpreters out there, which is why they went to the effort to license the ROM from Cloanto. 

Personally, I would like to see BBC BASIC running on the Commander. But, like other BASIC interpreters, it does not currently exist for 6502 under an open source license. 

 

It would take about a week's work to write one.  This one for example https://github.com/paulscottrobson/atomic-basic is an extended version of the Atom BASIC ; 32 bit integer only with 'C' style strings, so it's a bit experimental (it was meant to be), but it has a working interpreter with a built in 65C02 assembler, an idea I've always liked.  No list or tokeniser yet, but that's straightforward (there's a Python script that tokenises it and then the run time takes over).

Of course you could build a pick and mix easily enough, where different bits could be added or removed as you wanted, so for example have no floats or strings or whatever, different keywords for different systems.

Then you can just add bits as you want ; interface to the X16 Kernel routines for drawing, some SPRITE commands, that sort of thing.  You do run out of spaces, though there are paging ways round that it's a bit messy.

  • Like 1
Link to comment
Share on other sites

15 hours ago, paulscottrobson said:

MS BASIC, almost all of them, is designed to run on any 6502 hardware. There is almost no hardware specific stuff.

You are missing other hardware like video, audio, I/O, which is different in every other system.

Link to comment
Share on other sites

6 hours ago, Cyber said:

You are missing other hardware like video, audio, I/O, which is different in every other system.

No, they aren't. There's character out, character in, possibly a seperate line in, and save and load files (and sometimes streams of data). The vast majority of the code is the same. MS Basic does not normally have features for manipulating those in any manner whatsoever.

Link to comment
Share on other sites

2 hours ago, paulscottrobson said:

No, they aren't. There's character out, character in, possibly a seperate line in, and save and load files (and sometimes streams of data). The vast majority of the code is the same. MS Basic does not normally have features for manipulating those in any manner whatsoever.

But the point was made about Basic 7, which has it's memory banking operation directly reflecting Commodore 128 memory banking, its music keywords directly reflecting the SID chip and it's graphical keywords assuming the available C128 graphical displays. The last code delivery CBM took from MS was MS Basic v2 ... CBM Basic 3.5 and 7'were in-house extensions.

Link to comment
Share on other sites

3 hours ago, BruceMcF said:

But the point was made about Basic 7, which has it's memory banking operation directly reflecting Commodore 128 memory banking, its music keywords directly reflecting the SID chip and it's graphical keywords assuming the available C128 graphical displays. The last code delivery CBM took from MS was MS Basic v2 ... CBM Basic 3.5 and 7'were in-house extensions.

Indeed, my bad, they extended it further for the proto C65.

Link to comment
Share on other sites

8 hours ago, paulscottrobson said:

Indeed, my bad, they extended it further for the proto C65.

One advantage is that the keywords for those are already reserved, and new keywords are by far the easiest type of extension to make to an MS 6502 Basic V2 based system.

Link to comment
Share on other sites

On 2/21/2021 at 1:51 AM, BruceMcF said:

One advantage is that the keywords for those are already reserved, and new keywords are by far the easiest type of extension to make to an MS 6502 Basic V2 based system.

It's fairly easy unless you start wanting to muck around with the system stacks and so on. When I was a kid I had an MZ80K which came with Basic on tape, I remember hacking it so it had all sorts of stuff (including a Z80 assembler in line !) but that was pretty much entirely done by extending the keyword table and vector table and relying on an <evaluate> call

Link to comment
Share on other sites

I also wanted to ask this.

BASIC V2 was one of the weak points of the C64, even compared to contendors of its day. Did not justice to it's capabilities.

The C16 / Plus/4, then the C128, they got pretty good as far as BASIC goes. Not just with audio-visual commands, quality-of-life improvements too.

Suggestion: please, add a RENUMBER feature!

Edited by Wertzui
Link to comment
Share on other sites

2 hours ago, Wertzui said:

Suggestion: please, add a RENUMBER feature!

Renumber is useful, but it can get hairy.  Do you also have renumber scan the code looking for GOTO and GOSUB and fix those?  I've seen some that did, most didn't.  It's gets better when the implementation has labeled subroutines.

2 hours ago, Wertzui said:

Out of curiosity: who own the rights to the BASIC interpreters today? Microsoft? The Commodore brand holder? The Dartmouth college? Or someone random?

That would be interesting to unwind.  As I understand it, and I'm far from any expert on the matter, Commodore licensed BASIC for the 6502 from Microsoft for the original PET and basically (heh) just kept porting/extending it for new 8-bit C= systems.  I imagine that ownership is somehow split between whoever now owns that part of the IP (Cloanto?) and Microsoft.

In any case, no one seems to have taken down the 'cbmbasic' github page, which is the C-64 BASIC ROM dissembled and run through a tool that converted it to C, with some cleanups and patches to make it usable as a scripting language on UNIX/Linux/macOS/Windows.  They did the same thing with the original Apple I BASIC.

#!/usr/local/bin/cbmbasic
10 PRINT "HELLO WORLD

 

Link to comment
Share on other sites

On 2/13/2021 at 1:17 AM, paulscottrobson said:

My 'opinion' is that almost nobody at all will program the system in any other way [than cross-development] [on the emulator].

That's the way we all seem to be naturally doing it, so that sounds right.  

Therefore, it seems to me that the best 'extensions' to BASIC 2.0 or the KERNAL will be ones that leverage the X16 in useful ways... but not necessarily for the benefit of programming by hand.  Does that make sense?

 

Edited by rje
Link to comment
Share on other sites

Well, for most of us the emulator is the ONLY choice at the moment.

I can see myself, especially with the upgrade keyboard, doing a fair amount of development on the actual hardware.  Especially if there's any "pain" to transferring files, which I kind of foresee, until some kind of networking is available.  Even a direct serial link would be nice.

 

  • Like 1
Link to comment
Share on other sites

Quote

 

Do you also have renumber scan the code looking for GOTO and GOSUB and fix those?  I've seen some that did, most didn't.  It's gets better when the implementation has labeled subroutines.

The BASIC versions on Plus/4 and C128 do fix the jumps, so I'm going by that, yes. And while I got some interesting errors when I first tried it, the mistakes were on my part.

Sure, labels would be massivley superior. Altough it is supposed to be compatible with oldschool CBM  BASICs? So fixing the jumps to line numbers would be a must.

 

Link to comment
Share on other sites

Quote

My 'opinion' is that almost nobody at all will program the system in any other way [than cross-development] [on the emulator].

As we are today in the lockdowns and we have to live our lives on our main PC, it would be a refreshing change to sit in front of something different and type away, no urge to open the Internet, no dayjob stuff, no stupid news and social media in reach.

  • Like 2
Link to comment
Share on other sites

On 2/19/2021 at 2:11 PM, paulscottrobson said:

It would take about a week's work to write one.  This one for example https://github.com/paulscottrobson/atomic-basic is an extended version of the Atom BASIC ; 32 bit integer only with 'C' style strings, so it's a bit experimental (it was meant to be), but it has a working interpreter with a built in 65C02 assembler, an idea I've always liked.  No list or tokeniser yet, but that's straightforward (there's a Python script that tokenises it and then the run time takes over).

Of course you could build a pick and mix easily enough, where different bits could be added or removed as you wanted, so for example have no floats or strings or whatever, different keywords for different systems.

Then you can just add bits as you want ; interface to the X16 Kernel routines for drawing, some SPRITE commands, that sort of thing.  You do run out of spaces, though there are paging ways round that it's a bit messy.

Nice job, Mr R 😉
I like the way you're thinking 😉
And I like it also because if we manage to write our own basic, we won't have any licence troubles. And we will have something well suited for the X16.
Would you mind starting a thread on your BASIC with some examples, docs... and so on.
We may be of assistance 😉
Cheers to you, mate !
 

Link to comment
Share on other sites

On 3/3/2021 at 3:59 AM, Wertzui said:

As we are today in the lockdowns and we have to live our lives on our main PC, it would be a refreshing change to sit in front of something different and type away, no urge to open the Internet, no dayjob stuff, no stupid news and social media in reach.

It really depends on (1) what your expectations are and (2) what your goals are.  To program directly on the X16 you'd have to manage both -- and not just because we're used to modern computers.

So, it's not just the BASIC.  It's also the environment, which was advanced for 1980, but I am much more productive (guesstimate: 8 times more productive) transpiling from a modern system.

 

I work with two terminal windows.  One is editing the code, and one is used for grepping, building the output BASIC, booting the emulator with said BASIC, etc.  As long as I'm in a modern environment, I might as well transpile and reduce my mental load... all without the X16 caring about what I'm doing.

When I have graphics work, I pop up GIMP.  I have the tools from the x16 demo project to convert PNG to hexadecimal, and I wrote a Perl script to write that as a X16 loadable binary file.

 

YES, I welcome value-add to BASIC 2 and the KERNAL -- some of which Michael has already done.  But I'm not coding directly on the platform, so my needs are pragmatic.

Edited by rje
Link to comment
Share on other sites

On 2/13/2021 at 1:17 AM, paulscottrobson said:

My 'opinion' is that almost nobody at all will program the system in any other way. I'm not actually convinced anyone will program it at all like the old cross dev systems where there was a physical download connection. I think they'll develop it on the emulator, and occasionally run it on the system.

I don't want this to be true, but it sounds right... the emulator's reach will always be (much) greater than that of the hardware.  Case in point: my former classmates from grade school can run the little games I've ported, from the browser, without knowing or caring about the underlying target emulation. 

Granted, that's not the X16's demographic.

Edited by rje
Link to comment
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.

 Share

×
×
  • Create New...

Important Information

Please review our Terms of Use