Live data from Hacker News

From Node.js to Go

bowery.io

21–30 of 192 posts

Re: From Node.js to Go

#21

Go does lack quite a bit of the web pizzazz you'd find in rails, but I learned a lot more by writing web things in go than I did in rails because so much less of the magic is hidden away from you.

You can't really compare Go with Rails...

Re: From Node.js to Go

#22
post #2

Go is definitely promising but the last time I checked the problem with web development with Go was that there is no mature libraries for User authentication etc(Please correct me if I'm wrong). This makes going with Node or something like Rails more tempting.

>no mature libraries for User authentication "User authentication" can mean 1,000 different things, maybe if you clarify your use case, people can suggest solutions.

> "User authentication" can mean 1,000 different things

you mean like 4 different things... and even those have common components

Re: From Node.js to Go

#23

Go does lack quite a bit of the web pizzazz you'd find in rails, but I learned a lot more by writing web things in go than I did in rails because so much less of the magic is hidden away from you.

You can't really compare Go with Rails...

This is true. They really are apples and oranges; but when life gives you lemons, I choose web frameworks.

Re: From Node.js to Go

#24
post #16

I wish a language with advanced types like Haskell or OCaml would have the same tooling and ease of distribution around it that Go does. I haven't built anything in Haskell/ML in a while, so if anyone has any updates on this please chime in.

You may wish to explore Rust - http://www.rust-lang.org/ . I can't speak to tooling but it has advanced typing and ease of distribution seems similar to Go. Edit: mea culpa for my attempt at tongue-in-cheek humor, "I think that's called Rust - http://www.rust-lang.org/"

Rust's type system is definitely more robust than Go's, however it's also a different language and different philosophy. Go was created to be easy to read and easy to write, which is mirrored in the language (e.g. no generics). Rust is more complex, which might be a factor when deciding between Go and Rust. Plus it does not have the same adoption in the industry as Go.

Re: From Node.js to Go

#25
post #16

I wish a language with advanced types like Haskell or OCaml would have the same tooling and ease of distribution around it that Go does. I haven't built anything in Haskell/ML in a while, so if anyone has any updates on this please chime in.

Yea, I really like GADT too much to give it up. With Swift/Haxe/Rust/Haskell/F# all having them.

You may find this interesting, someone implemented a parsec-like library in Go [1]. I haven't wrapped my head around it completely, but it looks like it's all dynamic [2].

[1] https://godoc.org/github.com/prataprc/goparsec [2] https://github.com/prataprc/goparsec/blob/master/json/json.g...

Re: From Node.js to Go

#26
post #2

Go is definitely promising but the last time I checked the problem with web development with Go was that there is no mature libraries for User authentication etc(Please correct me if I'm wrong). This makes going with Node or something like Rails more tempting.

I wrote a Go Web Application with authentication and an API to learn Golang.

I must say, writing an API and some other services (SMTP pipe listener) was much nicer in Go than Authentication.

There is gorilla/sessions for sessions, but there's a lot to be desired here. A weak secret here means other people can decrypt the SessionStore Blob and possibly get secret information as a passive attacker or authenticate as another user. This sessionstore passphrase is the key to your entire webapp.

There's also nothing built in to Go for CSRF tokens, and HTMLTemplates are nice for preventing XSS but a pain in the butt for embedding, generating, and storing/regenerating (depending on how big you are) CSRF tokens.

Overall though....Writing Go has been pure joy for me. These are super knitpicky things to complain about.

Re: From Node.js to Go

#27

Go does lack quite a bit of the web pizzazz you'd find in rails, but I learned a lot more by writing web things in go than I did in rails because so much less of the magic is hidden away from you.

I'd consider that a feature of Go. At least that this is not your only way.

What you want is maybe something like Beego.

http://beego.me/

Re: From Node.js to Go

#28

> Go is a compiled language so distributing applications for use on multiple platforms is just easier. How is this a true statement? Ease of distribution isn't a function of a language's runtime environment (native vs interpreter).

Sure it's a true statement. Even if you have to compile to different targets (and you do), that's much simpler than implementing shared dependencies on those different targets. When you deploy a binary with no external dependencies, you can (generally) set it and forget it.

It's not to say there aren't meaningful differences across targets you need to account for, but it is "just easier" in my experience.

Re: From Node.js to Go

#29
post #9

For me the single biggest disadvantage of Go against Node.JS is the lack of a decent dependency management solution. NPM is awesome and Go doesn't even have a "meh" answer to that.

NPM is only awesome until you need to do something with it on Windows.

Re: From Node.js to Go

#30
post #16

I wish a language with advanced types like Haskell or OCaml would have the same tooling and ease of distribution around it that Go does. I haven't built anything in Haskell/ML in a while, so if anyone has any updates on this please chime in.

OCaml is usually statically compiled with ocamlopt, so distribution is pretty easy. As long as build/deploy platforms match, then you're good to go. Shared libraries only come into the picture for unusual cases, eg FFI.

OCaml tooling has also gotten a lot better over the past few years, mainly because of OPAM. The library count has exploded, and the language still gets regular point-releases with improvements designed to aid tooling, such as extension points.

Post reply on HN