{"id":7347,"date":"2013-04-25T11:39:08","date_gmt":"2013-04-25T10:39:08","guid":{"rendered":"http:\/\/www.itwriting.com\/blog\/?p=7347"},"modified":"2013-04-25T11:39:08","modified_gmt":"2013-04-25T10:39:08","slug":"changes-in-the-delphi-language-for-arm-and-mobile-support","status":"publish","type":"post","link":"https:\/\/www.itwriting.com\/blog\/7347-changes-in-the-delphi-language-for-arm-and-mobile-support.html","title":{"rendered":"Changes in the Delphi language for ARM and mobile support"},"content":{"rendered":"<p>Delphi developers should note changes in the Delphi language coming as a result of the move towards the LLVM compiler for mobile support. Embarcadero has released a paper describing these in detail. The just-released RAD Studio XE4 includes the ARM compiler for iOS, with an Android compiler to follow later this year.<\/p>\n<p>It seems to me that Delphi developers will now fall into two broad camps:<\/p>\n<p>1. Windows VCL developers for whom the new FireMonkey cross-platform framework is of little interest, either because they are not developing for Mac or mobile, or because they prefer other tools for those platforms.<\/p>\n<p>2. Developers who are embracing the new platform targets, migrating code to FireMonkey or starting new projects there, and planning to share code across all platforms as far as possible.<\/p>\n<p>If you are in the first camp, you need not worry too much about language changes yet. I believe it is Embarcadero\u2019s long-term intention to unify Delphi\u2019s compilers around LLVM on all platforms, but when or whether this will happen for Win32 and Win64 is moot; my guess is that what the company now calls the \u201cclassic compiler\u201d will be around for a long time yet. However the Mac compiler may migrate to LLVM sooner. (I am speculating). <\/p>\n<p>Currently, RAD Studio XE4 includes <strong>five<\/strong> compilers:<\/p>\n<ul>\n<li>The Win32 compiler (DCC32)<\/li>\n<li>The Win64 compiler (DCC64)<\/li>\n<li>The Mac compiler (DCCOSX)<\/li>\n<li>The iOS Simulator compiler (DCCIOS32)<\/li>\n<li>The iOS ARM compiler (DCCIOSARM)<\/li>\n<\/ul>\n<p>Of these, only the last one currently uses LLVM, though the iOS Simulator compiler behaves as closely as possible like its ARM cousin. In general the language changes are currently only applicable by default for the LLVM and Simulator compilers as far as I can tell.<\/p>\n<p>What are the language changes? My quick summary of the biggest changes is as follows:<\/p>\n<ul>\n<li>One string type only: UTF16, reference counted, immutable (though this is a point of confusion; reading the paper it seems it is not yet immutable as it describes modifying in place, but may become so).<\/li>\n<li>0-based strings. There is a compiler directive $ZEROBASEDSTRINGS, which is off for Delphi XE3 and Delphi XE4, but on for the mobile compiler in XE4.<\/li>\n<li>Automatic reference counting. Objects are destroyed automatically when the reference count hits zero. MyObj.Free; does not destroy the object, only reduces the reference count (and destroys it if zero). You can create weak references (which do not increment the count) by using the [Weak] attribute. If you really want to destroy the object, use MyObj.DisposeOf;. <\/li>\n<\/ul>\n<p>In addition, the <strong>With<\/strong> statement is now deprecated.<\/p>\n<p>The language changes are described in detail in the paper <strong>The Delphi Language for Mobile Development<\/strong>, which you can find <a href=\"http:\/\/www.embarcadero.com\/resources\/white-papers\/application-development\" target=\"_blank\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Delphi developers should note changes in the Delphi language coming as a result of the move towards the LLVM compiler for mobile support. Embarcadero has released a paper describing these in detail. The just-released RAD Studio XE4 includes the ARM compiler for iOS, with an Android compiler to follow later this year. It seems to &hellip; <a href=\"https:\/\/www.itwriting.com\/blog\/7347-changes-in-the-delphi-language-for-arm-and-mobile-support.html\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Changes in the Delphi language for ARM and mobile support<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26,67,80],"tags":[318,363,499],"class_list":["post-7347","post","type-post","status-publish","format-standard","hentry","category-development","category-professional","category-software-development","tag-delphi","tag-embarcadero","tag-ios"],"_links":{"self":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts\/7347","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/comments?post=7347"}],"version-history":[{"count":0,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts\/7347\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/media?parent=7347"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/categories?post=7347"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/tags?post=7347"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}