7 ms·
I hear "revolutionary" claimed about languages like Rust, Haskell and Zig, but rarely about Go. What about Golang is revolutionary to you?
by twelfthnight 3y ago
I hear "revolutionary" claimed about languages like Rust, Haskell and Zig, but rarely about Go. What about Golang is revolutionary to you?
- adrianmsmith 3y agoThe way concurrency works is pretty unique amongst mainstream languages. Java has just copied some parts of how concurrency works in Go, but that's nearly 20 years after Go was released. It's extremely easy to start up code concurrently with "go foo()". You can start up lots of such functions concurrently, as it works in userspace. Like async code, but no "colored functions" problem.
- ildjarn 3y agoColored functions is only a problem in JS
- lokhura 3y agoAnd C#, Python, Rust...
- ildjarn 3y agoYou can de-color an async function by blocking.
- bheadmaster 3y agoIn most implementations, blocking in an async function has unintended side effect of blocking all other async function running on the same executor.
- neonsunset 3y agoIt's not the case in C#. It is discouraged, but mainly because there just used to be so much sloppily written async code that managed to bring down threadpool to its knees despite hillclimbing and blocked threads detection doing a lot of heavy lifting, so the community has grown scar tissue against this. It's rarely an issue if ever in the last 5 years or so.
- bheadmaster 3y agoAnd Python... And Rust... And C#...
- superdisk 3y agoThe concurrency model basically came from Erlang, which in my opinion does it better.
- pjmlp 3y agoActually Java brought back the green threads model that it had before Go came to be. The difference is that now red and green threads are exposed at the API level, and not an implementation detail. Hardly copying Go.
- bzzzt 3y ago> but that's nearly 20 years after Go was released. Go 1.0 was released in 2012.
- neonsunset 3y agoQuoting "colored functions" is a problem of skill. It is a tell of engineer's lack of understanding of concurrency.
- bheadmaster 3y agoCan you please elaborate why?
- bheadmaster 3y agoThere are several features that can be considered neat on their own. Most of those features are probably derived from other languages, but together they form a very powerful language that simply takes away the pain that I feel using other modern languages, such as C++, Python, Java and NodeJS. Here are a few on top of my head: 1) CSP concepts embedded deeply into the language (goroutines/channels/select) making concurrency easy to do correctly 2) Standard Library and Go toolchain providing everything that most languages use third party libraries for (formatting, testing, benchmarking, fuzzing, HTTP, crypto, etc...) 3) Compilation into a static binary that can just be copied from machine to machine without any dependencies whatsoever (even C struggles with that on Linux, due to glibc NSS fiasco) 4) Cross-compilation by changing two environment variables 5) Minimalistic distribution system - just write `import "github.com/person/repository"` - no need for packaging, pom.xml, requirements.txt, package.json, etc. 6) Interface-based modularity (structural typing), making code reuse much easier than the usual OOP-style abstract-class based modularity (nominal typing) 7) Extremely fast compilation, which makes read-modify-run development loop as fast as with interpreted languages
- pjmlp 3y ago1) Modula-2, Active Oberon, Erlang 2) .NET, Java, Smalltalk, Common Lisp 3) Any compiled language until the mid-1990's. 4) Amsterdam Compilers Toolkit, 1980 5) Until the repo changes, forbids distribution of binary libraries 6) Standard ML, Caml Light, OCaml, Haskell,... 7) Turbo Pascal on CP/M, MS-DOS computers running at 7 MHz, with 640KB.
- bheadmaster 3y agoIf your post is intended to be a remark on how nothing in Go is "revolutionary", please read the first paragraph of my post, and notice how there isn't a single language in your list which is in all 7 categories. Additionally: - Erlang does not implement CSP, it implements Actor model - Java does NOT have all the listed features included in its default toolkit - hence the existence of Gradle, Maven and all other packaging/testing/benchmarking solutions - The "until mid 1990's" is the keyword here - I'm talking about modern languages and I explicitly pointed that out - ACT is not part of any language, it is an external tool that may or may not be reliable, but definitely does not have toolchain/standard library level of quality/stability guarantee. - "Until the repo changes" - packages can disappear from any system, see leftpad incident - "forbids distribution of binary libraries" - not true, see [0] [0] https://docs.google.com/document/d/1nr-TQHw_er6GOQRsF6T43GGhFDelrAP0NqSS_00RgZQ/edit?pli=1#heading=h.fwmrrio0df0i https://docs.google.com/document/d/1nr-TQHw_er6GOQRsF6T43GGh... --- However, if I have misread your tone, and your post was intended to be an informative list of languages Go was inspired by, then thanks for the information. But some of it is misleading or false.
- deleted 3y ago[deleted]
- deleted 3y ago[deleted]