Physfitfreak wrote:
[snip]
> You are way more proficient in BASIC than I am.
40 years will do that. It's what I use for most of my professional work.
> I knew BASIC and C (and FORTRAN) decades back. I've forgotten all that
> and need serious refreshing so I could write some simple programs for
> fun. I first chose BASIC thinking it would compile faster, but after I
> installed FreeBASIC and ran a few very simple codes I noticed that
> compiling was way too slow for me. So as of now, I'm aiming at
> refreshing of C++, not BASIC.
Modern C++ is very, very different than C "decades back". Might as well start
from the beginning.
> I understand that today's BASIC compilers first convert the codes to
> C++, then compile the newly created code using Windows supplied C++
> compiler. This takes too long, and I suspect this has something to do
> with the decline of BASIC language today.
No, most do *not* compile to C++. Some interpret, some compile to some form
of bytecode, and some compile to machine code (a.k.a. "normal" compiler).
Offhand I can only think of 2 that compile to anything in the C family that
are in active development: BCX (to C/C++) and B4X (to Java). FutureBASIC used
to have a project called FBtoC that allowed Mac apps to be compiled with GCC,
but that appears to be dead. Other BASIC-to-C-ish translators exist, but most
suck, and the ones that don't are generally dead.
(Also, Windows doesn't include any compilers by default.)
> I remember how fast (or slow) compiling of BASIC code was decades back
> on DOS. They were much faster than today's compilers which first convert
> the code to C++.
>
> Is there a way to compile BASIC code today, on Windows or Linux, without
> changing the code first to C++? I'd appreciate if I could get your input.
Compilation speed should not be something that determines your usage of a
language, unless we're talking "hours" (or longer); runtime speed is far more
important. Here's what I currently use for various projects:
- Visual Basic 2022: Free-ish. Compiles to .Net bytecode. Theoretically, apps
can run on Linux and Mac (using the Mono runtime), but realistically, it's
Windows-only. Not really the same as classic VB, but it gets the job done.
Note that the IDE can be slow to open, especially on older machines. (I
also still use VB6 for some things, and a lot of VBA under Excel, because
of course I do.)
- PowerBASIC: Commercial. Windows-only, 32-bit only. (A DOS version is
available but hasn't been updated in a couple decades.) Fast compile times,
fastest runtimes I've seen for BASIC on Windows. GUI and CLI compilers are
separate products, so [shrug]. My preferred BASIC for 32-bit development.
- FreeBASIC: Open Source. You know about this one, apparently.
- Chipmunk Basic: Free. Interpreter. Mainly for Mac but also has Windows,
Linux, and Raspberry Pi versions.
- Xojo: Commercial. Windows, Mac, and Linux; also compiles for Raspberry Pi,
iOS, Android, and web, if you get the Pro version. (Raspberry Pi-only
appears to be free; unsure.)
- B4J: Free. Windows. Part of B4X, this is the one for desktop systems. There
is also B4A for Android development, B4R for Arduino, and B4I, the
company's only commercial product, for iOS. (This started as Basic4PPC,
compiling for PocketPC, Microsoft's competitor to Palm Pilot, about a
thousand years ago.) Very similar to VB.Net.
- App Game Kit: Commercial. Windows only, I believe. Compiles to its own
bytecode, requires an interpreter (a "player"), which is available for
Windows, Mac, Linux, Android, and iOS. Graphical/3D modes only, no windowed
or CLI modes.
I've also tinkered with various other BASICs, including BBC BASIC (various),
PureBasic (commercial, free for Amiga), True BASIC (commercial), QB64 (open
source), XBASIC/XBLite (open source), Liberty Basic (commercial), and, well,
a bunch of others you've probably never heard of. I either didn't like their
dialects of BASIC, or else I didn't like something else about them, so I
didn't stick with any of them.
The one I specifically recommend *against* is Objective-Basic for the Mac,
from the same guy who created Kbasic, as the free version forces you to GPL3
your own source code to stay within its own licensing rules. (Also, it hasn't
been updated since 2012, so it's Intel-only, no Apple Silicon.)
--
...and in her self-loathing and despair she found wrath.