3 ms·
Never understood why languages like this don't just adopt full Lisp syntax. I'd have been much more interested.
by didibus 6y ago
Never understood why languages like this don't just adopt full Lisp syntax. I'd have been much more interested.
- lifthrasiir 6y agoBecause lisp syntax is never something everyone appreciates. See, for example, Dylan.
- timbit42 6y agoDylan is less appreciated than Lisp.
- Garlef 6y agoYou could just read linear = m b x -> b + m * x as (linear = m b x -> b + m * x) and assume this to be an expression given to some kind of macro ;)
- slightknack 6y agoMy goal was to replicate lisp without the redundant parenthesis. There are a few conventions common in lisp: expressions usually occur on a new line, blocks begin with, well, `begin`, there is spacing between definitions, macros operate on forms, etc. etc. I thought, why not use the conventions when writing a language to the advantage of the notation used to represent that language? A chain of symbols actually creates a `form` like a lisp list. So `a b c + c d e` is the same as `(a b c) + (c d e)`, which in list would be `(+ (a b c) (c d e))`. Additionally, newlines can be used to separate forms. So you can imagine that each expression on a new line is grouped in parenthesis - except in the case of operators, which can be split for legibility. Some more: If you do group an expression with parens explicitly, you can split it across multiple lines like in lisp: hello (this is) a form (hello (this is) a form) (hello (this is) a form) I that with enough work, one could use Passerine's macro system to turn the language into a lisp. Heck, you can already go the other way and turn it into this: syntax function name(args) body { name = args -> body } function thingo(x, y) { x + y * 2.7 } Notation is a powerful tool. Lisp is one two. It's hard to sneak a lisp past the eyes of a general population, but I think that the core of lisp: code as data, 'the Maxwell's Equations of Software' needn't be forever tied to s-expressions.