I'm torn about which is clearer, that magic variable style or assigning to the function name as one does in VBScript. I guess the magic variable makes refactoring dirty fewer lines
I also have mixed feelings about golang's `func Doit() (result int, err error)` syntax. To quote another platform, "there should be one, and preferably only one, obvious way to do it"
Isn't it basically equivalent to an anonymous tuple which is automatically deconstructed on assignment?
I'm sure this solved some Google-y problem but for my tastes it is just needlessly confusing since I have never met a programmer who needed help creating local variables and that's got to be infinitely true now that AI gonna take all our jobs
> Isn't it basically equivalent to an anonymous tuple which is automatically deconstructed on assignment?
Your comment brought up an interesting point: a certain audience may also think those names appear in the caller's scope because they're part of the function's published signature but are an implementation detail
func Doit() (result int, err error) {
return 123, nil
}
func main() {
// a, b := Doit()
// fmt.Printf("In reality %d %+v\n", a, b)
Doit()
fmt.Printf("Uh-huh %d %+v\n", result, err)
}
./fred.go:13:32: undefined: result
./fred.go:13:40: undefined: err
I also just realized they're one of the places where golang doesn't emit a compile error for unused variables (as in the example above). Now I extra hate it func Doit() (result int, err error) {
result = 123
return 456, nil
}
That's also "old style" Pascal, and still supported by Free Pascal (even though the compiler gives you a warning for doing it!).
type PInteger = ^Integer;
var X: Integer;
function Foo: PInteger;
begin
Foo := @X;
Foo^ := 123;
end;
The first assignment here is assigning to the magic result variable, while the second one recursively invokes the function and dereferences the returned pointer to assign through it. This is technically not ambiguous (since you can never have a naked function call on the left side of the assignment, unlike say C++), but it's a subtle enough distinction for human readers. No such problem with `Result`, obviously, which is presumably why it was one of the things that Delphi added since day 1.Besides Qt, does it have a pure Win API back-end as well?
I guess I'll wait for the next minor.
This was something like 500 Kb back in 2000, but it's still a far cry from your ~200 Mb Electron hello world.
With Gtk, no, because it implements all widgets by itself rather than wrapping Win32, so it'll necessarily be larger. Also, statically linking it can be a pain (and AFAIK isn't even supported in Gtk 4 anymore).
Then there is .NET Native and Native AOT.
Lazarus should have been the golden standard for creating desktop apps. Every other solution I've tried is subpar either in licensing or costs in general, executable size and resource usage, non native components, extra dependencies etc
It’s a pity that the C family of languages won out over Wirth’s languages. Pascal’s superior string handling alone would have saved us from countless security flaws.
But that was the static overhead of VCL core library and the benefits were considerable compared to writing raw WinAPI.
And unlike MSVC 16kB WinAPI executable you didn't have chance of sudden surprise "oh, but you need to update msvcrt.dll to run this" because Delphi (and Lazarus/FPC) default to statically linking the runtime
Qt backend should be able to do that, though (but then of course you need all those Qt DLLs).
[1]: https://learn.microsoft.com/en-us/windows/win32/winmsg/wm-wi... [2]: https://github.com/ysc3839/win32-darkmode
Be aware that this is what you're getting into when you pick dotnet for GUI applications. It's been that way for decades at this point, there are many unfixed bugs in WPF for example, in spite of it being touted as the final word in GUI development in its time and still being used for some Microsoft applications like VS.
Meanwhile, with Delphi you were using VCL 20 years ago, and you're still using VCL today, and its development velocity and performance is light years ahead of anything Microsoft put out during that time. This also applies to Lazarus's LCL.
https://github.com/microsoft/microsoft-ui-xaml/issues
https://github.com/microsoft/WindowsAppSDK/issues
May be I am doing something wrong, but I had installed Android Studio, then Android emulator, SDK, etc., and before I could get a hello-world app to compile, some 30 GB were gone from my disk space.
If it comes to it, I do not personally mind using multiple tools and code for different target platforms, as much as (a) both the tools themselves and the binaries generated are lean, and (b) the development tooling itself is on a single platform just so that I do not need to maintain multiple hardware. (I currently use Windows, would likely need to move over).
Thanks.
The problem is that you need to have a huge Java runtime installed or use something like Jlink which still produces very large binaries for GUI apps.
I think wxWidgets is the Lazarus alternative that is the closest to what grandparent was asking for.
Is there something similar for Android as well?
Asking ChatGPT, it has made recommendations for Haxe most importantly, which claims to support a large number of platforms.
I could use C++ and stick with Qt, but I'd much prefer Rust. Rust has no good Qt bindings. What are my options?
The app makes use of QV/HBoxLayout, QWidget, Qdialog, QPushButton, and other really standard features. It reads from the filesystem, reads and writes to SQLite, and outputs sound from mostly ogg files at various speeds (through VLC behind the scenes). I stick with Qt because I like how it integrates with KDE and other desktops flawlessly.
Also did you test similar functionality in C++, I haven’t compared many implementations but I app I use that has an SQlite db being read with Qt(C++) is pretty sluggish whenever you touch the DB.
Maybe store the values in a dict and only read/write from sqlite when needed. Dicts are very fast in python.
There are several Qt binding for rust, for example cxx-qt. I haven't tried myself but it looks maintained. Why is it not good?
Otherwise, the most promising equivalent to Qt in Rust would be Slint.
> I stick with Qt
These come up on search results if you combine Qt plus the language.
Go:
* https://github.com/mappu/miqt
Java:
* https://github.com/OmixVisualization/qtjambi
Nim:
* https://github.com/jerous86/nimqt
* https://github.com/seaqt/nim-seaqt
Zig:
And so it drives me crazy to see the state of their documentation. The wiki needs to be archived and replaced with a coherent documentation platform. It’s such a turn off. The whole website is a SWAG site frankly.
‘ SWAG sites
SWAG is an archive of tips and example programs for Turbo Pascal/Borland Pascal and early Delphi. Much of it is still applicable to today's Object Pascal - and much is obsolete...’
How can a language compete when a new user sees this?
Is this the wiki you somehow want to have removed? https://wiki.freepascal.org/
It seems perfectly fine, information-dense even which is even better. Seems a lot better than the typical one-long-landing-page-docs many languages have today. What exactly is the problem with the wiki that cannot be fixed and must be re-made from scratch?
It has good stuff, but I'd wager the "bad stuff" outweighs it by a large margin.
I talked about this in my article about the release:
> One criticism we've seen of the FreePascal project in general concerns its documentation, although there is quite a lot of it: eight FPC manuals, and lengthy Lazarus docs in multiple languages. There is a paid-for tutorial e-book available, too.
The criticism is that there is too much documentation available? And they're long, and dare even to be available in multiple languages?
Lazarus and FPC is a great project. Building GUI apps like with Lazarus does not have an easy alternative, from which I'm aware.
I have tried it now on my Mac, and I have to jump through some hoops to get it going. Again a pity, its a great option.
I do it with C, using opaque pointers for C objects. Painless because everything is statically compiled in.
If you want a more dynamic solution (i.e. Python), you'll need to find a way to link every component in (or at least the ones your Python would use).
I use Lua from Delphi and vice versa regularly
colechristensen•18h ago
>Lazarus is a Delphi compatible cross-platform IDE for Rapid Application Development. It has variety of components ready for use and a graphical form designer to easily create complex graphical user interfaces.
TiredOfLife•18h ago
notpushkin•18h ago
colechristensen•17h ago
nurettin•17h ago
troupo•17h ago
evidencetamper•16h ago
If one goes to the release notes for Lazarus, they either sought those release notes out, and hence already know what it is. Or they were linked to it in a specific context, such as Hacker News, which the expectation of curiously clicking around to understand the project is natural.
troupo•16h ago
It doesn't mean that I will actively try and navigate out of a forum completely separated [1] from the actual product site just to see what it is.
[1] It's the bane of nearly all projects, both commercial and open-source: blogs, release notes, discussions, forums and often even documentation don't have a single link back to the product page
integricho•17h ago
lionkor•17h ago
If you generate AI slop web dev code (and the chances are incredibly high if you haven't heard of Lisp or Delphi) you probably won't need Lazarus or care that native apps even exist.
I'm all for teaching and explaining, and I know a small percentage of new CS people are curious and interested, but... release notes aren't the place for helping them.
That said, an explanation of what Lazarus is is genuinely needed, because people who have written Delphi for years might not have heard it (thanks, Embarcadero). So your have a point beyond your main point there.
graemep•14h ago
now you have referred to something I do not know about. Was it on HN or where?
integricho•5h ago
mseepgood•17h ago
anon7725•15h ago
renewedrebecca•42m ago
Timon3•16h ago
I can understand not wanting to explain Delphi, but come on, not everyone knows the name of every IDE for every language. It doesn't hurt to add one sentence explaining that. If I hadn't seen the comment above, I wouldn't be able to consider Lazarus in the future if I ever use Delphi again.
lproven•13h ago
No.
Everyone thinks their pet project is obvious and self-explanatory.
This is NEVER EVER a safe assumption. Remember that our entire industry is a mysterious black box to the outside world.
I worked for A Prominent North American Linux Vendor for a while. I was hired to work on the docs for one of their projects.
I'm an industry veteran with at that time over 25 years of broad cross-platform tech experience from CP/M to Linux to mainframes.
It took me a month of hard digging to get an extremely vague overall concept of what the product was and did.
Most of the company had no idea -- it's not Linux-related in any way -- and many of them regard the entire product platform as an evil to be expunged.
This is typical for that vendor. Aside from their Linux distro, ask for a tweet-length summary of any of their portfolio, expressed in general terms not specific to that product or vague marketing-ware, and nobody in the company can give it.
Nonetheless they are a multi-billion-dollar vendor.
But they only sell into established markets.
trealira•11h ago
cess11•17h ago
szszrk•15h ago
Why would they explain that to their audience? They know.
colechristensen•7h ago
szszrk•7h ago
They made an internal forum announcement. It's trivial to find out what that is. If you lack context, blame the place that cited this resource without it. So HN and OP.
kristianp•14h ago