What happens next with OOP in FreeBasic and when? :)

For other topics related to the FreeBASIC project or its community.
marcov
Posts: 3002
Joined: Jun 16, 2005 9:45
Location: Eindhoven, NL
Contact:

Re: What happens next with OOP in FreeBasic and when? :)

Postby marcov » May 08, 2015 10:06

I do realize know that I replied as if MI in FB was inevitable. I didn't mean to do that.

Even in Delphi/FPC, with its 15 year old interface implementation, they are not that much used in practice, only for interfacing to languages or systems that are big on interfaces, like COM,Corba and Java (e.g. DOM models).

Basically, interfaces are more abused for their refcounted automatic memory management then for what they were actually meant for (MI and establishing object contracts)
Frontier
Posts: 3
Joined: Mar 02, 2015 7:48

Re: What happens next with OOP in FreeBasic and when? :)

Postby Frontier » May 12, 2015 7:35

Schrubber wrote:FreeBasic may Library of C, C++, and I think even use Pascal ?!
What more could you want?


My point exactly: FreeBasic needs to be able to address C++ libraries in order to gain access to projects like Qt.
Imagine having Qt available to FreeBasic and the power this brings to the FreeBasic ecosystem.
ike
Posts: 387
Joined: Jan 17, 2011 18:59

Re: What happens next with OOP in FreeBasic and when? :)

Postby ike » May 15, 2015 16:34

FreeBasic needs to be able to address C++ libraries in order to gain access to projects like Qt


Yes that is true. But there is already couple GUIs: GTK, IUP, Window9, WXC and FLTK

New user will download FB, try examples from it and probably will not work:
GTK will report missing libs, IUP will not work, and they will be unable to find FLTK on this forum.

So they will give up. Who will use a programming language just in console mode? Nobody!
So they will loose couple of hours or days and give up


There is already a lot of examples for different GUIs on this forum, so we have to collect it and create installer for all those GUI libs.
And then create more sample and share it

"INNO setup" is very nice program for making installers.

So after you download FB, and test it, you go and download installers for GUIs. I mean installers that will work from first try in 95%+ cases.

And it should be separated from FB, let core FB team concetrate on their job: writting compiler
fxm
Posts: 9820
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: What happens next with OOP in FreeBasic and when? :)

Postby fxm » May 15, 2015 16:51

ike wrote:New user will download FB, try examples from it and probably will not work:
GTK will report missing libs, IUP will not work, and they will be unable to find FLTK on this forum.

Advanced search:
Search for: FLTK
Topic titles only: yes
Topics: yes
==>>
- FLTK 1.3.3 C Wrapper Windows/Linux 32/64-bit
- Fluid + Fluid4Fb : GUI code for Fltk (Window-Linux)
- FBC 64bit users test FLTK-1.3.2 please ?
- FLTK GUI library
marcov
Posts: 3002
Joined: Jun 16, 2005 9:45
Location: Eindhoven, NL
Contact:

Re: What happens next with OOP in FreeBasic and when? :)

Postby marcov » May 15, 2015 17:46

Frontier wrote:
My point exactly: FreeBasic needs to be able to address C++ libraries in order to gain access to projects like Qt.


The problem is down that path is that you can't avoid becoming C++.

And for QT access that is not necessary, there are wrapper DLLs.
ike
Posts: 387
Joined: Jan 17, 2011 18:59

Re: What happens next with OOP in FreeBasic and when? :)

Postby ike » May 15, 2015 19:01

@fxm

assuming they know FLTK is search term.

But there is no reason for them to believe FLTK is a magic word.
===============================================================



When you download FB, there is examples\GUI folder with GTK, IUP, WXC, win32

So they will probably search GTK, and waste time downloading different versions 3.6 or 2.24
Some examples work with old version, some with new etc

Then try search IUP on this forum, and you will end up with couple versions: Joshi's, AGS and examples you find on this form are incopatible with current IUP headers.

I am not complaining IT IS LIKE IT IS, just want to point THAT ONLY GUI LIB worth of tring is FLTK.
and it should be included in FB with at least folder named FLTK, and a simple read.me file saying where to download it

It is easy to install, and it works (100 examples and all working, with one simple bat file to compile all)
BasicCoder2
Posts: 3571
Joined: Jan 01, 2009 7:03
Location: Australia

