Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
FreeBasic (freebasic.net)
105 points by debo_ on Dec 22, 2023 | hide | past | favorite | 70 comments


I started programming when I was around 12. My teacher told me about how he learned BASIC in school...so I went home and looked up BASIC. I had a lot of fun messing around with qbasic/qb64 and finally FreeBASIC. Semi-related but one of my favorite books of all time was Creating Adventure Games On Your Computer by Tim Hartnell. It's wild to think how much of an impact that book and FreeBASIC had on me. If I could upvote this a thousand times I would.


Thanks very much for this book reference. Our son (10yo) is learning to code and after quite a bit of research (and to my own huge surprise), I've pointed him to QBASIC (via DosBOX).

I'm just a hobbyist, and approaching 40, so maybe this is pure nostalgia. But I do think text adventures (especially writing one yourself) are still a great way to teach coding -- and the whole keyboard-centric paradigm of computing. As a side note, being a non-native speaker, I learned quite a bit of English with the legendary adventure games by Sierra and Al Lowe. Great teacher, extra credits for his quirky and naughty, but yet so intelligent humor, of course. :)

Currently we're going through a QBASIC tutorial by Ted Felix: http://tedfelix.com/qbasic/

I think it is really well thought out and structured; looks like a great "more traditional" introduction to programmer's way of reasoning for kids around 10-12. I also like the empathetic language the author is using -- he has clearly put some thought into how to explain things so that a 10-or-so year-old kid would understand it while reading on their own.

I am actually in the process of translating this tutorial to my language (Estonian). Most of it is already done, and I can confirm that our son is doing really well reading it and trying out the examples entirely on his own. The QBASIC IDE is IMO still really good due to the instant feedback the child gets while messing around with it.

The same author Ted Felix also has a follow-up about creating sprites in QBASIC: http://tedfelix.com/qbasic/sprites.html

Another great BASIC-based environment for children appears to be LowResNX: https://lowresnx.inutilis.com/

Haven't tested it out myself, but after we're done with the QBASIC book, we might move over to this one, actually. The manual looks great, might be quite accessible for a 10-12yo kid's self-study: https://lowresnx.inutilis.com/docs/manual.html

It is definitely strange to reach for BASIC as a teaching language in 2023. But, this is an argument that has been echoed on HN as well, today's popular languages do seem somewhat overkill for a child's first independent explorations. But, again, I am just a hobbyist, no intention to grow a programmer out of our son. I would actually just like to teach im thinking skills, and a way to have some intellecual fun.


For me TurboPascal set the standard for power and ease of learning. The IDE was fast and solid.

It would work if you were a newbie and grow with you as you got more advanced. The language manuals were well written and in places quite funny.

Compile time was ultra fast, and if you wanted to go deeper you could. (assembly).

I dont know of any popular IDE right now that is as complete and easy to use.


The QBASIC/QuickBASIC IDE was also quite good for its time. Either way, there's still nothing quite like it on modern systems. There are a few terminal text editors with intuitive TUI's and key bindings, but none of them provides the full IDE featureset and easy access to documentation that these tools had. (Hopefully we'll get there at some point. Perhaps by starting from the codebase of a modern GUI editor like lapce and providing a TUI frontend to expose the same features.)


Is the FreePascal IDE essentially a clone of the TurboPascal IDE, or does it have any shortcomings?


It's a very close look-a-like and it works quite well in practice but the codebase is quite messy, with many things still being based on old MS-DOG and its quirks. Would need a ton of refactoring to make it more extensible on modern systems.


I started programming with QBASIC at about 10 years old, too, after randomly coming across a book called “Practise Your BASIC”. It’s a great book and Usborne recently released it for free: https://usborne.com/gb/books/computer-and-coding-books


Not on topic but your English is perfect. Indistinguishable from a native, at least in written form.


Oh, I don't recall anybody ever explicitly saying something like this to me. Makes me happy for sure, especially considering that I actually did not learn the English language at school back in the day; we had German. Many thanks!

Those Sierra adventures probably did have a considerable, even huge impact on my early encounters with the English language, though. Basically, it was "learning by typing" [1], so it must have greatly contributed to the grasp of grammar and spelling early on.

This is actually a reason why I still consider text adventures a great learning tool for children. The child is playing a game (or coding their own), but because it is so text-heavy, they also improve their language and writing skills, without even noticing it. Leisure Suit Larry style jokes are not a compulsory part of this syllabus, though. :)

1: "Ken sent me"! :) https://invidious.protokolla.fi/watch?v=JWlTR29stts


The Ted Felix tutorial reminds me of the beginner's guide I got with my VIC-20 -- easy enough for a five-year-old (me) to read and follow, and it got me thinking of the kinds of programs I could build on my own.


This is exactly what happened to our son (10yo) as he went through the chapters. He would start seeing everything around him (and, particularly, in his Minecraft environment) in if-else statements, etc. It was quite fun to observe.


I remember the same thing and eventually seeing DarkBASIC in stores and PureBASIC on a few shelves as well in the 90s. I gravitated towards BlitzBasic because the developer (Mark Sibly) was genuinely interested and improving his system, forging a good community and making some cool looking stuff along the way. For years I wrote BB, B3D, and a few other dialects of BASIC for doing game-related and demo-related things.


I'm so excited about this because I first got interested in programming via the same book that was for some reason on a shelf in my primary school's computer room!!! They did show us basic computer literacy stuff which was already ahead of its time but no programming or anything like that.

I remember not really understanding at the time and then years later coming across Visual Basic and the name ringing a bell, and then I was off to the races! So much fun.


I found that book in a library as a kid -- or maybe a similar one, it's hard to remember now. I do recall typing in long listings from the book and then trying to "fix" the compile and runtime errors by randomly trying things.


I think the fact that the old 8-bit computers booted straight into BASIC and came with amazing manuals (at least Amstrad) that taught you programming was amazing and what made me a software engineer in the end. I shared some of this amazement and examples in: https://retrofun.pl/2021/05/18/hobbyarding/

But with BASIC getting so much hatred since the 70s... I started with the famous Dijkstra quote and did an investigation - was it really that bad? https://retrofun.pl/2023/12/18/was-basic-that-horrible-or-be... It was amazing to see the language origins and how it compares to the alternatives.

Today BASIC dialects are really advanced. Even BBC BASIC has structs now!


BASIC dialects were already quite advanced in the 1980's, VMS Basic, Turbo Basic, Quick Basic, AMOS, Acorn Basic, for example.

Originally BASIC used a JIT compiler, it was due to the hardware limitations of 8 bit systems that it was know as interpreted language for most folks.

16 bit and 32 bit BASIC supported structured programming, AOT compilation and everything one would expect for systems programming.


Dijkstra was a blowhard anyway. He belived students should prove programs correct on paper before they were allowed to type them into the computer. Basic on the other hand allows a fast feedback cycle of experimenting and learning.


“Bad” depends on purpose. For teaching novices a bit is programming, I think old-school BASIC with line numbers and goto is hard to beat.


Agreed. It also turns out that the features Dijkstra seen in BASIC at the time was half of the features you'd have on an Amstrad in the 80s, so it's not even apples to apples.

I also did an experiment not to praise BASIC without criticism and tried Advent of Code in BBC BASIC... it makes you focus on the "how" a lot, almost like assembly, while modern higher level languages let you focus on the "what" instead. On the other hand that still makes it good for learning how things really work. Not having a string.split for example makes you iterate over the string instead, and you'll be aware how split works whether you wanted it or not.


I really miss the Blitz Basic family of game engines. https://en.wikipedia.org/wiki/Blitz_BASIC

After reading the wikipeda page I found out Mr Sibly made them open source in 2014. I wonder if there is much community around them now?


There kind of is a community, but it's hard to say. Long ago in the earlier days of BB and B3D we had great community support because (a) most of us were on the official blitzresearch servers and (b) many of us were on blitzcoder.co.uk because of some of the problems at the official servers.

I'm still friends with many of the prolific creators on Facebook in that space.

It was FOSS'd in the later years, which is great, but it doesn't really solve many of the problems or make it easier to work with BlitzBasic code for most people. Some of us spent some time on some translation layer-like technologies with the main goal usually being someone can run a `.bb` file in the browser having it auto-transpiled into a bastardized version of Ecmascript running WebGL.


Yes of course. Blitz BASIC has transformed into Cerberus X which is my personal favorite BASIC: https://www.cerberus-x.com/community/index.php

It is a very capable language, as you would expect from it's beginnings (as Monkey X) under Mark Sibly.


Check out blitzmax.org and what NG offers.


My first language was Locomotive Basic 1.1 on an Amstrad 6128. The best thing about it was the huge manual that came with it. Not only did it have FOR/NEXT but also WHILE/WEND and the interesting ON x GOTO y1,y2..yn where x was anything that evaluated to an integer and the y's were line numbers.


that manual was my favorite book when I was a kid! it taught everything. Computers in general, programming, two languages, two OSes!


I learned Basic on a ZX Spectrum clone when I was a kid.

It was harder to structure the code because there were no functions and subroutines, just line numbers and goto.

No while, no fors. Just ifs.

When I've learned x86 assembly later, it didn't seem too different to me.

This variant of Basic is more close to Pascal for me than the Basic I've learned.


I've started on the ZX Spectrum too, as I recall the built-in BASIC had GO SUB and RETURN statements so you could do subroutines. It even had FOR loops.

Allowing only a single letter for string variable names was a pain though ;)


Then I don't have a good memory of it.

GO SUB line number isn't the same as using GOTO?


With GOSUB you can use RETURN, but not with GOTO. GOSUB is for subroutines. (At least that's how it was on MS BASIC.)


Then I don't have a good memory of it.


Sinclair ZX Spectrum (Sinclair BASIC) had subroutines and looping. See: https://worldofspectrum.org/ZXBasicManual/zxmanchap4.html https://worldofspectrum.org/ZXBasicManual/zxmanchap5.html

Timex Basic featured on the "clones" they produced is said to be a a superset of Sinclair basic, in which case then Timex Basic has the same features.

I am not 100% when it comes to the ZX81. I did most of my programming on the ZX Spectrum.

I wrote a database engine and front end on it. (There really was no backend and frontend it was all just one program. But the engine was versatile and easy to build a new front end on top of. I tried selling it for a while without luck. (Which was probably a good thing).

Looking back on it now its embarrassing. I had no real idea what a database was, or how to functioned inside. But given my age and tools available it was ok-


As Timex 2068 owner can confirm the superiority of its BASIC and extensions.

However for games, I needed to use the 48k emulation eprom cartridge, and with 128K ZX was on the edge again.


> there were no functions and subroutines, just line numbers and goto. No while, no fors. Just ifs

Your memory is a little hazy because the ZX Spectrum had both subroutines and for loops (I believe all Sinclair machines did).


Line numbers and goto make it really easy to learn to write simple programs.


weird clone. ZX Basic had for loops. I know very well because I wrote a program to help me to memorice multiplication tables on a ZX Spectrum when I was a kid .


It wasn't a weird clone, it's flakey memory from the commenter.


OP forgot the Basics.


:-D

Indeed. But it was a long time ago. I didn't mean to snark. It's forgiveable.


I looked up BASIC for mac, and lo and behold, there seems to be only one, by Nikolay Denislamov that is useful, and it's limit-ware (program size) and $12 to go "premium". Not even GAMBAS.

I found Basic! and techBASIC on the ipad, and they might run on Apple Silicon.

The latter is not in the appstore these days.(It seems to have morphed into something else)

(quick download) Basic! runs on Ventura/MacMiniM2. How well is TBD.

I'll set up a linux system for fun as soon as I get some things sorted out.

Not promoting any of these. My first BASIC was Palo Alto Tiny Basic, typed in or read in on paper tape (I had to set up the reader and program first) on the IMSAI.

For linux, I am pretty sure that GAMBAS will run. I have not researched others.

Happy Interpreting!


I think GAMBAS is excellent, probably the friendliest environment I've found for teaching kids, certainly the closest the the feeling of something like QBasic or early Visual Basic. Decent language, good IDE with built in docs, creating UIs is a breeze. Good stuff.


There's a few Mac based BASICs but I'm not sure how they fare now with the new CPUs.

Come share your findings with us in the discord BASIC community if you use discord: https://discord.gg/rWaFeCca3P


You probably know this but Apple created a MacBasic early on, around 1985. It was very fun, but never officially released. Sadly Microsoft quashed it.


Xojo (formally RealBASIC) might be what you want if you just want to learn. It runs on Mac, Windows, and I think Linux and allows you to target the web, iOS, and Android.


BBC BASIC with it's SDL IDE work ok on a mac too!


What features are you looking for and what kind of “Mac support”? EndBASIC runs natively on macOS :)


Don't forget PC-BASIC: https://robhagemans.github.io/pcbasic/

You can type in IBM PC DOS BASIC programs for GWBASIC in them and run them.


I’ve had my eye on https://www.aoz.studio/ for awhile. It’s by the guy who did STOS and AMOS and seems a very beginner friendly game programming tool using some variant of Basic.


Seems a bit expensive/restricted as a daily driver for programming in.

You may want to check out https://www.b4x.com for something that on the surface looks similar.


For me it was STOS on the Atari ST after seeing BBC BASIC at school.


I've been dismissive of BASIC as an outdated and terrible language since reading some old programs written in it. But reading the docs and examples for FreeBasic actually make it look decent. Static typing, decent syntax, and I don't even have to start all my lines with 10 20 30 so I can JUMP to them!


Serious question: What makes BASIC BASIC? I don't see anything in the FreeBasic example code that looks anything like what GWBASIC was 40 years ago. No line numbers and not a single GOTO. Is there still support for compiling old style BASIC or did the BASIC name move on to mean something completely different from what it used to?


That reminds me: There’s PC-BASIC available for all platforms that emulates GW-BASIC:

https://robhagemans.github.io/pcbasic/

Since I’m kind of a data hoarder, I’ve put my GW-BASIC files from the early 90s on GitHub:

https://github.com/mbirth/gwbasic


In this particular case, FreeBasic was written in Visual BASIC for DOS 1.0 until it could compile itself. But you're right that some of the original syntax it's added (e.g. C-style pointers) takes it a bit away from what BASIC was.


Yeah, BASIC started out painfully primitive, but it did eventually get pretty decent structured programming features (say, GOSUB with labels instead of just GOTO)


there are some BASIC dialects that can give other modern languages a run for their money. Check out on of my favs: https://www.cerberus-x.com/cxDocs/Programming_Language%20ref...


"Cerberus X is a high level programming language based on the popular 'Blitz' range of languages, and was inspired by both Java for its streamlined language, and BASIC for its readability."

Interesting language. I've never heard of Java as streamlined though ;)


Sounds like an in-joke :D I wonder if it's one of those "don't be like Java" things!


That would be hilarious


I started with the basic family of languages. VB6, QBasic (yes in this strange order), VB.Net, PowerBasic, FreeBasic.

FreeBasic was probably the most fun of them to me: cross-platform, compiles to fairly fast running binaries, can easily interface with libraries written in C, and has qbasic syntax mode.


To me, the most critical thing in the hobby market right now is the lack of good software courses, books and software itself. Without good software and an owner who understands programming, a hobby computer is wasted. Will quality software be written for the hobby market?

Almost a year ago, Paul Allen and myself, expecting the hobby market to expand, hired Monte Davidoff and developed Altair BASIC. Though the initial work took only two months, the three of us have spent most of the last year documenting, improving and adding features to BASIC. Now we have 4K, 8K, EXTENDED, ROM and DISK BASIC. The value of the computer time we have used exceeds $40,000.

The feedback we have gotten from the hundreds of people who say they are using BASIC has all been positive. Two surprising things are apparent, however, 1) Most of these "users" never bought BASIC (less thank 10% of all Altair owners have bought BASIC), and 2) The amount of royalties we have received from sales to hobbyists makes the time spent on Altair BASIC worth less than $2 an hour.

Why is this? As the majority of hobbyists must be aware, most of you steal your software. Hardware must be paid for, but software is something to share. Who cares if the people who worked on it get paid?

Is this fair? One thing you don't do by stealing software is get back at MITS for some problem you may have had. MITS doesn't make money selling software. The royalty paid to us, the manual, the tape and the overhead make it a break-even operation. One thing you do do is prevent good software from being written. Who can afford to do professional work for nothing? What hobbyist can put 3-man years into programming, finding all bugs, documenting his product and distribute for free? The fact is, no one besides us has invested a lot of money in hobby software. We have written 6800 BASIC, and are writing 8080 APL and 6800 APL, but there is very little incentive to make this software available to hobbyists. Most directly, the thing you do is theft.

What about the guys who re-sell Altair BASIC, aren't they making money on hobby software? Yes, but those who have been reported to us may lose in the end. They are the ones who give hobbyists a bad name, and should be kicked out of any club meeting they show up at.

I would appreciate letters from any one who wants to pay up, or has a suggestion or comment. Just write to me at 1180 Alvarado SE, #114, Albuquerque, New Mexico, 87108. Nothing would please me more than being able to hire ten programmers and deluge the hobby market with good software.


Paul Allen has long been dead WTH you are talking about?


I'm not sure, but I'm willing to bet that's is the "open letter to hobbyists" by bill gates from the late 1970's.


The above letter was written by the young William H. ("Bill") Gates III. At the time, Paul Allen was still alive.


tru i blame huey


This group is trying to bring back VB. Not BASIC but related.

https://www.remobjects.com/elements/mercury/


It is not like VB.NET with Windows Forms is that different from VB 6.

Unless you care too much about the AOT compiler or the easiness to create and use COM libraries.


I still use BlitzMax NG - blitzmax.org


Is it x86 only?



looks like so. but many OS's. And native




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: