Crates.io | rythonc |
lib.rs | rythonc |
version | 0.3.0 |
source | src |
created_at | 2023-10-27 08:11:15.670564 |
updated_at | 2024-05-16 01:36:30.231759 |
description | A command-line Python to Rust compiler, at this point, very incomplete. |
homepage | |
repository | https://github.com/rexlunae/rythonc.git |
max_upload_size | |
id | 1015727 |
size | 45,681 |
A compiler for Rython, a Python-like language. It can either generate Rust code, or an Abstract Syntax Tree (AST).
If you already have rust
and cargo
installed, you can just install rythonc
with cargo.
cargo install rythonc
The useage can be displayed at the command line by running rythonc -h
.
By default, the output is fairly minimal. If you would like more human-readable output, use the -p
flag.
By default, the output is printed to stdout. To save it in a file, use the -o
flag.
Usage: rythonc [OPTIONS] [INPUTS]...
Arguments:
[INPUTS]...
Options:
-o, --output <OUTPUT> The output file.
-p, --pretty Nicely format the output.
-a, --ast-only Don't actually compile, just output the ast.
-l, --log-level <LOG_LEVEL> Sets the log level. Values are: off,error,warn,info,debug,trace [default: WARN]
--log-file <LOG_FILE> Write log events to this file.
-h, --help Print help
-V, --version Print version
Under the hood, rythonc is based on the language defined by the python-ast crate. It will become more capable as the capabilities of the underlying crate improve. At this point, it is mostly a proof of concept, missing many key features.