Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2010-05

FPC + Haiku: how good is it?

7 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

Recently I have been playing with various OSes and various linux distros on my laptop (while I have a spare drive with no data). This is something I haven't done in years since I switch to Ubuntu full-time.

Anyway, I saw on OSNews the new release of Haiku R1A2 and thought I would try it out. I never used BeOS or Haiku before, so I don't know what the fuss is about but wanted to find out.

Boy was I impressed with the speed of Haiku even while running it from the LiveCD. It also detected and activated all the hardware in my Dell Inspiron 9100 laptop (something only the latest Ubuntu 10.04 managed to do for the first time). The OS and filesystem seems to be very well designed too - all nice with Objects (OOP) all over the place. I also watched the 2007 Google Tech Talk about Haiku - a bit old and outdated, but good for some background information on Haiku.

Anyway, I saw that FPC 2.4.0 has a Haiku release (I was quite surprised - kudos to the FPC developers!). How mature/stable is FPC on Haiku? Is it usable, or is it still very experimental?

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/

Reply by email

Matt Emson
to Graeme Geldenhuys

Graeme Geldenhuys wrote:

It's not often I get to actually have knowledge to give!

Anyway, I saw that FPC 2.4.0 has a Haiku release (I was quite surprised - kudos to the FPC developers!).

FPC supported BeOS since FPC 2.0. I believe the first port was by Pavel Kasselberger (sp?) for his Pixel image editor. I used to be involved in the effort to port some kind of API mapping, so I can give a little info.

How mature/stable is FPC on Haiku? Is it usable, or is it still very experimental?

The BeAPI (the API that Haiku has inherited) is C++ based and *heavily* multithreaded. As such, it is (was) pretty laborious to get any GUI apps working. I wrote some simple wrappers, which worked okay. They are probably still available in the Be FPC Source Forge repo. The other guys on the project started to write a real API wrapper, and at that point I sort of dropped out of the loop, so I'm unsure exactly how far they got. I remember the API having a lot of circular dependencies and modelling it in the same way as the BeAPI layed out files was pretty impossible. That was the last I spoke to them.

Your biggest issue is not C++, it is multithreading. In BeOS, every app has a thread (as normal) and every window has a separate Thread (actually, more than one, as there is one or more in the app_server for every one in the executable, but at the simplest level, the one per window is fairly accurate.) BeOS used B as a prefix, much like Borland's T. So you get a BLooper (a "thread"), then BMessenger (Postbox/message sender) and BHandler (a "message" handler), a BWindow inherits from both (IIRC) and IPC is done via an object based system comprising of BMessages that contain lists of values (basic data types, instances of class/structures, pointers etc.) The whole system is extremely client/server. Sending a message between two applications is trivial. This is all pretty easy to wrap with a little thought. However, some controls need to be created in the right thread context, so it starts getting messy.

Anyway, I'm working on 10 year old information, but Haiku is modelled very much after the original BeOS. Mind you, Haiku now has a QT 4.x port, so you might find that is simpler to get going?

M

Reply by email

Graeme Geldenhuys
to Matt Emson

Matt Emson het geskryf:

It's not often I get to actually have knowledge to give!

:-)

Anyway, I'm working on 10 year old information, but Haiku is modelled very much after the original BeOS. Mind you, Haiku now has a QT 4.x port, so you might find that is simpler to get going?

