~sircmpwn/public-inbox

2 2

re:Breaking down a small language design proposal

Details
Message ID
<qpFgk_zvVvpdseYzifbESOcdXZIoeUcVmktVpNSeMZ6nEmOIRjQwub1XY6-B9z1n3g6mQtK2E3Ai18o-kC9YcSbhwywGt3JJZxkCGwxckDI=@protonmail.com>
DKIM signature
pass
Download raw message
It seems a very bad idea to have the type after the name of a variable.
It breaks convention with natural language. In Eglish you always have
adjectives before the noun. Our brains just aren't wired to have a break
there.
Details
Message ID
<CH7RMDEPABRH.2GM6Y4V2BC1JB@eiger>
In-Reply-To
<qpFgk_zvVvpdseYzifbESOcdXZIoeUcVmktVpNSeMZ6nEmOIRjQwub1XY6-B9z1n3g6mQtK2E3Ai18o-kC9YcSbhwywGt3JJZxkCGwxckDI=@protonmail.com> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
It seems a very bad idea to have the type before the name of a variable.
It breaks convention with natural language. In Hebrew[0] you always have
adjectives after the noun. Our brains just aren't wired to have a break
there.

On a more serious note, in addition to the fact that not all natural
languages are English, putting the type first would either require
differentiating between types and expressions in the parser, which is
currently not particularly possible[1] (for the C-like syntax
`some_type foo = whatever;`) or just look pretty bad and still be
annoying to parse (for `let some_type foo = whatever;`). To top it off,
the C-like syntax wouldn't allow implicitly-typed bindings
(`let foo = whatever;`, where foo's type is the same as whatever's
type).

Oh, and if what you actually want is C-style bindings
(`char foo[10] = ...;`), those are neither fully left-to-right nor easy
to parse in complex cases. I consider xxxx's improved type syntax to be
one of its significant improvements over C.

[0]: And plenty of other natural languages, but Hebrew is the one I know
[1]: The first thing that comes to mind is (foo, bar, baz), which could
either be a tuple literal or a tuple type, and we wouldn't know until
check
Details
Message ID
<CH7NWIELIE61.16O3JP7FRPT98@ace>
In-Reply-To
<qpFgk_zvVvpdseYzifbESOcdXZIoeUcVmktVpNSeMZ6nEmOIRjQwub1XY6-B9z1n3g6mQtK2E3Ai18o-kC9YcSbhwywGt3JJZxkCGwxckDI=@protonmail.com> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
On Mon Jan 17, 2022 at 3:57 AM GMT, bibliocar wrote:
> It seems a very bad idea to have the type after the name of a variable.
> It breaks convention with natural language.
> In Eglish you always have adjectives before the noun.
> Our brains just aren't wired to have a break there.

Brains aren't wired specifically to English, even if it's the only
language you know, despite what many might think about language
learning. SOV (subject-object-verb) is the most common order amongst all
*natural languages*, btw. With a little experience, I'm sure your brain
is capable of adjusting to the syntax. In practice, it's neater anyway.
Reply to thread Export thread (mbox)