Editing Delphi Code on a Mac Over the last year, there has been an increasing push in the development of source code editors and even full development environments based on portable code and available on multiple platforms, including Mac OS X. Here are some notes about my experiments with Object Pascal enabled editors on the Mac. Over the last year, there has been an increasing push in the development of source code editors and even full development environments based on portable code and available on multiple platforms, including Mac OS X. Here are some notes about my experiments with Object Pascal enabled editors on the Mac. As a side note, most of this editors are based on HTML + JavaScript (and variations like TypeScript), but there are some exceptions. And before you ask, Embarcadero is not currently officially endorsing any of these solutions, but we are looking into this area to understand how valuable this would be for Delphi (and C++) developers. Visual Studio Code Microsoft entrance into the area of cross platform hosted development tools made a significant splash last year. Visual Studio Code is a very interesting project, mainly oriented to development with scripting languages and web technologies, but with capabilities that go well beyond those of an editor. While not a replacement of Visual Studio for C# development, it works pretty well on Mac OS X and has a couple of Object Pascal language extensions (among many others). Being backed by Microsoft, makes this project highly visible. Some links: The main Visual Studio Code page is at code.visualstudio.com/

The OmniPascal plugin is available at https://marketplace.visualstudio.com/items?itemName=Wosi.omnipascal and more information is available on the project web site at www.omnipascal.com/. The main limitation is that all of the features beyond syntax highlighting currently work only on Windows (and they also don't support fhe full Delphi Object Pascal language)

The simpler Language Pascal plugin offers only core features and is available at https://marketplace.visualstudio.com/items?itemName=alefragnani.pascal. Below is a screenshot of some Delphi code on my Mac in Visual Studio Code. Atom Another very interesting open source and cross platform editor is Atom, which is backed by GitHub. Atom is more of an editor than a full development environment, is focused on customization (or hack-ability), and is extremely fast. There are Object Pascal language bindings also for it (done by the same developer of the Pascal VSCode plugin). Links: Atom main site is at atom.io/

A very nice overview is at www.jonobacon.org/2015/11/16/atom-my-new-favorite-code-editor/

Atom Pascal bindings can be found at github.com/alefragnani/atom-language-pascal And here is a screen shot, with the same Delphi source code file. Trolledge This is not such a popular editor, but a very interesting one for me. In fact, rather than in JavaScript/HTML technologies it is written in Delphi and uses FireMonkey for the user interface. Trolledge comes natively with Delphi support, and it is available (not surprinsingly) for Windows and Mac. It does support many different programming languages, though, from JavaScript to C#. Links: Trolledge site is www.trolledge.com/

The source code repository is at github.com/FMXExpress/Trolledge As you can see in the image below, opening a form automatically opens the matching designer in a second text editor. This is the only editor with a core knowledge of Delphi and its language and architecture. What's Your Take? So, what's your take on these editors and IDEs? I end up using Delphi code editors on the Mac almost only for reading code, as writing in the Delphi editor is significantly better. But I increasingly use these editors for my HTML and JavaScript work. While the lack of designers and other integrated tools severely limits their scope, for the developer who are focused mostly on code writing and those using operating systems other than Windows, these editors can be handy. Have you used any and what's your experience? Which one do you like most? And do you think taht Embarcadero as a development tools company should invest in this area alongside with improving and modernizing the RAD Studio IDE on Windows?

23 Comments

Editing Delphi Code on a Mac I would love to see Delphi on OSX - that is, the editor and UI designer running natively on the Mac. It might have to be a cut-down version compared to the full Windows IDE, but if you got the basics working (code editing, form designer, components, ToolsAPI where applicable, etc) it would be amazing.

Editing Delphi Code on a Mac If I need to do Delphi stuff on a Mac I use FreePascal / Lazarus. Not only can I edit Pascal files (with auto-completion, syntax checking etc) , I can even compile them! Especialy for non-visual stuff you can keep almost 100% compatibility with Delphi.

Vote for OmniPascal Mac port The OmniPascal language service currently runs on Windows only. Please let me know if you really want to use it on a Mac and vote for it here: https://bitbucket.org/Wosi/omnipascalissues/issues/6/add-rich-language-support-for-mac-and The development is currently focused on supporting all Delphi language features. Help me prioritizing the backlog items.

Editing Delphi Code on a Mac IMHO EMBT should not focus on these kind of code editors, because it could simply use them and gain popularity for (almost) free. What I think could be good, is a free DelphiCompiler (RTL only and Win32/Win64 compiler) and a good support using an EMBT plugin. Is such way new users can use the language for free without limits. So Delphi could be used to create http and tcp servers, command line utilities, batches and so on. Also schools could use Delphi for free. Then the professional users (or the current customers base) can buy the full flagged Delphi with UI designer, FMX, VCL, mobile and so on.

Editing Delphi Code on a Mac Probably the most important feature of Delphi / RAD for me is the simplicity of deployment. Once configured, it's as simple as pressing 'F9' to deploy my application to Windows, Mac, iOS or Android. None of these editors are capable of this, not even Lazarus, so I'll take whatever measures are necessary to run the RAD IDE (even if that means using windows VM's on MAC). RAD on MAC and Linux would be awesome, so long as it remains as easy to use for deployment!

Editing Delphi Code on a Mac Have you guys given any thought to setting up something similar to how Delphi builds stuff for Mac and iOS, to allow a simple IDE to run in OS X and do the same with something running on a Windows box or inside of a Win environment on a VM hosted under OS X? That is, build a channel to the compiler tools in Windows, then let people build out native IDEs that use it.

Editing Delphi Code on a Mac It works as is but I would opt for a new fresh modern IDE build with FireMonkey! The current one is just old and does not scale very well on high dpi's and is not cross platform. Fonts in Visual Code looks crispy clear. For IOS and OSX development this will also have the benefit of a tighter integration with XCode. This will mean a new market. Lots of young Apple devs or starters that do have a mac book but not have a VM to run. So much easier to start with Delphi/AppMethod for them. But there are other improvements that I really like to see like: Lambda support! a less verbose pascal like Delphi.NET and Rich syntax highlighting and code completion (like VS code Peek and Resharper). Any thoughts on that? Lots of work! I know.

Editing Delphi Code on a Mac I agree with Daniele Teti idea. Being able to connect a free Delphi compiler/debugger with this editors should be considered a modern version of 'Turbo Delphi' :). And most important, make it cross platform. You already use LLVM for iOS/Android, so why not expand it to Desktop? And you have Firemonkey on Mac, so should be natural to develop right on a Mac. When I wrote the plugins for Atom and VS Code, the intention was to have a lighter code editor for reading my Delphi projects, using for reading/searching code, making small changes, but not development itself. That's because I work with really huge projects, and the Delphi IDE is too slow for things like 'Find in Files' and 'Go to Definition'. I know that newer Delphi versions are faster, but I'm still not there, so I have to find better tools for each job.

Editing Delphi Code on a Mac Debugging a mac app over the paserver can be exceptionally painful with the lag that gets involved. One wonders if the IDE could be firemonkey based and have VCL as a second option only on Windows. That way, perhaps a cross compiled version of the IDE could dramatically improve debugging on a Mac.

Editing Delphi Code on a Mac > "So, what's your take on these editors and IDEs?" Code editors and IDEs are secondary to the compiler. Does IDERA\Embarcadero have any plans to contribute Object Pascal language features to Free Pascal (http://www.freepascal.org)? Making Free Pascal's Delphi mode more compatible with Delphi's Object Pascal implementation can only benefit the Delphi ecosystem. It will allow Pascal libraries (especially open source ones) to more easily support both Free Pascal and Delphi and help grow the broader Object Pascal development community.

Editing Delphi Code on a Mac Gary, I disagree with your stance that Embarcadero should help FreePascal. I don't see a business reason to do that. We invest in product development (language, RTL) and encouraging others to copy what we do isn't really a great point. I don't mind (and can be quite happy) to see other Pascal language solutions out there, but not outright clones.

Editing Delphi Code on a Mac I also like to add that with an IDE build with FireMonkey it is way easier to make an IDE more attractive/sexy (better sliding menu's/panels etc.) thanks to FMX. It seems not important but it is.

Editing Delphi Code on a Mac > "Gary, I disagree with your stance that Embarcadero should help FreePascal." In what way specifically do you disagree with me? Delphi is competing against other languages and compilers as is. How does helping to grow the Object Pascal community by broadening and deepening the Pascal ecosystem (compilers, tools, and libraries on multiple platforms) in any way hurt Delphi? If for no other reason, think of it as good PR and marketing. Consider these comments on Pascal from a recent Slashdot poll on "toy" languages (http://slashdot.org/poll/2965): 1. "Pascal is a great toy. It's good for learning on, but you'll never use it in real life." 2. "Pascal chose to make operators different from C just to be different, and other languages chose to make them the same as C so as to not be different. Now it's just an annoyance. It's also just missing features. Anyone who uses Pascal on purpose today is deluded." 3. "[Pascal is missing] variable length arrays and pointer arithmetic" The majority of software developers today think Pascal is a dead language. The only way you're going to change their minds is by making a high quality, open source Object Pascal implementation available to them. Free Pascal is already there so that's the one you may as well contribute to. The more people there are doing Object Pascal development, the more opportunity you'll have to sell them Delphi. Without that community, you have to convince potential customers to not just invest in your tools but also to bear the cost of learning your language and that creates unnecessary hurdles, roadblocks, and deal-breakers for new customers.

Editing Delphi Code on Linux! The IDE run well in Windows in a virtual machine even on a mac mini (2011 with 8Gb RaM). So I do not need an IDE on OSX. Dear/embarcadero should concentrate on other aspect of the product like the development of a good integration framework (not only unit testing). However I do agree with others that point out that a free minimalist IDE (like the Turbo Pascal one + refactoring capability) for developing console application on Linux l would be great for younger people to learn the language on machine like the Raspberry Pi.

Editing Delphi Code on a Mac Marco, there is a OP plugin for Idea IDE from Jetbrains. It offers much more features than just a syntax highlighting. Here is the link: http://www.siberika.com/siberika/

Editing Delphi Code on a Mac FWIW, on the Mac, I often use TextWrangler. It can also edit and highlight Delphi code, although I rather use the Delphi IDE in Parallels.

The Pascal Perception Problem As another example of the perception problem, someone just posted an Ask HN on Hacker News titled "Do you use an old or 'unfashionable' programming language?": https://news.ycombinator.com/item?id=11001693 Inevitably Pascal came up as one of those "old or unfashionable" languages. Some examples of the comments: 1. "Holy cow! I used Pascal at college about 16 years ago. I never thought I would see it used in the wild, especially in 2016." 2. "I taught Pascal at college about 40 years ago." 3. "Delphi was the first language I learned and I always thought it was a teaching language." Even some of the comments which praise Delphi based on Delphi usage from nearly 20 years ago: "I used to program in Delphi between 1997-1999" Mindshare matters. The best way to increase mindshare for Object Pascal is to contribute to getting Free Pascal up to date with the latest language features in Delphi. Alternatively, release your own cross-platform, open source Object Pascal compiler. A policy of isolating the language from the broader development community isn't going to help Delphi.

Editing Delphi Code on a Mac I support at 100% the statement from Gary Johnson. Keep adding feature to the language rather than on build a IDE for an other platfform. Do not underestimate Linux 1 board computer. They find their way in the industry. Company do not want always to be bounded to a propriétariy operating system such iOS or Android. It is not difficult to convince company to use delphi today. Delphi as crossplatform programing tool is just amazing for handheld device. If you bring delphi to Linux then you are supporting the best platform for such things like on board computer in a car, Gateway for home automation, nano server. Software project are made using many programmation language. Are you not interfacing with java on android systeme? So make the interfacing easier with many more languages. Decision maker will then consider delphi may be not for 100% o a project need, but they may consider Delphi where Delphi as strong arguments and iterface it with other languages

Editing Delphi Code on a Mac Pointless. The whole point of Delphi is that it's RAD. Design/program/run in the one IDE. PCs are cheaper than Macs anyway, so that is the point?

Editing Delphi Code on a Mac I'm sure that there is a next-gen IDE being developed for some undetermined future release down the road. Maybe it is FMX, maybe not. While the performance of FMX has improved, I still can't imagine an entire IDE as complex as rad studio being written with it. Honestly though, that would be the best thing for Delphi and FMX in that if the IDE was written using FMX, then FMX improvement would accelerate out of necessity.

Editing Delphi Code on a Mac Jess, this: "Pointless. The whole point of Delphi is that it's RAD. Design/program/run in the one IDE. PCs are cheaper than Macs anyway, so that is the point?" ...is a kind of unaware view. People use Macs. People like using Macs. Saying you should use a PC to use Delphi is like saying you should use a motorbike instead of a car. It's a comment that anyone would shake their head at. You can't tell people what technology they should buy and use; it's a personal or professional choice. Many of us use Delphi /despite/ it being Windows-only, not because of it, and we're eagerly waiting for it to move forward and embrace other platforms. First the compilers, next the IDE. In 2016, it's fair to expect high-quality cross-platform software. Delphi itself supports that, since it has cross-platform compilers. We simply want Delphi to make the logical next step and run on OSX as well as Windows.

Editing Delphi Code on a Mac I wish that the Delphi editor becomes like (in feature set and quality) it IntelliJ.

Editing Delphi Code on a Mac I find the Delphi integrated editor almost completely useless, due to it not respecting EOL. If I am at the last character of a line of code and press the right arrow, I expect to end up on the first character of the next line. Likewise I expect to be able to navigate to the end of a line by pressing the left arrow from the first character of the line after. This is so ingrained in my code navigation, and works everywhere I am, that the lack of this functionality in Delphi is enough to make me not use the IDE for coding. It is too painful. It is even worse than the lack of Emacs keybindings, which is painful as well.





Post Your Comment

Click here for posting your feedback to this blog.

There are currently 0 pending (unapproved) messages.