Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

https://xkcd.com/356/

One would expect it to be possible to #define most of the keywords and functions one would need using the C or C++ preprocessor, though the actual #include and #define macros would still be in Latin script.

Unfortunately, the C standard (Annex D of http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf) does not allow runes in identifier names, but it would work for characters explicitly mentioned in the standard and supported by one's C compiler.

Here's my attempt:

    #include <stdio.h>
    
    #define _ᚠᛟᚱ for
    #define _ᛁᚠ if
    #define _ᛖᛚᛊᛖ else
    #define _ᚱᛖᛏᚢᚱᚾ return
    #define _ᛗᚨᛁᚾ main
    #define _ᛈᚱᛁᚾᛏᚠ(...) printf(__VA_ARGS__)
    #define _ᛊᛏᚱᛚᛖᚾ(...) strlen(__VA_ARGS__)
    typedef int _ᛁᚾᛏ;
    typedef char _ᚲᚺᚨᚱ;
    
    _ᛁᚾᛏ _ᛗᚨᛁᚾ(_ᛁᚾᛏ _ᚨᚱᚷᚲ, ᚲᚺᚨᚱ *_ᚨᚱᚷᛒ)
    {
        _ᛁᚾᛏ _ᛁ;
    
        _ᚠᛟᚱ(_ᛁ = 1; _ᛁ < _ᚨᚱᚷᚲ; _ᛁ++) {
            _ᛁᚠ(_ᛊᛏᚱᛚᛖᚾ(_ᚨᚱᚷᛒ[ᛁ]) & 1) {
                _ᚱᛖᛏᚢᚱᚾ("Hello, %s\n", _ᚨᚱᚷᛒ[_ᛁ]);
            } _ᛖᛚᛊᛖ {
                _ᚱᛖᛏᚢᚱᚾ("Goodbye, %s\n", _ᚨᚱᚷᛒ[_ᛁ]);
            }
        }
    
        _ᚱᛖᛏᚢᚱᚾ 0;
    }
Clang and gcc both give errors of this form:

    rune_c.c:16:2: error: non-ASCII characters are not
    allowed outside of literals and identifiers
    _ᛁᚾᛏ _ᛗᚨᛁᚾ(_ᛁᚾᛏ _ᚨᚱᚷᚲ, ᚲᚺᚨᚱ *_ᚨᚱᚷᛒ)
     ^
I used https://en.wikipedia.org/wiki/Runes#Runic_alphabets as a reference.

For other languages, one should be able to use Ruby metaprogramming to make it possible to write Ruby using nothing but runes and punctuation. One would have to define runic methods to replace the functionality def, class, module, and related keywords, but tricks like instance_eval make that possible.



It's sad that Chrome on Windows doesn't want to render those Unicode characters. The only mainstream browser that doesn't.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: