Skip to content

Commit

Permalink
docs: update pointfree readme's
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Mar 31, 2018
1 parent 32e2da0 commit 9e43405
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
6 changes: 4 additions & 2 deletions packages/pointfree-lang/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ import * as pf from "@thi.ng/pointfree-lang";
## Usage examples

```ts
import * as pf from "../src";

// DSL source code (syntax described further below)

const src = `
Expand Down Expand Up @@ -131,9 +129,13 @@ env.height = 480;
// now actually call the `hairx` word with args pulled from env
// words prefixed w/ `@` are variable lookups
pf.run(`@mouseX @mouseY @width @height hairx`, env);
// draw line: 100,0 -> 100,480
// draw line: 0,200 -> 640,200

// or call precompiled word/function directly w/ given initial stack
pf.runWord("hairx", env, [100, 200, 640, 480]);
// draw line: 100,0 -> 100,480
// draw line: 0,200 -> 640,200
```

## Language & Syntax
Expand Down
13 changes: 11 additions & 2 deletions packages/pointfree/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

[![npm (scoped)](https://img.shields.io/npm/v/@thi.ng/pointfree.svg)](https://www.npmjs.com/package/@thi.ng/pointfree)

This project is part of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.

<!-- TOC depthFrom:2 depthTo:3 -->

- [About](#about)
Expand Down Expand Up @@ -37,9 +39,16 @@
## About

[Pointfree](https://en.wikipedia.org/wiki/Concatenative_programming_language)
functional composition via lightweight (~3KB gzipped), stack-based DSL:
functional composition via lightweight (~3KB gzipped), stack-based embedded DSL.

This module implements the language's core components in vanilla ES6 and
is perfectly usable like that. **The related [@thi.ng/pointfree-lang](https://github.com/thi-ng/umbrella/tree/master/packages/pointfree-lang)
module defines an actual language with a powerful and more concise
syntax around this module and might be better suited for some use
cases.**

Current features:

- powerful, concise syntax
- words implemented as tiny vanilla JS functions (easily extensible)
- optimized pre-composition/compilation of custom user defined words (see [comp.ts](https://github.com/thi-ng/umbrella/tree/master/packages/pointfree/src/comp.ts))
- dual stack (main & stash/scratch space)
Expand Down

0 comments on commit 9e43405

Please sign in to comment.