On this page:
1.1 Getting Started
1.2 Libraries Provided by this Package
1.3 Java Script Language for Dr Scheme
1.4 Design Choices
1.5 Known Limitations
1.6 Feedback and Bug Reports
1.7 Acknowledgments
1.8 History
Version: 4.1.5.3

1 JavaScript for PLT Scheme

This package is an implementation of the ECMAScript language specified by ECMA-262 Edition 3, better known as JavaScript.

1.1 Getting Started

The easiest way to get started using JavaScript for PLT Scheme is with the main module:

 (require (planet dherman/javascript:9:1))

This module provides everything in the entire package. Subsequent sections of this manual describe the functionality of the individual libraries included, which can also be required individually.

Examples:

  > (eval-script "print(40 + 2)")

  42

  > (require (planet dherman/pprint))
  > (pretty-print
     (format-term
      (parse-source-element
       "while (true) { print('break!'); break }")))

  while ((true)) {

      print("break!");

      break;

  }

1.2 Libraries Provided by this Package

This package includes:

1.3 JavaScript Language for DrScheme

Installing this PLaneT package also automatically registers a DrScheme language called JavaScript, filed under Experimental Languages. Selecting the JavaScript language from DrScheme’s Language menu allows you to create and load JavaScript programs and interact with JavaScript at the REPL.

As of version 0.17 (released as PLaneT version 8:0), JavaScript is also available as a module language. This can be used by beginning a JavaScript source file with the line:

#lang planet dherman/javascript:9:1

You can omit the PLaneT version numbers if you prefer. Programs without the version number do not need to be updated when this PLaneT package is upgraded. However, it is then the responsibility of the programmer to address any backwards-incompatible changes to the JavaScript semantics.

1.4 Design Choices

1.5 Known Limitations

Some limitations that are likely to be addressed eventually:

Some limitations that are less likely to be fixed any time soon:

1.6 Feedback and Bug Reports

Before sending feedback or bug reports, please consult the current set of registered issues. If you cannot find your issue there, feel free to file a new bug report in the online issue database.

Any other feedback may be emailed to me, Dave Herman, at dherman@ccs.neu.edu.

1.7 Acknowledgments

This package was developed by me, Dave Herman. I thank Michael Greenberg, Dave Gurnell, Leo Meyerovich, and Jay McCarthy for their helpful feedback. I also thank Richard Cobbe, Ryan Culpepper, Carl Eastlund, Matthew Flatt, and Sam Tobin-Hochstadt for helping me with my many technical questions.

1.8 History