Iced Development(https://iceddev.com)
DevOps/Developer
@samrocksc
samrocksc@gmail.com
GoLang is a C derivative language that was built to make programming easier, and easier to understand. It's toolchain was built around creating a developer friendly ecosystem. It's very cute too.
Go is not a frontend language. It can be used for it, but there are situations where GoLang can be easier to use than Javascript....
Targeting Architectures!
Need to fit a specific architecture to run your code? No Problem!
GOOS=freebsd GOARCH=arm GOARM=7 go build -v example.go
// JayvaScript
var hello = 'Hello!';
const there = 'I am';
let name = 'Sam';
// GoLang
var hello string
hello = 'Hello!'
there := 'I am'
name := 'Sam'
// JazzzzzyScript
for (var i = 0; i < 10; i++) {
console.log(i);
}
vs.
// GoLang
for i := 0; i < 10; i++ {
fmt.Println(i)
}
Go and Javascript are very similar in a lot of ways....but not too similar
// I am an exported function
func Add(x int, y int) int {
return x + y
}
// I am a local function
func subtract(x int, y int) int {
return x - y
}
Exporting is done by simple capitalization!
In node, native-bindings can throw a huge wrench in gears and cause issues at build time.
In go, we can leverage the executable package system, and our binaries to create quicker easier methods of execution on our server.
Tooling for different editors is really nice! Built in Go Commands provide a smooth devloper atmosphere across all editors
ES6, Typescript, ES6 flag 0, vanilla, node, bleeding edge, coffee script.
....YOU ARE BUILDING THE TOWER OF BABEL!
No transpilation(this shouldn't be a word), predictable formats. Consistent error handling
Event Loop driven concurrency can lead to malfunctions and weird error handling. Running on a queing system we still don't have a true concurrency. Great for I/O, but maybe not for....heavier processing?
Go routines allow us to kick off a separate process with a heavier workload. Returning when finished we can keep our primary chain of programming running while we wait for our go routines to return their data. Channels allow us to move data between two go routines, allowing for stacks on stacks of uninterrupted processing!
package main
import "fmt"
func f(from string) {
for i := 0; i < 3; i++ {
fmt.Println(from, ":", i)
}
}
func main() {
f("direct")
go f("goroutine")
go func(msg string) {
fmt.Println(msg)
}("going")
var input string
fmt.Scanln(&input)
fmt.Println("done")
}
* https://gobyexample.com/gouroutines
Different linters can leave different methods of doing things. Which is great, for the same developer for a long time....
go fmt gives us a standardized method of doing things. Most editors are symbiotically linked to generating documentation.
node.js API
go API
...deploys as one executable with environment variables
...deploys as fifteen thousand five hundred and eighty six files
Sam Clark
@samrocksc
samrocksc@gmail.com
https://shoutinginfrench.com