What I'd really like to see in BlitzMax

BlitzMax Forums/BlitzMax Programming/What I'd really like to see in BlitzMax

Leiden(Posted 2007) [#1]
I know many people have asked the same thing but I'll take this chance to express what I feel would improve the language.

Overloading - I know its been asked before but being able to overload would remove the need for Type.Create() functions. We could just overload Type.New() with our required parameters.

Operators - Being able to use Type1*Type2 instead of Type1.Multiply(Type2) would simplify code thus making programming more streamlined.

Thats what I would most like to see. Here are a few others that would probably come in handy for other users.

Typedef - You all know what it does.

Templates - It would make working with different data types more optimal and streamlined.

Multiple Inheritance - I know C++ is the only other language that offers this but it would prevent the need for having multiple types extending others when we could just have on big inheritance.


SpaceAce(Posted 2007) [#2]
Some of those things would be nice but I don't think any of them are crucial. Besides, don't you know better than to post suggestions? All you're going to get is a horde of Blitz sycophants swarming all over your post telling you that [insert what you want] is [choose one: stupid/not a priority/interfering with the development of [insert something the sycophant wants added to BlitzMax for himself]]. It's pretty sickening to watch.

SpaceAce


H&K(Posted 2007) [#3]
Well, I dont understand why operators cannot be added at the IDE stage, that is if I type Type1*Type1 (And Ive defined Multiply), why the IDE cannot secretly make it Type1.Multiply(Type1) in the background.
The same with ovewloading, if I have FN(Int) and FN(Long), why cannot the IDE secretly call them FNInt(Int) and FN(Long), and just not let me see that.
The last time I asked, noone told me why not, just kicked up loads of fuss that I should leave Mark alone


Ninjacrat(Posted 2007) [#4]
Persecution complex much?


SculptureOfSoul(Posted 2007) [#5]
I know C++ is the only other language that offers this but it would prevent the need for having multiple types extending others when we could just have on big inheritance.



C++ the only language with multiple-inheritance? Nope. Lisp has it, for one, and I'm sure many other languages do as well.

Anyhow, multiple inheritance would be nice to see. Typedefs & Overloading would be especially nice.


Dreamora(Posted 2007) [#6]
C++ and multiple inheritance ... thats a good joke. It does not have any usefull selection - redefinition - undefinition functionality, calling such a "use all" approach multiple inheritance at best makes others laugh ...

Check out real languages (Eiffel has the best featured implementation from what I know), not 20 year old languages which hacked more and more in just to keep up with more modern languages ...


FlameDuck(Posted 2007) [#7]
Well the only thing I really need right now is runtime reflection and multithreading. Other than that:

Templatea - would rather have generics.
Multiple Inheritance - would rather have Interfaces.


H&K(Posted 2007) [#8]
Eiffel, by design, does not allow argument overloading where a given class has multiple same-named feature


SculptureOfSoul(Posted 2007) [#9]
Yeah, C++'s multi-inheritance suffers greatly from the diamond-inheritance problem. Lisp and it sounds like Eiffel and I'm sure others have overcome that.

Generics (from the bit I just read on them) do sound much more useful than templates! I never much liked templates, and after getting a taste of lisp and it's dynamic typing, along with the ability to write truly efficient generic code that optimizes itself based on it's type (via Lisps extremely powerful macro abilities) I can't say I'd go back to templates unless I had to.

I'll have to take a looksee to see where interfaces and multiple inheritance diverge.


Knotz(Posted 2007) [#10]
I've made a realtime softbody animation system in Max last month which use a *lot* of matrix&vector calculations.
Most calculations take this (generic) form (A,B,C are matrices):

A = A * B
A = B * C

First I made a matrix class with these two methods:

method Product:TMatrix( m:TMatrix ) for A = B * C return product.
method Multiply( m:TMatrix ) for A = A * B

In the same manner i made methods for addition, subtraction, division etc.
There where two problems with this method.
First a function like:

A = B*C + D*E

Would translate in:

A:TMatrix = B.Product(C).Sum(D.Product(E))

Which becomes very hard readable when there is a bit more difficult function.
And second, due to the vast amounts of temporary objects made, the garbage collector would take too much time to mob up everything between every frame.

In the end i fell back to a normal function like library with arrays. Still very hard readable but at least very fast.

So, yes i would like operators, but know there is a price attached in speed lost.

Overloading get's a big thumbs up from me.


SculptureOfSoul(Posted 2007) [#11]
Okay, I don't have time to thoroughly check into it, but how are interfaces any different than a multiple-inheritance setup where all of the base classes only have abstract methods defined?


SculptureOfSoul(Posted 2007) [#12]
This is for you FlameDuck (and anyone else interested in some other solutions to some of the problems mentioned in this thread.) I finally found a good article comparing C++ to Lisp. It's pretty short, too.

http://www.lurklurk.org/cpp_clos.html

If anything it'll give you a bit of a new perspective.


Dreamora(Posted 2007) [#13]
Its the same. Interface = Only declaration
Multiple Inheritance allows inheriting from actual classes, not just definitions with no implementations. (copy paste programming is kind of crap I think. Thats what interface enforces if you have several classes which do the same thing for the many methods but different for some other methods)
Java allows you to extend a class and X interfaces, so at least some part of functionality can be reused.

I understand that this kind of stuff is hard to implement.


Generic: Would really like to see that. Currently I use a "fake" to reach that, I just implemented an own base class TObject which is an extended object with functionality to easily check stuff without dummy casting terror.

One thing missing here are delegates. We have function pointers, but as all experienced users know, they have massiv downs. Even in C++ there are better ways to get similar functionality without blocking the pipe as FPs do. (using templates). Method pointers are not possible at all currently, this would need a delegate mechanism. (there are fakes but those fakes are highly inacceptable as they enforce "execute basing on some method name string" and thus get slower the more functions you have. To make it worse, they are not typesafe)

And yes, Eiffel does not allow method type declaration overloading. This is bad practice.
Its nearly impossible to guarantee correctness of something if you do not need what it is and that is exactly what is caused by this type of overloading.
But due to generics it does not need that. If you have a function doing something with numerics, you use numerics instead of float, double or int. The generics mechanisms of eiffel are very powerfull. Its not just a way of base class definition, you can even define them in a way that ensures that given classes need to be extended in classes that want to qualify as generics etc.


Azathoth(Posted 2007) [#14]
Okay, I don't have time to thoroughly check into it, but how are interfaces any different than a multiple-inheritance setup where all of the base classes only have abstract methods defined?

Apparently it doesn't suffer from the same problems that full multiple-inheritance has.


Who was John Galt?(Posted 2007) [#15]
STRUCTS... please


ziggy(Posted 2007) [#16]
I agree with Dreamora, in addition I will add something that nobody has token in consideration, and I think it is something that would be very easy to implement.

I would like the BlitzMax compiler to have a 'test mode' that doesn't produce any output executable, but list ALL compile errors on a given BMX file. That could be called by any IDE to get a list of code bugs, before building the entire project and making an executable (wich is very slow). This way, coding on BlitzMax would be a Dream...


FlameDuck(Posted 2007) [#17]
I would like the BlitzMax compiler to have a 'test mode' that doesn't produce any output executable, but list ALL compile errors on a given BMX file.
This should be the responsability of the IDE or 3rd party tools. It's a shame that the powers that be decided to model their IDE on Visual Studio (and VS without Reshaper at that) rather than Eclipse.

I finally found a good article comparing C++ to Lisp.
Actually it compares C++ to Common Lisp - which somewhat ironicly has very little in common with Lisp.


Dreamora(Posted 2007) [#18]
Code parsing done by IDE?
Wouldn't that defeat the point? Normally there is a preparser or similar you can call to get syntax errors ...
Would in any case be a good thing for large projects, but so far, even the largest stuff I compiled didn't take longer than 2 mins (thats full module rebuild of 1.24 with a dozen additional modules)

In that time, GCC 4.1.2 gets the configuration done :)


SculptureOfSoul(Posted 2007) [#19]
Actually it compares C++ to Common Lisp - which somewhat ironicly has very little in common with Lisp.



Lisp has been a synonym for "Common Lisp" for years now. Every major implementation of Lisp conforms (or attempts to) to the ANSI standards for Common Lisp.


ziggy(Posted 2007) [#20]
This should be the responsability of the IDE or 3rd party tools
Why? the compiler does this work, why are IDE developers supoused to repeat it?


FlameDuck(Posted 2007) [#21]
Every major implementation of Lisp conforms (or attempts to) to the ANSI standards for Common Lisp.
No it doesn't. Emacs Lisp for instance.

Why? the compiler does this work, why are IDE developers supoused to repeat it?
So you can get the errors right away, when you make them. Try using Eclipse (which does this) and then Visual Studio (which doesn't) to get a feel for how great it is to get your error warnings right away.


LarsG(Posted 2007) [#22]
OT:
Flamey;
wasn't there a plugin for BMax in Eclipse?
do you know the current status on it?


FlameDuck(Posted 2007) [#23]
wasn't there a plugin for BMax in Eclipse?
Yes.

do you know the current status on it?
Abandoned, as far as I can tell.


Mark Tiffany(Posted 2007) [#24]
wasn't there a plugin for BMax in Eclipse?

Wasn't it Brucey that started it?


Grey Alien(Posted 2007) [#25]
Has anyone said "automatically centred windows (non BMax GUI)" yet? And what about "fixed win98 sound issues" ?


FlameDuck(Posted 2007) [#26]
And what about "fixed win98 sound issues" ?
Frankly I couldn't care less. People using unsupported software are probably quite acustomed to stuff not working properly.


Dreamora(Posted 2007) [#27]
Yupp, same as FD on the Win98 ME topics.


Shaun Sullivan(Posted 2007) [#28]
I'd love to see Interfaces added.


Grisu(Posted 2007) [#29]
I'd love to see the bugs fixed I have posted months ago.