Commit 3f702ca4 authored by Jamie A. Jennings's avatar Jamie A. Jennings

Edits

parent c9666d54
Pipeline #51278624 passed with stage
in 1 minute and 32 seconds
......@@ -41,7 +41,7 @@ place it in double quotes, like string literals in other programs.)
* More **readable** and **maintainable** than regex
* RPL [looks like a programming language](rpl/num.rpl), with whitespace, comments, identifiers
* Built-in unit test framework (useful as regression tests when modifying patterns)
* Built-in unit test framework with `rosie test` (useful as regression tests when modifying patterns)
* Plays well with development tools (like `diff`, ci tools)
* Patterns can be (optionally) put into namespaces for easy sharing, e.g. `net` for network patterns
* Better **development experience** than regex
......@@ -53,20 +53,23 @@ place it in double quotes, like string literals in other programs.)
* Rosie produces **match output in multiple formats** including:
* Color, for human-readable use at the command line
* Plain text (full text `-o data` or list of sub-matches `-o subs`) for scripting
* JSON for post-processing by other programs
* JSON to use as input to other programs
* Native data structures in Python, Haskell, Go, etc.
* RPL is a **Parsing Expression Grammar** (PEG) language
* A superset of regular expressions, i.e. more powerful
* This formalism is a coherent and even elegant alternative to the ad hoc
extensions to regular expressions found in most "regex" libraries.
* Allows recursive grammars, so RPL can recognize recursively defined
structures like [JSON](rpl/json.rpl)
* This formalism is an elegant alternative to the ad hoc
extensions to regular expressions found in most "regex" libraries
* Supports linear run-time (in the input size) for common use cases
## Features
- Reasonably small:
* The Rosie compiler/runtime/libraries take up less than 2MB on disk.
<!-- du -ch /usr/local/lib/librosie.a /usr/local/bin/rosie /usr/local/lib/rosie/lib /usr/local/lib/rosie/rpl -->
* The Rosie compiler/runtime/libraries take up less than 2MB on disk. <!--
du -ch /usr/local/lib/librosie.a /usr/local/bin/rosie /usr/local/lib/rosie/lib /usr/local/lib/rosie/rpl
-->
* See a [discussion of Rosie performance](doc/performance.md).
- Reasonably good performance:
* Faster than [Grok](https://www.elastic.co/guide/en/logstash/current/plugins-filters-grok.html)
......@@ -106,7 +109,7 @@ Platforms: (most of these were tested with docker)
### Local installation
To install Rosie, clone this repository and `cd rosie-pattern-language` (the
_build directory_). Then `make`.
_build directory_). Then run `make`.
If the build succeeds, you will see a message like this:
......@@ -120,7 +123,7 @@ Rosie Pattern Engine 1.1.0 built successfully!
If the build fails, you probably need to install one of the dependencies listed
above, using a package management command like `apt-get`, `dnf install`, or
`brew install`.
`brew install`. More information on building Rosie are [here](doc/deployment.md).
After a successful build, you can run the Rosie CLI from the build directory
with `bin/rosie`. Try the example suggested in the build message:
......@@ -188,9 +191,6 @@ Rosie on IBM developerWorks Open: _(N.B. Examples may be out of date.)_
For an introduction to Rosie and explanations of the key concepts, see
[Rosie's _raison d'etre_](doc/raisondetre.md).
Rosie's internal components, as well as the utilities needed to build Rosie are
listed [here](doc/deployment.md).
I wrote some [notes](doc/geek.md) on Rosie's design and theoretical foundation
for my fellow PL and CS enthusiasts.
......@@ -234,21 +234,16 @@ packages.
Of course, you can also publish your own RPL patterns, hosted wherever you keep
other code online. In that case, let us know about it and we'll link to it!
### Calling Rosie from Go, Python, node.js, Ruby, Java, or ...? <a name="api-help"></a>
Rosie is available as a [C library](src/librosie/librosie.c) that is callable from these
languages. There are sample programs in [C](src/librosie/C) and
[Python](src/librosie/python) and [go](src/librosie/go).
These samples have simple interfaces to librosie, which could be improved.
If you're a Python hacker, we could use your help turning our
sample `librosie` client into a Python module. Same for the other languages.
### Calling Rosie from Go, C, Python, Haskell, ... <a name="api-help"></a>
And since `librosie` is built on [libffi](https://sourceware.org/libffi/), it's pretty easy to access Rosie from
other languages. This is another great way to make a contribution to the
project.
Rosie is available as a [C library](src/librosie/librosie.c) that is compiled
both as a static and dynamic (shared) library. An assortment of interface
libraries (or "clients") are hosted in
[their own repositories](https://gitlab.com/rosie-community/clients/). We are
eager to get pull requests for improvements (some of the clients are first
drafts) and for interfaces to other languages.
Important note: Before Rosie v1.0, we had sample interfaces to node.js and Ruby.
Before Rosie v1.0, we had sample interfaces to node.js and Ruby as well.
These have not been updated, and there were many changes to `librosie` when v1.0
was released. But we are confident that interfaces to those languages can be
created in a reasonably straightforward way. Please open an issue to request a
......@@ -257,7 +252,7 @@ particular language interface or to offer to work on one!
### Wanted: RPL tools
Because RPL is designed like a programming language (and it has an accessible
parser, [rpl_1_1.rpl](rpl/rosie/rpl_1_1.rpl), new tools are relatively easy to
parser, [rpl_1_2.rpl](rpl/rosie/rpl_1_2.rpl), new tools are relatively easy to
write. Here are some ideas:
- **Package doc:** Given a package name, display the exported pattern names
......
## Examples
### At the command line
## At the command line
The Rosie project provides a CLI (like Unix `grep`) and a library, `librosie`,
that can be used within programs written in Python, Go, Haskell, C, and other
......@@ -70,7 +68,7 @@ identifier; Yellow: word
</blockquote>
### In the Rosie REPL
## In the Rosie REPL
The Rosie command line program includes a REPL (Read-Eval-Print-Loop) that can
be useful for interactive pattern development and testing. You can inspect
......@@ -81,7 +79,7 @@ patterns, define patterns, and test them.
See the [REPL documentation](../../doc/repl.md) for more.
### From within programs
## From within programs
Starting with version 1.1.0, the interface libraries for `librosie` have their
own repositories in the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment