📗
Windows 96 Developer Documentation
  • Welcome
  • information
    • Important notes
      • Prerequisites
      • Best practices
      • Deprecated APIs
    • API typings
  • Getting Started
    • Creating your first app
    • Some examples
      • 1. A very basic app
  • API USAGE
    • GUI
      • Creating a window
  • API
    • File System
  • WRT
    • Introduction
    • The module system
    • API reference
      • WRTEnvEnum
      • WRTParameters
Powered by GitBook
On this page
  • How is WRT different from eval based execution?
  • Aliased functions and objects
  • To WRT or not to WRT?

Was this helpful?

  1. WRT

Introduction

An introduction to WRT, what it is, and how it works.

PreviousFile SystemNextThe module system

Last updated 3 years ago

Was this helpful?

WRT (which stands for Windows 96 RunTime) is the JavaScript execution environment for Windows 96 scripts. All script files are ran under WRT unless explicitly told not to do so.

If this sounds confusing, there is no need to panic - its all seamless and completely transparent to the user.

How is WRT different from eval based execution?

Scripts running under WRT are:

  • ran in their own scope to prevent global namespace pollution

  • designed to efficiently handle resources such as Blobs when the correct paradigm is used.

  • able to create dependencies using await include("my_script.js"), which follows the CommonJS format with some twists.

  • able to identify the environment from which they are executed (terminal, GUI, etc.)

  • asynchronous by default

Aliased functions and objects

WRT aliases the most common functions/objects in Windows 96 but also aliases functions/objects available to a script running under WRT. These are:

  • FS - an alias for w96.FS, the object used to interact with the file system.

  • FSUtil - an alias for w96.FSUtil, an object used to store file system utility functions.

  • env - an alias for current.env.

  • WApplication - an alias for w96.WApplication, a class used to write structured applications.

  • StandardWindow - an alias for w96.StandardWindow, a class used to construct GUI windows.

  • registerApp - an alias for w96.sys.reg.registerApp, a function used to register applications.

  • deregisterApp - an alias for w96.sys.reg.deregisterApp, a function used to deregister applications.

To WRT or not to WRT?

That depends on your use case.

If you're creating an application or some kind of library, you should be using WRT. The overhead is minimal and it provides a lot back for the developer (e.g. automatic handling of scope, dependencies, as mentioned before).

If you wish to have more control or simply don't want the additional features, you may want to use an eval based script.

current - the that were used to start the script.

WRTParameters
The logo used for WRT, derived from the JavaScript logo