.net 源代码(C#、VB.net)在其他(非英语)语言中是什么样子?
正如标题所说,我只是有点好奇......我看到一些欧洲开源项目发布了源代码,但它们在语法上都是相同的。中文、日文或其他更复杂的基于字符的语言又如何呢?
更新:我想这有点误导。我问的是“传统”.Net 语言,如 C#、VB.net,甚至可能是 F# 等。我现在了解到,正在创建更新的 .Net 语言,主要是为了支持非英语书面和口语,并且它们看起来与用 VB.net 和 C# 编写的类似源代码非常不同。
我会尝试给一些人投票,并将我想要的问题的答案标记为答案。
As the title says, I am just a little curious...I have seen some European open-source projects post the source, but it was all syntactically identical. What about Chinese or Japanese or other more complex character-based languages?
UPDATE: This was a little misleading I guess. I was asking about the "traditional" .Net languages like C#, VB.net, maybe even F# etc. I understand now that there are newer .Net languages that are being create primarily to support non-English written and spoken languages and that they appear very dissimilar to similar source written in VB.net and C#.
I will try to up vote a few people and mark the answer to my intended question as the answer.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
关键字是英文的,因此大多数代码在任何语言中都是相同的。有些人使用当地语言作为标识符名称,其他人也保留英语名称。
以下是使用瑞典标识符的某些代码的示例:
The keywords are in english, so most of the code is the same in any language. Some people use local languages for identifier names, others keep the names in english too.
Here's an example of how some code would look like with swedish identifiers:
当然,这取决于语言。
个别语言的语法和规则不会改变。例如,无论开发什么语言,C# 仍将使用相同的字符和关键字。但是,变量名称等可以使用(几乎)任何 unicode 字符,这意味着使用其他语言的人可以使用非英语命名。
话虽如此,没有什么可以阻止人们使用本质上不是英语的标识符来创建新的 .NET 语言 - 示例包括 Lexico 、印地语编程语言 和 Farsi.NET。
以下是 Lexico 网站 中的一些示例代码:
This, of course, depends on the language.
The individual language syntax and rules will not change. For example, C# will still use the same characters and keywords, no matter what language is being developed. However, variable names and the like are allowed to use (nearly) any unicode characters, which means people in other languages can use non-English naming.
That being said, there is nothing preventing people from making a new .NET language with identifiers that are not English in nature - Examples include Lexico, the Hindi Programming Language, and Farsi.NET.
Here's some sample code from the Lexico site:
语法相同。编程语言在语法上应该是通用的。
Syntactically identical. A programming language should be syntactically universal.