Live data from Hacker News

From Ruby to Haskell, Part 1: Testing

bendyworks.com

11–20 of 21 posts

Re: From Ruby to Haskell, Part 1: Testing

#11
post #8
post #7

Earlier quoted context omitted.

libraryDependencies ++= Seq( "org.scalatra" %% "scalatra" % "2.0.4", "org.scalatra" %% "scalatra-scalate" % "2.0.4", "org.scalatra" %% "scalatra-specs2" % "2.0.4" % "test", "ch.qos.logback" % "logback-classic" % "1.0.0" % "runtime", "org.eclipse.jetty" % "jetty-webapp" % "7.6.0.v20120127" % "container", "javax.servlet" % "servlet-api" % "2.5" % "provided" ) in your build.sbt too difficult? Admittedly a bit longer tha…

You just copy and pasted the output of giter8's black magic* and asked me if I think the resulting magical incantation is too difficult? Look at Scalatra's installation steps: http://www.scalatra.org/getting-started/installation.html . They don't even give you the sbt dependency. They just direct you to the tool that generates it for you. -- A tool that's only used for a couple other dozen projects: https://github.co…

Is Maven too complicated for you or something?

Those are just the latest version of the various libs.

Re: From Ruby to Haskell, Part 1: Testing

#12
post #3

Just talking aloud, here. Sorta frustrated. 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. But the excitement went away pretty quickly last weekend when I actually tried building things with it. Setting up a Sinatra app in Ruby is a matter of 'gem install sinatra', a 'require "sinatra"', and you're ready to roll.…

Can/did you try http://www.playframework.org/

It's more like a Rails framework for Scala.

Re: From Ruby to Haskell, Part 1: Testing

#13
post #10

move from perhaps the most dynamic language to what is perhaps the most static? 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" http://www.reddit.com/r/haskell/comments/10u7xr/ghc_head_now... https://news.ycombinator.com/item?id=4380900 http://hackage.haskell.org/trac/ghc/wiki/DeferErrorsToRuntim...

Here's where the "most dynamic/static/whatever" probably came from

http://james-iry.blogspot.com/2010/05/types-la-chart.html

Re: From Ruby to Haskell, Part 1: Testing

#14

Heh, never seen someone so defensive about using Haskell before. 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. I don't see it helping if you are…

"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?"

That's how I learned to write my first useful programs.

Maybe there is a better way, but that is the direct answer to your direct question.

Except I wouldn't say that it clicks "all of a sudden". It's a long process of learning. One day something doesn't work, and you think it should, and you just keep narrowing it down and eventually come to some deeper realization. It's the top-down approach to learning.

I've been trying to learn haskell bottom-up for a while, and I've done a few things and have some understanding of the theory. But I don't have anything to show for it. Every time I learn some new theoretical thing, I think "wow, what could I program with this?", at which point I've already lost. Because once I start thinking about the language rather than the utility, I'm not likely to create anything amazing.

I think that I'd be more successful if the next idea I had I just coded up in haskell (even though I don't really know it) and pushed through to a solution by any means necessary. But for me, learning a new language is secondary to realizing my visions; and my visions rarely start from an empty file any more.

That being said, I think a mix of bottom-up and top-down is probably best. There are some fundamental things that you need to learn deeply at some point to be good. Not sure the exact stages that these things should be learned, though.

Re: From Ruby to Haskell, Part 1: Testing

#15
post #3

Just talking aloud, here. Sorta frustrated. 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. But the excitement went away pretty quickly last weekend when I actually tried building things with it. Setting up a Sinatra app in Ruby is a matter of 'gem install sinatra', a 'require "sinatra"', and you're ready to roll.…

You are not alone in this. Scala has had ecosystem problems for a long time and because of the community status, that's unlikely to get much better anytime soon. One of the reasons I've been preferring haskell and clojure for my work is because scala's toolchain abused me so badly.

As I've just scratched Scala's surface, I don't get what you meant by the community status. Considering how important the ecosystem is, could you point some resource to understand ? Thanks

Re: From Ruby to Haskell, Part 1: Testing

#16

Heh, never seen someone so defensive about using Haskell before. 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. I don't see it helping if you are…

I had a similar experience switching from Java taught in college to self-teaching lisp. I essentially had to relearn everything that I knew and start looking at lisp as an entirely different beast, as most pattern matching that I did between the two came back to be wrong.

Apart from the basics, things like the CLOS definitely threw me for a spin, since it uses a different model for its object system.

Overall, probably best to approach most of the languages mentioned as a new way of thinking.

Re: From Ruby to Haskell, Part 1: Testing

#18
post #3

Just talking aloud, here. Sorta frustrated. 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. But the excitement went away pretty quickly last weekend when I actually tried building things with it. Setting up a Sinatra app in Ruby is a matter of 'gem install sinatra', a 'require "sinatra"', and you're ready to roll.…

I went through the exact same experience.

Fortunately, I had Clojure to fall back on already from Scala.

Leiningen single-handedly embarrasses the current state of the Scala community and it does SO much more but so effortlessly.

Re: From Ruby to Haskell, Part 1: Testing

#19
post #3

Just talking aloud, here. Sorta frustrated. 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. But the excitement went away pretty quickly last weekend when I actually tried building things with it. Setting up a Sinatra app in Ruby is a matter of 'gem install sinatra', a 'require "sinatra"', and you're ready to roll.…

[deleted]

Re: From Ruby to Haskell, Part 1: Testing

#20

Heh, never seen someone so defensive about using Haskell before. 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. I don't see it helping if you are…

"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?" That's how I learned to write my first useful programs. Maybe there is a better way, but that is the direct answer to your direct question. Except I wouldn't say that it clicks "all of a sudden". It's a long process of lear…

Interesting, I did bottom up first and then when I started to feel that same itch to actually build something useful things were more top down.

I agree that a mix of bottom-up and top-down is probably best, I was curious about other paths because I found that starting with bottom-up worked really well for me and wondered if that generalized to other people or was just well suited to my learning style. My experience makes me think that a solid foundation is essential but it's entirely likely that's just "that's the way i learned" bias.

Post reply on HN