by lorenzleutgeb on 9/15/18, 5:49 AM with 87 comments
by pedasmith on 9/16/18, 6:02 AM
Mind-blowing BASIC example from the 1970's:
100 A$="ABCDEF"
110 A$ = REP ("123", 4, 0)
120 PRINT A$
The result is ABC123DEF -- at position 4 (strings start at 1), replace 0 characters with "123". So the REP function looks at the statement it's part of, finds the variable that is being assigned to, and uses that as the starting string (!). It's kind of like a function, only with a weird implied variable that only works in an assignment.You can't just PRINT the result directly, because then how would REP know what the string to change is?
Nowadays "weird" syntax has some solid foundational reason why it's useful or important. This not-really-a-function, though, simply has no justification whatsoever.
(This example is from the BASIC embedded in the Tektronix 4050 terminal).
There are enough variants of BASIC that there's a really nifty handbook with the differences at https://archive.org/details/Basic_Handbook_2nd_Edition_1981_...
by lioeters on 9/16/18, 11:09 AM
by xrd on 9/16/18, 4:59 AM
It's late but I'm confused why anyone would spend time doing this, and since it is in the official Google repository, presumably someone at Google was actually doing it on paid time.
by bencollier49 on 9/16/18, 1:47 PM
This isn't that, but withering comments from Dijkstra aside, BASIC is still a great introduction to programming, and this is a fantastic idea; it'll be great to run loads of old type-ins in the browser.
Could have done with a crisper font, though.
by crazygringo on 9/16/18, 4:25 AM
BASIC was how I started programming, 30 years ago.
Is this the first time someone's implemented BASIC in JavaScript? It seems so... obvious in hindsight.
I wonder if this has any potential for kids who want to start to learn programming? Or if there are other better, more modern, places to start these days?
Also... why is this from Google of all places? Seems like more of a personal hobby project.
by kerng on 9/16/18, 4:51 AM
by TickleSteve on 9/16/18, 9:14 AM
"gwwwbasic" anyone??
by mdhughes on 9/16/18, 8:22 PM
I started on BASIC on the TRS-80 Model I in 1980, and it was a great introduction.
That said, newbies are probably better off starting Python (use IDLE for a decent REPL & editor), type `from turtle import *; reset()` to get a graphics window, and learning a nice language from the start.
by pankajdoharey on 9/16/18, 5:47 AM
by orionblastar on 9/16/18, 4:59 AM
by ilaksh on 9/16/18, 6:43 AM
by netsharc on 9/16/18, 2:54 PM
by Timucin on 9/17/18, 2:19 PM
by ourmandave on 9/16/18, 2:08 PM
Is there at least GOTO?
by andreygrehov on 9/16/18, 5:02 AM
by bernardlunn on 9/16/18, 6:01 AM
by xaduha on 9/16/18, 6:44 AM