News for hackers. Stuff that matters.
Re:You already use Lisp syntax by tomp on Wednesday May 21, 2014 @07:29AM (#7777637)
Oh god, another barely valid non-argument about the superiority of LISP syntax.

Well, guess what. Function name, followed by arguments, is not LISP, it's Mathematics. `A x` has meant applying a linear transformation to a vector (i.e. matrix multiplication) for a very long time.

Furthermore, saying "it's like LISP but without parenthesis around it" is like saying "it's like Java but without parenthesis around arguments and commas between then" when you actually mean to say "it's just like ML".

Finally, bash has infix operators (like `|` and `;`), which make it infinitely more readable than it would be without them. Really, if we can compare bash with any other programming language, it's ML.

Re:You already use Lisp syntax by scott_s on Wednesday May 21, 2014 @10:14AM (#7778326)
The purpose of this article is try to teach people how to think about Lisp syntax through analogy, not argue that it is a superior syntax.
Re:You already use Lisp syntax by grayclhn on Wednesday May 21, 2014 @09:07AM (#7777971)
There's more prefix notation in math than you think:

∑ᵢ xᵢ

∫ x² dx

etc. And `A x` is more likely to be written as `(A x)` than `A(x)` in your example. I don't necessarily agree with the article, though...

Re:You already use Lisp syntax by sp332 on Wednesday May 21, 2014 @09:34AM (#7778089)
tomp's point is that "LISP syntax" is actually math syntax. I think you're in violent agreement...
Re:You already use Lisp syntax by drunken_thor on Wednesday May 21, 2014 @07:41AM (#7777675)
whoa settle down, the article wasn't about the superiority of LISP syntax, it was more about how the syntax is not as weird as you might think.
Re:You already use Lisp syntax by chr1 on Wednesday May 21, 2014 @08:09AM (#7777761)
The weird thing about Lisp syntax is that people try to find all kinds of justifications why not having infix syntax is ok.

The fact that arithmetic can be written in weird form in other languages too isn't very interesting.

Re:You already use Lisp syntax by bunderbunder on Wednesday May 21, 2014 @09:46AM (#7778153)
There's really just one justification, but it really is an interesting one: It gets the logical structure of the code in line with its lexical structure.

One reason this is neat is that it facilitates language extensibility to a radical degree. LISP has its macros, FORTH has its compiling words. Languages that allow infix syntax have tried to come up with something similar, but I haven't personally used one that I thought was particularly successful.

Re:You already use Lisp syntax by emiljbs on Wednesday May 21, 2014 @08:27AM (#7777811)
The weird thing is that some people feel that they need to find all kinds of justifications for why not having an infix syntax is OK.

Arithmetic in Lisp-style is excellent and easy to read. Thing is that programming languages infix math is ridiculously bad compared to what I can do with paper and pencil. It's really just a really bad form of imitation and to me that irks me way more than just doing it in Lisp. Math written in PL:s is hard to read in general and I'd love to see an Emacs package that lets you show an inline picture as you mark a mathematical expression of LaTeX rendering it as 'regular' math.

Re:You already use Lisp syntax by tobik on Wednesday May 21, 2014 @09:13AM (#7777985)
AUCTeX has support for displaying inline pictures of LaTeX math expressions in Emacs. I just checked and it even says so on the homepage ;) http://www.gnu.org/software/auctex/
Re:You already use Lisp syntax by emiljbs on Wednesday May 21, 2014 @02:04PM (#7779749)
I know :)

I meant "take Java math code and convert into LaTeX, display inline", the first part is the missing one!

Re:You already use Lisp syntax by Morgawr on Wednesday May 21, 2014 @08:52AM (#7777908)
There are a lot of reasons to prefer RPN over infix syntax and why Lisp has chosen to adopt this notation. Although, I agree with the critiques of the article, it's not really saying much.
Re:You already use Lisp syntax by bunderbunder on Wednesday May 21, 2014 @09:32AM (#7778068)
RPN is postfix notation. You add 1 and 2 using "1 2 +"

Lisp is prefix notation, which is just the opposite.

Re:You already use Lisp syntax by mcguire on Wednesday May 21, 2014 @01:30PM (#7779509)
I just realized that makes Lisp "Polish Notation".

I'm sure that opens up some really horrible jokes.

Re:You already use Lisp syntax by bunderbunder on Wednesday May 21, 2014 @02:16PM (#7779809)
Not quite. If you drop Lisp's variable-arity operators, that enables you to drop the parenthesis. If you drop the parenthesis, that gives you Polish notation.

For example:

  Lisp:  (* (+ 1 2 3) (- 4 5) )

  Polish: * + + 1 2 3 - 4 5
Re:You already use Lisp syntax by AnimalMuppet on Wednesday May 21, 2014 @02:25PM (#7779863)
To me, it opened up a really horrible thought: Polish plus Hungarian.

Lisp with Hungarian names (shudder).

Re:You already use Lisp syntax by Morgawr on Wednesday May 21, 2014 @02:08PM (#7779769)
You're correct, I brain farted.
Re:You already use Lisp syntax by jimbokun on Wednesday May 21, 2014 @03:14PM (#7780142)
What's your justification for why having infix syntax is OK?
Re:You already use Lisp syntax by dllthomas on Wednesday May 21, 2014 @03:19PM (#7780172)
"People are used to it, from years of education."

It's a strong argument. Whether it is sufficient depends on what it is being weighed against.