Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Nexus Programming Language

73 views
Skip to first unread message

Adam Campbell

unread,
Jun 9, 2012, 10:45:43 PM6/9/12
to
The Nexus programming language version 0.5.0 has been released. It is
an "object-oriented, dynamically-typed, reflective programming
language", drawing from Lua and Ruby. www.nexuslang.org

BartC

unread,
Jun 10, 2012, 6:22:31 AM6/10/12
to


"Adam Campbell" <abcamp...@gmail.com> wrote in message
news:5372d4ac-92a3-41ba...@p13g2000yqk.googlegroups.com...
> The Nexus programming language version 0.5.0 has been released. It is
> an "object-oriented, dynamically-typed, reflective programming
> language", drawing from Lua and Ruby. www.nexuslang.org

It seems very fussy about where the { and } go. So:

while (i<10)
{
++i
}

is a syntax error, but:

while (i<10) {
++i
}

works. Yet the former style of braces is used for method definitions. Also,
I can't write {return n} inside an if-statement, but have to split the
braces a certain way. Any special rules apply? The grammar doesn't say
anything about white-space.

(BTW the screen-shot in the Getting Started..Try Me pages suggests for-loops
are written as for (i; 1..n) instead of for (i in 1..n); it doesn't like
that..)

--
Bartc

Nomen Nescio

unread,
Jun 10, 2012, 2:46:45 PM6/10/12
to
> It seems very fussy about where the { and } go. So:

Tcl does this too. Very frustrating and seemingly pointless.

Rugxulo

unread,
Jun 11, 2012, 12:29:05 PM6/11/12
to
Hi,

On Jun 10, 1:46 pm, Nomen Nescio <nob...@dizum.com> wrote:
> > It seems very fussy about where the { and } go. So:
>
> Tcl does this too. Very frustrating and seemingly pointless.

Welcome to the bracing wars: stylistic arguments, and syntax
woes! ;-)

I know of two potential reasons for this (besides personal taste):

1). Emacs requires { } to be on separate lines in order to recognize
the functions as functions (for use with certain built-in key
bindings).

2). Google's Go used similar syntax because it wanted to avoid tons of
semicolons as statement terminators (a la BCPL ??), so some
terminators are implied "behind the scenes", hence the syntax
restriction of { on same line as function name.

(I'm probably describing it vaguely incorrectly, but you get the idea.)

Marco van de Voort

unread,
Jun 12, 2012, 10:29:23 AM6/12/12
to
On 2012-06-11, Rugxulo <rug...@gmail.com> wrote:
>> Tcl does this too. Very frustrating and seemingly pointless.
>
> Welcome to the bracing wars: stylistic arguments, and syntax
> woes! ;-)
>
> I know of two potential reasons for this (besides personal taste):
>
> 1). Emacs requires { } to be on separate lines in order to recognize
> the functions as functions (for use with certain built-in key
> bindings).

> 2). Google's Go used similar syntax because it wanted to avoid tons of
> semicolons as statement terminators (a la BCPL ??), so some
> terminators are implied "behind the scenes", hence the syntax
> restriction of { on same line as function name.

> (I'm probably describing it vaguely incorrectly, but you get the idea.)

I don't think that is true. You could use the whitespace as separator and
then define whitespace as set of [space,tab,cr,lf].

In general, I think it is simply a leftover of linebased scanning where
linefeeds had meaning. ( vs scanning of a token stream).

It might be that Emacs default parser was linebased. In the case of GO that
is less logical, since it is so new.

Faried Nawaz

unread,
Jul 15, 2012, 8:38:13 AM7/15/12
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/12/2012 07:29 PM, Marco van de Voort wrote:

> It might be that Emacs default parser was linebased. In the case of GO that
> is less logical, since it is so new.

Go didn't start off that way, but the brace change was prompted by the
implicit semicolon feature. Here's the original proposal:

https://groups.google.com/d/msg/golang-nuts/XuMrWI0Q8uk/kXcBb4W3rH8J


Faried.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlACubQACgkQWVufAqdzMWORLACdHQg56icx9LQQfEeAZpeTKfOK
KJwAnjFq1DuQvZSEGE/mWeIzNytX8vDa
=rFeR
-----END PGP SIGNATURE-----
0 new messages