Sebastian Fernandez | 29 Apr 00:34

Brackets for type parameters distracting

Is it just me or do other people find the brackets for type parameters ( [\ and \] ) distracting to read? I've been looking at Fortress code for a few months now and my eyes keep stopping at those brackets, interrupting my reading of the code. I'm not sure why it is, if it is the two ASCII characters, the assymetry of the slashes or maybe my Java/C++ background keeps seeing the slashes as escape characters. If these brackets were rare I wouldn't say anything, but they are used throughout library code and I suspect will see some use in user code.


If it is just me, please ignore this message. However, I wanted to see if others felt the same way.


--
Sebastian Fernandez


Sorin Miklós Zsejki | 29 Apr 01:06

Re: Brackets for type parameters distracting

They are used extensively, but I'm generally ok with them for now. I
think it will get much better when there will be IDEs with the right
rendering.

On Tue, Apr 29, 2008 at 1:34 AM, Sebastian Fernandez
<sebastian.fernandez@...> wrote:
> Is it just me or do other people find the brackets for type parameters ( [\
> and \] ) distracting to read? I've been looking at Fortress code for a few
> months now and my eyes keep stopping at those brackets, interrupting my
> reading of the code. I'm not sure why it is, if it is the two ASCII
> characters, the assymetry of the slashes or maybe my Java/C++ background
> keeps seeing the slashes as escape characters. If these brackets were rare I
> wouldn't say anything, but they are used throughout library code and I
> suspect will see some use in user code.
>
> If it is just me, please ignore this message. However, I wanted to see if
> others felt the same way.
>
>
>
> --
> Sebastian Fernandez
>
>
>

Sorin Miklós Zsejki | 29 Apr 01:19

Re: Brackets for type parameters distracting

P.S.: As I understand it, inference of static parameters, as it gets
better, will help a lot with clarity and will reduce the use of those
brackets.

On Tue, Apr 29, 2008 at 2:06 AM, Sorin Miklós Zsejki
<zsejki@...> wrote:
> They are used extensively, but I'm generally ok with them for now. I
>  think it will get much better when there will be IDEs with the right
>  rendering.
>
>
>
>  On Tue, Apr 29, 2008 at 1:34 AM, Sebastian Fernandez
>  <sebastian.fernandez@...> wrote:
>  > Is it just me or do other people find the brackets for type parameters ( [\
>  > and \] ) distracting to read? I've been looking at Fortress code for a few
>  > months now and my eyes keep stopping at those brackets, interrupting my
>  > reading of the code. I'm not sure why it is, if it is the two ASCII
>  > characters, the assymetry of the slashes or maybe my Java/C++ background
>  > keeps seeing the slashes as escape characters. If these brackets were rare I
>  > wouldn't say anything, but they are used throughout library code and I
>  > suspect will see some use in user code.
>  >
>  > If it is just me, please ignore this message. However, I wanted to see if
>  > others felt the same way.
>  >
>  >
>  >
>  > --
>  > Sebastian Fernandez
>  >
>  >
>  >
>

Hezekiah M. Carty | 29 Apr 04:02

Re: Brackets for type parameters distracting

Sebastian Fernandez <sebastian.fernandez@...> writes:
> Is it just me or do other people find the brackets for type parameters
> ( [\ and \] ) distracting to read?

I have the same complaint.  I understand that proper rendering is a big part of
Fortress, but I think the ASCII in this case makes the code harder to read than
it should be.

Hez

Brandon Streiff | 29 Apr 04:45

Re: Brackets for type parameters distracting

Hezekiah M. Carty wrote:
> Sebastian Fernandez <sebastian.fernandez@...> writes:
>> Is it just me or do other people find the brackets for type parameters
>> ( [\ and \] ) distracting to read?
> 
> I have the same complaint.  I understand that proper rendering is a big part of
> Fortress, but I think the ASCII in this case makes the code harder to read than
> it should be.
> 
> Hez

I didn't find them too bad, though it took some doing to train myself to 
not do \[ \].

Also, once static-checking happens, it shouldn't be necessary to specify 
them all over the place-- I do agree that it is a bit unwieldy to 
specify the type parameters for methods like List.zip.

-- brandon

Eric Allen | 30 Apr 04:26
Favicon

Re: Brackets for type parameters distracting

On Apr 28, 2008, at 9:02 PM, Hezekiah M. Carty wrote:

