[Gambas-user] something need to be done with the compiler

Benoît Minisini gambas at ...1...
Wed Jul 8 00:17:42 CEST 2009


> Benoît Minisini wrote:
> >> I have been trying learn gambas for a month  now , I quite happy with it
> >> other than the compiler .
> >> the compiler just too stupid . when I code a program and some time typo
> >> or
> >> forget the fill a parameter of a function , the compiler just ignore it
> >> .
> >>
> >> I spend more time to trace such stupid problem on run time  . try to
> >> image
> >> you get weird exception from your program and the problem is some typo
> >> you
> >> made or made by others. the program you made will be full of unknown
> >> bugs that not yet discover
> >>
> >> this is really giving huge problem for anyone want to use gambas to
> >> develop
> >> a program .
> >>
> >> the compiler should check all these problem and show warning as what a
> >> normal compiler should do.
> >
> > The compiler could warn only when calling a function in the same class. I
> > may
> > add that check.
> >
> > But, as I explained before, it cannot do anything for call between two
> > different classes.
> >
> > But when you enter a function call, the IDE shows you the syntax of the
> > function in a tooltip, so I don't understand how you could forget an
> > argument
> > too often.
> >
> > Regards,
> >
> > --
> > Benoît
> >
> > -------------------------------------------------------------------------
> >----- Enter the BlackBerry Developer Challenge
> > This is your chance to win up to $100,000 in prizes! For a limited time,
> > vendors submitting new applications to BlackBerry App World(TM) will have
> > the opportunity to enter the BlackBerry Developer Challenge. See full
> > prize
> > details at: http://p.sf.net/sfu/Challenge
> > _______________________________________________
> > Gambas-user mailing list
> > Gambas-user at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
>
> checking the whole project will be the best . if those unable to find show
> as warning not error . even if slow down , I doubt anyone will mind .
>
> I'm a lazy programmer .  sometime I change the parameter of a function in a
> class or module , sometime I remove or move some share variable or function
> .
>
> I usually left the checking to the compiler (as most programming language
> compiler will do)  . the compiler will tell me where in the code that is
> effected to the change .
>
> gambas compile is the first compiler that I encounter that doesn't do what
> a standard compiler must do.
>
> i think this limitation is very bad to gambas . for example if you
> distribute some component . then at some version some function is remove .
> the people that using the component won't be able to know cause the
> compiler doesn't give them any warning .

What you see as a disadventage is exactly what I didn't find in other 
languages. I wanted a full dynamic linking and a very fast compiler. This is 
the reason why the compiler cannot check anything outside of the class it 
compiles.

And if the interface of a component changes, you must change its version 
number. Of course Gambas does not force you to do so, but this is a common 
practice.

As I said before, I can add the only possible check: inside the same class.

But as the linking is entirely dynamic, only the interpreter, during 
execution, and the first time it calls the method, can know if the arguments 
of the caller and the called method match. Checking argument matching cannot 
be 100% reliable at compile time.

I understand that it is disturbing for you and other people, but it is mainly 
a matter of habits. I don't want at the moment to break what I done to 
implement this kind of check in Gambas 3. It may be something for Gambas 4.

Regards,

-- 
Benoît




More information about the User mailing list