[Gambas-devel] Just a wild thought

Benoît Minisini gambas at ...1...
Fri Apr 3 21:15:21 CEST 2009


> I am trying to get the feel of Scala, this Java cousin that promises
> scripting-language-like terse syntax and support for functional
> programming. It is a very nice language but I think a little on the side of
> a write-only language. I love Gambas Basic incarnation, very well modeled.
> Then I find all over sites I visit, that Java is well entrenched in the
> server side and trying to get some desktop side usage; that .Net is coming
> from the reverse road, well used on the desktop and trying to steal some of
> Java space on the server. Many people reject the idea of desktop apps,
> saying web apps is the way to go, but that at least is contradictory, as
> the browser itself is a desktop app. If you make me choose between Vb.net
> and Gambas for desktop development, I choose Gambas without thinking twice.
> I do not even consider Java, as for me is like trying to write a business
> app in C. I have been programming 25 years and for a business app my ideal
> environment is something in the line of Foxpro (DOS, Win16, and Win32
> versions) and Access. Data bound controls, reporting, powerful and easy
> validations, visual grids for display, easy database querying (people look
> strange at me when I tell them LINQ comes from Fox and was there since the
> 80's).
> Now, where is this post heading? Gambas is missing a full working report
> component. The language is very nice, the IDE is the best sample program I
> have seen for a language. But I think many things are being reinvented here
> because Gambas is an island. gb.pdf, gb.report, gb.db.*. With Scala I have
> seen them implement the language and the interpreter on top of the JVM, the
> compiler generating Java bytecodes, and the language allowing transparent
> access to Java massive amount of code from the last decade. So I get a nice
> language, much like Paris Hilton, nice looking and with many resources just
> inherited from the past. Some people on the Scala lists just hope that
> Scala will be THE LANGUAGE for desktop Java development but I think some
> years of work are required to get there.
> Now the question. Please give me your opinions, pragmatic please, not just
> theoretical. You Gambas code gurus, you Master Benoit (sorry I do not know
> how to write your name in the right way from a Spanish keyboard): can the
> Gambas compiler and interpreter be ported to Java instead of C and plug to
> Java components instead of OS/library components? "CAN" being asked in the
> sense of a practical time frame and programming talent, not in the sense of
> Turing machine possibility...
> I mean, what if we could get JasperReports and iReport Java components for
> free and consider finished the gb.report component to dedicate resources to
> other more interesting problems? gb.qt and gt.gtk replaced by Swing, but
> hidden beneath gb.gui and the layout done with the lovely Gambas IDE? Side
> effects as the possibility of running on Mac and Windows? Scala, jRuby have
> shown that the real value of Java is not the language as it is the platform
> itself. jRuby runs faster and safer on the JVM than Ruby's C based VM.
> Ruby's source code is not Valgrind safe so when running production code one
> does not know how it will behave.
> I read somewhere in the Gambas site that Gambas is almost half a million
> lines of code. How much of it is core and how much is supporting
> components? Is there something in Gambas architecture that will make this
> truly hard or mostly impossible? I am testing the waters, maybe from your
> comments I get the drive...

I think that the Java Virtual Machine misses some features needed by the 
Gambas language. In other words, Gambas is internaly a too dynamic language 
for the JVM.

A Gambas class can be compiled without any explicit reference to anything 
declared somewhere else. In Java, you cannot do that, you must use the 
"import" keyword - But tell me if I am wrong, I didn't write a Java program 
for a while!

The Gambas inheritance and method overriding mechanism is entirely dynamic 
too. It is solved at runtime. Consequently, you can override any class and any 
method of any class, even the native ones, and these overriden classes will be 
used instead of the old ones, even if classes compiled outside of your 
projects. In other words, if you declare a "exported" class named "TextBox" in 
your project, you will redefine the TextBox control everywhere. I am not sure 
if the Java virtual machine can support that.

So it is impossible to use code written in Java from the Gambas interpreter. 
Or at least it would be not practical at all.

Note that the same comment could be done for Parrot.

Remember that I made Gambas because I wanted these features (and others). And 
because I like Basic and C/C++ of course. :-) Moreover, I don't really like 
Java, because it is a language that wanted to be ubiquitous. Gambas does not. 
It will try to use all existing libraries and command-line tools to do the 
job, which is want I want in my programming language.

Of course, all the big disadventages you wrote are real: things must be 
rewritten, there is no platform independence unless someone does it... But, 
hey, this is free software. :-)

Regards,

-- 
Benoît




More information about the Devel mailing list