> Sebastian Fernandez <sebastian.fernandez@...> writes:
>> Is it just me or do other people find the brackets for type  
>> parameters
>> ( [\ and \] ) distracting to read?
>
> I have the same complaint.  I understand that proper rendering is a  
> big part of
> Fortress, but I think the ASCII in this case makes the code harder  
> to read than
> it should be.

I strongly agree. I think it's fair to say that nobody actually likes  
[\ and \]. I, and others, have often brought up the idea of replacing  
them, but there are some technical issues to work out and it's  
difficult to come up with a design that is universally considered to  
be better.

The natural ASCII for white Oxford brackets is [[ and ]]. Guy has  
pointed out that there are two problems with this ASCII: (1) it  
interferes with subscripting expressions where the subscript happens  
to be an array aggregate:

A[[1 2 3]]

We could require spaces (or parentheses) between the brackets in such  
cases:

A[ [1 2 3] ]

or

A[([1 2 3])]

I'd be interested in knowing what others think of such a requirement.

Another, less serious, problem is that it interferes with the use of  
an array reference as a subscript, as in X[A[3]]. But there are known  
ways of dealing with this second issue. We could fix things in a  
manner similar to the way that Java manages to make types such as  
List<Vector<String>> parse correctly despite the fact that ">>"  
tokenizes as the right-shift operator.

Comments? On balance, I guess I'd prefer to simply use [[ and ]] as  
ASCII for white square brackets and require spaces or parentheses for  
indexing of arrays with array aggregate expressions (and to use the  
standard kludge to deal with X[A[3]]).

-- Eric

Akhilesh Mritunjai | 30 Apr 10:24

Re: Brackets for type parameters distracting



On Wed, Apr 30, 2008 at 7:56 AM, Eric Allen <Eric.Allen-xsfywfwIY+M@public.gmane.org> wrote:

Comments? On balance, I guess I'd prefer to simply use [[ and ]] as ASCII for white square brackets and require spaces or parentheses for indexing of arrays with array aggregate expressions (and to use the standard kludge to deal with X[A[3]]).


I think the parser should deal with situations which it can deal with without too much magic. White spaces to distinguish between "[[" and "[" symbols is intuitive. Requiring extra parentheses would really mean that the symbol for array aggregate delimiters from nothing to "(", which isn't too bad, but kinda extreme.

The X[A[3]] thing can be dealt with in way Java deals with ">>". That's ok.

What I'm getting at is that syntax should strive to be intuitive, non-cryptic and at same time it shouldn't be too taxing on parser writers. If it's too hard to write a parser/analyzer for the language, the IDEs and III party tools probably won't take off.


My 2 cents
Regards
- Akhilesh
Jan-Willem Maessen | 30 Apr 12:54
Favicon

Re: Brackets for type parameters distracting


On Apr 30, 2008, at 4:24 AM, Akhilesh Mritunjai wrote:
>
> What I'm getting at is that syntax should strive to be intuitive,  
> non-cryptic and at same time it shouldn't be too taxing on parser  
> writers. If it's too hard to write a parser/analyzer for the  
> language, the IDEs and III party tools probably won't take off.

I'd suggest just using our parser (when the NetBeans plugin was  
contributed, Rats was described as being easy to use in this  
respect).  Fortress is, in fact, hard to parse, especially if you try  
to use an LR(1), LALR, or LL(k) parsing tool.  Syntax abstraction will  
make this harder still (because it integrates with our parser).   
Luckily the Packrat model used by Rats is pretty easy to understand.

-Jan

>
>
>
> My 2 cents
> Regards
> - Akhilesh

Jan-Willem Maessen | 30 Apr 12:49
Favicon

Re: Brackets for type parameters distracting

On Apr 29, 2008, at 10:26 PM, Eric Allen wrote:

> On Apr 28, 2008, at 9:02 PM, Hezekiah M. Carty wrote:
>
>> Sebastian Fernandez <sebastian.fernandez@...> writes:
>>> Is it just me or do other people find the brackets for type  
>>> parameters
>>> ( [\ and \] ) distracting to read?
>>
>> I have the same complaint.  I understand that proper rendering is a  
>> big part of
>> Fortress, but I think the ASCII in this case makes the code harder  
>> to read than
>> it should be.

My favored solution here is just to turn on the appropriate font  
folding.  This is included in the emacs mode.

