3 ms·
Ask HN: Syntax extension in weakly typed lanuages?
I like languages that give me the ability to extend the syntax of the language. At the same time, all the languages that I know will let me extend the syntax have relatively heavy type systems. Are there lighter weight languages that allow the same sort of syntax extensibility? Or does flexible syntax require that you be able to define new data types (and operations on those types)?
Basically I want the syntactic flexibility of Haskell without Haskell's type system. Is there a way to get this, or does that syntactic flexibility require the assistance of a type system?
Examples of languages where I know the type system can be abused to create new syntax
Haskell, C++, Python (cf. the recent thread on the pipe operator in Python)
Possible examples of where syntax could be modified without a strong type system maybe:
Scheme, Forth, Common Lisp?
However, while I can see how to overload operators in the first list to generate new syntactic constructs, I don't know enough to know how to do it in the second list. Maybe the answer is for me to go read up on macros in Common Lisp.
What I would like is a language with the conceptual complexity of C, Lua or Erlang, but with the ability to create additional syntactic operators as desired.
- brad22 16y agoit is never what. it is always why. you can make jelly beans dance with void *'s and make a lisp machine cry harder than a pypy. heck you can even brainfuck your self. you can do just about anything with a general programming language. always look for the why. any new syntax this new language offers is going to be useless anyway as you will be calling functions most of the time. so just get used to to the () and recur into that skip list.