Racket is a
general-purpose,
multi-paradigm programming language
Programming paradigms are a way to classify programming languages based on their features. Languages can be classified into multiple paradigms.
Some paradigms are concerned mainly with implications for the execution model of the language, suc ...
and a multi-platform distribution that includes the Racket language,
compiler
In computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs that ...
, 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 A scheme is a systematic plan for the implementation of a certain idea.
Scheme or schemer may refer to:
Arts and entertainment
* ''The Scheme'' (TV series), a BBC Scotland documentary series
* The Scheme (band), an English pop band
* ''The Schem ...
, Scribble, Datalog, Racklog,
Algol 60
ALGOL 60 (short for ''Algorithmic Language 1960'') is a member of the ALGOL family of computer programming languages. It followed on from ALGOL 58 which had introduced code blocks and the begin and end pairs for delimiting them, representing a k ...
and several teaching languages.
The Racket language is a modern dialect of
Lisp
A lisp is a speech impairment in which a person misarticulates sibilants (, , , , , , , ). These misarticulations often result in unclear speech.
Types
* A frontal lisp occurs when the tongue is placed anterior to the target. Interdental lisping ...
and a descendant of
Scheme A scheme is a systematic plan for the implementation of a certain idea.
Scheme or schemer may refer to:
Arts and entertainment
* ''The Scheme'' (TV series), a BBC Scotland documentary series
* The Scheme (band), an English pop band
* ''The Schem ...
. It is designed as a platform for
programming language design
A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language.
The description of a programming la ...
and implementation.
In addition to the core Racket language, ''Racket'' is also used to refer to the family of programming languages and set of tools supporting development on and with Racket. Racket is also used for
scripting,
computer science
Computer science is the study of computation, automation, and information. Computer science spans theoretical disciplines (such as algorithms, theory of computation, information theory, and automation) to Applied science, practical discipli ...
education, and research.
The Racket platform provides an implementation of the Racket language (including a
runtime system
In computer programming, a runtime system or runtime environment is a sub-system that exists both in the computer where a program is created, as well as in the computers where the program is intended to be run. The name comes from the compile t ...
,
libraries, and
compiler
In computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs that ...
supporting several compilation modes: machine code, machine-independent, interpreted, and JIT) along with the DrRacket
integrated development environment
An integrated development environment (IDE) is a software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of at least a source code editor, build automation tools a ...
(IDE) written in Racket.
Racket is used by the
ProgramByDesign
The ProgramByDesign (formerly TeachScheme!) project is an outreach effort of the PLT research group. The goal is to train college faculty, high school teachers, and possibly even middle school teachers, in programming and computing.
History
Matt ...
outreach program, which aims to turn
computer science
Computer science is the study of computation, automation, and information. Computer science spans theoretical disciplines (such as algorithms, theory of computation, information theory, and automation) to Applied science, practical discipli ...
into "an indispensable part of the
liberal arts
Liberal arts education (from Latin "free" and "art or principled practice") is the traditional academic course in Western higher education. ''Liberal arts'' takes the term ''art'' in the sense of a learned skill rather than specifically the ...
curriculum
In education, a curriculum (; : curricula or curriculums) is broadly defined as the totality of student experiences that occur in the educational process. The term often refers specifically to a planned sequence of instruction, or to a view ...
".
The core Racket language is known for its extensive
macro system which enables creating embedded and
domain-specific language
A domain-specific language (DSL) is a computer language specialized to a particular application domain. This is in contrast to a general-purpose language (GPL), which is broadly applicable across domains. There are a wide variety of DSLs, ranging f ...
s, language constructs such as
classes or
modules
Broadly speaking, modularity is the degree to which a system's components may be separated and recombined, often with the benefit of flexibility and variety in use. The concept of modularity is used primarily to reduce complexity by breaking a sy ...
, and separate dialects of Racket with different
semantics
Semantics (from grc, σημαντικός ''sēmantikós'', "significant") is the study of reference, meaning, or truth. The term can be used to refer to subfields of several distinct disciplines, including philosophy
Philosophy (f ...
.
[
][
][
]
The platform distribution is
free and open-source software
Free and open-source software (FOSS) is a term used to refer to groups of software consisting of both free software and open-source software where anyone is freely licensed to use, copy, study, and change the software in any way, and the source ...
distributed under the
Apache 2.0 and
MIT license
The MIT License is a permissive free software license originating at the Massachusetts Institute of Technology (MIT) in the late 1980s. As a permissive license, it puts only very limited restriction on reuse and has, therefore, high license comp ...
s.
Extensions and packages written by the community may be uploaded to Racket's
package catalog.
History
Development
Matthias Felleisen
Matthias Felleisen is a German-American computer science professor and author. He grew up in Germany and immigrated to the US when he was 21 years old.
He received his PhD from Indiana University under the direction of Daniel P. Friedman.
Afte ...
founded PLT Inc. in the mid 1990s, first as a research group, soon after as a project dedicated to producing
pedagogic
Pedagogy (), most commonly understood as the approach to teaching, is the theory and practice of learning, and how this process influences, and is influenced by, the social, political and Developmental psychology, psychological development of le ...
materials for novice programmers (lectures, exercises/projects, software). In January 1995, the group decided to develop a pedagogic programming environment based on
Scheme A scheme is a systematic plan for the implementation of a certain idea.
Scheme or schemer may refer to:
Arts and entertainment
* ''The Scheme'' (TV series), a BBC Scotland documentary series
* The Scheme (band), an English pop band
* ''The Schem ...
.
Matthew Flatt Matthew Flatt is an American computer scientist and professor at the University of Utah School of Computing in Salt Lake City. He is also a member of the core development team for the Racket programming language.
Flatt received his PhD at Rice Univ ...
cobbled together MrEd, the original
virtual machine
In computing, a virtual machine (VM) is the virtualization/emulation of a computer system. Virtual machines are based on computer architectures and provide functionality of a physical computer. Their implementations may involve specialized hardw ...
for Racket, from libscheme,
wxWidgets
wxWidgets (formerly wxWindows) is a widget toolkit and tools library for creating graphical user interfaces (GUIs) for cross-platform applications. wxWidgets enables a program's GUI code to compile and run on several computer platforms with mini ...
, and a few other free systems.
In the years that followed, a team including Flatt,
Robby Findler,
Shriram Krishnamurthi
Shriram Krishnamurthi is a computer scientist, currently a professor of computer science at Brown University and a member of the core development group for the Racket programming languages, responsible for creation of software packages including ...
, Cormac Flanagan, and many others produced DrScheme, a programming environment for novice Scheme programmers and a research environment for
soft typing.
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.
Over the following years, PLT added teaching languages, an algebraic stepper, a transparent
read–eval–print loop
A read–eval–print loop (REPL), also termed an interactive toplevel or language shell, is a simple interactive computer programming environment that takes single user inputs, executes them, and returns the result to the user; a program written ...
, a constructor-based printer, and many other innovations to DrScheme, producing an application-quality pedagogic program development environment. By 2001, the core team (Felleisen, Findler, Flatt, Krishnamurthi) had also written and published their first textbook, ''
How to Design Programs
''How to Design Programs'' (''HtDP'') is a textbook by Matthias Felleisen, Robert Bruce Findler, Matthew Flatt, and Shriram Krishnamurthi on the systematic design of computer programs. MIT Press published the first edition in 2001, and the secon ...
'', based on their teaching philosophy.
''The Racket Manifesto''
details the principles driving the development of Racket, presents the evaluation framework behind the design process, and details opportunities for future improvements.
Version history
The first generation of PLT Scheme revisions introduced features for
programming in the large
In software engineering, programming in the large and programming in the small refer to two different aspects of writing software, namely, designing a larger system as a composition of smaller parts, and creating those smaller parts by writing li ...
with both
modules
Broadly speaking, modularity is the degree to which a system's components may be separated and recombined, often with the benefit of flexibility and variety in use. The concept of modularity is used primarily to reduce complexity by breaking a sy ...
and
classes. Version 42 introduced units – a first-class module system – to complement classes for large scale development.
The class system gained features (e.g.
Java
Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's List ...
-style
interfaces
Interface or interfacing may refer to:
Academic journals
* Interface (journal), ''Interface'' (journal), by the Electrochemical Society
* ''Interface, Journal of Applied Linguistics'', now merged with ''ITL International Journal of Applied Lin ...
) and also lost several features (e.g.
multiple inheritance
Multiple inheritance is a feature of some object-oriented computer programming languages in which an object or class can inherit features from more than one parent object or parent class. It is distinct from single inheritance, where an object or ...
) throughout these versions.
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.
In particular, the module system ensures that run-time and
compile-time
In computer science, compile time (or compile-time) describes the time window during which a computer program is compiled.
The term is used as an adjective to describe concepts related to the context of program compilation, as opposed to concept ...
computation are separated to support a "tower of languages". Unlike units, these modules are not
first-class object
In programming language design, a first-class citizen (also type, object, entity, or value) in a given programming language is an entity which supports all the operations generally available to other entities. These operations typically include ...
s.
Version 300 introduced
Unicode
Unicode, formally The Unicode Standard,The formal version reference is is an information technology Technical standard, standard for the consistent character encoding, encoding, representation, and handling of Character (computing), text expre ...
support,
foreign library support, and refinements to the class system.
Later on, the 300 series improved the
performance
A performance is an act of staging or presenting a play, concert, or other form of entertainment. It is also defined as the action or process of carrying out or accomplishing an action, task, or function.
Management science
In the work place ...
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
sequence-based version numbering. Version 4.0 introduced the
#lang
shorthand to specify the language that a module is written in. Further, the revision introduced
immutable
In object-oriented and functional programming, an immutable object (unchangeable object) is an object whose state cannot be modified after it is created.Goetz et al. ''Java Concurrency in Practice''. Addison Wesley Professional, 2006, Section 3.4 ...
pairs and lists, support for fine-grained
parallelism, and a
statically-typed
In computer programming, a type system is a logical system comprising a set of rules that assigns a property called a type (computer science), type to every "term" (a word, phrase, or other set of symbols). Usually the terms are various constru ...
dialect.
On 7 June 2010, PLT Scheme was renamed Racket. The renaming coincided with the release of Version 5.0. Subsequently, the
graphical user interface
The GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, inste ...
(GUI) backend was rewritten in Racket from
C++
C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
in Version 5.1 using native
UI toolkits on all platforms.
Version 5.2 included a background
syntax checking tool, a new plotting library, a database library, and a new extended REPL.
Version 5.3 included a new submodule feature for optionally loaded modules,
new
optimization
Mathematical optimization (alternatively spelled ''optimisation'') or mathematical programming is the selection of a best element, with regard to some criterion, from some set of available alternatives. It is generally divided into two subfi ...
tools, a
JSON
JSON (JavaScript Object Notation, pronounced ; also ) is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and arrays (or other ser ...
library, and other features.
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.
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.
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
Chez Scheme is a programming language, a dialect and implementation of the language Scheme which is a type of Lisp. It uses an incremental native-code compiler to produce native binary files for the x86 (IA-32, x86-64), PowerPC, and SPARC proce ...
runtime system and supporting multiple runtime systems.
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.
On 2021 February 13, Racket 8.0 was released. Racket 8.0 marks the first release where Racket with the
Chez Scheme
Chez Scheme is a programming language, a dialect and implementation of the language Scheme which is a type of Lisp. It uses an incremental native-code compiler to produce native binary files for the x86 (IA-32, x86-64), PowerPC, and SPARC proce ...
runtime system, known as Racket CS, is the default implementation. Racket CS is faster, easier to maintain and develop, backward-compatible with existing Racket programs, and has better parallel garbage collection.
Features
Racket's core language includes
macros,
modules
Broadly speaking, modularity is the degree to which a system's components may be separated and recombined, often with the benefit of flexibility and variety in use. The concept of modularity is used primarily to reduce complexity by breaking a sy ...
,
lexical closures,
tail call
In computer science, a tail call is a subroutine call performed as the final action of a procedure. If the target of a tail is the same subroutine, the subroutine is said to be tail recursive, which is a special case of direct recursion. Tail recur ...
s,
delimited continuation In programming languages, a delimited continuation, composable continuation or partial continuation, is a "slice" of a continuation frame that has been reified into a function. Unlike regular continuations, delimited continuations return a value, a ...
s,
[ parameters (fluid variables), software contracts, ]green threads
In computer programming, a green thread is a thread that is scheduled by a runtime library or virtual machine (VM) instead of natively by the underlying operating system (OS). Green threads emulate multithreaded environments without relying on an ...
and OS threads, and more. The language also comes with primitives, such as eventspaces and custodians, which control resource management and enables the language to act like an operating system
An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs.
Time-sharing operating systems schedule tasks for efficient use of the system and may also in ...
for loading and managing other programs. Further extensions to the language are created with the powerful macro system, which together with the module system and custom parsers can control all aspects of a language. Most language constructs in Racket are implemented as macros in the base language. These include a mixin
In object-oriented programming languages, a mixin (or mix-in) is a class that contains methods for use by other classes without having to be the parent class of those other classes. How those other classes gain access to the mixin's methods depend ...
class system, a component (or module) system as expressive as opaque ascription in the ML module system, and pattern matching
In computer science, pattern matching is the act of checking a given sequence of tokens for the presence of the constituents of some pattern. In contrast to pattern recognition, the match usually has to be exact: "either it will or will not be ...
.
Further, the language features the first contract system for a higher-order programming
Higher-order programming is a style of computer programming that uses software components, like functions, modules or objects, as values. It is usually instantiated with, or borrowed from, models of computation such as lambda calculus which make h ...
language.
Racket's contract system is inspired by the Design by Contract work for Eiffel
Eiffel may refer to:
Places
* Eiffel Peak, a summit in Alberta, Canada
* Champ de Mars – Tour Eiffel station, Paris, France; a transit station
Structures
* Eiffel Tower, in Paris, France, designed by Gustave Eiffel
* Eiffel Bridge, Ungheni, M ...
and extends it to work for higher-order values such as first-class function
In computer science, a programming language is said to have first-class functions if it treats functions as first-class citizens. This means the language supports passing functions as arguments to other functions, returning them as the values from ...
s, objects, reference
Reference is a relationship between objects in which one object designates, or acts as a means by which to connect to or link to, another object. The first object in this relation is said to ''refer to'' the second object. It is called a ''name'' ...
cells, and so on. For example, an object that is checked by a contract can be ensured to make contract checks when its methods are eventually invoked.
Racket includes both bytecode
Bytecode (also called portable code or p-code) is a form of instruction set designed for efficient execution by a software interpreter. Unlike human-readable source code, bytecodes are compact numeric codes, constants, and references (norma ...
and JIT
Jit (also known as jiti, jit-jive and the Harare beat) is a style of popular Zimbabwean dance music. It features a swift rhythm played on drums and accompanied by a guitar. Jit evolved out many diverse influences, including domestic chimurenga, ...
(JIT) compilers. The bytecode compiler produces an internal bytecode format run by the Racket virtual machine
In computing, a virtual machine (VM) is the virtualization/emulation of a computer system. Virtual machines are based on computer architectures and provide functionality of a physical computer. Their implementations may involve specialized hardw ...
, and the JIT compiler translates bytecode to machine code at runtime.
Since 2004, the language has also shipped with PLaneT, a package manager that is integrated into the module system so that third-party libraries can be transparently imported and used. Also, PLaneT has a built-in versioning policy to prevent dependency hell Dependency hell is a colloquial term for the frustration of some software users who have installed software packages which have dependencies on specific versions of other software packages.
The dependency issue arises when several packages have d ...
.
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.
Integrated language extensibility and macros
The features that most clearly distinguish Racket from other languages in the Lisp family are its integrated language extensibility
Extensibility is a software engineering and systems design principle that provides for future growth. Extensibility is a measure of the ability to extend a system and the level of effort required to implement the extension. Extensions can be th ...
features that support building new domain-specific
Domain specificity is a theoretical position in cognitive science (especially modern cognitive development) that argues that many aspects of cognition are supported by specialized, presumably evolutionarily specified, learning devices. The positi ...
and general-purpose languages. Racket's extensibility features are built into the module system to allow context-sensitive and module-level control over syntax. For example, the #%app
syntactic form can be overridden to change the semantics of function application
In mathematics, function application is the act of applying a function to an argument from its domain so as to obtain the corresponding value from its range. In this sense, function application can be thought of as the opposite of function abst ...
. Similarly, the #%module-begin
form allows arbitrary static analysis of the entire module. Since any module can be used as a language, via the #lang
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 A scheme is a systematic plan for the implementation of a certain idea.
Scheme or schemer may refer to:
Arts and entertainment
* ''The Scheme'' (TV series), a BBC Scotland documentary series
* The Scheme (band), an English pop band
* ''The Schem ...
-like hygienic macro system, which provides more features than Lisp's s-expression manipulation system, Scheme 84's hygienic
Hygiene is a series of practices performed to preserve health.
According to the World Health Organization (WHO), "Hygiene refers to conditions and practices that help to maintain health and prevent the spread of diseases." Personal hygiene refer ...
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
An application programming interface (API) is a way for two or more computer programs to communicate with each other. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how t ...
(API) for compiler
In computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs that ...
extensions. Using this compiler API, programmers can add features and entire domain-specific language
A domain-specific language (DSL) is a computer language specialized to a particular application domain. This is in contrast to a general-purpose language (GPL), which is broadly applicable across domains. There are a wide variety of DSLs, ranging f ...
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 dialects
The term dialect (from Latin , , from the Ancient Greek word , 'discourse', from , 'through' and , 'I speak') can refer to either of two distinctly different types of linguistic phenomena:
One usage refers to a variety of a language that is a ...
. This includes Typed Racket, which is a gradually typed dialect of Racket that eases the migration from untyped to typed code, Lazy Racket—a dialect with lazy evaluation
In programming language theory, lazy evaluation, or call-by-need, is an evaluation strategy which delays the evaluation of an expression until its value is needed (non-strict evaluation) and which also avoids repeated evaluations (sharing).
The b ...
, and Hackett, which combines Haskell and Racket. The pedagogical programming language Pyret was originally implemented in Racket.
Other dialects include FrTime (functional reactive programming
Functional reactive programming (FRP) is a programming paradigm for reactive programming (asynchronous dataflow programming) using the building blocks of functional programming (e.g. map, reduce, filter). FRP has been used for programming graphica ...
), Scribble (documentation language), Slideshow (presentation
A presentation conveys information from a speaker to an audience. Presentations are typically demonstrations, introduction, lecture, or speech meant to inform, persuade, inspire, motivate, build goodwill, or present a new idea/product. Presenta ...
language), and several languages for education.
Racket's core distribution provides libraries to aid the development of programming languages. Such languages are not restricted to s-expression
In computer programming, an S-expression (or symbolic expression, abbreviated as sexpr or sexp) is an expression in a like-named notation for nested list (tree-structured) data. S-expressions were invented for and popularized by the programming la ...
based syntax. In addition to conventional readtable-based syntax extensions, the directive #lang
enables the invocation of arbitrary parsers, which can be implemented using the parser tools library. See Racket logic programming for an example of such a language.
Programming environment
The language platform provides a self-hosted IDE named DrRacket, a continuation-based web server
A web server is computer software and underlying hardware that accepts requests via HTTP (the network protocol created to distribute web content) or its secure variant HTTPS. A user agent, commonly a web browser or web crawler, initiate ...
, a graphical user interface
The GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, inste ...
, and other tools. As a viable scripting tool with libraries like common scripting language
A scripting language or script language is a programming language that is used to manipulate, customize, and automate the facilities of an existing system. Scripting languages are usually interpreted at runtime rather than compiled.
A scripting ...
s, it can be used for scripting the Unix shell. It can parse command line arguments
A command-line interpreter or command-line processor uses a command-line interface (CLI) to receive commands from a user in the form of lines of text. This provides a means of setting parameters for the environment, invoking executables and pro ...
and execute external tools.
DrRacket IDE
DrRacket (formerly DrScheme) is widely used among introductory computer science courses that teach Scheme or Racket and is lauded for its simplicity and appeal to beginner programmers. The IDE was originally built for use with the TeachScheme! project (now ProgramByDesign
The ProgramByDesign (formerly TeachScheme!) project is an outreach effort of the PLT research group. The goal is to train college faculty, high school teachers, and possibly even middle school teachers, in programming and computing.
History
Matt ...
), an outreach effort by Northeastern University
Northeastern University (NU) is a private university, private research university with its main campus in Boston. Established in 1898, the university offers undergraduate and graduate programs on its main campus as well as satellite campuses in ...
and a number of affiliated universities for attracting high school students to computer science courses at the college level.
The editor provides highlighting for syntax and run-time errors, parenthesis matching, a debugger
A debugger or debugging tool is a computer program used to software testing, test and debugging, debug other programs (the "target" program). The main use of a debugger is to run the target program under controlled conditions that permit the pr ...
and an algebraic stepper. Its student-friendly features include support for multiple "language levels" (Beginning Student, Intermediate Student and so on). It also has integrated library support, and sophisticated analysis
Analysis ( : analyses) is the process of breaking a complex topic or substance into smaller parts in order to gain a better understanding of it. The technique has been applied in the study of mathematics and logic since before Aristotle (38 ...
tools for advanced programmers. Further, module-oriented programming is supported with the module browser, a contour view, integrated testing
An examination (exam or evaluation) or test is an educational assessment intended to measure a test-taker's knowledge, skill, aptitude, physical fitness, or classification in many other topics (e.g., beliefs). A test may be administered verba ...
and coverage
Coverage may refer to:
Filmmaking
* Coverage (lens), the size of the image a lens can produce
* Camera coverage, the amount of footage shot and different camera setups used in filming a scene
* Script coverage, a short summary of a script, wri ...
measurements, and refactoring
In computer programming and software design, code refactoring is the process of restructuring existing computer code—changing the '' factoring''—without changing its external behavior. Refactoring is intended to improve the design, structure ...
support. It provides integrated, context-sensitive access to an extensive hyper-linked help system named "Help Desk".
DrRacket is available for Windows
Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
, macOS
macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac computers. Within the market of desktop and lapt ...
, Unix
Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and ot ...
, and Linux
Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which ...
with the X Window System
The X Window System (X11, or simply X) is a windowing system for bitmap displays, common on Unix-like operating systems.
X provides the basic framework for a GUI environment: drawing and moving windows on the display device and interacting wit ...
and programs behave similarly on all these platforms.
Code examples
Here is a trivial hello world
''Hello'' is a salutation or greeting in the English language. It is first attested in writing from 1826. Early uses
''Hello'', with that spelling, was used in publications in the U.S. as early as the 18 October 1826 edition of the ''Norwich C ...
program:
#lang racket
"Hello, World!"
Running this program produces the output:
:
Here is a slightly less trivial program:
#lang racket
(require 2htdp/image)
(let sierpinski ( 8
(if (zero? n)
(triangle 2 'solid 'red)
(let ( (sierpinski (- n 1))
(freeze (above t (beside t t))))))
This program, taken from the Racket website, draws a Sierpinski triangle, nested to depth 8.
Using the #lang
directive, a source file can be written in different dialects of Racket. Here is an example of the factorial program in Typed Racket, a statically typed
In computer programming, a type system is a logical system comprising a set of rules that assigns a property called a type to every "term" (a word, phrase, or other set of symbols). Usually the terms are various constructs of a computer progra ...
dialect of Racket:
#lang typed/racket
(: fact (Integer -> Integer))
(define (fact n)
(if (zero? n) 1 (* n (fact (- n 1)))))
Applications and practical use
Apart from having a basis in programming language theory
Programming language theory (PLT) is a branch of computer science that deals with the design, implementation, analysis, characterization, and classification of formal languages known as programming languages. Programming language theory is clos ...
, Racket was designed as a general-purpose language for production systems. Thus, the Racket distribution features an extensive library that covers systems and network programming, web development, a uniform interface to the underlying operating system, a dynamic foreign function interface
A foreign function interface (FFI) is a mechanism by which a program written in one programming language can call routines or make use of services written in another.
Naming
The term comes from the specification for Common Lisp, which explicit ...
, several flavours of regular expressions
A regular expression (shortened as regex or regexp; sometimes referred to as rational expression) is a sequence of characters that specifies a search pattern in text. Usually such patterns are used by string-searching algorithms for "find" or ...
, lexer/parser generators, logic programming
Logic programming is a programming paradigm which is largely based on formal logic. Any program written in a logic programming language is a set of sentences in logical form, expressing facts and rules about some problem domain. Major logic prog ...
, and a complete GUI
The GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, inste ...
framework.
Racket has several features useful for a commercial language, among them an ability to compile standalone executables under Windows, macOS, and Unix, a profiler and debugger
A debugger or debugging tool is a computer program used to software testing, test and debugging, debug other programs (the "target" program). The main use of a debugger is to run the target program under controlled conditions that permit the pr ...
included in the integrated development environment
An integrated development environment (IDE) is a software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of at least a source code editor, build automation tools a ...
(IDE), and a unit testing
In computer programming, unit testing is a software testing method by which individual units of source code—sets of one or more computer program modules together with associated control data, usage procedures, and operating procedures&md ...
framework.
Racket has been used for commercial projects and web applications. A notable example is the Hacker News
Hacker News (sometimes abbreviated as HN) is a social news website focusing on computer science and entrepreneurship. It is run by the investment fund and startup incubator Y Combinator. In general, content that can be submitted is defined as "any ...
website, which runs on Arc
ARC may refer to:
Business
* Aircraft Radio Corporation, a major avionics manufacturer from the 1920s to the '50s
* Airlines Reporting Corporation, an airline-owned company that provides ticket distribution, reporting, and settlement services
* ...
, which is developed in Racket. Naughty Dog
Naughty Dog, LLC (formerly JAM Software, Inc.) is an American first-party video game developer based in Santa Monica, California. Founded by Andy Gavin and Jason Rubin in 1984, the studio was acquired by Sony Computer Entertainment in 2001. Gav ...
has used it as a scripting language in several of their video games.
Racket is used to teach students algebra through game design in the Bootstrap program.
References
Further reading
* Felleisen ''et al.'', 2013.
''Realm of Racket''
No Starch Press.
* Felleisen ''et al.'', 2003. ''How to Design Programs
''How to Design Programs'' (''HtDP'') is a textbook by Matthias Felleisen, Robert Bruce Findler, Matthew Flatt, and Shriram Krishnamurthi on the systematic design of computer programs. MIT Press published the first edition in 2001, and the secon ...
''. MIT Press.
External links
*
{{DEFAULTSORT:Racket
Functional languages
Object-oriented programming languages
Extensible syntax programming languages
Scheme (programming language) implementations
Scheme (programming language) compilers
Scheme (programming language) interpreters
R6RS Scheme
Academic programming languages
Educational programming languages
Pedagogic integrated development environments
Cross-platform free software
Free compilers and interpreters
Programming languages created in 1995
Pattern matching programming languages
Articles with example Racket code
Scheme (programming language)
Software development
Language workbench
Lisp programming language family