> ...
> Another, less serious, problem is that it interferes with the use of  
> an array reference as a subscript, as in X[A[3]]. But there are  
> known ways of dealing with this second issue. We could fix things in  
> a manner similar to the way that Java manages to make types such as  
> List<Vector<String>> parse correctly despite the fact that ">>"  
> tokenizes as the right-shift operator.

This throws away the notion that ascii conversion occurs as a separate  
pre-pass; we need to parse as we convert instead.

-Jan

Hezekiah M. Carty | 30 Apr 16:51

Re: Brackets for type parameters distracting

Eric Allen <Eric.Allen@...> writes:
> Comments? On balance, I guess I'd prefer to simply use [[ and ]] as  
> ASCII for white square brackets and require spaces or parentheses for  
> indexing of arrays with array aggregate expressions (and to use the  
> standard kludge to deal with X[A[3]]).
> 

I think this sounds like a reasonable solution.  Would type inference be able to
help catch mistakes in this case (space vs no space)?

Hez

dmitrey | 30 Apr 17:32
Favicon

Re: Brackets for type parameters distracting

To fix the issue with [[...]] array indexing another (symmetric) 
brackets could be used, for example <[...]> or [<...>].

On the other hand I would prefer it be just {}:
my_func{...}(...):(...) = ...
, while current implementation of set (IIRC it is the one defined by {}) 
make as {{}} or [\\] or something else. I guess sets will be used much 
more rarely than static arguments, so {} may be used for a more common 
language operation.

Regards, D.

Sebastian Fernandez | 30 Apr 19:20

Re: Brackets for type parameters distracting



On Tue, Apr 29, 2008 at 7:26 PM, Eric Allen <Eric.Allen-xsfywfwIY+M@public.gmane.org> wrote:
On Apr 28, 2008, at 9:02 PM, Hezekiah M. Carty wrote:

Sebastian Fernandez <sebastian.fernandez <at> ...> writes:
Is it just me or do other people find the brackets for type parameters
( [\ and \] ) distracting to read?

I have the same complaint.  I understand that proper rendering is a big part of
Fortress, but I think the ASCII in this case makes the code harder to read than
it should be.

I strongly agree. I think it's fair to say that nobody actually likes [\ and \]. I, and others, have often brought up the idea of replacing them, but there are some technical issues to work out and it's difficult to come up with a design that is universally considered to be better.

The natural ASCII for white Oxford brackets is [[ and ]]. Guy has pointed out that there are two problems with this ASCII: (1) it interferes with subscripting expressions where the subscript happens to be an array aggregate:

A[[1 2 3]]

We could require spaces (or parentheses) between the brackets in such cases:

A[ [1 2 3] ]

or

A[([1 2 3])]

I'd be interested in knowing what others think of such a requirement.
 
I very much prefer [[ and ]] (although nested type parameters may be hard to read with all the brackets at the end: Foo[[Bar,Baz[[Bar]]]]). I can't imagine that array indexing with an array literal would be a very common operation (particularly when tuples are available) and so making it slightly less convenient does not seem like much of a burden to the user.

--
Sebastian Fernandez
dmitrey | 30 Apr 17:32
Favicon

Re: Brackets for type parameters distracting

To fix the issue with [[...]] array indexing another (symmetric) 
brackets could be used, for example <[...]> or [<...>].

On the other hand I would prefer it be just {}:
my_func{...}(...):(...) = ...
, while current implementation of set (IIRC it is the one defined by {}) 
make as {{}} or [\\] or something else. I guess sets will be used much 
more rarely than static arguments, so {} may be used for a more common 
language operation.

Regards, D.

Guy.Steele | 1 May 05:54
Favicon

Re: Brackets for type parameters distracting

I see that there is a fair amount of sentiment for changing
[\ ... \] to [[ ... ]] for ASCII type parameter brackets.  After some
thought, I think I would support this change---but if we are to
do it, we should do it soon, and using a phase-over approach
that will provide compatibility until we get all the libraries
converted.  That is, for some period of time (maybe a few months)
we should support both syntaxes, while we convert the libraries
and encourage the user base to switch.

One thought about implementation: while we could use a parser
kludge to handle situations such as a[b[c]], I suggest that it might
be preferable to confine the kludge to the ASCII conversion process.
since it's really an ASCII conversion problem.  This would allow
the parser to remain simpler and would not support the strange
spectacle of accepting a Unicode program that happened to
have two ordinary left brackets and one Oxford right bracket.

Therefore I propose this alternate approach: on a line-by-line
bases, the ASCII converter tracks opening and closing delimiters,
pushing each opening delimiter (after any conversion) onto a stack
and popping the stack when a closing delimiter is encountered.
(If the stack is empty, then an attempt tp pop the stack just leaves
it empty.)  When the ASCII converter encounters a ]] sequence,
it converts it to an Oxford right bracket if the stack is empty
or the top item on the stack is an Oxford left bracket; otherwise
a single ] is recognized (and the stack is popped).

Doing this on a line-by-line basis keeps the conversion process
reasonably local (and potentially easier to parallelize!).  The only
case it doesn't handle well is the case where the stack is empty
and the ]] was really intended to be two plain right brackets
But that means that two nested uses of brackets (whether for
subscripts or array constructors) were both broken across a line
boundary, and in that case it is not unreasonable to expect the
programmer to exercise a little more care and separate the brackets
with spaces as ] ] (which after all will make the code much more readable).
The common case of nested subscripting such as a[b[c]] will succeed
with no additional thought.

Alternatively, we could require the ASCII converter to maintain the
stack over an entire component, and then it should (in principle)
always succeed.

--Guy

Jan-Willem Maessen | 1 May 14:15
Favicon

Re: Brackets for type parameters distracting


On Apr 30, 2008, at 11:56 PM, Guy.Steele@... wrote:

> I see that there is a fair amount of sentiment for changing
> [\ ... \] to [[ ... ]] for ASCII type parameter brackets.  After some
> thought, I think I would support this change---but if we are to
> do it, we should do it soon, and using a phase-over approach
> that will provide compatibility until we get all the libraries
> converted.  That is, for some period of time (maybe a few months)
> we should support both syntaxes, while we convert the libraries
> and encourage the user base to switch.

Sounds good.  I'll most likely convert the libraries we provide in  
bulk, but it'll be easier to coordinate this transition if we add the  
syntax first, and *then* convert the libraries.

> One thought about implementation: while we could use a parser
> kludge to handle situations such as a[b[c]], I suggest that it might
> be preferable to confine the kludge to the ASCII conversion process.

I won't comment on the relative ease of implementing the two solutions  
you suggest (line-at-a-time and bulk file matching) in the parser we  
have today, but I'd like to hear comments on the subject from folks  
who have worked with the parser.  I'm thinking about the changes to  
the emacs mode; right now character folding works using regexps, and  
it may be hard to fold ]] into ⟧ in that setting.  A simple matter of  
programming to work around this, I expect.

-Jan

David Chase | 12 May 18:36
Favicon

Re: Brackets for type parameters distracting

We're discussing this in our weekly meeting, not reaching consensus,
and curious to know what other people think.  This example comes
from the recently created wordcount demo, and was chosen because
it's hard to read.  Here's four versions (better viewed in a fixed font,
not only does that line up the indents, that's also what people will
probably use to edit code in this form):

(1) status quo:

opr BIG UNIONUNION(g:(Reduction[\Map[\ZZ32,List[\String\]\]\],
                       Map[\ZZ32,List[\String\]\]->Map[\ZZ32,List 
[\String\]\])->
                         Map[\ZZ32,List[\String\]\]):Map[\ZZ32,List 
[\String\]\] =
     embiggen[\Map[\ZZ32, List[\String\]\]\](fn(a,b) => a UNIONUNION b,
                                             mapping[\ZZ32,List 
[\String\]\](),
                                             g)

(2) [[ and ]]:

opr BIG UNIONUNION(g:(Reduction[[Map[[ZZ32,List[[String]]]]]],
                       Map[[ZZ32,List[[String]]]]->Map[[ZZ32,List 
[[String]]]])->
                         Map[[ZZ32,List[[String]]]]):Map[[ZZ32,List 
[[String]]]] =
     embiggen[[Map[[ZZ32, List[[String]]]]]](fn(a,b) => a UNIONUNION b,
                                             mapping[[ZZ32,List 
[[String]]]](),
                                             g)

(3) [[ and ]] with some spacing:

opr BIG UNIONUNION(g:(Reduction[[Map[[ZZ32,List[[String]] ]] ]],
                       Map[[ZZ32,List[[String]] ]]->Map[[ZZ32,List 
[[String]] ]])->
                         Map[[ZZ32,List[[String]] ]]):Map[[ZZ32,List 
[[String]] ]] =
     embiggen[[Map[[ZZ32, List[[String]] ]] ]](fn(a,b) => a  
UNIONUNION b,
                                               mapping[[ZZ32,List 
[[String]] ]](),
                                               g)

(4) with actual white square brackets, no other formatting (might not
display if no font on your box has the character(s) 27E6 and 27E7):

opr BIG UNIONUNION(g:(Reduction⟦Map⟦ZZ32,List⟦String⟧⟧⟧,
                       Map⟦ZZ32,List⟦String⟧⟧->Map 
⟦ZZ32,List⟦String⟧⟧)->
                         Map⟦ZZ32,List⟦String⟧⟧):Map 
⟦ZZ32,List⟦String⟧⟧ =
     embiggen⟦Map⟦ZZ32, List⟦String⟧⟧⟧(fn(a,b) => a  
UNIONUNION b,
                                             mapping⟦ZZ32,List 
⟦String⟧⟧(),
                                             g)

We'd like some estimate of relative awfulness -- for instance,
how do these proposals compare to:

(a) Python blocking with indentation
(b) Lisp backquote macros
(c) Lisp parentheses
(d) C declaration syntax
(e) Perl (in general)
(f) Postscript

Changes could still get tangled up in parsing issues, but we're  
trying to
get a feel for whether [\ \] is a short-term annoyance, or something  
that
will bother people every time they use the language.

David

dmitrey | 12 May 19:37
Favicon

Re: Brackets for type parameters distracting

David Chase wrote:
> opr BIG UNIONUNION(g:(Reduction⟦Map⟦ZZ32,List⟦String⟧⟧⟧,
>                       Map⟦ZZ32,List⟦String⟧⟧->Map⟦ZZ32,List⟦String⟧⟧)->
>                         Map⟦ZZ32,List⟦String⟧⟧):Map⟦ZZ32,List⟦String⟧⟧ =
>     embiggen⟦Map⟦ZZ32, List⟦String⟧⟧⟧(fn(a,b) => a UNIONUNION b,
>                                             mapping⟦ZZ32,List⟦String⟧⟧(),
>                                             g)
My 2 cents:
still I think too many brackets, like "⟧⟧⟧" above, make code difficult 
to read and edit. Using {} would be better (is it so hard to check is it 
used for fortress *set* type or for these args from function definition?).

Also, I think definitions w/o args like the one above with () should be 
made with () being optional or absent at all.
D.

Sorin Miklós Zsejki | 12 May 20:22

Re: Brackets for type parameters distracting

In my opinion, white brackets are great and [\ \] is really not a big
deal. People should probably concentrate more on IDEs for Fortress
than finding a temporary solution. I don't care how the scaffolding
looks like, only the façade matters.

As an aside, wouldn't it be great to be able to write:

type IntToStrings = Map[\ZZ32,List[\String\]\]

before that expression?

On Mon, May 12, 2008 at 7:36 PM, David Chase <dr2chase@...> wrote:
> We're discussing this in our weekly meeting, not reaching consensus,
>  and curious to know what other people think.  This example comes
>  from the recently created wordcount demo, and was chosen because
>  it's hard to read.  Here's four versions (better viewed in a fixed font,
>  not only does that line up the indents, that's also what people will
>  probably use to edit code in this form):
>
>  (1) status quo:
>
>  opr BIG UNIONUNION(g:(Reduction[\Map[\ZZ32,List[\String\]\]\],
>
> Map[\ZZ32,List[\String\]\]->Map[\ZZ32,List[\String\]\])->
>
> Map[\ZZ32,List[\String\]\]):Map[\ZZ32,List[\String\]\] =
>     embiggen[\Map[\ZZ32, List[\String\]\]\](fn(a,b) => a UNIONUNION b,
>
> mapping[\ZZ32,List[\String\]\](),
>                                             g)
>
>  (2) [[ and ]]:
>
>  opr BIG UNIONUNION(g:(Reduction[[Map[[ZZ32,List[[String]]]]]],
>
> Map[[ZZ32,List[[String]]]]->Map[[ZZ32,List[[String]]]])->
>
> Map[[ZZ32,List[[String]]]]):Map[[ZZ32,List[[String]]]] =
>     embiggen[[Map[[ZZ32, List[[String]]]]]](fn(a,b) => a UNIONUNION b,
>
> mapping[[ZZ32,List[[String]]]](),
>                                             g)
>
>  (3) [[ and ]] with some spacing:
>
>  opr BIG UNIONUNION(g:(Reduction[[Map[[ZZ32,List[[String]] ]] ]],
>                       Map[[ZZ32,List[[String]] ]]->Map[[ZZ32,List[[String]]
> ]])->
>                         Map[[ZZ32,List[[String]]
> ]]):Map[[ZZ32,List[[String]] ]] =
>     embiggen[[Map[[ZZ32, List[[String]] ]] ]](fn(a,b) => a UNIONUNION b,
>                                               mapping[[ZZ32,List[[String]]
> ]](),
>                                               g)
>
>  (4) with actual white square brackets, no other formatting (might not
>  display if no font on your box has the character(s) 27E6 and 27E7):
>
>  opr BIG UNIONUNION(g:(Reduction⟦Map⟦ZZ32,List⟦String⟧⟧⟧,
>                       Map⟦ZZ32,List⟦String⟧⟧->Map⟦ZZ32,List⟦String⟧⟧)->
>                         Map⟦ZZ32,List⟦String⟧⟧):Map⟦ZZ32,List⟦String⟧⟧ =
>     embiggen⟦Map⟦ZZ32, List⟦String⟧⟧⟧(fn(a,b) => a UNIONUNION b,
>                                             mapping⟦ZZ32,List⟦String⟧⟧(),
>                                             g)
>
>  We'd like some estimate of relative awfulness -- for instance,
>  how do these proposals compare to:
>
>  (a) Python blocking with indentation
>  (b) Lisp backquote macros
>  (c) Lisp parentheses
>  (d) C declaration syntax
>  (e) Perl (in general)
>  (f) Postscript
>
>  Changes could still get tangled up in parsing issues, but we're trying to
>  get a feel for whether [\ \] is a short-term annoyance, or something that
>  will bother people every time they use the language.
>
>  David
>
>
>

Akhilesh Mritunjai | 12 May 20:40

Re: Brackets for type parameters distracting



In ascending order of fugliness - 4 3 1 2.

Unless IDE does the mapping between keystrokes and proper character, I think it's going to suck one way or the other.

- mritun

On Mon, May 12, 2008 at 10:06 PM, David Chase <dr2chase <at> sun.com> wrote:
We're discussing this in our weekly meeting, not reaching consensus,
and curious to know what other people think.  This example comes
from the recently created wordcount demo, and was chosen because
it's hard to read.  Here's four versions (better viewed in a fixed font,
not only does that line up the indents, that's also what people will
probably use to edit code in this form):

(1) status quo:

opr BIG UNIONUNION(g:(Reduction[\Map[\ZZ32,List[\String\]\]\],
                     Map[\ZZ32,List[\String\]\]->Map[\ZZ32,List[\String\]\])->
                       Map[\ZZ32,List[\String\]\]):Map[\ZZ32,List[\String\]\] =
   embiggen[\Map[\ZZ32, List[\String\]\]\](fn(a,b) => a UNIONUNION b,
                                           mapping[\ZZ32,List[\String\]\](),
                                           g)

(2) [[ and ]]:

opr BIG UNIONUNION(g:(Reduction[[Map[[ZZ32,List[[String]]]]]],
                     Map[[ZZ32,List[[String]]]]->Map[[ZZ32,List[[String]]]])->
                       Map[[ZZ32,List[[String]]]]):Map[[ZZ32,List[[String]]]] =
   embiggen[[Map[[ZZ32, List[[String]]]]]](fn(a,b) => a UNIONUNION b,
                                           mapping[[ZZ32,List[[String]]]](),
                                           g)

(3) [[ and ]] with some spacing:

opr BIG UNIONUNION(g:(Reduction[[Map[[ZZ32,List[[String]] ]] ]],
                     Map[[ZZ32,List[[String]] ]]->Map[[ZZ32,List[[String]] ]])->
                       Map[[ZZ32,List[[String]] ]]):Map[[ZZ32,List[[String]] ]] =
   embiggen[[Map[[ZZ32, List[[String]] ]] ]](fn(a,b) => a UNIONUNION b,
                                             mapping[[ZZ32,List[[String]] ]](),
                                             g)

(4) with actual white square brackets, no other formatting (might not
display if no font on your box has the character(s) 27E6 and 27E7):

