7 ms·
C to Delphi converter (2018)
- v-yadli 8y agoSounds like there’s no macro support? Edit: in that case, better target FreePascal or Lazarus.
- FartyMcFarter 8y agoAlso no "typedef", "unsigned char", "unsigned long" support, nor apparently understanding of what "char *argv[]" means as a function parameter. So don't expect this is something you can use for arbitrary C code. Still an interesting teaching tool, as long as the user understands it's very limited.
- int_19h 8y agoHow does it compare to C2PAS?
- raister 8y agoWhere exactly is Delphi being used nowadays?
- detaro 8y agoNiche/custom desktop applications.
- ak39 8y agoMostly Windows desktop apps for specific verticals (seen many in insurance, finance etc) - albeit considered legacy. I use it for Windows ISAPI dlls against various backend databases (mostly MS SQL Server). The newer output however from this stack is from its cross platform and mobile features - Firemonkey (native UI and cross platform API wrapper). I haven’t used it yet but I have seen a few apps on AppStore and Play using them.
- wila 8y agoFiremonkey does not use native controls, it draws its own buttons and other controls.
- clouddrover 8y agoFireMonkey has the ability to use native controls as an option: http://docwiki.embarcadero.com/RADStudio/Rio/en/FireMonkey_Native_Controls http://docwiki.embarcadero.com/RADStudio/Rio/en/FireMonkey_N...
- wila 8y agoThanks iOS and Windows only though, not macOS and Android.
- clouddrover 8y agoNative Android controls: http://docwiki.embarcadero.com/RADStudio/Rio/en/FireMonkey_Native_Android_Controls http://docwiki.embarcadero.com/RADStudio/Rio/en/FireMonkey_N... With more native Android controls coming in the future.
- wila 8y agoNice. Of course I mostly care about macOS. Unfortunately that's the area that Embarcadero appears to mostly ignore.
- ak39 8y agoSorry, my bad - you are 100% right. Firemonkey uses scalable vectors for UI. (It also uses native, but that's not what I had intended to say.)
- wila 8y agoNo worries. It runs native, so your statement wasn't technically wrong. Just wanted to point out that it does still look and behave a bit different from using native controls. Although apparently that nowadays that depends on the host OS used.
- jasode 8y agoA blog post listed some Delphi apps: https://jonlennartaasenden.wordpress.com/2014/11/06/famous-software-made-with-delphi/ https://jonlennartaasenden.wordpress.com/2014/11/06/famous-s... On that list, I use WinRAR and BeyondCompare every day. I also see Skype but I think the client was rewritten in Electron/Javascript to be cross-platform Windows/Mac/Linux. Not on that list is AcrylicDNS which I use as a DNS "firewall". The author provides Delphi source code for it: (https://mayakron.altervista.org/wikibase/show.php?id=AcrylicHome https://mayakron.altervista.org/wikibase/show.php?id=Acrylic...)
- tinus_hn 8y agoThe Dolphin emulator which is on the list is written in c++. Perhaps there once was a frontend in Delphi.
- frankbreetz 8y agoDelphi was one of my first interactions with programming. It was a CAD/CAM desktop application. They are still around today, but when I left they were trying to switch to C#. I have not met a lot of people. Who even know what it is.
- clouddrover 8y agoEmbarcadero has some Delphi testimonials on their website: https://www.embarcadero.com/case-study https://www.embarcadero.com/case-study And the Delphi product page: https://www.embarcadero.com/products/delphi https://www.embarcadero.com/products/delphi
- user5994461 8y agoI'd take any marketing material with a grain of salt. Delphi was big 20 years ago and used in important projects. There are certainly stories to tell, doesn't mean it's relevant to the current decade.
- clouddrover 8y agoDoesn't mean it's irrelevant either.
- user5994461 8y agoIt does actually. Be wary of any system or company that has not migrated away. Delphi means very legacy and it's a career killer for any programmer. The ecosystem had been on a strong decline for a while. The tools just to compile an application are incredibly expensive . Experienced developers have long left to other languages with more job prospects. New developers are not learning Delphi in university or anywhere.
- NikkiA 8y agoDelphi was never 'big', it was merely different and had some interest from the 'Borland' name being attached to it. Now they're not called Borland noone gives a shit about delphi.
- chungleong 8y agoNothing comes to mind developed in the last 20 years that's a good alternative to Delphi. Delphi lets you create commercial-grade software intended for a very small user base (less than 100). There's really nothing like it on the market. I imagine it's still used in many corporate in-house projects.
- dejv 8y agoAnother niche is control software for industrial/laboratory instruments. I know about FTIR spectroscopes, huge weaving machines or system that call you by number when you are at office, bank or post office.
- haolez 8y agoI've seen it recently being used in industrial automation. The IDE is friendly to non-programmers, the generated binaries perform really well and the compilation times are very fast. From my perspective, as a developer that uses more up-to-date tools, Delphi is not great, but it's not bad either.
- maxxxxx 8y agoI think if Delphi had been developed more it could still be the best windows desktop environment now.
- syockit 8y agoMy experience with Delphi-based Windows software is that they always load quickly and and most things are snappy, in contrast to most modern programs. I've always wondered if it's due the language itself, but then again modern programs run in managed environment. I guess if the same program is created using MFC they would be just as fast. Maybe if you don't have to deal with accessibility or internationalization it's possible to create such binaries in any compiled unmanaged language.
- kpwagner 8y agoBroadcast radio automation.
- S_A_P 8y agoFL Studio is/was Delphi based but I got to believe that it’s been ported to c/c++ in light of the Mac version that’s now available. I know there is kylix but I can’t imagine that was the way it was ported. But maybe so. I actually maintain a Delphi app used for trucking and logistics that the company purchased the source code for. We have a vm sitting on our server farm that is hosting an image of a highly customized version of Delphi that’s our “build” server. We are going to port this to C# second half of the year. The dude made all sorts of UI snafus, like 4 way check boxes using multi color checks for security provisioning. To add insult to injury if you have any color blindness you cannot perform this task- red, violet, green and blue are the options. I don’t have any known color blindness and it’s hard for me to tell.
- clouddrover 8y ago> but I got to believe that it’s been ported to c/c++ in light of the Mac version that’s now available. Delphi can be used for macOS and iOS development, which is what Image-Line did for FL Studio: https://www.embarcadero.com/case-study/image-line-software-case-study https://www.embarcadero.com/case-study/image-line-software-c...
- ebj73 8y agoI think Image-Line is still using Object Pascal actually, both for the PC and the Mac version of FL Studio. They've been managing the Mac version by using Free Pascal for the compilation. They also have a fair amount of inline assembly, for the performance critical parts, and they have their own in-house GUI and widget library, which, apparently, will compile and run equally well using both Delphi and Free Pascal. Edit: I notice that the post below says they're using Delphi for both the PC and the Mac version now... It could be a recent development. Last year there were posts on the Image-Line forums saying they were still using Free Pascal, due to the fact that Delphi (at that point) could not produce 64 bit binaries for Mac.
- wila 8y agoDelphi still cannot produce 64 bit binaries for macOS.
- loeg 8y agoDoes it know when to use 1-indices for accessing converted C strings vs 0-indices for other types? That seems to be one difficult thing to infer dynamically, especially for non-constants. I suppose it could just always treat C char* as dynamic arrays. It does appear to treat C string constants as Pascal string constants, so if those are to be indexed correctly, it must be somewhat clever.
- childintime 8y agoI was pleasantly surprised, does a lot of things, very useful for when it's needed. It had one unexpected glitch: // C if (known_devices & BIT(0)) // Pascal if known_devices and BIT(0 then )
- shdown 8y agoCould somebody please check how it converts the following program: #include <stdio.h> int main() { if (((unsigned char) 255) + ((unsigned char) 255) == 510) { puts("yes"); } else { puts("no"); } } (The code outputs "yes", and it does not rely on undefined behavior.) In other words, I doubt that proper “conversion”, with all the C semantics, is feasible.
- badsectoracula 8y agoTypecasts seem to trip it up, it replaces the check with if (unsigned char then 255) + ((unsigned char) 255) = 510 then begin
- avuxo 8y agoI'm not particularly familiar with Delphi, but the issue here appears to be a combination of parenthetical grouping not being picked up and the program not knowing that "unsigned char" should become "byte". Ex: unsigned char a = 255; unsigned char b = 255; if ((a + b) == 510) { puts("yes"); } becomes unsigned char a = 255; unsigned char b = 255; if a + b then = 510 then begin WriteLn('yes'); end; instead of var a,b: byte; begin a := 255; b := 255; if (a + b) = 510 then begin writeln('yes'); end; It's also worth noting that assuming parenthetical grouping is fixed, the C code snippet should work fine; according to the online compiler I was toying around with, Pascal uses integer type promotion.
- vfclists 8y agoIt seems there a quite a number of people who are not that hot on C++, Qt or both. The FreePascal guys though have put in some effort to create useable LCL interfaces (the Lazarus equivalent of Delphi's VCL) to interfaces to Qt4 and Qt5