Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I genuinely fail to understand the advantages of any sort of Lisp. Contrary to what gigantic brain lisp devs might think, it's syntactical annoyingness is far too much of a barrier to overcome.


>it's syntactical annoyingness is far too much of a barrier to overcome.

You're likely being downvoted because statements like these are more a reflection of you than the language, but instead of phrasing it that way, you come across as making an absolute statement about the language.

In any case, I'll bit.

I'm not a Lisp programmer - the extent to which I do Lisp is the occasional Emacs Lisp. Still:

You can use virtually any character as part of your variable name. Lispers tend to use hyphen and '?' a lot. Once you get used to it, it's hard not to view all other languages as inferior. Why did they restrict the variable names so much?

A lot more substantive: I saw this in John Kitchn's blog post somewhere. My details are probably a bit off, but I think I have the general gist of it. His team works on, I believe, computational chemistry. Their code base is in Python, and they've developed an API for various aspects of their calculation. A lot of their functions require a lot of arguments - not generally a good idea, but it makes sense in the domain they work in. To manage that headache, they've built a systematic way of documenting all those arguments in their docstring, with a particular format.

Unfortunately, that means anyone in his team who creates such a function needs to conform to that format, and people get lazy, make mistakes, etc.

So using Hy, he wrote a macro for another syntax for defining a function. With this new way of defining a function, there was special syntax for all the special information that needs to be in the docstring. The macro then creates the Python function with the appropriately written docstring. If the programmer makes a mistake, the macro fails. So now everyone uses the macro to create those types of functions.

I don't recall the details, but let's say it was something like:

    deff func(x, x_doc="doc for x", y, y_doc="doc for y",...)
If someone makes an argument called x, but does not provide x_doc, then it will fail.

(I think in reality it was more than that - not just x_doc but x_doc_a, x_doc_b, etc and it generated the docstring from all those pieces).

Now are there other, perhaps Pythonic ways to do this? Probably. However, it is nice that for a domain specific problem, you can just invent new syntax and use it.


> You're likely being downvoted

I do not care about downvotes on here.

> You can use virtually any character as part of your variable name. Lispers

This is not a good thing.

> However, it is nice that for a domain specific problem, you can just invent new syntax and use it.

This is equally not a good thing.


Saying nothing other than:

1. I don't care 2. Not a good thing

Is not adding anything to the conversation. Have you examined your internal need to spend time commenting on this?


Readability trumps just about all else in software dev, so I am 100% with you there on variable name limits and lack of syntax extension.

```[a-zA-Z_][a-zA-Z0-9_]*``` is such a universal and useful convention that I find myself using it even when the domain allows other characters (bash, Xnix filenames). Obviously this is English-centric so I would include other language constructs if I were in a country with another dominant language.

In fact even though I have the ability (languages supporting unicode and a QMK keyboard) to use symbols, e.g. Greek letters for math, I don't, because I know it's a hassle for anyone else.

> You can use virtually any character as part of your variable name.

> invent new syntax

are a hassle and anti-pattern for the same reason.


I think you think all this stuff is bad because you’re imagining having this power in C or JavaScript, in which case these features would be awful.

However if these features are exposed through clean abstractions in a language that is syntactically bare to begin with, you might have different thoughts.


The original (implicit) question was how one language is better than another. Responding to the answer with "Things shouldn't be different" is probably not the best counter. If you value familiarity, stick to the familiar.


The world’s best optimizing compiler for a quantum programming language was built in Common Lisp [1], and it couldn’t have reasonably been built otherwise.

[1] https://github.com/rigetti/quilc




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: