Skip to content

Commit

Permalink
Update change log.
Browse files Browse the repository at this point in the history
  • Loading branch information
pqwy committed Oct 31, 2017
1 parent d66071b commit 73a5459
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 47 deletions.
43 changes: 26 additions & 17 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
## v0.2.0 (trunk):
## v0.2.0 (2017-10-31)

Breaking changes:
* Switch over to `Uchar.t`
* Rename input `#key` to `#special`
* Separate ASCII from general Unicode input
* Move the cursor origin from (1, 1) to (0, 0)
* Replace `I.tile` with more general `I.tabulate`
* All-around speed and memory improvements.
* Draw over lines cell-by-cell instead of using erase-and-skip.
Slower, but flicker-free drawing.
* `Term.create`: optionally inhibit synthetic TTY signals.
* Cursor origin moved from `(1, 1)` to `(0, 0)`. **breaking**
* `#key` renamed to `#special`. **breaking**
* Added `Term.fds` to get connected file descriptors.
* Added `A.equal` and `I.equal`.
* Switched over to `Uchar.t`. **breaking**
* Separated ASCII from the rest of Unicode input. **breaking**
* Added image pretty-printer `I.pp`.
* Added `notty.top` for use in the toplevel.
* Removed `I.tile`. **breaking**
* Added `I.tabulate`, generalizing `I.tile`.
* Added support for 24-bit color.
* Added `Notty_*.show_cursor` and `Notty_*.move_cursor` for manual cursor
positioning in inline mode.
* Removed `output_image_endline`. Can be replaced by `eol`. **breaking**
* `Notty_*.output_image` lost the `~clear` parameter. Can be replaced in various
ways by cursor positioning.
* `Notty_unix.output_image ~chan` renamed to `~fd`. **breaking**
* Added support for bracketed paste.
* More example programs.

Other changes:
* More examples
* Reduced memory pressure
* Lines are now completely redrawn; reduces blinking
* Option to inhibit synthetic TTY signals on term creation
* Query a terminal for file descriptors it is connected to
* Add attr and image equality

## v0.1.1 (2016-02-09):
## v0.1.1 (2016-02-09)
* `Term.input` -> `Term.event`
* Option to redraw the line

## v0.1.0 (2016-02-09):
## v0.1.0 (2016-02-09)
* Initial release
57 changes: 27 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,63 @@
![demo]
<a href="https://asciinema.org/a/ZIXzn2ZmIxK39qoT3eJla5OyO" alt="dumper"><img src="https://asciinema.org/a/ZIXzn2ZmIxK39qoT3eJla5OyO.png" width="400"/></a>
<a href="https://asciinema.org/a/TsIhDJv5S00AB2biVmhHRzZ8I" alt="input"><img src="https://asciinema.org/a/TsIhDJv5S00AB2biVmhHRzZ8I.png" width="400"/></a>
<a href="https://asciinema.org/a/z1Pc0Mppg2JFzteZzdeigLwYc" alt="microdots"><img src="https://asciinema.org/a/z1Pc0Mppg2JFzteZzdeigLwYc.png" width="400"/></a>
<a href="https://asciinema.org/a/NgpF9Im8qfUICC39GDDAe9Ede" alt="rain"><img src="https://asciinema.org/a/R94gnHTQhCFJAsWpRfVlZWcUB.png" width="400"/></a>

# Notty

**Notty** is a declarative terminal library for OCaml structured around a notion
Notty is a declarative terminal library for OCaml structured around a notion
of composable images. It tries to abstract away the basic terminal programming
model, and provide one that is simpler and more expressive.
model, providing a simpler and more expressive one.

The core layout engine and IO codecs are pure platform-independent OCaml.
Distribution includes modules with input and output facilities for Unix, and Lwt
on Unix.

As an attempt to redefine terminal programming, **Notty** has to be
"opinionated". It assumes Unicode throughout, does not have universal support
As an attempt to redefine terminal programming, Notty has to be
_opinionated_. It assumes Unicode throughout, does not have universal support
for various terminals out there, and has a peculiar programming and rendering
model.

Notty's core API was heavily influenced by Haskell's [Vty][vty].

## Where to start

Check out the [documentation], [examples], or peek directly into the [interface]
file.

**Notty**'s core API was heavily influenced by Haskell's [Vty][vty].
Building with `pkg/pkg.ml build --with-lwt true --examples true` will produce
several little example programs that also double as tests.

```OCaml
(* Game of Life with ZX Spectrum kitsch. *)
let dot = I.uchar A.(fg lightred) 0x25cf 1 1
let dot : image = I.uchar A.(fg lightred) (Uchar.of_int 0x25cf) 1 1
let background step (n, m) =
let k = int_of_float @@ (sin (float (step + m + n) /. 10.)) *. 24. in
let k = 24. *. sin (float (step + m + n) /. 10.) |> truncate in
if k > 0 then I.char A.(fg (gray k)) '.' 1 1 else I.void 1 1
let render (w, h) step life =
let render (w, h) step life : image =
I.tabulate w (h - 1) @@ fun x y ->
let pt = (x, y) in
if CSet.mem pt life then
dot
else background step pt
if CSet.mem pt life then dot else background step pt
```

Building with `./pkg/pkg.ml build --with-lwt true --examples true` will produce
several little example programs that also double as tests.

[documentation]: https://pqwy.github.io/notty
[documentation]: https://pqwy.github.io/notty/doc
[examples]: http://pqwy.github.io/notty/Notty.html#examples
[interface]: https://github.com/pqwy/notty/blob/master/src/notty.mli
[vty]: https://hackage.haskell.org/package/vty
[demo]: https://raw.githubusercontent.com/pqwy/notty/blob/images/demo.gif

## Why?

**Q:**
**_Notty?_**

**A:**
Terminals are tedious to program for. Notty tries to abstract the tedium away,
leaving you with a more pleasant programming surface that's quite unlike a TTY.
Hence, **No-TTY**.

**Q:**
Why make yet another terminal library?

**A:**
Because:
- _Notty?_

Terminals are tedious to program for. Notty tries to abstract the tedium away,
leaving you with a more pleasant programming surface that's quite unlike a TTY.
Hence, _No-TTY_.
- Why make yet another terminal library?

Because:
* It allows one to *describe* what should be seen, as opposed to *commanding*
a terminal.
* It's pretty compact. Both bells and whistles can be implemented separately.
Expand Down
1 change: 1 addition & 0 deletions opam
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ opam-version: "1.2"
homepage: "https://github.com/pqwy/notty"
dev-repo: "https://github.com/pqwy/notty.git"
bug-reports: "https://github.com/pqwy/notty/issues"
doc: "http://pqwy.github.io/notty/doc"
author: "David Kaloper <[email protected]>"
maintainer: "David Kaloper <[email protected]>"
license: "ISC"
Expand Down

0 comments on commit 73a5459

Please sign in to comment.