Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Fix Markdown links and trailing whitespace #51

Open
wants to merge 2 commits into
base: Agoric
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# agoric
# agoric

Repository for producing snapshot-supporting XS runtimes. See [xsnap](./xsnap).
4 changes: 2 additions & 2 deletions xsnap/documentation/xsnap-worker.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# xsnap-worker

`sources/xsnap-worker.c` contains a variant of `xsnap` which accepts execution commands over a file descriptor. It is designed to function as a "JS coprocessor", driven by a parent process (which can be written in any language). The parent does a fork+exec of `xsnap-worker`, then writes netstring-formatted commands to the child. The child executes those commands (evaluating JS or delivering the command to a handler function), possibly emitting one or more requests to the parent during execution, then finally finishes the command and writing a status to the parent (including metering information).
`sources/xsnap-worker.c` contains a variant of `xsnap` which accepts execution commands over a file descriptor. It is designed to function as a "JS coprocessor", driven by a parent process (which can be written in any language). The parent does a fork+exec of `xsnap-worker`, then writes [netstring](https://en.wikipedia.org/wiki/Netstring)-formatted commands to the child. The child executes those commands (evaluating JS or delivering the command to a handler function), possibly emitting one or more requests to the parent during execution, then finally finishes the command and writing a status to the parent (including metering information).

By default, the process starts from an empty JS environment (for now, you must install SES/`lockdown` yourself, but in the future it is likely to start from an empty SES environment). If the child is started with a `-r SNAPSHOTFILENAME` argument, it will start from a previously-written JS engine snapshot instead.
By default, the process starts from an empty JS environment (in the future it may start from an empty [hardened JavaScript](https://github.com/endojs/endo/blob/master/packages/ses/README.md) environment, but for now you must [`lockdown()`](https://github.com/endojs/endo/blob/master/packages/ses/README.md#lockdown) yourself). If the child is started with a `-r SNAPSHOTFILENAME` argument, it will start from a previously-written JS engine snapshot instead.

The launch arguments are:

Expand Down
20 changes: 9 additions & 11 deletions xsnap/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ Warning: These notes are preliminary. Omissions and errors are likely. If you en

## About

`xsnap` is a custom XS runtime that read and write XS snapshots. See [XS snapshots](./documentation/XS Snapshots.md) for details and the C programming interface. `xsnap` can create a machine from scratch or from a snapshot.
`xsnap` is a custom [Moddable XS](https://github.com/Moddable-OpenSource/moddable/blob/public/documentation/xs/XS%20Differences.md) runtime that can dump and load from [heap snapshots](./documentation/XS%20Snapshots.md).

`xsnap` also uses the metering version of XS. There are options to constraint how much computation a machine can do. See [XS metering](./documentation/XS Metering.md)
`xsnap` also uses the metering version of XS. There are options to constraint how much computation a machine can do. See [XS metering](./documentation/XS%20Metering.md).

## Additions

Expand Down Expand Up @@ -40,23 +40,23 @@ Besides ECMAScript built-ins and intrinsics, `xsnap` provides additional feature

## Build

### Linux
### Linux

cd ./makefiles/lin
make

The debug version is built in `$MODDABLE/build/bin/lin/debug`
The release version is built in `$MODDABLE/build/bin/lin/release `

### macOS
### macOS

cd ./xs/makefiles/mac
make

The debug version is built in `$MODDABLE/build/bin/mac/debug`
The release version is built in `$MODDABLE/build/bin/mac/release `

### Windows
### Windows

cd .\xs\makefiles\win
build
Expand Down Expand Up @@ -87,7 +87,7 @@ Without `-e`, `-m`, `-s`, if the extension is `.mjs`, strings are paths to modul

## Examples

Add the debug or release directory here above to your path.
Add the debug or release directory here above to your path.

### helloworld

Expand Down Expand Up @@ -139,7 +139,7 @@ Just to test how a `Proxy` instance, its target and its handler survive the snap

### modules

Use the `-m` option for modules
Use the `-m` option for modules

cd ./examples/modules
xsnap -m before.js -w snapshot.xsm
Expand All @@ -149,7 +149,7 @@ Modules imported before writing the snapshot are available after reading the sna

### metering

Use the `-l` option to limit the number of byte codes that can be executed.
Use the `-l` option to limit the number of byte codes that can be executed.

cd ./examples/metering
xsnap test.js -l 10000
Expand All @@ -174,7 +174,7 @@ There is a performance gain but a precision lost.

### metering-built-ins

Use the `-p` option to prefix `print` output with the metering index.
Use the `-p` option to prefix `print` output with the metering index.

cd ./examples/metering-built-ins
xsnap test.js -p
Expand All @@ -187,5 +187,3 @@ The tests builds, sorts and reverses an array of 100 random numbers. Observe the
[11266] reverse
[16260] 0 0.000007826369259425611
...


7 changes: 2 additions & 5 deletions xsnap/xsbug-node/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ The xsnap pipes are used to communicate with xsnap as usual. The script reads th

This module defines the xsbug `Machine` class.

The xsbug protocol uses XML so the module needs a SAX parser. A few have been tried but [Saxophone](https://github.com/matteodelabre/saxophone) was the only one that worked well.
The xsbug protocol uses XML so the module needs a SAX parser. A few have been tried but [Saxophone](https://github.com/matteodelabre/saxophone) was the only one that worked well.

The xsbug `Machine` class defines a bunch of commands and internal events. These are all the commands and events that **xsbug** uses.

Expand Down Expand Up @@ -133,7 +133,4 @@ Then instruments can be sampled at will.
xsSampleInstrumentation(machine, xsnapInstrumentCount, xsnapInstrumentValues);
#endif

Every time instruments are sampled, the xsbug `Machine` object triggers the `'instruments'` event.



Every time instruments are sampled, the xsbug `Machine` object triggers the `'instruments'` event.