Compile for one platform from another

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
the.weavster
Addict
Addict
Posts: 1537
Joined: Thu Jul 03, 2003 6:53 pm
Location: England

Compile for one platform from another

Post by the.weavster »

I'd like to be able to compile for any supported platform from any supported platform
User avatar
chi
Addict
Addict
Posts: 1034
Joined: Sat May 05, 2007 5:31 pm
Location: Linz, Austria

Re: Compile for one platform from another

Post by chi »

I'd like Fred to switch from FASM to LLVM. All the problems that PB is currently struggling with would be gone for good :twisted:
Et cetera is my worst enemy
Mohsen

Re: Compile for one platform from another

Post by Mohsen »

+1
User avatar
Josh
Addict
Addict
Posts: 1183
Joined: Sat Feb 13, 2010 3:45 pm

Re: Compile for one platform from another

Post by Josh »

This has already been discussed several times and, as far as I can remember, is not possible for legal reasons.
sorry for my bad english
BarryG
Addict
Addict
Posts: 3330
Joined: Thu Apr 18, 2019 8:17 am

Re: Compile for one platform from another

Post by BarryG »

Josh, legal for which bit: compiling on one platform for another, or switching from FASM to LLVM?
User avatar
mk-soft
Always Here
Always Here
Posts: 5409
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Compile for one platform from another

Post by mk-soft »

It's not that simple. It doesn't matter if it is ASM, LLVM or C++ compiler.
It is still the big differences of the operating system that have to be considered. You want to test it and you have to have everything from all operating systems.

-1
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
Saki
Addict
Addict
Posts: 830
Joined: Sun Apr 05, 2020 11:28 am
Location: Pandora

Re: Compile for one platform from another

Post by Saki »

This is not possible and will never be possible.

It must always be checked if a code works properly with the desired OS.

What works with Windows is far from being safe with Linux.

You can rather say that what works with Linux will probably work with Windows and Mac OS.
But primarily every code has to be checked in detail and adapted accordingly.

Working with VM is also risky,
that goes very well, but there are some strange misbehaviours from time to time.

Best Regards Saki
Last edited by Saki on Sun Jun 21, 2020 10:15 am, edited 2 times in total.
地球上の平和
User avatar
Josh
Addict
Addict
Posts: 1183
Joined: Sat Feb 13, 2010 3:45 pm

Re: Compile for one platform from another

Post by Josh »

BarryG wrote:Josh, legal for which bit: compiling on one platform for another, or switching from FASM to LLVM?
For compiling you need some libraries or other stuff that belongs to the operating system. You can't just take them and use them on another os.
sorry for my bad english
User avatar
the.weavster
Addict
Addict
Posts: 1537
Joined: Thu Jul 03, 2003 6:53 pm
Location: England

Re: Compile for one platform from another

Post by the.weavster »

Saki wrote:This is not possible and will never be possible.
Why will it never be possible?

I used to be able to do it with Real Studio (now Xojo and now a broken feature).
And I can do it with Nim: https://nim-lang.github.io/Nim/nimc.htm ... or-windows
User avatar
Tenaja
Addict
Addict
Posts: 1949
Joined: Tue Nov 09, 2010 10:15 pm

Re: Compile for one platform from another

Post by Tenaja »

the.weavster wrote:
Saki wrote:This is not possible and will never be possible.
Why will it never be possible?

I used to be able to do it with Real Studio (now Xojo and now a broken feature).
And I can do it with Nim: https://nim-lang.github.io/Nim/nimc.htm ... or-windows
The greatest hindrance to its possibility is Fred's desire, and he has repeatedly indicated it is not there.

Technically, it's possible. It seems he finds the maintenance overwhelming, which is understandable. He'd have to port the generation libraries to every platform, do there'd be nine instead of three... And if you add the recently promised arm output, it will be sixteen instead of four. Or, cumbersome #CompilerIfPlatform=TheRightOne statements.
User avatar
Saki
Addict
Addict
Posts: 830
Joined: Sun Apr 05, 2020 11:28 am
Location: Pandora

Re: Compile for one platform from another

Post by Saki »

Hi,
the OS are just too different.
It might work if you started from scratch.
But then a lot of things would probably work differently than now.
This would also mean that compatibility with older codes would no longer be possible.
So, a reduction to common features.
Look how many years of work has been done on the individual OS.
Thousands of people are working on improving and updating everything.
The more complex and extensive everything becomes, the harder it becomes to define commonalities.
Internal processes, many things are different.

Otherwise, it's quite amazing what these few people have already accomplished.
But if you look at the fact that it often takes several years to fix a single bug,
you can quickly see that it's not that easy.
I also don't believe that the developers have become rich through their efforts,
who is supposed to do it, who is supposed to pay for it, who can live on it ?
Many questions !

Best Regards Saki
地球上の平和
User avatar
mk-soft
Always Here
Always Here
Posts: 5409
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Compile for one platform from another

Post by mk-soft »

We should be happy with what we have with Purebasic. All functions are brought on a common denominator and that with the massive differences in the operating systems. Especially with the GUI. Windows API with the windows controls. MacOS with cocoa and objective-c. Linux with gtk2, gtk3 and QT. So the applications we create look good on the OS without having to drag huge libraries to display the user interface.

This is a great achievement of Fred, which is not appreciated enough.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
oreopa
Enthusiast
Enthusiast
Posts: 281
Joined: Sat Jun 24, 2006 3:29 am
Location: Edinburgh, Scotland.

Re: Compile for one platform from another

Post by oreopa »

Very good post mk-soft. I concur 100%
Proud supporter of PB! * Musician * C64/6502 Freak
deeproot
Enthusiast
Enthusiast
Posts: 271
Joined: Thu Dec 17, 2009 12:00 pm
Location: Llangadog, Wales, UK
Contact:

Re: Compile for one platform from another

Post by deeproot »

oreopa wrote:Very good post mk-soft. I concur 100%
Yes, very well said and I couldn't agree more!
User avatar
the.weavster
Addict
Addict
Posts: 1537
Joined: Thu Jul 03, 2003 6:53 pm
Location: England

Re: Compile for one platform from another

Post by the.weavster »

Tenaja wrote:Technically, it's possible. It seems he finds the maintenance overwhelming, which is understandable. He'd have to port the generation libraries to every platform, do there'd be nine instead of three... And if you add the recently promised arm output, it will be sixteen instead of four. Or, cumbersome #CompilerIfPlatform=TheRightOne statements.
Thanks for the perspective.

mk-soft wrote:We should be happy with what we have with Purebasic.
Oh, OK then... perhaps Fred should just shut down the Feature Requests and Wishlists section of the forum <eye-roll>
Post Reply