Its primary purpose and design is for embedding in other software to add scripting capability to those programs, but it can also be used as an extensible scripting language.
In contrast to other programs that are large and complex, MuJS was designed with a focus on small size, correctness, and simplicity. MuJS is written in portable C and implements ECMAScript as specified by ECMA-262.
The interface for binding with native code is designed to be as simple as possible to use and is similar to Lua. There is no need for interacting with C++ template mechanisms, worrying about marking and unmarking garbage collection roots or wrestling with obscure build systems.
Why Choose MuJS
There are several reasons to select and use MuJS.
- Portable – MuJS is written in portable C and can be built by compiling a single C file using any standard C compiler. There is no need for configuration or fancy build systems. MuJS runs on a variety of systems and platforms, including all flavors of Unix and Windows, on mobile devices (such as Android and iOS), and embedded microprocessors (such as the Beagle board and Raspberry Pi).
- Embeddable – MuJS is a simple language engine with a small footprint that you can easily embed into your application. The API is simple and well documented and allows strong integration with code written in other languages. You don’t need to work with byzantine C++ templating mechanisms, or manually manage garbage collection roots. It is easy to extend MuJS with libraries written in other languages. It is also easy to extend programs written in other languages with MuJS.
- Fast and secure – MuJS is a bytecode interpreter with a very fast mechanism to call-out to C. The default build is sandboxed with very restricted access to resources.
MuJS is developed and maintained by Artifex Software. It was originally developed for use with the MuPDF viewer, but is designed to be useful as an independent component.
The primary meeting place for the MuJS community is the #mupdf channel on irc.freenode.net.
MuJS is Copyright © 2013-2017 Artifex Software, Inc.