about summary refs log tree commit diff
path: root/src/libsyntax/ext/pipes/mod.rs
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2013-07-31 16:10:35 -0700
committerBrian Anderson <banderson@mozilla.com>2013-08-01 12:17:32 -0700
commit4b3e766ac6a6f89430b65a5bc2f55bb29f6290ab (patch)
tree2f02d8a7f30c9998912d9278eefbc8cf3ec4ee29 /src/libsyntax/ext/pipes/mod.rs
parent7daea7c9c107238ba7bfc2e9f0e8955d42ad71ed (diff)
downloadrust-4b3e766ac6a6f89430b65a5bc2f55bb29f6290ab.tar.gz
rust-4b3e766ac6a6f89430b65a5bc2f55bb29f6290ab.zip
Remove the pipes compiler
The pipes compiler produced data types that encoded efficient and safe
bounded message passing protocols between two endpoints. It was also
capable of producing unbounded protocols.

It was useful research but was arguably done before its proper time.

I am removing it for the following reasons:

* In practice we used it only for producing the `oneshot` and `stream`
  unbounded protocols and all communication in Rust use those.
* The interface between the proto! macro and the standard library
  has a large surface area and was difficult to maintain through
  language and library changes.
* It is now written in an old dialect of Rust and generates code
  which would likely be considered non-idiomatic.
* Both the compiler and the runtime are difficult to understand,
  and likewise the relationship between the generated code and
  the library is hard to understand. Debugging is difficult.
* The new scheduler implements `stream` and `oneshot` by hand
  in a way that will be significantly easier to maintain.

This shouldn't be taken as an indication that 'channel protocols'
for Rust are not worth pursuing again in the future.
Diffstat (limited to 'src/libsyntax/ext/pipes/mod.rs')
-rw-r--r--src/libsyntax/ext/pipes/mod.rs84
1 files changed, 0 insertions, 84 deletions
diff --git a/src/libsyntax/ext/pipes/mod.rs b/src/libsyntax/ext/pipes/mod.rs
deleted file mode 100644
index b8a0da8fe8f..00000000000
--- a/src/libsyntax/ext/pipes/mod.rs
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-/*! Implementation of proto! extension.
-
-This is frequently called the pipe compiler. It handles code such as...
-
-~~~
-proto! pingpong (
-    ping: send {
-        ping -> pong
-    }
-    pong: recv {
-        pong -> ping
-    }
-)
-~~~
-
-There are several components:
-
- * The parser (libsyntax/ext/pipes/parse_proto.rs)
-   * Responsible for building an AST from a protocol specification.
-
- * The checker (libsyntax/ext/pipes/check.rs)
-   * Basic correctness checking for protocols (i.e. no undefined states, etc.)
-
- * The analyzer (libsyntax/ext/pipes/liveness.rs)
-   * Determines whether the protocol is bounded or unbounded.
-
- * The compiler (libsynatx/ext/pipes/pipec.rs)
-   * Generates a Rust AST from the protocol AST and the results of analysis.
-
-There is more documentation in each of the files referenced above.
-
-FIXME (#3072) - This is still incomplete.
-
-*/
-
-use ast;
-use codemap::span;
-use ext::base;
-use ext::base::ExtCtxt;
-use ext::pipes::parse_proto::proto_parser;
-use ext::pipes::pipec::gen_init;
-use ext::pipes::proto::visit;
-use parse::lexer::{new_tt_reader, reader};
-use parse::parser::Parser;
-
-pub mod ast_builder;
-pub mod parse_proto;
-pub mod pipec;
-pub mod proto;
-pub mod check;
-pub mod liveness;
-
-
-pub fn expand_proto(cx: @ExtCtxt, _sp: span, id: ast::ident,
-                    tt: ~[ast::token_tree]) -> base::MacResult {
-    let sess = cx.parse_sess();
-    let cfg = cx.cfg();
-    let tt_rdr = new_tt_reader(cx.parse_sess().span_diagnostic,
-                               None,
-                               tt.clone());
-    let rdr = tt_rdr as @reader;
-    let rust_parser = Parser(sess, cfg, rdr.dup());
-
-    let proto = rust_parser.parse_proto(cx.str_of(id));
-
-    // check for errors
-    visit(proto, cx);
-
-    // do analysis
-    liveness::analyze(proto, cx);
-
-    // compile
-    base::MRItem(proto.compile(cx))
-}