Skip to content

Commit

Permalink
Update READMEs [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnoredAmbience committed Nov 17, 2016
1 parent bd2cd8e commit 94c6e97
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 7 deletions.
24 changes: 17 additions & 7 deletions README.org
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* JSExplain

To install:
#+BEGIN_SRC shell
make init
Expand All @@ -21,10 +23,18 @@ https://jscert.github.io/jsexplain/branch/master/driver.html
mljsref results are tested online and results published to:
https://psvg.doc.ic.ac.uk/ci/jscert-testing/

* JavaScript features used
- Object.assign
- No type casting
- No prototypes
- Arrays (for tuples)
- Switch on strings
- ...
** Architecture

The source code for the interpreter is primarily written in a subset of
OCaml with supporting runtime libraries written in both OCaml and JS.

The source code is located in the jsref directory. It can either be built
using the standard OCaml compiler (to produce a result we term mljsref), or
using a custom OCaml-to-JS compiler which is located in the generator
directory (we term the resulting product jsjsref).

Details about the custom compilation are provided in the generator
directory.

To simplify presentation of the code, a monadic binder syntax extension is
used. This is also described in the generator directory.
36 changes: 36 additions & 0 deletions generator/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ type 'a tree =

#+END_src

* *Records* Records are translated to objects. Record copying
`with` syntax is supported with any number of field updates.

** About the Subset of JavaScript Used
- Object.assign (ES6)
- No type casting
- No prototypes
- Arrays (for tuples)
- Switch on strings
- ...

** Notes

Historical versions of the repository required the OCaml 4.02.1 compiler
Expand All @@ -73,3 +84,28 @@ type 'a tree =
the OCaml distribution into this directory, some further configuration may
be required... Team members may find the whole historic distribution
archived in the private jscert_dev repository.

** About the Monadic Rewriter PPX
This is a OCaml AST preprocessor that converts `let%x` syntax into the
monadic binder `if_x` with the continuation as the bound expression of the
let term.

For example:
- `let%some x = expr in cont` becomes `if_some expr (fun x -> cont)`
- `let%if_spec (s,x) = expr in cont` becomes `if_spec expr (fun s x -> cont)`

The full list of available moands is provided in `monad_mapping` of
monad_ppx.ml, but is reproduced below for convenience:
- run
- string
- object
- value
- prim
- number
- some
- bool
- void
- success
- not_throw
- ter
- break

0 comments on commit 94c6e97

Please sign in to comment.