SlideShare une entreprise Scribd logo
1  sur  13
Télécharger pour lire hors ligne
1Use Go for System Programming, Distributed Systems and Cloud Workloads	 Mphasis
Mphasis Digital POV
Use Go for System Programming, Distributed Systems
and Cloud Workloads
PoV by
Aniruddha Chakrabarti
AVP Digital, Mphasis
2Use Go for System Programming, Distributed Systems and Cloud Workloads	 Mphasis
Abstract
C and C++ are widely accepted and used as de-facto standard for systemprogramming language.In spite of the
tremendous success and adoption of C and C++, there was always need for a more modern system programming language
that would not only have performance characteristics of C and
C++, but also the flexibility of other modern languages such
as Python, Pascal, Modula and Smalltalk.
In recent past (since 2000) we have seen three moderately
successful system programming languages being born
– D (in 2001), Go (in 2009) and Rust (in 2012). Among
them, while D is a close follower of C and C++, if not
predecessor and hence the name D, Go takes a unique and
differentiated approach than C and C++. We believe this is
the strongest reason behind Go’s success.
Go is also well suited for web development. There are multiple web development frameworks and middle tiers for Go
that have received success in recent times, including Martini, Gin, Negroni, Revel, Beego, Gorilla and Net/HTTP. Go is
also supported by multiple PaaS platforms including Google Cloud Platform (App Engine), Cloud Foundry (including
Pivotal Web Service) and Heroku. AWS Elastic Beanstalk also supports deploying Go applications. We strongly
believe that in future Go would come out as a strong alternate of C and C++ in the area of system programming, web
development, large scale distributed systems and cloud workloads.0
0
0
0
0
0
0
1
1
1
0
0
0
0
1
0
0
1
0
0
1
0
0
1
0
0
0
1
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
0
0
0
1
1
1
0
0
0
0
1
0
0
1
0
0
1
0
0
1
0
0
0
1
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
0
0
0
1
1
1
0
0
0
0
1
0
0
1
0
0
1
0
0
1
0
0
0
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
1
0
0
1
0
1
0
0
1
0
1
0
1
0
0
0
0
0
0
0
0
0
1
1
1
0
0
0
0
1
0
0
1
0
0
1
0
0
1
0
0
0
1
0
0
0
0
1
0
0
0
0
1
0
0
0
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0
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
1
0
0
1
0
1
0
0
1
0
1
0
1
0
0
0
0
0
0
0
0
0
1
1
1
0
0
0
0
1
0
0
1
0
0
1
0
0
1
0
0
0
1
0
0
0
0
1
0
0
0
1
0
0
Overview of Go
Go or Golang is an open source programming language developed at Google, specially targeted at system
programming and for building large scale distributed systems. It is natively compiled (does not need a VM to run),
statically typed language following the footsteps of system programming languages such as C and C++. But Go is
garbage collected, unlike C and C++.
Go is designed with the philosophy of “Less is exponentially more”. In a blog post dated June 2012, Rob Pike, one of the
designers of the language, reported how a language with less but well-designed features is far better than a language.
Go is not an object-oriented language. While Go support types, methods and interfaces, it does not support classes,
inheritance, overloading of methods or operators.
History of Go
•	 Go language was originated as an outcome of an experiment by Robert Griesemer, Rob Pike and Ken Thompson at
Google, to design a new system programming language in 2007
•	 Officially announced in November 2009, it is used in some of Google's production systems as well as by other firms
•	 Version 1.0 was released in March 2012 and between 2012 and 2015, multiple versions were released
•	 Version 1.5 was released in August 2015, which is the current stable version
When you think about system programming,
think Go - developed at Google for advanced
technology demands
3Use Go for System Programming, Distributed Systems and Cloud Workloads	 Mphasis
New Programming Languages
Programming
Language
Backed by /
Developed at
First public
release
Success Paradigm Suitable for
Go (also called
golang)
Google
November
2009
High
Procedural - Designed from ground up with
concurrency in mind. Supports Actor model
based concurrency.
System programming,
large scale distributed
systems, cloud workloads,
web back ends
D Facebook
December
2001
Medium
Procedural,
Object-oriented
System programming,
large scale distributed
systems, web back ends
Rust Mozilla 2010 Medium
Procedural, Object-oriented with functional
programming constructs.
System programming
R Bell Laboratories Late 90s High
Object-oriented with functional and procedural
constructs.
Statistical computing, Big
Data analytics
Scala Open Source 2004 High
Object oriented with influences functional
programming Programming. Supports actor
model based concurrency.
General purpose
Groovy
Apache
Foundation
2004 Medium
Object oriented programming language with
dynamic typing – designed for scripting in mind
General purpose,
scripting focused
Clojure Open Source 2007 Low Functional – Is a dialect of Lisp General purpose
Dart Google 2011 Low
Object-oriented with scripting and functional
programming constructs. Designed from group
up for web development. Supports Actor model
based concurrency.
Web development
TypeScript Microsoft 2012 Medium
Scripting language with Object oriented
constructs. Designed from group up for web
development
Web development
F# Microsoft 2005 Medium
Functional programming language that supports
object oriented concepts
General purpose
Ceylon Red Hat 2011 Low Object oriented General purpose
Swift Apple 2014 High
Object oriented with influences from functional
programming
General purpose
Other System Programming Languages
Language  Originator  Birth Date  Influenced by  Used for 
ESPOL Burroughs Corporation 1961 Algol 60 MCP
PL/I IBM , SHARE 1964 Algol, FORTRAN , some
COBOL
Multics
PL360 Niklaus Wirth 1968 Algol 60 Algol W
C Dennis Ritchie 1969 BCPL Unix
PL/S IBM 196x PL/I OS/360
BLISS Carnegie Mellon University 1970 Algol-PL/I(5) VMS (portions)
PL/8 IBM 197x PL/I AIX
PL-6 Honeywell. Inc 197x PL/I CP-6
SYMPL CDC 197x JOVIAL NOS subsystems, most complters, FSE editor
C++ Bjarne Stroustrup 1979 C. Simula See C++ Applications(6)
Ada Jean Ichbiah. S. Tucker Taft 1983 Algol 68, Pascal, C++,
Java, Effel
Embedded systems, OS kernels, compilers, games,
simulations, Cubesat, air traffic control, and avionics
D Digital Mars 2001 C++ XomB
Go Google 2009 C, Pasacal, CSP Some Google systems.(7)
Docker, Kubernetes,
CoreOS(a)
Rust Mozilla Research(8)
2012 C++, Haskell, Erlang,
Ruby
Servo layput engine
System Programming Languages Developed after 2000
4Use Go for System Programming, Distributed Systems and Cloud Workloads	 Mphasis
Go Usage
•	 Many Google web properties and systems including YouTube, Kubernetes containers and download server
dl.google.com
•	 Docker, a set of tools for deploying Linux containers
•	 Dropbox, migrated some of their critical components from Python to Go
•	 SoundCloud, for many of their systems
•	 Cloud Foundry, a platform as a service (PaaS)
•	 Couchbase, Query and Indexing services within the Couchbase Server
•	 MongoDB, tools for administering MongoDB instances
•	 ThoughtWorks, some tools and applications around continuous delivery and instant messages
•	 SendGrid, a transactional email delivery and management service
•	 The BBC, in some games and internal projects
•	 Novartis, for an internal inventory system
For a complete list of apps and systems that use Go refer-
https://en.wikipedia.org/wiki/Go_(programming_language)#Notable_users and https://github.com/golang/go/wiki/GoUsers
Features that made Go a success
Pointers
Interface
Rich
Standard
Library
Structs and
Methods
First class
functions
Actor Model
Based
Concurrency
First class functions
Go supports first class functions - Functions could be assigned to variables and passed as parameter to other
functions. They could be even returned from other functions. Go supports anonymous functions, multiple return values
from functions and all concepts supported by functional programming languages.
Anonymous Functions
Anonymous Functions are functions without name – they are typically assigned to variable.
func main(){
	 add := func(x int, y int) int {return x+y}
	 var sub = func(x int, y int) int {return x-y}
	 fmt.Println(add(20,30))
	 fmt.Println(sub(20,30))
}
5Use Go for System Programming, Distributed Systems and Cloud Workloads	 Mphasis
Functions can be passed to other functions as parameters. In the below example higherOrderFunc is a higher order
function that accepts another function (f func(x int, y int) int) as parameter -
func main(){
add := func(x int, y int) int {return x+y}
var sub = func(x int, y int) int {return x-y}
fmt.Println(add(20,30))
fmt.Println(sub(20,30))
fmt.Println(higherOrderFunc(add, 30, 20))
fmt.Println(higherOrderFunc(sub, 30, 20))
}
func higherOrderFunc(f func(x int, y int) int, num1 int, num2 int) int{
return f(num1 * num1, num2 * num2)
}
Now the function definition for higherOrderFunc is a bit complicated and could get even more complicated if it
accepts multiple functions as input parameter. This could be simplified by defining a user defined function type.
func main(){
add := func(x int, y int) int {return x+y}
var sub = func(x int, y int) int {return x-y}
fmt.Println(add(20,30))
fmt.Println(sub(20,30))
fmt.Println(higherOrderFunc(add, 30, 20))
fmt.Println(higherOrderFunc(sub, 30, 20))
}
type HigherFunc func(x int, y int) int	 	 // user defined function type
func higherOrderFunc(f HigherFunc, num1 int, num2 int) int{
return f(num1 * num1, num2 * num2)
}
Similarly a higher order function could return another function –
func main(){
var result = higherOrderFunc2()
fmt.Println(result(30, 20))		 // 50
}
func higherOrderFunc() func(x int, y int)int {
add := func(x int, y int) int {return x+y}
return add
}
Go can also return multiple values from a function –
func swap(x, y int) (int, int){
return y, x
}
var x,y int = 10,20
fmt.Println(x,y)		 // 10 20
var p,q int = swap(x,y)
fmt.Println(p,q)		 // 20 10
6Use Go for System Programming, Distributed Systems and Cloud Workloads	 Mphasis
Structs and Methods
Structs
Go does not support Class, but supports Struct. Structs in Go are typed collections of named fields similar to other
programming languages like C++ and Java. Structs can have methods apart from fields. Struct allows grouping of
fields (data) and methods (behavior).
type Employee struct {
	 name	 string	 // field name of type string
	 age	 int	 // field age of type int
	 salary	 float32	 // field salary of type float32
	 designation	 string	 // field designation of type string
}
Structs could be initialized either using new function (Option 1) or using JavaScript like object literal notation (Option 2)
// Option 1 – using new function
emp := new(Employee)
emp.name = "Ken Thompson"
emp.age = 50
emp.salary = 12345.678
emp.designation = "Distinguished Engineer"
// Option 2 – using JavaScript like object literal notation
emp := Employee{}
emp.name = "Ken Thompson"
emp.age = 50
emp.salary = 12345.678
emp.designation = "Distinguished Engineer"
Another alternate is to specify field values as parameters in the same order fields are declared
// Option 3 – parameters should be in the same order fields are declared
emp := Employee{"Ken Thompson", 50, 12345.678, "Distinguished Engineer"}
Note:
; are optional in Go similar to JavaScript.
Local variables could be assigned without specifying their types using := instead of =
Structs can have arrays and other child structs as fields
type Employee struct{
	Name	 string
	Age	 int
	 Salary	 float32
	 Skills	 [4]string	 // Array field
	 HomeAddress	 Address	 // Nested Child struct as property
}
type Address struct{
	 StreetAddress string
	 City string
	 Country string
}
func main(){
	 address := Address{"MG Road", "Blore", "IN"}
	 skills := [4]string {"C","Go","Rwust"}
	 emp := Employee{"Aniruddha", 40, 123.456, skills, address}
	 fmt.Println(emp)	 // {Aniruddha 40 123.456 [C Go Rust] {MG Road Blore IN}}
	 fmt.Println(emp.Skills)	 // [C Go Rust]
	 fmt.Println(emp.HomeAddress.StreetAddress)	 // M G Road
}
7Use Go for System Programming, Distributed Systems and Cloud Workloads	 Mphasis
Go simplifies the process and reduces a lot of
effort from programming perspective.
Methods
Apart from member fields, Go structs support defining methods (member functions). Methods of the struct are actually
defined outside the struct declaration, which is unique in Go.
type Employee struct {
	name	 string	
	age	 int
	 designation	 string
}
// Displayis declaredas a method for Employeestruct
func (emp Employee) Display() {
	 fmt.Println("Name:", emp.name, ", Designation:", emp.designation)
}
func main(){
	 emp := Employee{name:"Bill G", age:55, designation:"President"}
	 emp.Display()	 // prints Name: Bill G , Designation: President
}
Methods can accept parameter similar to normal functions –
type Employee struct {
	name	 string
	age	 int
	 designation	 string
}
// Method for struct Employee that accepts a string input
func (emp Employee) Display(message string) {
	 fmt.Println(message, emp.name, ", Designation:", emp.designation)
}
func main(){
	 emp := Employee{name:"Bill G", age:55, designation:"President"}
	 emp.Display("Hello")
}
Interfaces
Go support interfaces, just like C++, Java and C# do.
Interfaces are named collections of method signatures.
They could be treated as blueprint as they do not provide
implementation. Types that implement an interface is
responsible for providing the actual implementation.
Go is unique in the fact that types do not have to explicitly
use “implements” or other similar declarations to specify
that they are implementing an interface. To implement an
interface, all that types have to do is provide implementation of methods defined in interface.
// An interface called Human is declared with two methods – Walk and Talk
type Human interface {
	 Walk(miles int)
	 Talk()
}
// A type called Employee is declared which would implement the interface Human
// Note that the type does not specify that it would implement the interface
type Employee struct {
	name	 string
	 designation 	string
}
8Use Go for System Programming, Distributed Systems and Cloud Workloads	 Mphasis
Parallelism and concurrency are the key
elements in Go design
// Implementation of methods of Human interface
func (emp Employee) Walk(miles int){
	 fmt.Println("I can walk", miles, "miles")
}
// Implementation of methods of Human interface
func (emp Employee) Talk(){
	 fmt.Println("I can talk. My name is", emp.name, "and I am a", emp.designation)
}
func main(){
	 var emp Human = Employee{name:"Rob Pike", designation:"Architect"}	
	 emp.Walk(10)	 // I can walk 10 miles
	 emp.Talk()	 // I can talk. My name is Rob Pike and I am a Architect
}
The type implementing the interface has to implement all the methods specified in the interface. Also, all the method
signatures should match. If both of these conditions are not matched then compiler complains -
type Contractor struct {
	 name string
}
func (cont Contractor) Walk(miles string){
	 fmt.Println("I can walk", miles, "miles")
}
func main(){
	 var cont Human = Contractor{name:"John Smith"}	
	 cont.Walk("7")
}
Go compiler throws the following error for the above example –
cannot use Contractor literal (type Contractor) as type Human in assignment:
	 Contractor does not implement Human (missing Talk method)
cannot use "7" (type string) as type int in argument to cont.Walk
Concurrency (Goroutines and Channels)
Go has been designed from ground up, keeping concurrency
and parallelism in mind. Go’s concurrency is based on a
concept called Communicating Sequential Processes (CSP)
that was introduced by C.A.R. Hoare in a seminal paper in
1978. CSP is similar to the Actor model of currency, which
was made popular by Erlang. CSP takes a different approach
to concurrency, compared to thread / lock based concurrency.
While in thread based concurrency, multiple threads use
shared memory to communicate among themselves, in CSP,
concurrent processes or actor or routines use message passing to communicate. They do not use shared memory thus
avoiding synchronization and synchronization primitive (lock, mutex, monitor, semaphore etc) related issue.
Thread 1
read and write read and write
Thread 2 Thread 3
Shared Memory
Thread based concurrency model with shared memory
9Use Go for System Programming, Distributed Systems and Cloud Workloads	 Mphasis
Do not communicate by sharing memory; instead, share memory by
communicating – GoLang website
Goroutine
Go uses goroutines for concurrency. A goroutine is a
function that executes concurrently with other goroutines in
the same address space; it’s quite lightweight as compared
to OS threads and is managed by Go runtime. Multiple
goroutines could be executed concurrently thus bringing in
concurrency.
Any function could be executed as a goroutine by prefixing
it with go keyword –
func main() {
	 // add function is called as goroutine
	 go add(20, 10)
	
	 fmt.Println("add executed")
	 fmt.Scanln()
}
func add(x int, y int){
	fmt.Println(x+y)
}
Channel
Channels are the conduit through which messages could be sent and received. For sending and receiving messages
using channel <- operator is used.
Channels could be created using make function. While creating the channel the type of message to be passed using
the channel is specified –
Goroutines make Go easy to use and help
it keep concurrency intact.
Actor 1
Actor 2
Actor 3
SharedMemory
Asynchronous
message passing
Asynchronous
message passing
Asynchronous
message passing
Actor based concurrency model - no shared memory
10Use Go for System Programming, Distributed Systems and Cloud Workloads	 Mphasis
// Declare and allocate a channel
channel := make(chan string)
// Send a message across the channel
channel <- "message"
// Receive message from the channel
msg:= <- channel
The below example creates two goroutines – one of them behaves as message sender and the other is message
receiver. The message sender then sends the message via a channel and the message receiver receives the message.
Message Receiver
(ReceiveMessage goroutine)
Message Sender
(SendMessage goroutine)
Message
Channel
func main(){
	 channel := make(chan string)
go SendMessage(channel)    
go ReceiveMessage(channel)
	 fmt.Scanln();
}
// goroutine that sends the message
func SendMessage(channel chan string) {
	 for {
    	 channel <- "sending message @" + time.Now().String()
	 	 time.Sleep(2 * time.Second)    
	}
}
// goroutine that receives the message
func ReceiveMessage(channel chan string) {
    for {
message := <- channel
		fmt.Println(message)
}
}
Message Receiver
(ReceiveMessage goroutine)
Message Sender
(SendMessage goroutine)
Acknowledgement Channel
Message Channel
Acknowledgement
Message
func main() {
	 // Channel used to send the message from sender to receiver
	 msgChannel := make(chan string)
	 // Channel used to acknowledge the message receipt by receiver
	 ackChannel := make(chan string)
	 go SendMessage(msgChannel, ackChannel)
	 go ReceiveMessage(msgChannel, ackChannel)
	
	 fmt.Scanln()
}
11Use Go for System Programming, Distributed Systems and Cloud Workloads	 Mphasis
// goroutine that sends the message
func SendMessage(msgChannel chan string, ackChannel chan string) {
	 for {
	 	 // Send the message to message channel
	 	 msgChannel <- "Sending message @" + time.Now().String()
	 	 time.Sleep(2 * time.Second)
		
// Receive the acknowledgement from acknowledgement channel
	 	 ack := <-ackChannel
	 	 fmt.Println(ack)
	}
}
// goroutine that receives the message
func ReceiveMessage(msgChannel chan string, ackChannel chan string) {
	 for {
	 	 // Receive the message from message channel
		 message := <-msgChannel
		fmt.Println(message)
	 	 // Send the acknowledgement to acknowledge channel
	 	 ackChannel <- "Message received @" + time.Now().String()
	}
}
Pointers
Unlike some of the new programming languages such as
Java, C#, Ruby, Python and Swift, Go supports pointers.
Pointers in Go behave much the same way as C and C++.
Pointers reference a location in memory where a value is
stored rather than the value itself.
A pointer is represented using the * (asterisk) character
followed by the type of the stored value. The & (ampersand)
operator is used to denote the address of a variable. In the
below example, a pointer is declared that points to an
existing string variable (city). The address of the pointer and
the value it’s pointing to is printed.
var city string = "Bangalore"
// Declare a pointer that points to the address of city variable
ptrToCity := &city
// Print the address of the pointer and value the pointer is pointing to
fmt.Println("&ptrToCity = ", &ptrToCity);	// prints the address of the pointer
fmt.Println("*ptrToCity = ", *ptrToCity);	// prints the value it’s pointing to
Changing the value of the pointer changes the value of the original value it is pointing to -
var city string = "Bangalore"
var ctr int = 10
// Declare two pointers pointing to city and ctr variables
ptrToCity := &city
ptrToCtr := &ctr
fmt.Println("city = ", city, ", *ptrToCity = ", *ptrToCity);
fmt.Println("ctr = ", ctr, ", *ptrToCtr = ", *ptrToCtr);
Go is one of the most advanced programming
languages for a reason - it supports the
use of pointers.
12Use Go for System Programming, Distributed Systems and Cloud Workloads	 Mphasis
// Change the values of the pointers
*ptrToCity = "Kolkata"
*ptrToCtr = 20
// The original variables to which pointers are pointing is also changed
fmt.Println("city = ", city, ", *ptrToCity = ", *ptrToCity);
fmt.Println("ctr = ", ctr, ", *ptrToCtr = ", *ptrToCtr);
Rich standard library
Go comes with a large no of packages that provide common functionality such as File handling, IO, String handling,
Cryptography etc. Below is a list of popularly used Go packages -
Sl. No Description Package Name
1 String manipulation Strings
2 Input and Output io, bytes
3 Files and Folders os, path/filepath
4 Errors Errors
5 Containers & Sort container/list
6 Hashes and Cryptography hash, crypto
7 Encoding encoding/sob
8 Allows interacting with Go's runtime system, such as functions to control goroutines Runtime
9 Synchronization Primitives Sync
10 Server communication, RPC, HTTP, SMTP etc. net, http/rpc/jsonrpc
11 Math library Math
12 Zip, Archive, Compress archive, compress
13 Database related database, sql
14 Debugging Debug
15 Automated testing Testing
Other highlights of Go
1.	Go is statically typed
2.	Natively compiled, but garbage collected
3.	Go is statically typed with optional type inference
4.	Supports Defer, Panic and Recover for error handling
5.	Does not support classes and inheritance
6.	Does not support overloading of methods
and operators
7.	Go compiler compiles source code very fast.
8.	Does not support Generics
Conclusion
Go has evolved as a major programming language suitable for not only system programming, but also for cloud
workloads. Go is supported by multiple cloud platforms, including Google Cloud Platform (App Engine), Cloud
Foundry (including Pivotal Web Service), Heroku and AWS Elastic Beanstalk. Microsoft also added "experimental
support" for Go into its Azure cloud service. Go is becoming a popular language of choice for system programming,
web development, large scale distributed systems and cloud workloads.
Further Reading
•	 Less is exponentially more: A blog by Rob Pike - http://commandcenter.blogspot.de/2012/06/less-is-exponentially-more.html
•	 Go website - https://golang.org
•	 Go FAQ - https://golang.org/doc/faq#Is_Go_an_object-oriented_language
•	 Go By Example - https://gobyexample.com/
•	 An Introduction to Programming in Go - https://www.golang-book.com/books/intro
•	 Little Go Book - http://openmymind.net/assets/go/go.pdf
•	 Effective Go - https://golang.org/doc/effective_go.html
•	 Communicating Sequential Processes - https://en.wikipedia.org/wiki/Communicating_sequential_processes
Copyright ©: The brand names mentioned in this POV (Go, D, Rust, C, C++, AWS, Heroku, Google Cloud Platform,
Cloud Foundry, Pivotal Web Service, Azure etc.) belong to their respective owners.
13Use Go for System Programming, Distributed Systems and Cloud Workloads	 Mphasis
Aniruddha Chakrabarti
Associate Vice President, Digital, Mphasis
Aniruddha has 16+ years of IT experience spread across systems integration,
technology consulting, IT outsourcing and product development. He has
extensive experience of delivery leadership, solution architecture, presales,
technology architecture and program management of large scale distributed
systems.
As AVP, Digital in Mphasis, Aniruddha is responsible for Presales, Solutions,
RFP/RFI and Capability Development of Digital Practice. Before as Sr.
Manager & Sr. Principal Architect in Accenture, he was responsible for
presales, architecture and leading large delivery teams. He had played
delivery leadership and architecture focused roles in Microsoft, Target, Misys
and Cognizant.
His interests include digital, cloud, mobility, IoT, cognitive computing, NLP,
distributed systems, web, open source, .NET, Java, programming languages
and NoSQL. His industry experience spans Retail, Healthcare, Capital Markets,
Insurance, Travel, Hospitality, Pharma and Medical Technology.
VAS01/07/16USLETTERBASIL4020
For more information, contact: marketinginfo@mphasis.com
USA
460 Park Avenue South
Suite #1101
New York, NY 10016, USA
Tel.: +1 212 686 6655
Fax: +1 212 683 1690
Copyright © Mphasis Corporation. All rights reserved.
UKt88 Wood Street
London EC2V 7RS, UK
Tel.: +44 20 8528 1000
Fax: +44 20 8528 1001
INDIA
Bagmane World Technology Center
Marathahalli Ring Road
DoddanakundhiVillage,Mahadevapura
Bangalore 560 048, India
Tel.: +91 80 3352 5000
Fax: +91 80 6695 9942
About Mphasis
Mphasis is a global Technology Services and Solutions company specializing in the areas of Digital and Governance, Risk & Compliance. Our solution
focus and superior human capital propels our partnership with large enterprise customers in their Digital Transformation journeys and with global
financial institutions in the conception and execution of their Governance, Risk and Compliance Strategies. We focus on next generation technologies for
differentiated solutions delivering optimized operations for clients.
www.mphasis.com

Contenu connexe

Tendances

Wonders of Golang
Wonders of GolangWonders of Golang
Wonders of GolangKartik Sura
 
Why you should care about Go (Golang)
Why you should care about Go (Golang)Why you should care about Go (Golang)
Why you should care about Go (Golang)Aaron Schlesinger
 
Golang (Go Programming Language)
Golang (Go Programming Language)Golang (Go Programming Language)
Golang (Go Programming Language)ShubhamMishra485
 
Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go langAmal Mohan N
 
A First Look at Google's Go Programming Language
A First Look at Google's Go Programming LanguageA First Look at Google's Go Programming Language
A First Look at Google's Go Programming LanguageGanesh Samarthyam
 
Dependency management in golang
Dependency management in golangDependency management in golang
Dependency management in golangRamit Surana
 
An introduction to go programming language
An introduction to go programming languageAn introduction to go programming language
An introduction to go programming languageTechnology Parser
 
Golang from Scala developer’s perspective
Golang from Scala developer’s perspectiveGolang from Scala developer’s perspective
Golang from Scala developer’s perspectiveSveta Bozhko
 
Go Programming Language by Google
Go Programming Language by GoogleGo Programming Language by Google
Go Programming Language by GoogleUttam Gandhi
 
Getting started with Go - Florin Patan - Codemotion Rome 2017
Getting started with Go - Florin Patan - Codemotion Rome 2017Getting started with Go - Florin Patan - Codemotion Rome 2017
Getting started with Go - Florin Patan - Codemotion Rome 2017Codemotion
 
