Recent

Author Topic: Future of Lazarus and MacOS  (Read 5444 times)

stem

  • Jr. Member
  • **
  • Posts: 70
Future of Lazarus and MacOS
« on: December 31, 2018, 04:11:06 pm »
Hi,

I'm developing an application that runs as well as on Linux as on Windows. Everything works fine on both operating systems.

Now I'm thinking about supporting MacOS. As I'm completely new to Mac(OS), I've done some reading in the forum about the different widgetsets and about the installation of Lazarus.

Did I unterstand correctly that Cocoa is not fully supported with Lazarus and not as stable as the other widgetsets, although Cocoa is the widgetset one should focus in the future? Is it a "good" idea to do coding for MacOS with Lazarus and not with XCode? (I've read that there are many users of MacOS, but not many developers with Lazarus.)

So the final question: Is it "worth" having an eye on MacOS + Lazarus and thinking about buying hardware or will the "Lazarus experience" not be as good as with Linux and Windows?  ;)

Additional question: Assuming I create an application with Lazarus and the latest MacOS 10.14 Mojave, will it run on other versions of MacOS? If yes, on which? Thanx.


Thanx alot and a happy new year

Stem
« Last Edit: December 31, 2018, 04:32:59 pm by stem »

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2496
    • havefunsoft.com
Re: Future of Lazarus and MacOS
« Reply #1 on: December 31, 2018, 04:45:29 pm »
Assuming I create an application with Lazarus and the latest MacOS 10.14 Mojave, will it run on other versions of MacOS? If yes, on which? Thanx.
if you link the app for the compatibility with the previous versions of macOS, then you can go as low as 10.6 for Cocoa.
and 10.4 for Carbon.
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 6455
    • wiki
Re: Future of Lazarus and MacOS
« Reply #2 on: December 31, 2018, 04:48:59 pm »
This really is the chicken or egg question.

Lazarus depends on users - who report issues - to become (or keep being) a good environment.

This is true on all platforms. On Windows and Linux there are plenty of people, and problems are discovered, and the developers (or sometimes users by means of patches) can fix them.

At current there is active development for cocoa. So if you run into issues they may get fixed.

So the final question: Is it "worth" having an eye on MacOS + Lazarus and thinking about buying hardware or will the "Lazarus experience" not be as good as with Linux and Windows?  ;)

About the buying, if you go for x-code you have buy it too.

About coming from windows... You probably will scream about the OS differences, even before you download Lazarus. Every mouse action and keyboard usage are totally difference.
That goes to the point, that many of the key-combos that Lazarus uses, are occupied by the MacOs, and you need to use others.

As for comparing the IDE and LCL experience:
There are widget dependent differences, some by design. (same as some things work diff in gtk, compared to win).

Cocoa is much newer. So it is far less tested. But it also is actively worked on right now.
I have no experience of my own how they compare.

But I would say, you will have to expect some pitfalls at the very least.
(while I wrote about debugging speed (below), compiling is slower too)


No idea if it is worth it. (in terms of money spent on the hardware).

------------------
As for comparing debugging:
(one of the topics, and the one on which I can comment)

You have a choice between gdb-based and lldb-based.

gdb based is extremely hard to get working. If you do get it working (and that is a very big IF), then it will (should?) be similar to what you have on windows.

lldb works out of the box. But it will be first released with Lazarus 2.0.
Some beta testers report that it generally works. But once it goes officially released, I am certain there will be a ton of bug reports.

- Debugging with the lldb based debugger is definitely slower than gdb-based on Windows. And that can NOT be fixed.
- lldb based does not (or not fully) support watch-points. And it is unclear yet, if that will improve.
- "step over to cursor" is not implemented. It is a todo. But with low priority
- attach/detach is not implemented. It is a todo. But with low priority
- debugging libraries is not implemented. It is a todo. But with low priority (and unclear how well it will work)
- modifying watches value is not implemented. It is a todo. But with low priority and unclear if possible (though that has severe limits on windows and gtk too)

Probably more. But as I said, many differences will only become clear, when people start using it.

jwdietrich

  • Hero Member
  • *****
  • Posts: 1121
    • formatio reticularis
Re: Future of Lazarus and MacOS
« Reply #3 on: December 31, 2018, 04:51:27 pm »
This is a lot of simple questions that aren't however simple to be answered.

I personally develop software for the Mac with Lazarus since 2011. It allowed me to migrate old Pascal code (written in the 1990ies with THINK PASCAL) to modern platforms, and this method delivered well-functional professional platform-sensitive apps. However, we have also to admit that Lazarus is less mature on macOS, especially if compared to the Windows version. The last months witnessed considerable improvements with the advent of rather complete Cocoa support and debugging facilities made available again. There is still, however, a quite large amount of work to do.
function GetRandomNumber: integer; // xkcd.com
begin
  GetRandomNumber := 4; // chosen by fair dice roll. Guaranteed to be random.
end;

http://www.formatio-reticularis.de

Lazarus 2.0.10 | FPC 3.2.0 | PPC, Intel, ARM | macOS, Windows, Linux

Trenatos

  • Hero Member
  • *****
  • Posts: 524
    • MarcusFernstrom.com
Re: Future of Lazarus and MacOS
« Reply #4 on: December 31, 2018, 06:24:18 pm »
My main computer is a MacBook Pro, I cross compile for Windows and Linux.

Depending on what I'm doing, I usually either compile for Mac-only (Cocoa, as Carbon is EOL) or cross compile for all of them.

Lazarus is incredibly handy for creating Mac applications.

Sure there are some things to keep in mind between platforms, but for the most part things work very well across platforms.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: Future of Lazarus and MacOS
« Reply #5 on: December 31, 2018, 08:29:55 pm »
Additional question: Assuming I create an application with Lazarus and the latest MacOS 10.14 Mojave

If you want to use Lazarus and MacOS, I would recommend that you buy an used MacBook that runs for example 10.10 Yosemite. The development experience is pretty good there. I am writing a commercial software with this setup.

With 10.14 it is very hard to get the debugger to work, because Apple dropped gdb support and AFAIK Lazarus doesn't support lldb at the moment.

jwdietrich

  • Hero Member
  • *****
  • Posts: 1121
    • formatio reticularis
Re: Future of Lazarus and MacOS
« Reply #6 on: December 31, 2018, 09:44:16 pm »
With 10.14 it is very hard to get the debugger to work because Apple dropped gdb support and AFAIK Lazarus doesn't support lldb at the moment.

I have Lazarus 2.0 RC3 with lldb debugger running here (see http://forum.lazarus-ide.org/index.php/topic,42869.0.html for instructions). It works quite well, although lldb is slower than GDB.
function GetRandomNumber: integer; // xkcd.com
begin
  GetRandomNumber := 4; // chosen by fair dice roll. Guaranteed to be random.
end;

http://www.formatio-reticularis.de

Lazarus 2.0.10 | FPC 3.2.0 | PPC, Intel, ARM | macOS, Windows, Linux

dbannon

  • Hero Member
  • *****
  • Posts: 1108
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Future of Lazarus and MacOS
« Reply #7 on: January 01, 2019, 04:54:59 am »
My experience is very directly related to your question. I built an app  that compiles from one code base on both Linux and Windows. I wondered about mac, never used one myself. I managed to pick up an old, 2012, Mac Powerbook on ebay for a hundred odd dollars AU$. It had faulty USB ports but otherwise works fine, I run Sierra (10.12).

I was not willing to maintain a separate code base, if it was just a case of "write once, compile anywhere" it was worthwhile. My code has a few easily managed $IFDEFs and I can build both Carbon and Cocoa based versions. The Cocoa one I still class as experimental, it has a few issues. The Carbon one works fine - again, while I have had to adjust the code to accommodate Cocoa, there is no separate inc files specific to one platform.

I think martin_fr is being a bit harsh, gdb can be got going if you follow some laborious but clear enough instructions. lldb works, if its slow, I assume its because I'm using old hardware !

But this approach really means you spend very little time developing on the mac, most work is done on your preferred platform, you will test and, occasionally, debug on the Mac.

You will have to spend time making the Mac specific distribution package, its quite complicated but once setup, just a case of running a few scripts. See the scripts in my project's 'package' directory, its all open source !       

Use the fixes_2_0 branch of Lazarus, its Cocoa is heaps better.

In summary,  yep, I reckon you should !
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

stem

  • Jr. Member
  • **
  • Posts: 70
Re: Future of Lazarus and MacOS
« Reply #8 on: January 01, 2019, 11:28:48 am »
Hi,

thank you for your answers and a happy new year!  :)

Do I understand correctly that
a) I need at least macOS 10.4 for building Carbon apps
(only 32 bit) and at least macOS 10.6 for building Cocoa
apps (only 64 bit)?
b) an app built with an old Mac can run and looks the same
on the most modern Mac?
c) Carbon will be discontinued by Apple in the future?
d) Cocoa support of Lazarus is being worked on heavily
at present, so that future versions of Lazarus will much
better work with Cocoa?

 ;)

stem

dbannon

  • Hero Member
  • *****
  • Posts: 1108
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Future of Lazarus and MacOS
« Reply #9 on: January 01, 2019, 11:39:41 am »
a) I need at least macOS 10.4 for building Carbon apps
(only 32 bit) and at least macOS 10.6 for building Cocoa
apps (only 64 bit)?

No, I don't think either is the case. I'd expect, but don't know, you can go back further than 10.4.

b) an app built with an old Mac can run and looks the same
on the most modern Mac?

Yep.

c) Carbon will be discontinued by Apple in the future?

Yes, when you (first ?) startup a 32bit app in the newest version, you get a warning.
 
d) Cocoa support of Lazarus is being worked on heavily
at present, so that future versions of Lazarus will much
better work with Cocoa?

Probably !

And a happy new year to you too !

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

CCRDude

  • Hero Member
  • *****
  • Posts: 502
Re: Future of Lazarus and MacOS
« Reply #10 on: January 07, 2019, 09:37:59 am »
About buying hardware: they are grey areas like virtual machines running macOS, or a Hackintosh on existing hardware, or even rented remote desktop access, that might help evaluating the system before purchasing Apple hardware (or Hackintosh hardware).

I do cross-compile to macOS and Linux from Windows and just need the Mac to wrap/sign an App Store compatible bundle & package.

Can't speak much about the LCL, since my app has a custom BGRA based GUI, but the few bugs I encountered were quickly fixed.

The Lazarus IDE was bit struggling the past months (especially on the Mac, I "need" AnchorDocking, which failed the past few weeks), but usable, and debugging using lldb is indeed a good experience (seems to be more responsive than gdb on Windows).

ps

  • Full Member
  • ***
  • Posts: 129
    • CSS
Re: Future of Lazarus and MacOS
« Reply #11 on: January 07, 2019, 10:26:46 am »
Progress of current Cocoa support is amazing.  Running hackintosh (Ryzen CPU, NVidia GPU :) ) without any issuses. Little worried about new ARM CPUs  for MacOS (if any) and how fast Lazarus team will bring arm support for this platform.
Small simple CSS/box model implementation: https://github.com/pst2d/csscontrols/tree/dev

kevin.black

  • Full Member
  • ***
  • Posts: 122
Re: Future of Lazarus and MacOS
« Reply #12 on: February 08, 2019, 04:24:18 am »
If you do not have mac hardware and would like to try, by far the simplest is to run macOS (if it's on non-Apple hardware) using VMware Workstation. There is a slight hack, it's on the web, but works well. You can take snapshots and wind-back if things blow up. Overall a good idea.

As suggested you can build a Hackintosh, but this is significantly more complicated and generally breaks with every OS upgrade. If things blow up you have some difficulty resurrecting the system. Personally, and YMMV, I would not recommend the Hackintosh route.

Further, if you buy an older, cheap (sic) mac/macbook/macmini and can run either parallels or FUSION (mac version of VMWare Workstation) just ensure that you have as much RAM as possible (16GB is good). You can then buy a (relatively) cheap Thunderbolt 2 SSD drive (TB 3 will not play unfortunately) or a USB 3 SSD drive which are both adequate to run VMs at a reasonable speed especially if your main system disk is relatively small. Note if you upgrade later to a system with TB3/USB C the TB 2 drive will work as a standard USB 3 Drive. You also get the Apple connectivity with Drive sharing, iMessages (if you have an iPhone) etc etc...

TL;DR run macOS in a VM
HTH

HenrikErlandsson

  • New Member
  • *
  • Posts: 19
  • ^ Happy coder :)
Re: Future of Lazarus and MacOS
« Reply #13 on: September 09, 2019, 02:16:15 pm »
Posting from the future. My answers are timeless, though, I think. :) If your program must have a Mac OS port, e.g. business software for deployment in a company, you should have a very late Mac OSX version running at least for testing. If it's just a case of supporting Mac OSX also, I wouldn't bother unless it's a killer app or game that is, or you think will be, popular.

As for costs, anything that needs XCode requires a yearly fee of $100 to Apple. You will likely also want to distribute over the App Store, because Apple allows perfectly valid installation packages and executables only from the devs they know and themselves, and clients will have to have admin rights and muck around with System Prefs to run them. There's also the cost of the OS itself, which is only free for Mac buyers AFAIK. A quick Google suggest you can't buy OSes separately since 10.8?

If you're making games, a big issue is that Apple has dropped OpenGL support in favor of their own Metal (only), naturally expecting all devs to rewrite their games and engines for Metal.  :D

As for development, I have a Mac, and compilation and execution performance is several times faster with the Windows version in a VM on the Mac, than making native applications on the Mac. I don't know why, but Mac GUI components have been rewritten to not be slowed down by the 5K resolution, and maybe Lazarus and Forms don't yet take advantage of that.

I'll leave cross-compilation for more experience devs to answer, but in order for your application to not be seen as an intruder (see above), you still need an Apple Developer account at $100/year and probably XCode to package it for upload "Application Loader", even if you can create the release files on another platform.
Turbo Pascal was the tool of my trade as a young professional.

ps

  • Full Member
  • ***
  • Posts: 129
    • CSS
Re: Future of Lazarus and MacOS
« Reply #14 on: September 09, 2019, 02:46:17 pm »
As for development, I have a Mac, and compilation and execution performance is several times faster with the Windows version in a VM on the Mac, than making native applications on the Mac. I don't know why, but Mac GUI components have been rewritten to not be slowed down by the 5K resolution, and maybe Lazarus and Forms don't yet take advantage of that.
I have "hackintosh" and on same hardware, mac compilation is faster than Windows. Problem is with LCL performance. Maybe too much repainting: https://bugs.freepascal.org/view.php?id=34829
Small simple CSS/box model implementation: https://github.com/pst2d/csscontrols/tree/dev

 

TinyPortal © 2005-2018