
BaCon – BASIC to C converter - networked
http://basic-converter.org/
======
marktangotango
I was curious to see what 'type' of BASIC this project translates, turns out
it implements it's own version of BASIC similar to qbasic. It's essentially a
thin veneer over C with arrays, records, and dictionaries. It allow dynamic
memory allocation. I've often pondered what the minimal BASIC would consist
of, and this implementation hits all the things I'd expect: subroutines,
functions, records, arrays, dictionaries.

I didn't see anything in the documentation about garbage collection and
reference counting. The language has the ability to return arrays from
functions, but the arrays are required to declared static. How is this
different from just declaring a global array? How does the language prevent
memory leaks with strings and arrays?

------
vmorgulis
It seems fully written in shell:
[http://fossilrepos.sourceforge.net/srv.fsl/144/artifact/6154...](http://fossilrepos.sourceforge.net/srv.fsl/144/artifact/61548d5f251f83e7d90d54192a860acb637f90a4)

~~~
nothrabannosir
Wow that alone is perhaps even more impressive than what the program actually
does... I thought I knew bash but just wow. Compatible with 5 different
shells, too. This is some next level enlightened zen master stuff.

~~~
chx
Don't get too carried away, it's written for ksh and relies on bash and zsh to
be compatible with ksh. You can see in the beginning it does a tiny bit of
setup and never cares again which shell it runs on. For zsh, it literally says
"emulate ksh" which is something zsh provides.

~~~
sverige
Proving once again that ksh is all you really need in a shell. ;)

------
lf-non
I am very curious what is the target audience for this project ? Given its
long history (dating back to 2011) it does not look like just an experiment or
hobby project. I would have assumed it to be a solution for porting legacy
programs but it implements a custom basic dialect so that is largely out of
question. Is it intended to be a solution for rapidly prototyping performant
systems applications ?

------
dragonbonheur
It's great that there's also a way to get it to work on some Android devices
too [http://basic-converter.proboards.com/thread/683/howto-use-
ba...](http://basic-converter.proboards.com/thread/683/howto-use-bacon-
android)

------
versteegen
I've seen a lot of BASIC-to-C converters, inspected the source code for a
number of them (the transpilers, not the output), and almost universally been
disappointed at their poor quality, which I decided I couldn't trust for a
real project. This one however, looks like real _software engineering_ went
into it (see eg [http://basic-
converter.org/String_optimization.html](http://basic-
converter.org/String_optimization.html)), even if the code is... well, it's
shell script which looks an awful lot like perl, real arcane magic.

------
vmorgulis
A toy webbrowser working with GTK: [http://basic-
converter.proboards.com/thread/803/minimal-web-...](http://basic-
converter.proboards.com/thread/803/minimal-web-browser-bacon-gtk)

~~~
remotebug
A toy BASIC wrapper around a webkit window...

