6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 9:39 am

All times are UTC




Post new topic Reply to topic  [ 41 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
PostPosted: Sat Jul 25, 2020 1:15 pm 
Offline
User avatar

Joined: Fri Dec 12, 2008 10:40 pm
Posts: 1007
Location: Canada
cjs wrote:
MS BASIC is covered by the copyright laws of the country in which you are making a copy. This is why the exact same work can be in public domain in one country and under copyright in a different one. Or why you can put a work into the public domain in some countries but not others.


Been doing more reading on this. It also seems to depend on whether or not the foreign work was officially published in the country in which it's being copied. It really is a mess isn't it?

_________________
Bill


Top
 Profile  
Reply with quote  
PostPosted: Sat Jul 25, 2020 6:16 pm 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 730
Location: Tokyo, Japan
BillO wrote:
It also seems to depend on whether or not the foreign work was officially published in the country in which it's being copied.

I had thought that the Berne convention had gotten rid of most all registration and publication requirements back in the '70s, when they decided the best way to go was to have anything written down by anybody immediately under copyright. (Yes, you hold copyright on your shopping lists, and you can sue someone for copying one.) But I wouldn't be surprised if there's still some hangover related to this.

Quote:
It really is a mess isn't it?

You're not kidding. Copyright was in in the U.S. originally an idea to help works get in to the public domain but these days more often seems to make works completely unusable by anyone for half a century or more.

_________________
Curt J. Sampson - github.com/0cjs


Top
 Profile  
Reply with quote  
PostPosted: Sun Jul 26, 2020 12:41 am 
Offline
User avatar

Joined: Thu May 14, 2015 9:20 pm
Posts: 155
Location: UK
BillO wrote:
It really is a mess isn't it?

Yes, and if anything, it’s getting worse.

Especially if companies are taken over or cease trading, both of which appears to be happening more often in the so called modern world. When this happens, it’s hard work even finding out who the current copyright holder is, let alone anything else.

And with governments and law writers being evermore influenced by the large companies, who are often pushing for longer and longer periods of copyright, a lot of electronic works can’t be officially copied, and by the time that the copyright expires, either the media they are on is a long obsolete format or the work is completely irrelevant.

Mark


Top
 Profile  
Reply with quote  
PostPosted: Sun Jul 26, 2020 6:23 pm 
Offline

Joined: Mon Sep 17, 2018 2:39 am
Posts: 138
Hi!

drogon wrote:
So who's up for writing a new BASIC? (and releasing it under an appropriate license)

My suspicions is: No-one. Mostly because people want their old BASIC, warts, bugs, weird FOR loop behaviour, etc.


Well, in the Atari 8-bit scene things seem different, we have at least three free BASICs for the 6502:

- Altirra BASIC: http://www.virtualdub.org/downloads/Alt ... Manual.pdf

Written by Avery Lee, this is a re-implementation of the original Atari BASIC, capable of running most (all?) of BASIC games published for the Atari 8-bit computers. It is faster than Atari BASIC and it is mostly bug-free, but no known, published, Atari BASIC source relies in the original interpreter bugs.

Source license is completely permissive: "Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty."

- Altirra Extended BASIC: https://atariage.com/forums/topic/28406 ... ded-basic/

Also by Avery, this re-implements the famous "Turbo Basic XL", but it is ROM based instead of the original disk based. Same license as above.

Turbo Basic XL was a compatible extension of Atari BASIC, derived from the Atari BASIC source code book, published by a magazine in 1985, and adds to Atari BASIC many control statements (DO, WHILE, REPEAT), labels, procedures, multi-line IF/ENDIF, extended graphic and sound commands, tracing, etc.

- My own FastBasic: https://github.com/dmsc/fastbasic

A modern BASIC without line-numbers and "GOTO", using the Turbo Basic XL syntax and supporting most of the statements, adding string arrays and automatic strings, more game-oriented graphic commands (including raster-interrupt support). FastBasic is not a direct interpreter, it compiles the source code to a compact bytecode, this makes the interpreter very fast.

FastBasic is GPL licensed, with a runtime-exception allowing distribution of compiled BASIC programs.

Porting FastBasic to other 6502 systems should not be difficult, you would need to remove all graphic and sound statements. The IDE is written in FastBasic, and uses standard full-screen output.

And by replacing the full-screen editor with a standard line-based input interface the code could be smaller, perhaps the full floating-point interpreter could use 8kB.

Have Fun!


Top
 Profile  
Reply with quote  
PostPosted: Sun Jul 26, 2020 6:36 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
That's excellent!


Top
 Profile  
Reply with quote  
PostPosted: Sun Jul 26, 2020 6:39 pm 
Online
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1488
Location: Scotland
dmsc wrote:
- My own FastBasic: https://github.com/dmsc/fastbasic

A modern BASIC without line-numbers and "GOTO", using the Turbo Basic XL syntax and supporting most of the statements, adding string arrays and automatic strings, more game-oriented graphic commands (including raster-interrupt support). FastBasic is not a direct interpreter, it compiles the source code to a compact bytecode, this makes the interpreter very fast.

FastBasic is GPL licensed, with a runtime-exception allowing distribution of compiled BASIC programs.

Porting FastBasic to other 6502 systems should not be difficult, you would need to remove all graphic and sound statements. The IDE is written in FastBasic, and uses standard full-screen output.

And by replacing the full-screen editor with a standard line-based input interface the code could be smaller, perhaps the full floating-point interpreter could use 8kB.

Have Fun!


I once demonstrated my BASIC to an interested group and when I said line numbers were optional, one person stood up, said something quite negative and left! I think there are a lot of people stuck in the old ways...

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
PostPosted: Sun Jul 26, 2020 6:53 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
I like the idea of a nicely featured open source and currently maintained 6502 Basic!


Top
 Profile  
Reply with quote  
PostPosted: Sun Jul 26, 2020 8:11 pm 
Offline

Joined: Mon Sep 17, 2018 2:39 am
Posts: 138
Hi!

drogon wrote:
dmsc wrote:
A modern BASIC without line-numbers and "GOTO",


I once demonstrated my BASIC to an interested group and when I said line numbers were optional, one person stood up, said something quite negative and left! I think there are a lot of people stuck in the old ways...


Then, I can only imagine telling those people that my basic does not have GOTO!! :) :lol: :)

