Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Syntax Du Jour

Name: Anonymous 2013-01-06 21:43

If you were to design a language right now which syntax tradition would you follow?

1. C/C++/C#/PHP/Perl
2. Lisp/Common Lisp/Scheme/... Lisp/... Lisp
3. ISWIM/ML/OCaml/Haskell
4. Prolog/Erlang
5. Pascal/... Pascal/... Pascal/... Pascal/... Pascal/Ada
6. FIOC
7. Bash/Ruby
8. BASIC/... BASIC/... BASIC/xBase/FoxPro/COBOL/SQL/FORTRAN77/shit
9. Other
A. Forth
B. Brainfuck
C. INI files
D. XML
E. CSV

Name: Anonymous 2013-01-07 2:10

I would have a sh/Ada style block structure syntax where different opening statements have different end statements instead of just plain end. So at least instead of end end end it'd be fi done fi or the like.

I would steal the APL family's syntax for array literals. Write 1 3 -5 7 instead of [1, 3, -5, 7]. Binary operators would be separated from their arguments by whitespace. I might take it a step further and make the leading minus sign part of the number token. Also, you'd be able to put underscores between digits for readability (1_000_000 instead of 1000000).

I like how Clojure has special syntax to indicate tail recursion so I would want to try something like that, but with support for tail calls in general, not just recursive ones. I would also like to support a pragma (or whatever) that prohibits recursion except via tail calls. But that's beside the point.

I like the my and sub keywords in Perl and I'd probably steal those.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List