Posts | Comments

Planet Arduino

Archive for the ‘go’ Category

Go — a modern programming language with roots at Google — is one of the new generation languages that would like to unseat C (and C++) for what we think of as traditional programming. It is only for PCs, though, right? Not so fast! TinyGo provides a compiler that — in their words — is for small places. How small? They can target code for the Arduino Uno or the BBC micro:bit. It can also produce code for x86 or ARM Linux (both 32- and 64-bit) as well as WebAssembly. They claim that a recent project to add ESP8266 and EPS32 support to LLVM will eventually enable TinyGo to target those platforms, too.

As you would expect, there are some subtle differences between TinyGo and the full-blown version. The compiler handles the entire program at once which is slower but offers more for optimization. Certain optimizations for interface methods are not used in TinyGo, and global variable handling changes to accommodate moving data from flash to RAM efficiently. TinyGo passes parameters in registers.

Other changes are more profound. For example, there’s no garbage collection yet, so you are urged to not perform heap allocations after initialization. There are also a few other major features not supported. Concurrency in the form of goroutines and channels, cgo, reflection, and three index slices won’t work. Maps are available, but only with certain key types. Because of the missing pieces, many of the packages in the standard library won’t build.

Of course, the other modern language in the same position is Rust and if you were wondering why Go instead of Rust, there’s an FAQ for that. Do you need Go on the Arduino? Maybe not. However, if you are a Go programmer, maybe this opens up some possibilities for you.

We remember a hacker jukebox that used Go. We also remember someone using it on the ill-fated Intel Edison.

Nov
12

Google annuncia Go un nuovo linguaggio di programmazione

C/C++, Geek, go, Go programming language, google, language, Plan 9, Programmazione, Programming Commenti disabilitati su Google annuncia Go un nuovo linguaggio di programmazione 

Ieri, 10 novembre, Google ha anunciato un nuovo linguaggio di programmazione, Go. Non sono riuscito a trovare il link ufficiale e da quanto leggo qua e là mi pare che non sia un progetto ufficiale ma solo di alcuni sviluppatori (Robert Griesemer, Ken Thompson, e Rob Pike) che utilizzano il loro tempo libero, circa il [...]


  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook