[ANN] A BASIC compiler

195 views
Skip to first unread message

JuciÊ Andrade

unread,
Oct 26, 2019, 12:16:40 PM10/26/19
to golang-nuts

A compiler for BASIC programming language.


This tool understands what is in David H. Ahl's own words "the gold standard of microcomputer BASICs: MITS Altair 8K BASIC, Rev. 4.0 (ix)." It has been tested against every program from Ahl's bestseller "BASIC Computer Games".

Anca Emanuel

unread,
Oct 26, 2019, 1:32:24 PM10/26/19
to golang-nuts
Why do you need C in the source code ?

JuciÊ Andrade

unread,
Oct 26, 2019, 1:40:43 PM10/26/19
to golang-nuts
Hi, Anca.

The compiler proper doesn't use C code, generated code does, it has references to some support functions.
Those support functions are declared in basiclib.h and defined in basiclib.c .

Anca Emanuel

unread,
Oct 26, 2019, 1:55:35 PM10/26/19
to golang-nuts
Please explain how it works.
Do you get executables from basic programs ?

Robert Engels

unread,
Oct 26, 2019, 2:03:40 PM10/26/19
to Anca Emanuel, golang-nuts
Yes. I generates C code from a basic program and you compile the C. 

On Oct 26, 2019, at 8:55 AM, Anca Emanuel <anca.e...@gmail.com> wrote:


--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/cba97461-cf16-4273-8336-cc26e236aa0a%40googlegroups.com.

Anca Emanuel

unread,
Oct 26, 2019, 2:30:35 PM10/26/19
to golang-nuts


On Saturday, October 26, 2019 at 5:03:40 PM UTC+3, Robert Engels wrote:
Yes. I generates C code from a basic program and you compile the C. 

On Oct 26, 2019, at 8:55 AM, Anca Emanuel <anca....@gmail.com> wrote:


Please explain how it works.
Do you get executables from basic programs ?


On Saturday, October 26, 2019 at 4:40:43 PM UTC+3, JuciÊ Andrade wrote:
Hi, Anca.

The compiler proper doesn't use C code, generated code does, it has references to some support functions.
Those support functions are declared in basiclib.h and defined in basiclib.c .

On Saturday, October 26, 2019 at 10:32:24 AM UTC-3, Anca Emanuel wrote:
Why do you need C in the source code ?

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golan...@googlegroups.com.

JuciÊ Andrade

unread,
Oct 26, 2019, 2:33:05 PM10/26/19
to golang-nuts
I just edited the project README to clarify this point. This tool generates C code that you submits to the C compiler for your particular platform.

JuciÊ Andrade

unread,
Oct 26, 2019, 2:39:53 PM10/26/19
to golang-nuts
Feel free to classify the tool anyway you like, Anca.

I don't buy the distinction between "compiler" and "transpiler" because it's the same thing. They read code in some language and generates code in some language.

I picked C for output because it is utterly portable and everyone could enjoy the games. Any other output format would exclude someone.

Robert Engels

unread,
Oct 26, 2019, 3:34:21 PM10/26/19
to JuciÊ Andrade, golang-nuts
Why not generate Go?

On Oct 26, 2019, at 9:40 AM, JuciÊ Andrade <oju...@gmail.com> wrote:


--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/c9946e3b-0648-4260-b1bc-811ec9179f5d%40googlegroups.com.

Robert Engels

unread,
Oct 26, 2019, 3:52:54 PM10/26/19
to JuciÊ Andrade, golang-nuts
Out of curiosity only. 

On Oct 26, 2019, at 10:33 AM, Robert Engels <ren...@ix.netcom.com> wrote:



JuciÊ Andrade

unread,
Oct 26, 2019, 3:57:47 PM10/26/19
to golang-nuts
It could be done, Robert. Then the programs would run in every platform that Go runs, quite a few!

JuciÊ Andrade

unread,
Oct 27, 2019, 10:41:33 AM10/27/19
to Robert Engels, golang-nuts
Today I learned a fellow programmer did just that! His name is Everton Marques.

Reply all
Reply to author
Forward
0 new messages