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.

From Ruby to Haskell, Part 1: Testing

66 pointsby twopoint718over 12 years ago

4 comments

danneuover 12 years ago
Just talking aloud, here. Sorta frustrated.<p>I recently dove into Scala for fun and I enjoy its terse syntax (often more terse than Ruby's!) and principles. I was really excited about it at first.<p>But the excitement went away pretty quickly last weekend when I actually tried building things with it.<p>Setting up a Sinatra app in Ruby is a matter of 'gem install sinatra', a 'require "sinatra"', and you're ready to roll.<p>Meanwhile setting up a Scalatra app in Scala was a far more involved process, every tutorial getting me to use a tool called 'giter8' just to copy down app boilerplate from github. I also ran into general difficulties just setting up IntelliJ/Eclipse, falling back to Vim which makes compilation errors feel like runtime errors since I had to go back to the terminal to see that my program didn't even compile.<p>I pine for a world where I can just `scale install scalatra` (or pop it into my Scalefile), `$ vim app.scala`, and begin coding.<p>I still plan on writing some "Scala for Rubyists"-type blog posts, but it's a shame I couldn't figure out and enjoy the actual workflow. I'd have more patience coming from an ecosystem that didn't make things as easy as Ruby's does, but I've realized that tools/workflow/environment are showstoppers no matter how much you enjoy a language.
评论 #4884766 未加载
评论 #4886151 未加载
评论 #4885604 未加载
评论 #4884868 未加载
评论 #4886152 未加载
freshhawkover 12 years ago
Heh, never seen someone so defensive about using Haskell before.<p>I'm not sure that the "here's now to do this Ruby thing in Haskell" method of learning Haskell is a good way to go about it. It would work well to teach Python or JS but not a Lisp or Haskell or Prolog. They differ at a lower level and require different mental models to even understand them, nevermind thinking in them.<p>I don't see it helping if you are trying to cram monads, laziness, side effect free programming, inferred types <i>and</i> new syntax into the mental model of code execution you use for Ruby.<p>Has anyone learned that way and found it useful? Do you learn a few things in a familiar context while cargo-culting the rest and then fill in the gaps later? Does it just click all of a sudden?<p>My biggest struggle was learning to think in Haskell and this type of mixed metaphor teaching material would just make things worse. That might not apply to everyone, but if it applies to you then you aren't alone. Try learning the execution model with little toy programs first, then move on to the kind of software you are used to writing once you know how to look at Haskell code and reason about what it does.
评论 #4885725 未加载
评论 #4885763 未加载
gtaniover 12 years ago
<p><pre><code> move from perhaps the most dynamic language to what is perhaps the most static? </code></pre> I don't think this continuum has any meaning, but s/he should look at GHC Typeables, deferred type checking and the type holes work in the "most static"<p><a href="http://www.reddit.com/r/haskell/comments/10u7xr/ghc_head_now_features_agdalike_holes/" rel="nofollow">http://www.reddit.com/r/haskell/comments/10u7xr/ghc_head_now...</a><p><a href="https://news.ycombinator.com/item?id=4380900" rel="nofollow">https://news.ycombinator.com/item?id=4380900</a><p><a href="http://hackage.haskell.org/trac/ghc/wiki/DeferErrorsToRuntime" rel="nofollow">http://hackage.haskell.org/trac/ghc/wiki/DeferErrorsToRuntim...</a>
评论 #4885679 未加载
coderhsover 12 years ago
Why? whats the need or advantage of going to Huskel from Ruby??
评论 #4884623 未加载
评论 #4884780 未加载
评论 #4910470 未加载
评论 #4886044 未加载