Getting Started with V Programming
eBook - ePub

Getting Started with V Programming

Navule Pavan Kumar Rao

Compartir libro
  1. 408 páginas
  2. English
  3. ePUB (apto para móviles)
  4. Disponible en iOS y Android
eBook - ePub

Getting Started with V Programming

Navule Pavan Kumar Rao

Detalles del libro
Vista previa del libro
Índice
Citas

Información del 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.

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es Getting Started with V Programming un PDF/ePUB en línea?
Sí, puedes acceder a Getting Started with V Programming de Navule Pavan Kumar Rao en formato PDF o ePUB, así como a otros libros populares de Ciencia de la computación y Programación en C. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Año
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...

Índice