Japanese is a head-final, strictly left branching language, as linguists might put it, which means it's structured like postfix.
This would actually let you read code strictly left-to-right (even though English speakers would be tempted to think of it as right-to-left) - when you read through functional programs, you end up reading a lot of the code right-to-left, due to function application, to see the order that code is actually executed. In postfix, the order objects/functions are written is the order they're executed.
Continuing along the lines of the post, a more Japanese programming language would also have named arguments (particles), and if it was object oriented, you wouldn't need to type 'this'/'self', since subject can be implied by context (well, it's really the direct object - the computer is the subject).
Interesting point with regards to functional programming, although it's worth pointing out that at least some functional languages have operators that allow you to do what you're describing. For instance, in F# instead of writing "f x" you can write "x |> f"
I think the brain is wired in such a way that it can handle different verb orders without reprogramming. Personally, the verb order in Japanese has never given me any trouble; combined with the way verb inflection works, I never have trouble picking out the verbs, even in the written language.
German, on the other hand, has this mechanism where verbs split and wind up with fragments stacked up the end of the sentence and that, combined with the need to master grammatical gender to answer questions like "who did what to whom?" causes me to have a much harder time parsing German, despite the use of the roman alphabet.
Cute, but the prefix notation in LISP is not purely aesthetic; it is related to the fact that lists were stored in a first-rest (car-cdr) pair structure, and thus function calls (a list including the function itself and all its arguments) could be broken into the function and its list of arguments, using mechanisms already present.
I suppose you could then define car-cdr as a last-rest pair, but there are reasons aside from linguistic ones to want the first of a list to be the prominent one.
It's fun to speculate the cultural influence on a programming language design.
There was a story Dijkstra told in his "Discipline of programming" - he gave his students a task where they had to process a set of items or something like that; and most did it in left-to-right order.
The only one to work right-to-left was Syrian or Egyptian - i.e. native Arabic speaker.
What would be interesting is if Lisp were invented by the Greeks. In Greek (I believe) there is no grammatical ordering. Each part of a sentence is declined according to what part of speech it is. So a noun is formed differently if it's an object or if it's a subject. Verbs are readily identifiable as well. So a sentence can be any of SVO SOV OSV OVS VSO VOS.
In Japanese, you can mix word order freely as well---nouns are marked with particles ("ha" = topic marker; "wo" subject; etc etc). You can think of it as the nouns being declined, but with the declensions being completely regular.
These sentnces all mean the same thing ("Jim ate an apple"):
Jim-ha ringo-wo tabeta.
Tabeta ringo-wo Jim-ha.
Ringo-wo tabeta Jim-ha.
Jim-ha tabeta ringo-wo.
Ringo-wo Jim-ha tabeta.
Tabeta Jim-ha ringo-wo.
However, putting the sentences in a non-SOV order changes which which get emphasized (the same thing happens in Latin and Greek, which were also both verb-final languages by default). The SVO form of the sentence is the most neutral, plainly informative version of the sentence.
I have no idea what this comment means and it is already the highest Google hit, with all others not making any sense. Would you please care to elaborate?
Factor really needs a book or large tutorial as it is one of the coolest languages out there but you still need to read a forth book or delve deep into the provided example problems to really get into it.
It looks a lot like Forth (a RPN language). Many years ago I worked on a hardware project to build a Forth machine specifically for running ""reversed lisp"".
Many years ago I had the luck to work on a project that involved me writing a lot of code in both Lisp and PostScript (another RPN language, although not one commonly associated with manual code generation) - there is actually quite a lot that the two environments had in common - particularly the REPL and a relatively simple set of structural abstractions.
Yes. And as an avid HP-50g user, I wouldn't have much problem switching everything I do to postfix. After you get used to it, everything is a lot easier.
It is an interesting point the author makes concerning linguistic influence on using infix notation or prefix notation. Aside from grammar, there is really no reason to do things that way.
Consider the following sentences:
"Mix 2 eggs with 1 cup flour" (prefix)
"We ate dinner" (infix)
In both cases, the first step is to fetch the operands, being 2 eggs and 1 cup flour and "we" and dinner. Only after we fetch them can we apply the operator, to mix and to eat. Both of these sentences are carried out in postfix.
That's the way cpu instructions are executed. The read stage comes before the execute stage.
There's no example the author gives that contradicts it, but it's not quite RPN. In Lisp, the + operator is variadic -- it can take any number of arguments. So in reverse-Lisp, this would be legal code:
It's worth pointing out that the default word order of English is SVO, and not VOS/VSO like the "word" order of LISP. Perhaps, John McCarthy is a native speaker of Malagasy?
Given that imperative sentences in English map onto function calls rather well, and also have an understood subject, I think Malagasy is an unnecessary assumption.
[+] [-] fogus|15 years ago|reply
[+] [-] sahillavingia|15 years ago|reply
[+] [-] T-R|15 years ago|reply
This would actually let you read code strictly left-to-right (even though English speakers would be tempted to think of it as right-to-left) - when you read through functional programs, you end up reading a lot of the code right-to-left, due to function application, to see the order that code is actually executed. In postfix, the order objects/functions are written is the order they're executed.
Continuing along the lines of the post, a more Japanese programming language would also have named arguments (particles), and if it was object oriented, you wouldn't need to type 'this'/'self', since subject can be implied by context (well, it's really the direct object - the computer is the subject).
[+] [-] overgard|15 years ago|reply
[+] [-] sjs|15 years ago|reply
[+] [-] PaulHoule|15 years ago|reply
German, on the other hand, has this mechanism where verbs split and wind up with fragments stacked up the end of the sentence and that, combined with the need to master grammatical gender to answer questions like "who did what to whom?" causes me to have a much harder time parsing German, despite the use of the roman alphabet.
[+] [-] codebaobab|15 years ago|reply
"I passed the man in the red hat by." pass-by
"I threw all of my old, useless papers out." throw-out
In the case of pass-by, we still have the verb bypass, but its meaning has drifted slightly from pass-by.
[+] [-] ihodes|15 years ago|reply
[1] http://en.wikipedia.org/wiki/Reverse_Polish_notation
[+] [-] idonthack|15 years ago|reply
[+] [-] blahedo|15 years ago|reply
I suppose you could then define car-cdr as a last-rest pair, but there are reasons aside from linguistic ones to want the first of a list to be the prominent one.
[+] [-] Miky|15 years ago|reply
[+] [-] egor83|15 years ago|reply
There was a story Dijkstra told in his "Discipline of programming" - he gave his students a task where they had to process a set of items or something like that; and most did it in left-to-right order.
The only one to work right-to-left was Syrian or Egyptian - i.e. native Arabic speaker.
[+] [-] kazuya|15 years ago|reply
http://www.scripts-lab.co.jp/mind/ver7/v7unix_download.html
Example to add 4 and 5 (from http://ja.wikipedia.org/wiki/Mind ):
[+] [-] T-R|15 years ago|reply
Now I know what language to learn once I finish reading "Real World Haskell". I was gonna go for Factor or Forth, but this absolutely wins.
[+] [-] phamilton|15 years ago|reply
[+] [-] daxelrod|15 years ago|reply
Take a look at Lingua::Romana::Perligata, a Perl module that gives Perl a latin-style grammar: http://search.cpan.org/perldoc?Lingua::Romana::Perligata
Damian Conway, its author, wrote a paper about it as well: http://www.csse.monash.edu.au/~damian/papers/HTML/Perligata....
[+] [-] angus77|15 years ago|reply
These sentnces all mean the same thing ("Jim ate an apple"): Jim-ha ringo-wo tabeta. Tabeta ringo-wo Jim-ha. Ringo-wo tabeta Jim-ha. Jim-ha tabeta ringo-wo. Ringo-wo Jim-ha tabeta. Tabeta Jim-ha ringo-wo.
However, putting the sentences in a non-SOV order changes which which get emphasized (the same thing happens in Latin and Greek, which were also both verb-final languages by default). The SVO form of the sentence is the most neutral, plainly informative version of the sentence.
[+] [-] jimfl|15 years ago|reply
[+] [-] Confusion|15 years ago|reply
[+] [-] leoc|15 years ago|reply
[+] [-] saurabh|15 years ago|reply
4 5 + 3 * print
http://factorcode.org/
Also, Factor was influenced by LISP and Forth among other languages.
[+] [-] staffandsword|15 years ago|reply
[+] [-] pschlump|15 years ago|reply
[+] [-] arethuza|15 years ago|reply
[+] [-] philh|15 years ago|reply
[+] [-] vorg|15 years ago|reply
[+] [-] angus77|15 years ago|reply
The character you picked for "hash" (井) was cute, but the actual word used in Japanese is "ハッシュ".
You're welcome.
[+] [-] kenjackson|15 years ago|reply
[+] [-] phamilton|15 years ago|reply
It is an interesting point the author makes concerning linguistic influence on using infix notation or prefix notation. Aside from grammar, there is really no reason to do things that way.
Consider the following sentences:
"Mix 2 eggs with 1 cup flour" (prefix)
"We ate dinner" (infix)
In both cases, the first step is to fetch the operands, being 2 eggs and 1 cup flour and "we" and dinner. Only after we fetch them can we apply the operator, to mix and to eat. Both of these sentences are carried out in postfix.
That's the way cpu instructions are executed. The read stage comes before the execute stage.
[+] [-] zck|15 years ago|reply
[+] [-] mixmax|15 years ago|reply
[+] [-] leoc|15 years ago|reply
[+] [-] yoshiks|15 years ago|reply
[+] [-] unknown|15 years ago|reply
[deleted]
[+] [-] Pooter|15 years ago|reply
[+] [-] Vivtek|15 years ago|reply
[+] [-] carussell|15 years ago|reply