News for hackers. Stuff that matters.
Re:BaCon – BASIC to C converter by marktangotango on Sunday January 29, 2017 @10:45AM (#13514583)
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?

Re:BaCon – BASIC to C converter by vmorgulis on Sunday January 29, 2017 @08:39AM (#13514059)
Re:BaCon – BASIC to C converter by nothrabannosir on Sunday January 29, 2017 @09:56AM (#13514357)
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.
Re:BaCon – BASIC to C converter by shakna on Sunday January 29, 2017 @12:12PM (#13515139)
Though not crazy cross compatible, you might find Mal's bash implementation interesting [0]. Mal is a small, easy to implement Lisp.

[0] https://github.com/kanaka/mal/tree/master/bash

Re:BaCon – BASIC to C converter by chx on Sunday January 29, 2017 @01:23PM (#13515697)
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.
Re:BaCon – BASIC to C converter by sverige on Sunday January 29, 2017 @05:03PM (#13516996)
Proving once again that ksh is all you really need in a shell. ;)
Re:BaCon – BASIC to C converter by lf-non on Sunday January 29, 2017 @12:36PM (#13515347)
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 ?
Re:BaCon – BASIC to C converter by dragonbonheur on Sunday January 29, 2017 @08:36AM (#13514040)
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...
Re:BaCon – BASIC to C converter by versteegen on Tuesday January 31, 2017 @03:53AM (#13528872)
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), even if the code is... well, it's shell script which looks an awful lot like perl, real arcane magic.
Re:BaCon – BASIC to C converter by vmorgulis on Sunday January 29, 2017 @08:42AM (#13514074)
Re:BaCon – BASIC to C converter by remotebug on Sunday January 29, 2017 @08:47AM (#13514095)
A toy BASIC wrapper around a webkit window...