12 ms·
Lazarus – A Delphi-compatible cross-platform IDE
- oregontechninja 9y agoI recently tried out Lazarus, and besides looking a bit dated, it works REALLY well. I had no Pascal experience so it was also overwhelming for a hello world app. But after the basic Pascal "Hello World" command line app, a GUI app didn't even require a tutorial to get working. Really impressed and am considering Pascal for a project.
- SXX 9y agoFor me as for the guy who only look at Lazarus not as developer, but as user who just go to compile map editor of our game (developed by other very skilled developer) main frustration was multi-windows interface. Not that I can't understand why some would prefer to work in that mode, but that alone make it feel more dated than it's actually is. It's still weird why they still ship it in multi-window mode by default, but fortunately all you need to do is install "anchor docking" and then it's become a lot more usable for guys like me. Also ability to patch and recompile your own IDE on the fly without waiting for half of hour to it to compile is just great. Nothing like that is possible in case of 99% C++ projects.
- wolfgke 9y ago> main frustration was multi-windows interface. Multiple windows are very comfortable if you have multiple displays connected to your computer.
- gfody 9y agoLazarus is basically a Delphi 2 clone. Delphi ditched the multiple floating windows design starting in version 3 and every subsequent version has been the more traditional "MDI" design similar to Visual Studio. I really like that Lazarus kept the floating window design because it's nice to be able to see your desktop, the wallpaper is more pleasant than whatever solid color background is on the MDI client, and you can access tools and things by just clicking through to your desktop icons. Lazarus is like the best version of Delphi frozen in time.
- fiddlerwoaroof 9y agoThis isn't true, Delphi 4 definitely had the multiple windows setup
- dguaraglia 9y agoBut you could disable it. The multi-window thing was something Delphi lifted directly from Visual Basic, and even VB dropped it (well, more like it got swallowed by VB.NET and Visual Studio.)
- squarefoot 9y agoWith monitors getting bigger we can abandon the multi window way and embrace something better, but surely not MDI which to me is even worse. Tiling is the answer: a giant single window containing the entire application, and a layout definition stating what section appears where and at what size (read: area percentage). Options to maximize the active area can be implemented, but the goal should be freeing the user from being forced to find and move windows from below other windows or partially gone out of the screen.
- gfody 9y agoI think Visual Studio has the right idea with being primarily MDI but then all of the various windows can detach and float to other screens and wherever. I think if Windows would just render your desktop background on the MDI background instead of a solid color that would be a nice system setting.
- gfody 9y agoI think maybe Delphi 5 was the first version where it stopped even being an option. I remember 3 was MDI and I'm surprised I never bothered looking for the option to switch it back.
- yardshop 9y agoThe floating windows were still very much present in Delphi 7, my preferred arrangement [0]. D7 was the last "good" version before the .NET era. Actually I remember the buzz around Lazarus and Free Pascal really growing when the .NET versions of Delphi came out. So I think its fair to say Lazarus took plenty of influence from versions later than D2. [0] http://i.imgur.com/gHQR6aH.png http://i.imgur.com/gHQR6aH.png
- SXX 9y agoI do have two monitors and understand multi-window mode has it's uses, but for any person who used to [name standard IDE] it's frustrating first impression. It's basically gives false sense of complexity to the tech that actually easy to use.
- tomc1985 9y agoI miss the glory days of RAD
- pvg 9y agoXcode is a RAD tool at heart so we're in the glory decade of RAD. We just don't call it that.
- laythea 9y agoIn my opinion, I wouldn't call XCode the pinnacle. That position is for VB/C#.
- skrebbel 9y agoStill, things didn't get any more Rapid than they were in 1998 and that's a bit sad. In terms of productivity, C# with WPF/XAML is at best equally good IMO.
- tonyedgecombe 9y agoWPF/XAML can give you amazing results but I'm nowhere near as productive with it as I was with VB6.
- int_19h 9y agoI would venture that WinForms is actually more RAD'ish than WPF. A lot of that productivity came from the drag-and-drop form editing. And what made it possible (and easy) was complete disregard for any kind of advanced dynamic layouts. Delphi's VCL, .NET's WinForms and the nameless VB6 UI toolkit are all designed around the notion of widgets manually placed on a 2D grid, and the most that you can get in terms of dynamic resizing is "anchoring" their corners to containers.
- pjmlp 9y agoWhile true, WPF development when coupled with Blend design can be very expressive. The main hurdle is getting how templates, styles, triggers and code interact together. If one happens to work in enterprise projects, it is quite easy to get WPF component libraries.
- samuell 9y agoLazarus/FPC checks so many nice boxes: [x] Statically compiled [x] Native UI on Linux/Mac/Win [x] Typically compiled without code changes on Linux/Mac/Win [x] Small binaries [x] No GC [x] Readable, somewhat python-like syntax [x] Still, doesn't rely on indentation for nested blocks [ ] (Fill in)
- generic_user 9y agodo you know what UI kit is used on Linux?
- SXX 9y agoThere are options for both GTK and Qt.
- generic_user 9y agoVery nice, I will take a look.
- deleted 9y ago[deleted]
- SXX 9y agoAs soon as you need 3rd-party libraries "statically compiled" is no longer the case. Or at least it's not easy, depend on platform and still bring a lot of mess. Though in the right hands Lazarus is a great tool since relatively complex project could be completed just by one developer. E.g here is our game engine map editor: https://github.com/vcmi/vcmi_editor https://github.com/vcmi/vcmi_editor Another thing to note is that FPC provide good performance and even used for game development and memory footprint is small. There is RTS on Steam called Cossacks 3 and it's fully in Pascal (though no idea if they using FPC outside of Linux): http://store.steampowered.com/app/333420/Cossacks_3/ http://store.steampowered.com/app/333420/Cossacks_3/ PS: Another example would be open source Hedgewars of course.
- adrianlmm 9y agoI've created small projects in Lazarus and you are right in all points except in the small binary part, also I would add that it comes with db drivers for Postgrees, MySQL and Firebird SQL out of the box.
- samuell 9y agoBtw, OmniPascal for VSCode is also worth a mention as an alternative for quick edits, or for coding those CLI apps in pure FPC. A really nice project, which also helps showing that Pascal is Alive and Kicking :) http://www.omnipascal.com http://www.omnipascal.com (Only issue is Linux support is not (yet) on par with Windows and Mac ... but then, it is open source, so that could change!)
- Zablus 9y agoJust wanted to mention OmniPascal :) What's about Linux support? It's working on all platforms, isn't it? http://blog.omnipascal.com/omnipascal-0-14-0-mac-and-linux-support/ http://blog.omnipascal.com/omnipascal-0-14-0-mac-and-linux-s...
- leledumbo 9y agoYes it is, finally :) I like the ability to extract build information from .lpi, despite still needs a lot of work (macros won't work), already lifts the burden to write the unnecessary build scripts.
- scardine 9y agoI wish porting projects from Delphi was easier. I was trying to make Python bindings for the AcBR library[1] and failed miserably. Shameless plug: if you think you are up to the task and is not too expensive contact paulo at xtend.com.br [1] http://acbr.sourceforge.net/drupal/ http://acbr.sourceforge.net/drupal/
- Jack4E4B 9y agoThere is another Pascal project out there called Oxygen by the folks at RemObjects. Not free, but I've heard good comments about it: http://www.elementscompiler.com/elements/oxygene/ http://www.elementscompiler.com/elements/oxygene/
- rgacote 9y agoI'd definitely use it more if I could port over the last few Delphi apps I have in production. My Delphi 7 is getting a bit old... Aside from single-file executables, the biggest advantage to Lazarus (and also Delphi) [to me] is that all the libraries are also built in the language. No needing to bounce down to opaque DLLs just to display some GUI element.
- throwaway7645 9y agoI see Lazarus pop up on HN occasionally. It's an IDE for FreePascal right? I guess I'll have to open the article again. How are the database drivers? I've been told they're ageing. Is there 64 bit support for Windows or only 32?
- Zablus 9y agoThere is a Win64 compiler and it's working great! I don't know anything about the database drivers.
- throwaway7645 9y agoJust tested it out and confirmed.
- DisownedWheat 9y agoI'm no expert by any means, but I just opened Lazarus to look at the DB drivers and they seem pretty respectable. The MySQL driver only goes up to 5.6 but works well in my experience. I haven't tried the SQLite, Postgres, ODB or MSSQL drivers though. Also it does support 64 bit, I have a 64 bit Lazarus installed on my Windows VPS.
- throwaway7645 9y agoGlad to know, thanks for the pointer!
- leledumbo 9y agoAs MySQL develops, the bindings are updated as well, but most people will have to wait for stable release. If you use trunk, though, you can enjoy it right away because MySQL bindings has been designed rather easy to port a new version.
- boznz 9y agoFYI 5.6 drivers work on 5.7. not extensively checked but my database application worked fine after mysql was updated..
- Jack4E4B 9y agoLazarus is awesome because of the speed of the compiler, the fact that it has a GUI that works, and is OPEN SOURCE. So one wonders WTH is going on with all the other compiled languages that have nothing like this? And no QT is not the answer, we need a built-in good enough GUI! =)
- necessity 9y agoIIRC Delphi compilers are usually single pass and thus really fast
- gardnr 9y agoThat is correct and it is why all the variables must be declared before the "implementation" section of a unit. The compilation felt instantaneous.
- jcelerier 9y ago> we need a built-in good enough GUI! =) what do you call built-in ?
- whitea 9y agomORMot framework is also a nice example for modern Pascal... https://synopse.info/fossil/wiki?name=SQLite3+Framework https://synopse.info/fossil/wiki?name=SQLite3+Framework It has DDD, SOA, MVC, ORM (even for NoSql), REST, caching, logging and security features and works with Lazarus.
- zoom6628 9y agoLooks great - have added to my research list on FPK. Thanks.
- edwinyzh 9y agomORMot is very full-featured and powerful! I'd suggest to start with its rich set of samples (https://github.com/synopse/mORMot/tree/master/SQLite3/Samples https://github.com/synopse/mORMot/tree/master/SQLite3/Sample...) and this blog: https://tamingthemormot.wordpress.com/ https://tamingthemormot.wordpress.com/
- sctb 9y agoWe've updated the description from “Proving That Pascal Is Alive and Kicking Ass”. Submitters: the guidelines ask that you please don't editorialize titles.
- Jack4E4B 9y agoThat headline made people read... and your current title is not fully accurate. It is a Delphi inspired Pascal for sure, but not fully compatible, more like a free alternative.
- Tomte 9y agoExactly. Your title was clickbait and dishonest. We don't accept that here.
- Jack4E4B 9y agoOkay let us use some logic, I assume you are a logical person. "Proving That Pascal Is Alive and Kicking Ass" contains the following logical assertions: p1 Pascal is alive p2 Pascal is kicking ass, which any urban dictionary will tell you means it is just awesome, and beating the compeition. p3 is the actual statememnt: P1 AND p2 = p3 They are ALL TRUE. Where is the click bait? It is 100% true, you are only objecting to the word choice. Which was bu the way accurate, just not boring like your current title.
- bigtunacan 9y agoA bit funny seeing this on here tonight. My teenage daughter was looking to create a native desktop app and I pointed her to Lazarus just today. Then I login and check Hacker News...
- systems 9y agoHow do you avoid spaghetti code, in an environment like lazarus?
- undreren 9y agoDiscipline. The same way you do in Java and C#. Don't use singletons and global variables.
- analognoise 9y agoI'll take this one - architecture. So you can setup a very standard MVC or MVVM architecture using Lazarus. I bought this book to help:http://www.apress.com/br/book/9781484222133 http://www.apress.com/br/book/9781484222133 it uses Delphi, so there's translation to do, but the concepts are the same. Also, Lazarus has an amazing community that's a joy to be a part of, and is extremely welcoming. I'm a hardware jockey (mostly) so if they can explain it to me, literally anyone can get it. To boot, there are a number of excellent older texts that are just a few dollars, and all the concepts are the same. There's new material being produced more and more for it as well. What I'm trying to say is: join us... One of US. One of US. One of US....
- edwinyzh 9y agoThat's an interesting question. Lazarus is an IDE like Visual Studio or the JetBrains ones, and it has nothing to do if you write spaghetti code or not, try google "SOLID" instead on that subject.
- Johnny_Brahms 9y agoAs someone who maintains a multi-MLOC application in fpc (using emacs and lazarus): discipline. You don't grow an application to that size by simply building on what might be suitable for a 30kloc application. It requires discipline, experience, trial and error and ability to invest time in properly maintaining the codebase. Disciplined code review by people very familiar with the codebase is vital.
- badsectoracula 9y agoMy personal approach is to create a unit to contain the classes for the "thing" i am working with (e.g. for a 3D world editor, i create a unit that was a TWorld inside, perhaps with TEntity and other classes). Then create another unit for the global stuff (lately i've taken a liking to use a TDataModule which can be edited visually even though it is a non-visual thing - it allows me to place non-visual components in an IDE surface which helps assign event handlers and properties from the editor without writing code for that). Then from the GUI side i just make calls to the global unit/datamodule and/or to methods in the classes i work with. Of course it all depends on what i'm making, for simple stuff i just throw everything in the form code directly. For more complex stuff i use the method above. Here is an image showing an example of the approach: http://i.imgur.com/cm4VTHn.png http://i.imgur.com/cm4VTHn.png The "GlobalState" window is an IDE window that represents a TDataModule (the name sucks and probably is for Delphi compatibility, it doesn't have anything to do with "Data" and because of that i ignored it for years) that contains the "SimpleViewportRenderer1" and "ViewportManager1" non-visual components - instances of the TSimpleViewportRenderer and TViewportManager component classes. This is in its own unit and can be accessed by other units, essentially providing global state (note that a data module is really a class - much like forms - but you can have a global variable with a single instance of it - again like forms). The neat thing with this approach is that it can also be seen by the IDE: the Viewport1, Viewport2, Viewport3 and Viewport4 components in the Form1 form have a property that accepts an optional TViewportRenderer component. This is presented as a combobox in the Object Inspector window and when you pull it down, one of the options is "GlobalState.SimpleViewportRenderer1" - so you can wire together components 100% visually.
- 0xbear 9y agoNow someone just needs to clone C++ Builder and we'll be all set. Power of C++ with the simplicity of Delphi.
- Tom4hawk 9y agoQT Creator is really nice.
- 0xbear 9y agoQT is really expensive for commercial use though. And it's not as easy as Builder was. Builder basically gave you Delphi capability but in C++. You could focus 100% on the problem you're solving rather than on the UI -- true component based RAD. Drop a few components, wire them together, then add your code to do what they can't do.
- leledumbo 9y agoNo other RAD claiming IDE has the same RAD capabilities as Lazarus or Delphi (or C++ builder), including QT Creator. Live database connection and manipulation while designing your form and data module? Nah, it doesn't even know what a data module is.
- cturner 9y agoI use Free Pascal at times. In case there are any FP developers here: your build arrangements hamper my use. I tried installing earlier this week from source and could not get it going. My ideal would be a single configure/Makefile combination in the root directory. Consider if the user does not have root, how are they to set a prefix? The idea of the 'build' download is good, but not if it needs to link to recent shared-objects. Particularly recent shared objects like libc. Maybe you could put statically-linked tools in the 'build' version.
- MageSlayer 9y agoI guess you need to contact devs to clarify. I regularly build from sources for Linux and cross-compile for Windows both x32 and x64 using just single "make ..." command.
- rcarmo 9y agoI mentioned Lazarus in other threads a few days ago (since my kids are playing around with it) and it's great to see it as a top-level post. Some random thoughts: - It's somewhat amusing to realize that in 2017 this is pretty much the easiest way to do a desktop app (besides RealBasic/Xojo which I've yet to try - was put off by their mandatory registration) - I wish we had RAD environments like this for more languages (Racket, Python, etc. - even JS). - On the Mac, installation is a bit fiddly. It needs a little polish and support (a standalone, integrated bundle would be better, or at the very least a unified installer). - We've been retrofitting web UIs to desktops to such an extent (I'm looking at you, Electron) that the tiny, supremely efficient apps Lazarus spits out put the last couple of years into stark perspective (2GB RAM used by Slack, etc.) I love Lazarus, and hope it helps resurrect the RAD approach for other languages - if anyone knows of any similar environments (besides QtCreator, etc.), could you share the links?
- dkersten 9y agoI've not used Lazarus or Delphi, so I can't really compare properly. Perhaps I'm missing something. But: > if anyone knows of any similar environments (besides QtCreator, etc.) Why "besides QtCreator, etc"? It sounds to me almost like "do you know any X besides all of the popular X". Is there any particular reason you discount QtCreator? Does it not work for your purposes? Or is it just a case of you already know about it and want to hear about more obscure tools? > It's somewhat amusing to realize that in 2017 this is pretty much the easiest way to do a desktop app I've found Qt with QtCreator to be an incredibly productive way to develop desktop applications. Both old-school QWidgets-based Qt with QtDesigner (the RAD portion of QtCreator for pre-QtQuick) and QtQuick/QML with and without its RAD interface. > I wish we had RAD environments like this for more languages (Racket, Python, etc. - even JS). I've used the Python version of Qt with QWidgets in the past and it was a pretty nice workflow. I've never done it personally, but I know of people who use Python + QtQuick/QML and seem pretty happy with it. There's also various "app builder" tools for JS, but I don't know how good they are.
- chx 9y agoThere is https://blind.guru/qta11y.html https://blind.guru/qta11y.html as a problem with QT, I think it made to HN like three days ago.
- fithisux 9y agoDo not forget also the tremendous effort in the Free Pascal other big IDE https://sourceforge.net/projects/mseide-msegui/ https://sourceforge.net/projects/mseide-msegui/ It is a pitty dev pascal didn't catch up or ported to FPC.
- dvfjsdhgfv 9y agoLooks interesting. What are its advantages when compared to Lazarus?
- leledumbo 9y agoSmaller and simpler (written in old Delphi, with some 3rd party packages, so Windows only), nothing else I guess. Lazarus is far superior in every other aspects.
- WildParser 9y agoI've made the mistake to write a complex project in Free Pascal. As far as I can tell pretty much every release of Lazarus is breaking something. And surprisingly often those breaks are major (like e.g. broken multi-threading, broken-strings, ...). For me the whole thing looks more like a playground for hobbyists and is not really useful for anything productive. There's not much continuity in the language. And for the devs something like 95% compatibility seems to be good enough. For small projects it might be ok to use, but you better keep your snapshot of the compiler locked in a safe place. On the other hand: If you're young and want to make history as the guy who replaced all those begin/end in pascal with smileys: This project might be your chance...
- wiz21c 9y agoI like your comment. It highlights what misses from so many discussion about languages/tools down here. Being expressive, powerful, compiled, interpreted doesn't matter much if long term stability, reliability, backward compatibility are not a top goal for the devs.
- wruza 9y agoThe same was for Delphi, but no one complained in such way. Your sources were to update accordingly, or you simply remained on previous version, which was not a bad thing, because it is your app, it was working yesterday, why would it break tomorrow? For new projects you took new libraries. Personally, I don't like the modern idea of autoupdated anything. Once program is tested and deployed, only cherry-picked (or backported) security updates must be applied.
- samuell 9y agoI have had best success by using the (very stable) version provided in (X)ubuntu LTS, which I'm always staying with, so I'd say it is about finding a good strategy for version selection.
- badsectoracula 9y agoYour project was probably doing something wrong or weird since the Lazarus and Free Pascal developers have gone to great lengths to avoid breaking backwards compatibility - i have code from 10 years ago that compiles almost without changes. The only change that i have to do is when i abused strings as byte buffers that wouldn't work in Free Pascal 3.0. However that was something the FPC developers said for years and they made several release candidates so that people can report back issues. Even then the change was simply replacing all uses of `string` with `rawbytestring`. The only backwards compatibility breaking they do is when they are fixing compiler bugs that shouldn't be used anyway. For example at some point it was possible to take the address of a property getter and this usually worked, but not always. They changed that to be illegal (according to the language reference it was illegal anyway) so any code that relied on that would need to change (a simple change would be to make a new property or function that gave back the address of the private reference and mark it as inline so that you wont get any performance penalty). Personally i am very anal about backwards compatibility and i have abandoned tons of libraries (SDL, GTK, Qt, etc) because of that. In my experience Free Pascal, LCL and Lazarus are among the most stable frameworks to the point that they prefer to keep unnecessary things around for years just in case someone is still using them or introduce unnecessary options for the framework to change behavior in case someone is still relying on the old one (this is why for example you get a `RequireDerivedFormResource:=True;` line in new projects, older projects wont have this line which affects the behavior of how forms are created). Obviously i don't know what your project was doing but you don't really provide any description (both of the issues you mentioned i haven't encountered), so i put my counter-experience here since i wouldn't like people to get the impression that Lazarus doesn't care about backwards compatibility. For me it is a prime example of a very complex project doing backwards compatibility right (hell, the Lazarus IDE itself can even be compiled with Free Pascal compilers that are years old just in case someone might for whatever reason - like the few cases mentioned above, or use FPC from some Linux distribution that only has old versions - be stuck with them). Things that break backwards compatibility are considered important bugs and are fixed - sometimes even at the cost of getting things "right".
- int_19h 9y agoWhile we're at it, for those times when you're hacking on console apps, FreePascal also has a very nice text-mode (TUI) IDE that is basically a Turbo/Borland Pascal 7.0 IDE clone - but cross-platform. To do that, they had to port Turbo Vision (or rather its open source fork Free Vision). It's still a great TUI library... it's a shame it's Pascal-specific. Would be interesting to have an implementation of it for, say, Python, for system tools and the like.
- pjmlp 9y agoThe Turbo Vision IDE was actually introduced with version 6.0 as an example what the framework was capable of. It was later available in C++ as well, and there is a port available. http://tvision.sourceforge.net/ http://tvision.sourceforge.net/
- int_19h 9y agoYeah. I was thinking more like C (with possibly glib as the object model), so that it can then be wrapped in Python etc.
- throwaway7645 9y agoHoe do you run it?
- int_19h 9y agoEven that is a throwback to Turbo Pascal - you type "fp" in the shell (on Windows, after adding C:\FPC\bin or equivalent to your PATH).
- throwaway7645 9y agoThank you...I'll try that again.
- samuell 9y agoOne of the things I'm excited about, is using FPC/Lazarus as GUI for computationally heavy Go code (Now with the recent efforts to use Go for datascience ... see http://gopherdata.io http://gopherdata.io), now since Go supports shared object (.so/.dll) files. I collected my (very early) research on it in this thread: https://forum.lazarus.freepascal.org/index.php?topic=24948.0 https://forum.lazarus.freepascal.org/index.php?topic=24948.0 ... where some users report they tried it already. Seems to work, if not super smooth. Hope it can be improved in the future.
- Jack4E4B 9y agoGreat news, the key comment there was that Go supports calling from other languages: https://dev.to/vladimirvivien/calling-go-functions-from-other-languages https://dev.to/vladimirvivien/calling-go-functions-from-othe...
- samuell 9y agoFor the FPC/Lazarus project as a whole, it is also good news that there is some work going on to build up a foundation (it exists already), with funding and stuff, to support further development: https://foundation.freepascal.org/ https://foundation.freepascal.org/ Among founders being Delphi luminaire Boian Mitov (author of Visuino / OpenWire / OpenWireStudio etc). Hoping the foundation can take off with some good funding.
- edwinyzh 9y agoI've been watching the foundation since it's creation (I think it's over one year ago), I don't think it has done any significant help to the FPC/Lazarus development so far. Anyhow, such effort is plausible. On the other hand, open source projects like this (http://newpascal.org/ http://newpascal.org/) is what actually driving open source going forward.
- samuell 9y agoFor anyone looking for a proper, "modern" introduction to Object Pascal, as found in FPC/Lazarus, don't miss this excellent guide: http://castle-engine.io/modern_pascal_introduction.html http://castle-engine.io/modern_pascal_introduction.html