[HN Gopher] EndBASIC
       ___________________________________________________________________
        
       EndBASIC
        
       Author : tosh
       Score  : 48 points
       Date   : 2022-06-07 09:44 UTC (13 hours ago)
        
 (HTM) web link (www.endbasic.dev)
 (TXT) w3m dump (www.endbasic.dev)
        
       | nsxwolf wrote:
       | It has no line numbers, fine. But I couldn't figure out how to
       | enter a program since it doesn't present an editor. All my
       | commands were executed in immediate mode.
       | 
       | I probably would have spent a little more time with it if it had
       | been obvious how to enter a program without poring through
       | documentation.
       | 
       | I did load the DEMO program, maybe it was in there, but I missed
       | it.
        
         | jmmv wrote:
         | Try typing EDIT.
        
       | bmacho wrote:
       | Send text as image because reasons. No thanks.
        
       | wellpast wrote:
       | This is how I learned to code. I cannot imagine throwing a kid in
       | front of a Javascript browser console or modern IDE and say
       | figure it out. This is so awesome -- with the low-res graphics,
       | too! If my kids learn to code, this is how my kids will learn to
       | code.
        
       | jmmv wrote:
       | Author of EndBASIC here. Surprised to see this show up on the
       | front page today. AMA!
        
         | mysterydip wrote:
         | As an avid BASIC enthusiast I love the concept! What did you
         | envision as the use case for when you're feature complete? Just
         | a toy or something more?
        
           | jmmv wrote:
           | I was mostly targeting the ability to write some simple games
           | that combine graphics, some peripheral input, and sound.
           | Mostly a toy though, but who knows: the future is unchartered
           | :)
        
         | snorkel wrote:
         | Glad it has graphics! Always the best part of BASIC
        
           | jmmv wrote:
           | Indeed. The difficulty in manipulating graphics is what most
           | puzzles me these days. We have these amazing graphics cards
           | and screens, but all we can do is output text by default in
           | most languages, and drawing anything requires large libraries
           | or SDKs.
        
         | guessbest wrote:
         | Congrats! How do you keep your site from crashing with all the
         | traffic? I assume you must be serving up a lot of javascript
        
           | jmmv wrote:
           | It's all client-side, unless you use the cloud service to
           | fetch the tiny programs that are shared, like this one:
           | https://repl.endbasic.dev/?run=jmmv/bounce.bas -- and those
           | requests are cheap and infrequent right now.
           | 
           | The current wasm file that's downloaded is just about 1MB!
        
       | ChicagoDave wrote:
       | Without line numbers, GOTO, GOSUB, and/or SUB/FUNCTION, this is a
       | very raw (and mostly unusable) version of BASIC.
        
         | jmmv wrote:
         | This is what's coming next. I've so far been carried away
         | building the environment around the tiny language, but it's
         | time to start making the language usable -- and user supplied
         | functions are the very next work item to complete.
        
           | ChicagoDave wrote:
           | In the mature versions of BASIC, SUB was for routines that
           | didn't return any value and FUNCTION was for returning a
           | value.
           | 
           | I'd 100% skip the line numbers and GOTO/GOSUB and build those
           | two things. I grew up PDP BASIC and then VAX BASIC and the
           | procedural aspect is what made it a great platform to write
           | code. the line number/GOTO stuff is great for nostalgia, but
           | a dead end for good coding practices.
        
             | TedDoesntTalk wrote:
             | This is a great idea. I grew up with AppleBASIC, which had
             | line numbers, but after decades coding with many other
             | languages, there's no reason to use line numbers. And if
             | the purpose of this repl is to teach, then teaching line
             | number programming in 2022 is pointless.
             | 
             | Unfortunately it then requires an editor, otherwise how do
             | you overwrite/change a line?
        
           | eatonphil wrote:
           | Have you decided on the plan of attack? Switch to a VM or
           | something more fun in the AST evaluator? :)
        
       | behringer wrote:
       | BASIC languages seem to be having a bit of a renaissance year.
       | There have been about (that I know of) 2 or 3 new BASIC languages
       | introduced just this year alone.
       | 
       | I absolutely love the idea of a modern web based BASIC as I can
       | work on the road from anywhere!
       | 
       | I've added a room for this to my BASIC oriented discord,
       | hopefully this doesn't seem spammy it's the only one around on
       | the subject of BASIC in general, as far as I'm aware:
       | https://discord.gg/HQaDgJvbbJ
        
         | pjmlp wrote:
         | Structured BASICs are great.
         | 
         | Not only they were quite productive as dynamic languages, they
         | also had optional typical and AOT compilation, besides the rich
         | libraries for start coding right away.
         | 
         | One thing that many might be unaware is that the original
         | Dartmouth BASIC was actually JIT based, the pure interpreted
         | versions only came to be due to fitting it into 8 bit home
         | computers.
        
           | eatonphil wrote:
           | My concern with attempting to learn BASIC is that at least
           | the big ones aren't garbage collected (freebasic, qb64).
           | 
           | In the first place (not growing up using BASIC) I don't
           | understand how BASIC got so big as a programming language for
           | beginners (even kids) without a GC.
           | 
           | Or maybe my searches just haven't turned up the right
           | implementation or something.
           | 
           | I have the same issue with (Free)Pascal but I'm less
           | surprised there because it's not like (apparently, since like
           | I said this wasn't me) everyone as a kid learned to game
           | program with Pascal the same way they did with BASIC.
        
       | wiz21c wrote:
       | Reminds me of Gambas sort of
        
       | TheHideout wrote:
       | Very cool. I have a ton of old qbasic/freebasic projects that
       | would be fun to give them life again on the web.
       | 
       | http://syn9.thehideoutgames.com/
        
         | 38_9503-94_5201 wrote:
         | marik.
        
         | 38_9503-94_5201 wrote:
         | dan ie l.
        
       | stef-13013 wrote:
       | GFA revival ?
        
       | whitten wrote:
       | Interesting. Please provide some syntax pages beyond using the
       | HELP command interactively to find out what the possibilities
       | might be.
        
         | whitten wrote:
         | I tried to move the cursor and then print at that location
         | through the command line. How do you separate two commands on
         | the same line to do this in the repl?
        
           | jmmv wrote:
           | Use a colon to separate statements.
           | 
           | LOCATE 5, 5: PRINT "Hi"
           | 
           | should do the trick.
        
         | jmmv wrote:
         | Take a look at the docs page in the website
         | (https://www.endbasic.dev/docs.html) and the demos at the top
         | of the gallery (https://www.endbasic.dev/gallery.html).
        
       | khazhoux wrote:
       | A man implemented BASIC.
       | 
       | He did not support '10 PRINT "HELLO"'
       | 
       | He did not implement BASIC.
        
       | hoistbypetard wrote:
       | When I typed
       | 
       | '10 ? "hello, world"'
       | 
       | it got angry. That violates all my expectations of a BASIC :)
       | 
       | Also, is there a good reason the REPL won't let me select, copy
       | and paste text?
        
         | jmmv wrote:
         | The console is hand-crafted and implemented as an HTML or SDL
         | canvas to support rendering text and graphics at the same time.
         | I haven't implemented text selection nor copy/paste on top of
         | that yet (and it isn't in my list of priorities right now
         | because, well, you didn't have a mouse in the old BASIC
         | interpreters anyway ;) ).
        
           | brundolf wrote:
           | You could do Ctrl+[arrow]-style selection/copying for now;
           | should be much easier than mouse integration
        
           | guenthert wrote:
           | But at least Locomotive Basic (TM) of mid-eighties Amstrad
           | computers had copy&paste, there using an odd 'shadow' cursor.
        
             | jmmv wrote:
             | Oh really? That must have been too advanced for when I
             | played with it back in the day :) I'm looking at the
             | CPC6128 manual right now and cannot find "shadow" in it
             | though; what are the right keywords to find this?
        
               | tom_ wrote:
               | https://www.manualslib.com/manual/851404/Amstrad-
               | Cpc-6128.ht... ?
               | 
               | The BBC Micro had a very similar mechanism.
        
         | gushie wrote:
         | I spent 20+ years in my day job programming in BASIC on OpenVMS
         | without using line numbers or GOTO's. Yet the first thing I did
         | here was fall back to my childhood Sinclair/BBC BASIC of trying
         | 10 PRINT "Hello" 20 GOTO 10
        
         | jmmv wrote:
         | Yeah, there are no line numbers (although 0.3 had them!) nor
         | GOTO. I think this is the main thing I'll add in the upcoming
         | 0.10 because it's what everyone asks for :)
         | 
         | https://www.endbasic.dev/docs.html#lang-goto
        
       | Cyder wrote:
       | I first programmed using basica on an IBM dual 5.25 diskette PC
       | but have not been able to find it or an emulator. I did graphics
       | programming with it using commands like line (0,0)-(100,200).
       | I've never been able to find a version if basic that had that
       | graphics capability. I loaded it from Dos typing 'basica'.
       | Anyways, great language to learn on.
        
         | jmmv wrote:
         | EndBASIC has graphics support. Not with that syntax, but
         | hopefully similar enough. You can try things like this:
         | 
         | GFX_LINE 100, 100, 200, 200 GFX_RECTF 300, 300, 400, 500
        
       ___________________________________________________________________
       (page generated 2022-06-07 23:01 UTC)