5 ms·
I know C++ isn't really dying off, but what is the best platform-agnostic compiled object-orientated language these days? I liked Borland Pascal, and I know De
by cogs 8y ago
I know C++ isn't really dying off, but what is the best platform-agnostic compiled object-orientated language these days?
I liked Borland Pascal, and I know Delphi is kind of ticking along, but I'd rather invest in a language that is growing.
Swift looks nice but still seems too Apple focused.
Don't want to start a war, just open to some tips on the ecosystem..
- systems 8y agoD has potential
- red75prime 8y agoYes, it is having potential for 11 years and will probably continue doing so.
- unrealhoang 8y agoRust definitely is a good choice, if you can give up inheritance.
- MrBuddyCasino 8y agoWouldn’t classify Rust as OO though.
- 11235813213455 8y agoHe said the opposite
- bluejekyll 8y agoWhy? It specifically chooses to drop one piece of OO, object inheritance, but it does have functional inheritance. It even has Deref which gives back a form of object inheritance. It supports polymorphic functions like other OO languages. While I find functional patterns more useful in Rust, that doesn’t prevent OO design where it’s desirable.
- jcelerier 8y agoRust has vtables and inheritance, that's fairly OO.
- MrBuddyCasino 8y agoIf a GC or binary size is not a dealbreaker, Kotlin is hard to beat. Startup time fast when compiled to native.
- mamcx 8y agoFreePascal, if someday get enough support could work. Rust maybe. Swift have at least a valid alternative to move to other platforms: http://elementscompiler.com/ http://elementscompiler.com/ I wish Apple get smarter and put swift for windows and better linux.
- p0nce 8y agoNative programmer for the last 16 years. D is the one I'm building with because it keeps the "everything is possible" ethos from C++ and has no big agenda.
- badsectoracula 8y agoIf you liked Borland Pascal/Delphi then check out Free Pascal/Lazarus. If nothing else, it is growing (a bit too much if you ask me, but it isn't the monster that C++ is - yet). The main star of the show here is Lazarus which is basically a cross platform Delphi with support for the native widgets for each platform (on Linux you can choose between Gtk+ and Qt). Another alternative is D, which is basically C++ minus a few warts, the option to have a somewhat faster compiler (all modern C++ compilers are very slow) but it wasn't made yesterday so it has accumulated its own cruft (most common being that most of the new "flags" for declarations being in the form of "@stuff" instead of just "stuff" even though some older stuff being just "stuff" so things look a bit messy - in a similar vein, the new supposedly best practice, especially for libraries, is for functions to be pure and nogc, but this isn't the default so you have to put the declarations everywhere). Still, it is the most obvious choice for someone who wants a better language than C++ without changing too much. There is also Rust, but i don't know about it.
- amyjess 8y agoI'm pretty fond of D and Nim.
- criddell 8y agoYou didn't exclude C++, so I'll vote for that. Like you said - it isn't dying off and there are lots of C++ programmers out there so hiring is easier than with less popular languages.
- grawprog 8y agoI'm going to throw my vote in for D. I've been porting a few small classes from c++ to d for a project i'm working on. The D versions are about half as many lines. There are no header files or #defines/#ifdefs everywhere. I replaced most of the setters/getters with @properties
- rwmj 8y agoI was involved with a large OCaml project with a GUI which was compiled on Windows and Linux. We didn't try macOS but it would probably have been possible to port it there too. For the GUI we used Gtk (with a Windows-flavoured theme on Windows). It was written with emacs, built using a bunch of Makefiles, and shipped as a native binary on both platforms, with an NSIS-based installer on Windows.
- mwcampbell 8y agoA warning for anyone thinking of doing their cross-platform GUI this way: GTK only supports accessibility tools (such as screen readers for blind users) on Unix (via AT-SPI), not Windows or macOS. I'd suggest using wxWidgets or Qt instead. Of course, both of those use C++ as their native language, so creating bindings to other languages isn't as easy as for something C-based like GTK.
- AltVanilla 8y agoPeople often think of C++ as a Object Oriented Language. That's understandable, as it was the key feature back in the earliest days. OOP got hyped and over used. Now OOP is (almost) considered harmful in C++ community. If you look at modern C++ libraries (like boost), you will see a lot of templates and free functions, and not a lot of inheritance or dynamic polymorphism.
- jcelerier 8y ago> If you look at modern C++ libraries (like boost), you will see a lot of templates and free functions, I mean, people were already calling for more templates and free functions in 1997. It's not modern by any stretch of mind, it's just normal C++.
- TimJYoung 8y agoIf you really want to keep getting things done today, especially on Windows, and not just learn something new, then stick with Delphi/Lazarus for now. Every year I keep looking to see if a language will become available that will be able to replace Delphi, and there have been some close candidates, but nothing quite there yet. The close candidates right now are: AOT-compiled C# and Go. If you like the OOP in Object Pascal, then the type handling in Go will probably seem wonky to you, and as far as I know, AOT C# isn't quite ready, but I may be wrong on that front (it's hard to find information on the AOT progress with C#) and someone else can chime in with more information. I cannot understate what a game-changer AOT C# will be on multiple platforms, especially if they can keep the binary size down.
- magduf 8y ago>I know C++ isn't really dying off, but what is the best platform-agnostic compiled object-orientated language these days? C++ with Qt.
- Const-me 8y agoYou mentioned “compiled” without “…to native code”. If that’s what you meant, C# fits quite well. The language is safe, very high-level but has easy ways to use C interop or pointer arithmetic, performance is adequate for many practical applications, asynchronous IO and multithreading are IMO best in the class, tons of libraries, good documentation, many users. The main downside is limited options for cross-platform GUI. On windows it’s very good, on mobile platforms OK, for the rest of them (Linux esp. embedded, OSX) there’re no good options that I know of. Another one is runtime size, current version is around 25-30 MB. No installation is required, but for some applications that’s still too much.