[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

[Advertise on 4chan]


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: golang.jpg (47 KB, 800x452)
47 KB
47 KB JPG
Should I learn Go? I'm interested in backend web development, and so far I've only experimented with django (didn't really like it that much). Also, I want to finally learn a compiled language.
>>
it's pretty comfy, anybody who says otherwise is probably a rust tranny
>>
> I'm interested in backend web development

Node.js
>>
>>82645602
>trannyscript
no thx

>>82645588
>No
Can you elaborate?
>>
>>82645581
> backend web development
It is not good for that at all. In fact most web-specific tasks (validation, serialization, database access) really fucking suck in Go, especially if you don't use GRPC (or any other protocol that enforces a strictly typed schema). Learn C#, that will be much more useful for you from any standpoint. Both a very practical language and a very nice learning experience.
>>
>>82645647
>GRPC
Thanks for the input, I guess I'll look into C# as well.
>>
>>82645581
ASP.NET Core
>>
>>82645581
not using one of the popular, fully-featured frameworks like rails, django, laravel or spring boot is just asking for trouble.
you will have less features and no one to ask.
>>
>>82645708
I can give you an example. You can't do declarative serialization in go without a reflexion. Even tags use reflect, and you'll need to utilize it in some way to work past the tags. While they might have improved it, reflect has historically been slow as shit in golang. It's slow across the board, but there are techniques in most languages to avoid it, but not in go.
So you got a very typical web-dev task, used your "fast" compiled static language and got a result about as slow as python and about as maintainable as C89.
It is, however, pretty damn good at tasks with simple interfaces that require parallel execution. Concurrency model is really simple and really good, and the code is pretty fast in and of itself.
>>
>>82645751
>Concurrency model is really simple and really good, and the code is pretty fast in and of itself.
that's just not true. it's data races galore.
https://gist.github.com/kachayev/21e7fe149bc5ae0bd878

it's an half-assed implementation of actors.
you want elixir.
>>
>>82645798
>elixir
It's better at keeping concurrent threads for prolonged periods of time. Much better. But it's really slow at maths, as far as I can recall it's pretty much the slowest floating point machine out there? So yeah, it's good at what it does, but what it does is not the same as Go.
>>
>>82645834
If you're benchmarking individual floating point operations, you're not measuring anything useful. Every language worth a damn has a library that can perform bulk floating point operations using SIMD on the CPU. There's also OpenCL style GPU fuckery. Small floating point calculations have zero impact on overall performance. You could use exact rationals represented by integer pairs and be fine.
>>
>>82645898
Not having to resort to SIMD is fucking great. Making your software platform-specific just because your language sucks at math is really stupid. That among other things.
Pushing Elixir into math-intensive data-processing is pretty much like pushing Go into web-dev backend. Just a shitty idea overall.
>>
>>82645647
>>82645751
Don't be ridiculous. Validation, serialization, and database are probably the easiest to do in go out of any language. C# is a terrible suggestion old bloated language. You can't do serialization in any language without reflection or code generation. The shitty runtime code generation is C# is doing is not a good thing. Tags is a much better system for readability. Besides, reflection is never going to be your bottleneck. Oh no reflection add 1 more nano sec to the process, meanwhile transition of the network took 0.5 sec.
>>
>>82645934
Using a library that uses SIMD internally does not make your code dependent on a specific processor.
>>
>>82646022
Serialize me a variable type array in Go. No, reflecting on literally everything is not good. If network is always your bottleneck, use Python then. It'll be as fast by your logic and much more maintainable.
>>
>>82646031
It depends on the library. It might and it might not. And it might do some weird shit with a fake QEMU processor at some point. It's not a great idea in general.
>>
>>82646047
Network is always going to be your bottleneck if you are working on backend applications. You could do python but golang has a much clear and cleaner syntax
>>
>>82646095
Wait what? Bhahahahaha. Golang? Cleaner syntax? Sure fucking thing. ORM's that mix SQL with in language objects. Explicid data logic in the code (marshal). No generics. Retarded reflection all over the place. Fucking errors as values. Walrus operators (they are in python now, I'll give you that, although I am yet to see one). Pointer fuckery in a garbage collected language. Inevitable Interface{}, complete with explicid field access and typecasting.

Jesus, do Go fags really thing it's concise or beautiful? At least Rust trannies have no such illusions.
>>
>>82646022
>Validation, serialization, and database are probably the easiest to do in go out of any language.
are you saying this:
https://github.com/gothinkster/golang-gin-realworld-example-app/blob/master/users/serializers.go
is easier than:
https://github.com/gothinkster/elixir-phoenix-realworld-example-app/blob/master/lib/real_world_web/views/profile_view.ex
>>
>>82646062
Wrong. People use numpy, BLAS, and LAPACK without any of your imagined issues. Fortran and MATLAB have built in support. Python's numpy is faster than naive array floats in C; it's better than naive array floats in Go.
>>
>>82645581
generics soon
>>
>>82646181
And it does weird shit on some machines occasionally. At least numpy, never used BLAS or LAPACK. I mean you would still use it, don't get me wrong. But if you can avoid it -- you do.
>>
>>82646210
>And it does weird shit on some machines occasionally.
IEEE floats are already "weird". You have imaginary problems.

>At least numpy, never used BLAS or LAPACK.
Numpy uses SIMD.

>I mean you would still use it, don't get me wrong. But if you can avoid it -- you do.
There are only two situations: you barely do any FLOPS and so the speed of FLOPS doesen't matter; you do lots of FLOPS and get a library that abstracts over hardware parallelism. Saying, "Language X has faster FLOPS than language Y.", is retarded.
>>
>>82646274
While I generally agree, I think there is the third case where you do a lot of flops, but either your language lib is shit or you don't want to use it for whatever reason. Btw, what's the library for that in elexir?
>>
>>82646326
ffi to rust is what web-scale phoenix shops do:
https://blog.discord.com/using-rust-to-scale-elixir-for-11-million-concurrent-users-c6f19fc029d3
>>
>>82646326
If there isn't a library for FLOPS with SIMD and writing one is out of scope, then your language *is* shit for FLOPS. For example, if C didn't have a library for FLOPS and writing one yourself wasn't viable, then C would be garbage at FLOPS.

>Btw, what's the library for that in elexir?
I don't sue Elixir.
>>
>>82645581
If you're doing it as a learning experience, you're honestly better off with anything else, even C# or Java. Go sells itself as "simple", but Rob Pike's idea of simplicity is entirely concerned with how easily junior engineers can shit out copypasted code, rather than conciseness or expressiveness or maintainability.

Pike is ideological about the dumbest shit, and Go has his repulsive fingerprints all over it.
>>
>>82645602
Node is a mess. Go is the solution. Kill yourself.
>>
>>82645647
>It is not good for that at all.
You're retarded.

>In fact most web-specific tasks (validation, serialization, database access) really fucking suck in Go, especially if you don't use GRPC (or any other protocol that enforces a strictly typed schema).

Again, retard. Go is built for these tasks.

> Learn C#, that will be much more useful for you from any standpoint. Both a very practical language and a very nice learning experience.
Imagine using Windows.
>>
>>82647527
Was this meant to be ironic, a purely ideological post commenting on pike's ideological obsession?
>>
>>82645581
It's a really nice minimalist backend language. C# is good too, but the thing is, Go can do everything with 10% of the features, and the general minimalism of the language means that even if tha language lacks <insert feature>, the resultant code is as compact as C#. Some stuff I don't like (reflection is slow, you're supposed to generate code, which isn't that easy), but the good thing is instead of trying to be everything to everyone, they fill a niche very well.
For example Go doesn't really do ORMs like Entity Framework, just write SQL if you wanna do db stuff.
The simplicity tends to result in samey solutions, which is great if you're downloading a library from the web, its interface will probably look simple and familiar. The library docs are great too, both for official and third-party stuff, usually I can get an unfamiliar library working (or determine that it's garbage) in 10 minutes.