opr BIG UNIONUNION(g:(Reduction⟦Map⟦ZZ32,List⟦String⟧⟧⟧,
                     Map⟦ZZ32,List⟦String⟧⟧->Map⟦ZZ32,List⟦String⟧⟧)->
                       Map⟦ZZ32,List⟦String⟧⟧):Map⟦ZZ32,List⟦String⟧⟧ =
   embiggen⟦Map⟦ZZ32, List⟦String⟧⟧⟧(fn(a,b) => a UNIONUNION b,
                                           mapping⟦ZZ32,List⟦String⟧⟧(),
                                           g)

We'd like some estimate of relative awfulness -- for instance,
how do these proposals compare to:

(a) Python blocking with indentation
(b) Lisp backquote macros
(c) Lisp parentheses
(d) C declaration syntax
(e) Perl (in general)
(f) Postscript

Changes could still get tangled up in parsing issues, but we're trying to
get a feel for whether [\ \] is a short-term annoyance, or something that
will bother people every time they use the language.

David



Sebastian Fernandez | 13 May 04:39

Re: Brackets for type parameters distracting

I think 3 is preferable to 2 which is preferable to 1. In an ideal world, we'd just use 4, but I suspect that for many years still people will have to work with incomplete font sets (even if your IDE is correctly set up, does your mail browser have the right fonts? your web browser?).


--
Sebastian

On Mon, May 12, 2008 at 9:36 AM, David Chase <dr2chase <at> sun.com> wrote:
We're discussing this in our weekly meeting, not reaching consensus,
and curious to know what other people think.  This example comes
from the recently created wordcount demo, and was chosen because
it's hard to read.  Here's four versions (better viewed in a fixed font,
not only does that line up the indents, that's also what people will
probably use to edit code in this form):

(1) status quo:

opr BIG UNIONUNION(g:(Reduction[\Map[\ZZ32,List[\String\]\]\],
                     Map[\ZZ32,List[\String\]\]->Map[\ZZ32,List[\String\]\])->
                       Map[\ZZ32,List[\String\]\]):Map[\ZZ32,List[\String\]\] =
   embiggen[\Map[\ZZ32, List[\String\]\]\](fn(a,b) => a UNIONUNION b,
                                           mapping[\ZZ32,List[\String\]\](),
                                           g)

(2) [[ and ]]:

opr BIG UNIONUNION(g:(Reduction[[Map[[ZZ32,List[[String]]]]]],
                     Map[[ZZ32,List[[String]]]]->Map[[ZZ32,List[[String]]]])->
                       Map[[ZZ32,List[[String]]]]):Map[[ZZ32,List[[String]]]] =
   embiggen[[Map[[ZZ32, List[[String]]]]]](fn(a,b) => a UNIONUNION b,
                                           mapping[[ZZ32,List[[String]]]](),
                                           g)

(3) [[ and ]] with some spacing:

opr BIG UNIONUNION(g:(Reduction[[Map[[ZZ32,List[[String]] ]] ]],
                     Map[[ZZ32,List[[String]] ]]->Map[[ZZ32,List[[String]] ]])->
                       Map[[ZZ32,List[[String]] ]]):Map[[ZZ32,List[[String]] ]] =
   embiggen[[Map[[ZZ32, List[[String]] ]] ]](fn(a,b) => a UNIONUNION b,
                                             mapping[[ZZ32,List[[String]] ]](),
                                             g)

(4) with actual white square brackets, no other formatting (might not
display if no font on your box has the character(s) 27E6 and 27E7):

opr BIG UNIONUNION(g:(Reduction⟦Map⟦ZZ32,List⟦String⟧⟧⟧,
                     Map⟦ZZ32,List⟦String⟧⟧->Map⟦ZZ32,List⟦String⟧⟧)->
                       Map⟦ZZ32,List⟦String⟧⟧):Map⟦ZZ32,List⟦String⟧⟧ =
   embiggen⟦Map⟦ZZ32, List⟦String⟧⟧⟧(fn(a,b) => a UNIONUNION b,
                                           mapping⟦ZZ32,List⟦String⟧⟧(),
                                           g)

We'd like some estimate of relative awfulness -- for instance,
how do these proposals compare to:

(a) Python blocking with indentation
(b) Lisp backquote macros
(c) Lisp parentheses
(d) C declaration syntax
(e) Perl (in general)
(f) Postscript

Changes could still get tangled up in parsing issues, but we're trying to
get a feel for whether [\ \] is a short-term annoyance, or something that
will bother people every time they use the language.

David




Gmane