Page 1 of 1

Vintage computer compatibility

Posted: Tue Feb 27, 2024 1:01 pm
by craig7
I have in mind to create code that would be written in such a way that, while it runs on Windows, could easily be ported to other basic systems - especially older systems, such as Commodore Pet, TRS 80, Amstrad etc.

My question. What parts of Purebasic would be compatible with older basic systems and what should one avoid using (e.g. GUI) to make it easier to port?
I am a beginner (with Basic - but I use modern languages: R, Python & VBA) and still in the early planning stages and wondering if Purebasic is suitable for making code that is 'robust' and not too dependent on one or the other OS and hardware.

Re: Vintage computer compatibility

Posted: Tue Feb 27, 2024 1:13 pm
by zikitrake
Although I have not used them, it is more likely that I would use one of these two languages:

https://zxbasic.readthedocs.io/en/docs/ or https://en.wikipedia.org/wiki/Z88DK

Re: Vintage computer compatability

Posted: Tue Feb 27, 2024 2:02 pm
by matalog
Start with the BASIC language of your old system of choice, as they will have far less commands that Purebasic.

Check that the use of each command will work in Purebasic.

For example on ZX Spectrum you have to use 10 LET X=1 ; that is , a line number and LET to define a variable.
Commodore 64 also needs a line number, but you can leave out the LET, which will work with Purebasic. 10 X=1

Purebasic doesn't allow line numbers, so that will be a big problem if you want code that can be exactly the same on both computers.

Re: Vintage computer compatibility

Posted: Tue Feb 27, 2024 2:04 pm
by matalog
One other way to look at it is if you ccan compile C with Purebasic, you will also be able to compile C for most of those computers.

Re: Vintage computer compatibility

Posted: Tue Feb 27, 2024 2:52 pm
by craig7
matalog wrote: Tue Feb 27, 2024 2:02 pm Start with the BASIC language of your old system of choice, as they will have far less commands that Purebasic.

Check that the use of each command will work in Purebasic.

For example on ZX Spectrum you have to use 10 LET X=1 ; that is , a line number and LET to define a variable.
Commodore 64 also needs a line number, but you can leave out the LET, which will work with Purebasic. 10 X=1

Purebasic doesn't allow line numbers, so that will be a big problem if you want code that can be exactly the same on both computers.
Yes that sounds logical to start with the old language first.
The line numbers; I forgot about that. I'm most familiar with R, Python & VBA and only have vague memories of tinkering with Basic in the 80s. I suppose there is no way to get PureBasic to ignore them without an error.

Re: Vintage computer compatibility

Posted: Tue Feb 27, 2024 2:56 pm
by craig7
zikitrake wrote: Tue Feb 27, 2024 1:13 pm Although I have not used them, it is more likely that I would use one of these two languages:

https://zxbasic.readthedocs.io/en/docs/ or https://en.wikipedia.org/wiki/Z88DK
Interesting, never seen that before. I guess PureBasic is more of a VB6 replacement / continuation than early Basic. Perhaps if looking at other languages that would work well across time, Fortran is another to consider as that is well documented and has strict standards such as F77 and a lot of discussion around compatibility across time.

Re: Vintage computer compatibility

Posted: Sun Mar 03, 2024 1:05 pm
by CDXbow
zikitrake wrote: Tue Feb 27, 2024 1:13 pm Although I have not used them, it is more likely that I would use one of these two languages:

https://zxbasic.readthedocs.io/en/docs/ or https://en.wikipedia.org/wiki/Z88DK
Sinclair Basic was my first computer language I ever used, on the Speccy. Probably close to forty years ago and it makes me feel so very old. Glad to see it's still alive, but thank god the tape drive died. I still have the Spectrum stored away, I might give ZXBasic a try. It compiles BASIC to Z80 assembler code so potentially other Z80 platforms could be supported, not that I have any.

Re: Vintage computer compatibility

Posted: Sun Mar 03, 2024 5:21 pm
by matalog
CDXbow wrote: Sun Mar 03, 2024 1:05 pm
zikitrake wrote: Tue Feb 27, 2024 1:13 pm Although I have not used them, it is more likely that I would use one of these two languages:

https://zxbasic.readthedocs.io/en/docs/ or https://en.wikipedia.org/wiki/Z88DK
Sinclair Basic was my first computer language I ever used, on the Speccy. Probably close to forty years ago and it makes me feel so very old. Glad to see it's still alive, but thank god the tape drive died. I still have the Spectrum stored away, I might give ZXBasic a try. It compiles BASIC to Z80 assembler code so potentially other Z80 platforms could be supported, not that I have any.
SpecBAS https://github.com/ZXDunny/SpecBAS is an enhanced Sinclair BASIC interpreter for modern PCs - and BASINC https://arda.kisafilm.org/blog/?page_id=848&lang=en Is a great IDE with emulator for working with origingal ZX BASIC programs.

Re: Vintage computer compatibility

Posted: Mon Mar 04, 2024 3:15 am
by Rinzwind
matalog wrote: Tue Feb 27, 2024 2:04 pm One other way to look at it is if you ccan compile C with Purebasic, you will also be able to compile C for most of those computers.
Not really, just because it has a c layer, doesn't mean it runs everywhere. Especially not since PB's standard libs are "only" available for mac, linux and windows and not open sourced. And especially not for vintage hardware.

MSX basic is a good 80's basic and easy to start with at https://msxpen.com/
For classic lower level 8 bits dev this is a great start: http://8bitworkshop.com/v3.11.0/?

But no, there is no vintage computer compatibility found in PB. Unless you're into the Amiga. IMHO PB is more like a fully packaged easier c.

Btw FreePascal has a large number of target platforms incl z80.

Re: Vintage computer compatibility

Posted: Mon Mar 04, 2024 1:49 pm
by craig7
Rinzwind wrote: Mon Mar 04, 2024 3:15 am
matalog wrote: Tue Feb 27, 2024 2:04 pm One other way to look at it is if you ccan compile C with Purebasic, you will also be able to compile C for most of those computers.
Not really, just because it has a c layer, doesn't mean it runs everywhere. Especially not since PB's standard libs are "only" available for mac, linux and windows and not open sourced. And especially not for vintage hardware.

MSX basic is a good 80's basic and easy to start with at https://msxpen.com/
For classic lower level 8 bits dev this is a great start: http://8bitworkshop.com/v3.11.0/?

But no, there is no vintage computer compatibility found in PB. Unless you're into the Amiga. IMHO PB is more like a fully packaged easier c.

Btw FreePascal has a large number of target platforms incl z80.
Thanks that is useful.