Re: Free word order
From: Aslan Kral (aslanski2002_at_yahoo.com)
Date: 01/24/05
- Next message: Peter T. Daniels: "Re: A new Korean-invented Chinese name for Korean city"
- Previous message: Peter T. Daniels: "Re: A new Korean-invented Chinese name for Korean city"
- In reply to: Bart Mathias: "Re: Free word order"
- Next in thread: examachine_at_gmail.com: "Re: Free word order"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 24 Jan 2005 14:18:37 +0200
"Bart Mathias" <mathias@hawaii.edu>, haber iletisinde sunlari
yazdi:04_Id.18079$IP6.13825@trnddc05...
> Wiktor S. wrote:
> >>> [...]
> >> That dash has hardly any hair on it at all!
>
> (Of course I meant that it is some of the baldestdash I've ever seen.)
>
> >> Japanese is one of a minority (but as I recall, the largest minority)
> >> of languages that are spoken frontwards.
> >
> >
> > Can you define front- and backwardness of language?
>
> If that's directed at me, yes, easy:
>
> Frontwardness of language: Going S O V.
>
> Backwardness of language: Going V O S.
>
> And a bonus. All-mixed-upness of language: Going S V O.
>
> Bart Mathias
I agree that SVO is a bit mixed-up for me as a native speaker of a SOV
language.
I would like to give some examples to clarify what I am saying and to show
that SOV fits better (at least for my examples).
Example-1: How a function call is translated to machine language by a
compiler.
The following C language statement,
x = func(arg1, arg2);
becomes more or less like the following,
push arg2
push arg1
call func (arg1 and arg2 are popped by func)
move x, result
If we call the V as function (functor) and the others (S,0) as arguments,
the translated code is very natural for a SOV-speaker.
In a SOV language by analogy, the arguments (S,0) are pushed to the stack
first and
when the V comes the action is performed.
OK I will try to support it with some more examples.
Example-2: Take the following C language statement.
x = 1 + 2 + 3;
Hmm, let's see what the compiler does to parse it.
First an x, seems like a variable but what to do with it? no idea so push it
to stack
= shows that x will be assigned a value but what is it? we don't know yet so
push it to stack
then comes 1 but is it the value to be assigned? no idea so push it to stack
then comes + a binary operator, so there going to be addition first before
the assignment but we must wait so push it stack
then comes 2, ok there is an add operation pending so perform it and push
back the result to the stack
then come + so another addition will take place but we must wait for the
other operand, so push it to stack
then comes 3, ok there is an add operation pending so perform it and push
back the result to the stack
then comes ; to signal that the assignment can be done.
Somewhat messy. It is because the compiler writer was speaking a SVO
language and he designed it his natural way.
Here is what it would look like if I were to design it as a SOV speaker (the
way more natural for me):
1 2 + 3 + x =
OK it may seem strange for a SVO-speaker, but if I, as a SOV-speaker, were
to put it into words I would follow the above sequence.
Let's see what the compiler would do in this case:
1 push it to stack
2 push it stack
then comes +, no need to push it to stack, it is a binary operator, the
operands must have already been pushed onto the stack,
so just pop 2 operands off the stack and perform an add operation then
push the result back to the stack.
then comes 3 push it to stack
then comes +, no need to push it to stack, just pop 2 operands off the stack
and perform an add, then push back the result,
then comes x, push it to stack
and finally = which shows an assignment, no need to push it to stack, just
perform the action (assign the result of additions to x).
The SOV design doesn't need to push the operators to stack and doesn't need
a terminator for the statement.
Let's also add a divide in the above example.
x = 1 + 2 + 3 / 4; ( that is 1 2 + 3 4 / + x = )
x = (1 + 2 + 3) / 4; (that is 1 2 + 3 + 4 / x = ) (doesn't need parenthesis)
As can be seen, SOV approach works better in the above examples.
- Next message: Peter T. Daniels: "Re: A new Korean-invented Chinese name for Korean city"
- Previous message: Peter T. Daniels: "Re: A new Korean-invented Chinese name for Korean city"
- In reply to: Bart Mathias: "Re: Free word order"
- Next in thread: examachine_at_gmail.com: "Re: Free word order"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|