Thank you very much for all the information. I'll try and install FPC 2.4.0 on Haiku in the coming days and see how it goes. As for the writing of apps
- if my experience with FPC+Haiku goes well, I would like to add yet another todo item to my list (as if I don't have enough). I am considering writing a Haiku backend for the fpGUI Toolkit. This will bring some new apps and development tools to Haiku. For fpGUI to work on any platform I need very limited support from the OS itself (basic window handling and some canvas painting routines) as fpGUI does much of the work internally.

As for the Pixel project - I think Pavel supported various platforms by simply writing a single SDL backend for eLiquid. I think, I don't really know much about Pixel or eLiquid.

I saw Haiku has Qt 4.x support - I wonder if Lazarus IDE compiled with Qt will run under it? Has anybody tried this yet?

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/

Reply by email

Olivier Coursiere
to Matt Emson: It's not often I get to actually have knowledge to give! FPC supported BeOS since FPC…

Hi,

Matt Emson wrote 10 lines
Graeme Geldenhuys wrote: > Anyway, I saw that FPC 2.4.0 has a Haiku release (I was quite > surprised - > kudos to the FPC developers!). FPC supported BeOS since FPC 2.0. I believe the first port was by Pavel Kasselberger (sp?) for his Pixel image editor. I used to be involved in the effort to port some kind of API mapping, so I can give a little info.

If i remember correctly, the BeOS port was started in the 1.x series.

Now, FPC 2.4 should be pretty much complete under Haiku. All packages are not heavily tested though. Some bugs probably remains here and there. The text mode IDE even work with mouse and debugging support.

Show quoted text 31 lines
> How mature/stable is FPC on Haiku? Is it > usable, or is it still very experimental? > The BeAPI (the API that Haiku has inherited) is C++ based and *heavily* multithreaded. As such, it is (was) pretty laborious to get any GUI apps working. I wrote some simple wrappers, which worked okay. They are probably still available in the Be FPC Source Forge repo. The other guys on the project started to write a real API wrapper, and at that point I sort of dropped out of the loop, so I'm unsure exactly how far they got. I remember the API having a lot of circular dependencies and modelling it in the same way as the BeAPI layed out files was pretty impossible. That was the last I spoke to them. Your biggest issue is not C++, it is multithreading. In BeOS, every app has a thread (as normal) and every window has a separate Thread (actually, more than one, as there is one or more in the app_server for every one in the executable, but at the simplest level, the one per window is fairly accurate.) BeOS used B as a prefix, much like Borland's T. So you get a BLooper (a "thread"), then BMessenger (Postbox/message sender) and BHandler (a "message" handler), a BWindow inherits from both (IIRC) and IPC is done via an object based system comprising of BMessages that contain lists of values (basic data types, instances of class/structures, pointers etc.) The whole system is extremely client/server. Sending a message between two applications is trivial. This is all pretty easy to wrap with a little thought. However, some controls need to be created in the right thread context, so it starts getting messy. Anyway, I'm working on 10 year old information, but Haiku is modelled very much after the original BeOS. Mind you, Haiku now has a QT 4.x port, so you might find that is simpler to get going?

This has not changed under Haiku. The GUI API is the same (http://www.haiku-os.org/legacy-docs/bebook/). Haiku is just more POSIX than BeOS. The wrapper is still in the same state. But i plan to rework on this in the future now that the compiler side is pretty much complete. Maybe the first step should be to switch to svn as i am not sure i still remember how to use cvs. At least, befpc still compile and work under Haiku. I have even found a bug in Haiku using the sample program (http://dev.haiku-os.org/ticket/1651).

Olivier

Reply by email

Olivier Coursiere
to Graeme Geldenhuys: Matt Emson het geskryf: :-) Thank you very much for all the information. I'll try and…
Graeme Geldenhuys wrote 10 lines
Matt Emson het geskryf: Thank you very much for all the information. I'll try and install FPC 2.4.0 on Haiku in the coming days and see how it goes. As for the writing of apps - if my experience with FPC+Haiku goes well, I would like to add yet another todo item to my list (as if I don't have enough). I am considering writing a Haiku backend for the fpGUI Toolkit. This will bring some new apps and development tools to Haiku. For fpGUI to work on any platform I need very limited support from the OS itself (basic window handling and some canvas painting routines) as fpGUI does much of the work internally.

It would be a nice.

I saw Haiku has Qt 4.x support - I wonder if Lazarus IDE compiled with Qt will run under it? Has anybody tried this yet?

I have tried. And it even work quite well now. All patches are available in the lazarus trunk. What is missing is debugging support. There is also a problem when resising components in the designer, probably because Qt is still young under Haiku. I plan to write a wiki page to explain how to build Qt, Qtpas and Lazarus on Haiku.

The official 2.4.0 for haiku is not enough to compile Lazarus. I discover a few bugs. They are hopefully fixed in trunk and in the fixes_2_4 branche.

One thing to do to compile lazarus under Haiku is setting gcc4 as the current one using setgcc gcc4. Qt does not compile with the default old gcc 2.95. Lazarus need to set gcc4 so ld look at the right libraries while linking.

Good luck with FPC and Lazarus under Haiku.

Olivier

Reply by email

Schindler Karl-Michael

Hi,

My 2 cents regarding crosscompiling to Haiku:

The original binutils from gnu do not support haiku directly. The point is that the Haiku project hosts its own modified version of the binutils, which have not been backported to the gnu source. The Haiku binutils are also not the most recent version. However, the modifications are minor. Using a diff of the Haiku and the original version, I was able to patch the recent version of the binutils. I did this on Mac OS X, but it should serve as a base of a crosscompiler on any other platform. I did not do any further tests, since there was no real feed back, that actually anyone was interested in this and i had some other stuff to do.

If anyone is interested in building a crosscompiler, I could still provide the patch file.

Michael.

Reply by email