Tag Archive

Below you'll find a list of all posts that have been tagged as "programming language"
blogImage

How Go can be your “Go-to” language

“Go”, or “Golang”(as it is sometimes referred to), is an open source project developed by Google, to make programmers more productive. In order to understand why it is such an important language today and what promise it holds for the future, we need to understand the reasons that let to its development.The Hardware ScenarioIn the past few decades, there has not been any significant improvement in the CPU processing power. To put things into perspective, Intel launched a Pentium 4 model with a clock speed of 3.06 GHz in November 2002, while the processors commonly used today (after 15 long years), still have a clock speed of around 2.9-3.6 GHz.In order to meet the demand for more power, manufacturers started increasing the number of cores, since this makes it possible to increase the processing power without increasing the clock speed. Today, we see quadra(4), octa(8) core processors and the like. However, there are limitations to this approach as well.Limitations of Multi-core ProcessorsHardware limitations – When more cores are added, the transistor density increases. This, in turn, increases power consumption and heating of the cores. To reduce power dissipation, cores have to run at relatively lower frequency than single-core processors.To reduce the power heat in hot-cores, voltage and frequency is reduced. This further lowers down the performance.Further, cores can only be scaled to a certain limit.Cost – Increasing the number of cores increases the cost substantially. After a certain limit, it is not economically feasible for manufacturers.The present-day hardware is not able to cope-up with the increasing demands for higher processing performance. So, the only way out is to create optimized and efficient software.Expectations from programming languages and softwareLanguage should permit efficient code to be written.Software should be written with a deep understanding of the underlying processors.Such programming languages should be preferred, which make it easy to write and manage concurrency and parallelism.Software should be scalable. That is, it should fully utilize the processing power of the hardware, when more cores are added.Language should be compiled, not interpreted (to reduce execution time).Limitations of many programming languagesMany of the programming languages available today support multi-threading. However, it is not easy to write multi-threaded programs using them. Further, the amount of resources consumed by multi-threaded programs is a matter of great concern.As an example, creating new threads in Java is not memory efficient. Each thread consumes approximately 1Mb space on the memory heap. When multiple threads are created, it puts immense pressure on memory resources, sometimes resulting in abrupt termination due to low memory.C++, another popular programming language, also lacks proper concurrency support at the language level.Another popular language, Node.js is “single-threaded”. It cannot directly use multi-core CPUs.How does Go helpAs developers, we need to start to thinking more about optimization as well as best-coding and best-development practices. Go is the programming language more suited for this kind of development. Go was released in 2009 with the aim of addressing all these concerns that are present in several popular languages today. This language was created, with concurrency as the major goal. Fig. 1 The Go LanguageMajor Features of GoMinimal Memory ConsumptionGo has its own abstraction over “threads”, called “goroutines”. Creation of a goroutine takes just 2Kb of heap memory. Each goroutine is automatically and efficiently managed (tasks like adding/removing goroutines are handled efficiently)The Go runtime ensures that any one goroutine isn’t blocking the others. The code is written in a synchronous style while being fully non-blocking. There is no need for callbacks.Reduced Setup and Teardown CostsThreads have significant setup and teardown costs because it has to request resources from the OS and return it once it is done. The workaround to this problem is to maintain a pool of threads. In contrast, goroutines are created and destroyed by the runtime and those operations are pretty cost-effective.Low Switching CostsWhen a thread blocks, another has to be scheduled in its place. Threads are scheduled preemptively, and during a thread switch, the scheduler needs to save/restore all registers, that is, 16 general purpose registers, PC (Program Counter), SP (Stack Pointer), segment registers, 16 XMM registers, FP coprocessor state, 16 AVX registers, all MSRs etc. This is quite significant when there is rapid switching between threads.In contrast, goroutines are scheduled cooperatively and when a switch occurs, only 3 registers need to be saved/restored – Program Counter, Stack Pointer and DX. The cost is much lower.Synchronization and Messaging FeatureGo language has a concept of “channels”. Synchronization between goroutines takes place through channel communication.Multi-way Concurrent ControlGo supports multi-way concurrent control through “Select”.Easily Manageable CodeGo has a syntax that resembles C. It is easy to learn and understand.It is easy to create thousands of goroutines in one program.Open SourceThis means that its source code can be customised efficiently to fit our needs and requirements. Further, Open source programming languages are subject to peer review constantly, so the bugs present in the program code can be easily found and fixed. Users from different programming backgrounds and countries can collaborate and work together.There are thousands of additional applications and libraries at awesome-go. Some of the most popular ones being Moby (formerly Docker),Kubernetes, Hugo, and Prometheus.A Sample Go ProgramThe following simple program demonstrates Go’s concurrency features.It launches two “goroutines”: one waits for the user to type some text, while the other implements a timeout. The ”select” statement waits for either of these goroutines to send a message to the main routine, and acts on the first message to arrive.Fig. 2 A sample program in GoFastest Growing LanguageNo wonder that Go has been embraced by approximately 1 million users worldwide.Today, it is the 9th most popular language.It is the fastest growing language on GitHub.It is being termed as the language of Cloud infrastructure. Every single cloud company has critical components of their cloud infrastructure implemented in Go including Google Cloud, AWS, Microsoft Azure, Digital Ocean, Heroku and many others.As per the TIOBE Index, Go was 2016’s programming language of the year. Every year, this award goes to ” the programming language that has gained the most popularity in a year.” And “without hardly any competition Go has won the award for 2016,” TIOBE writes.Go is good especially for stand-alone command-line apps or scripts, network and web servers.Google Trends chart highlights the popularity of Go, over the years.Fig. 3 Popularity of Go. Here, numbers represent search interest relative to the highest point on the chart for the given region and time. A value of 100 is the peak popularity for the term.ConclusionHardware isn’t getting significantly faster, anytime soon. However, there is an ever-increasing demand for better software performance. In such a scenario, a language like Go can definitely help. However, that’s not enough. Developers like us need to understand more about the hardware, in order to be able to exploit the full range of multi-core architecture of the CPU. Writing optimized code using a language like Go will make it possible to run software smoothly even on cheaper and slower hardware. This means, for instance, less expensive cloud servers. This, in turn, means higher profits for corporations and overall cost reduction for the end-user. Needless to say, when the hardware is upgraded, the software will run at a blazing speed!References and Suggested Readinghttps://en.wikipedia.org/wiki/Comparison_of_Intel_processorshttps://blog.nindalf.com/posts/how-goroutines-work/https://talks.golang.org/2012/splash.articlehttps://www.tiobe.com/tiobe-index/https://github.com/avelino/awesome-go

