Live data from Hacker News

Why Racket? Why Lisp?

practicaltypography.com

51–60 of 295 posts

Re: Why Racket? Why Lisp?

#51
post #23

> If Lisp lan­guages are so great, then it should be pos­si­ble to sum­ma­rize their ben­e­fits in con­cise, prac­ti­cal terms. His list is concise but man did he take a while to get to it! Seriously though. The introduction was super relevant as I have wondered the exact same question about Lisp myself. What features make it so praise-worthy? Maybe X-expressions isn't a core feature for everyone to appreciate, but t…

By feature set you mean sequences, map/filter/reduce and such ?

I felt there was more to Lisp than that. It was the root of the ML/function-based family, which deepened the recursive typed logic McCarthy talked about in his early papers.

The first-class function and functions as modeling unit, giving composability, and domain embedding as first class.

Re: Why Racket? Why Lisp?

#52
post #6

I sure hope the giant, hideous, obtrusive diamonds inserted into the text to denote a hyperlink doesn't catch on as a trend. It's a great way to break the flow of the text and irritate your readers. As for the idea of Lisps, well, it sure seems neat. But I've literally never run across a situation where I needed my code to edit itself. I've never run across a situation where the lack of an everything-is-an-expression…

giant, hideous, obtrusive diamonds inserted into the text to denote a hyperlink

I hadn't even noticed that they're hyperlinks, I thought something had went wrong with the text formatting or character set!

I've literally never run across a situation where I needed my code to edit itself.

Needed to is too strong a statement. I've never needed to write a macro (and in Clojure, its somewhat frowned upon to write macros when normal functions will do), but sometimes it saves you from a lot of working around limitations (and every language has limitations). It also allows things to be added to the language as libraries that otherwise would have to be built in - the majority of programmers won't need to do this, but if you do, its awesome knowing that its possible. Clojure's core.async is an excellent example (Go-style goroutine's, as a library).

I've never run across a situation where the lack of an everything-is-an-expression-is-a-list feature prevented me from doing what I wanted to do.

Of course not, but you can also do everything you want in assembly. What everything-is-an-expression-is-a-list gives you is 1) uniformity - everything works the same way, so it lowers the cognitive load; 2) simpler code - if you need a statement in an expression, you can do so, and other languages don't prevent you from getting the same result - they just take more code, or the code is more complex, or you use less-than-ideal constructs, or...

So you never need these things, but they make life more pleasant to have them.

I just don't really feel the need to get repetitive strain injuries in my pinky from reaching for the parentheses all the time.

I program in Clojure fulltime and I don't find that it has any more parentheses than a language like C++ or Java does. On top of that, anyone who programs in a Lisp for a while will use some form of paredit, which makes working with parentheses a breeze to the point where I find I type less than I do in other languages because jumping between parentheses, splicing parentheses-enclosed lists, wrapping things in parentheses and such tasks are a single keypress that just isn't possible in other less-parentheses-focused languages.

In short, just like significant whitespace in Python, parentheses are a non-issue in practice (after a short adjustment period).

But at the end of the day, to each his own. If Lisp doesn't do it for you, then that's fair enough - you don't have to use it :-)

Re: Why Racket? Why Lisp?

#53
post #45

Why Lisp? That is understood. Why Racket? From an ignorant outsider's perspective, all Lisps seem to be more or less interchangeable when it comes to the language. They only differ in the details, and each seems to be about as difficult to learn as the other. Although this article does make somewhat of a case for specifically Racket, it seems to be a rather weak one - tools are nice and some language details are nice…

Racket has probably the best macro system out of all existing lisps available to date. Plus it has concept of extensible languages via #lang. If you care about lisp-style macros and meta-programming that's probably the main reason why I would recommend Racket.

Clojure macros in comparison are very ascetic. You can get stuff done in them but it's not a strong feature of the language in my opinion.

Re: Why Racket? Why Lisp?

#54
post #6

I sure hope the giant, hideous, obtrusive diamonds inserted into the text to denote a hyperlink doesn't catch on as a trend. It's a great way to break the flow of the text and irritate your readers. As for the idea of Lisps, well, it sure seems neat. But I've literally never run across a situation where I needed my code to edit itself. I've never run across a situation where the lack of an everything-is-an-expression…

I didn't mind but note that he wrote http://practicaltypography.com.

As for not missing stuff from Lisps, I think opportunities start appearing once you start using it more. But I agree, it doesn't prevent you from getting things done.. I don't see any Lisp in the Go space (native compilation, great networking features), so I find Go more pragmatic at this time.

Re: Why Racket? Why Lisp?

#55
post #13
post #8

Please.... text-align: justify; ...

Please... see http://practicaltypography.com/justified-text.html for the author's opinion. Personally I believe that Matthew is wrong there. There's no justification for justification. :-)

Also on that page: "Jus­ti­fi­ca­tion is a mat­ter of per­son­al pref­er­ence. It is not a sig­ni­fi­er of pro­fes­sion­al ty­pog­ra­phy. "

Re: Why Racket? Why Lisp?

#56
post #46
post #44

Earlier quoted context omitted.

I'm talking about something like this.. def foo(): do_this() and_this() later I change it.. def foo(): if something(): do_this() and_this() oops... and_this() should have been in the if block and I won't find out till I run it. (imagine a much bigger more complex example of the above function) In large pieces of code this can be easy do. If you are forced to use parenthesis it's much more difficult to make this error…

> If you are forced to use parenthesis it's much more difficult to make this error. By "parentheses" you mean delimiters, which create visible boundaries to defined areas in code. Parentheses are an example of delimiters, but not all delimiters are parentheses. Bash has if ... then ... else ... fi Ruby has if ... else ... end C/C++/Java have (logical test) { controlled area }, nested to any practical depth. And so fo…

Well I used the word parenthesis since the topic was Lisp.

> This is an argument against complex functions that do a lot

Functions large and complex enough to make this problem significant seem to be the reality I have to deal with when programming in the large. It's only my opinion but a language feature that improves my real world experience at no cost is a bonus.

Re: Why Racket? Why Lisp?

#57
post #20

Earlier quoted context omitted.

I would assume it'd be the same as people complaining about significant whitespace in python. No one who actually programs in python complains about the whitespace.

> No one who actually programs in python complains about the whitespace. I wouldn't say "no one." I read comments regularly from people, usually students, who get into trouble with whitespace in Python, especially if they mix tabs and spaces in the same source file.

If you're mixing tabs and spaces in the same source file, chances are that you're not a very seasoned python programmer. I would imagine a large segment of students also complain about parens in lisp.

Though to be fair, there would be some people that use python day-to-day that don't like significant whitespace. I'd bet there'd be at least a few lispers that don't enjoy wrangling parens.

Re: Why Racket? Why Lisp?

#58

From what I've seen out of the Clojure community over the past few years, it seems like they're far more likely (and able) to offer up concrete examples of how Clojure makes their businesses and products successful in a way that an imperative language could not. So, yay Clojure community, and boo on hand-wavy Lisp people. e.g.: http://www.kreuzwerker.de/en/blog/posts/why-clojure-rocks-2/ https://news.ycombinator.com/…

> ... in a way that an imperative language could not

Perhaps a nitpick, but sometimes nomenclature is important. Clojure (like all Lisps) is an imperative programming language. "Imperative" languages are contrasted with "declarative" languages[1]. Where does functional fit in and what is the name for "non-functional"? Well, that's not clear, as "functional" (in the PL sense) doesn't even have an agreed upon definition. Is Clojure "functional", then? Well, it's certainly not pure like Haskell is (and it has explicit loops etc.), but it does encourage more uses of function composition than, say, Java, it's more declarative, and it also isn't object-oriented, but that doesn't make it not imperative. Actually, I think even Haskell still qualifies as imperative.

But Clojure can certainly be contrasted with OO and procedural languages (even though at least one of its core abstractions -- protocols -- is borrowed from OO).

[1]: http://en.wikipedia.org/wiki/Imperative_programming

Re: Why Racket? Why Lisp?

#59
post #38
post #29

Earlier quoted context omitted.

I program in python (and C/C++) and really dislike python's whitespace handling. I think giving semantic meaning to one of the least-standardized aspects of text (tabs/spaces) is a bad decision through and through.

That's the thing. Python does standardise it. 4 spaces, no tabs.

Not quite...

http://legacy.python.org/dev/peps/pep-0008/#tabs-or-spaces

Spaces are the preferred indentation method.

Tabs should be used solely to remain consistent with code that is already indented with tabs.

Python 3 disallows mixing the use of tabs and spaces for indentation.

Python 2 code indented with a mixture of tabs and spaces should be converted to using spaces exclusively.

When invoking the Python 2 command line interpreter with the -t option, it issues warnings about code that illegally mixes tabs and spaces. When using -tt these warnings become errors. These options are highly recommended!

Re: Why Racket? Why Lisp?

#60
post #35

From what I've seen out of the Clojure community over the past few years, it seems like they're far more likely (and able) to offer up concrete examples of how Clojure makes their businesses and products successful in a way that an imperative language could not. So, yay Clojure community, and boo on hand-wavy Lisp people. e.g.: http://www.kreuzwerker.de/en/blog/posts/why-clojure-rocks-2/ https://news.ycombinator.com/…

That is also a sore point from the Lisp community in regard to Clojure. Clojure devs are willing to compromise a bit to allow a good integration within the JVM and other implementations, thus allowing some shops to buy into Clojure. Whereas many in the Common Lisp community will not, no matter what.

A long time ago, the inventor of the Clojure language Rich Hickey wrote a Java bridge for one Common Lisp implementation that was very good - I used it a lot for a while.

So, Rich has been thinking of the practicalities of Java interop for a long time.

Post reply on HN