language-rust alternatives and similar packages
Based on the "Language" category.
Alternatively, view language-rust alternatives based on common mentions on social networks and blogs.
-
elm-compiler
Compiler for Elm, a functional language for reliable webapps. -
purescript
A strongly-typed language that compiles to JavaScript -
stylish-haskell
Haskell code prettifier [Moved to: https://github.com/haskell/stylish-haskell] -
haskell-src-exts
Manipulating Haskell source: abstract syntax, lexer, parser, and pretty-printer -
haskell-tools-ast-fromghc
Developer tools for Haskell -
nirum
Nirum: IDL compiler and RPC/distributed object framework for microservices -
liquid-fixpoint
Horn Clause Constraint Solving for Liquid Types -
language-python
A parser for Python 2.x and 3.x written in Haskell -
elm-export
Create Elm types and JSON decoders from Haskell source. -
tal
An implementation of Typed Assembly Language (Morrisett, Walker, Crary, Glew) -
shentong
A Haskell implementation of the Shen programming language. -
camfort
Light-weight verification and transformation tools for Fortran -
language-c-quote
C/CUDA/OpenCL/Objective-C quasiquoting library. -
aterm-utils
Utility functions for working with aterms as generated by Minitermite -
language-ecmascript
Haskell library: ECMAScript parser, pretty-printer and additional tools -
ministg
Ministg is an interpreter for a high-level, small-step, operational semantics for the STG machine. -
purescript-tsd-gen
TypeScript Declaration File (.d.ts) generator for PureScript
Clean code begins in your IDE with SonarLint
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of language-rust or a related project?
README
Parser and pretty printer for Rust

language-rust
aspires to efficiently and accurately parse and pretty print the Rust language.
The underlying AST structures are also intended to be as similar as possible to the libsyntax
AST
that rustc
itself uses.
A typical use looks like:
>>> :set -XTypeApplications +t
>>> import Language.Rust.Syntax
>>> -- Sample use of the parser
>>> import Language.Rust.Parser
>>> let inp = inputStreamFromString "fn main () { println!(\"Hello world!\"); }"
inp :: InputStream
>>> let sourceFile = parse' @(SourceFile Span) inp
sourceFile :: SourceFile Span
>>> -- Sample use of the pretty printer
>>> import Language.Rust.Pretty
>>> pretty' sourceFile
fn main() {
println!("Hello world!");
}
it :: Doc b
Building
Cabal
With Cabal and GHC, run
cabal install happy --constraint 'happy >= 1.19.8'
cabal install alex
cabal configure
cabal build
Stack
With the Stack tool installed, run
stack init
stack build
The second command is responsible for pulling in all of the dependencies (including executable
tools like Alex, Happy, and GHC itself) and then compiling everything. If Stack complains
about the version of Happy installed, you can explicitly install a recent one with stack install
happy-1.19.8
.
Evolution of Rust
As Rust evolves, so will language-rust
. A best effort will be made to support unstable features
from nightly as they come out, but only compatibility with stable is guaranteed. The last component
of the version number indicates the nightly Rust compiler version against which tests were run. For
example, 0.1.0.26
is tested against rustc 1.26.0-nightly
.
Bugs
Please report any bugs to the github issue tracker.
Parser
Any difference between what is accepted by the rustc
parser and the language-rust
parser
indicates one of
- a bug in
language-rust
(this is almost always the case) - a bug in
rustc
- that there is a newer version of
rustc
which made a breaking change to this syntax
If the AST/parser of rustc
changes, the rustc-tests
test suite should start failing - it
compares the JSON AST debug output of rustc
to our parsed AST.
Pretty printer
For the pretty printer, bugs are a bit tougher to list exhaustively. Suggestions for better layout
algorithms are most welcome! The fmt-rfcs
repo is loosely used as the reference for "correct"
pretty printing.