News for hackers. Stuff that matters.
Re:How Steve Wozniak Wrote BASIC for the Original Apple From... by listic on Friday May 02, 2014 @03:01PM (#7687474)
I programmed in Forth some time ago and I wonder why didn't Wozniak implement Forth on his first computer. Surely, it would be easier to do and run faster than BASIC. That BASIC was a naive interpreter, it couldn't help being slow, except for the primitives that Woz coded in machine language, I'm sure they were fast.

Was it already clear for Wozniak in 1975 that Forth looks weird and people won't get it?

Re:How Steve Wozniak Wrote BASIC for the Original Apple From... by colomon on Friday May 02, 2014 @03:18PM (#7687569)
I'd simply guess he'd never heard of it -- it was pretty obscure in the early 1970s. It might have been less accessible to beginners, but Forth was the perfect language for those early microcomputers. I loved programming in it on my Commodore 64.
Re:How Steve Wozniak Wrote BASIC for the Original Apple From... by kalleboo on Friday May 02, 2014 @08:00PM (#7688915)
It says right there in the article. BASIC had books like "101 computer games" published for it. It had already made Bill Gates a minor celebrity. It already had the most mindshare in his target market.

> "The key to games was BASIC. Bill Gates was unknown except in the electronics hobby world. Everyone in our club knew that he'd written BASIC for the Intel microprocessor. I sniffed the wind and knew that the key to making my computer good (popular) was to include a high-level language and that it had to be BASIC. Engineers programming in FORTRAN were not going to be what would start a home computer revolution."

Re:How Steve Wozniak Wrote BASIC for the Original Apple From... by Jtsummers on Friday May 02, 2014 @03:03PM (#7687489)
http://en.wikipedia.org/wiki/Forth_(programming_language)

I checked the above link to confirm my recollection, but while Forth had been around for a while it wasn't really public until the 70s (versus BASIC). I suspect he wouldn't have even heard of it, or at least not realized its potential, in 1975.

Re:How Steve Wozniak Wrote BASIC for the Original Apple From... by etfb on Saturday May 03, 2014 @07:14AM (#7690338)
I think it must have been. If he was aware of it at all, he would have associated it with the Reverse Polish Notation of his HP calculator, and probably knew that, while they were certainly powerful, RPN calcs were never going to make it to the mainstream.

And actually implementing a basic interpreter isn't all that complex. The loop is simple:

Read a line.

If the line starts with an integer, you're adding a line to your program; otherwise you need to interpret then execute.

Read the first word. In some BASICs, this is the first string of characters that matches one of the keywords; in others, it's all the alphanumerics up to a non-alphanumeric.

(In effect) dispatch to the appropriate interpretation routine based on which keyword you just read in. For example, PRINT goes to the argument handler for PRINT, LET goes to the argument handler for LET, and so on.

Then you just have a bunch of routines (read one variable name, read an expression and interpret it as a number, read a destination line number, etc) and different keywords use them in different ways.

It's pretty simple, really. Way easier than writing a full LALR parser.

Re:How Steve Wozniak Wrote BASIC for the Original Apple From... by zhemao on Friday May 02, 2014 @06:21PM (#7688521)
Wozniak was all about bringing computers into wider use. At the time, BASIC was considered the "easy" language to learn. So easy that kids could do it.
Re:How Steve Wozniak Wrote BASIC for the Original Apple From... by listic on Saturday May 03, 2014 @01:07PM (#7691489)
I thought Logo was, too, and Logo is based on Forth, but I checked Wikipedia article and Forth is not mentioned. Also, don't know about the popularity of Logo back in the day, but I thought it enjoyed some.
Re:How Steve Wozniak Wrote BASIC for the Original Apple From... by raverbashing on Friday May 02, 2014 @03:07PM (#7687510)
> Was it already clear for Wozniak in 1975 that Forth looks weird and people won't get it?

Since he had an HP calculator, yes