tsmithe / anic

Automatically exported from code.google.com/p/anic
0 stars 0 forks source link

Reddit disapproves anic's syntax #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
http://www.reddit.com/r/programming/comments/anp8l/anic_faster_than_c_safer_than
_java_si
mpler_than_sh/

In summary the following potentially useful observations were made:

The use of [[ ]] around type declarations is excessive and problematic for 
eastern european 
keyboards.

I would nominate the use of ( and )

If code "a b" causes a to pipe to b, why do we need a -> operator in a block?

I would nominate that -> is redundant, and left inherently pipes into right.

If ANI is left to right, why do we allow <- operators, which are intrinsically 
right to left, in an 
inline position?

I would nominate removing this operator, as it allows and encourages writing 
code both left to 
right and right to left, which is remarkably confusing to read.  As a result, 
the sample code would 
read something akin to "10 std.gen ? {  "  This change becomes more important 
when more 
complex examples are provided.

Also, the Project Home page makes a bunch of claims that aren't backed by any 
benchmarks.  It's 
better to have benchmarks and not claim anything.

Best Regards,
Dan

Original issue reported on code.google.com by dan.from...@gmail.com on 25 Jan 2010 at 5:12

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
The problem with using () is that it creates ambiguities: saying (objName) can 
be 
interpreted as:

a) an expression referring to the value of objName (the current interpretation)
b) a cast to objName (incorrect assumnption, but the language is consistent in 
that 
anything bracketed is an expression, not a cast)
c) new instantiation of a type from a prototype

If the ambiguity between a) and c) can be resolved, then I think switching to 
another set of glyphs would be a good idea. But the [[ ]] is necessary, because 
we 
need to know we're sending to a new instance of std.gen prototype, and not the 
prototype itself.

The -> is not redundant: saying "1 x s" means "take 1, filter it through x, 
throw 
away the return value, then get the constant current value of s". If we say "1 
x -
>s", that means "take 1, filter it through x, and send the result to s". These 
are 
two different perfectly valid semantics, each of which is useful in different 
cases, 
and they need to somehow be kept separate. Maybe -> isn't the best way to do 
this, 
but it needs to be done.

The <- operator is just syntactic sugar, and indeed, the example you gave is 
almost 
valid. If you wrote it this way:

10 [[std.gen]] ? { ...

Then it would be well-formed ANI code.

The reason that <- is included is that types become much more obvious if they 
are 
right next to the = sign in binding declarations, and having something like

x = { blah blah blah ; blah blah \ blah -->; } [[std.something\]];

completely obscures the fact that x is of type std.something\, wheras if you 
wrote 
it with the <- syntax, it would be obvious.

Original comment by ultimus@gmail.com on 28 Jan 2010 at 4:32

GoogleCodeExporter commented 9 years ago

Original comment by ultimus@gmail.com on 10 Mar 2010 at 4:10