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

All times are UTC




Post new topic Reply to topic  [ 63 posts ]  Go to page 1, 2, 3, 4, 5  Next
Author Message
PostPosted: Tue Sep 13, 2022 3:25 pm 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 718
Location: Texas
Hello everyone,

I have a 4 year old daughter who has been using my 6502 computer daily for her math (and reading/typing) lessons. We use a program I made called the "Scratchpad" which allows you to type and move around the screen, very simple.

She is progressing in her math very quickly, and it makes me wonder if she could at least start programming some very basic things on the 6502 computer. Not Assembly. Not Forth. Maybe BASIC, maybe not. I know that some of y'all were handed computers at an early age, and all you COULD do on them was program. I'm trying to follow in those footsteps a bit here.

I'm looking for a style/language that is very simple. Not at all good with speed, memory, size, or efficiency. Instead, something that is readable, somewhat usable, and can ask for keyboard input, spit out ASCII output, do some loops and if statements, and basic integer math. Also, if I were to make my own language, I'm thinking it would slightly resemble 6502 Assembly in how it functions. One stack, accumulator, X and Y, little things like that that would make learning the real Assembly language easier to grasp.

Because I haven't found what I'm looking for, I've been devising my own programming language which resembles something between BASIC and COBOL. And I do not mind making up my own language since this is very specific, but some pointers/guides would be nice. Or, if BASIC is good enough, I'm ok with trying that. What I found though, when looking at versions of BASIC, is that it *can* be complicated looking, using special symbols and stuff.

