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.

My favorite Erlang program (2013)

184 pointsby cpreciosoabout 5 years ago

6 comments

manthideaalabout 5 years ago
You can find more information about erlang in this Ph.D Thesis (1), on page 86 is an example of a universal server, explained with detail.<p><a href="https:&#x2F;&#x2F;erlang.org&#x2F;download&#x2F;armstrong_thesis_2003.pdf" rel="nofollow">https:&#x2F;&#x2F;erlang.org&#x2F;download&#x2F;armstrong_thesis_2003.pdf</a>
评论 #22415759 未加载
kitdabout 5 years ago
Excuse my Erlang ignorance.<p>When he sends the &quot;{become, F}&quot; message, and F is a function pointer or closure, how is that dispatched across a network? Do the code definitions need to be present remotely too? If so, I&#x27;m not sure that quite qualifies as a &quot;universal&quot; server, only a server for locally defined functions. Still cool though.<p>BTW, I&#x27;ve used a similar technique to create a pool of worker goroutines in Golang. Had good performance from it too.
评论 #22413678 未加载
评论 #22413842 未加载
评论 #22416171 未加载
评论 #22413727 未加载
评论 #22415420 未加载
Jtsummersabout 5 years ago
Here are a couple previous discussions (only linking ones with comments):<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=12396420" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=12396420</a> (38 comments)<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=8807660" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=8807660</a> (2 comments)
ProfHewittabout 5 years ago
Unfortunately, Erlang does <i>not</i> directly implement Actor behavior change.<p>Consequently, Erlang cannot directly implement Actor behavior change. A factorial server is implemented below:<p><pre><code> FactorialServer[ ] *implements* ProcedureServer&lt;[NaturalNumber], NaturalNumber&gt; [i] |-&gt; &#x2F;&#x2F; received message [i] Factorial.[i] &#x2F;&#x2F; return result of sending [i] to Factorial </code></pre> In order to implement Actor behavior change, Erlang must resort to using helper processes that trampoline back so that helper processes can return the desired change.<p>See the following for direct implementation of Actor behavior change:<p><pre><code> https:&#x2F;&#x2F;papers.ssrn.com&#x2F;abstract=3418003 </code></pre> PS. The type ProcedureServer above can be defined as follows:<p><pre><code> ProcedureServer&lt;t1, t2&gt; ≡ &#x2F;&#x2F; Procedure server with parameters types t1 and t2 is defined to be t1 -&gt; t2 &#x2F;&#x2F; type of procedure from t1 into t2</code></pre>
评论 #22415211 未加载
holtalanmabout 5 years ago
RIP Joe Armstrong.
评论 #22417914 未加载
评论 #22420011 未加载
quothaabout 5 years ago
My favorite erlang-based blockchain<p><a href="https:&#x2F;&#x2F;aeternity.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;aeternity.com&#x2F;</a>