Content deleted Content added
Sammi Brie (talk | contribs) Importing Wikidata short description: "Branch of object-oriented derivatives of Pascal programming language" (Shortdesc helper) |
No edit summary |
||
(37 intermediate revisions by 26 users not shown) | |||
Line 1:
{{Short description|Branch of object-oriented derivatives of Pascal programming language}}
{{More citations needed|date=May 2019}}
{{Infobox programming language
| name = Object Pascal
Line 7 ⟶ 6:
| paradigms = [[Imperative programming|Imperative]], [[Structured programming|structured]], [[Object-oriented programming|object-oriented]], [[Functional programming|functional]] (Delphi dialect only), [[Component-based software engineering|component-based]], [[Event-driven programming|event-driven]], [[Generic programming|generic]]
| family = [[Niklaus Wirth|Wirth]] [[Pascal (programming language)|Pascal]]
| designers = [[Larry Tesler]] (Apple)<br/>[[Niklaus Wirth]] (for Apple)<br/>[[Anders Hejlsberg]] (Borland)<ref name="InfoworldTechTalk">{{cite
| developers = Apple Computer (initial)<br/>Borland International<ref name="InfoworldTechTalk"/>
| released = {{Start date and age|1986}}
Line 15 ⟶ 14:
| scope = [[Scope (computer science)|Lexical]] (static)
| programming language =
| platform = [[ARM architecture family|ARM]], [[x86]], [[PowerPC]], [[ppc64]], [[SPARC]], [[MIPS architecture|MIPS]], [[Common Language Infrastructure|CLI]], [[Java (software platform)|Java
| operating system =
| license =
Line 21 ⟶ 20:
| file format = <!-- or: | file formats = -->
| website = <!-- {{URL|www.example.com}} -->
| implementations = [[Delphi (software)|Delphi]] ([[x86]], [[ARM architecture family|ARM]]), [[Free Pascal]] ([[x86]], [[PowerPC]], [[ppc64]], [[SPARC]], [[MIPS architecture|MIPS]], [[ARM architecture family|ARM]]), [[Oxygene (programming language)|Oxygene]] ([[Common Language Infrastructure|CLI]], [[Java (programming language)|Java]], Native [[Cocoa (API)|Cocoa]]), Smart Mobile Studio ([[JavaScript]])
| dialects = Apple, [[Turbo Pascal]], [[Free Pascal]] (using '''objfpc''' or '''delphi''' mode), [[Delphi (software)|Delphi]], Delphi.NET, Delphi Web Script, [[PascalABC.NET]], [[Oxygene (programming language)|Oxygene]]
| influenced by = [[Pascal (programming language)|Pascal]], [[Simula]], [[Smalltalk]]
| influenced = [[C Sharp (programming language)|C#]],
}}
'''Object Pascal''' is an extension to the programming language [[Pascal (programming language)|Pascal]] that provides [[object-oriented programming]] (OOP) features such as [[Class (computer programming)|classes]] and [[Method (computer programming)|methods]].
The language was originally developed by [[Apple Inc.|Apple Computer]] as ''[[Clascal]]'' for the [[Apple Lisa|Lisa]] Workshop development system. As Lisa gave way to [[Mac (computer)|Macintosh]], Apple collaborated with [[Niklaus Wirth]], the author of Pascal, to develop an officially standardized version of Clascal. This was renamed Object Pascal. Through the mid-1980s, Object Pascal was the main programming language for early versions of the [[MacApp]] [[application framework]]. The language lost its place as the main development language on the Mac in 1991 with the release of the [[C++]]-based MacApp 3.0. Official support ended in 1996.
[[
Symantec ported Object Pascal to the PC, and developed a similar object framework on that platform. In contrast to TCL, which eventually migrated to C++, the PC [[Library (computing)|libraries]] remained mainly based on Pascal.
[[Borland]] added support for object-oriented programming to [[Turbo Pascal]] 5.5, which would eventually become the basis for the Object Pascal dialect used in [[Delphi (software)|Delphi]] created by [[Anders Hejlsberg]]. Delphi remained mainstream for business applications on the PC into the early 2000s, and was partly displaced in the 2000s with the introduction of the [[.NET Framework]] which included Hejlsberg's [[C Sharp (programming language)|C#]].
==History==
===Apple Pascal===
Pascal became a major language in the programming world in the 1970s, with high-quality implementations on most [[minicomputer]] platforms and [[microcomputer]]s. Among the
Pascal became one of the major languages in the company in this period. With the start of the [[Apple Lisa]] project, Pascal was selected as the main programming language of the platform, although this time as a ''compiler'' in contrast to the p-System ''interpreter''.
===Clascal and Apple's early Object Pascal===
Object Pascal is an extension of the Pascal language that was developed at [[Apple Inc.|Apple Computer]] by a team led by [[Larry Tesler]] in consultation with [[Niklaus Wirth]], the inventor of Pascal.<ref>{{cite journal |last=Tesler |first=Larry |date=1985 |title=Object Pascal Report |journal=Structured Language World |volume=9 |issue=3 |pages=10–7}}</ref><ref>{{cite web |last=Tesler | first=Larry |title=Object Pascal for the Macintosh |url=https://bitsavers.org/pdf/apple/mac/developer/MacApp/Object_Pascal_For_The_Macintosh_19850214.pdf |date=February 4, 1985 |access-date=March 13, 2025}}</ref> It is descended from an earlier object-oriented version of Pascal named [[Clascal]], which was available on the [[Apple Lisa|Lisa]] computer.
Object Pascal was needed to support [[MacApp]], an expandable Macintosh application framework that would now be termed a [[class library]]. Object Pascal extensions, and MacApp, were developed by Barry Haynes, Ken Doyle, and Larry Rosenstein, and were tested by Dan Allen. Larry Tesler oversaw the project, which began very early in 1985 and became a product in 1986.
An Object Pascal extension was also implemented in the Think Pascal [[integrated development environment]] (IDE). The IDE includes the compiler and an editor with [[syntax highlighting]] and checking, a powerful [[debugger]], and a class library.<ref>{{cite
| magazine = [[Macworld]]
| url = https://archive.org/details/mac_MacWorld_9011_November_1990/page/n251/mode/1up
| date = November 1990
| volume = 7
| issue = 11
| first = Charles
| last = Seiter
| page = 236
| title = Think Pascal 3
}}</ref> Many developers preferred Think Pascal over Apple's implementation of Object Pascal because Think Pascal offered a much faster compile–[[Linker (computing)|link]]–debug cycle, and tight integration of its tools. The last official release of Think Pascal was 4.01, in 1992. [[NortonLifeLock|Symantec]] later released an unofficial version 4.5d4 at no charge.
Apple dropped support for Object Pascal when they moved from [[Motorola 68000 series]] chips to IBM's [[PowerPC]] architecture in 1994. MacApp 3.0,
[[Metrowerks]] bundled an Object Pascal compiler with [[CodeWarrior]] that targeted both [[Motorola 68000 series|68k]] and [[PowerPC]], both in their IDE and as MPW tools. Macintosh developers using Object Pascal had a path to port to the [[PowerPC]], even after both Apple and Symantec dropped support. [[MacApp]] 2.0, written in Object Pascal, was ported to the PowerPC using [[CodeWarrior]].<ref name=mt1995_11>
{{cite magazine
| magazine = [[MacTech]]
| url = https://archive.org/details/eu_MacTech-1995-11/page/n31/mode/1up
| title = MacApp Pascal Rides again
| date = November 1995
| volume = 11
| issue = 11
| pages = 30–31
| first1 = Brian
| last1 = Arnold
| first2 = Guy
| last2 = McCarthy
}}
</ref><ref name=mt1996_02>{{cite magazine
| magazine = [[MacTech]]
| pages = 25–32
| url = https://archive.org/details/eu_MacTech-1996-02_OCR/page/n26/mode/1up
| title = MacApp 2 for PowerPC in Object Pascal
| date = February 1996
| first = Brian
| last = Arnold
| volume = 12
| issue = 2
}}</ref>
==Borland, Inprise, CodeGear, and Embarcadero years==
In 1986, [[Borland]] introduced similar extensions, also named Object Pascal, to the [[Turbo Pascal]] product for the Macintosh, and in 1989 for Turbo Pascal 5.5 for DOS. When Borland refocused from [[DOS]] to [[Microsoft Windows|Windows]] in 1994, they created a successor to Turbo Pascal, named [[Delphi (software)|Delphi]], and introduced a new set of extensions to create what is now known as the Delphi language.
The development of Delphi started in 1993 and Delphi 1.0 was officially released in the United States on 14 February 1995. While code using the Turbo Pascal object model could still be compiled, Delphi featured a new syntax using the keyword <code>class</code> in preference to <code>object</code>, the Create constructor and a virtual Destroy destructor (and negating having to call the <code>New</code> and <code>Dispose</code> procedures), properties, method pointers, and some other things. These were inspired by the [[International Organization for Standardization|ISO]] working [[Draft document|draft]] for object-oriented extensions, but many of the differences from Turbo Pascal's dialect (such as the draft's requirement that all methods be [[Virtual function|virtual]]) were ignored. {{Citation needed|date=January 2025}}
The Delphi language has continued to evolve over the years to support constructs such as [[dynamic array]]s, [[Generic programming|generics]] and [[Anonymous function|anonymous methods]]. The old object syntax introduced by Apple ("Old-Style Object Types") is still supported.<ref>{{cite book |last1=Lischner |first1=Ray |title=Delphi in a nutshell: a desktop quick reference |date=2000 |publisher=O'Reilly and Associates |___location=Sebastopol, CA |isbn=1565926595 |edition=1st |url-access=registration |url=https://archive.org/details/delphidesktopqui00lisc}}</ref>
Line 61 ⟶ 96:
==Versions==
* [[Borland]] used the name ''Object Pascal'' for the programming language in the first versions, but later renamed it to ''Delphi''. [[Compiler]]s that claim to be compatible with Object Pascal are often trying to be compatible with Delphi [[source code]].{{Citation needed|date=August 2009}} Because Delphi is a [[trademark]], compatible compilers continue using the name ''Object Pascal''.
* [[Embarcadero Technologies]], which purchased Delphi in 2008,<ref>[http://edn.embarcadero.com/article/38132 Community Letter: Embarcadero Technologies agrees to acquire CodeGear from Borland] {{Webarchive|url=https://web.archive.org/web/20180302044728/http://edn.embarcadero.com/article/38132 |date=2018-03-02 }}. Edn.embarcadero.com. Retrieved on 2013-07-21.</ref> sells the [[Delphi (software)|Delphi]] [[integrated development environment]] (IDE) that compiles the Delphi dialect of Object Pascal to [[Windows]] and [[macOS]], [[iOS]], [[Android (operating system)|Android]] and Web.
* [[.NET Framework|.NET]] support existed from Delphi 8 through Delphi 2005, 2006, and 2007, which now has been replaced by another language, ''Oxygene'' (see below), which is not fully backward-compatible.
* The [[Oxygene (programming language)|Oxygene]] language developed by [[RemObjects Software]] targets the [[Common Language Infrastructure]], the [[Java (software platform)|Java]] Runtime Environment and [[Apple Inc.|Apple]]'s [[Cocoa (API)|Cocoa]] frameworks for [[iOS]] and [[macOS]].
* The [[open source]] [[Free Pascal]] project allows the language to be compiled for a wide range of [[operating system]]s, including [[Linux]] ([[32-bit]], [[64-bit]]), [[FreeBSD]], [[Classic Mac OS]], [[macOS]], [[Solaris (operating system)|Solaris]], [[Windows API]] (32, 64, [[Windows CE|CE]]), the [[ARM architecture family|ARM]] [[instruction set architecture]] (ISA), and several other hardware architectures. The first version of Free Pascal for the [[iPhone]] [[software development kit]] (SDK) 2.''x'' was announced on January 17, 2009.<ref name="fpciphone">{{cite web |title=iPhone/iPod development |publisher=Free Pascal development team |url=http://wiki.freepascal.org/iPhone/iPod_development |access-date=2009-04-13 |archive-date=2009-04-28 |archive-url=https://web.archive.org/web/20090428024653/http://wiki.freepascal.org/iPhone/iPod_development |url-status=live }}</ref>
* The [[Smart Pascal]] language<ref name="asmartbook">{{cite
* The [[Morfik]] Pascal language, developed by Morfik, targets [[Ajax (programming)|Ajax]]-enabled Web applications. The compiler is built into the company's AppsBuilder IDE and allows Object Pascal code to be used in implementing code to execute in a browser or server. It uses the [[Free Pascal]] compiler to generate native binaries from Object Pascal.
* The open source [[GNU Pascal]] compiler is available as a front-end to the [[GNU Compiler Collection]], which implements the [[International Organization for Standardization]] (ISO) 7185 Pascal standard, and most of the ISO 10206 Extended Pascal standard.
* Turbo51 is a free compiler to program [[Intel 8051]] chips.<ref>{{cite web |url=http://turbo51.com/ |title=Turbo51: Turbo Pascal Compiler for 8051 microcontrollers |last=Funa |first=Igor |date=2021 |url-status=live |archive-url=https://web.archive.org/web/20180925023509/http://turbo51.com/ |archive-date=2018-09-25}}</ref>
* WDSibyl is an open source Delphi-like IDE and compiler available for [[Microsoft Windows]] and [[OS/2]],<ref>{{cite web |url=https://www.wdsibyl.org/ |title=WDSibyl: Visual Development Environment |last=Draxler |first=Wolfgang |url-status=live |archive-url=https://web.archive.org/web/20200212174135/https://www.wdsibyl.org/ |archive-date=2020-02-12}}</ref> and is a commercial [[Turbo Pascal]] compatible environment released by a company named Speedsoft that was later developed into a Delphi-like RAD environment named Sybil, and then open sourced under the GPL when that company closed down. Wolfgang Draxler (WD) now maintains the software.
{{cite web
|url= http://www.edm2.com/index.php/WDSibyl
|title= EDM/2: WDSibyl
|archive-url= https://web.archive.org/web/20210324031505/http://www.edm2.com/index.php/WDSibyl
|archive-date= 2021-03-24
}}
</ref><ref>
{{cite web
|url= http://www.edm2.com/index.php/List_of_Tools
|title= EDM/2: List of Tools
|archive-url= https://web.archive.org/web/20220821090646/http://www.edm2.com/index.php/List_of_Tools
|archive-date= 2022-08-21
}}
</ref><ref>
{{cite web
|url=https://ecsoft2.org/wdsibyl
|title= eCSoft/2: The Complete OS/2 Software Encyclopedia: WDSibyl
|archive-date= 2021-10-17
|archive-url=https://web.archive.org/web/20211017225456/https://ecsoft2.org/wdsibyl
}}
</ref> The compiler used seems to be located in a DLL and is not open-source.{{Citation needed|date=August 2024}}
==Compilers==
Object Pascal [[compiler]]s are available for a wide range of [[operating system]]s and architectures.
* [[Delphi (software)|Delphi]] is probably the best known compiler. It is the successor of the highly successful Borland Pascal and [[Turbo Pascal]] product line. It targets [[Windows 9x]] (Delphi 2007 and older), the [[Windows NT]] family, [[.NET Framework]] (Delphi 8, 2005, 2007), [[macOS]] (Delphi XE2 and later), [[iOS]] (Delphi XE2 and later, generating native binaries in XE4 and later), [[Android (operating system)|Android]] (Delphi XE5 and later, generating native binaries in XE5 and later). Support for .NET finally became a separate product known as Oxygene (see below).
* [[Free Pascal]] Compiler (FPC) is an open-source Object Pascal compiler that supports many Pascal dialects, including [[Turbo Pascal]] 7, Delphi, and others. Currently, FPC can generate code for [[IA-32]], [[x86-64]], [[PowerPC]], [[SPARC]], and [[ARM architecture|ARM]] processors, and for several operating systems, including [[Microsoft Windows]], [[Linux]], [[FreeBSD]], [[Classic Mac OS]], and [[macOS]] (with an [[Xcode]] integration kit). Several separate projects exist to facilitate rapid application development with FPC, the most prominent one being [[Lazarus (IDE)]].
* [[GNU Pascal]] (a separately distributed part of the [[GNU Compiler Collection]]), while not formally aimed at the Delphi dialect of Pascal, does contain a Turbo Pascal compatibility mode, and is very slowly incorporating a few Delphi language features. It is unsuitable for recompiling large bodies of Delphi code directly, but is notable as having prolific support for operating systems and hardware architectures.
* [[Oxygene (programming language)|Oxygene]] (formerly ''Chrome'') is an Object Pascal compiler from [[RemObjects Software]] that integrates into [[Microsoft Visual Studio]]. It is also available as free [[command-line interface]] compiler that runs native on [[Common Language Infrastructure|CLI]]. It is three compilers in one, each targeting a different platform: Echoes for [[.NET Framework]], [[Mono (software)|Mono]], [[Windows Runtime|WinRT]] and [[Windows Phone 8]], Cooper for [[JDK]] and [[Android (operating system)|Android]], and Nougat for [[iOS]] and [[macOS]].
===Legacy products===
Line 90 ⟶ 141:
==Interpreters==
{{Main|Pascal Script}}
[http://www.remobjects.com/ps Pascal Script] (formerly ''InnerFuse'') and [http://code.google.com/p/dwscript/ DWScript] (Delphi Web Script) are open-source Object Pascal [[Interpreter (computing)|interpreters]] and scripting engines written in Delphi. They support subsets of Object Pascal. DWScript can also compile Object Pascal code into JavaScript code (Smart Pascal), and supports [[just-in-time compilation]] (JIT).
==Sample "Hello World" programs==
Line 121 ⟶ 172:
===Turbo Pascal version===
Still supported in Delphi and Free Pascal. FPC also packages its own substitutes for the libraries/units. Delphi
====Stack based allocation====
Line 231 ⟶ 282:
</syntaxhighlight>
Note that the object construct is still available in Delphi and Free Pascal.
===Oxygene version===
Line 319 ⟶ 331:
==Development==
Many features have been introduced continuously to Object Pascal with extensions to Delphi and extensions to FreePascal. In reaction to criticism, Free Pascal has adopted generics with the same syntax as Delphi, provided Delphi compatibility mode is selected, and both Delphi (partial) and Free Pascal (more extensive) support [[operator overloading]]. Delphi has also introduced many other features since version 7,<ref name="newftrs">{{cite web|title=New Delphi language features since Delphi 7|publisher=CodeGear|url=http://dn.codegear.com/article/34324|access-date=2008-07-06|archive-date=2008-07-02|archive-url=https://web.archive.org/web/20080702184859/http://dn.codegear.com/article/34324|url-status=live}}</ref> including generics. Whereas FreePascal tries to be compatible to Delphi in Delphi compatibility mode, it also usually introduced many new features to the language that are not always available in Delphi.
==References==
Line 326 ⟶ 338:
==External links==
*[http://www.mactech.com/articles/mactech/Vol.02/02.12/ObjectPascal/ Introduction to Object Pascal], MacTech Vol 2 Issue 12 1985.
*[http://www.freepascal.org/docs-html/ref/ref.html Object Pascal reference guide for Free Pascal.] {{Webarchive|url=https://web.archive.org/web/20091223073028/http://www.freepascal.org/docs-html/ref/ref.html |date=2009-12-23 }} "The aim is to list which Pascal constructs are supported, and to show where the Free Pascal implementation differs from the Turbo Pascal or Delphi implementations."
**[https://web.archive.org/web/20060713205007/http://www.freepascal.org/docs/ref.pdf Free Pascal: Reference guide], Reference guide for Free Pascal, version 2.0.0
*[http://www.roblocher.com/whitepapers/opascal.html Major Differences Between the Syntax of C++ and Object Pascal]
Line 339 ⟶ 351:
{{Pascal programming language family}}
{{Wirth}}
{{Authority control}}
[[Category:Borland]]
Line 344 ⟶ 357:
[[Category:Delphi (programming language)]]
[[Category:Object-oriented programming languages]]
[[Category:Systems programming languages]]
[[Category:Pascal programming language family]]
[[Category:Programming languages created in 1986]]
|