Presentation is loading. Please wait.

Presentation is loading. Please wait.

Go.

Similar presentations


Presentation on theme: "Go."— Presentation transcript:

1 Go

2 Introduction My talk today is about a statically typed programming language - Go. Go features user-friendly concurrency and some special data types, such as slice and interface, that increase program flexibility and performance.

3 Introduction I will begin by introducing Go’s concise syntax, which contains only 25 keywords, then I’ll talk about the usage and structure of the data types that Go provides. I conclude the advantages of Go and how it stands out from other programming languages.

4 Syntax Go’s syntax includes changes from C that aimed to keep code concise and readable. Semicolons that terminate statements are unnecessary. Declaration and initialization operators are combined. Functions are allowed to return multiple values.

5 Slice Type Slice resembles a dynamic array; append() function increases the slice size. The copy() function assigns the reference of the array to another one.

6 Interface Interface is a collection of methods
Data types implementing an interface can use the methods defined in that interface. Empty interface, implemented by every data type, is an interface without any methods. An interface can be implemented by many data types; a data type can implement multiple interfaces.

7 goroutines goroutine, a type of light-weight process, is the primary concurrency construct. A function call prefixed with the “go” keyword starts a function in a new goroutine. Current implementations multiplex a Go process's goroutines onto a smaller set of operating system threads.

8 channels Channel allows two goroutines to communicate while executing concurrently. Syntax <-ch Blocks an executing goroutine until a value comes into the channel ch ch <- x sends the x value to channel ch

9 Conclusion Go’s syntax is relatively more concise and flexible than C.
Go enables programmers to implement concurrency more easily. Go provides different ways to implement OOP concepts such as polymorphism.


Download ppt "Go."

Similar presentations


Ads by Google