Imagine combining Visual Designer with the PB IDE...

Working on new editor enhancements?
User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post by GedB »

even though it's called IBFriendly, you have to admit that it's not a very friendly way of coding it.. :p
:lol: Your not wrong.

I think something good could be done with a bit of code generation.

I really don't won't Fred to take PB in an OO direction, as it is a slippery slope into obscurity and bloat. However, I also want to use OO with the great compilation of PB.
LarsG
Enthusiast
Enthusiast
Posts: 713
Joined: Mon Jun 02, 2003 1:06 pm
Location: Norway
Contact:

Post by LarsG »

mind you, I don't want a complete OO PB language... but the possibility of making your own structures with methods and inheritance... easily!
the current way works, but it's so darn complex and user un-friendly..

AMD Athlon XP2400, 512 MB RAM, Hercules 3D Prophet 9600 256MB RAM, WinXP
PIII 800MHz, 320 MB RAM, Nvidia Riva Tnt 2 Mach 64 (32MB), WinXP + Linux
17" iMac, 1.8 GHz G5, 512 MB DDR-RAM, 80 GB HD, 64 MB Geforce FX 5200, SuperDrive, OSX
Amiga5k
Enthusiast
Enthusiast
Posts: 329
Joined: Fri Apr 25, 2003 8:57 pm

Post by Amiga5k »

I second LarsG opinion. It'd be nice to just literally put the procedures specific to that structure inside the structure, declare some as private, etc like a "proper" oop language...

It's nice to know it's possible now, though ;)

Russell
*** Diapers and politicians need to be changed...for the same reason! ***
*** Make every vote equal: Abolish the Electoral College ***
*** www.au.org ***
User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post by GedB »

LarsG, Amiga5k,

This is exacly what I'd like to work towards.

My plan is to first create it through code generation. Something like

Code: Select all

Class MyObject
  Private
    Procedure This
      blah
    EndProcedure
  EndPrivate

  Public
    Procedure That
      blah
    EndProcedure
  EndPublic
EndClass
This would then be passed through a preprocessor that would convert it into the corresponding PB code.

My biggest problem is the fact that it will have to generate functions, giving them names that will be accessible to other programs. For 'proper' encapsulation the internal procedures should only be accessible through the interface.

I see a couple of solutions to this

1) If PB allowed anonymous functions then I could use these. I ased for them but Fred didn't take the bait :(

2) Create DLLs. This would be nice a flexible, but you lose static linking. Using VB at work has given me a hatred of DLL hell.

3) Create Userlibraries, similar to the way Tailbite does it. I think this would be a neat solution, but I don't know how to do it. When the time comes I hope El_Choni is willing to show me how.

My implementation of objects would be a little different. I'm hoping to implement them as Relational rather then as a network linked by pointers. If my planning is correct this will allow for perfect resource management with all objects destroyed automatically without the overhead of a garbage collector. It is all part of my planned Master's dissertation.
Amiga5k
Enthusiast
Enthusiast
Posts: 329
Joined: Fri Apr 25, 2003 8:57 pm

Post by Amiga5k »

Implementing it through code generation would be somewhat of a 'kludge', but I'd go for that until it's REALLY part of the language. (A temporary solution).

Using your example, it would have to be possible to call the particular function with something along the lines of:

Code: Select all

Create bob.MyObject   ; Create a new object of class 'MyObject'
returned = bob.This(arg)
Or something like that. Throw in a create and destroy function and it would really start to look like a "respectable" oop language!

Russell

p.s. I like the form\syntax of your example very much. Something along that line would work very nicely!
*** Diapers and politicians need to be changed...for the same reason! ***
*** Make every vote equal: Abolish the Electoral College ***
*** www.au.org ***
User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post by GedB »

I see two options for this.

The first is to have factory functions which would create and return the create object. It would look like this:

Code: Select all

  bob.MyObject = Make_MyObject()
  jim.MyObject = Make_MyObject_With_A_Value(aValue)
The advantage of this is that it fits nicely into the use of libraries. A DLL or PureLibrary would only have to expose these methods. Everything else would be accessible through the Interface returned.

With this approach the Objects would be thing layers over purebasic code, rather like C++'s classes.

There would be no RTTI.

The Interface would then include a Destroy() method for freeing the resources.

I'm taking my lead from Eiffel, the most respectable of all oop languages.

The other alternative is the Java / Smalltalk approach. There would be a hiearchy of meta objects that could be passed to a creation method. I think this is closer to your example.

As with Java and smalltalk, classes will then be first class objects, with RTTI making reflection/introspection possible.

Personally I'm not convinced of this method. I don't think it ties in with the lightweight PB philosophy.
dell_jockey
Enthusiast
Enthusiast
Posts: 767
Joined: Sat Jan 24, 2004 6:56 pm

Post by dell_jockey »

GedB, you're talking design patterns here, cool!
btw: I share your opinion about Eiffel.
cheers,
dell_jockey
________
http://blog.forex-trading-ideas.com
Amiga5k
Enthusiast
Enthusiast
Posts: 329
Joined: Fri Apr 25, 2003 8:57 pm

Post by Amiga5k »

I agree that if PB is going to support objects in this way, it should do so in a fashion not too un-PB like, as we want people to actually WANT to use this new functionality..not be afraid of it (or too confused by it).

Like you say, this approach would be like a thin layer above the core language and I think it would probably be easier for Fred (or whoever) to actually implement without doing a re-write of the core language.

I wonder what Fred thinks of these ideas? :D

Russell
*** Diapers and politicians need to be changed...for the same reason! ***
*** Make every vote equal: Abolish the Electoral College ***
*** www.au.org ***
User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post by GedB »

I wonder what Fred thinks of these ideas?
I've no idea. My plan is to get something usable and accessible. Once I have that I will start trying to pursuade Fred into making it a core part of the langauge.

Then again, Fred has promised Macros for v4. This may be a reality by then and the preprocessor won't be needed - the macros might be good enough.

In the next few months I'll have a web site up and running with tutorials and a start to the whole process. Don't expect anything in the short term.
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

well i believe that if this happens, the designer would have too much control over the source. The source would have too look as the designer wants it to. I like it the way it is right now, and then nothing is stolen. You have control over the source, not some microsoft-copy source blender weird thing :P

What i means is that i like to have control over what happens. It would make it easier, and maybe i want it, but i am not unhappy about it right now (and it dosent look like VB)


just my thought.. :wink:
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

Berikco wrote:I'm looking at it for real :twisted:
AH! OH!

PB IDE with BUGS !!! :twisted:
Amiga5k
Enthusiast
Enthusiast
Posts: 329
Joined: Fri Apr 25, 2003 8:57 pm

Post by Amiga5k »

thefool wrote:well i believe that if this happens, the designer would have too much control over the source. The source would have too look as the designer wants it to. I like it the way it is right now, and then nothing is stolen. You have control over the source, not some microsoft-copy source blender weird thing :P

What i means is that i like to have control over what happens. It would make it easier, and maybe i want it, but i am not unhappy about it right now (and it dosent look like VB)


just my thought.. :wink:
Well, the beauty of this scenario is that if you want to continue to program the way you do now, then you're under no obligation to use the "Visual PB" as a means to create your program. Visual Basic, on the other hand, pretty much takes that control\flexibility out of your hands.

So you could just ignore the parts you don't like and just continue to use PB the same way you do now.

Another possibility is that this "VPB" (Visual PB) could have options that allow you to select how it constructs your program(s), if you choose to use it for that purpose. For example, you could have the choice of using conventional Windows API methods to create windows and react to events, or use PB's built-in commands to do the same. Both methods would have their advantages and disadvantages, although the WinAPI method would be an excellent way to learn how to communicate with Windows on a lower level. This would have limitations in the Linux version, perhaps...

Looking forward to see what you come up with, GedB. Also looking forward to macros, as they can be a lot more powerful than many people may realize.

Russell
*** Diapers and politicians need to be changed...for the same reason! ***
*** Make every vote equal: Abolish the Electoral College ***
*** www.au.org ***
techjunkie
Addict
Addict
Posts: 1126
Joined: Wed Oct 15, 2003 12:40 am
Location: Sweden
Contact:

Post by techjunkie »

Berikco wrote:
LarsG wrote:I'm imagining!! :wink:
I'm looking at it for real :twisted:
:D

How are things going with the "new" Visual Designer Berikco? *curious*

One more question,

Is 3.90 build 1360 the latest official Visual Designer?

(PS: Do you need any beta-testers? :roll: )
Image
(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
LarsG
Enthusiast
Enthusiast
Posts: 713
Joined: Mon Jun 02, 2003 1:06 pm
Location: Norway
Contact:

Post by LarsG »

Take a look at this thread, Techjunkie..
viewtopic.php?t=11314&postdays=0&postorder=asc&start=0

AMD Athlon XP2400, 512 MB RAM, Hercules 3D Prophet 9600 256MB RAM, WinXP
PIII 800MHz, 320 MB RAM, Nvidia Riva Tnt 2 Mach 64 (32MB), WinXP + Linux
17" iMac, 1.8 GHz G5, 512 MB DDR-RAM, 80 GB HD, 64 MB Geforce FX 5200, SuperDrive, OSX
techjunkie
Addict
Addict
Posts: 1126
Joined: Wed Oct 15, 2003 12:40 am
Location: Sweden
Contact:

Post by techjunkie »

LarsG wrote:Take a look at this thread, Techjunkie..
viewtopic.php?t=11314&postdays=0&postorder=asc&start=0
Thanks LarsG!

:P
Image
(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
Post Reply