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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

How we secretly introduced Haskell and got away with it

313 点作者 philippelh大约 8 年前

24 条评论

mybrid大约 8 年前
In the 1990s I did research on the efficacy claims of object oriented programming versus procedural programming. This article bares a striking resemblance in the claims. Case study after case study showed that object oriented code had less bugs due to compilers catching bugs, etc. However, almost every study was similar to this report: it was a re-write from procedural to object-oriented. There exists strong evidence to suggest that throwing away ones first prototype produces the same results as to benefits comparing object-oriented versus procedural programming. The conclusion of my research was the same as others: unless one is comparing the same project written from scratch without any sharing of design or code then these studies claims are correlation, not causation.
评论 #13783649 未加载
评论 #13783611 未加载
评论 #13784921 未加载
评论 #13784051 未加载
评论 #13783661 未加载
评论 #13785595 未加载
评论 #13784286 未加载
评论 #13783894 未加载
评论 #13783609 未加载
评论 #13785194 未加载
评论 #13786087 未加载
评论 #13785354 未加载
评论 #13785179 未加载
评论 #13783544 未加载
评论 #13784635 未加载
daxfohl大约 8 年前
I&#x27;m just starting with Haskell and PureScript. So far I&#x27;m liking the latter better. It solves a few of their gripes with respect to strings, laziness and records, plus has a more granular&#x2F;extendable effects system and cleans up the standard typeclass hierarchy. Also `head []` doesn&#x27;t crash.<p>Of course Haskell is more mature, has support for multithreading and STM, compiles to native, so it&#x27;s more performant. But PureScript integrates with JS libraries and seems &quot;fast enough&quot; in many cases. I think it&#x27;s more interesting <i>as a project</i> too: the lack of runtime and laziness means the compiler code is orders of magnitude simpler than Haskell&#x27;s, so I could see a larger community building around it if it catches on.<p>Given that they were on Python earlier, I wonder if PureScript would have been a better choice.
评论 #13787534 未加载
评论 #13785328 未加载
评论 #13784618 未加载
评论 #13785808 未加载
评论 #13788977 未加载
sid-kap大约 8 年前
The comparison between Stack and Python build tools is striking:<p>&gt; No messing around with virtualenvs and requirement files. Everybody builds with the same dependency versions. No more “works on my machine” and “did you install the latest requirements?”.<p>I wonder why the Python ecosystem, which is much more mature, doesn&#x27;t provide a build tool as delightful as Stack (which is less than 2 years old).
评论 #13783758 未加载
评论 #13783354 未加载
评论 #13783350 未加载
评论 #13783541 未加载
评论 #13783371 未加载
slezakattack大约 8 年前
&quot;It is said that Haskell programmers are a rare species, but actually the majority of developers at Channable had used Haskell before.&quot;<p>Could you imagine if this wasn&#x27;t the case? The hurdle to actually get people excited about a language such as Haskell especially moving from something like Python would potentially be huge. Kudos for already having that problem solved.
评论 #13784085 未加载
评论 #13791528 未加载
gaius大约 8 年前
At one company I experimentally wrote OCaml and named the resulting native binaries whatever.py. None ever looked at them. So there is alot of scope for shenanigans.
Twirrim大约 8 年前
While it&#x27;s an interesting look at a change you introduced, that blog title might not come across quite as intended.<p>If you&#x27;re having to &quot;secretly introduce&quot; tech, and &quot;get away with it&quot;, that suggests there are unnecessary and unproductive constraints on your work; maybe even suggesting that you&#x27;d get in trouble for actually daring to make things better.
评论 #13784505 未加载
评论 #13784022 未加载
framp大约 8 年前
Glad to see Haskell used in production.<p>It&#x27;s kind of funny that build reproducibility (which was a major issue before stack) is one of the strong point.<p>I wonder if, for your project, using cloudhaskell would have been more appropriate. I have a feeling some of the problems you found could have been solved with that.
lima大约 8 年前
You <i>can</i> deploy Python code as a static binary that includes the interpreter along with all dependencies. I heavily use this in production and life is great - deployment means copying one single binary, reverting means running an older one instead. No external dependencies, no pip upgrades, just libc.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;pyinstaller&#x2F;pyinstaller" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;pyinstaller&#x2F;pyinstaller</a>
techman9大约 8 年前
&gt; No messing around with virtualenvs and requirement files. Everybody builds with the same dependency versions. No more “works on my machine” and “did you install the latest requirements?”.<p>While this is nice, of course, I&#x27;m not sure that is outcome is unique to Haskell&#x2F;Stack. It seems like you could accomplish a similar level of reproducibility by building a Docker image or bundling dependencies in some other way.
评论 #13785990 未加载
评论 #13785266 未加载
arianvanp大约 8 年前
I&#x27;m the author of the post. I&#x27;ll be happy to answer any of your questions :)
评论 #13785285 未加载
评论 #13783689 未加载
评论 #13784261 未加载
评论 #13784757 未加载
评论 #13787571 未加载
jwatte大约 8 年前
Instead of using separate monad transformers, we use a single &quot;World&quot; that knows how to provide Redis, logging, iOS, and other typeclass instances.<p>There is a RealWorld that runs on top of IO and a FakeWorld that runs on top of pure State for unit testing.<p>This means that we have to wrap every single API into our own &quot;SupportsRedis&quot; and similar APIs, but in the end I think it&#x27;s worth it! Unit tests are super fast and not intermittent at all.
yawaramin大约 8 年前
Nice article. Out of curiosity, what does your write with? Vim&#x2F;ghc-mod? Emacs&#x2F;Intero? IntelliJ IDEA&#x2F;plugins? Atom&#x2F;VSCode etc.?
评论 #13784186 未加载
javajosh大约 8 年前
In case anyone was wondering, the &#x27;stack&#x27; command in the article refers to <a href="https:&#x2F;&#x2F;docs.haskellstack.org&#x2F;en&#x2F;stable&#x2F;README&#x2F;" rel="nofollow">https:&#x2F;&#x2F;docs.haskellstack.org&#x2F;en&#x2F;stable&#x2F;README&#x2F;</a>. Which actually looks kind of wonderful.
kisstheblade大约 8 年前
Always when I see haskell demonstrations eveyrthing looks like just interface declarations.<p>You can do beautiful interfaces with eg. java also. But where is the meat where anything actually happens? I rarely see that in these posts. Yes I could look up the source but I don&#x27;t have time to read through it randomly.<p>This looks just so nice and stuff just magically works?:<p>runWorkerLoop :: (MonadBackingStore m, MonadLogger m, MonadIO m) =&gt; WorkerState -&gt; m WorkerState<p>And monads to boot! (are monads haskells equivalent of java factories? I kid, I kid :)
评论 #13786203 未加载
contravariant大约 8 年前
&gt; The issue here is that we cannot run runWorkerLoop and runFetchLoop with forkIO, because we don’t have the right transformer stack.<p>Am I understanding correctly that this is because, while you can lift e.g. runFetchLoop to something of type IO m (), it&#x27;s not possible to convert use forkIO on it since it requires an input of type IO ()? Isn&#x27;t that just a consequence of the fact that Haskell has no possible way of knowing if your side effects can be contained in the IO monad?
评论 #13784714 未加载
评论 #13784989 未加载
davedx大约 8 年前
Good luck with hiring!
评论 #13784244 未加载
评论 #13785598 未加载
评论 #13787051 未加载
osi大约 8 年前
makes me wonder how long they would have lasted had the initial implementation been done simpler (ie, not in their PyDatalog fork).
hota_mazi大约 8 年前
&gt; but if we could get it done, there would be no going back<p>The naïveté in this simple statement is so cute.<p>The list of concerns is also pretty naïve. The main problem you are going to encounter with this project is hiring. If you want to grow this project or if the main developers leave the company, I bet it will get rewritten in a different language in no time.
评论 #13786992 未加载
guptaneil大约 8 年前
It looks like jobmachine is a private repo, maybe don&#x27;t include the url in your blog post :)
评论 #13783834 未加载
评论 #13783384 未加载
mehaveaccount大约 8 年前
Actually if you wanted a statically typed compiled functional language of Haskell while keeping the declarative logic paradigm of Prolog, then the Mercury programming language was made exactly for you!
xyzzy4大约 8 年前
Haskell is a bad language, in my opinion, because you can&#x27;t tell what the O(n) run-time is for any operation. Instead you just have to &quot;trust&quot; that it&#x27;ll be fast enough.<p>More on this: <a href="https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;haskell&#x2F;comments&#x2F;1f48dc&#x2F;what_does_the_haskell_runtime_look_like&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;haskell&#x2F;comments&#x2F;1f48dc&#x2F;what_does_t...</a><p>All of the answers seem insufficient. Basically you can&#x27;t estimate Haskell run-time unless you are very familiar with the internal Haskell engine.
评论 #13785331 未加载
评论 #13784769 未加载
评论 #13785347 未加载
ctlaltdefeat大约 8 年前
There are various mature options for scheduling jobs with dependencies between them.<p>Why did you choose to write your own, regardless of the language?
评论 #13787508 未加载
vorotato大约 8 年前
I&#x27;d use haskell if it weren&#x27;t lazy by default and didn&#x27;t use Cabal. Aka I&#x27;d use OCaml&#x2F;F#.
eternalban大约 8 年前
&gt; Our lead developer Robert usually comes in a bit later, so we had about an hour to build a working prototype.<p>I&#x27;m guessing he is a Python developer and likely he is no longer the lead.
评论 #13783592 未加载
评论 #13786650 未加载