Ask HN: What are your opinions on modern BASIC dialects?

29 points by obdev ↗ HN
I’ve been programming professionally for over a decade with both “business” and “hacker” languages.

Although I’m not unhappy with what I’ve been using, I have developed an interest in BASIC after I was introduced PureBasic and AppGameKit (DarkBASIC).

I’m wondering about your experiences and feelings about today’s BASIC languages.

38 comments

[ 3.4 ms ] story [ 89.1 ms ] thread
VB.Net is like Basic meets C or Java.

I still like Visual BASIC 6.0 for older machines.

If BASIC is the premier language for an environment (like VB6 or VBA) then it’s quite nice.

VB.NET immediately makes you a second class citizen in the .NET world because C# is the language all resources go into with with VB just an afterthought.

Is it still possible to feed C# code through a translator and have it spit out VB.net?

Not a perfect (or even preferred) solution but before I learned C# it helped me do stuff.

I run into the same issue trying to work with Kotlin. It's gotten to the point where I would just rather write in Java

BASIC is how I got started, and I'm always tinkering with making BASIC compilers (https://web.eecs.utk.edu/~azh/blog/teenytinycompiler1.html). I'm open to trying a "modern" dialect, and I think novices could benefit from it as well.

Are there any big efforts towards a modern BASIC?

> Are there any big efforts towards a modern BASIC?

It depends on how you define big and how you define modern, but I feel like freebasic probably counts

I used Liberty Basic back when I was about 9. It was one of my first languages and I held it very dear. I also dabbled a bit in VB, but C# became somewhat popular(/created? I don't remember) around the same time so that took over.

Overall, if you like it, use it! Can't hurt. I wouldn't recommend it for any serious, large projects that would require a team of collaborators, though.

My favorite BASIC of all time was QBasic.

FreeBASIC was interesting - a portable implementation and extension (including OOP concepts) of the original PC QBasic and I enjoyed playing with it a long time ago.

You would have liked BASIC09 on motorola 6809 CPUs running OS9 in the early 80s.
I want to suggest to you that you research AMOS which was a BASIC for the Amiga with very interesting concepts.

I think "spaghetti" is in the eye of the beholder. Alternatively you could argue that GOTO/GOSUB puts BASIC near ASM and that is cool.

I really liked QBasic in the 90's. Its help, debugging functions, and example games you could modify, were amazing to learn programming as a kid.

I also tried some Visual Basic back then, but didn't like it because I loved drawing things with pixels in QBasic (using PSET, CIRCLE, etc..., in e.g. Mode 13h) and VB couldn't do that (at least not any way I knew), only create GUI windows with radio buttons and such, which really disappointed me.

Commodore BASIC V2 taught me 6502 ML.
I've been using Xojo for a little while, which is kind of like a cross-platform Visual Basic. It's pretty nice other than a fairly limited standard library (json is supported but not zip files, no object serialization and limited file/path manipulation functions). Also there's no "community edition" or similar so you have to be pretty sure you want to use it before paying up the $300 for a license.
Just curious, what kind of apps do you build with Xojo?
I was pretty heavy into the QBasic community in the 2000s, and move into the FreeBASIC community once it was stable.

I'd highly recommend FreeBASIC, especially if you enjoy C-style programming. Lots of good libraries and good C library support (give or take writing the headers by hand or translating)

I tried QB64, but I'd only recommend that if you want nostalgia. By default, it gives that classic QBasic IDE interface, and feels very self contained.

+1 for FreeBASIC, very underrated language with many expected modern trimmings.
I have made an easy programming language, which is not BASIC, but has some similarities with the old home computer BASIC variants. Variables don't have to be declared, you can draw on the screen with simple commands, you don't have to install anything and you can start right away, etc.

https://easylang.online/ide/

I was just playing with EasyLang the other day! Here are my initial thoughts after playing with it for half an hour or so. An intermediate to experienced programmer will have no problem understanding it. But more documentation may be in order for the complete beginner who may not understand syntactic sugars such as '+=, -=, *=... My 13-year old son is learning Python and Lua and he could make out most of the syntax. Of course, he's not used to seeing 'end' to delineate blocks of code like in Basic (eg. if end, while end (wend) as well as periods '.'

EasyLang feels like a blend between Basic and Python. It appears to be indentation-based like Python or at least the 'IDE' autocorrects any whitespaces I added to the sample code. So it appears EasyLang uses both indentation to define blocks of code as well as keywords/chars like 'end' and '.'

I really like the look of EasyLang, the syntax is terse (like replacing 'print' with 'pr', but unfortunately it also appears to lack one feature that was noticeable right away to my son and that's the input-prompt function found in both Python and most Basic variations.

age = input("How old are you? ") # Python

input "How old are you?", age # Basic

It appears I have to create two statements in EasyLang. I know some languages will allow you to place two statements on one line using a delimiter such as a colon ':' or such, but I could not find one that would work. So two separate statements it is:

pr "How old are you? "

age = number input

pr "So you are " & age & " years old."

Possible future features I might like to see: String interpolation such as: pr $"So you are {age} years old."

And it would be helpful if the 'IDE" could display vertical lines to delineate blocks of code, especially when periods '.' are employed.

Otherwise, Great work! I'm always amazed at the talent required to create a new programming language. I will continue to explore EasyLang with my son. :)

Cheers,

Gary

Hi Gary! Thanks for your feedback and the really good suggestions. Multiple statements in one line are possible since today - just separate commands with a semicolon. Vertical lines to visually connect blocks would be cool, but now I have no idea if and how to do that. The IDE can automatically correct whitespace, since blocks are terminated with 'end' or '.'. I am looking forward to further feedback from you, also by mail.
I started in BASIC, and loved it. I was profilic, even. C and such were so ugly and hard in comparison.

Once I grew and learned other languages, I only then realized why BASIC is/was weird and 'bad', as people say.

I love that BASIC existed for me, and I learned a lot, but I don't think it has much value today.

I think Python is a similarly easy language, and one people can immediately be more productive in.

It seems like the poster is asking about PureBasic and it's competitor (PowerBasic). These are modern Basic languages that run very fast and compile into small executables with solid library support. I believe the two front runners are both commercial products, but pretty cheap (a lot less than an annual subscription for most IDEs).

I don't think they were referring to QBasic or VB6 or anything like that.

BASIC can be quite powerful. The version on the Sinclair QL was ahead of its time, for example.

For modern BASIC, you have some interesting choices such as EndBASIC, which is written in Rust and which has some very cool features:

https://jmmv.dev/software/endbasic.html

I grew up with many versions of BASIC, the best ones I used were Locomotive BASIC and GFA BASIC. Today's BASIC languages, like FreeBASIC, don't feel like the old BASICs anymore. Furthermore, the power of BASIC in the 80s was that it was on almost every home computer, but that is no longer the case. I think today's equivalent of BASIC is Python.
Python is way too complex and fiddly. Nope, today's best equivalent of BASIC is Go.
Both horrible entry level programming languages. Compared to basic or pascal
I notice each month the high positions of Visual Basic (#6 in Sep 2021) and "Classic Visual Basic" (#11) in the Tiobe Index https://www.tiobe.com/tiobe-index/ . Is Tiobe exaggerating the popularity of these Basics or are they really so popular but rarely discussed?

I liked VBA when I used it within Excel.

I've been playing with classic BASICs recently, especially dialects for pocket calculators. Here are some random thoughts from this exercise:

"PRINT USING" is terrible (vs. C's formatted strings).

"INPUT A" is not versatile enough. I should be able to prompt with the current value of A, so user can hit enter to keep the current value. None allow you to print the current value of A (INPUT STR$(A)+">",A does not work anywhere). Some dialects allow you to retain A: TRS-80 BASICs do it. MS-BASIC sets A to zero if user just hits Enter.

Pocket computer BASIC allows you to enter an expression as a response to INPUT, such as A+1.

Modern calculators allow you to enter equations in textbook format. I kind of think modern BASICs should support this- no reason to be stuck in the early 60s teletype world.

Pocket computer BASIC allows you to bind programs to keys (or at least entry points to keys: you can have a key jump to a line with a key-label).

Pocket computer BASIC allows you to read the last entered value (AREAD command in Sharp).

Here is a benchmark which shows why these things can be important, at least in the realm of pocket computers and calculators:

https://github.com/jhallen/calculator/wiki

VB.NET is a decent programming language.
But managed horribly. When .net cute would have made it a first class citizen and support for vs code being offered adequately it would have been a nice sorry especially nowadays with notebooks and web ides
My first programming language was (I think) BBC Basic. Later on I used AMOS Basic which was tailored to do amazing stuff using the Amiga hardware.

AOZ studio[1] is (I believe) a modern descendant of AMOS (but without the Amiga). Every now and again I visit the language's homepage but I haven't downloaded and played with it yet.

[1] - https://www.aoz.studio/

Others have already shared their opinions on BASIC past and present. I agree with most.

In the event you are willing to explore another language I might suggest to have a look at Lua.

https://www.lua.org

Another very popular Basic language under very active development is B4X. It must have one of the most vibrant forums I've seen.
The problem with PureBasic is the executables it compiles are flagged aggressively by antivirus software. Have a look at their forum, it is a major issue for developers who have invested a lot into building software with the language.