Coding in other languages

I am curious about whether programming languages in non-English speaking countries such as France, Spain, and Japan have the same syntax as English programming languages?

Yeah, the syntax works the same no matter what language you speak. You can write comments in whatever language you like, but English tends to be the most common language in coding projects.

The syntax of the coding language doesn’t change. A var is a var, no matter where it’s written. Some coding languages look more like English than others. The names of variables, comments, and any text being generated can be anything you like, but very often when you look at code written commercially you’ll see that English is disproportionately used. English is currently the de facto “common language” of code, so when there is the possibility that a software project could be international the bias is toward English.

No, programming languages in non-English speaking countries typically use their own syntax due to cultural and linguistic differences. However, they may also borrow syntax from existing English programming languages. For example, some French programming languages such as OCaml are based on the syntax of the popular English language programming language, C.

Huh? OCaml uses English keywords.

The syntax is the same for a programming language no matter what part of the world it is used.

No they don’t, they generally use a common vocabualary based on a combination of

  • a constrained set of characters (ASCII) available on all computers
  • previous programming languages
  • mathematical idioms

Most newer languages support utf8 for defining names of things, often specifically so that, for example, Chinese programmers can use Chinese for naming things. But that doesn’t affect the actual syntax.

A programming language is a symbolic language: not as much as in maths, but still, that’s what it is. The fact they all use English words for the most part, that isn’t really anything but an accident of history. Like Greek letters are used all over the place in maths: doesn’t mean maths is Greek (heh), you don’t use a different maths in Germany than you would in Ghana.

OCAML is not based on C, it’s an ML family language, and there’s nothing specifically “French” about it. There’s nothing specifically “Japanese” about Ruby, or “Swedish” about Erlang, or “Brazilian” about Lua or Elixir, or “Dutch” about Python. Or for that matter there’s nothing “Greek” about Geometry, or “Arabic” about algebra.

2 Likes

“Artificial Intelligence” languages are actually just a subset of programming languages and have their own set of rules. They don’t have any relation to any natural language.

“ML” stands for “Meta Language” (not “machine learning”), it’s just a general purpose programming language invented in the 1970s, like C. It’s not something designed for artificial intelligence any more than C is.


Edit: ML languages use a type system called Hindley-Milner, that’s their main chacteristic. So Standard ML and OCaml are dialects of ML. F# (which is a direct port of OCaml, but allows interop with other Microsoft languages so isn’t quite just a dialect), Haskell, Elm, Idris are directly influenced by it and can say are ML-family languages. Swift, Kotlin, Scala take many of its ideas (Swift in particular is basically OCaml). C++, C#, Rust are even further away but also absorbed very many of its ideas.

Then C++, Java, C#, Go, Rust are C-type languages (ideas converge). Python very much is, as is PHP. Lots of languages use C-type syntax, like JavaScript, so they look similar even though they work a bit differently (Python looks the same as well except it swaps curly brackets for the whitespace). Etc etc

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.