3 ms·
Yea, but did you open a book on either language? I've trudged through a few Lisp books and tutorials and at least part of a Haskell book. You're right that syn
by 6thaccount2 7y ago
Yea, but did you open a book on either language?
I've trudged through a few Lisp books and tutorials and at least part of a Haskell book. You're right that syntax-wise they're very different than Python & Java, but the simple examples aren't hard once you learn more. Granted, I can't write even moderately advanced Haskell code, but quick-sort and some list comprehension code shown in "Learn you a Haskell" is pretty straightforward. "Real World Haskell" is also not too bad (at least the first few chapters). If you're even aware of Lisp & Haskell, you'll be able to pick them up at least at a superficial level with a little effort. Lisp is just weird due to the parentheses and the pre-fix notation, but the principles are very simple and allow you to directly manipulate the syntax tree as there is no difference between code and data. For example the simple lisp expression (+ 2 2) returns 4. What about (* 2 (+ 2 2))? The inner expression returns 4 and that is passed to the multiplication operator with 2:
(* 2 (+ 2 2))######
(* 2 (4))######
(* 2 4)######
8######
Edit: I have no idea how to format things on HN, so I out six "#" to represent a new line.
Btw...David Touretsky's Common Lisp book is extremely high level and approachable. My biggest issue with many lisps is that installing and learning the tooling (Ex: Emacs) is a huge pain. I'd recommend you start with Racket as it is like Python in that it comes with a simple IDE, so you can focus on the language and not the tooling. Racket also has a lot of libraries for a niche language.
- andredz 7y ago(* 2 (+ 2 2)) (* 2 (4)) (* 2 4) 8
- 6thaccount2 7y agoThank you good soul!
- andredz 7y agoYou are welcome. Here's how to format comments: https://news.ycombinator.com/formatdoc https://news.ycombinator.com/formatdoc