Aren't you เหนื่อย 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 Thai touch to your programs?
sanim (Thai for Rust) is here to save your day! as it allows you to write Rust programs in Thai, using Thai keywords, Thai function names, and Thai idioms. Even the great leader Plaek Pibulsonggram himself would be proud of you for writing in such a civilized language!
Here's an example on what can be achieved with Sanim:
#[ย่อย(ดีบัก)]
สาธารณะ แจกแจง เพศ {
ชาย,
หญิง,
}
#[ย่อย(ดีบัก)]
สธณ ชุดข้อมูล บุคคล {
สธณ ชื่อ: สตริง, // shorthand for pub
สธณ อายุ: จำนวนเต็ม,
สธณ เพศ: เพศ,
}
ลักษณะ มนุษย์ {
ฟังก์ชัน เดิน(&ตน) {
พิมพ์!("กำลังเดิน");
}
ฟังก์ชัน พูด(&ตน) {
พิมพ์!("สวัสดี");
}
ฟังก์ชัน เล่น(&ตน);
}
วิธี มนุษย์ สำหรับ บุคคล {
ฟังก์ชัน เล่น(&ตน) {
พิมพ์!("เล่นเกมส์");
}
}
(Thai does not have regional swear words)
#[อนุญาต(โค้ดเข้าถึงไม่ได้)]
ฟังก์ชัน บัก(&ตน) {
ปัญหา!("หาสตริงไม่เจอ"); // the proper way to say "panic!"
อ้าว!("งงดิ"); // the polite way
ชิบหาย!("ไรวะ"); // when you're doing this for the 1000th time
ไอ้เหี้ย!("ควย"); // when you're using unsafe code and it causes a memory leak
กรรม!("ไม่น่าเลย"); // when you managed to create a footgun for yourself
}
See the examples to get a rough sense of the whole thing.
First of all, Thank you for participating in this one big joke. The Thai Government will probably promote this on national news as a "user friendly" way to learn programming. Feel free to throw in a few identifiers here and there, and make a PR against the หลัก
(Thai for main
) branch.
- The French did it, so why can't we?
- proc macros are very fun
- French: rouille
- Dutch: roest
- German: rost
- Polish: rdza
- Italian: ruggine
- Russian: ржавчина
- Esperanto: rustteksto
- Hindi: zung
- Hungarian: rozsda
- Chinese: xiu (锈)
- Spanish: rustico
- Korean: Nok (녹)
- Finnish: ruoste
- Arabic: sada
- Turkish: pas
- Vietnamese: gỉ
- Japanese: sabi (錆)
- Danish: rust?
- Marathi: gan̄ja
- Romanian: rugină
- Czech: rez
- Ukrainian: irzha
- Bulgarian: ryzhda
- Slovak: hrdza
- Catalan: rovell
- Corsican: rughjina
- Indonesian: karat
- Lithuanian: rūdys
- Greek: skouriasmeno
Big thanks to rouille for making me realize this was actually possible somehow. I remember seeing ruggine somewhere but I couldn't remember where the create is.
WTFPL 1.0, because the Author is Thai. Also translated into Thai.