Getting Started with V Programming
eBook - ePub

Getting Started with V Programming

Navule Pavan Kumar Rao

Condividi libro
  1. 408 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
eBook - ePub

Getting Started with V Programming

Navule Pavan Kumar Rao

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Informazioni sul libro

Learn a new statically compiled programming language to build maintainable and fast software with the help of this comprehensive guide to V programmingKey Features• Explore the features of the V programming language step by step with this beginner's guide• Gain strong foundational knowledge of core programming concepts such as modules, functions, and structs• Learn how to write super-fast programs and applications that compile in a matter of secondsBook DescriptionA new language on the block, V comes with a promising set of features such as fast compilation and interoperability with other programming languages. This is the first book on the V programming language, packed with concise information and a walkthrough of all the features you need to know to get started with the language. The book begins by covering the fundamentals to help you learn about the basic features of V and the suite of built-in libraries available within the V ecosystem. You'll become familiar with primitive data types, declaring variables, arrays, and maps. In addition to basic programming, you'll develop a solid understanding of the building blocks of programming, including functions, structs, and modules in the V programming language. As you advance through the chapters, you'll learn how to implement concurrency in V Programming, and finally learn how to write test cases for functions. This book takes you through an end-to-end project that will guide you to build fast and maintainable RESTful microservices by leveraging the power of V and its built-in libraries. By the end of this V programming book, you'll be well-versed with the V programming language and be able to start writing your own programs and applications.What you will learn• Become familiar with the basic building blocks of programming in the V language• Install the V language on various operating systems• Understand how to work with arrays and maps in V programming• Discover how to implement concurrency in V programming• Use channels in V programming to learn the best practices of sharing memory by communicating among coroutines• Write modular code and build on your knowledge of structs and functions in V• Get acquainted with writing tests in V programming• Get to grips with building and querying RESTful microservice in VWho this book is forWhether you're a beginner interested in learning a programming language or an experienced programmer looking to switch to a new and better statically compiled programming language, this V programming book is for you.

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
Getting Started with V Programming è disponibile online in formato PDF/ePub?
Sì, puoi accedere a Getting Started with V Programming di Navule Pavan Kumar Rao in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Ciencia de la computación e Programación en C. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Anno
2021
ISBN
9781839212178

Section 1: Introduction to the V Programming Language

This section provides a detailed introduction to the V programming language. You will also gain an understanding of various features of V and the suite of modules and libraries available within the V ecosystem.
This section also introduces you to approaches to install the V programming language on the various operating systems, which will help readers get started with hands-on examples that will be covered in this book.
This section has the following chapters:
  • Chapter 1, Introduction to V Programming
  • Chapter 2, Installing V Programming

Chapter 1: Introduction to V Programming

The V programming language is a statically typed compiled programming language that's used to build maintainable and robust software applications. It comes with high performance and simplicity, which allows software programmers to do rapid prototyping of applications at scale. You can write simple and clean code with minimal abstraction using V. V comes with performance as fast as C. V is not derived from any other programming language and is written in V itself and compiles itself in under 1 second.
The design of V has been influenced by programming languages such as Go, Rust, Oberon, Swift, Kotlin, and Python. The V language has similar syntax compared to the popular Go programming language. It is a simple, fast, safe, and compiled programming language. V offers all safety features by default, such as immutable variables, immutable structs, and pure functions. V offers great support for concurrency that is on par with Go programming.
In this chapter, we will cover the following topics:
  • The past, present, and future of V
  • V is a statically typed and compiled programming language
  • Simple and maintainable syntax
  • Backward compatibility, stability, and easy to upgrade to future versions
  • Features of V programming
  • V as a framework
  • Operating systems V supports
By the end of this chapter, you will have learned about the V language and its features. You will also understand Vinix, an operating system (OS) written completely in V.
Let's begin our journey by understanding how V came into existence, who created it, and what its future is.

The past, present, and future of V

V is a new programming language created in early 2019 by Alexander Medvednikov. The creator has come up with an extensive vision for the V language and the features it offers. Therefore, the V language and its various features are undergoing heavy development. The official website is https://vlang.io/. The V programming language is open sourced and licensed under MIT. You can refer to the entire source code of V on its official GitHub repository at https://github.com/vlang/v.
V has an active community of developers and contributors. The community is highly active and responsive to issues raised on GitHub. You can participate in discussions at https://github.com/vlang/v/discussions and the team is also available on Discord: https://discord.gg/vlang.
V comes with a lot of performance optimizations that are on par with C compared to any other programming language, such as Go, Java, or Python to mention a few..
From version 0.3, V is expected to have the ability to translate C code to human readable V code. Also, you will be able to generate V wrappers on the top of C libraries.

V is a statically typed and compiled programming language

A programming language is designed to have certain typing and execution phenomena. Typing could refer to either statically typed or dynamically typed, while the execution phenomena could be referred to as compiled or interpreted. Let's look at these terms in more detail.

Statically typed versus dynamically typed

A programming language is referred to as statically typed when the type checking of the variables happens during compile time instead of runtime.
In a dynamically typed programming language, the types are determined during runtime based on the values assigned to the variables. The advantage of dynamically typed programming languages is that the programmers do not have to explicitly mention the type of variables while they code. This capability eases and speeds up development times.

Compiled versus interpreted languages

A programming language is said to be compiled when the code is directly translated into machine code or byte code. This phenomenon makes the resulting program run significantly faster in contrast to interpreted languages. V compiles ~1 million lines of code (LOCs) per CPU per second.
On the other hand, the term interpreted refers to programming languages where the interpreter runs the program by executing the commands line by line. And this phenomenon makes interpreted languages significantly slower than compiled languages.
The V programming language is a statically typed compiled programming language. So, the type checking in V happens during compile time itself. Also, when you build a V program, it generates an executable file as output that contains all the instructions written in the program translated into machine code.

Simple and maintainable syntax

As we've already learned, V is inspired by the Go programming language, and its design has also been influenced by Oberon, Rust, Swift, Kotlin, and Python. V comes with the simplest form of coding style when it comes to syntax and semantics. If you are a Go programmer, writing a program in V gives you an adrenaline rush because of the simplicity of the syntax. The syntactic simplicity offered by V lets beginners of this programming language learn quickly and understand the basics instead of trying to learn about the semantics.
V takes a similar or even fewer number of LOCs to mimic functionality written in Go. It has only one standard format for writing code, and this is managed by vfmt, a built-in library that helps format the code. vfmt strictly formats your code according to a globally unique coding standard across all V projects.
All it...

Indice dei contenuti