Go was designed by a team in Google that included Dennis Richie and Ken Thompson, who were the original designers of C. They created a programming language which is based on parallelism and safety. Go is simpler in syntax than C/C++ and employs automatic garbage collection like Java, but with better performance. The language isn’t low-level enough for operating systems and device drivers, but it is finding a large number of uses, including running Google Web Services.
.. Swift is designed to replace Apple’s Objective-C. Unlike Go, it incorporates more of the features from higher-level languages. It also has automatic freeing of memory, but it uses resource counters to determine when to free the memory, rather than a garbage collector which imposes a performance penalty.
.. The most interesting of these new languages in my opinion is Rust, which was designed by the Mozilla Foundation in order to develop a new web browser engine based on safety and parallelism. Instead of a garbage collector or resource counter, Rust uses a novel concept of ownership to determine when to free memory. Only one variable at a time can own a piece of memory, so memory is automatically freed once its variable goes out of scope
.. Rust strives to give the programmer all the control of C/C++, but with greater safety and many features of high level languages such as closures, pattern matching, generics, loops with automatic iterators, and traits without the overhead of classes and inheritance. The Rust designers describe these features as “zero-cost abstraction,” meaning that they want to give programmers features from high-level languages, but without the performance cost of that abstraction.
.. Whereas Go and Swift are easier to learn and the syntax is simpler than C/C++, Rust has a very complex syntax and is much harder to learn in my opinion. Writing code in Rust forces the programmer to do a lot more mental work from the outset and type more code to do the same thing as Go or Swift.
.. Despite its steep learning curve and complex syntax, Rust is rated by Stack Overflow’s 2016 Developer Survey as the programming language with the highest percentage of users who want to continue using it. The language with the second highest percentage is Swift and Go is the fifth highest.
.. The rise of Go, Swift and Rust is a sign of the growing recognition that Moore’s Law is sputtering out and we will need to live in a world of limited resources. We don’t have the luxury of solving all problems by simply throwing more hardware and costly layers of abstraction at it. Instead, we need leaner code that consumes as little memory and processing cycles as possible, while still providing safety and concurrency.
Cross posted from MSDN’s channel 9
I believe it is wrong to take one paradigm and stretch it out all the way.
In the same way that it is wrong to take the object-oriented paradigm and say that it is the only way.
Google runs millions of lines of Python code. The front-end server that drives youtube.com and YouTube’s APIs is primarily written in Python, and it serves millions of requests per second! YouTube’s front-end runs on CPython 2.7,
.. but we always run up against the same issue: it’s very difficult to make concurrent workloads perform well on CPython.
.. Grumpy is an experimental Python runtime for Go. It translates Python code into Go programs, and those transpiled programs run seamlessly within the Go runtime.
.. The goal is for Grumpy to be a drop-in replacement runtime for any pure-Python project.
.. In particular, Grumpy has no global interpreter lock, and it leverages Go’s garbage collection for object lifetime management instead of counting references. We think Grumpy has the potential to scale more gracefully than CPython for many real world workloads.
.. Grumpy programs can import Go packages just like Python modules! For example, the Python snippet below uses Go’s standard net/http package to start a simple server