[bitc-dev] Surface Syntax (again)
Jonathan S. Shapiro
shap at eros-os.com
Thu Feb 26 11:43:53 EST 2009
On Wed, Feb 25, 2009 at 5:05 PM, Levi Greenspan
<greenspan.levi at googlemail.com> wrote:
> Would it be possible to elaborate a bit on how this new surface syntax
> would look like?
Levi: Let me open by saying that I appreciate and welcome your
interest, and that my response is in no way directed at you
More languages have been stalled or killed by syntax debates than any
other issue. Everyone has a strong opinion about syntax, there is very
little objective data by which to evaluate "goodness", and no matter
what you do you are going to piss off two thirds of the user base. For
the most part, it isn't the final syntax choice that alienates them;
it's the fact that their particular preference was not incorporated.
Otherwise sensible people get disappointed even when their pet idea is
not very feasible (example: it has been suggested here to maintain two
surface syntaxes in parallel).
For this reason, I am VERY reluctant to open a general discussion
about syntax. It seems better to generate by fiat one syntax that
everybody will piss and moan about, and then address the specific
valid issues that emerge during the complaint process.
> From  I would expect it to be similar to the
> C-family of languages...
That was the original plan. To the extent that C programs could be
transcoded into BitC directly, it seemed like a good idea for C
programmers to be able to read and understand the result.
To some degree a C-like syntax it is still likely, if only because the
C family is the language family that is most familiar to me. But two
things have changed as BitC has evolved:
1. As BitC has become more powerful the C-like syntax has become less
viable in certain respects.
2. I have realized that in the absence of local dependent type
inference (which we are *not* doing any time soon), some common
syntactic constructs of C simply do not translate sensibly into BitC.
That is: they don't have a translation that is "obviously the same" in
the eyes of the programmer. The main example here is incomplete switch
3. I have realized that existing C programmers will not be early
adopters in any case.
Given this, I'm no longer as tied to the idea of a C-like syntax.
>, and from  that it would not be ML-like.
The ML syntax is that it is horribly ambiguous, even when mixfix is
disregarded. Whatever style of syntax we converge on, this sort of
unmotivated ambiguity seems unwise.
> As a personal preference I very much prefer ML-like syntax (F#, SML, OCaml)
> over C-style syntax.
This is *exactly* the type of discussion that I want to avoid.
Discussions of the form "if we want to achieve goal X, what
restrictions or patterns do we need to preserve in the grammar" are
potentially productive. Discussions of preference are not.
> ...So I would be interested to know the arguments that
> make you prefer the C style.
It was entirely driven by my notions of the early adopter target
audience. Those notions have since changed.
> Also I think surface syntax matters, so I
> would welcome a more detailed discussion about it. Now seems to be the
> right time, or not?
It depends how long you want to delay the language deployment. I agree
with you that syntax matters. That being said, a syntax that is 90%
okay this month is better than a syntax that is 92% okay next year.
More information about the bitc-dev