Re: What happens next with OOP in FreeBasic and when? :)

Postby BasicCoder2 » May 15, 2015 20:57

ike wrote:I am not complaining IT IS LIKE IT IS, just want to point THAT ONLY GUI LIB worth of trying is FLTK.
and it should be included in FB with at least folder named FLTK, and a simple read.me file saying where to download it
It is easy to install, and it works (100 examples and all working, with one simple bat file to compile all)


Well if you need "one simple bat file to compile all" then it isn't simple. You need to be able to download and then simple include the extensions. They should auto install and just work without any more fuss just a simple #include x in your source code.

Who is the target audience of FreeBASIC? The QBASIC replacement version would have been mainly old QBASIC programmers. It was an amazing project that worked very well. It has evolved since then but the target audience has been the developers themselves making something that works for them not the casual users who simply don't have the time or maybe ability to reach their level of competency. Looking at the recent posted linked list example it may as well be written in C++. Turning FreeBASIC into C++ doesn't make much sense to me why not just use C++ it isn't that hard until you get into its more advanced features. The reason I stopped using C and used FreeBasic instead was it was easier to read having used QBASIC before and I didn't have to learn how to use the SDL library. FreeBasic handled bitmaps well and that suited the project I was working on at the time.

http://en.wikipedia.org/wiki/BASIC
"Most built-in procedures and functions [used in modern BASICS] are now represented as methods of standard objects rather than operators."
Console.Write("Do you want more stars? ")
Answer = Console.ReadLine()

Now I find that readable. And when programming in C++ although they were not object orientated themselves I found using C++ objects readable such as the String object. Although cin and cout were strange to me they were easier to read and use than the printf
ike
Posts: 387
Joined: Jan 17, 2011 18:59

Re: What happens next with OOP in FreeBasic and when? :)

Postby ike » May 16, 2015 0:09

Turning FreeBASIC into C++ doesn't make much sense to me why not just use C++


It make sense: you will be able to use more external libs

And you dont have to use all that advanced features if you dont like them.

For what I am using FB it is more advanced than I will ever need

But I would not complain if I can use
http://www.cgal.org/
in FB
caseih
Posts: 1518
Joined: Feb 26, 2007 5:32

Re: What happens next with OOP in FreeBasic and when? :)

Postby caseih » May 16, 2015 4:07

ike wrote:
Turning FreeBASIC into C++ doesn't make much sense to me why not just use C++


It make sense: you will be able to use more external libs


Except that it isn't actually necessary. It's not easy, and requires complicated tools like SWIG to generate the wrappers, but you can access C++ libraries from other languages that don't share the exact same object model. Sometimes there is a bit of an impedance mismatch, and sometimes wrappers have to be hand-written. Typically wrappers are written (generated) in C code, which is easy to access from other languages. The C code then calls into and manages the C++ objects, and then the part of the wrapper that's in the target languages wraps these C wrappers in whatever form (OOP for example) is appropriate for the language.

For example Qt has excellent bindings in Python and Python's object model is nowhere like C++'s. Yet you can use Python just as you normally would with PyQt, even to extend C++-based classes with Python classes, though there are some limitations to how you can use metaprogramming on these wrapped C++ classes.

But I would not complain if I can use
http://www.cgal.org/
in FB

If cgal doesn't use the C++ boolean type, then you can access cgal classes directly from FB using extern "C++" blocks to create FB type definitions.

To me the real moral of the story is never write libraries in C++! C-based libraries can be accessed from anywhere and easily wrapped to work with any language.
ike
Posts: 387
Joined: Jan 17, 2011 18:59

Re: What happens next with OOP in FreeBasic and when? :)

Postby ike » May 25, 2015 23:13

If cgal doesn't use the C++ boolean type, then you can access cgal classes directly from FB using extern "C++" blocks to create FB type definitions.


CGAL HAS SWIG BINDINGS, and examples in PYTHON and JAVA

https://github.com/cgal/cgal-swig-bindings



2015/02/01 - SWIG-3.0.5 released We are pleased to announce SWIG-3.0.5 has been released with the addition of support for Scilab.

http://www.scilab.org/scilab/gallery
http://cglab.gforge.inria.fr/

Return to “Community Discussion”

Who is online

Users browsing this forum: No registered users and 3 guests