Go is an exciting new programming language developed at Google that focuses on high performance and easing the developer experience. It has many advantages over other languages like C++ such as having a simple, quick to learn syntax, extremely fast compiler and execution speeds, powerful standard library, easy concurrency with goroutines and channels, and implicit interfaces. While still missing some features like a full IDE, Go shows great promise for building scalable server side applications and performing data processing.
A Recovering Java Developer Learns to GoMatt Stine
As presented at OSCON 2014.
The Go programming language has emerged as a favorite tool of DevOps and cloud practitioners alike. In many ways, Go is more famous for what it doesn’t include than what it does, and co-author Rob Pike has said that Go represents a “less is more” approach to language design.
The Cloud Foundry engineering teams have steadily increased their use of Go for building components, starting with the Router, and progressing through Loggregator, the CLI, and more recently the Health Manager. As a “recovering-Java-developer-turned-DevOps-junkie” focused on helping our customers and community succeed with Cloud Foundry, it became very clear to me that I needed to add Go to my knowledge portfolio.
This talk will introduce Go and its distinctives to Java developers looking to add Go to their toolkits. We’ll cover Go vs. Java in terms of:
* type systems
* modularity
* programming idioms
* object-oriented constructs
* concurrency
Golang basics for Java developers - Part 1Robert Stern
A short overview of Golang with Java comparison.
Part 1 of the series "Microservice development with Golang".
Contains hints and example links for potential Gophers
A Recovering Java Developer Learns to GoMatt Stine
As presented at OSCON 2014.
The Go programming language has emerged as a favorite tool of DevOps and cloud practitioners alike. In many ways, Go is more famous for what it doesn’t include than what it does, and co-author Rob Pike has said that Go represents a “less is more” approach to language design.
The Cloud Foundry engineering teams have steadily increased their use of Go for building components, starting with the Router, and progressing through Loggregator, the CLI, and more recently the Health Manager. As a “recovering-Java-developer-turned-DevOps-junkie” focused on helping our customers and community succeed with Cloud Foundry, it became very clear to me that I needed to add Go to my knowledge portfolio.
This talk will introduce Go and its distinctives to Java developers looking to add Go to their toolkits. We’ll cover Go vs. Java in terms of:
* type systems
* modularity
* programming idioms
* object-oriented constructs
* concurrency
Golang basics for Java developers - Part 1Robert Stern
A short overview of Golang with Java comparison.
Part 1 of the series "Microservice development with Golang".
Contains hints and example links for potential Gophers
Introduction to go language programming , benchmark with another language programming nodejs , php , ruby & python . how install go . use what IDE . and rapid learnin golang
Golang from Scala developer’s perspectiveSveta Bozhko
My talk from Functional Vilnius MeetUp #6.
http://www.functionalvilnius.lt/posts/2015-10-03-6th-meetup-announcement.html
Golang is becoming more and more popular. Most likely many of you have heard of its upgraded garbage collector and possibilities to work with lightweight threads – goroutines. Obviously, Golang is quite a good choice for server-side software oriented on a huge load. As Scala backend developer, I am a big fan of functional programming and actor model. Golang seems very promising, but from the first glance, its a totally imperative language. In my speech I’m going to tell about my experiments with Golang and attempt to use it as a functional language.
This deck was used to conduct a hands-on workshop at Mumbai Tech Meetup. It covers an introduction to Go, core language features, Object Oriented features of Go, Concurrency, API Servers and more.
How to write a well-behaved Python command line applicationgjcross
Tutorial #1 from PyCon AU 2012
Python is a fantastic scripting language. It is easy to hack up quick scripts for all sorts of problems - without a lot more effort, that hack can become a robust, easily maintained command line application that your users love.
This tutorial covers how to write useful, well-behaved command line applications that are a joy to use:
* Easily process command line options
* Write a script that can be used interactively or as a filter
* Display help to the user
* Gracefully handle and report errors, to the user and the shell
* Trap and process signals in a robust manner
* Create an easily configured application
* Use a range of the Python standard library modules for easier command line scripting
* Test your application
* Set up the supporting files that any well-behaved application should have, eg. a man page
* How to package your application for other people to use
This tutorial will assume a very basic knowledge of Python and some familiarity with the command line environment of your choice.
Having trouble managing dependencies with golang ? Here's how to resolve those issues using some of the best tools built by the community for the community.
Introduction to go language programming , benchmark with another language programming nodejs , php , ruby & python . how install go . use what IDE . and rapid learnin golang
Golang from Scala developer’s perspectiveSveta Bozhko
My talk from Functional Vilnius MeetUp #6.
http://www.functionalvilnius.lt/posts/2015-10-03-6th-meetup-announcement.html
Golang is becoming more and more popular. Most likely many of you have heard of its upgraded garbage collector and possibilities to work with lightweight threads – goroutines. Obviously, Golang is quite a good choice for server-side software oriented on a huge load. As Scala backend developer, I am a big fan of functional programming and actor model. Golang seems very promising, but from the first glance, its a totally imperative language. In my speech I’m going to tell about my experiments with Golang and attempt to use it as a functional language.
This deck was used to conduct a hands-on workshop at Mumbai Tech Meetup. It covers an introduction to Go, core language features, Object Oriented features of Go, Concurrency, API Servers and more.
How to write a well-behaved Python command line applicationgjcross
Tutorial #1 from PyCon AU 2012
Python is a fantastic scripting language. It is easy to hack up quick scripts for all sorts of problems - without a lot more effort, that hack can become a robust, easily maintained command line application that your users love.
This tutorial covers how to write useful, well-behaved command line applications that are a joy to use:
* Easily process command line options
* Write a script that can be used interactively or as a filter
* Display help to the user
* Gracefully handle and report errors, to the user and the shell
* Trap and process signals in a robust manner
* Create an easily configured application
* Use a range of the Python standard library modules for easier command line scripting
* Test your application
* Set up the supporting files that any well-behaved application should have, eg. a man page
* How to package your application for other people to use
This tutorial will assume a very basic knowledge of Python and some familiarity with the command line environment of your choice.
Having trouble managing dependencies with golang ? Here's how to resolve those issues using some of the best tools built by the community for the community.
CloudEndure Technology Introduction For PartnersThe Rudder Group
Introduction to CloudEndure... The pioneering Disaster Recovery-as-a-Service technology for cloud applications. Our technology was built specifically for the cloud. Lots of proprietary innovative technology in order to continuously copy, store, synchronize and replicate an up-to-the-second fully functioning version of the entire application stack - on demand.
Amazon Web Services support Docker containers by Elastic Beanstalk service and with new Elastic Container Services. AWS Elastic Beanstalk is an easy-to-use service for deploying and scaling web applications and services. ECS is a highly scalable, high performance container management service that supports Docker.
Docker landed almost two years ago, making it possible to build, ship, and run
any Linux application, on any platform, it was quickly adopted by developers
and ops, like no other tool before. The CI/CD industry even took it to
production long before it was stamped "production-ready."
Why does everyone (or almost!) love Docker? Because it puts powerful
automation abilities within the hands of normal developers. Automation
almost always involves building distribution packages, virtual machine
images, or writing configuration management manifests. With Docker,
those tasks are radically transformed: sometimes they're far easier than before,
other times they're no longer needed at all. Either way, the intervention
of a seasoned sysadmin guru is no longer required.
Docker, Linux Containers, and Security: Does It Add Up?Jérôme Petazzoni
Containers are becoming increasingly popular. They have many advantages over virtual machines: they boot faster, have less performance overhead, and use less resources. However, those advantages also stem from the fact that containers share the kernel of their host, instead of abstracting an new independent environment. This sharing has significant security implications, as kernel exploits can now lead to host-wide escalations.
In this presentation, we will:
- Review the actual security risks, in particular for multi-tenant environments running arbitrary applications and code
- Discuss how to mitigate those risks
- Focus on containers as implemented by Docker and the libcontainer project, but the discussion also stands for plain containers as implemented by LXC
Containers, docker, and security: state of the union (Bay Area Infracoders Me...Jérôme Petazzoni
Docker is two years old. While security has always been at the core of the questions revolving around Docker, the nature of those questions has changed. Last year, the main concern was "can I safely colocate containers on the same machine?" and it elicited various responses. Dan Walsh, SELinux expert, notoriously said: "containers do not contain!", and at last year's LinuxCon, Jérôme delivered a presentation detailing how to harden Docker and containers to isolate them better. Today, people have new concerns. They include image transport, vulnerability mitigation, and more.
After a recap about the current state of container security, Jérôme will explain why those new questions showed up, and most importantly, how to address them and safely deploy containers in general, and Docker in particular.
Redis Use Patterns (DevconTLV June 2014)Itamar Haber
An introduction to Redis for the SQL practitioner, covering data types and common use cases.
The video of this session can be found at: https://www.youtube.com/watch?v=8Unaug_vmFI
A brief description of a software architecture based on golang micro services.
The keynote was shown during the Golangit meetup @ Codemotion Rome 2015 event on March 27th 2015.
Go: Why it goes
by Serhii Pichkurov
In this talk Serhii will talk about Go, also known as Golang – an open source language developed at Google and used in production by companies such as Docker, Dropbox, Facebook and Google itself. Go is now heavily used as a general-purpose programming language that’s a pleasure to use and maintain. This introductory talk contains many live demos of basic language concepts, concurrency model, simple HTTP-based endpoint implementation and, of course, tests using build-in framework. This presentation will be interesting for backend engineers and DevOps to understand why Go had become so popular and how it might help to build robust and maintainable services.
Join this session after which you can start coding using language that has static safe compiler, GC and is as fast as C++ or Java, with even simpler syntax than Python!
Go (often referred to as “Golang”) is a fairly new programming language, version 1.0 released in 2012. Its three creators include Ken Thompson, who is the legendary father of UNIX and the inventor of the C language. The motives behind Go are very similar to those behind Java’s origins: much easier to use than C/C++, automatic garbage collection, no pointer arithmetic, built-in concurrency support, rich standard library, strong networking support.
New language from Google, static safe compiler, with GC and as fast as C++ or Java, syntax simpler then Python - 2 hour-long tutorial and you can start code.
In this talk Serhii will talk about Go, also known as Golang – an open source language developed at Google and used in production by companies such as Docker, Dropbox, Facebook and Google itself. Go is now heavily used as a general-purpose programming language that’s a pleasure to use and maintain. This introductory talk contains many live demos of basic language concepts, concurrency model, simple HTTP-based endpoint implementation and, of course, tests using build-in framework. This presentation will be interesting for backend engineers and DevOps to understand why Go had become so popular and how it might help to build robust and maintanable services.
Agenda of the presentation:
1. Go is not C, not Java, not anything
2. Rob Pike argument
3. Main ideas and basics
4. Concurrency model
5. Tools
6. Issues
go programming language basics
This presentation is a copy of one of the presentation in the slideshare
i just walk through the basic side of go programming language
its about a 45 mins presentation
more details about this language you get from golang.org refer this link
An introduction to the motivation behind the ooc project.
In a nutshell: software sucks, tools sucks, languages sucks - examples of what not to do. How ooc allows you to do pretty much aything with a few building blocks. An overview of the advantages/strong points of ooc.
Google's Go is a relatively new systems programming language that has recently gained a lot of traction with developers. It brings together the ease and efficiency of development in modern interpreted languages like Python, Perl, and Ruby with the efficiency and safety of a statically typed, compiled language like C/C++ and Java.
On top of that, Go is a language built for modern hardware and problems. With built-in support for concurrency, programmers can easily build software to scale up to today's many-core beasts. Programming in Go is really nice, and in this tutorial, you will learn why.
We will cover an introduction to the Go programming language, and together we will build a multi-user network service demonstrating all of the major principles of programming in Go.
These are the slides for the seminar to have a basic overview on the GO Language, By Alessandro Sanino.
They were used on a Lesson in University of Turin (Computer Science Department) 11-06-2018
Go 1.10 Release Party, featuring what's new in Go 1.10 and a few deep dives into how Go works.
Presented at the PDX Go Meetup on April 24th, 2018.
https://www.meetup.com/PDX-Go/events/248938586/
Golang becomes more and more popular: new projects are developed in this language and the old ones migrate to it. Why is Go loved by developers, wanted by clients and preferred by architects? Find the answers in this video.
This presentation was held by Sergii Shapoval (Senior Software Engineer, Consultant, GlobalLogic) at GlobalLogic Kyiv Java Career Day #2 on December 1, 2018.
Video: https://youtu.be/wSSgY_Du9zY
Learn more: https://www.globallogic.com/ua/events/globallogic-kyiv-java-career-day-2-summary
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™UiPathCommunity
In questo evento online gratuito, organizzato dalla Community Italiana di UiPath, potrai esplorare le nuove funzionalità di Autopilot, il tool che integra l'Intelligenza Artificiale nei processi di sviluppo e utilizzo delle Automazioni.
📕 Vedremo insieme alcuni esempi dell'utilizzo di Autopilot in diversi tool della Suite UiPath:
Autopilot per Studio Web
Autopilot per Studio
Autopilot per Apps
Clipboard AI
GenAI applicata alla Document Understanding
👨🏫👨💻 Speakers:
Stefano Negro, UiPath MVPx3, RPA Tech Lead @ BSP Consultant
Flavio Martinelli, UiPath MVP 2023, Technical Account Manager @UiPath
Andrei Tasca, RPA Solutions Team Lead @NTT Data
Welocme to ViralQR, your best QR code generator.ViralQR
Welcome to ViralQR, your best QR code generator available on the market!
At ViralQR, we design static and dynamic QR codes. Our mission is to make business operations easier and customer engagement more powerful through the use of QR technology. Be it a small-scale business or a huge enterprise, our easy-to-use platform provides multiple choices that can be tailored according to your company's branding and marketing strategies.
Our Vision
We are here to make the process of creating QR codes easy and smooth, thus enhancing customer interaction and making business more fluid. We very strongly believe in the ability of QR codes to change the world for businesses in their interaction with customers and are set on making that technology accessible and usable far and wide.
Our Achievements
Ever since its inception, we have successfully served many clients by offering QR codes in their marketing, service delivery, and collection of feedback across various industries. Our platform has been recognized for its ease of use and amazing features, which helped a business to make QR codes.
Our Services
At ViralQR, here is a comprehensive suite of services that caters to your very needs:
Static QR Codes: Create free static QR codes. These QR codes are able to store significant information such as URLs, vCards, plain text, emails and SMS, Wi-Fi credentials, and Bitcoin addresses.
Dynamic QR codes: These also have all the advanced features but are subscription-based. They can directly link to PDF files, images, micro-landing pages, social accounts, review forms, business pages, and applications. In addition, they can be branded with CTAs, frames, patterns, colors, and logos to enhance your branding.
Pricing and Packages
Additionally, there is a 14-day free offer to ViralQR, which is an exceptional opportunity for new users to take a feel of this platform. One can easily subscribe from there and experience the full dynamic of using QR codes. The subscription plans are not only meant for business; they are priced very flexibly so that literally every business could afford to benefit from our service.
Why choose us?
ViralQR will provide services for marketing, advertising, catering, retail, and the like. The QR codes can be posted on fliers, packaging, merchandise, and banners, as well as to substitute for cash and cards in a restaurant or coffee shop. With QR codes integrated into your business, improve customer engagement and streamline operations.
Comprehensive Analytics
Subscribers of ViralQR receive detailed analytics and tracking tools in light of having a view of the core values of QR code performance. Our analytics dashboard shows aggregate views and unique views, as well as detailed information about each impression, including time, device, browser, and estimated location by city and country.
So, thank you for choosing ViralQR; we have an offer of nothing but the best in terms of QR code services to meet business diversity!
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
3. What is Go
● New-ish programming language developed
at Google (and used there)
● Targeted for high performance servers
● Focuses on easing the life of the developer
● Addresses real pains - mainly from C++
● Object-Oriented-ish
● Statically Compiled
● Garbage Collected
● Strictly Typed
● Concurrency Oriented
4. Reason 1: The syntax
● Simple, Quick learning curve, little code to write.
● Few keywords - e.g.: do, while, for
● Multiple return values
● Public / private
● Maps, slices (vectors), queues as first class members
● Pointers - without arithmetic
● No macros
● No exceptions
● No templates
● No operator overloading
● No warnings!
5. The syntax: Hello World
package main
import "fmt"
func main() {
fmt.Println("Hello World!")
}
6. The syntax: Variables, looping
package main
import "fmt"
func main() {
a, b := 1, 2
fmt.Printf("a + b: %dn", a + b)
for a < 100 {
a++
fmt.Println(a)
}
}
7. The syntax: Imports, casting
package main
import (
"fmt"
"math"
)
func main() {
for i := 0; i < 100; i++ {
fmt.Println(math.Pow(float64(i), 2))
}
}
8. The syntax: Funcs
package main
import (
"fmt"
// "math"
)
func square(i int) int {
return i*i
}
func main() {
for i := 0; i < 100; i++ {
fmt.Println(i, square(i))
}
}
9. The syntax: Structs & Methods
type User struct {
Name string
password string
}
// This is a method for User
func (u *User) Authenticate(name, password string) bool {
return u.Name == name && u.password == password
}
// Instead of constructors...
func NewUser(name, password string) *User {
return &User{ Name: name, password: password, }
}
// Instead of inheritence...
type Administrator struct {
User
email string
}
func (a *Administrator) SendMail(msg string) {
log.Println("Sending message to ", a.Name)
}
10. Reason 2: Compiler Speed
● The whole SDK and compiler compiled in 19 seconds.
● Standard library - a couple of seconds. For 370 KLOC.
● My own project, 5 KLOC - 0.186 seconds.
Why?
● Compiling imports only directly imported stuff.
● Compiler friendly syntax.
● The language is very small.
● Unused imports not allowed.
● Circular imports not allowed (no #IFDEF).
11. Reason 3: Execution Speed
● Go is FAST
● Slower usually than C++, not by a lot.
● More or less on par with Java
● about x10 to x100 faster than Python/Ruby
● (but let's not forget concurrency)
● Only gcc-go does machine code
optimizations
● Significant performance improvements
between versions.
12. Execution Speed: Go vs. C++
(Data: The benchmark game, http://benchmarksgame.alioth.debian.org/)
13. Execution Speed: Go vs. Java
(Data: The benchmark game, http://benchmarksgame.alioth.debian.org/)
14. Execution Speed: Go vs. Ruby
(Data: The benchmark game, http://benchmarksgame.alioth.debian.org/)
15. Reason 4: The Ecosystem
● Go Get - a pip/gem like installation system
● Compliant with Github / Google Code,
Bitbucket
● Any repo can be made compliant
● The repo url is also the namespace!
● Can be automated to run on compile time
● Excellent repo search engines
● Friendly, useful community
16. Importing a package: Example
package main
import (
"github.com/dvirsky/go-pylog/logging"
)
func main() {
logging.Info("All Your Base Are Belong to %s!", "us")
logging.Critical("And now with a stack trace")
}
17. Reason 5: Simple Conventions
● Lots of convention-over-configuration:
● all tests & benchmarks in *_test.go - just hit
go test
● func TestXXX(t *testing.T) {}
● func BenchmarkXXX(b *testing.B) {}
● func ExampleFoo() {}
● Excellent documentation system built-in
● Folders are packages, URLs for installed
● Public / private
20. Reason 6: Concurrency
● Goroutines and Channels are the heart of
Go
● Goroutines are microthreads with an internal
scheduler
● You can run 10Ks of goroutines easily
● No need for non-blocking IO. It is under the
hood!
● The usual pattern: One goroutine per server
connection
● Locks are available but not encouraged
21. Concurrency: Channels
● Channels are synchronized message
queues between goroutines.
● They are strictly typed first-class citizens.
● Delegate state through channels instead of
sharing it.
● Buffered channels for non blocking pushes.
● They can be iterated on.
22. Channels: Over-simplified example...
func producer(c chan string) {
for i := 0; i < 100; i++ {
c <- fmt.Sprintf("Message #%d", i)
}
close(c)
}
func main() {
c := make(chan string)
go producer(c)
for s := range c {
fmt.Println(s)
}
}
23. Channels: Slightly more complex #1
package main
import (
"fmt"
"runtime"
)
type result struct {
in int
out int
}
//worker getting numbers and sending back their sqaure
func squarer(in chan int, out chan result) {
for i := range in {
out <- result{i, i * i}
}
}
//take in the results and print them
func aggregator(res chan result) {
for s := range res {
fmt.Println(s)
}
}
// TO BE CONTINUED ON NEXT SLIDE ------>
24. Channels: Slightly more complex #2
func main() {
//utilize all CPUs
runtime.GOMAXPROCS(runtime.NumCPU())
//create the channels
inChan := make(chan int)
outChan := make(chan result)
//fire up the workers
for i := 0; i < 10; i++ {
go squarer(inChan, outChan)
}
//aggregate results
go aggregator(outChan)
//push the input
for i := 0; i < 1000; i++ {
inChan <- i
}
//there are prettier ways of blocking here... :)
var input string
fmt.Scanln(&input)
}
25. Reason 7: The standard library
● Excellent, rich standard library
● More like Python's than C++'s
● Very well documented
● Great source for idiomatic code
● Excellent serialization
26. Reason 7: The standard library
● The "Batteries" include:
○ Robust HTTP Web Server + template library
○ Compression, encryption, JSON / XML / CSV
○ Profiling, debugging, source parsing
○ Reflection library
○ Image manipulation
○ Plus the usual suspects
○ No GUI Toolkit :)
27. The standard library: A Web Server
package main
import (
"fmt"
"net/http"
)
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hi there, I love %s!" , r.URL.Path[1:])
}
func main() {
http.HandleFunc( "/", handler)
http.ListenAndServe( ":8080", nil)
}
28. Reason 8: C is never too far
● CGo is part of the standard library
● Makes binding C libraries trivial
● You can also trivially call Go code from C
● BTW: A JVM based Go exists ;)
package rand
/*
#include <stdlib.h>
*/
import "C"
func Random() int {
return int(C.rand())
}
func Seed(i int) {
C.srand(C. uint(i))
}
29. Reason 9: Implicit Interfaces
● Implementing an interface simply means you
implement it, no declaration needed.
● Example: any struct that has a method
String() string can be used for "%s" fmt
● You can mix and match interfaces as you go
● The empty interface, interface{} is super
useful.
● Interfaces can be safely cast into structs, or
called directly.
30. Reason 10: Procrastination It's Fun!
● Go is fun to work on and read about
● Beware: productive procrastination :)
● "Code is compiling" is no longer valid!
● Thank God we have a new excuse
31. Before we get too excited
● Lack of complete, real IDE
● Debugging: GDB Works great - but no real
frontend
● No dynamic linking/loading
● Implicit interfaces are cool but can be
confusing
● No exceptions - a matter of taste.
32. Wanna write some Go code?
We're hiring! :)
We're introducing Go to our backend and data
crunching stack, where C++ used to roam, or
where Go could kick Python's ass.
Email jobs@everything.me
33. A Few Good Resources
● The official website:
http://golang.org/
● Excellent introductory book:
http://www.golang-book.com/
● GoDoc: Package search
http://godoc.org/
● Migrating from Python to Go:
http://blog.repustate.com/migrating-code-from-python-
to-golang-what-you-need-to-know/2013/04/23/