Aziro Marketing

EXPLORE ALL TAGS
2019 dockercon
Advanced analytics
Agentic AI
agile
AI
AI ML
AIOps
Amazon Aws
Amazon EC2
Analytics
Analytics tools
AndroidThings
Anomaly Detection
Anomaly monitor
Ansible Test Automation
apache
apache8
Apache Spark RDD
app containerization
application containerization
applications
Application Security
application testing
artificial intelligence
asynchronous replication
automate
automation
automation testing
Autonomous Storage
AWS Lambda
Aziro
Aziro Technologies
big data
Big Data Analytics
big data pipeline
Big Data QA
Big Data Tester
Big Data Testing
bitcoin
blockchain
blog
bluetooth
buildroot
business intelligence
busybox
chef
ci/cd
CI/CD security
cloud
Cloud Analytics
cloud computing
Cloud Cost Optimization
cloud devops
Cloud Infrastructure
Cloud Interoperability
Cloud Native Solution
Cloud Security
cloudstack
cloud storage
Cloud Storage Data
Cloud Storage Security
Codeless Automation
Cognitive analytics
Configuration Management
connected homes
container
Containers
container world 2019
container world conference
continuous-delivery
continuous deployment
continuous integration
Coronavirus
Covid-19
cryptocurrency
cyber security
data-analytics
data backup and recovery
datacenter
data protection
data replication
data-security
data-storage
deep learning
demo
Descriptive analytics
Descriptive analytics tools
development
devops
devops agile
devops automation
DEVOPS CERTIFICATION
devops monitoring
DevOps QA
DevOps Security
DevOps testing
DevSecOps
Digital Transformation
disaster recovery
DMA
docker
dockercon
dockercon 2019
dockercon 2019 san francisco
dockercon usa 2019
docker swarm
DRaaS
edge computing
Embedded AI
embedded-systems
end-to-end-test-automation
FaaS
finance
fintech
FIrebase
flash memory
flash memory summit
FMS2017
GDPR faqs
Glass-Box AI
golang
GraphQL
graphql vs rest
gui testing
habitat
hadoop
hardware-providers
healthcare
Heartfullness
High Performance Computing
Holistic Life
HPC
Hybrid-Cloud
hyper-converged
hyper-v
IaaS
IaaS Security
icinga
icinga for monitoring
Image Recognition 2024
infographic
InSpec
internet-of-things
investing
iot
iot application
iot testing
java 8 streams
javascript
jenkins
KubeCon
kubernetes
kubernetesday
kubernetesday bangalore
libstorage
linux
litecoin
log analytics
Log mining
Low-Code
Low-Code No-Code Platforms
Loyalty
machine-learning
Meditation
Microservices
migration
Mindfulness
ML
mobile-application-testing
mobile-automation-testing
monitoring tools
Mutli-Cloud
network
network file storage
new features
NFS
NVMe
NVMEof
NVMes
Online Education
opensource
openstack
opscode-2
OSS
others
Paas
PDLC
Positivty
predictive analytics
Predictive analytics tools
prescriptive analysis
private-cloud
product sustenance
programming language
public cloud
qa
qa automation
quality-assurance
Rapid Application Development
raspberry pi
RDMA
real time analytics
realtime analytics platforms
Real-time data analytics
Recovery
Recovery as a service
recovery as service
rsa
rsa 2019
rsa 2019 san francisco
rsac 2018
rsa conference
rsa conference 2019
rsa usa 2019
SaaS Security
san francisco
SDC India 2019
SDDC
security
Security Monitoring
Selenium Test Automation
selenium testng
serverless
Serverless Computing
Site Reliability Engineering
smart homes
smart mirror
SNIA
snia india 2019
SNIA SDC 2019
SNIA SDC INDIA
SNIA SDC USA
software
software defined storage
software-testing
software testing trends
software testing trends 2019
SRE
STaaS
storage
storage events
storage replication
Storage Trends 2018
storage virtualization
support
Synchronous Replication
technology
tech support
test-automation
Testing
testing automation tools
thought leadership articles
trends
tutorials
ui automation testing
ui testing
ui testing automation
vCenter Operations Manager
vCOPS
virtualization
VMware
vmworld
VMworld 2019
vmworld 2019 san francisco
VMworld 2019 US
vROM
Web Automation Testing
web test automation
WFH

LET'S ENGINEER

Your Next Product Breakthrough

Book a Free 30-minute Meeting with our technology experts.

Aziro has been a true engineering partner in our digital transformation journey. Their AI-native approach and deep technical expertise helped us modernize our infrastructure and accelerate product delivery without compromising quality. The collaboration has been seamless, efficient, and outcome-driven.

Customer Placeholder
CTO

Fortune 500 company