News for hackers. Stuff that matters.
Re:C-style vs. Python-style syntax: which one would you pref... by cabalamat on Sunday December 14, 2008 @08:31PM (#397842)
Why not allow both? To resolve ambiguity, there could be keywords CLIKE and PYTHONLIKE which determine how the code is to be parsed from that point, e.g:

   CLIKE

   def factorial(x) {
      return ( x<=2 ? 
         1 : 
         n*factorial(n-1) );
   }

   PYTHONLIKE

   printf(factorial(10))  # note ';' not needed
Incidently I'm writing a language that'll have C-like syntax which will then be compiled into Lisp-like intermediate code. The Lisp-like code will be available to the programmer, who will thus be able to inspect the syntax tree, write Lisp-like macros, etc. Furthermore, the programmer can embed the Lisp-like code inside normal code (like inserting assembler inside a C function).

There are no comments on this comment yet.