/gir

Rust programming, in Vietnamese.

Primary LanguageRust

gỉ

Gỉ's logo

Aren't you mệt mỏi from writing Rust programs in English? Do you like saying "đù" a lot? Would you like to try something different, in an exotic and funny-sounding language? Would you want to bring some Vietnamese touch to your programs?

gỉ (Vietnamese for Rust) is here to save your day, as it allows you to write Rust programs in Vietnamese, using Vietnamese keywords, Vietnamese function names, Vietnamese idioms.

You're not from Vietnam mainland and don't feel at ease using only Vietnamese words? Don't worry! Vietnamese Rust is fully compatible with English-Rust, so you can mix both at your convenience.

Here's an example of what can be achieved with Gỉ:

trait and impl (aka tính chất và triển khai)

gỉ::gỉ! {
    dùng chuẩn::collections::ÁnhXạBăm như ÁnhXạ;

    tính_chất KhoáGiáTrị {
        hàm viết(&bản_thân, khoá: Xâu, giá_trị: Xâu);
        hàm đọc(&bản_thân, giá_trị: Xâu) -> Tuỳ<&Xâu>;
    }

    tĩnh khả_biến TỪ_ĐIỂN: Tuỳ<ÁnhXạ<Xâu, Xâu>> = Rỗng;

    cấu_trúc CụThể;

    triển_khai KhoáGiáTrị với CụThể {
        hàm viết(&bản_thân, khoá: Xâu, giá_trị: Xâu) {
            đặt tđ = nguy_hiểm {
                TỪ_ĐIỂN.đọc_hoặc_chèn_với(MặcĐịnh::mặc_định)
            };
            tđ.chèn(khoá, giá_trị);
        }
        hàm đọc(&bản_thân, khoá: Xâu) -> KếtQuả<Tuỳ<&Xâu>, Xâu> {
            nếu đặt () = nguy_hiểm { TỪ_ĐIỂN.bằng_tham_chiếu() } {
                Được(tđ.đọc(&khoá))
            } không_thì {
                InLỗi("đang lấy tđ (từ điển)".vào())
            }
        }
    }
}

Support for various ideolects

#[cho_phép(mã_không_được_chạy)]
hàm thứ_cấp() {
    đù!("ôi không"); // for the true Vietnamese experience
    trời_đất!("lỗi rồi"); // in SFW contexts
    ối!("sai ở đây"); // in SFW contexts, but shorter
}

Additionally, you can put tone diacritics the old way (Tùy) or the current standard way (Tuỳ)

Other examples

See the examples to get a rough sense of the whole syntax.

đóng góp

First of all, cám ơn nhiều for considering participating to this joke, the Vietnamese government will thank you later! Feel free to throw in a few identifiers here and there, and open a pull-request against the chính (Vietnamese for main) branch.

but why would you do zat

  • horsin around
  • playing with raw proc macros
  • making a bit of fun about programming languages that do this seriously, though I can see their utility.
  • others can do it so why not

Other languages

See the original shitpost for a more up-to-date list.

Lời cám ơn

Giấy phép

Giấy phép Công cộng Thích làm gì thì làm, the unofficial translation of the WTFPL by the me.