The language of programming
temochka.com
temochka.com
xn = (A * y) * x * (1 - x)
was actually stored as: id17 = (id1 * id11) * id10 * (1 - id10)
and there was a mapping of internal IDs to visible names: id1 A
id2 B
...
id10 x
id11 y
...
id17 xn
The upshot---you could change the name of a variable anywhere in the editor and the code would still work because the "name" picked by the programmer was not the actual "name" used by the system. I often wonder if that can't even extend to keywords in a language as well, translating this [2]: medan not_done
börja
för x:= 1 till 5 gör
börja
om person^.age = 120 så
too_old(person);
om person^.age > 130 så
gåtill person_should_be_dead;
slut;
slut;
into: while not_done
begin
for x := 1 to 5 do
begin
if person^.age = 120 then
too_old(person);
if person^.age > 130 then
return person_should_be_dead;
end
end
Or heck, while we're at it: while(not_done)
{
for (x = 1 ; x <= 5 ; x++)
{
if (person->age = 120)
too_old(person);
if (person->age > 130)
return person_should_be_dead;
}
}
But I'm not holding my breath on this.[1] Yes, the company that made all the text adventure games.
#! /usr/local/bin/perl -w
use Lingua::Romana::Perligata;
adnota Illud Cribrum Eratothenis
maximum tum val inquementum tum biguttam tum stadium egresso scribe.
vestibulo perlegementum da meo maximo .
maximum tum novumversum egresso scribe.
da II tum maximum conscribementa meis listis.
dum damentum nexto listis decapitamentum fac sic
lista sic hoc tum nextum recidementum cis vannementa da listis.
next tum biguttam tum stadium tum nextum tum novumversum
scribe egresso.
cisI mean, even without the "internal IDs" you're basically talking about creating a Pascal code generator and hooking it up to an early stage in the existing Håstad compiler. A first year CS student could do that as a course project. It's not that complicated.
But there are a few reasons we don't do that.
Like the Sean Conner article argues, the specific keyword symbols we use barely matter. Sure, you can come up with pathological cases with obviously bad choices of keywords, but all reasonable choices can be learned in a matter of minutes and then you're good. As long as a for loop behaves like a for loop it really doesn't matter if we write "for", "för", "meanwhile", or "සදහා". We'll learn to recognise the symbol, whatever its etymology.
Because of the above, when we "transpile" (which is apparently what the kids call compilation these days) we tend to want to do it to a language that is sufficiencly different (i.e.not a language whose only difference is that the keywords are made up of different symbols). And when you do that, you'll get code that uses idioms from one language but syntax from the other. And in your attempt to go from 100 people being able to read your code to 100,000 people, you accidentally went to 0 people.
For example in Kannada language (or any other Dravidian language) sentence formation itself is different. In English you can read 'if' statement as a proper sentence ("If a equals to Zero") but in Kannada conjunction appear at the end, 'if' sentence is more like "a equals to zero 'then'", so these kind of changes requires non-trivial changes to programming languages. As an example I was trying to 'alias' basic functions (if, for, define... etc) to Kannada languages in Lisp (because its easy in lisp!), but these kind changes breaks "S-Expression" format due to change of the position of the function in the list.
And typing in these languages in typical US-en keyboard is whole new problem in itself!
But I believe that some problems can be expressed better in languages with different structure or at least better to its native speaker.
1. http://lispnyc.org/blog/euske/what-if-lisp-was-invented-by-t...
However, it would still be the first element of the list in the abstract data structure: i.e. the equivalent of (car '(1 1 +)) -> +. (Or, rather, of course, ((1 1 +)' car) -> +. Let's use the fantasy read syntax.)
The main point is not that + is leftmost or rightmost, but that it's at a fixed position in the data structure, and that it is the first/most accessible position.
Microsofts LINQ is a good example of this. Instead of using SQLs natural language "select foo from bar", they reversed it into "from bar select foo". Just for autocompletion to work better (you don't know which columns are available until you've selected table). This doesn't make it any harder to understand than SQL, except maybe the very first time you read a query but you'll get over it in 5 minutes.
Most programming languages also require you to write seconds(10) instead of "10 seconds". It's no major problem.
https://en.wikipedia.org/wiki/Non-English-based_programming_...
I too labor under the yoke of a foreign tongue not sung to me at my cradle.
But something to keep in mind about English is that she gives everyone a hard time. No-one gets a free pass. Absolutely no-one.
In a few months, POTUS Trump will visit the Queen of English. Fo' shizzle they too will have problems with the language. She'll have bigly problems, and he'll have all the rest.
So the thing I do is to have something worthy to say, find people who'll appreciate it, and improvise a shared tongue for that special moment.
People have always gladly met me halfway.
In English, words mean what people understand by them, not what they are suppose to mean.
The fact that we were quite poor until not that long ago might have helped to maintain those differences, since most people didn't have TVs nor could afford to move to a city to attend college. Then again, the poverty also led to major emigration from rural areas, which killed a lot of smaller communities.
A cultured speaker (he doesn't even have to be native) will recognize where other speakers are from based on either their accent or their phrasing, in most languages.
Neither 'reify' nor 'transduce' are particular to english. They're both Latin.
I'm reminded of Feynman's experiences lecturing in Brazil. He got complimented on his rapid grasp of Portuguese, when in fact he was exploiting the fact that all the big fancy Portuguese technical words were either Latin or Greek. He was perfectly able to talk about Physics, but he was unable to order himself a sandwich.
It'd be easier for a native speaker to attach a somewhat correct meaning to transduce because of familiarity with words like translate, transfer, transform, induce, reduce and deduce.
It'd be easier for a native speaker to attach a somewhat correct meaning to transduce because of familiarity with words like translate, transfer, transform, induce, reduce and deduce.
So while most people couldn't define them, they are familiar with both parts of the word and that would make it easier to remember and to understand in when seen in its context.
while it's less true for Russian, it's true to some extent because Russian and greek share many roots, especially for technical language, and loan-words are prominent features of the language.
The way that programming languages allow us to write these stories is by giving us the opportunity to name things. Naming transforms code from a dumb sequence of instructions, to something that can be understood.
I don't believe non-textual names have any place in programming. I have used Haskell and it is an unmitigated disaster.
If you are referring to the use of non-alphanumeric symbols, then I wonder whether you believe that calling the monadic bind bind instead of >>= would really make things clearer?
Sure, one of them looks like a word that already exists in English, so it might be marginally easier to remember; but it has nothing to do with the binding you do with a rope, so its familiar appearance is actually misleading.
Personally, I believe you should use names that are already part of your vocabulary (even symbolic ones like +), or combine existing vocabulary items into a description (even mixing English and symbols, as in number->string), or make up your own arbitrary words or symbols, so long as the end result is internally consistent.
And yet millions of programmers use && and not and, || and not or, { } and not begin, end, down to things like => to mean bound-closure in JS, with no issue at all.
If symbols "like in math" are OK, then math also use symbols x,y,z etc for the items in an equation/function etc, not just for the operators.
Just resist naming anything an 'entity'. ;)
Unless, of course, it has semantic meaning in your domain, such as when creating an Entity Component System.
For reading code in another language, you apply the .pot file to the code base in a separate branch and it does search and replace in the source files so you have the same code base localized (assuming utf-8 everything).
When running code with localized identifiers, any single word, underscore_connected, and CamelCase identifier is "looked up" and "symlinked" to the correct identifier in the default locale (English). Think "search and replace" at the AST level of the language.
I've proposed that languages like Golang and Swift that support unicode should go a step further, and come with a translation file for their keywords, which is then fed into the lexer/parser.
It doesn't solve the problem of an international codebase, or let you switch languages as shown in the Excel example, but it would at least make it significantly easier to learn and write code in one's native tongue.
And it could be available today, without significant changes in tooling on either the compiler vendor's side (except the translation tooling of course) or the developer's side.
So there I was struggling with my English, always being happy when there were enough technical terms which I understood. (And worst thing of all - English speaking authors dare to use puns and humour in technical books. Which I didn't understand, because of the vocabulary and because we Germans would never do anything like this, we're much too serious for that.)
A cheer or two for the humble spreadsheet - the longest lasting and most widely used end-user 'programming' metaphor I've heard of, despite the estimated 5% error rate in formulas.
A git for spreadsheets would be ace!
References from 10 years ago but enough to start chasing more recent stuff.
With standard libraries becoming more important, non-keyword terms like 'vector' and 'set' are also important, but they tend to be common across languages. Good luck renaming them on the fly without a serious refactoring tool.