Rost – 德语 Rust 编程
Rost – Rust Programming in German

原始链接: https://github.com/michidk/rost

Rost是一个幽默的项目,允许你使用德语关键词、函数名和习语编写Rust代码,为你的编程增添一丝“德国风情”。你可以把它想象成Rust,*aber auf Deutsch*!它完全兼容普通的英文Rust,让你可以随意混合两种语言。 该项目提供了一些演示其语法的示例,鼓励贡献者趣味性地添加德语标识符并向*hauptzweig*(主分支)提交拉取请求。虽然最初由Shemnei和michidk翻译,但任何人都欢迎加入这项有趣的活动。 为什么?因为为什么不呢!拥抱*Witz*,在你的代码中添加一些*scheiße*,并*vielen Dank*感谢你考虑这项有趣的尝试!它全部采用WTFPL许可,所以尽情拥抱荒诞,贡献你的力量吧! *Gut so!*

Hacker News 最新 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 Rost – 德语 Rust 编程 (github.com/michidk) miniBill 7小时前 24 分 | 隐藏 | 过去 | 收藏 | 讨论 加入我们 6月16-17日旧金山 AI 初创公司学校! 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系我们 搜索:
相关文章
  • RustPython 2024-02-08
  • 惯用 Rust 2025-03-20
  • (评论) 2024-08-12
  • (评论) 2025-03-18
  • (评论) 2024-05-18

  • 原文

    Rust German Logo

    Aren't you müde from writing Rust programs in English? Do you like saying "scheiße" a lot? Would you like to try something different, in an exotic and funny-sounding language? Would you want to bring some German touch to your programs?

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

    You don't feel at ease using only German words? Don't worry! German 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 Rost:

    struct and impl (aka Konvention und Umsetzung)

    rost::rost! {
        benutze std::sammlungen::Wörterbuch als Wöbu;
    
        eigenschaft SchlüsselWert {
            fk schreibe(&selbst, schlsl: Zeichenkette, wert: Zeichenkette);
            fk lese(&selbst, schlsl: Zeichenkette) -> Ergebnis<Möglichkeit<&Zeichenkette>, Zeichenkette>;
        }
    
        statisch änd WÖRTERBUCH: Möglichkeit<Wöbu<Zeichenkette, Zeichenkette>> = Nichts;
    
        struktur Konkret;
    
        umstz SchlüsselWert für Konkret {
    
            fk schreibe(&selbst, schlsl: Zeichenkette, wert: Zeichenkette) {
                lass wöbu = gefährlich {
                    WÖRTERBUCH.hole_oder_füge_ein_mit(Standard::standard)
                };
                wöbu.einfügen(schlsl, wert);
            }
    
            fk lese(&selbst, schlsl: Zeichenkette) -> Ergebnis<Möglichkeit<&Zeichenkette>, Zeichenkette> {
                wenn lass Etwas(wöbu) = gefährlich { WÖRTERBUCH.als_ref() } {
                    Gut(wöbu.hole(&schlsl))
                } anderenfalls {
                    Fehler("Holt das Wörterbuch".hinein())
                }
            }
        }
    }

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

    but why would you do das?

    First of all, vielen Dank for considering participating to this joke, the German government will thank you later! Feel free to throw in a few identifiers here and there, and open a pull-request against the hauptzweig (German for main branch). The initial translation was made by Shemnei and michidk.

    WTFPL. The images do not fall under this license, see below.

    Image attributions:

    • "Brezel und Filzhut zum Oktoberfest" by Tim Reckmann | a59.de is licensed under CC BY 2.0
    • "Lederhose" is licensed under CC BY-NC-SA 4.0
    联系我们 contact @ memedata.com