Jump to content

Someone asked me this question today, and I wasn't 100% sure. Does languages like c#, java, javascript, or python support syntax outside of English? Like there is such a thing right? Or do they have to program in the English syntax. I know I've seen python code were the syntax was in English put the declarations and comments were in spanish. 

Link to comment
https://linustechtips.com/topic/809295-programming-in-different-languages/
Share on other sites

Link to post
Share on other sites

keywords are fixed and must be in whatever language they were defined in (so you cannot type in "función" for "function" in JavaScript if you want to do Spanish or "si" for "if" if you want to do French). However, symbol names can be whatever you want as long as the compiler has support for that character encoding.

Link to post
Share on other sites

Actually I take my post back.

 

It's possible to have the keyword be of a different language if the compiler knows about it because on the scanning pass, it is looking for keywords, and those keywords can be anything.

 

It's probably never done though because it would create confusion and keeping it in its original implementation is best for international collaboration.

Link to post
Share on other sites

54 minutes ago, jman629 said:

So does anyone know what programming languages exactly support multi language syntax?

https://en.wikipedia.org/wiki/Non-English-based_programming_languages

 

ALGOL68 appears to be the only one that has been designed for this. Everything else was either based on the language in question only or is for educational purposes.

Link to post
Share on other sites

Some folks told me there is a variant of Cobol who is in French who exist.

 

Ok it's cobol... i won't bring back this dinosaur.

 

I don't know the reason why you do look into that, but frankly, not sure it's a good idea.

 

Despite the fact the compiler can just convert "IF" to "SI", "GOTO" to "ALLER À" and "THROW" to "JETTER" (for French again), we are missing the point there is a huge ecosystem of tools for development. Some IDEs implement a custom parser or validator to improve the quality of error detection (example: PHPStorm who use php docs and js docs to simulate a assigned type in a variable/return value and offer an auto-complete and validation who match the type, this is pretty brilliant), or there is a lot of documentation available for the programming language, where now, need to have N variants, for every language (for the docs, in addition to have the documentation translated, to have the documentation functions translated).

 

Also, since translating some programming languages to other is simply a piece of changing keywords, some languages are a huge challenge. Whats happens with language where the char change based on the previous char, like Arabic. Or what about languages where we read right to left. Suddenly, we will need to have a debugger and a grammar...

 

And I'm not talking about the limitations on the organizational side. You want to have a development made on 24hours (like with a team in Europe, in America and one in Australia/China), that will be rough. A lot of companies documents stuff in English, despite the fact the language spoken in the area/company is not English. It's could be also a brake/downside in case the company or technology is bought by an external company.

 

Tom Scott have made some YouTube videos who he explains pretty well the hell who exists on stuff regarding internalizéa, internalizata, i18n (Not sure if i can post them there). So now, add those huge challenges to the technical aspect for the syntax of the language, and you will see why there is not a lot of non-English programming languages.

 

Cheers :-)

Link to post
Share on other sites

29 minutes ago, xavsworld said:

Despite the fact the compiler can just convert "IF" to "SI", "GOTO" to "ALLER À" and "THROW" to "JETTER" (for French again), we are missing the point there is a huge ecosystem of tools for development. Some IDEs implement a custom parser or validator to improve the quality of error detection (example: PHPStorm who use php docs and js docs to simulate a assigned type in a variable/return value and offer an auto-complete and validation who match the type, this is pretty brilliant), or there is a lot of documentation available for the programming language, where now, need to have N variants, for every language (for the docs, in addition to have the documentation translated, to have the documentation functions translated).

You kind of need to have N variants anyway, just that the keywords are the only thing that's the same.

 

Now it is a problem for the compiler, because you're making a program that needs to be simple more complicated. Even if that more complicated thing is mapping keywords to the same token type.

29 minutes ago, xavsworld said:

Also, since translating some programming languages to other is simply a piece of changing keywords, some languages are a huge challenge. Whats happens with language where the char change based on the previous char, like Arabic. Or what about languages where we read right to left. Suddenly, we will need to have a debugger and a grammar...

This is handled by text parsers anyway. Text is just a number code, and all you're looking for is a specific combination of that number code. Even for languages that read RTL, all that's changed is you're adding a non-printing character somewhere to tell the text parser to print RTL. At least that's what I like to think.

 

29 minutes ago, xavsworld said:

And I'm not talking about the limitations on the organizational side. You want to have a development made on 24hours (like with a team in Europe, in America and one in Australia/China), that will be rough. A lot of companies documents stuff in English, despite the fact the language spoken in the area/company is not English. It's could be also a brake/downside in case the company or technology is bought by an external company.

Well of course, you need a lingua franca anyway if you're going international, but what about companies that are local?

 

Also the language barrier is a problem anyway even if you're stuck using the English alphabet because what's stopping a non-English speaking European company from naming their variables in their language to the best they can? For example, if I were reading the source code from a French company, they may put down "nombre_d_invites" as a variable name. I don't know what the heck that means but it's completely valid to use.

 

29 minutes ago, xavsworld said:

Tom Scott have made some YouTube videos who he explains pretty well the hell who exists on stuff regarding internalizéa, internalizata, i18n (Not sure if i can post them there). So now, add those huge challenges to the technical aspect for the syntax of the language, and you will see why there is not a lot of non-English programming languages.

I don't think language syntax has anything to do with it. C is already foreign language to most people anyway (and I mean that to English speakers). The only reason why there hasn't been a lot of non-English programming languages is simply because all of the "industry standard" ones were developed from English speaking countries and it's very hard to change the juggernauts they are.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×