You are on page 1of 20

SEMINAR

ON
GOLANG-By GOOGLE

Guided By :
Dr. Rajesh
Mishra

SCHOOL OF ICT, GAUTAM

Submitted By:
Praval kulshreshtha
(12/iec/064)
Prem shankar
(12/iec/038)
Srishty verma
(12/iec/010)
Himanshu choudhary
(12/iec/041
)
BUDDHA
UNIVERSITY

>> INTRODUCTION

Go, also commonly referred to asgolang, is a programming language


developed atGooglein 2007 byRobert Griesemer, Rob Pike and Ken
Thompson.
It is a staticallytypedlanguage with syntax loosely derived from that of C
The language was announced in November 2009 and is now used in some
of Google's production systems.
Go's "gc" compiler targets theLinux, OS X, Free BSD, Net BSD, Open BSD,
Plan 9, Dragon Fly BSD, Solaris, and Windows operating systems and
thei386, AMD64, ARM and IBM Power processor architectures. A second
compiler, gcc go, is aGCC frontend.
Androidsupport was added in version 1.4, which has since been ported to
also run oniOS.

>> PURPOSE OF THE PROJECT


No major systems language has emerged in over a decade, but over that
time the computing landscape has changed tremendously. There are
several trends:
Software Development.
Dependency Management.
Rebellion Against Cumbersome Type System Languages.
Not Supportive Fundamental Concepts.

>> STATUS OF THE PROJECT


Go became a public open source project on November 10, 2009.
After a couple of years of very active design and development, stability
was called for and Go 1 wasreleasedon March 28, 2012.
# Go 1 releases : 1. Go1.1 (released 13/05/2013)
- Go1.1.1

- Go1.1.2

2. Go1.2 (released 01/12/2013)

- Go1.2.1
- Go1.2.2

3. Go1.3 (released 18/06/2014)

- Go1.3.1
- Go1.3.2
- Go1.3.3

4. Go1.4 (released 10/12/2014)

- Go1.4.1
- Go1.4.2
- Go1.4.3

5. Go1.5 (released 19/08/2015)

- Go1.5.1

>> ANSWERS
Started as an answer to software problems at Google:
multicore processors
networked systems
massive computation clusters
scale: 10 lines of code
scale: 10 programmers
scale: 10 machines (design point)
Deployed: parts of YouTube, dl.google.com, Blogger, Google
Code, Google Fiber

>> RESEARCH & GO


Go is designed for building production systems at Google.
Goal: make that job easier, faster, better.
Non-goal: break new ground in programming language research
Plenty of research questions about how to implement Go well.
Concurrency
Polymorphism
Garbage collection
Program translation

>> CONCURRENCY
Go provides two important concepts:
A goroutine
A channel
Concurrency: CSP
Channels adopted from Hoare's Communicating Sequential
Processes.
Orthogonal to rest of language
Can keep familiar model for computation
Focus oncompositionof regular code

>> CONCURRENCY

package main
import "fmt
func main() {
c := make(chan
string) go func()
{
c <- "Hello"
c <- "World"
}()
fmt.Println(<-c,
<-c)
code }

run

>> POLYMORPHISM
Interfaces
An interface defines a set of methods. Implementation of an
interface can be assigned to a variable of that interface type.
Interface Advantages
no dependence between interface and implementation
easy testing
avoids overdesign, rigid hierarchy of inheritance-based OO
The source of all generality in the Go language

>> POLYMORPHISM
b := new(bytes.Buffer)
var w io.Writer
w = b
fmt.Fprintf(w, "hello,
%s\n", "world")
os.Stdout.Write(b.Bytes(
))

code

run

>> GARBAGE COLLECTION


Garbage collection simplifies APIs.
In C and C++, too much API design (and too much
programming effort!) is about memory management.
Observation: garbage collection is a service, and like any service
it can be overloaded, oversubscribed .
Implementing Garbage Collection

Cannot reuse Java GC algorithms directly.


But givesprogrammermore control over allocation.

>> PROGRAM TRANSLATION


Go programs can be parsed without context (unlike C and C++).
Exploring the conversion of C programs to Go today.
Decide return type (for example, int vs bool).
Decide which variables are pointers vs arrays.
Decide which functions are really methods.
Decide natural package boundaries.

>> ADVANTAGES V/S


DISADVANTAGES

Advantages:

Go compiles very quickly.


Go supports concurrency at the language level.
Functions are first class objects in Go.
Go has garbage collection.
Strings and maps are built into the language.

Disadvantages:
The packages distributed with Go are pretty useful, but there are
still some libraries you'll miss. Most notably a UI toolkit.
There is no support for generics in Go, although there are many
discussions around it.

>> CHANGES FROM C

Syntax so different from C


Declarations backwards
No pointer arithmetic
Braces but no semicolons
Garbage collection

>> GO USERS
Other companies and sites using Go (generally together with other languages, not
exclusively) include:

Google
Dropbox
CloudFlare
Railgun
SoundCloud
TheBBC
Novartis
Splice
Cloud Foundry
CoreOS
MongoDB
Zerodha
Chango
SendGrid
Plug.dj

THANK YOU..!!!

You might also like