[HN Gopher] Why am I wasting time on EndBASIC?
       ___________________________________________________________________
        
       Why am I wasting time on EndBASIC?
        
       Author : todsacerdoti
       Score  : 49 points
       Date   : 2021-01-23 18:31 UTC (1 days ago)
        
 (HTM) web link (jmmv.dev)
 (TXT) w3m dump (jmmv.dev)
        
       | jes5199 wrote:
       | I've recently unearthed a copy of WORM.BAS that is written to run
       | on ZBasic for the Zenith Z100 - it's the version of "snake" I
       | played as a child. I wish I had an interpreter that could run it,
       | but it relies on the Z100's direct access to the RAM that holds
       | the text mode font, in order to overwrite the letter shapes with
       | bitmaps of sections of the worm/snake. I have, more than once,
       | tried to port it to a modern context, but the old coding style
       | (no explicit subroutines, just GOSUBs) is very hard to read and
       | even though it is not a lot of lines of code, it is a very
       | painstaking process. I don't know if hacking a BASIC interpreter
       | would _help_ , but it might!
        
       | jmmv wrote:
       | Hello everyone! Original post/project author here.
       | 
       | I'm honestly surprised to see this bubbling up to the front page
       | after it was originally shared five days ago and failed to gain
       | traction then. But anyway, thanks everyone for stopping by. It
       | was a good surprise.
       | 
       | Coincidentally, I have just pushed a new 0.5 release and a
       | follow-up blog post that might clarify some of the questions I've
       | heard so far: https://jmmv.dev/2021/01/endbasic-0.5.html
       | (although briefly; I'll elaborate more on answers in future
       | posts).
       | 
       | And, well, feel free to AMA!
        
         | retr0nerd wrote:
         | Cool stuff, man!
         | 
         | I also love to dabble in old, long-dead technologies and feel
         | no need to justify it to anybody. I tinker with old 8 and 16
         | bit Commodore machines writing code and building hardware and
         | it gives me such a thrill because "young me" would have killed
         | to do this stuff.
        
       | _tom_ wrote:
       | LOL.
       | 
       | I, too, recently implemented BASIC. It was something to do while
       | bored. I was motivated by a desire to play the old star trek
       | game, which it now does. It's called TrekBasic, but the github
       | project it still private, as it's just a fun hack.
       | 
       | It is not as cool as yours, as I wrote it in python. It does have
       | better features for developers than most BASICs from long ago:
       | Code breakpoints         Data write breakpoints         Single
       | stepping         Execution timing         Execution tracing
       | Code coverage reports         Reformatting         Renumbering
       | 
       | I think my next step will be to move it to LLVM, just for the fun
       | of learning about LLVM.
        
         | _tom_ wrote:
         | Ok, I just made the repository public, in case anyone is
         | curious: https://github.com/cocode/TrekBASIC
        
           | stevekemp wrote:
           | I wrote a simple BASIC too, for nothing more than a sense of
           | nostalgia:
           | 
           | https://github.com/skx/gobasic
        
           | ryandrake wrote:
           | Nice, I remember vividly being 11 years old and typing this
           | line by line into a Commodore 64, carefully reading it from a
           | ragged copy of "101 BASIC Computer Games". Took me three days
           | to get it right. I slept next to the computer so my dad
           | wouldn't turn it off by mistake.
           | 
           | Later ended up porting it to Pascal and adding graphics, in
           | an attempt to learn the language.
        
             | benibela wrote:
             | I still write almost all my code in Pascal
             | 
             | Why am I wasting time on Pascal?
        
               | butterisgood wrote:
               | There are modern iOS games written in Delphi last time I
               | looked around.
               | 
               | I've been spending a little time with ActiveOberon, which
               | might look familiar to a Pascal user. It's an interesting
               | language and environment. Reminds me of Smalltalk the way
               | the platform works (or Pharo for a modern Smalltalk
               | environment), except you absolutely can create more
               | "native" binaries for your environment with it.
               | 
               | ActiveOberon might be one of the first places
               | async/.await style concurrency was implemented. It
               | definitely predates Rust by a bit.
               | 
               | The Fox compiler is an interesting beast too! They're
               | still working on the language. The tip of their SVN tree
               | has enhancements over the language report that was
               | published in 2019 http://cas.inf.ethz.ch/news/2
               | 
               | Now there's ternary conditionals, functors (per C++, not
               | Category Theory) etc.
               | 
               | Last update to the repo was 11 days ago. It's very much
               | alive it seems :-)
        
               | mysterydip wrote:
               | If Pascal does the job, why not?
        
               | jes5199 wrote:
               | Pascal was my first language, and I really miss some
               | things about it that didn't make it into the popular
               | modern languages
        
         | xkriva11 wrote:
         | Old Basics had quite impressive debugging features. It had
         | breakpoints (STOP), you were able to inspect and change the
         | content of the variables, change code before or after the
         | breakpoint - and even on the same line - and then CONTINUE from
         | the interruption point. Even ZX80 with 4 KiB of ROM (Basic + OS
         | routines + 0.5 KiB character table) was able to do that (except
         | modification of the same line because it had one command per
         | line only)
        
           | jmmv wrote:
           | They indeed are. As I keep referring to the Locomotive BASIC
           | manual and the QuickBASIC builtin help to implement my
           | version, I'm amazed at how many features those had.
           | Especially the latter was a great IDE even when compared to
           | today's standards.
        
             | Doctor_Fegg wrote:
             | Locomotive was a great dialect. Fully featured and
             | consistent with few of the arcane incantations that other
             | 8-bit BASICs had.
        
       | sigzero wrote:
       | BECAUSE is a great reason to do it.
        
       | lokedhs wrote:
       | I tried the online version and it's really neat. I really like
       | the idea of having a commandline but also an editor you can
       | easily switch to. I have only seen this implemented once before
       | (the BASIC that is shipped with RiscOS).
       | 
       | I understand the author is not working on this for fame, but
       | BASIC is really underrated as a learning language these days.
       | This could be a pretty good playground for teaching kids
       | programming.
       | 
       | I'm going to be so selfish as to give two suggestions/requests.
       | The first is to have a way to switch to a white background in the
       | editor (I managed to do it in the commandline), since it's hard
       | to use for someone with astigmatism like myself.
       | 
       | The other is some graphics features. They may exist but I didn't
       | find any. Something that I really enjoyed as a kid, learning to
       | program, was to use commands such as LINE, CIRCLE, RECTANGLE etc
       | to draw things on the screen. Being a Commodore 64 user, I didn't
       | hey much opportunity to do that until I got a BASIC extension
       | that supported graphics.
        
         | jmmv wrote:
         | Thanks for trying it out and for your suggestions.
         | 
         | As for the white background, thanks for the information on how
         | it plays out with astigmatism; had no idea! I'm still thinking
         | how to add how some form of configuration so that those
         | customizations can stick. (The new release I published today
         | has support for an AUTOEXEC.BAS, so probably that combined with
         | some global environment variables could do the trick.)
         | 
         | As for graphics, definitely. I want to add the features you
         | mention as well as PLAY for music... but that will require some
         | reworking on how the web UI works and I'm not sure how I'd add
         | those to the CLI. But these are definitely in my mind.
        
       | bovermyer wrote:
       | This is akin to the "Forever Project" concept described by Scott
       | Turner of Here Dragons Abound:
       | https://heredragonsabound.blogspot.com/2020/02/the-forever-p...
        
         | jes5199 wrote:
         | ooh, this hits at some things I've been seriously struggling
         | with. thank you for the link
        
       | amelius wrote:
       | Please make it work on microcontrollers. And write a book aimed
       | at children to go with it.
        
         | pjmlp wrote:
         | I think MicroPython already claimed that place.
        
           | teddyh wrote:
           | Or Snek.
        
         | jmmv wrote:
         | That'd be nice indeed. As part of the 0.5 release I have just
         | published, I split the language core from the standard library
         | to ensure the former remains as small as possible. So far, it's
         | at 2,500 lines of non-test code and about 480kb compiled. Not
         | the tiniest, but not too huge! (I know, possibly still huge for
         | microcontrollers, but I'm not too familiar with that domain.)
         | 
         | As for a book... yeah, that'd be nice too. I attempted to write
         | some worksheets earlier with screen-related concepts
         | (rows/columns, cursor positioning) but, well, uncovered enough
         | bugs at the time that I had to put those in the back burner ;)
         | I'll keep thinking about this though, as a few individuals have
         | also asked for something similar.
        
       | pjmlp wrote:
       | While this one was done in Rust, I keep thinking someone will
       | eventually come around with a QuickBasic to WASM compiler,
       | written in QB64. :)
        
       | Abishek_Muthian wrote:
       | I recently learnt that 80's high school math text book in U.S.
       | had BASIC program for graphing calculator[1], I felt that's a
       | great way to teach programming.
       | 
       | Not sure whether its being continued in some form, but I feel a
       | python code to compute problems in math and other science
       | subjects needs to be part of curriculum everywhere.
       | 
       | [1] https://twitter.com/heavyinfo/status/1352888793070620672
        
       | lokedhs wrote:
       | This post mirrors my feeling on this topic as well. Just like the
       | author, I'm also working on a programming language which will not
       | be used by a lot of people.
       | 
       | In fact, having a lot of users would make things complicated as I
       | would have to stop making incompatible changes if I want to try
       | something new.
       | 
       | Designing your own programming language is such a nice hobby, and
       | something I believe a lot of programmers do. In fact, I would
       | like to see links to other people's programming languages, just
       | to see what people are playing around with at the moment.
       | 
       | Here is my project: https://github.com/lokedhs/array
        
       | hakfoo wrote:
       | On the page, he comments roughly "Basic isn't the language of the
       | future" and makes a joke about the wide usage of Visual Basic.
       | 
       | We shouldn't cast shade on any language like that ( except
       | JavaScript, which deserves all the shade).
       | 
       | The right programming language is the one that lets you express
       | yourself clearly and accurately, and solves your problem with a
       | reasonable tradeoff between implementation overhead and execution
       | costs. That's going to vary based on the problem space and the
       | developer's background. Should he spend 40 hours learning the
       | latest meme language and cobbling together an amateur-night
       | solution rather than 20 minutes actually making something that
       | works with tools that fit the job properly?
       | 
       | Yeah, if the only BASIC you ever used was the pack-in one on the
       | Commodore 64, you're probably fighting the language as much as
       | you are solving the problem. But a modern BASIC, with a rich
       | library, can be a perfectly valid tool choice. In some ways, a
       | traditional and restrictive syntax can be a boon: you're strongly
       | nudged to work within the limitations rather than wandering down
       | trendy architectural rabbit holes.
        
         | newswasboring wrote:
         | > The right programming language is the one that lets you
         | express yourself clearly and accurately, and solves your
         | problem with a reasonable tradeoff between implementation
         | overhead and execution costs.
         | 
         | Yeah but thats not the reason why BASIC is around is it? Its
         | around simply as legacy or because MS insists on including it
         | with Excel which makes it a path of least resistance choice.
         | Lets not get too high and mighty about BASIC or VB.NET like
         | stuff. They are bad tools, so are most other tools we use. We
         | just make it work not because its possible, but because nobody
         | wants to go through the requisition forms.
         | 
         | Edit: This comment is brought to you by my painful existence
         | with MATLAB
        
           | JohnStrangeII wrote:
           | It's not just for legacy purposes. I've written a few useful
           | personal tools in Purebasic, for instance. BASIC dialects
           | tend to provide the functionality needed and can be handy for
           | quickly throwing something together when you don't have the
           | time to deal with GUI frameworks and complex libraries. You
           | can also use Python or Go, of course, but they do not have
           | integrated IDE and do not have a rich command set in the core
           | language. Easy deployment and compact executables are also a
           | plus of some existing BASIC dialects. If I had the money /
           | the investment in a license would give me a good ROI, then
           | I'd also pay for Xojo, for example.
           | 
           | Whatever gets the job done without wasting time.
        
             | newswasboring wrote:
             | > Whatever gets the job done without wasting time.
             | 
             | Completely agreed. My point isn't that these tools can get
             | the job done, but that I see too many people praising them
             | because they can get the job done. There is a difference
             | between done and useful. I can throw together a market
             | model in excel quite fast and easily, its "done". It might
             | even be useful in your case, but please don't give high
             | praise to it because no real world task has ever ended with
             | that task. Everything you will create, especially software
             | will be reused. That's the whole point and power of
             | software. These tools make it incredibly hard to reuse
             | anything. I think we should have higher standards for our
             | tools, especially when whole companies are being built on
             | it (don't think google here, think portfolio management
             | companies and Excel).
             | 
             | Edit: I would like to include an example of a spoon. I can
             | bash in a small nail using it, it will not be good, but it
             | will be done. It will stick one piece of wood to another.
             | but would you praise the spoon as a hammer replacement?
        
               | pjmlp wrote:
               | In a life sciences research center I worked with, the
               | work was definitely not done after those scientists got
               | their csv processed files out of the cell reader own data
               | format, generated using their home made VB.NET tool.
               | 
               | It didn't matter, those files were done used as input
               | data into Tableau for further processing, where they
               | could carry on doing the work that actually mattered to
               | them.
        
       | vzaliva wrote:
       | This statement is little naive: "If I wanted to change the
       | language per se to offer a more "modern" experience with things
       | like first-order functions, objects, etc. it'd be trivial to do
       | so."
       | 
       | Of course simple simulation of these features could be easily
       | added, but many of more complex modern language features have to
       | be designed from ground up. But I guess it will be the next
       | learning experience for the author and he can have a lot of fun
       | with it as well.
        
         | jmmv wrote:
         | The point of that comment wasn't to say that implementing all
         | language features is trivial, nor to say that designing a
         | language from the ground up is easy.
         | 
         | But rather, than the "shape" of the language I currently
         | implemented is irrelevant. Conditionals and loops are
         | conditionals and loops everywhere. Adding new features isn't
         | easy, but changing how the existing ones look like is. In other
         | words: if you came to this project and left just because BASIC
         | was in the name... well, that's the least interesting part of
         | the whole thing.
        
       ___________________________________________________________________
       (page generated 2021-01-24 23:02 UTC)