Golang and Domain Specific Languages - Lorenzo Fontana - Codemotion Rome 2017
Golang and Domain Specific Languages - Lorenzo Fontana - Codemotion Rome 2017Golang and Domain Specific Languages - Lorenzo Fontana - Codemotion Rome 2017
Golang and Domain Specific Languages - Lorenzo Fontana - Codemotion Rome 2017Codemotion
 
Google Go! language
Google Go! languageGoogle Go! language
Google Go! languageAndré Mayer
 
[INNOVATUBE] Tech Talk #3: Golang - Takaaki Mizuno
 [INNOVATUBE] Tech Talk #3: Golang - Takaaki Mizuno [INNOVATUBE] Tech Talk #3: Golang - Takaaki Mizuno
[INNOVATUBE] Tech Talk #3: Golang - Takaaki MizunoNexus FrontierTech
 
Building Command Line Tools with Golang
Building Command Line Tools with GolangBuilding Command Line Tools with Golang
Building Command Line Tools with GolangTakaaki Mizuno
 
Developing for LinkedIn's Application Platform
Developing for LinkedIn's Application PlatformDeveloping for LinkedIn's Application Platform
Developing for LinkedIn's Application PlatformTaylor Singletary
 
Lets Go - An introduction to Google's Go Programming Language
Lets Go - An introduction to Google's Go Programming Language Lets Go - An introduction to Google's Go Programming Language
Lets Go - An introduction to Google's Go Programming Language Ganesh Samarthyam
 

Tendances (20)

Wonders of Golang
Wonders of GolangWonders of Golang
Wonders of Golang
 
Why you should care about Go (Golang)
Why you should care about Go (Golang)Why you should care about Go (Golang)
Why you should care about Go (Golang)
 
Golang (Go Programming Language)
Golang (Go Programming Language)Golang (Go Programming Language)
Golang (Go Programming Language)
 
Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go lang
 
Go Lang
Go LangGo Lang
Go Lang
 
A First Look at Google's Go Programming Language
A First Look at Google's Go Programming LanguageA First Look at Google's Go Programming Language
A First Look at Google's Go Programming Language
 
Dependency management in golang
Dependency management in golangDependency management in golang
Dependency management in golang
 
Go lang
Go langGo lang
Go lang
 
An introduction to go programming language
An introduction to go programming languageAn introduction to go programming language
An introduction to go programming language
 
Golang from Scala developer’s perspective
Golang from Scala developer’s perspectiveGolang from Scala developer’s perspective
Golang from Scala developer’s perspective
 
Go Programming Language by Google
Go Programming Language by GoogleGo Programming Language by Google
Go Programming Language by Google
 
Golang
GolangGolang
Golang
 
Getting started with Go - Florin Patan - Codemotion Rome 2017
Getting started with Go - Florin Patan - Codemotion Rome 2017Getting started with Go - Florin Patan - Codemotion Rome 2017
Getting started with Go - Florin Patan - Codemotion Rome 2017
 
Introduction to Go-Lang
Introduction to Go-LangIntroduction to Go-Lang
Introduction to Go-Lang
 
Golang and Domain Specific Languages - Lorenzo Fontana - Codemotion Rome 2017
Golang and Domain Specific Languages - Lorenzo Fontana - Codemotion Rome 2017Golang and Domain Specific Languages - Lorenzo Fontana - Codemotion Rome 2017
Golang and Domain Specific Languages - Lorenzo Fontana - Codemotion Rome 2017
 
Google Go! language
Google Go! languageGoogle Go! language
Google Go! language
 
[INNOVATUBE] Tech Talk #3: Golang - Takaaki Mizuno
 [INNOVATUBE] Tech Talk #3: Golang - Takaaki Mizuno [INNOVATUBE] Tech Talk #3: Golang - Takaaki Mizuno
[INNOVATUBE] Tech Talk #3: Golang - Takaaki Mizuno
 
Building Command Line Tools with Golang
Building Command Line Tools with GolangBuilding Command Line Tools with Golang
Building Command Line Tools with Golang
 
Developing for LinkedIn's Application Platform
Developing for LinkedIn's Application PlatformDeveloping for LinkedIn's Application Platform
Developing for LinkedIn's Application Platform
 
Lets Go - An introduction to Google's Go Programming Language
Lets Go - An introduction to Google's Go Programming Language Lets Go - An introduction to Google's Go Programming Language
Lets Go - An introduction to Google's Go Programming Language
 

Similaire à Mphasis Digital - Use Go (gloang) for system programming, distributed systems and cloud workloads

Introduction to Go
Introduction to GoIntroduction to Go
Introduction to GoSimon Hewitt
 
Serverless Computing with Python
Serverless Computing with PythonServerless Computing with Python
Serverless Computing with Pythonwesley chun
 
Serverless computing with Google Cloud
Serverless computing with Google CloudServerless computing with Google Cloud
Serverless computing with Google Cloudwesley chun
 
Powerful Google developer tools for immediate impact! (2023-24 B)
Powerful Google developer tools for immediate impact! (2023-24 B)Powerful Google developer tools for immediate impact! (2023-24 B)
Powerful Google developer tools for immediate impact! (2023-24 B)wesley chun
 
The Why of Go
The Why of GoThe Why of Go
The Why of GoC4Media
 
What does people say when they switch to Go?
What does people say when they switch to Go?What does people say when they switch to Go?
What does people say when they switch to Go?Oliver N
 
[INNOVATUBE] Tech Talk #3: Golang - Vũ Nguyễn
[INNOVATUBE] Tech Talk #3: Golang - Vũ Nguyễn [INNOVATUBE] Tech Talk #3: Golang - Vũ Nguyễn
[INNOVATUBE] Tech Talk #3: Golang - Vũ Nguyễn Nexus FrontierTech
 
Powerful Google Cloud tools for your hack
Powerful Google Cloud tools for your hackPowerful Google Cloud tools for your hack
Powerful Google Cloud tools for your hackwesley chun
 
Serverless Computing with Google Cloud
Serverless Computing with Google CloudServerless Computing with Google Cloud
Serverless Computing with Google Cloudwesley chun
 
Top 10 web development tools in 2022
Top 10 web development tools in 2022Top 10 web development tools in 2022
Top 10 web development tools in 2022intouchgroup2
 
Powerful Google Cloud tools for your hack (2020)
Powerful Google Cloud tools for your hack (2020)Powerful Google Cloud tools for your hack (2020)
Powerful Google Cloud tools for your hack (2020)wesley chun
 
