[1] If we allow esolangs I would proudly present Aheui (https://esolangs.org/wiki/Aheui) as a good example.
[1] If we allow esolangs I would proudly present Aheui (https://esolangs.org/wiki/Aheui) as a good example.
I tried to find an example of this and found a somewhat related article about how Japanese grammar maps nicely onto ruby: https://thoughtbot.com/blog/learning-japanese-the-rubyist-wa...
I'm not sure if that's true in this generality. After all, "agent.doSomeThingWith(object)" is not a declarative sentence, it's a command. So you'd have to look for languages where imperatives don't have subject-verb-object (as an acceptable) order.
I'm sure there exist some, but at least I would expect them to start with the agent you are commanding.
In German, the difference between the imperative "Machen Sie das!" [Do that, you (polite form of address).] and the declarative "Sie machen das." [You (polite form of address) are doing that.] is that the imperative does not put the agent first.
The du/Sie in such sentences is something that's specific to German compared to the other languages I know, which don't need (or even allow) the pronoun: "do this", "faites ça", "gjør det" are all complete sentences. In fact even in German it's specific to Sie, for while you can say "mach Du das", "mach das" is fine as well. (If you speak a different dialect from mine, you might insist on "mache" instead of "mach", but around here that ship has sailed.)
http://reganmian.net/blog/2008/11/21/chinese-python-translat...
I bet there are IoT devices out there that use it already.
For example:
#!/usr/bin/env zhpy
# 檔名: while.py
數字 = 23
運行 = 真
當 運行:
猜測 = 整數(輸入('輸入一個數字: '))
如果 猜測 == 數字:
印出 '恭喜, 你猜對了.'
運行 = 假 # 這會讓循環語句結束
假使 猜測 < 數字:
印出 '錯了, 數字再大一點.'
否則:
印出 '錯了, 數字再小一點.'
否則: 印出 '循環語句結束'
印出 '結束'which translates to:
#!/usr/bin/env python
# File name: while.twpy
number = 23
running = True
while running:
guess = int(raw_input('Enter an integer : '))
if guess == number:
print 'Congratulations, you guessed it.'
running = False # this causes the while loop to stop
elif guess < number:
print 'No, it is higher than that.'
else:
print 'No, it is lower than that.'
else:
print 'The while loop is over'
print 'Done'This is really interesting. I wonder if there are some human language with properties that would allow for programming language constructs that we don't really use today.
My linguistic skills are not good enough to really suggest an example, but considering there is a language[0] (almost) without relative directions (left and right), which is mind blowing to me, it feels like there should be something interesting out there.
언어를 배운다.
[topic omitted] Language-(object marker "를") learn-(verb conjugation "ㄴ다").
(One) learns a language.
Many syntaxes are based on easily segmented tokens, or words, so they are not a good fit for Korean and other agglutinative languages. My friend has made a programming language, Yaksok [1], specially made for Korean and solving this problem by making all invocations as a pattern, somewhat similarly to AppleScript: # - "약속" is a keyword for procedure declarations.
# - Unquoted words are formal parameters.
# - Anything quoted should occur literally, except for slashed alternations
# used for affixes varying by the preceding word.
약속 대상"을/를 배운다"
...
Of course this results in a very unconventional parser.Ooh, just thought of something interesting: I lived in Turkey for 4 months, and in Turkish, rather than using location to indicate which words modify each other, you use suffixes. (At least, as much as I could figure out in that time.) Then you can order your words for clarity and emphasis, rather than for meaning.
You could imagine doing the same thing with functions or expressions; rather than being stuck with "infix" operators, which need precedence and parentheses, or "prefix" operators forcing you to use RPN, you could order them the way you want.
So perhaps the following three expressions could all evaluate to the same thing ("a / b" in most C-based languages):
/' a' b"
/' b" a'
b" /' a'
a' /' b"
a' b" /'
The idea would be that `/` is the verb, and `'` is the suffix indicating that its two "arguments" are `'` and `"`.That sounds like an interesting concept to explore anyway.
English is one of the most strongly analytic languages (Chinese being even more extreme) - it determines word relationships and function with word order and helper words.
Whereas Standard Arabic, Ancient Latin, and Finnish are very synthetic, changing words to indicate their function and relationship to other words in the sentence. If your language has the concept of "declensions", it's probably on the synthetic end of the spectrum.
Interestingly, after observing an increase in analyticity over time in European languages, some linguists have hypothesized that analytic languages are easier for foreign speakers to learn as adults, and that this causes languages with lots of geographic spread and inter-language contact to become more and more analytic. With creole languages being of course the most striking example.
That's an interesting theory, and certainly fits with Mandarin (aka "Common Speech"); but how well does it fit with the prevalence of Greek in the ancient world, Latin during the Middle Ages, and Arabic in the Middle East and North Africa now? Those are all towards the "synthetic" scale, aren't they? Did/have those languages drift/ed to become more "analytic"?
It's a similar phenomenon to Latin, where the formal written Latin used in Europe preserved things like case endings and flexible word order, while the Vulgates that later became the Romance Languages dropped a lot of that and started relying much more heavily on word order.