A Gambas Compiler

Post your Gambas programming questions here.
Post Reply
User avatar
sadams54
Posts: 139
Joined: Monday 9th July 2018 3:43am
Contact:

A Gambas Compiler

Post by sadams54 »

I was wondering if Gambas plans to have a real compiler at any time. What I mean by that is currently Gambas uses an interpreter. You need to have a runtime for gambas installed in order to make the programs work. If the interpreter is changed the update will change how your program runs even if you did not make any changes. This leads to wide spread errors that are now backwards compatible. A program that worked flawlessly now has problems due to an error in the runtime interpreter.

I was wondering if Gambas which is such a powerful and amazing language would have a compiler that allows a Gambas program to run without any runtime and if a program works it will always work because it is independent of any interpreter. MS has compilers for visual basic. C and C++ and C# all have compilers like that. Wouldn't it be great if Gambas had one?

Is this something we can look into and see if it can happen?
cage
Posts: 123
Joined: Monday 2nd September 2019 5:47am
Location: Phoenix Arizona

Re: A Gambas Compiler

Post by cage »

I don't think that will ever happen. What could be done though is combine the interpreter and the program as one. One program that I can remember was YaBasic which was an interpreted basic program. You could create an execute file by combining the interpreter and the program as one file. By combining the two the interpreter would never change no matter how Gambas would. The only other option would be by using an appimage of your program.
User avatar
sadams54
Posts: 139
Joined: Monday 9th July 2018 3:43am
Contact:

Re: A Gambas Compiler

Post by sadams54 »

I thought about the app image idea. I am not up to date on it and really have no clue how to do something like that. If we can't get a compiler that is another option that maybe would be good addition to Gambas. A menu option to create an app image.
User avatar
BruceSteers
Posts: 1521
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: A Gambas Compiler

Post by BruceSteers »

Fabien has already submitted a merge request for adding an appimage maker to gambas IDE.
https://gitlab.com/gambas/gambas/-/merge_requests/298
If at first you don't succeed , try doing something differently.
BruceS
cage
Posts: 123
Joined: Monday 2nd September 2019 5:47am
Location: Phoenix Arizona

Re: A Gambas Compiler

Post by cage »

Bruce that would be a great idea. Although from what I have seen it's not a straight forward thing to do. There is a web site that explains how to create an app image with Gambas and by the looks of it, it's not that simple of a thing to do.

Here is a url for Gambas and appimages: https://appimage-builder.readthedocs.io ... mbas3.html
User avatar
sadams54
Posts: 139
Joined: Monday 9th July 2018 3:43am
Contact:

Re: A Gambas Compiler

Post by sadams54 »

Let hope that perhaps our geniuses that created Gambas can make it simple to do. Perhaps a single mouse click on a menu item in the IDE and maybe a few options to check and poof we have an app image.

I would love this if for no other reason than that nearly every time a new Gambas version is released I end up with it and there are things broken that adversely affect my already working projects and then I have to stress and run around fixing things, or impatiently wait for the fix. I understand this is normal and it happens, I have done it myself. But with app image or a full compiler it will not impact production environments like it does now. It will only affect the development and that is easier to deal with.

I am not trying to say anything bad, I love Gambas and think it is amazing. I just think that compilers and or app image would make it better. Lessen impact of errors in the interpreter too. If my clients have to deal with an error or problem in software I want it to be my fault and something I can go fix rather than having to wait for the interpreter to be fixed and another update. Fedora is very slow to push the updates out and even now I am waiting on the 3.18.1 to hit fedora to fix problems.
User avatar
BruceSteers
Posts: 1521
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: A Gambas Compiler

Post by BruceSteers »

Sounds like you are using Dev branch , problems are expected on dev branch , that's what it's for , Ben or someone else adds stuff , we test it, and then we report problems.

The sorts of problems you are talking about are rare if you stick with stable branch.

The rollercoaster of instability you make it sound like does not happen that much in dev branch either to be fair.

There was a major change recently that had something to do with overflow ,, i do not know what but the situation was that the interpreter was wrong , then it got fixed ,
now some of our programs did not error but they are also wrong and should do.
some just needed a simple re-compile of the binaries.
If at first you don't succeed , try doing something differently.
BruceS
User avatar
sadams54
Posts: 139
Joined: Monday 9th July 2018 3:43am
Contact:

Re: A Gambas Compiler

Post by sadams54 »

actually I do not do the dev at all. I stick to the stable released in the repo from fedora. Yes the problems are not common but when they happen they tend to be crippling to my production environment. Please never take this as criticism as I think the Gambas project is amazing and has my total support. I just think there is room to improve and the interpreter is the place. If it was just affecting the development it would be little problem but when a client does a system update and the interpreter is part of that, a problem can creep in that has nothing to do with me and cripple a system. I can't really control client updates. That is my assessment of where the few problems come in and I hope I am providing something to address that problem.

Let me give my current issue. I have a project that uses large fonts on the screen for visual impaired and for longer distance visibility. The interpreter has been updated in the repo and now drag and drop is not working. That is rather important feature. Also the font size of the combo box is large as it should be but if you click to select, the font size goes back to normal size rather than the size of the font selected. You can see the selected item in full size but the other options are not. I am told all that is fixed in the next interpreter 3.18.1 while I have 3.18.0 but I have to wait for it to go thru the fedora repo before everybody using it can get that functionality back.

Prior to that we lost the ability to control window placement which crippled a point of sale system that uses multiple monitors so window placement and moving was crucial. The problems are addressed and fixed but the time involved hurts.

I count myself lucky that it is only these 2 problems in about 2 years but even those uncommon problems cause me grief. The compiler or app image could stop that from ever happening. Perhaps it is just my bad luck but the rare problems seem to cause me alot of issue when they happen.

Please keep the amazing work going but please add this app image or compiler feature so that even the rare problems can be caught and never reach production. You guys are amazing.
User avatar
Cedron
Posts: 156
Joined: Thursday 21st February 2019 5:02pm
Location: The Mitten State
Contact:

Re: A Gambas Compiler

Post by Cedron »

Writing a native compiler is awfully difficult. Especially for a language as rich as Gambas.

Writing one that produced optimized code, even more difficult, and its already been done by gobs of people.

I think the best approach would be a translator from Gambas to C++ source code, then submit that to g++. This would require a few support libraries at runtime, yada, yada. It would also make Gambas a valid prototyping tool for "real systems", where the translated code is simply a foundational starting point.

Nobody has mentioned the Gambas JIT in this either. I have never employed it.
.... and carry a big stick!
Post Reply