TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: What should I give priority, Lisp, Haskell, or the Dragon Book?

6 点作者 thegenius2000超过 9 年前
I realise the Lisp&#x2F;Haskell question has been asked before, so let me clarify. I&#x27;m about to enter my second year of uni (studying ECE) and I&#x27;m trying to decide what to focus my time on. I&#x27;m very interested in learning about writing compilers, but I also want to grow my skill in programming. Currently, the only languages I know are C-derivatives, and although I&#x27;m falling in love with Go, I know that it probably won&#x27;t give me fundamentally new ways to think about software.<p>So, to the issue at hand. I&#x27;ve been struggling to start The Dragon Book, as I find it incredibly dense and difficult to understand (though, to confess, I haven&#x27;t given it the dedication it deserves). Also, after reading some of PG&#x27;s essays and threads on StackOverflow&#x2F;Reddit&#x2F;Hacker News, I&#x27;ve been convinced that Lisp is an important language to learn, esp. because of functional programming (which I don&#x27;t know much about). Then I recently ran into Haskell, which seems to offer some of the same.<p>My question is this, because I&#x27;m in school, I have plenty of free time, but it&#x27;s still a limited resource. Between the 3 things I&#x27;ve listed (Lisp, Haskell, Compilers), which do you consider to be most enriching? (To the experienced) if you were back in your hacker-youth, knowing only a few languages and how to use a shell, what would you do? Am I making a mistake by starting with the Dragon, and if so, what do you recommend? Should I learn Lisp then Haskell or vice-versa? And what should I prioritize, compilers or more languages?

9 条评论

brudgers超过 9 年前
My idiosyncratic but free advice:<p>Lisp and specifically Racket because:<p>1. It&#x27;s a community that is strongly oriented toward meeting the needs of students.<p>2. It&#x27;s documentation is top notch.<p>3. It&#x27;s a single download with no external dependencies. There&#x27;s even a pretty good IDE (that even has a fairly compatible Emacs mode).<p>4. Racket in the large is an ecosystem that has tools for many many aspects of computer science that a student even at the graduate level might want to play with [meta-programming, objects, type systems, logic programming, ffi, Algol 60, web systems, etc.]. And it all comes down in one package and there&#x27;s no futzing around with package managers unless you want something that you probably don&#x27;t want for a long while...did I mention it&#x27;s a single download.<p>5. It&#x27;s beginner friendly. It has its own textbook. It has a gradient of languages with increasing complexity.<p>I&#x27;ve got nothing against Haskell or Go or anything else. And for a person in a different situation I might be high on one of them...or Erlang. But the orientation of their communities is different and so the problems that they&#x27;re good at is different, i.e. Go solves Google&#x27;s problem of hiring a lot of people with a C++ background for systems programming and the problem of packaging programs that run on more servers than one can deploy reasonably to in a week [it uses native executable binaries].<p>Or learn JavaScript.<p>Good luck.
评论 #10892538 未加载
such_a_casual超过 9 年前
I&#x27;m currently learning Common Lisp. After I wrote my first real program with it (not a tutorial), I knew I made the right choice. After hours getting everything to work, when all was said and done, all that was left was this tiny, succinct thing. Was this really everything I was trying to do? Had the answer really been that simple? And I thought to myself, this is what programming is supposed to be, not a bunch of spaghetti code brute forcing one&#x27;s self through the program, but the search for something concise and beautiful that says something about the problem and solution.<p>There seems to be a certain personality associated with lisp programmers, which emanates when they speak about the language. So logically I was pretty confident in my choice from day 0. However it wasn&#x27;t until I actually made a program with it that I was emotionally confident and content with the choice.<p>In conclusion, I recommend you build a program with Haskell, Lisp, and&#x2F;or an idea from the dragon book. That experience may give you the best idea of what path will be the most rewarding.
meric超过 9 年前
Go Haskell. It&#x27;s even more different from Lisp &amp; Algol-like languages than the difference between Lisp &amp; Algol-like languages.<p>Lisp &amp; Algol-like has the difference where Lisp&#x27;s code is also data and its code can rearrange code using macros written in Lisp itself. Both can have functional programming inspired constructs like `map` and `fold` as functions.<p>Haskell is different because all its code is lazy. So if you write `take 1 (map ((*) 2) [1..1000000000000])`, it runs instantly even though writing idiomatic lisp or python or C will have the computer spinning for ages going through all those numbers you don&#x27;t even use. It also has partial application of functions, as well as pure functional programming by preventing you to write a line that doesn&#x27;t contribute to the returned value. The sophisticated type system I have not ever seen outside of the ML family of languages, either.<p>I haven&#x27;t read the Dragon Book, but I&#x27;ve written some compilers in my free time, and my compiler code was much better after I had a go at Haskell.
siscia超过 9 年前
I will suggest, in your situation to read the SICP.<p>It us Scheme (a kind of Lisp), it is very functional focused, so many concept will translate fairly good with Haskell and along the way it teach you the fundamental of an interpreter, which is not quite a compiler, but still matching what you are interested in.<p>And you will be a better coder after that book, I guarantee :)
kele超过 9 年前
I suggest you don&#x27;t start reading about writing compilers if you know only C-derivatives.<p>As for the choice of a functional language for a beginner, I think you just should pick whatever has better introductory materials available. You&#x27;re likely to experience a big mental shift by using a functional language for the first time. It was a struggle for me, at least. That being said, I&#x27;d recommend a Lisp derivative - Racket. It has a very nice tutorial and a good IDE. Also, John Carmack&#x27;s son game in Racket: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=10111479" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=10111479</a>
Al__Dante超过 9 年前
If you want to learn a functional language, Lisp is a good choice. It has been around a long, time, so it is stable and well supported, and it is also the basis for many other languages. Haskell, while also an excellent language, is more niche.<p>Deciding whether to learn a language or learn how to write a compiler is more difficult. If you are struggling with the Dragon book, have you condidered &quot;Modern Compiler Implementation in ML&quot;? Although ML is even more niche than Haskell, it is a functional language and the book takes you step-by-step through the process of writing a compiler for (a subset of) it.
评论 #10886385 未加载
bribri超过 9 年前
Learn Haskell, it significantly changed the way I think about programming and those new perspectives have been applicable in the other languages I&#x27;ve written in. Lisp is good, but I think Haskell will broaden your horizons more. The only problem is Haskell is really hard to learn and there aren&#x27;t a ton of good learning resources. I suggest learning a simpler, similar language Elm, to start thinking functionally, and then move on to Haskell.
merqurio超过 9 年前
Based on the experience of a friend of mine, Lisp. He first learnt the language, managed to do cool stuff and the he wrote his own compiler. It&#x27;s been a nice journey from outside, I&#x27;m sure it was even better for him!
TurboHaskal超过 9 年前
It doesn&#x27;t matter. Whichever you choose of those three will turn you into an unemployable mess.
评论 #10886373 未加载