Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Go is the best worst language I've used. Most of what I do fits pretty much right in the sweet spot for go, network services and web development. Stuff I would have previously used C and (insert scripting language here) for respectively. Go fits into both of those areas really nicely, and I prefer it over C and scripting language X for these tasks.

But the problem is, I've already tried haskell, which also fits that same area, and is semantically a vastly better language. I just wish go had been more willing to push the envelope and at least try to be somewhat modern and useful instead of being "C with modules, but slow". On the other hand, haskell is a terrible language syntactically, and from a development environment perspective. Go is near enough to perfect in those regards. Having a fast compiler, a simple, working build system, a sane and easily enforced code format all make a huge practical difference. I wish I could use go, as it is much nicer than haskell from a usability perspective. But the language is just too primitive.



Might I suggest Scala[1]? It is a modern languages with mature build tools and development environment. It also has a lot of nice tools surrounding network services and web development[2].

[1] http://www.scala-lang.org/ [2] http://typesafe.com/stack


You certainly can suggest it, I already tried it though. ;)

Scala ends up more like the worst aspects of haskell and go combined, rather than the best aspects of both.


Details, please.


Pretty much what I described above. The bad parts of haskell (compile time, memory usage while compiling, bad syntax, terrible dependency/package/module management) are all present in scala, and it is semantically an inferior language to haskell. Scala is certainly a whole lot closer to haskell than go is, and I certainly don't blame anyone involved in the creation of scala for its limitations, the JVM limits how good they can get. But at the end of the day, using scala would solve none of the problems I have with haskell, and leave me with a less powerful language.


Out of curiosity, what make the Go dependency management so good? I'm not terribly familiar with this aspect of Go. Based on a what I've read, it doesn't seem dramatically different than what you would do for Scala (except it is packaged with the language rather than an external tool like SBT). Is there something I am missing?


SBT just fails to work correctly on a semi-regular basis. Quite a few scala people ended up resorting to maven instead, which says a lot.


That has not been my experience at all. SBT has always worked correctly for me.

When was the last time you used Scala and/or SBT? I know a lot of the tools in the Scala ecosystem were unstable prior to Scala 2.8. However, now they have become pretty good. Even the, previously notoriously bad, Eclipse plugin has become good.


~6 months ago. I'd certainly say the eclipse plugin has improved a lot, it's better than the intellij one now. It is still quite a ways away from good though.


Well, I guess will have to agree to disagree here.

From my perspective Scala solves a lot of problems with Haskell:

- Working module system (From my experience, especially people coming from OO languages are surprised that this is such a huge unsolved problem in Haskell, because all the languages they know have come up with a working solution.) It will be interesting if some OCaml-style module system as currently discussed makes it into Haskell.

- It is much easier to reason about space consumption.

- It benefits from the best general-purpose VM with its superior garbage collection algorithms. (I agree that the lack of VM features is deeply annoying.)

- Tons of tools for monitoring.

- Debuggers. I'm not certain that Haskell will ever have decent debugging capabilities, taking its approach to laziness and compilation into account.

- Exceptions which don't leave the developer wondering where exactly an error has occurred. (Stack-traces, anyone?)

- Libraries for basically everything. Even if you don't use them, you can have a look at how other developers have approached a certain problem.

- Tool support. The Scala IDE alone has 10 people working on it. Compare it to Leksah and EclipseFP.

- Commercial support. Scala has Typesafe (> 30 people) and dozens of partners, consultancies, etc. In Haskell, there is Well-Typed, which is more or less payed by the “Industrial Haskell Group” (which consists of Galois and Amgen).

- The REPL is just a lot more usable.

I don't have any problems with the compile time. When developing in Eclipse there is just no delay between pressing “Run” and the execution of the program. It is instantaneous.

Syntax ... well, that's a completely subjective topic.

“terrible dependency/package/module management” ... SBT delivers a top-notch experience here. Have dependencies as source on sites like GitHub? SBT will fetch and build them without problems. Need to deploy artifacts into the local repo, to Maven Central or other services? SBT will happily do that. Need to cross-compile to different versions? Easy. Want to build software for Android? SBT will compile, jar, proguard, dex and install it on your device in seconds. I would love to hear what you would like to see here!

“semantically an inferior language”: Well, I guess every language is inferior to Haskell. I appreciate the hard work done in Haskell to track side-effects and other things. While I don't think these exact approaches will ever see much adoption, it leads the way to more manageable approaches. I'm pretty sure computer science will come up with some great solution in the next decade and Haskell will play its part here.

“less powerful language”: Well, it depends on what you mean with “Haskell”. “Haskell” == the Haskell standard? Scala is a lot more powerful than that. “Haskell” == GHC with all its proprietary extensions enabled: Yes, probably.

I don't think Go is really comparable with Scala or Haskell. It feels a bit like it was designed in an ivory tower. It is certainly a nice language if you ignored the last 20 years of progress in language design and have never used anything except C.

Let me know what you think and if I missed something!


Most of what you listed as "solved" by scala isn't a problem in haskell in the first place. The JVM is a problem, not a solution to the problem haskell has of "actually working". Listing "our possible semantics are gimped by java" as a feature seems rather bizarre. Debugging? Have you ever tried debugging haskell? It works just fine.

>Tool support. The Scala IDE alone has 10 people working on it. Compare it to Leksah and EclipseFP.

I don't think insulting the people working on the scala eclipse plugin is very productive. Yes they have more people, and yes it is annoying that it is still not as good as haskell's eclipse plugin, but give them some time.

>The REPL is just a lot more usable.

In what way? The fact that it is way slower? You seem to be just listing random things as if you've never tried haskell.

>SBT delivers a top-notch experience here

You are the first person I've ever seen make that claim. Hell, people use maven because SBT is so bad.

>I don't think Go is really comparable with Scala or Haskell. It feels a bit like it was designed in an ivory tower

You might want to look up what "ivory tower" means. That is the most backwards characterization of go I've ever seen.


Sorry, I'm not really sure if you're trolling.


I'm pretty sure "post a bunch of obvious nonsense, then call anyone who disagrees a troll" isn't considered appropriate behaviour on HN.


What have you written in Go that you'd wished you'd written in Haskell?


Everything, and the same in reverse. That's the problem. Using haskell, I wish I was using go because the downsides of haskell bother me. But when I am using go, I wish I was using haskell because the downsides of go bother me.


Ah the quest for the perfect mix of everything. I sympathize but I've generally found that there are some things that are better solved in Haskell and others in Go and have found a generally pleasant balance.


I see. For me I haven't found anything like that, where task X would be better in go and task Y would be better in haskell. Everything I've done was always better in haskell. It was just an annoying pain in the ass the whole time because of super slow compile times, or running out of RAM compiling, or package conflicts from cabal hating me, or .cabal files requiring spaces instead of tabs, or haskell code I want to modify being some giant mess of arbitrarily aligned with a million spaces craziness that makes cool things like "diff" useless. It just feels like rather than "haskell needs to stop being so crazy", the "go needs to gain modern features" approach is more likely to actually be possible.


You can create a tool that lets you inline Haskell code in your Go sources. The resulting code could be compiled and called via C, some sort of IPC or even as a network service.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: