TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Dabbling in Erlang, Part 2: A Minimal Introduction

75 pointsby pasxizeisover 11 years ago

8 comments

anonymouzover 11 years ago
In the section &quot;Functional programming for real&quot; he states:<p>&gt; Note that the order of the definitions is important: had we moved our base case at the bottom, the recursion would never finish because map(F, [H|T]) would always match (remember? an empty list is also a list with a head and a tail).<p>Which confuses me a bit, since I am used to the empty list <i>not</i> having a head (I am thinking for example of Haskell). Is it true that in Erland the empty list has a head? And what would it be? Some generic null object?
评论 #6539344 未加载
评论 #6539295 未加载
评论 #6539583 未加载
评论 #6539214 未加载
stiffover 11 years ago
I have written a more quickly paced Erlang tutorial some years ago, it is not even online anymore, but here is a copy from archive.org:<p><a href="http://web.archive.org/web/20080708140354/http://www.stifflog.com/2007/05/09/erlang-for-the-practical-man/" rel="nofollow">http:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20080708140354&#x2F;http:&#x2F;&#x2F;www.stifflo...</a><p>I must shamelessly say it seems to have aged reasonably well, unlike some other things I wrote I actually read it now with interest, especially I haven&#x27;t dabbled in Erlang since and forgot some details.<p>I recommend everyone who finds fun in programming to give Erlang a shot, I don&#x27;t think it&#x27;s great for all the use cases (what is?), but, for example, for writing servers of all kinds it&#x27;s totally awesome, especially with OTP, which I didn&#x27;t cover in my tutorial. It&#x27;s also completely different from everything else, even if you know Prolog or Haskell&#x2F;ML, which are related in some ways. One day I would really like to get myself together and write something like a game server for poker or bridge in it.
GrinningFoolover 11 years ago
This is a pretty good introduction and is pretty accessible on first pass through.<p>However, a factual error:: &quot;(remember? an empty list is also a list with a head and a tail).&quot;<p>An empty list is an empty list :) You could switch the order of those two function heads and &#x27;map&#x27; would still behave properly.
评论 #6539620 未加载
robblesover 11 years ago
For anyone finding the syntax of list comprehensions a bit confusing (like me), I found this comparison to be useful if you&#x27;re familiar with the more readable (usually) Python equivalent:<p><pre><code> [expression(element) || element &lt;- list, conditions] </code></pre> is the same as<p><pre><code> [expression(element) for element in list if condition]</code></pre>
ritonlajoieover 11 years ago
Is there some platform that offers such a VM as Erlang&#x27;s one, but without the functional language ?
评论 #6540619 未加载
appostolisover 11 years ago
That&#x27;s awesome mate keep up!!!
rdtscover 11 years ago
I like the pace, the formatting, and the content. Would love to see more! Great work!
评论 #6539850 未加载
eddie_the_headover 11 years ago
Two .gr &#x2F; Greek links on HN in a day, nice.
评论 #6540005 未加载