7 Predictions about Software Development trends in 2021
7 Predictions about Software Development trends in 20217 Predictions about Software Development trends in 2021
7 Predictions about Software Development trends in 2021Claritus Consulting
 
Cloud computing overview & running your code on Google Cloud
Cloud computing overview & running your code on Google CloudCloud computing overview & running your code on Google Cloud
Cloud computing overview & running your code on Google Cloudwesley chun
 
10 kickass-technologies-modern-developers-love
10 kickass-technologies-modern-developers-love10 kickass-technologies-modern-developers-love
10 kickass-technologies-modern-developers-loveHamed Hatami
 
Is Go Better Than Python For Data Mining
Is Go Better Than Python For Data MiningIs Go Better Than Python For Data Mining
Is Go Better Than Python For Data MiningRepustate
 
Advantages of golang development services &amp; 10 most used go frameworks
Advantages of golang development services &amp; 10 most used go frameworksAdvantages of golang development services &amp; 10 most used go frameworks
Advantages of golang development services &amp; 10 most used go frameworksKaty Slemon
 
Unveiling the Future: 10 Software Development Trends to Watch Out for in 2023
Unveiling the Future: 10 Software Development Trends to Watch Out for in 2023Unveiling the Future: 10 Software Development Trends to Watch Out for in 2023
Unveiling the Future: 10 Software Development Trends to Watch Out for in 2023aTeam soft solutions
 
Stay Ahead of the Curve: Top Software Development Trends to Watch Out for in ...
Stay Ahead of the Curve: Top Software Development Trends to Watch Out for in ...Stay Ahead of the Curve: Top Software Development Trends to Watch Out for in ...
Stay Ahead of the Curve: Top Software Development Trends to Watch Out for in ...aTeam soft solutions
 
Scaling applications with go
Scaling applications with goScaling applications with go
Scaling applications with goVimlesh Sharma
 

Similaire à Mphasis Digital - Use Go (gloang) for system programming, distributed systems and cloud workloads (20)

Introduction to Go
Introduction to GoIntroduction to Go
Introduction to Go
 
Serverless Computing with Python
Serverless Computing with PythonServerless Computing with Python
Serverless Computing with Python
 
Serverless computing with Google Cloud
Serverless computing with Google CloudServerless computing with Google Cloud
Serverless computing with Google Cloud
 
Powerful Google developer tools for immediate impact! (2023-24 B)
Powerful Google developer tools for immediate impact! (2023-24 B)Powerful Google developer tools for immediate impact! (2023-24 B)
Powerful Google developer tools for immediate impact! (2023-24 B)
 
The Why of Go
The Why of GoThe Why of Go
The Why of Go
 
Enterprise 2020
Enterprise 2020Enterprise 2020
Enterprise 2020
 
What does people say when they switch to Go?
What does people say when they switch to Go?What does people say when they switch to Go?
What does people say when they switch to Go?
 
[INNOVATUBE] Tech Talk #3: Golang - Vũ Nguyễn
[INNOVATUBE] Tech Talk #3: Golang - Vũ Nguyễn [INNOVATUBE] Tech Talk #3: Golang - Vũ Nguyễn
[INNOVATUBE] Tech Talk #3: Golang - Vũ Nguyễn
 
Powerful Google Cloud tools for your hack
Powerful Google Cloud tools for your hackPowerful Google Cloud tools for your hack
Powerful Google Cloud tools for your hack
 
Serverless Computing with Google Cloud
Serverless Computing with Google CloudServerless Computing with Google Cloud
Serverless Computing with Google Cloud
 
Top 10 web development tools in 2022
Top 10 web development tools in 2022Top 10 web development tools in 2022
Top 10 web development tools in 2022
 
Powerful Google Cloud tools for your hack (2020)
Powerful Google Cloud tools for your hack (2020)Powerful Google Cloud tools for your hack (2020)
Powerful Google Cloud tools for your hack (2020)
 
7 Predictions about Software Development trends in 2021
7 Predictions about Software Development trends in 20217 Predictions about Software Development trends in 2021
7 Predictions about Software Development trends in 2021
 
Cloud computing overview & running your code on Google Cloud
Cloud computing overview & running your code on Google CloudCloud computing overview & running your code on Google Cloud
Cloud computing overview & running your code on Google Cloud
 
10 kickass-technologies-modern-developers-love
10 kickass-technologies-modern-developers-love10 kickass-technologies-modern-developers-love
10 kickass-technologies-modern-developers-love
 
Is Go Better Than Python For Data Mining
Is Go Better Than Python For Data MiningIs Go Better Than Python For Data Mining
Is Go Better Than Python For Data Mining
 
Advantages of golang development services &amp; 10 most used go frameworks
Advantages of golang development services &amp; 10 most used go frameworksAdvantages of golang development services &amp; 10 most used go frameworks
Advantages of golang development services &amp; 10 most used go frameworks
 
Unveiling the Future: 10 Software Development Trends to Watch Out for in 2023
Unveiling the Future: 10 Software Development Trends to Watch Out for in 2023Unveiling the Future: 10 Software Development Trends to Watch Out for in 2023
Unveiling the Future: 10 Software Development Trends to Watch Out for in 2023
 
Stay Ahead of the Curve: Top Software Development Trends to Watch Out for in ...
Stay Ahead of the Curve: Top Software Development Trends to Watch Out for in ...Stay Ahead of the Curve: Top Software Development Trends to Watch Out for in ...
Stay Ahead of the Curve: Top Software Development Trends to Watch Out for in ...
 
Scaling applications with go
Scaling applications with goScaling applications with go
Scaling applications with go
 

Plus de Aniruddha Chakrabarti

Thomas Cook and Accenture expand relationship with 10 year technology consult...
Thomas Cook and Accenture expand relationship with 10 year technology consult...Thomas Cook and Accenture expand relationship with 10 year technology consult...
Thomas Cook and Accenture expand relationship with 10 year technology consult...Aniruddha Chakrabarti
 
NLP using JavaScript Natural Library
NLP using JavaScript Natural LibraryNLP using JavaScript Natural Library
NLP using JavaScript Natural LibraryAniruddha Chakrabarti
 
Amazon alexa - building custom skills
Amazon alexa - building custom skillsAmazon alexa - building custom skills
Amazon alexa - building custom skillsAniruddha Chakrabarti
 
Using Node-RED for building IoT workflows
Using Node-RED for building IoT workflowsUsing Node-RED for building IoT workflows
Using Node-RED for building IoT workflowsAniruddha Chakrabarti
 
Using Swift for all Apple platforms (iOS, watchOS, tvOS and OS X)
Using Swift for all Apple platforms (iOS, watchOS, tvOS and OS X)Using Swift for all Apple platforms (iOS, watchOS, tvOS and OS X)
Using Swift for all Apple platforms (iOS, watchOS, tvOS and OS X)Aniruddha Chakrabarti
 
Future of .NET - .NET on Non Windows Platforms
Future of .NET - .NET on Non Windows PlatformsFuture of .NET - .NET on Non Windows Platforms
Future of .NET - .NET on Non Windows PlatformsAniruddha Chakrabarti
 
Mphasis Digital POV - Emerging Open Standard Protocol stack for IoT
Mphasis Digital POV - Emerging Open Standard Protocol stack for IoTMphasis Digital POV - Emerging Open Standard Protocol stack for IoT
Mphasis Digital POV - Emerging Open Standard Protocol stack for IoTAniruddha Chakrabarti
 

Plus de Aniruddha Chakrabarti (20)

Pinecone Vector Database.pdf
Pinecone Vector Database.pdfPinecone Vector Database.pdf
Pinecone Vector Database.pdf
 
Mphasis-Annual-Report-2018.pdf
Mphasis-Annual-Report-2018.pdfMphasis-Annual-Report-2018.pdf
Mphasis-Annual-Report-2018.pdf
 
Thomas Cook and Accenture expand relationship with 10 year technology consult...
Thomas Cook and Accenture expand relationship with 10 year technology consult...Thomas Cook and Accenture expand relationship with 10 year technology consult...
Thomas Cook and Accenture expand relationship with 10 year technology consult...
 
NLP using JavaScript Natural Library
NLP using JavaScript Natural LibraryNLP using JavaScript Natural Library
NLP using JavaScript Natural Library
 
Dart programming language
Dart programming languageDart programming language
Dart programming language
 
Third era of computing
Third era of computingThird era of computing
Third era of computing
 