Remember, this is for a 4 year old, not for any advanced programmers like yourselves. [ And I can't STAND to use some dumbed down point-and-click IDE, gross! ]

Recommendations? Thoughts? Comments? I'm willing to hear them! Thank you all.

Chad


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 13, 2022 4:00 pm 
Offline
User avatar

Joined: Sun Nov 07, 2021 4:11 pm
Posts: 101
Location: Toronto, Canada
Have you considered Logo? It was built specifically for this reason (and, as I recall, there was a version for the Apple ][, so you might even be lucky enough to find some source code!).


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 13, 2022 4:17 pm 
Offline

Joined: Thu Jan 21, 2016 7:33 pm
Posts: 282
Location: Placerville, CA
I guess it kind of depends on the goal. LOGO is certainly a simple way to grasp basic concepts - programming is making a list of instructions for the machine to follow, numbers and lists/structures of numbers can represent human-level information in a way machines can understand - but it's not well-suited for doing much more than drawing simple pictures. Still, it might be a good jumping-off point.

Past that, finding a nice BASIC would be a good choice (something with a reasonably complete library of functions so that you don't have to go the CBM route of learning cryptic PEEKs and POKEs simply to draw a line on the screen; a full-fledged structured variant is probably unnecessary for beginners, but if you find one that supports it, so much the better.)

If I were designing a teaching language myself, I think I might start by looking to Smalltalk for syntax and general structure - but Smalltalk itself has never solved the problem of decoupling a program from the object library/operating environment in a really satisfactory way...


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 13, 2022 4:26 pm 
Offline

Joined: Sun Nov 08, 2009 1:56 am
Posts: 411
Location: Minnesota
What do you mean by "6502 computer"? Is it a name brand, such as Apple, Atari, BBC or Commodore? All (or at any rate) most of these had a BASIC interpreter in ROM. Additional languages were often available for purchase. The C64 had versions of Comal (a popular teaching language in Europe in the 80's, sort of a more structured BASIC) and Logo (probably more appropriate for younger children, and the language has the features you want).

Quote:
but it's not well-suited for doing much more than drawing simple pictures.


That would be the Turtle Graphics, which I'd argue is not really part of the core language, but just a way to get children interested. As a language it's more about lists, functions and recursion. It can also be very slow at purely numerical tasks (at least the C64 version is).

Even if you go on to write your own, you might take a look around at some languages meant for teaching programming for inspiration. There have been many efforts in this area over the years.


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 13, 2022 5:11 pm 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 718
Location: Texas
Thank you all for the comments so far!

CountChocula wrote:
Have you considered Logo


I didn't even know what that was until now! I see the cool graphics it can make, that's interesting. Any code examples I've seen have been about turtles, which is... interesting. I see lots of features but some are cryptic (to me) and some are something I would ask "Well, why do I need that?" The style of using words for, ya know, doing stuff is close to what I'm thinking though.

commodorejohn wrote:
finding a nice BASIC would be a good choice


'Nice' is the key word I think.

commodorejohn wrote:
I think I might start by looking to Smalltalk


I saw some examples of Smalltalk, and besides me being confused, it has various sorts of special characters to do particular tasks. Colons all over the place, carets for I don't know what, etc. I mean, perhaps? A good attempt.

teamtempest wrote:
What do you mean by "6502 computer"?


My own SBC, thus my bend on programming my own language. I can't even see a good way to use someone else's existing BASIC!

Let me give you some examples of code I'm thinking about:

Code:
VAR X
VAR Y
SET Y = 0
FOR X FROM 0 TO 128
  CALC Y = Y + 1
  PRINT Y
  PRINT $0D ; carriage return
LOOP


or

Code:
VAR X
ARRAY X 'HELLO WORLD'
PRINT X


or

Code:
VAR X
LABEL MAIN
INPUT X
IF X = 0 THEN MAIN
PRINT X
GOTO MAIN


I don't know exactly, these are just basic commands I was thinking of. As little symbols as possible, but math symbols are acceptable ( + - * / = )

Here's another example of something I'd like to see: My daughter likes to make music using my SBC's 1-voice square wave audio output. I made a sheet music program that you can move notes around and then create your own song. Maybe here she could type:

Code:
SOUND 100
SOUND 120
SOUND 120
SOUND 80
SOUND 60


To make it play little tunes. Also, she likes drawing things on my little 'paint' program, so perhaps with this she could do:

Code:
LINE FROM 10,10 TO 20,20
CIRCLE AT 30,30 RADIUS 10


I don't know, that's maybe a bit much honestly.

Any other thoughts?

Thanks again everyone.

Chad


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 13, 2022 5:29 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
I think it's important to have words to do graphics and sounds - POKEs are a big barrier to learning, and they encourage memorising arcane facts, instead of building an understanding.

> all you could do was program
I'd extend that thought a little: it was very common to type in other people's programs from magazines. In doing that, you learn something by osmosis, something by needing to correct your typos, and something by making minor changes.

> Logo
An excellent idea. It's a whole lot more than turtle graphics. (There's a 4004 transistor level simulator written in logo.) It has named procedures, and apparently kids spontaneously learn to factor out repeated things. After typing so many constants, they naturally see the advantage of loops.

I've never studied the art of teaching, bar a very short course at school on child development, but I remain convinced it's a science and a skill all of its own. Teaching something is much more than just handing over one's own knowledge. It might be worth looking into this.


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 13, 2022 6:50 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1385
From a simpler view, you could always start her out with BASIC. Dumbing it down is relative, you don't need to tell her everything it can do, just focus initially on a handful of commands/functions to get something working. As she progresses, you introduce her to more features/functions.

In some cases... I'd likely say try and find her an old Vic-20 to start with (assuming you have a monitor/TV to hook it up to). It can do some simple graphics and sounds, which is likely going to be more interesting for a 4 year old than a text screen with the occasional beep. It also let's her know that it's her machine... not yours.

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 13, 2022 9:41 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8507
Location: Midwestern USA
I agree with flooby on this one.

I think it would be more beneficial for your daughter to work with a language environment that is already a de facto standard. Just introduce her to it little-by-little, and as she progresses and is able to make the computer do cool things, her interest will be stoked.

The trouble with concocting your own language is she will be learning something that exists nowhere else, which means (assuming she maintains interest as she gets older) she would have to unlearn what she learned working with a homebrew pseudo-language.

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


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 13, 2022 9:45 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8507
Location: Midwestern USA
floobydust wrote:
I'd likely say try and find her an old Vic-20 to start with...

One advantage a VIC-20 has in this sort of application is its large on-screen character size. I think that feature would be better suited to a young child getting the hang of playing around with a computer, as well as developing her reading skills. As she learns and gains confidence, then introduce her to a different machine with smaller character size, but more capability.

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


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 13, 2022 9:58 pm 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 718
Location: Texas
BigEd wrote:
I think it's important to have words to do graphics and sounds


Good point. I, being older and well the creator of this 6502 computer, know the in's and out's so peek and poke are no biggie. For me. I have to always remember that. Thank you.

BigEd wrote:
you learn something by osmosis


I've heard this many times. I agree, mostly. There are two levels of learning: mimicking others, and then self discovery. Infants and toddlers mimic all the time, that's how we all learn how to talk, very natural. That's why our children sound like us, our expressions and our accents. Then later they need to self discover. Telling a kid that the stove is hot, don't touch that, is not always enough. Sometimes they need to get burned. I think typing alone doesn't teach as much as fixing mistakes, though if they were copying then their mistakes were simply typos and re-copying always fixes it. But if one of those magazines had some code with a logic error in it.... Muh ha ha! Now THAT would be learning.

BigEd wrote:
I remain convinced it's a science and a skill all of its own


Indeed. Being a teacher, I agree that there is a skill and science to it all. Sadly, this goes WAY overboard with some 'education majors' who want to re-make what has already been tried-and-true for centuries. When we add numbers, it should be like how you learned in 5th grade, one number up top, another below it, a big plus sign on the left, a line at the bottom. Carry the one! Etc. There is NO NEED to re-invent that wheel. How many times in class do I hear students say they got 'some method' to solve whose-its-face problems. Box method, diamond method, fish-in-the-water method, basket-weaving method, all these stupid methods that some guy made up to get his PhD, when factoring a polynomial DOES NOT need to be that hard! Gosh. Don't get me started :)

floobydust wrote:
From a simpler view, you could always start her out with BASIC


I feel like I'm leaning that way.

floobydust wrote:
It also let's her know that it's her machine... not yours.


Very true! I actually told her that my SBC is hers. And she treats it like it is hers. She has respect for it and cares about it. She tells me some evenings, "I need to email!" Hahaha, so she gets on her computer and starts typing away. She follows after her daddy too well it seems :/

BDD wrote:
I think it would be more beneficial for your daughter to work with a language environment that is already a de facto standard.


Yes, very good point. Now, I know there are many different dialects of BASIC. If I make something that is "mostly BASIC" or "feels like BASIC", is that enough? I personally do not know *how* universal it is, but I have heard that BASIC on a C64 will not run on an Apple II, etc. Mainly because of the particular machine's way of doing things. Still, overall, you can get a for-loop going without issue I'm sure. Right?

BDD wrote:
large on-screen character size


I've been thinking about converting my "Scratchpad" from 80-column mono to 40-column CGA colors. That would give colors, and she won't be using the 80-column mode for... whatever she would be doing with a scratchpad. Very good point.

Thanks everyone, any other thoughts are welcome.

Chad


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 13, 2022 10:11 pm 
Offline

Joined: Thu Jan 21, 2016 7:33 pm
Posts: 282
Location: Placerville, CA
As far as picking a BASIC, you're right that many home computers of the day use subtly or not-so-subtly incompatible dialects (even the ones that are tweaked MS BASIC variants...!) But there are a few BASICs out there that are designed to be more portable, with a little elbow grease; I know ehBasic is popular these days.


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 13, 2022 10:13 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8507
Location: Midwestern USA
sburrow wrote:
BDD wrote:
I think it would be more beneficial for your daughter to work with a language environment that is already a de facto standard.

Yes, very good point. Now, I know there are many different dialects of BASIC. If I make something that is "mostly BASIC" or "feels like BASIC", is that enough?

For better or worse, Microsoft's rendition of BASIC has a sort of universality in the microcomputer world. EhBasic, the late Lee Davison’s rendition for the 6502, is sufficiently similar to Microsoft’s for your purposes, should you desire to implement BASIC on your SBC. Also, floobydust edited the EhBasic source code so it could be run on a 65C02 system and take advantage of the C02’s enhanced instructions.

I'd stay away from what Apple did on their eight-bit machines, as it is a bit of an outlier in the BASIC world. Commodore BASIC is a good version because it is almost entirely MS BASIC. The weakness, of course, is the lack of verbs for using audio and graphics (excepting BASIC 7.0 in the C-128). Those could be added to EhBasic, assuming the target system has the required resources.

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


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 13, 2022 11:09 pm 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 718
Location: Texas
I'm a big fan of public domain stuff, so that I can use/modify/add/subtract/sell without any constraints. I do not believe EhBasic is public domain, correct? Say I wanted to sell my SBC as a kit at some point, putting EhBasic on it would not work, correct? Y'all help me here please, because I'm in the dark about copyrights and stuff.

Chad


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 13, 2022 11:36 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1385
Well, I think you're possibly getting a lot ahead of yourself on this one.... from trying to get a simple learning language to selling machines and worrying about copyright and licensing! You don't have to supply any code with the hardware, just have a link to download some software. Granted, there might someone related to Lee that could hold some copyright for EhBasic, but it too has much similarity to MS Basic.

For now, just focus on getting something for a 4-year old. Grant Searle has a single source code for MS Basic which should be pretty easy to get running on your system. As BDD pointed out, my version of EhBasic should be extremely simple to get running, as a single source, you only need to provide character in/out routines, a starting address in ROM for assembly and declare a half page or so for the input buffer.

Still... the Vic-20 is an easy win on doing this. Commodore also released a Programmer's Aid cartridge that extended Basic and also added an additional 3KB of RAM.

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
PostPosted: Wed Sep 14, 2022 12:14 am 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 718
Location: Texas
floobydust wrote:
Well, I think you're possibly getting a lot ahead of yourself on this one....


I think this way ALL of the time. Whenever I program my video games on other platforms, I always use public domain sound effects (because I can't do that stuff!), open graphics libraries, all game graphic art is either self created or public domain, etc. This is literally just how I think. As if I will ever *sell* my video games, ha! No way. I use them exclusively for demos at Math Appreciation Day at the college, nothing more. There are moral reasons behind my decisions, not simply commercial gain.

So, no offense was intended in showing my typical behavior, I never meant to get ahead of myself. Thank you anyways, I'll be exploring ways to get Basic going somehow. I appreciate the input, this was exactly what I needed. A little extra push towards the right direction.

Chad


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 17 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: