Transcript

SEMINARON

GOLANG-By GOOGLE

Guided By :Submitted By:

Dr. Rajesh Mishra

•Praval kulshreshtha (12/iec/064)•Prem shankar (12/iec/038)•Srishty verma (12/iec/010)•Himanshu choudhary (12/iec/041)SCHOOL OF ICT, GAUTAM BUDDHA UNIVERSITY

• Go, also commonly referred to as golang, is a programming language developed at Google in 2007 by Robert Griesemer, Rob Pike and Ken Thompson.

•  It is a statically typed language 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 the Linux, OS X, Free BSD, Net BSD, Open BSD, Plan 9, Dragon Fly BSD, Solaris, and Windows operating systems and the i386, AMD64, ARM and IBM Power processor architectures. A second compiler, gcc go, is a GCC frontend.

• Android support was added in version 1.4, which has since been ported to also run on iOS.

>> INTRODUCTION

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.

>> PURPOSE 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 was released on 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

>> STATUS OF THE PROJECT

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

>> ANSWERS

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

>> RESEARCH & GO

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 on composition of regular code

>> CONCURRENCY

code run

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

>> CONCURRENCY

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

code run

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

>> POLYMORPHISM

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 gives programmer more control over allocation.

>> GARBAGE COLLECTION

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.

>> PROGRAM TRANSLATION

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.

>> ADVANTAGES V/S DISADVANTAGES

• Syntax so different from C

• Declarations backwards

• No pointer arithmetic

• Braces but no semicolons

• Garbage collection

>> CHANGES FROM C

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

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

>> GO USERS

THANK YOU………..!!!

top related