Crates.io | malbolge |
lib.rs | malbolge |
version | 1.0.1 |
source | src |
created_at | 2019-08-14 19:27:02.485897 |
updated_at | 2019-08-15 14:56:54.652437 |
description | A implementation of the Malbolge Programming Language in Rust |
homepage | |
repository | https://github.com/return/malbolge |
max_upload_size | |
id | 156853 |
size | 47,861 |
('&%:9]!}|z2Vxwv-,POqponl$Hjig%eB@@>}=<M:9wv6WsU2T|nm-,jcL(I&%$#"
|4XzyTT43Qsqq(Lnmkj"Fhg${z@>CB]V?Tx<uVtT
Rpo3NlF.Jh++FdbCBA@?]!
That right there is a Hello World in Malbolge.
What you are looking at is a language which is something worse than all languages out there. It's more esoteric than Brainfu*k and it is even harder to read and write than its friend Befunge.
Malbolge is a self-modifying programming language that is made to be deliberately difficult to program in and close to impossible to read. You could easily mistake it for a crypto-system although some researchers have made the case for it. But you probably could not have determined that this code alone prints out 'Hello!'
(=<`#9]76Z{z2V0/S-Qr*)M:,+*)('&%$#"!~}|{z(Kw%$t"Vq0iAm,,j<h'`%
Hello!
This implementation is written in pure Rust and a port from the reference C and Java implementations and is able to execute programs written in Malbolge.
This is a Malbolge implementation of the UNIX cat
program.
(=BA#9"=<;:3y7x54-21q/p-,+*)"!h%B0/.
~P<
<:(8&
66#"!~}|{zyxwvu
gJ%
There is also a macro available to pass in a raw Malbolge binary using a raw string literal.
This is the same program that prints Hello!.
malbolge!(r#"(=<`#9]76Z{z2V0/S-Qr*)M:,+*)('&%$#"!~}|{z(Kw%$t"Vq0iAm,,j<h'`%"#);
See the examples for more non-trivial malbolge programs.
Well I don't know why anyone would want to do this, but I guess you really want to know so here it goes.
It is known for years that Malbolge is close to impossible to program in. The first valid program in Malbolge was found via trial and error for 8 years with brute-force until the above 'Hello World' program was able to run.
Because I simply can and you should too.
See the examples folder for running these programs through the interpreter.
Build by using this command.
cargo build
cargo test
GPLv3+