[Gambas-user] Gambas IDE and JavaScript?

Benoit Minisini benoit.minisini at gambas-basic.org
Sat Feb 25 13:44:44 CET 2023


Le 25/02/2023 à 13:19, Martín a écrit :
> First of all, I apologies for my ignorance and hope that no one will 
> take these questions the wrong way. It happens that I am starting to 
> make programs with javascript and I am so comfortable and familiar with 
> Gambas IDE that I was wondering:
> Is it possible to use javascript instead of Basic in Gambas IDE?
> If it is possible, could someone tell me how to start?
> If not, what would it take to do it?
> Or if the idea is that it will never be extended to other languages?
> 
> Thanks.
> 
> Martín.
> 

The question of "using javascript instead of Basic" has different meaning.

If you mean using the javascript language instead of Gambas, the answer 
is obviously: no it's impossible by definition.

If you mean using a "javascript-like" syntax instead of a "BASIC-like" 
syntax, it's theoritically possible.

It needs defining this "javascript-like" syntax, and write a new 
compiler (or extend the current one).

But, as the reality of a language is not its syntax but what it actually 
does at runtime, this "javascript-like" syntax cannot be equivalent to 
"javascript" - different classes and functions - and some new features 
should be implemented in the interpreter.

For example, there is no closures in Gambas. If you want closures in the 
"javascript-like" syntax, you have to add support for that in the 
interpreter.

As a summary: no, Gambas will never be extended to other languages, but 
it can be extended to other syntaxes.

Regards,

-- 
Benoît Minisini.



More information about the User mailing list