Technically, I could add GOTO to FastBasic (using labels instead of line numbers), but you could write invalid programs that crash the interpreter.

As the compiler is quite limited (it is designed to run in the 6502 and writes code in one pass), there are assumptions abut which way you can enter and exit loops. A GOTO into the middle of a FOR loop or into a PROC would lead to a crash in the NEXT or ENDPROC.

And in my experience (and IMHO), the lack of GOTO leads to better code, for example using "EXIT" is a lot more readable than "GOTO XXX" to exit a loop, and by restructuring your program in multiple PROCedures, the control flow is easier to folow.

The main loop of the editor is only 10 lines, even as it is heavily optimized for size: https://github.com/dmsc/fastbasic/blob/ ... or.bas#L62

For a more traditional BASIC program, you can see the PI calculation example https://github.com/dmsc/fastbasic/blob/ ... int/pi.bas or the sieve benchmark https://github.com/dmsc/fastbasic/blob/ ... /sieve.bas


Have Fun!


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 27, 2020 6:15 am 
Online
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1488
Location: Scotland
dmsc wrote:
For a more traditional BASIC program, you can see the PI calculation example https://github.com/dmsc/fastbasic/blob/ ... int/pi.bas or the sieve benchmark https://github.com/dmsc/fastbasic/blob/ ... /sieve.bas


Have Fun!


At the risk of drifting a little OT I'm curios about how long it takes to generate Pi to 100 digits. (and what CPU clock speed).

And if I weren't so far down my BCPL rabbit hole I'd have a got at porting it to my 6502/816 systems. The BCPL version of the Pi generator (similar arctan algorithm) takes a shade over 7 seconds for 100 digits, however all arithmetic is done in 32-bits.

Code:
Ruby BCPL CLI

% pi 100
Time taken: 7136
pi = 3.+
1415926535 8979323846 2643383279 5028841971 6939937510
5820974944 5923078164 0628620899 8628034825 3421170679
%


Cheers,

Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 27, 2020 8:09 am 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 730
Location: Tokyo, Japan
drogon wrote:
I once demonstrated my BASIC to an interested group and when I said line numbers were optional, one person stood up, said something quite negative and left! I think there are a lot of people stuck in the old ways...

Well, yes. It's BASIC after all! Creating a language without functions or local variables was known to be a dumb idea even in the '60s, when BASIC was invented, and such languages certainly should have been dead by the '70s.

I used to think that Dijkstra was exaggerating when he said, "It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration." (EWD498, "How do we tell truths that might hurt?", 1975) But I think now he's probably right. I do, however, place the blame not on those poor souls who were given BASIC to learn as they started learning about computers, but on those who provided it.

_________________
Curt J. Sampson - github.com/0cjs


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 27, 2020 1:15 pm 
Offline

Joined: Mon Sep 17, 2018 2:39 am
Posts: 138
Hi!

drogon wrote:
dmsc wrote:
For a more traditional BASIC program, you can see the PI calculation example https://github.com/dmsc/fastbasic/blob/ ... int/pi.bas or the sieve benchmark https://github.com/dmsc/fastbasic/blob/ ... /sieve.bas


Have Fun!


At the risk of drifting a little OT I'm curios about how long it takes to generate Pi to 100 digits. (and what CPU clock speed).

And if I weren't so far down my BCPL rabbit hole I'd have a got at porting it to my 6502/816 systems. The BCPL version of the Pi generator (similar arctan algorithm) takes a shade over 7 seconds for 100 digits, however all arithmetic is done in 32-bits.



Modifying at line 20 "Q=51" to calculate 51 digit pairs, and using the cross-compiler, this is what I get:
Code:
$ fb pi-100.bas
$ minisim pi-100.xex -d
A(1/5):.........................................................................
A(1/239):.....................
PI=3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170680
sim65: Total cycles: 23557698


Assuming a 2MHz 6502, this is a about 11.8 seconds.

By using the native compiler, the compiled code is slower and takes 26301116 cycles, so this is 13.15 seconds at 2MHz. The results include all the interpreter initialization and printing.

Note that my result gives correctly rounded to 101 decimals, the last digits are 3421170679...82.

The code calculates using a byte array, in base 100, as this is the larger in which all intermediate operations fit into 16 bit integers. Also, FastBasic use 16 bit values in all arithmetic operations, including loops and array indexing.

Have Fun!


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 27, 2020 4:44 pm 
Offline
User avatar

Joined: Thu May 14, 2015 9:20 pm
Posts: 155
Location: UK
cjs wrote:
I used to think that Dijkstra was exaggerating when he said, "It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration." (EWD498, "How do we tell truths that might hurt?", 1975) But I think now he's probably right. I do, however, place the blame not on those poor souls who were given BASIC to learn as they started learning about computers, but on those who provided it.

People often talk utter rubbish. So how did a whole new industry (software and games) spring into existence during the 1980s in Europe then, considering that apart from one home computer (which used FORTH and was a commercial failure), all the rest came with BASIC as the default language (some of which were better than others)?

I agree that structured code should be taught, especially all the points that make up accepted good practice.

People have learned to program various systems using various languages, both low level and high level, with some being self taught with others being professionally taught. And where they started and where they are now could have taken various routes.

The principles for good practice remain very similar though whichever language you are using.

Also keep in mind that before home computers were a thing, BASIC programs would be composed on programming sheets. Then sent off where a typist entered the program for you. Either via punched card or later, directly into a dumb terminal. You could run a BASIC program without ever seeing or touching a computer...

It would be a bit hard to keep track of the order of the program if it was on many programming sheets if line numbers were not used. And line numbers were also used on the line printer output error messages.

Could it have been done another way? Maybe, but then we are in the what if game...

Anyway this is all off topic and already there are other topics covering this elsewhere (Is GOTO ever not evil? over on StarDot being the most recent that I am aware of).

Mark


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 28, 2020 12:44 am 
Offline

Joined: Tue Jul 24, 2012 2:27 am
Posts: 679
Yeah, it's kind of like saying that Newtonian physics has crippled people in an era of quantum physics.

BASIC still introduces people to the notion of expressing program state in variables, making computational decisions and updates to them, and doing input & output. Those things carry forward into all programming, even if the specific BASIC-related mechanics don't.

_________________
WFDis Interactive 6502 Disassembler
AcheronVM: A Reconfigurable 16-bit Virtual CPU for the 6502 Microprocessor


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 28, 2020 5:09 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
It's an odd choice, to use an EhBasic forum to declare that Basic is a poor language in one or another respect. It's off topic in a very strong way.

The 6502 forums are generally a place for sharing enthusiasms and cooperating to solve problems. Some of the sub-reddits are good places for arguing over strong opinions. Some of the stackexchanges are good places for seeking some kind of justified answers to certain kinds of questions. Stardot is another place for sharing enthusiasm: every now and again someone wanders in from a different place and makes provocative statements in an effort to start a conversation, but they find that's not what happens over there.

Edit: as a hopefully constructive suggestion: a new thread is a good way to introduce a new idea. An idea like Dijkstra's could be introduced as part of a discussion about which languages people might recommend as a first language. Another way to open a discussion would be to ask people which language they started with, and which language they might now choose as a first language.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 28, 2020 5:50 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8509
Location: Midwestern USA
BigEd wrote:
It's an odd choice, to use an EhBasic forum to declare that Basic is a poor language in one or another respect.

One of the things I have learned over my very long experience with computers (53 years if I count time in the military working with ballistic computers) is a programmer who is not organized and disciplined will produce spaghetti code, no matter the language. On the other hand, assembly language—the least structured of any language—can be used to produce structured programs...if the programmer chooses to do so (see Garth's website for examples of what can be done with some judicious macro writing).

Much of BASIC's poor reputation developed with the use of the language in microcomputers that were being programmed by people with no formal programming education. Patently, such individuals would be ignorant of structured programming and top-down design, which showed in countless programs published in magazines and such. That was much less the fault of BASIC and more the fault of untrained amateurs.

Although the ancestral Dartmouth BASIC had no elements that encouraged structured programming, all iterations of Business BASIC (BB) in existence since the 1980s do. All the structured programming elements one might find in, say, C, are present in BB. Notably, the language supports the concept of "black box" functions through the CALL mechanism, which allows the programmer to treat entire programs as full re-entrant subroutines, complete with optional parameter passing or a shared environment.

In Thoroughbred Dictionary-IV, which is the BB in which I have the most familiarity, there are many elements that allow programs to flow as they would in other, supposedly more-structured, languages. With the use of statement labels instead of line numbers (line numbers being present for backward compatibility) and multi-way decision making statements, it is possible to write BB software that runs fast, is easy to understand and maintain, and is devoid of spaghetti code and other evils that are thought to be innate to BASIC. In fact, in most cases, the universally-reviled GOTO statement is completely avoidable.

The degree of structure that can be built into a BB program is limited by the programmer's imagination, not the language. If that weren't the case, BB would have died out when minicomputers were put out to pasture in the 1990s. Au contraire, BB is still in widespread use—I have a number of clients whose vertical software is running on BB of various flavors (primarily BBx and Thoroughbred).

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 41 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 36 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: