Racket (programming language): Difference between revisions

Content deleted Content added
Linked to compiler
Tags: Mobile edit Mobile web edit Advanced mobile edit
Rescuing 1 sources and tagging 0 as dead.) #IABot (v2.0.9.5
 
(44 intermediate revisions by 32 users not shown)
Line 1:
{{Short description|Lisp dialect}}
{{Infobox programming language
| name = Racket
| logo = Racket-logo.svg
| logo size = 121px140px
| screenshot = Drracket.png
| screenshot size = 250px
| screenshot caption = DrRacket on [[Linux]]
| paradigm = [[multiMulti-paradigm programming language|Multi-paradigm]]: [[functionalFunctional programming|functional]], [[imperativeImperative programming|imperative]], [[logicLogic programming|logic]], [[metaprogrammingMetaprogramming|meta]], [[modularModular programming|modular]], [[objectObject-oriented programming|object-oriented]], [[reflectionReflective (computer science)programming|reflective]]
| family = [[Lisp (programming language)|Lisp]]
| year = {{Start date and age|1995|01|28}}
| designer = PLT Inc.
| developer = PLT Inc.
| latest_release_versionlatest release version = {{Wikidata|property|reference|edit|Q28975406|P348}}
| latest_release_datelatest release date = {{start date and age|{{Wikidata|qualifier|Q28975406|P348|P577}}}}
| typing = [[dynamicDynamic typing|Dynamic]], [[staticStatic typing|static]], [[strongStrong and weak typing|strong]]
| implementations = [https://docs.racket-lang.org/reference/implementations.html Racket], [https://docs.racket-lang.org/racketscript/index.html RacketScript] Racket to JavaScript (ES6) compiler, [https://github.com/pycket/pycket Pycket] a Racket implementation using [https://pypi.org/project/rpython/ RPython].
| implementations =
| dialects = Typed Racket, FrTime, Lazy Racket, Scribble
| influenced by = [[Eiffel (programming language)|Eiffel]],<ref>{{cite web |url=http://www.ccs.neu.edu/racket/pubs/dls10-sf.pdf |title=DLS 2010: Contracts for First-Class Classes |last1=Strickland |first1=T.S. |last2=Fellesisen |first2=Matthias |year=2010}}</ref> [[Scheme (programming language)|Scheme]]
| influenced = [[Clojure]],<ref name="typed-clojure-thesis">{{cite thesis |last=Bonnaire-Sergeant |first=Ambrose |title=A Practical Optional Type System for Clojure|publisher=The University of Western Australia |year=2012}}</ref> [[Rust (programming language)|Rust]],<ref>{{cite web |url=https://mail.mozilla.org/pipermail/rust-dev/2013-May/003947.html |title=Planet2 questions}}</ref><ref>{{cite web |url=https://github.com/rust-lang/rust/blob/0486e12ad0661adcfdbd926dea17d7edfda419c1/src/doc/book/bibliography.md |title=Rust Bibliography|website=[[GitHub]] |date=23 November 2022 }}</ref> [[Scheme (programming language)|Scheme (R6RS)]]<ref name="r6rs">{{cite web |url=http://www.r6rs.org |title=Revised<sup>6</sup> Report on the Algorithmic Language Scheme (R6RS) |last1=Sperber |first1=Michael |last2=Dybvig |first2=R. Kent |last3=Flatt |first3=Matthew |last4=Van Straaten |first4=Anton |date=August 2007 |publisher=Scheme Steering Committee |access-date=2011-09-13 |display-authors=etal}}</ref>
| platform = [[x86]], [[PowerPC]], [[SPARC]], [[MIPS architecture|MIPS]], [[ARM architecture|ARM]]
| operating system = [[Cross-platform]]
| license = [[MIT License|MIT]] or [[Apache License 2.0|Apache 2.0]]<ref>{{cite web|title=Completing Racket's relicensing effort|url=https://blog.racket-lang.org/2019/11/completing-racket-s-relicensing-effort.html|last1=Tobin-Hochstadt|first1=Sam|last2=Gerard|first2=Sage|last3=Dueck|first3=Joel|last4=Flatt|first4=Matthew|author-link4=Matthew Flatt|author5=Software Freedom Conservancy|author-link5=Software Freedom Conservancy|last6=Chestek|first6=Pamela|date=2019-11-15|access-date=2019-12-27}}</ref>
| file ext = .rkt<ref>{{cite web|title=DrRacket Files|quote=The standard file extension for a Racket program file is ".rkt". The extensions ".ss", ".scm", and ".sch" are also historically popular.|url=https://docs.racket-lang.org/drracket/drracket-files.html|access-date=21 July 2019}}</ref>
| website = {{URLurl|https://racket-lang.org/}}
| frequently updated = yes
| standard = [[R5RS]], [[R6RS]]
}}
 
'''Racket''' is a [[General-purpose programming language|general-purpose]], [[multi-paradigm programming language]]. The Racket(the language) is a modern dialect of [[Lisp (programming language)|Lisp]] and a descendant of the [[Scheme (programming language)|Scheme]]. It is designed as a platform for [[programming language theory|programming language design]] and implementation.<ref name="manifesto">{{cite journal |last1=Felleisen |first1=M. |last2=Findler |first2=R.B. |last3=Flatt |first3=M. |last4=Krishnamurthi |first4=S. |last5=Barzilay |first5=E. |last6=McCarthy |first6=J. |last7=Tobin-Hochstadt |first7=S. |title=The Racket Manifesto |journal=Proceedings of the First Summit on Advances in Programming Languages |date=2015 |pages=113–128 |url=https://www2.ccs.neu.edu/racket/pubs/manifesto.pdf}}</ref> In addition to the core Racket language, ''Racket'' is also used to refer to the family of programming languages<ref>{{cite web |title=Dialects of Racket and Scheme |url=http://docs.racket-lang.org/guide/dialects.html |access-date=2011-08-15}}</ref> and set of tools supporting development on and with Racket.<ref>{{cite web |title=Welcome to Racket |url=http://docs.racket-lang.org/guide/intro.html|access-date=2019-05-15}}</ref> Racket is also used for [[script (computing)|scripting]], [[computer science]] education, and research.
'''Racket''' is a [[compiler|compiled]], [[General-purpose programming language|general-purpose]], [[multi-paradigm programming language]] and a multi-platform distribution that includes the Racket language, [[compiler]], large standard library, [[IDE]], development tools, and a set of additional languages including Typed Racket (a sister language of Racket with a static type-checker), Swindle, FrTime, Lazy Racket, R5RS & R6RS Scheme, Scribble, Datalog, Racklog, [[Algol 60]] and several teaching languages.
 
The Racket platform provides an implementation of the Racket language (including a [[runtime system]],<ref name="mred"/> libraries, and [[compiler]] supporting several compilation modes: machine code, machine-independent, interpreted, and JIT) along with the DrRacket [[integrated development environment]] (IDE) written in Racket.<ref name="drscheme"/> Racket is used by the [[ProgramByDesign]] outreach program, which aims to turn [[computer science]] into "an indispensable part of the [[liberal arts]] [[curriculum]]".<ref name="teachscheme">{{cite news| last1=Felleisen |last2=Findler |last3=Flatt |last4=Krishnamurthi |year=2004 |url=http://www.ccs.neu.edu/scheme/pubs/#cse2003-fffk |title=The TeachScheme! Project: Computing and Programming for Every Student|journal=Journal of Computer Science Education}}</ref><ref>{{cite web |url=http://programbydesign.org/overview |title=Overview |publisher=Program by Design |access-date=2011-08-17 |archive-date=2013-05-20 |archive-url=https://web.archive.org/web/20130520104718/http://www.programbydesign.org/overview |url-status=dead }}</ref>
Racket(the language) is a modern dialect of [[Lisp (programming language)|Lisp]] and a descendant of the [[Scheme (programming language)|Scheme]]. It is designed as a platform for [[programming language theory|programming language design]] and implementation.<ref name="manifesto">{{cite journal |last1=Felleisen |first1=M. |last2=Findler |first2=R.B. |last3=Flatt |first3=M. |last4=Krishnamurthi |first4=S. |last5=Barzilay |first5=E. |last6=McCarthy |first6=J. |last7=Tobin-Hochstadt |first7=S. |title=The Racket Manifesto |journal=Proceedings of the First Summit on Advances in Programming Languages |date=2015 |pages=113–128 |url=https://www2.ccs.neu.edu/racket/pubs/manifesto.pdf}}</ref> In addition to the core Racket language, ''Racket'' is also used to refer to the family of programming languages<ref>{{cite web |title=Dialects of Racket and Scheme |url=http://docs.racket-lang.org/guide/dialects.html |access-date=2011-08-15}}</ref> and set of tools supporting development on and with Racket.<ref>{{cite web |title=Welcome to Racket |url=http://docs.racket-lang.org/guide/intro.html|access-date=2019-05-15}}</ref> Racket is also used for [[script (computing)|scripting]], [[computer science]] education, and research.
 
The Racket platform provides an implementation of the Racket language (including a [[runtime system]],<ref name="mred"/> libraries, and [[compiler]] supporting several compilation modes: machine code, machine-independent, interpreted, and JIT) along with the DrRacket [[integrated development environment]] (IDE) written in Racket.<ref name="drscheme"/> Racket is used by the [[ProgramByDesign]] outreach program, which aims to turn [[computer science]] into "an indispensable part of the [[liberal arts]] [[curriculum]]".<ref name="teachscheme">{{cite news| last1=Felleisen |last2=Findler |last3=Flatt |last4=Krishnamurthi |year=2004 |url=http://www.ccs.neu.edu/scheme/pubs/#cse2003-fffk |title=The TeachScheme! Project: Computing and Programming for Every Student|journal=Journal of Computer Science Education}}</ref><ref>{{cite web |url=http://programbydesign.org/overview |title=Overview |publisher=Program by Design |access-date=2011-08-17}}</ref>
 
The core Racket language is known for its extensive [[macro (computer science)|macro]] system which enables creating embedded and [[___domain-specific language]]s, language constructs such as [[class (computer programming)|classes]] or [[modular programming|modules]], and separate dialects of Racket with different [[semantics of programming languages|semantics]].<ref name="scheme-with-classes">{{cite conference
Line 57 ⟶ 55:
|year=2011
|url=http://www.ccs.neu.edu/scheme/pubs/pldi11-thacff.pdf}}
</ref><ref>{{Cite journal |doi=10.1145/3127323 |volume=61 |issue=3 |pages=62–71 |last1=Felleisen |first1=Matthias |last2=Findler |first2=Robert Bruce |last3=Flatt |first3=Matthew |last4=Krishnamurthi |first4=Shriram |last5=Barzilay |first5=Eli |last6=McCarthy |first6=Jay |last7=Tobin-Hochstadt |first7=Sam |title=A Programmable Programming Language |journal=Communications of the ACM |date=2018 |s2cid=3887010 |url=https://cacm.acm.org/magazines/2018/3/225475-a-programmable-programming-language/fulltext|url-access=subscription }}</ref>
 
The platform distribution is [[free and open-source software]] distributed under the [[Apache License|Apache 2.0]] and [[MIT license]]s.<ref name="racket-lgpl-license">{{cite web |title=Racket: Software License |url=http://download.racket-lang.org/license.html |access-date=2015-10-20}}</ref> Extensions and packages written by the community may be uploaded to Racket's [[package manager|package catalog]].
Line 64 ⟶ 62:
 
===Development===
[[Matthias Felleisen]] founded PLT Inc. in the mid 1990s, first as a research group, soon after as a project dedicated to producing [[pedagogic]] materials for novice programmers (lectures, exercises/projects, software). In January 1995, the group decided to develop a pedagogic programming environment based on [[Scheme (programming language)|Scheme]]. [[Matthew Flatt]] cobbled together MrEd, the original [[virtual machine]] for Racket, from libscheme,<ref name="libscheme">{{cite conference |url=https://www.usenix.org/legacy/publications/library/proceedings/vhll/benson.html |title=libscheme: Scheme as a C Library |last=Benson |first=Brent W. Jr. |date=26–28 October 1994 |publisher=USENIX Association |publication-place=Berkeley, CA |book-title=Proceedings of the USENIX Symposium on Very High Level Languages |pages=7–19 |___location=Santa Fe, NM |isbn=978-1880446652 |access-date=7 July 2013}}</ref> [[wxWidgets]], and a few other free systems.<ref name="gui-rebuild">{{cite web |title=Rebuilding Racket's Graphics Layer |access-date=2017-12-11|date=2010-12-08 |url=http://blog.racket-lang.org/2010/12/rebuilding-rackets-graphics-layer.html}}</ref> In the years that followed, a team including Flatt, [[Robert Bruce Findler|Robby Findler]], [[Shriram Krishnamurthi]], Cormac Flanagan, and many others produced DrScheme, a programming environment for novice Scheme programmers and a research environment for [[type system#Combining static and dynamic type checking|softgradual typing]].<ref name="drscheme">{{cite journal |title=DrScheme: A Programming Environment for Scheme|journal=Journal of Functional Programming |last1=Findler |last2=Clements |last3=Flanagan |last4=Flatt |last5=Krishnamurthi |last6=Steckler |last7=Felleisen |url=http://www.ccs.neu.edu/racket/pubs/jfp01-fcffksf.pdf |year=2001}}</ref> The main development language that DrScheme supported was named PLT Scheme.
 
In parallel, the team began conducting workshops for high school teachers, training them in program design and functional programming. Field tests with these teachers and their students provided essential clues for directing the development.
Line 73 ⟶ 71:
 
===Version history===
The first generation of PLT Scheme revisions introduced features for [[programming in the large and programming in the small#Programming in the large|programming in the large]] with both [[modular programming|modules]] and [[class (computer programming)|classes]]. Version 42 introduced units – a first-class module system – to complement classes for large scale development.<ref name="release-notes">{{cite web |title=Racket Core Release Notes |url=http://docs.racket-lang.org/release-notes/racket/HISTORY.txt |access-date=2012-04-15 |url-status=dead |archive-url=https://wwwweb.webcitationarchive.org/6GpxFjzKz?url=web/20130705094339/http://docs.racket-lang.org/release-notes/racket/HISTORY.txt |archive-date=2013-0507-2305 }}</ref> The class system gained features (e.g. [[Java (programming language)|Java]]-style [[Protocol (object-oriented programming)|interfaces]]) and also lost several features (e.g. [[multiple inheritance]]) throughout these versions.<ref name="scheme-with-classes" /> The language evolved throughout a number of successive versions, and gaining milestone popularity in Version 53, leading to extensive work and the following Version 100, which would be equivalent to a "1.0" release in current popular version systems.
 
The next major revision was named Version 200, which introduced a new default module system that cooperates with macros.<ref name="release-notes" /> In particular, the module system ensures that run-time and [[compile-time]] computation are separated to support a "tower of languages".<ref>{{cite conference |title=Composable and Compilable Macros |last=Flatt |first=M. |book-title=International Conference on Functional Programming |year=2002}}</ref> Unlike units, these modules are not [[first-class object]]s.
Line 79 ⟶ 77:
Version 300 introduced [[Unicode]] support, [[foreign function interface|foreign library]] support, and refinements to the class system.<ref name="release-notes" /> Later on, the 300 series improved the [[computer performance|performance]] of the language runtime with an addition of a JIT compiler and a switch to a default [[generational garbage collection]].
 
By the next major release, the project had switched to a more conventional [[software versioning#Sequence-based identifiers|sequence-based]] version numbering. Version 4.0 introduced the <code>#lang</code> shorthand to specify the language that a module is written in. Further, the revision introduced [[immutable object|immutable]] pairs and lists, support for fine-grained [[parallel computing|parallelism]], and a [[Static typing|statically-typed]] dialect.<ref name="4.0">{{cite web |url=http://blog.racket-lang.org/2008/06/plt-scheme-version-4.html |title=PLT Scheme version 4.0 |date=2008-06-12 |access-date=2012-08-07 |url-status=dead |archive-url=https://wwwweb.webcitationarchive.org/6GpxGJOg8?url=web/20130202224019/http://blog.racket-lang.org/2008/06/plt-scheme-version-4.html |archive-date=2013-0502-2302 }}</ref>
 
On 7 June 2010, PLT Scheme was renamed Racket.<ref>{{cite web |url=http://racket-lang.org/new-name.html |title=From PLT Scheme to Racket |publisher=Racket-lang.org |access-date=2011-08-17}}</ref> The renaming coincided with the release of Version 5.0. Subsequently, the [[graphical user interface]] (GUI) backend was rewritten in Racket from [[C++]] in Version 5.1 using native [[widget toolkit|UI toolkits]] on all platforms.<ref name="gui-rebuild" /> Version 5.2 included a background [[Static code analysis|syntax checking]] tool, a new plotting library, a database library, and a new extended REPL.<ref name="5.2">{{cite web |url=http://blog.racket-lang.org/2011/11/racket-v52.html |title=Racket 5.2|publisher=PLT, Inc|date=2011-11-09 |access-date=2012-06-16}}</ref> Version 5.3 included a new submodule feature for optionally loaded modules,<ref name="submodules">{{cite web |url=http://blog.racket-lang.org/2012/06/submodules.html |title=Submodules|date=2012-06-03 |access-date=2012-08-07}}</ref> new [[Program optimization|optimization]] tools, a [[JSON]] library, and other features.<ref name="5.3">{{cite web |url=http://blog.racket-lang.org/2012/08/racket-v53.html |title=Racket 5.3|publisher=PLT, Inc|date=2012-08-07 |access-date=2012-08-07}}</ref> Version 5.3.1 introduced major improvements to DrRacket: the background syntax checker was turned on by default and a new documentation preview tool was added.<ref name="5.3.1">{{cite web |url=http://blog.racket-lang.org/2012/11/racket-v531.html |title=Racket 5.3.1|publisher=PLT, Inc|date=2012-11-07 |access-date=2012-11-07}}</ref>
Line 85 ⟶ 83:
In version 6.0, Racket released its second-generation package management system. As part of this development, the principal DrRacket and Racket repository was reorganized and split into a large set of small packages, making it possible to install a ''minimal racket'' and to install only those packages needed.<ref name="6.0">{{cite web |url=http://blog.racket-lang.org/2014/02/racket-v60.html |title=Racket 6.0|publisher=PLT, Inc |date=2014-02-26 |access-date=2016-02-23}}</ref>
 
Version 7 of Racket was released with a new macro expander written in Racket as part the preparations for supporting moving to the [[Chez Scheme]] runtime system and supporting multiple runtime systems.<ref>{{cite web |url=https://blog.racket-lang.org/2018/01/racket-on-chez-status.html |title=Racket-on-Chez Status: January 2018|date=2018-01-05 |access-date=2018-04-13 |archive-url=https://wwwweb.webcitationarchive.org/6yea9ArGR?url=web/20180628163352/https://blog.racket-lang.org/2018/01/racket-on-chez-status.html |url-status=live |archive-date=2018-0406-1328}}</ref>
<ref>{{cite web |url=https://www.cs.utah.edu/plt/publications/icfp19-rddkmstz.pdf |title=building Racket on Chez Scheme (Experience Report)|date=2019-08-01 |access-date=2019-07-25}}</ref> On 19 November 2019, Racket 7.5 was released. The license of Racket 7.5 was less restrictive. They use now either the Apache 2.0 license or the MIT license.<ref>{{Cite web|url=https://hub.packtpub.com/racket-7-5-releases-with-relicensing-to-apache-mit-standard-json-mime-dark-mode-interface-and-more/|title=Racket 7.5 release|website=Packt Hub|date=22 November 2019 |access-date=2019-11-28}}</ref><ref>{{Cite web|url=https://blog.racket-lang.org/2019/11/racket-v7-5.html|title=Racket v7.5|website=Racket {{!}} Blog|access-date=2019-11-28}}</ref>
 
On 2021 February 13, Racket 8.0 was released. Racket 8.0 marks the first release where Racket with the [[Chez Scheme]] runtime system, known as Racket CS, is the default implementation. Racket CS is faster, easier to maintain and develop, and is backward-compatible with existing Racket programs, and has better parallel garbage collection, and typically gives a 10%–30% reduction in the size of generated code.<ref>{{cite web |url=https://blog.racket-lang.org/2021/02/racket-v8-0.html |title = Racket v8.0}}</ref>
 
== Features ==
Line 109 ⟶ 107:
At the end of 2014, much of Racket's code was moved into a new packaging system separate from the main code base. This new packaging system is serviced by a client program named ''raco''. The new package system provides fewer features than PLaneT; a blog post by Jay McCarthy on the Racket blog explains the rationale for the change and how to duplicate the older system.<ref>{{cite web |url=http://blog.racket-lang.org/2014/12/the-racket-package-system-and-planet.html |title=The Racket package system and Planet}}</ref>
 
===Integrated Languagelanguage Extensibilityextensibility and Macrosmacros===
{{See also|Racket features#Language Extensions|l1=Racket language extensions}}
 
The features that most clearly distinguish Racket from other languages in the Lisp family are its integrated language [[Extensible programming|extensibility]] features that support building new [[Domain-specific languages|___domain-specific]] and [[General-purpose programming language|general-purpose]] languages. Racket's extensibility features are built into the module system to allow context-sensitive and module-level control over syntax.<ref name='"languages-as-libraries'"/> For example, the <code>#%app</code> syntactic form can be overridden to change the semantics of [[function application]]. Similarly, the <code>#%module-begin</code> form allows arbitrary static analysis of the entire module.<ref name='"languages-as-libraries'"/> Since any module can be used as a language, via the <code>#lang</code> notation, this effectively means that virtually any aspect of the language can be programmed and controlled.
 
The module-level extensibility features are combined with a [[Scheme (programming language)|Scheme]]-like hygienic macro system, which provides more features than [[Lisp (programming language)|Lisp's]] s-expression manipulation system,<ref name='"you-want-it-when'">{{cite conference |last=Flatt |first=Matthew |url=http://www.cs.utah.edu/plt/publications/macromod.pdf |title=Composable and Compilable Macros, You Want it When? |book-title=International Conference on Functional Programming |year=2002}}</ref><ref>Flatt, Culpepper, Darais, Findler, [http://www.cs.utah.edu/plt/publications/jfp12-draft-fcdf.pdf Macros that Work Together; Compile-Time Bindings, Partial Expansion, and Definition Contexts]</ref> Scheme 84's [[Hygienic macro|hygienic]] extend-syntax macros, or [[R5RS]]'s [[syntax-rules]]. Indeed, it is fair to say that the macro system is a carefully tuned [[application programming interface]] (API) for [[compiler]] extensions. Using this compiler API, programmers can add features and entire [[___domain-specific language]]s in a manner that makes them completely indistinguishable from built-in language constructs.
 
The '''macro''' system in Racket has been used to construct entire language [[dialect (computing)|dialects]]. This includes Typed Racket, which is a gradually typed dialect of Racket that eases the migration from [[dynamically typed|untyped]] to typed code,<ref>{{cite conference |last1=Tobin-Hochstadt |first1=S. |last2=Felleisen |first2=M. |title=The Design and Implementation of Typed Scheme |book-title=Principles of Programming Languages |year=2008}}</ref> Lazy Racket—a dialect with [[lazy evaluation]],<ref>{{cite conference |last1=Barzilay |first1=E. |last2=Clements |first2=J. |title=Laziness Without All the Hard Work: Combining Lazy and Strict Languages for Teaching |book-title=Functional and Declarative Programming in Education |year=2005}}</ref> and Hackett, which combines Haskell and Racket.<ref name="Alexis Kings Blog">{{cite web | title=The Hackett Programming Language | website=Alexis King's Blog | url=https://lexi-lambda.github.io/hackett/ | access-date=16 June 2019}}</ref> The pedagogical programming language [[Pyret]] was originally implemented in Racket.<ref name="The Pyret Crew 2011">{{cite web | author=The Pyret Crew | title=The Pyret Code; or A Rationale for the Pyret Programming Language | website=Pyret | date=24 May 2011 | url=http://pyret.org/pyret-code/index.html | access-date=16 June 2019}}</ref><ref name="Index of / 2017">{{cite web | title=Programming and Programming Languages | website=Index of / | date=20 September 2017 | url=https://papl.cs.brown.edu/2017/ | access-date=16 June 2019}}</ref>
 
Other dialects include FrTime ([[functional reactive programming]]), Scribble (documentation language),<ref>{{cite conference |last1=Flatt |first1=M. |last2=Barzilay |first2=E. |last3=Findler |first3=R. B. |title=Scribble: Closing the Book on Ad Hoc Documentation Tools |book-title=International Conference on Functional Programming |year=2009}}</ref> Slideshow ([[slide show|presentation]] language),<ref>{{cite conference |last1=Findler |first1=R. B. |last2=Flatt |first2=M. |title=Slideshow: Functional Presentations |book-title=International Conference on Functional Programming |year=2004}}</ref> and several languages for education.<ref name="functional-io">{{cite conference |last1=Felleisen |last2=Findler |last3=Flatt |last4=Krishnamurthi |first1=M. |first2=R. B. |first3=M. |first4=S. |title=A Functional I/O System (or Fun for Freshman Kids) |url=http://www.ccs.neu.edu/scheme/pubs/icfp09-fffk.pdf |book-title=International Conference on Functional Programming |year=2009}}</ref><ref>{{cite journal |title=The Structure and Interpretation of the Computer Science Curriculum |last1=Felleisen |last2=Findler |last3=Flatt |last4=Krishnamurthi |first1=M. |first2=R. B. |first3=M. |first4=S.|journal=Journal of Functional Programming |volume=14 |issue=4 |pages=365–378 |url=http://www.ccs.neu.edu/scheme/pubs/fdpe2002-fffk.pdf |year=2004|doi=10.1017/S0956796804005076 }}</ref>
 
Racket's core distribution provides libraries to aid the development of programming languages.<ref name="languages-as-libraries"/> Such languages are not restricted to [[s-expression]] based syntax. In addition to conventional readtable-based syntax extensions, the directive <code>#lang</code> enables the invocation of arbitrary parsers, which can be implemented using the parser tools library.<ref name="parsers">{{cite web |title=Parser Tools: lex and yacc-style Parsing |url=http://docs.racket-lang.org/parser-tools/ |access-date=2011-08-16}}</ref> See [[Racket features#Logic Programmingprogramming|Racket logic programming]] for an example of such a language.
 
==Programming environment==
The language platform provides a [[Self-hosting (compilers)|self-hosted]] [[integrated development environment|IDE]]<ref name="drscheme"/> named DrRacket, a continuation-based [[web server]],<ref name="web-server"/> a [[graphical user interface]],<ref name="gui-rebuild"/> and other tools. As a viable scripting tool with libraries like common [[scripting language]]s, it can be used for scripting the Unix shell. It can parse [[command -line argumentsargument]]s and execute external tools.
 
===DrRacket IDE===
Line 133 ⟶ 131:
 
== Code examples ==
Here is a trivial [[hello"Hello, world]]World!" program]]:
<syntaxhighlight lang="Racket">
#lang racket
Line 163 ⟶ 161:
(if (zero? n) 1 (* n (fact (- n 1)))))
</syntaxhighlight>
 
== Implementations ==
Racket currently has two implementations. Both support Linux, Windows and MacOS on a variety of architectures and are supported as at version 8.8 (2023). The default implementation uses the [[Chez Scheme]] incremental compiler and runtime. The alternate implementation generates platform-independent bytecode and uses [[Just-in-time compilation]] to generate machine code as it is loaded.<ref>[https://docs.racket-lang.org/reference/implementations.html Implementations]</ref>
 
In addition, there are experimental implementations:
* RacketScript is an experimental Racket to JavaScript (ES6) compiler. It allows programmers to use both JavaScript’s and Racket’s ecosystem and aims to make this interoperability as smooth as possible.<ref>[https://docs.racket-lang.org/racketscript/index.html RacketScript]</ref>
* Pycket is a Racket implementation generated using the RPython framework.<ref>[https://github.com/pycket/pycket Pycket]</ref>
 
== Applications and practical use ==
Line 170 ⟶ 175:
Racket has several features useful for a commercial language, among them an ability to compile standalone executables under Windows, macOS, and Unix, a [[Profiling (computer programming)|profiler]] and [[debugger]] included in the [[integrated development environment]] (IDE), and a [[unit testing]] framework.
 
Racket has been used for commercial projects and web applications. A notable example is the [[Hacker News]] website, which runs on [[Arc (programming language)|Arc]], which is developed in Racket. [[Naughty Dog]] has used it as a scripting language in several of their video games.<ref>{{cite web |url=http://cufp.org/conference/sessions/2011/functional-mzscheme-dsls-game-development |title=Functional mzScheme DSLs in Game Development |access-date=2012-05-08}}</ref>
 
Racket is used to teach students algebra through game design in the [[Bootstrap curriculum|Bootstrap program]].<ref>{{cite web |url=http://www.bootstrapworld.org/materials/fall2015/index.shtml |website=bootstrapworld.org |access-date=2015-08-11 |title=Bootstrap}}</ref>
Line 209 ⟶ 214:
[[Category:Pedagogic integrated development environments]]
[[Category:Cross-platform free software]]
[[Category:Free compilers and interpretersopen source compilers]]
[[Category:Programming languages created in 1995]]
[[Category:Pattern matching programming languages]]