Sujet : Re: this girl calls c ugly
De : ldo (at) *nospam* nz.invalid (Lawrence D’Oliveiro)
Groupes : comp.lang.cDate : 29. May 2026, 00:54:52
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <10vakkb$3phl1$9@dont-email.me>
References : 1 2 3 4 5
User-Agent : Pan/0.165 (Kostiantynivka)
On Thu, 28 May 2026 14:07:45 -0500, BGB wrote:
Some like LISP syntax, others can't stand the excessive parenthesis.
Worth mentioning that the whole point about Lisp syntax is to get as
close to no syntax as possible -- essentially, all the “syntax” is
down to the meaning of the first word after each opening parenthesis
(function call, macro call or “special form”). This is to achieve
homoiconicity, which is a core feature of the language.
Anybody remember PostScript? That, too, was homoiconic. And achieved
it in a similar way, with an absolutely minimalist compile-time
syntax.
Other, newer languages have found a way to implement AST-level macros
without going to that sort of extreme -- Julia and Rust, I think, can
manage it. I even did it in Python, with a little bit of fudging.
There have been attempts to eliminate parenthesis ...
The problem for me is the “parenthesis pileup” layout that seems to be
traditional among Lisp programmers. I prefer to put parentheses that
have the interpretation of delimiting statement blocks on lines by
themselves (and sometimes other constructs as well, if they get too
long), e.g.
(defun set_auto_indent (&optional on)
"lets user change auto-indent setting."
(interactive)
(when (eq on nil)
(setq on
(y-or-n-p
(format
"Auto-indent [%s]? "
(if
(eq
(lookup-key (current-global-map) "\015")
'auto_indent
)
"y"
"n"
) ; if
)
)
) ; setq
) ; when
(cond
(on
(global-set-key "\015" 'auto_indent)
(global-set-key [?\C-\M-m] 'newline)
(message "Auto-indent on")
)
(t
(global-set-key "\015" 'newline)
(global-set-key [?\C-\M-m] 'auto_indent)
(message "Auto-indent off")
)
) ; cond
) ; set_auto_indent
Infix notation and precedence rules are pros/cons.
Python took over most of the C operator precedence rules, with one
interesting wrinkle: they moved up the precedence of the bitwise
operators so that what has to be written like this in C:
(«val» & «mask») == «expected»
can have the parentheses omitted in Python:
«val» & «mask» == «expected»
Smalltalk was once popular, and while arguably some aspects of its
syntax are "aesthetic", I personally found trying to read anything
in the language to be almost incomprehensible (so, negative points
if I can't make any sense of what is going on).
I did have a look at it at one point. Not too hard to manage. The
hardest part was trying to find some actual explicit definition of the
whole syntax.
All in all, though, I think its approach to object-orientation is a
bit ancient, compared to, say, Python.
Early on, I had liked JS and ActionScript, as (compared with LISP
and Scheme) they scaled a lot easier to "real programming work".
>
But, then one faces a tension:
Light duty scripting: Favors keeping the language dynamic and
minimizing structural concerns;
Implementation work: Favors strongly going in a direction more like
the C-like languages.
Lua sounds like it was designed for what you had in mind.
But these days, it’s just easier to use Python.
Haut de la page
Les messages affichés proviennent d'usenet.
NewsPortal