This language is not for everyone, and every use case, there's a strong focus on writing command-line tools on Linux or server stuff, but it's really good at that, and the resulting code is really readable. Plus, if you come from any curly brace language, you can get productive with it in days.
>>
>>82646163
That go code can be greatly improved. It is not go's fault you suck at writing code. For example using type embedding would greatly increase the readability here.
>>
calm down nerds. nobody even understands what you are all arguing about. try having sex with a woman one day.
>>
if you want production quality http3 then go is your only option.
>>
>>82645581
Yes, learn it. It won't be wasted time, even if you later decide that you want to learn other language.
Just focus on single one first, and grasp concepts. After that you will be just changing syntax a little.
>>
I like its clear and concise syntax, go is fun to write. Concurrency is where go shines the most. All the basic tools to do backend development are there though you might need to write some additional things compared to other languages. However the ecosystem is not as mature as said for example, java or node.js. You will have less options when searching for libraries and much of these libraries are pretty abandoned. Still go is worth learning, there are jobs out there, it has its niche.
>>
>>82647540
> Again, retard. Go is built for these tasks.

Serialize an arbitrarily typed array in go. Let's say it's a web RPC, that takes a queue of commands. There are four types of commands, one is a parrent type, three are children. Serialize accepting such a queue in Go. All command fields must be accessible without explicid typecasting.
>>
>>82645581
Huge demand for Go developers right now and the companies hiring modern languages are generally better than the companies not

t. writes go for a living
>>
>>82645581
Golang takes "simplicity" to a retarded extreme. Problems which "complex" languages solve with an abstraction (e.g. generics, higher-order functions) are solved in Go by copypasting code.

Learn C# or a functional programming language (e.g. Scala, Haskell) instead
>>
>>82648013
>However the ecosystem is not as mature as said for example, java or node.js
wth?
nodejs has less of an ecosystem than go.
the most popular nodejs web framework is still express.
exrpess was abandoned by its dev in 2014 for go:
https://medium.com/@tjholowaychuk/farewell-node-js-4ba9e7f3e52b
it's been in minimal maintenance ever since.

obv java's spring dwarves anyone else.
>>
>>82645798
>it's an half-assed implementation of actors.
No, it's an implementation of CSP (which can be used to model actors using buffered channels, which - even if they didn't exist - could be written with 2 channels + goroutine worker + buffer).

CSP and Actor model are equivalent.
>>
>>82645591

Not a rust tranny. I don't like my languages not compiling because the format is wrong. Go feels very sjw to me in this sense because it requires me to prostrate my self to whatever aspie is writing the coding "standards" at google. Go is modern day COBOL and you are a monkey.
>>
>>82649009
>doesn't use a code formatter
Don't post again until you've had a job.
>>
>>82645581
>I'm interested in backend web development,
>Also, I want to finally learn a compiled language.

I'd say java but Go is pretty fun as well.
>>
>>82648113
This, after I switch to go my salary went up 40%.
>>
>>82648135
This argument is going to be moot pretty soon. generics are in the pipeline for upcoming releases.
>>
>>82648537
I mean that there are thousands of npm packages to do random shit, that's not the case with go



Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.