Live data from Hacker News

Why Racket? Why Lisp? (2014)

practicaltypography.com

31–40 of 168 posts

Re: Why Racket? Why Lisp? (2014)

#31

What is a good resource to learn Lisp for an advanced (non Lisp) programmer? Most guides for most languages only cover declaration, simple functions and tiny applications. I want something that quickly goes through the basics and skips to advanced uses in bigger codebases.

Practical Common Lisp by Peter Seibel: http://www.gigamonkeys.com/book/

PCL is a good book but too wordy for my taste.

Paul Graham's ANSI Common Lisp will get an advanced programmer up to an advanced level more quickly and efficiently.

http://www.paulgraham.com/acl.html

Re: Why Racket? Why Lisp? (2014)

#33
post #29

Has anyone tried to use Butterick's Pollen and written about it? The idea of debugging your website with racket as you write markup and styles seemed really interesting alternative to what I do; write styles, refresh, and then refine the stylesheet by incrementally adding changes with the inspector and then copying them to my stylesheet.

I'm working through the admittedly beautiful and very thorough documentation [1]. It's a very simple idea, really: you write your document and sprinkle racket s-expressions wherever you want. You can put your definitions at the top of your document, or in another file. You describe your templates in Racket also, because like Butterick says in his RacketCon video [2], "S-expressions and XML are the same thing". You ca…

> You still have to roll your own CSS and any JavaScript

True, though you can automate those files (and any other text-based files) with Pollen as well, so you can use common functions and data across all of them.

Also, here's the previous discussion of Pollen on HN:

https://news.ycombinator.com/item?id=7822057

Re: Why Racket? Why Lisp? (2014)

#34
post #20
post #15

Earlier quoted context omitted.

It in fact takes it to amusing extremes, allowing you to mutate even the strings associated with symbols. (setf (char (symbol-name nil) 1) #\U) (Though I guess that could be taken as being the same thing as doing nonsensical pointer arithmetic in C -- you simply should know better.)

I'd point out that Common Lisp, kind of like Smalltalk, is a highly dynamic environment that has historically been used as an operating system in itself. That's one reason why the system is so mutable—you don't want to have to relaunch it even to modify core functionality.

I actually don't view mutation in Common Lisp as a downside. I find writing high performance (usually numerical, but sometimes not) code in Clojure to be painfully obtuse compared to Common Lisp, but I love Clojure otherwise. Writing highly optimized code can be quite elegant in Common Lisp, and I appreciate that when the problem at hand calls for it.

Re: Why Racket? Why Lisp? (2014)

#35
post #18

I have so far stuck with Clojure instead of a Scheme primarily because of the nice literal syntax for maps, sets, vectors, and regexes that Clojure supports. I don't want to give that up and just use cons/car/cdr. And also, last time I looked at Racket, it seemed very focused on academics. I just wanted to write some simple Scheme in a .scm file and try it out (a script), but I think I had to choose a language first…

There are also some practical reasons to favour Clojure over Racket, specifically if you work in Java shop. The inertia to move to Clojure but remain on the JVM is going to be considerably lower than moving to whole new infrastructure as would be the case with Racket (indeed the language interoperability offered by the JVM was probably one reason why Scala gained such ground). However, even with Clojure I'm going to get some damn funny looks at the next code review.

Re: Why Racket? Why Lisp? (2014)

#36
It's about a month since I've started seriously diving into lisp.

The last couple of weeks I've spent my days reading 'The joy of Clojure', Structure and Interpretation of Computer programs, lots of tutorials and documentation, playing around in the repl + experimenting with all kinds of frameworks and libs in clojure (eg. Om).

I've spent today implementing the brainfuck interpreter in Racket.

I can't explain it, it's like something is calling me - 'learn lisp. now.'.

Given the amount of Lisp code read/written and the relative novelty of it, I'm dreaming lisp code and the arguments to functions are actual physical things, which are then mapped, reduced, recursed or expanded.

Literally, I think I'm going crazy.

I can fluently write x-platform C++, Javascript/CoffeeScript, Objective-C, Java, Pascal, VB and everything in between.

But never have I experienced this kind of mental strain/obsession as I do now with lisp.

But.

Seems like I'm not alone! Given the amount of lisp news lately on HN, I fell like more and more people are going through what I'm going.

Seems like we here on HN follow a common mental pattern and suddenly everyone's talking/learning lisp.

As interesting as learning lisp is, this 'group preference' thing is even more interesting to observe.

Re: Why Racket? Why Lisp? (2014)

#37
post #18

I have so far stuck with Clojure instead of a Scheme primarily because of the nice literal syntax for maps, sets, vectors, and regexes that Clojure supports. I don't want to give that up and just use cons/car/cdr. And also, last time I looked at Racket, it seemed very focused on academics. I just wanted to write some simple Scheme in a .scm file and try it out (a script), but I think I had to choose a language first…

I'd encourage you to give it a longer try. When selecting a language, just pick R(5,6,7)RS and you're set. Liking syntax sugar is hardly a reason not to use the language with the most powerful macros around. You can write macros to provide nice literal syntax for whatever you want - this is part of the fun.

Have not yet learned to use or appreciate macros.

The idea of everyone having to come up with their own syntax for such commonly-needed things as, say, hashes, seems counter-productive to me. That would lead to everyone's code looking like a different language.

Re: Why Racket? Why Lisp? (2014)

#38
post #35
post #18

I have so far stuck with Clojure instead of a Scheme primarily because of the nice literal syntax for maps, sets, vectors, and regexes that Clojure supports. I don't want to give that up and just use cons/car/cdr. And also, last time I looked at Racket, it seemed very focused on academics. I just wanted to write some simple Scheme in a .scm file and try it out (a script), but I think I had to choose a language first…

There are also some practical reasons to favour Clojure over Racket, specifically if you work in Java shop. The inertia to move to Clojure but remain on the JVM is going to be considerably lower than moving to whole new infrastructure as would be the case with Racket (indeed the language interoperability offered by the JVM was probably one reason why Scala gained such ground). However, even with Clojure I'm going to…

Yes, I think one reason for Clojure's popularity is that it allows you to escape Java while still remaining on the JVM and being able to interoperate with your existing Java codebase.

That said, for a variety of reasons, I would actually prefer to not be tied to the JVM.

Re: Why Racket? Why Lisp? (2014)

#39

For more on the per­- ils of tax­ing reader pa­tience, see WHY DOES TY- POGRAPHY MAT- TER This quote, hyphenated as is, provides all sorts of opportunities for snark. Instead I'll just note that it seems Pollen needs work. It's far too eager to hyphenate; doesn't protrude hyphens, commas, etc.; and doesn't use TeX-style paragraph-level optimization. Not being able to identify the bounds of hyperlinks is also a strong…

Where do you see this? On my machine it's not hyphenated

Re: Why Racket? Why Lisp? (2014)

#40
> (x + (if is_true(): 1 else: 2)) [is invalid in Python] be­cause the if–else con­di­tional is a state­ment, and can only be used in cer­tain positions.

Point taken, but troll-mode pedantry: (x + (1 if is_true() else 2)) would be valid :)

Post reply on HN