Amazon alexa - building custom skills
Amazon alexa - building custom skillsAmazon alexa - building custom skills
Amazon alexa - building custom skills
 
Using Node-RED for building IoT workflows
Using Node-RED for building IoT workflowsUsing Node-RED for building IoT workflows
Using Node-RED for building IoT workflows
 
Using Swift for all Apple platforms (iOS, watchOS, tvOS and OS X)
Using Swift for all Apple platforms (iOS, watchOS, tvOS and OS X)Using Swift for all Apple platforms (iOS, watchOS, tvOS and OS X)
Using Swift for all Apple platforms (iOS, watchOS, tvOS and OS X)
 
Future of .NET - .NET on Non Windows Platforms
Future of .NET - .NET on Non Windows PlatformsFuture of .NET - .NET on Non Windows Platforms
Future of .NET - .NET on Non Windows Platforms
 
CoAP - Web Protocol for IoT
CoAP - Web Protocol for IoTCoAP - Web Protocol for IoT
CoAP - Web Protocol for IoT
 
Groovy Programming Language
Groovy Programming LanguageGroovy Programming Language
Groovy Programming Language
 
Mphasis Digital POV - Emerging Open Standard Protocol stack for IoT
Mphasis Digital POV - Emerging Open Standard Protocol stack for IoTMphasis Digital POV - Emerging Open Standard Protocol stack for IoT
Mphasis Digital POV - Emerging Open Standard Protocol stack for IoT
 
Level DB - Quick Cheat Sheet
Level DB - Quick Cheat SheetLevel DB - Quick Cheat Sheet
Level DB - Quick Cheat Sheet
 
Lisp
LispLisp
Lisp
 
Overview of CoffeeScript
Overview of CoffeeScriptOverview of CoffeeScript
Overview of CoffeeScript
 
memcached Distributed Cache
memcached Distributed Cachememcached Distributed Cache
memcached Distributed Cache
 
Redis and it's data types
Redis and it's data typesRedis and it's data types
Redis and it's data types
 
pebble - Building apps on pebble
pebble - Building apps on pebblepebble - Building apps on pebble
pebble - Building apps on pebble
 
TypeScript Overview
TypeScript OverviewTypeScript Overview
TypeScript Overview
 

Dernier

PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 

Dernier (20)

PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 

Mphasis Digital - Use Go (gloang) for system programming, distributed systems and cloud workloads

  • 1. 1Use Go for System Programming, Distributed Systems and Cloud Workloads Mphasis Mphasis Digital POV Use Go for System Programming, Distributed Systems and Cloud Workloads PoV by Aniruddha Chakrabarti AVP Digital, Mphasis
  • 2. 2Use Go for System Programming, Distributed Systems and Cloud Workloads Mphasis Abstract C and C++ are widely accepted and used as de-facto standard for systemprogramming language.In spite of the tremendous success and adoption of C and C++, there was always need for a more modern system programming language that would not only have performance characteristics of C and C++, but also the flexibility of other modern languages such as Python, Pascal, Modula and Smalltalk. In recent past (since 2000) we have seen three moderately successful system programming languages being born – D (in 2001), Go (in 2009) and Rust (in 2012). Among them, while D is a close follower of C and C++, if not predecessor and hence the name D, Go takes a unique and differentiated approach than C and C++. We believe this is the strongest reason behind Go’s success. Go is also well suited for web development. There are multiple web development frameworks and middle tiers for Go that have received success in recent times, including Martini, Gin, Negroni, Revel, Beego, Gorilla and Net/HTTP. Go is also supported by multiple PaaS platforms including Google Cloud Platform (App Engine), Cloud Foundry (including Pivotal Web Service) and Heroku. AWS Elastic Beanstalk also supports deploying Go applications. We strongly believe that in future Go would come out as a strong alternate of C and C++ in the area of system programming, web development, large scale distributed systems and cloud workloads.0 0 0 0 0 0 0 1 1 1 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0 1 0 1 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0 1 0 1 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0 1 0 1 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 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1 0 1 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0 1 0 1 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0 1 0 1 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0 1 0 1 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0 1 0 1 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0 1 0 1 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0 1 0 1 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 Overview of Go Go or Golang is an open source programming language developed at Google, specially targeted at system programming and for building large scale distributed systems. It is natively compiled (does not need a VM to run), statically typed language following the footsteps of system programming languages such as C and C++. But Go is garbage collected, unlike C and C++. Go is designed with the philosophy of “Less is exponentially more”. In a blog post dated June 2012, Rob Pike, one of the designers of the language, reported how a language with less but well-designed features is far better than a language. Go is not an object-oriented language. While Go support types, methods and interfaces, it does not support classes, inheritance, overloading of methods or operators. History of Go • Go language was originated as an outcome of an experiment by Robert Griesemer, Rob Pike and Ken Thompson at Google, to design a new system programming language in 2007 • Officially announced in November 2009, it is used in some of Google's production systems as well as by other firms • Version 1.0 was released in March 2012 and between 2012 and 2015, multiple versions were released • Version 1.5 was released in August 2015, which is the current stable version When you think about system programming, think Go - developed at Google for advanced technology demands
  • 3. 3Use Go for System Programming, Distributed Systems and Cloud Workloads Mphasis New Programming Languages Programming Language Backed by / Developed at First public release Success Paradigm Suitable for Go (also called golang) Google November 2009 High Procedural - Designed from ground up with concurrency in mind. Supports Actor model based concurrency. System programming, large scale distributed systems, cloud workloads, web back ends D Facebook December 2001 Medium Procedural, Object-oriented System programming, large scale distributed systems, web back ends Rust Mozilla 2010 Medium Procedural, Object-oriented with functional programming constructs. System programming R Bell Laboratories Late 90s High Object-oriented with functional and procedural constructs. Statistical computing, Big Data analytics Scala Open Source 2004 High Object oriented with influences functional programming Programming. Supports actor model based concurrency. General purpose Groovy Apache Foundation 2004 Medium Object oriented programming language with dynamic typing – designed for scripting in mind General purpose, scripting focused Clojure Open Source 2007 Low Functional – Is a dialect of Lisp General purpose Dart Google 2011 Low Object-oriented with scripting and functional programming constructs. Designed from group up for web development. Supports Actor model based concurrency. Web development TypeScript Microsoft 2012 Medium Scripting language with Object oriented constructs. Designed from group up for web development Web development F# Microsoft 2005 Medium Functional programming language that supports object oriented concepts General purpose Ceylon Red Hat 2011 Low Object oriented General purpose Swift Apple 2014 High Object oriented with influences from functional programming General purpose Other System Programming Languages Language  Originator  Birth Date  Influenced by  Used for  ESPOL Burroughs Corporation 1961 Algol 60 MCP PL/I IBM , SHARE 1964 Algol, FORTRAN , some COBOL Multics PL360 Niklaus Wirth 1968 Algol 60 Algol W C Dennis Ritchie 1969 BCPL Unix PL/S IBM 196x PL/I OS/360 BLISS Carnegie Mellon University 1970 Algol-PL/I(5) VMS (portions) PL/8 IBM 197x PL/I AIX PL-6 Honeywell. Inc 197x PL/I CP-6 SYMPL CDC 197x JOVIAL NOS subsystems, most complters, FSE editor C++ Bjarne Stroustrup 1979 C. Simula See C++ Applications(6) Ada Jean Ichbiah. S. Tucker Taft 1983 Algol 68, Pascal, C++, Java, Effel Embedded systems, OS kernels, compilers, games, simulations, Cubesat, air traffic control, and avionics D Digital Mars 2001 C++ XomB Go Google 2009 C, Pasacal, CSP Some Google systems.(7) Docker, Kubernetes, CoreOS(a) Rust Mozilla Research(8) 2012 C++, Haskell, Erlang, Ruby Servo layput engine System Programming Languages Developed after 2000
  • 4. 4Use Go for System Programming, Distributed Systems and Cloud Workloads Mphasis Go Usage • Many Google web properties and systems including YouTube, Kubernetes containers and download server dl.google.com • Docker, a set of tools for deploying Linux containers • Dropbox, migrated some of their critical components from Python to Go • SoundCloud, for many of their systems • Cloud Foundry, a platform as a service (PaaS) • Couchbase, Query and Indexing services within the Couchbase Server • MongoDB, tools for administering MongoDB instances • ThoughtWorks, some tools and applications around continuous delivery and instant messages • SendGrid, a transactional email delivery and management service • The BBC, in some games and internal projects • Novartis, for an internal inventory system For a complete list of apps and systems that use Go refer- https://en.wikipedia.org/wiki/Go_(programming_language)#Notable_users and https://github.com/golang/go/wiki/GoUsers Features that made Go a success Pointers Interface Rich Standard Library Structs and Methods First class functions Actor Model Based Concurrency First class functions Go supports first class functions - Functions could be assigned to variables and passed as parameter to other functions. They could be even returned from other functions. Go supports anonymous functions, multiple return values from functions and all concepts supported by functional programming languages. Anonymous Functions Anonymous Functions are functions without name – they are typically assigned to variable. func main(){ add := func(x int, y int) int {return x+y} var sub = func(x int, y int) int {return x-y} fmt.Println(add(20,30)) fmt.Println(sub(20,30)) }
  • 5. 5Use Go for System Programming, Distributed Systems and Cloud Workloads Mphasis Functions can be passed to other functions as parameters. In the below example higherOrderFunc is a higher order function that accepts another function (f func(x int, y int) int) as parameter - func main(){ add := func(x int, y int) int {return x+y} var sub = func(x int, y int) int {return x-y} fmt.Println(add(20,30)) fmt.Println(sub(20,30)) fmt.Println(higherOrderFunc(add, 30, 20)) fmt.Println(higherOrderFunc(sub, 30, 20)) } func higherOrderFunc(f func(x int, y int) int, num1 int, num2 int) int{ return f(num1 * num1, num2 * num2) } Now the function definition for higherOrderFunc is a bit complicated and could get even more complicated if it accepts multiple functions as input parameter. This could be simplified by defining a user defined function type. func main(){ add := func(x int, y int) int {return x+y} var sub = func(x int, y int) int {return x-y} fmt.Println(add(20,30)) fmt.Println(sub(20,30)) fmt.Println(higherOrderFunc(add, 30, 20)) fmt.Println(higherOrderFunc(sub, 30, 20)) } type HigherFunc func(x int, y int) int // user defined function type func higherOrderFunc(f HigherFunc, num1 int, num2 int) int{ return f(num1 * num1, num2 * num2) } Similarly a higher order function could return another function – func main(){ var result = higherOrderFunc2() fmt.Println(result(30, 20)) // 50 } func higherOrderFunc() func(x int, y int)int { add := func(x int, y int) int {return x+y} return add } Go can also return multiple values from a function – func swap(x, y int) (int, int){ return y, x } var x,y int = 10,20 fmt.Println(x,y) // 10 20 var p,q int = swap(x,y) fmt.Println(p,q) // 20 10
  • 6. 6Use Go for System Programming, Distributed Systems and Cloud Workloads Mphasis Structs and Methods Structs Go does not support Class, but supports Struct. Structs in Go are typed collections of named fields similar to other programming languages like C++ and Java. Structs can have methods apart from fields. Struct allows grouping of fields (data) and methods (behavior). type Employee struct { name string // field name of type string age int // field age of type int salary float32 // field salary of type float32 designation string // field designation of type string } Structs could be initialized either using new function (Option 1) or using JavaScript like object literal notation (Option 2) // Option 1 – using new function emp := new(Employee) emp.name = "Ken Thompson" emp.age = 50 emp.salary = 12345.678 emp.designation = "Distinguished Engineer" // Option 2 – using JavaScript like object literal notation emp := Employee{} emp.name = "Ken Thompson" emp.age = 50 emp.salary = 12345.678 emp.designation = "Distinguished Engineer" Another alternate is to specify field values as parameters in the same order fields are declared // Option 3 – parameters should be in the same order fields are declared emp := Employee{"Ken Thompson", 50, 12345.678, "Distinguished Engineer"} Note: ; are optional in Go similar to JavaScript. Local variables could be assigned without specifying their types using := instead of = Structs can have arrays and other child structs as fields type Employee struct{ Name string Age int Salary float32 Skills [4]string // Array field HomeAddress Address // Nested Child struct as property } type Address struct{ StreetAddress string City string Country string } func main(){ address := Address{"MG Road", "Blore", "IN"} skills := [4]string {"C","Go","Rwust"} emp := Employee{"Aniruddha", 40, 123.456, skills, address} fmt.Println(emp) // {Aniruddha 40 123.456 [C Go Rust] {MG Road Blore IN}} fmt.Println(emp.Skills) // [C Go Rust] fmt.Println(emp.HomeAddress.StreetAddress) // M G Road }
  • 7. 7Use Go for System Programming, Distributed Systems and Cloud Workloads Mphasis Go simplifies the process and reduces a lot of effort from programming perspective. Methods Apart from member fields, Go structs support defining methods (member functions). Methods of the struct are actually defined outside the struct declaration, which is unique in Go. type Employee struct { name string age int designation string } // Displayis declaredas a method for Employeestruct func (emp Employee) Display() { fmt.Println("Name:", emp.name, ", Designation:", emp.designation) } func main(){ emp := Employee{name:"Bill G", age:55, designation:"President"} emp.Display() // prints Name: Bill G , Designation: President } Methods can accept parameter similar to normal functions – type Employee struct { name string age int designation string } // Method for struct Employee that accepts a string input func (emp Employee) Display(message string) { fmt.Println(message, emp.name, ", Designation:", emp.designation) } func main(){ emp := Employee{name:"Bill G", age:55, designation:"President"} emp.Display("Hello") } Interfaces Go support interfaces, just like C++, Java and C# do. Interfaces are named collections of method signatures. They could be treated as blueprint as they do not provide implementation. Types that implement an interface is responsible for providing the actual implementation. Go is unique in the fact that types do not have to explicitly use “implements” or other similar declarations to specify that they are implementing an interface. To implement an interface, all that types have to do is provide implementation of methods defined in interface. // An interface called Human is declared with two methods – Walk and Talk type Human interface { Walk(miles int) Talk() } // A type called Employee is declared which would implement the interface Human // Note that the type does not specify that it would implement the interface type Employee struct { name string designation string }
  • 8. 8Use Go for System Programming, Distributed Systems and Cloud Workloads Mphasis Parallelism and concurrency are the key elements in Go design // Implementation of methods of Human interface func (emp Employee) Walk(miles int){ fmt.Println("I can walk", miles, "miles") } // Implementation of methods of Human interface func (emp Employee) Talk(){ fmt.Println("I can talk. My name is", emp.name, "and I am a", emp.designation) } func main(){ var emp Human = Employee{name:"Rob Pike", designation:"Architect"} emp.Walk(10) // I can walk 10 miles emp.Talk() // I can talk. My name is Rob Pike and I am a Architect } The type implementing the interface has to implement all the methods specified in the interface. Also, all the method signatures should match. If both of these conditions are not matched then compiler complains - type Contractor struct { name string } func (cont Contractor) Walk(miles string){ fmt.Println("I can walk", miles, "miles") } func main(){ var cont Human = Contractor{name:"John Smith"} cont.Walk("7") } Go compiler throws the following error for the above example – cannot use Contractor literal (type Contractor) as type Human in assignment: Contractor does not implement Human (missing Talk method) cannot use "7" (type string) as type int in argument to cont.Walk Concurrency (Goroutines and Channels) Go has been designed from ground up, keeping concurrency and parallelism in mind. Go’s concurrency is based on a concept called Communicating Sequential Processes (CSP) that was introduced by C.A.R. Hoare in a seminal paper in 1978. CSP is similar to the Actor model of currency, which was made popular by Erlang. CSP takes a different approach to concurrency, compared to thread / lock based concurrency. While in thread based concurrency, multiple threads use shared memory to communicate among themselves, in CSP, concurrent processes or actor or routines use message passing to communicate. They do not use shared memory thus avoiding synchronization and synchronization primitive (lock, mutex, monitor, semaphore etc) related issue. Thread 1 read and write read and write Thread 2 Thread 3 Shared Memory Thread based concurrency model with shared memory
  • 9. 9Use Go for System Programming, Distributed Systems and Cloud Workloads Mphasis Do not communicate by sharing memory; instead, share memory by communicating – GoLang website Goroutine Go uses goroutines for concurrency. A goroutine is a function that executes concurrently with other goroutines in the same address space; it’s quite lightweight as compared to OS threads and is managed by Go runtime. Multiple goroutines could be executed concurrently thus bringing in concurrency. Any function could be executed as a goroutine by prefixing it with go keyword – func main() { // add function is called as goroutine go add(20, 10) fmt.Println("add executed") fmt.Scanln() } func add(x int, y int){ fmt.Println(x+y) } Channel Channels are the conduit through which messages could be sent and received. For sending and receiving messages using channel <- operator is used. Channels could be created using make function. While creating the channel the type of message to be passed using the channel is specified – Goroutines make Go easy to use and help it keep concurrency intact. Actor 1 Actor 2 Actor 3 SharedMemory Asynchronous message passing Asynchronous message passing Asynchronous message passing Actor based concurrency model - no shared memory
  • 10. 10Use Go for System Programming, Distributed Systems and Cloud Workloads Mphasis // Declare and allocate a channel channel := make(chan string) // Send a message across the channel channel <- "message" // Receive message from the channel msg:= <- channel The below example creates two goroutines – one of them behaves as message sender and the other is message receiver. The message sender then sends the message via a channel and the message receiver receives the message. Message Receiver (ReceiveMessage goroutine) Message Sender (SendMessage goroutine) Message Channel func main(){ channel := make(chan string) go SendMessage(channel) go ReceiveMessage(channel) fmt.Scanln(); } // goroutine that sends the message func SendMessage(channel chan string) { for { channel <- "sending message @" + time.Now().String() time.Sleep(2 * time.Second) } } // goroutine that receives the message func ReceiveMessage(channel chan string) { for { message := <- channel fmt.Println(message) } } Message Receiver (ReceiveMessage goroutine) Message Sender (SendMessage goroutine) Acknowledgement Channel Message Channel Acknowledgement Message func main() { // Channel used to send the message from sender to receiver msgChannel := make(chan string) // Channel used to acknowledge the message receipt by receiver ackChannel := make(chan string) go SendMessage(msgChannel, ackChannel) go ReceiveMessage(msgChannel, ackChannel) fmt.Scanln() }
  • 11. 11Use Go for System Programming, Distributed Systems and Cloud Workloads Mphasis // goroutine that sends the message func SendMessage(msgChannel chan string, ackChannel chan string) { for { // Send the message to message channel msgChannel <- "Sending message @" + time.Now().String() time.Sleep(2 * time.Second) // Receive the acknowledgement from acknowledgement channel ack := <-ackChannel fmt.Println(ack) } } // goroutine that receives the message func ReceiveMessage(msgChannel chan string, ackChannel chan string) { for { // Receive the message from message channel message := <-msgChannel fmt.Println(message) // Send the acknowledgement to acknowledge channel ackChannel <- "Message received @" + time.Now().String() } } Pointers Unlike some of the new programming languages such as Java, C#, Ruby, Python and Swift, Go supports pointers. Pointers in Go behave much the same way as C and C++. Pointers reference a location in memory where a value is stored rather than the value itself. A pointer is represented using the * (asterisk) character followed by the type of the stored value. The & (ampersand) operator is used to denote the address of a variable. In the below example, a pointer is declared that points to an existing string variable (city). The address of the pointer and the value it’s pointing to is printed. var city string = "Bangalore" // Declare a pointer that points to the address of city variable ptrToCity := &city // Print the address of the pointer and value the pointer is pointing to fmt.Println("&ptrToCity = ", &ptrToCity); // prints the address of the pointer fmt.Println("*ptrToCity = ", *ptrToCity); // prints the value it’s pointing to Changing the value of the pointer changes the value of the original value it is pointing to - var city string = "Bangalore" var ctr int = 10 // Declare two pointers pointing to city and ctr variables ptrToCity := &city ptrToCtr := &ctr fmt.Println("city = ", city, ", *ptrToCity = ", *ptrToCity); fmt.Println("ctr = ", ctr, ", *ptrToCtr = ", *ptrToCtr); Go is one of the most advanced programming languages for a reason - it supports the use of pointers.
  • 12. 12Use Go for System Programming, Distributed Systems and Cloud Workloads Mphasis // Change the values of the pointers *ptrToCity = "Kolkata" *ptrToCtr = 20 // The original variables to which pointers are pointing is also changed fmt.Println("city = ", city, ", *ptrToCity = ", *ptrToCity); fmt.Println("ctr = ", ctr, ", *ptrToCtr = ", *ptrToCtr); Rich standard library Go comes with a large no of packages that provide common functionality such as File handling, IO, String handling, Cryptography etc. Below is a list of popularly used Go packages - Sl. No Description Package Name 1 String manipulation Strings 2 Input and Output io, bytes 3 Files and Folders os, path/filepath 4 Errors Errors 5 Containers & Sort container/list 6 Hashes and Cryptography hash, crypto 7 Encoding encoding/sob 8 Allows interacting with Go's runtime system, such as functions to control goroutines Runtime 9 Synchronization Primitives Sync 10 Server communication, RPC, HTTP, SMTP etc. net, http/rpc/jsonrpc 11 Math library Math 12 Zip, Archive, Compress archive, compress 13 Database related database, sql 14 Debugging Debug 15 Automated testing Testing Other highlights of Go 1. Go is statically typed 2. Natively compiled, but garbage collected 3. Go is statically typed with optional type inference 4. Supports Defer, Panic and Recover for error handling 5. Does not support classes and inheritance 6. Does not support overloading of methods and operators 7. Go compiler compiles source code very fast. 8. Does not support Generics Conclusion Go has evolved as a major programming language suitable for not only system programming, but also for cloud workloads. Go is supported by multiple cloud platforms, including Google Cloud Platform (App Engine), Cloud Foundry (including Pivotal Web Service), Heroku and AWS Elastic Beanstalk. Microsoft also added "experimental support" for Go into its Azure cloud service. Go is becoming a popular language of choice for system programming, web development, large scale distributed systems and cloud workloads. Further Reading • Less is exponentially more: A blog by Rob Pike - http://commandcenter.blogspot.de/2012/06/less-is-exponentially-more.html • Go website - https://golang.org • Go FAQ - https://golang.org/doc/faq#Is_Go_an_object-oriented_language • Go By Example - https://gobyexample.com/ • An Introduction to Programming in Go - https://www.golang-book.com/books/intro • Little Go Book - http://openmymind.net/assets/go/go.pdf • Effective Go - https://golang.org/doc/effective_go.html • Communicating Sequential Processes - https://en.wikipedia.org/wiki/Communicating_sequential_processes Copyright ©: The brand names mentioned in this POV (Go, D, Rust, C, C++, AWS, Heroku, Google Cloud Platform, Cloud Foundry, Pivotal Web Service, Azure etc.) belong to their respective owners.
  • 13. 13Use Go for System Programming, Distributed Systems and Cloud Workloads Mphasis Aniruddha Chakrabarti Associate Vice President, Digital, Mphasis Aniruddha has 16+ years of IT experience spread across systems integration, technology consulting, IT outsourcing and product development. He has extensive experience of delivery leadership, solution architecture, presales, technology architecture and program management of large scale distributed systems. As AVP, Digital in Mphasis, Aniruddha is responsible for Presales, Solutions, RFP/RFI and Capability Development of Digital Practice. Before as Sr. Manager & Sr. Principal Architect in Accenture, he was responsible for presales, architecture and leading large delivery teams. He had played delivery leadership and architecture focused roles in Microsoft, Target, Misys and Cognizant. His interests include digital, cloud, mobility, IoT, cognitive computing, NLP, distributed systems, web, open source, .NET, Java, programming languages and NoSQL. His industry experience spans Retail, Healthcare, Capital Markets, Insurance, Travel, Hospitality, Pharma and Medical Technology. VAS01/07/16USLETTERBASIL4020 For more information, contact: marketinginfo@mphasis.com USA 460 Park Avenue South Suite #1101 New York, NY 10016, USA Tel.: +1 212 686 6655 Fax: +1 212 683 1690 Copyright © Mphasis Corporation. All rights reserved. UKt88 Wood Street London EC2V 7RS, UK Tel.: +44 20 8528 1000 Fax: +44 20 8528 1001 INDIA Bagmane World Technology Center Marathahalli Ring Road DoddanakundhiVillage,Mahadevapura Bangalore 560 048, India Tel.: +91 80 3352 5000 Fax: +91 80 6695 9942 About Mphasis Mphasis is a global Technology Services and Solutions company specializing in the areas of Digital and Governance, Risk & Compliance. Our solution focus and superior human capital propels our partnership with large enterprise customers in their Digital Transformation journeys and with global financial institutions in the conception and execution of their Governance, Risk and Compliance Strategies. We focus on next generation technologies for differentiated solutions delivering optimized operations for clients. www.mphasis.com