BASIC

Languages and libraries

interpreter

SHOW HN2018

144points
76comments
#286of 2,155 in 2018
Top 14%of 2018 by points

How HN took it

DebatedReal support and real criticism

3 positive, 3 neutral or asking, 1 mixed, 5 critical, out of 12 comments about the project. Thread score +0.06.

Execution: 1 for, 4 againstIdea: 1 for, 1 against

The thread, comment by comment

Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.

positive neutral or mixed critical about another commenter or something else the maker

What HN said

What people liked

  • Fun project that brings back memories of retro BASIC

    From 2 comments
    • A fun project! I had a buddy tried this, wrote it in C++ over a week. Had console, graphics, formatting and networking (I think). The trick was first a parser, then use C++…
      JoeAltmaier on HN
    • Oooh wonderful! I wrote hundreds of games as a kid in QBasic and have had the idea for years to write a QBasic to JavaScript transpiler so I could actually showcase some of them…
      donatj on HN

Objections

  • Expression evaluator bugs: 3+4*5 gives wrong result

    From 3 comments
    • ``` $ echo 'PRINT 3+4∗5' > test.bas $ go run main.go test.bas 34 $ echo 'PRINT (3+4*5)' > test.bas $ go run main.go test.bas 23 $ echo 'PRINT (3+4)*5' > test.bas $ go run main.go…
      tyingq on HN
    • In the first case, maybe it's treating the '+' as string concatenation - so 3+4 is giving 34? Then it's just dropping the 5 because it can't multiply a string and a number.…
      rpeden on HN
    • Ahh, you're correct. ``` go run main.go /dev/tty PRINT 1+2*5,"\n" ^D 12 ```
      tyingq on HN
  • Division by zero handling is wrong

    From 1 comment
    • Don't know if it's the same bug, but "PRINT 1/0" returns 1. "PRINT (1/0)" prints nothing. Using "LET a=1/0" raises a div by zero error. Also, "LET a=1%0" panics.
      tyingq on HN

Requests

  • Fix expression evaluation precedence bugs

    From 1 comment
    • Yes, but it should not require that LET statement. The expression evaluator looks subtly broken.
      jacquesm on HN

Questions

  • Why does PRINT 3+4*5 output 34?

    From 1 comment
    • ``` $ echo 'PRINT 3+4∗5' > test.bas $ go run main.go test.bas 34 $ echo 'PRINT (3+4*5)' > test.bas $ go run main.go test.bas 23 $ echo 'PRINT (3+4)*5' > test.bas $ go run main.go…
      tyingq on HN

Alternatives named

  • Gorilla.bas and other classic BASIC games

    From 1 comment
    • Does anyone remember some installs shipped with a game called gorilla.bas? A fun little game where you had two gorillas across a cityscape and the whole idea was to take turns…
      deckarep on HN
  • True BASIC

    From 1 comment
    • Yes, I read that there were some more structured-programming-oriented BASICs that came out some time after the structured programming movement started [1]. IIRC, one such BASIC…
      vram22 on HN
  • Peter Norvig's Python BASIC

    From 1 comment
    • Peter Norvig did one for Python, and it's pretty cool: https://github.com/norvig/pytudes/blob/master/ipynb/BASIC.ipynb
      vfinn on HN

Category, keywords, summaries and labels on this page were made by AI (Thread Reader v2) and not checked by hand. Each point links to the comments it came from.

Add a badge to your READMEShown on HackerShow
[![Shown on HackerShow](https://hackershow.org/badge.svg)](https://hackershow.org/show/18315292)