News for hackers. Stuff that matters.
Re:Lazarus IDE – write once, compile anywhere by rcarmo on Sunday September 11, 2022 @04:25AM (#32797818)
Is there any equivalent to Lazarus that uses a modern programming language and can output standalone binaries? I really miss the days when you could build simple, _native_ desktop GUI apps for various purposes.

(I have been using Godot Engine to do some toy apps and it sort of works, but…)

Re:Lazarus IDE – write once, compile anywhere by rahen on Sunday September 11, 2022 @04:42AM (#32797912)
What's wrong with Object Pascal?

"Plain" Pascal is about as efficient as C, uses slightly less memory, is safer because of its lower dependency on pointers, and is easy to work with, especially with strings.

Then Object Pascal has classes, units, interfaces, generics and type safety. Is it still not enough? https://castle-engine.io/modern_pascal

An alternative would be to build a Go program with a wish/tk frontend, which is also cross platform, native and simple to write. It's actually straightforward to do with go-pipes for the binding with wish, and provides a nice decoupling between the program and its UI. Also, it's fairly small and efficient unlike Qt, or worse, web technologies.

Re:Lazarus IDE – write once, compile anywhere by alexvoda on Sunday September 11, 2022 @04:46AM (#32797932)
Indeed, it is a modern language even if it is rather different from what we are used to today (mostly C descendants).

It is a niche choice but it is not outdated.

Re:Lazarus IDE – write once, compile anywhere by rcarmo on Sunday September 11, 2022 @05:42AM (#32798247)
As someone who wrote it 30 years ago, I have no interest in going back. And if any of my little tools become popular, I couldn't find anyone to pick them up after me.
Re:Lazarus IDE – write once, compile anywhere by jstimpfle on Sunday September 11, 2022 @06:32AM (#32798476)
A couple years ago I worked as a programmer in a 1-2M SLOC enterprise Delphi codebase for 6 months (I believe Delphi is basically Object Pascal). It let me do my work. Under the hood there is the same simple machine model as C and you can access it ok, but the ecosystem around it is considerably clunkier. 90's OOP craze is very present. The various container libraries are composed of different strata of types and classes that do the same things but with different philosophies that were popular over time. Mix of 0-based and 1-based indexing in various string and array types is one of the most annoying problems that I can recall.

Syntax-wise, it was weird the we had to do a lot of "PFoo" pointer-to-foo style typedefs. Syntax has a few strange "addressing" models builtin, including out vars etc. Allocation using "SetLength" is weird, a function that takes a dynamic array can realloc it but the changes would not (or only when reallocation was required?) reflect in the caller. I resorted to plain pointers and manual memory management, because everything else was too confusing for me.

To wrap up, it has a lot of fluff built in that doesn't scale because of non-orthogonality of features, and some OOP that is hard to use IMHO because it is too implicit. As a C programmer I am biased but I find that the usable parts are the C-like parts. The syntax is considerably more clunky compared to C, with all the keywords that tire the eyes and fingers after writing a couple hundreds lines of code.

On the plus side, I'm not an ecosystem guy but I'm sure the ecosystem has a lot to offer functionality-wise, including extensive coverage of the Win32 API. And the compiler is really fast, I have good memories of it and the (Embarcadero) IDE. A big reason why it's fast is that the syntax and module system are better designed than C as far as allowing efficient implementation.

Re:Lazarus IDE – write once, compile anywhere by rcarmo on Sunday September 11, 2022 @05:30AM (#32798188)
I find it clunky and verbose. I wrote Pascal and Modula-2 during my VAX years and honestly don't want to go back 30 years or so... But I do find go to be an interesting alternative, as long as no web components are involved.
Re:Lazarus IDE – write once, compile anywhere by andy128k on Sunday September 11, 2022 @06:17AM (#32798403)
Lack of automatic memory management (garbage collector, smart pointers, ARC...).
Re:Lazarus IDE – write once, compile anywhere by Y_Y on Sunday September 11, 2022 @04:43AM (#32797915)
Qt Creator? It definitely comes with some headaches but it ticks the boxes of being modern and cross-platform. I've used it to develop fairly complex applications that run on multiple OSes and look/feel IMHO pretty good.
Re:Lazarus IDE – write once, compile anywhere by rcarmo on Sunday September 11, 2022 @05:44AM (#32798262)
I an loathe to deal with its licensing requirements, plus I've never been completely comfortable with their IDE
Re:Lazarus IDE – write once, compile anywhere by seba_dos1 on Sunday September 11, 2022 @09:49AM (#32799613)
What's wrong with LGPL licensing?
Re:Lazarus IDE – write once, compile anywhere by haunter on Sunday September 11, 2022 @05:35AM (#32798215)
Wouldn't PyInstaller solve this? Not a cross compiler though https://pyinstaller.org/
Re:Lazarus IDE – write once, compile anywhere by rcarmo on Sunday September 11, 2022 @05:39AM (#32798232)
The state of affairs for cross-platform Python GUIs is pretty underwhelming right now, and I want something that doesn’t carry a Python disto around. We should be able to do single megabyte executables real again…
Re:Lazarus IDE – write once, compile anywhere by soapdog on Sunday September 11, 2022 @05:01AM (#32798020)
There is LiveCode from https://LiveCode.com

I have been enjoying it to make bespoke gui apps for more than a decade.

Re:Lazarus IDE – write once, compile anywhere by mhoad on Sunday September 11, 2022 @04:59AM (#32798012)
Flutter is almost certainly the answer you are looking for here. You can see what the developer experience is like here https://docs.flutter.dev/get-started/codelab
Re:Lazarus IDE – write once, compile anywhere by rcarmo on Sunday September 11, 2022 @05:36AM (#32798225)
No, I don't want any JavaScript in my desktop apps, sorry.
Re:Lazarus IDE – write once, compile anywhere by mhoad on Sunday September 11, 2022 @09:17AM (#32799379)
You’re in luck then because there is none. You seem To be thinking of Electron which is something entirely different.
Re:Lazarus IDE – write once, compile anywhere by rahen on Sunday September 11, 2022 @05:13AM (#32798093)
OP insisted on _native_ desktop apps, not wrapped web apps. Otherwise Java/Swing would have been a no-brainer.
Re:Lazarus IDE – write once, compile anywhere by account-5 on Sunday September 11, 2022 @05:21AM (#32798145)
From my current reading of Dart/Flutter[0] the output is not a wrapped webapp.

[0] https://dart.dev/tools/dart-compile

Re:Lazarus IDE – write once, compile anywhere by rahen on Sunday September 11, 2022 @05:40AM (#32798238)
It's not a native desktop app either, it embeds a large JIT and a hello world is around 50 MB.
Re:Lazarus IDE – write once, compile anywhere by account-5 on Sunday September 11, 2022 @06:04AM (#32798350)
This might be my lack of knowledge in this area since I'm just reading at the minute but from my reading that's not the case. If you create a standalone app (exe compile option) there is no JIT, just: "A standalone, architecture-specific executable file containing the source code compiled to machine code and a small Dart runtime." that "... handles type checking and garbage collection."

Unless that runtime is what you're referring to as a JIT. But since it outputs machine code that is a compiled program, not a JIT. I obviously can't speak to the size as I've not written anything yet, I'm just practing.

Quite happy to be corrected if I'm misreading things though.

Re:Lazarus IDE – write once, compile anywhere by mhoad on Sunday September 11, 2022 @09:20AM (#32799396)
You seem to be a bit confused on this topic. Have you actually used Flutter before? What you’re describing isn’t how it works at all.
Re:Lazarus IDE – write once, compile anywhere by kaba0 on Sunday September 11, 2022 @07:26AM (#32798728)
You can actually compile a Swing app with Graal for a standalone executable nowadays
Re:Lazarus IDE – write once, compile anywhere by mhoad on Sunday September 11, 2022 @09:18AM (#32799382)
They are native desktop apps. Not sure where you got any other idea from.
Re:Lazarus IDE – write once, compile anywhere by account-5 on Sunday September 11, 2022 @04:53AM (#32797978)
Dart/Flutter seem to offer this, modern language, GUI framework, and compiles to binaries or transpiles if targeting web.
Re:Lazarus IDE – write once, compile anywhere by shrubble on Sunday September 11, 2022 @08:14AM (#32798978)
What is 'modern for you, exactly?
Re:Lazarus IDE – write once, compile anywhere by s7g2vp2 on Sunday September 11, 2022 @06:34AM (#32798481)
have you tried Xojo? https://www.xojo.com/