[erlang-questions] Erlang Syntax - again
Richard A. O'Keefe
ok@REDACTED
Wed Mar 12 05:56:40 CET 2008
On 12 Mar 2008, at 1:58 pm, Robert Virding wrote:
> Very few of the misfeatures of Erlang syntax are new, though this
> doesn't make them less important. Some are be fixable.
>
> I was probably a little unclear but I was interested in the question
> of a whole new syntax, which at least Ulf understood. And the follow-
> up question of whether this would satisfy people?
It seems to me that a new syntax for Erlang should do one of three
things,
and ideally should do them all.
(1) Reduce the labour of creating Erlang.
I have a proposal for 'HaskErl' -- a Haskell-inspired syntax for
Erlang,
which has not kept up with developments in the bit syntax. I
found that
this can reduce the SLOC count by a factor of 1.6. That is, for
every
8 lines of Erlang, there would be 5 lines of HaskErl.
In code which is heavily commented, of course, the total effect
would be
much reduced, because the comments would not change.
(2) Reduce the error rate when creating Erlang.
That is, it should lead you into making fewer mistakes. One can
have ideas
about what _ought_ to be error prone, but really, empirical
measurement is
called for. HaskErl requires explicit 'let' for binding
identifiers (or
equally explicit comprehensions), reducing some errors, but the
great
reduction in parentheses and commas presumably increases others.
(3) Reduce the labout of editing Erlang.
This, of course, invites (NOT "begs") the question "by what
editor?"
Arguably, Lisp is about as good as it gets here, and LFE is a very
worthwhile experiment.
I don't list "familiarity" as a criterion, for two reasons.
- The kind of programmer who is likely to be interested in Erlang is
likely
to already be familiar with at least one language that didn't steal
its
syntax from C.
- Too much similarity can lead to mistakes when things aren't
_exactly_ the
same. When I was taught French at school, I was warned about "faux
amis":
words that looked exactly like English words, but didn't mean the
same.
> I suppose the question really gets back to where the *real* problem
> is. Is it really the syntax, or is it actually the semantics but
> people see it a syntax problem because that is what they see first,
> the syntax? If a new syntax really solved new users problems then it
> might be worth doing, otherwise not. What do people think?
Does anyone remember a story by John Brunner about "stardroppers"? It
appeared
as a serial in Analog, but was also published as a book. The hero was a
government agent. One of the nice little gimmicks in the book was
that he
communicated with his superiors in a unique language specially
designed for
him, based on his person and personality. When he reported to them,
he never
knew what he said, but it felt really really comfortable saying it.
My point is that syntax isn't *the* problem, but it is *a* problem in
the sense
that practically everyone has a language in them, and Erlang isn't it,
and the
mismatch will be a source of discomfort.
Does anyone remember the wave of PL/I-like languages?
Or the wave of Algol 68-inspired languages?
Or the later wave of Pascal-like languages?
Heck, I've even seen a language that borrowed the control structures
of SNOBOL!
PL/I is pretty much gone; Pascal is pretty much gone; SNOBOL is gone;
but Lisp is still with us.
Oh yeah, so are Fortran, Basic, and COBOL. Should we make Erlang look
like COBOL?
If Erlang got a Java-inspired syntax, we'd still get grief from people
who wanted it to look like C# instead.
More information about the erlang-questions
mailing list