Nut - Tabbed Nu fileformat

59 views
Skip to first unread message

ksjogo

unread,
Apr 4, 2012, 11:21:42 AM4/4/12
to program...@googlegroups.com
Hi guys,
I am experimenting with a tabbed version of Nu to reduce parentheses typing work.
I think the tabbed style is great to write self-evaling data formats in it because it can be easily written and read by humans and the computer has no problem as well. Plus it allows the greatness of macros and functions reducing a lot of the parser parts.
Syntax example can be found here: https://github.com/ksjogo/nu/blob/nut/test/test_nut.nut
Working extension to Nu as well: https://github.com/ksjogo/nu/tree/nut
Has anybody done something similiar?

A bigger example might follow when I come to write a DSL for my next iOS game.

Cheers
jogo

alco

unread,
Apr 5, 2012, 1:02:36 AM4/5/12
to Programming Nu
This looks familiar http://syrup.tcr.io/

Chris Brody

unread,
Apr 4, 2012, 11:49:28 AM4/4/12
to program...@googlegroups.com
In general I do really like this. In general I like having more
indentation freedom that comes with Python or Javascript but doesn't
really matter, I would follow similar rules to writing makefiles.

Another thing I like about Python is that any statement line that has
some lines underneath, such as if or class, end with a ":". I wonder
if this could be part of a "nut" standard library, if it is ever
created. An example like your test case:

class TestNut extends NuTestCase is:
- testTimes is:
set sum 0
10 times:
lambda (i) do:
set sum (+ sum i)
assert_equal 45 sum

Readability is a winner!

Chris

> --
> You received this message because you are subscribed to the Google Groups
> "Programming Nu" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/programming-nu/-/ti34Ze31y98J.
> To post to this group, send email to program...@googlegroups.com.
> To unsubscribe from this group, send email to
> programming-n...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/programming-nu?hl=en.

ksjogo

unread,
Apr 5, 2012, 6:00:16 AM4/5/12
to program...@googlegroups.com
Interesting, have not seen syrup before, but for my taste it is already too much syntax.

Checking for colons at the end should be possible because nut is a string manipulation preparser, but the disambiguation with objc methods (double colon at end?) would cause quirks with me.

Jonathan 'Wolf' Rentzsch

unread,
Apr 22, 2012, 2:39:33 PM4/22/12
to program...@googlegroups.com
You may also be interested in reading http://www.dwheeler.com/readable/sweet-expressions.html

-jwr

> --
> You received this message because you are subscribed to the Google Groups "Programming Nu" group.

Aleksandr Skobelev

unread,
Apr 23, 2012, 1:14:22 AM4/23/12
to Programming Nu
IMHO, the style with parens looks prettier.


On Apr 22, 10:39 pm, Jonathan 'Wolf' Rentzsch <n...@redshed.net>
wrote:
> You may also be interested in readinghttp://www.dwheeler.com/readable/sweet-expressions.html
>
> -jwr
>
> On Apr 5, 2012, at 12:02 AM, alco wrote:
>
>
>
>
>
>
>
> > This looks familiarhttp://syrup.tcr.io/
Reply all
Reply to author
Forward
0 new messages