[cfe-dev] 经过一些思考,我想,如果clang和llvm能提供多语言支持的话,必定会扩大其影响力.使计算机程序和代码世界变得更多彩更丰富和更多可能性./After some reflection, I think that if clang and llvm can provide multi-language support, it will certainly expand its influence to make computer programs and code the world more colorful and more possibilities

Renato Golin via cfe-dev cfe-dev at lists.llvm.org
Wed Oct 19 02:19:01 PDT 2016


On 4 October 2016 at 19:00, mats petersson via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Option 1 seems a little meaningless to me, as there are only a handful of
> keywords in C, and a few more in C++ to learn. Yes, there is also a large
> amount of C and C++ libraries that go together with the compiler, but these
> are not (in general) the task of Clang directly. I would also argue that
> this is NOT a good way to go. Programming is very much an international
> activity, and although there are probably more people that natively speak &
> write Chinese than any other language in the world, outside of those with
> Chinese as a native language, the Chinese language is not well known, where
> English is a reasonably workable language in many parts of the world,
> whether the native language is Chinese, German, Korean, French, Russian or
> Arabic. A program written in Chinese would be completely unreadable by me
> and I would guess about 90% of the subscribers of this mailing list.
>

Hi Matt,

I'm surprised by your comments. The concern is very real.

The reason why programming languages are written in English is not because
English is the most popular second language in the world, but because the
development of computers started in England and was popularised in the US.

This is not just about learning English to program, this is about your
native tongue, and how you write it, and how you think about it.

As Brazilian, I find programming in English reasonably simple. I write
left-to-right, I express "if" as "se" and "while" as "enquanto", and I
speak "==" as "igual". Reading C++ is very natural to me, even if it's in a
different language.

But Arabic speakers read right-to-left and their culture is different
enough that made people create Arabic programming languages [1]. It was
mostly an art project, but the concern, again, is real. People think
differently.

Most Asiatic countries have completely different writing systems, which is
not just top-down, but symbolic rather than syllabic. This is a huge shift
in understanding of the language, and it's a lot harder for native Chinese
speakers to "read" English *code*.

This puts a huge burden on non-English speakers to not only learn the
reality of computing (logic, hardware, algorithms), but another language
entirely and a special subset that only makes sense for computer
programmers. The burden is worse for the people that grew up with a
completely different communication mindset.

I think your remarks on the English language being "workable" and spoken by
90% of this mailing list were very poor, (unintentionally) bearing
prejudicial. European languages are far apart from each other, but they
have the same thinking pattern. Asian languages are much further apart from
European ones, and changing the thinking pattern is *really* hard and not
at all the same thing.



Option 2 should already work. If there is a specific issue that doesn't
> work, that should be reported as a bug.
>

The point here is to program in a way that is expressive to different
people. Using variable names in Chinese using UTF-8 is not enough.




> I would also suggest that for someone wishing to work as a software
> developer for a large international company or a company trading on the
> international market, being able to communicate in English is almost
> certainly a great benefit to the career prospects, if not fully required. I
> say this as a person whose first language is NOT English.
>

Again, I believe this response misses the point. Technology and Science are
for everyone, not only those that can easily learn a few new languages plus
a whole new field.

The dominance of English in STEM subjects is real, but that doesn't mean we
have to accept it or even think it's the only way forward. I truly believe
it isn't.


Note that there has been programming languages in "other than English", but
> they tend to not become very popular, for the reason I described above: Not
> many outside of the native language region are able to use that language.
> Yes, Chinese is a much bigger language than French of German, for example,
> but it's still not used by most other countries in general communication,
> which is the key point: software is an international business, it is an
> international community, and using one human language for communications
> with the community makes the group understand each other, re-use each
> others solutions and being able to help each other.
>

This is not about language, but about thought process.

Software is a learning tool, and as such, should be available to
*everyone*. Not only businesses.

Software re-use has nothing to do with the (programming) language you write
in, but in the well defined and documented ABIs in between.

As to the practicalities of making C++ "look" Chinese, I don't think it
will work in that way. But it should be possible to achieve a few improving
goals...

1. As Matt said, try to use Chinese characters as variable/function names
using UTF-8 and see if it helps. I'm not sure how name mangling will work,
though.

2. Try to change the Clang parser to recognise Chinese words for C++
keywords. This would be a departure from the C++ standard, no doubt, but an
interesting concept regardless.

3. Start a new front-end for LLVM, one that implements a language using the
Chinese thinking pattern and transforms into LLVM IR. If the transformation
matches well, it may make interoperability with the rest of LLVM supported
languages much easier.

cheers,
--renato

[1] https://en.wikipedia.org/wiki/Qalb_(programming_language)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20161019/ffb6e54e/attachment.html>


More information about the cfe-dev mailing list