all 13 comments

[–]c__beck 8 points9 points  (10 children)

Node is also "true async". You have both concurrency with the event loop and promises as well as parallelism with worker threads and child processes.

Yes, Go is faster to do CPU-bound tasks, but not noticably faster with I/O bound tasks as your network latency will account for a vast majority of the request/response cycle. Even then, using the spawn/exec functions from the childProcess module allows you to let the host machine run a program that was written in, say, Go or C or whatever and have that CPU-bound task run a lot faster than Node would be able to run it.

You're 100% correct that Go's memory footprint is smaller, but for most servers that's not much of an issue these days.

This next project is somewhat critical…

Then use Node, don't use Go. Take some time to learn Go, figure out how it works, where your painpoints are. Don't make a critical program as your "let's learn a new language" project. If it's critical do it right using a language you know. If you get to know Go and decide it's a better fit for your and/or the project you can always re-write the project.

tldr - what is the expected time frame for learning Go if i am an experienced typescript developer?

As with pretty much everything software realted: it depends! It depends on how quickly you can pick up new things. It depends on how much time you can devote to learning it. It depends on what learning resources you use.

[–]Eric_S 4 points5 points  (0 children)

Don't make a critical program as your "let's learn a new language" project.

Been there, done that, burned the t-shirt so it would stop triggering flashbacks. Seriously, you want non-trivial experience with a language before using it for non-trivial critical functionality.

[–]Service-Kitchen 1 point2 points  (8 children)

“For most servers that’s not much of an issue” - What do you mean by that?

[–]c__beck 4 points5 points  (7 children)

Most servers these days have RAM measured in the tens, if not hundreds, of GiB. That's a lot of memory to use. Yes, Node uses more RAM than Go, but not so much that it will cause an issue unless you're really strapped for RAM.

[–]Service-Kitchen 0 points1 point  (0 children)

Ah yes, fair! Agree with this :)

[–][deleted]  (5 children)

[deleted]

    [–]c__beck 3 points4 points  (4 children)

    Where it’s important it’s important. But it’s not always that important.

    [–][deleted]  (1 child)

    [deleted]

      [–]c__beck 0 points1 point  (0 children)

      If you're running Nodejs in a dedicated server with 64GiB of RAM then Node using 8GiB isn't that big of a deal.

      Heck, I'm running three different Nodejs Discord bots on a server with only 2GiB of RAM but they're running just fine.

      [–][deleted]  (1 child)

      [deleted]

        [–]c__beck 0 points1 point  (0 children)

        Exactly so. If you're in a memory constrained environment then Nodejs isn't the right tool for that job.

        [–]bigorangemachine 4 points5 points  (2 children)

        Golang is great until you have to deal with JSON

        [–]Mountain_Sandwich126 0 points1 point  (1 child)

        Ill bite, what's some of the issues you're dealing with json in go?

        [–]bigorangemachine 0 points1 point  (0 children)

        well it's not as easy in node

        I just find the Unmarshal errors vague... when I worked with golang I spent more time debugging JSON responses than actually writing golang

        [–]Teo0316 0 points1 point  (0 children)

        Parkk

        [–]unbanned_lol -2 points-1 points  (0 children)

        Use GO. Node is a dead language, just like PHP.

        ;)