Source is a family of sublanguages of
JavaScript
JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of Website, websites use JavaScript on the Client (computing), client side ...
, developed for the textbook
(SICP JS). The JavaScript sublanguages Source §1, Source §2, Source §3 and Source §4 are designed to be just expressive enough to support all examples of the respective chapter of the textbook.
Purpose and design principle
During the development of SICP JS, starting in 2008, it became clear that purpose-designed sublanguages of JavaScript would contribute to the learning experience. Initially called "JediScript" and inspired by the book "JavaScript: The Good Parts" by
Douglas Crockford, the Source sublanguages follow the chapters of SICP JS; each language Source §x is a sublanguage of the next language Source §(x+1). Following the minimalistic approach of SICP JS, implementations of Source are expected to remove any JavaScript language features that are not included in the language specification.
Features
Source §1 is a very small purely functional sublanguage of JavaScript, designed for Chapter 1 of SICP JS. Source §2 adds pairs and a list library, following the data structures theme of Chapter 2. Source §3 adds stateful constructs, and Source §4 adds support for meta-circular evaluation. Chapter 5 of SICP JS does not require language support beyond Source §4. All Source languages are
properly tail recursive, as required by Chapter 1 of
SICP and as specified by
ECMAScript
ECMAScript (; ES) is a JavaScript standard intended to ensure the interoperability of web pages across different browsers. It is standardized by Ecma International in the documenECMA-262
ECMAScript is commonly used for client-side scriptin ...
2015.
Source Academy
Since the
Safari browser
Safari is a web browser developed by Apple. It is built into macOS, iOS, and iPadOS, and uses Apple's open-source browser engine, WebKit, which was derived from KHTML.
Safari was introduced in Mac OS X Panther in January 2003. It was includ ...
is
ECMAScript
ECMAScript (; ES) is a JavaScript standard intended to ensure the interoperability of web pages across different browsers. It is standardized by Ecma International in the documenECMA-262
ECMAScript is commonly used for client-side scriptin ...
-2015-compliant, including
proper tail calls, it can serve as an implementation of all Source languages, provided that the SICP package is loaded. The Source Academy is a web-based programming environment that implements all Source languages, regardless of browser support for proper tail calls, and features various tools for the readers of SICP JS. The language implementation in the Source Academy, js-slang,
is also available as a stand-alone environment based on Node.js.
References
External links
*
{{Use dmy dates, date=August 2017
Programming languages
Scripting languages
Cross-platform free software
Cross-platform software
Dynamic programming languages
Dynamically typed programming languages
Free compilers and interpreters
Free computer libraries
Software using the Apache license