Crystal Programming: A Project-based introduction to building efficient, safe, and reliable web and CLI applications /
Кристалльное программирование: Основанное на проектах введение в построение эффективных, безопасных и надёжных веб-приложений и приложений с интерфейсом командной строки
Год издания: 2022
Авторы: Dietrich George , Bernal Guilherme / Дитрих Джордж, Бернал Гильерме
Издательство: Packt
ISBN: 978-1-80181-867-4
Язык: Английский
Формат: PDF / EPUB
Качество: Издательский макет или текст (eBook)
Интерактивное оглавление: Да
Количество страниц: 335
Кристалл — это язык с Руби-подобным синтаксисом, но, в отличие от Руби, Кристалл — статически типизированный компилируемый язык.
Описание: Crystal is a programming language with a concise and user-friendly syntax, along with a seamless system and a performant core, reaching C-like speed. This book will help you gain a deep understanding of the fundamental concepts of Crystal and show you how to apply them to create various types of applications. This book comes packed with step-by-step explanations of essential concepts and practical examples. You'll learn how to use Crystal’s features to create complex and organized projects relying on OOP and its most common design patterns. As you progress, you'll gain a solid understanding of both the basic and advanced features of Crystal. This will enable you to build any application, including command-line interface (CLI) programs and web applications using IOs, concurrency and C bindings, HTTP servers, and the JSON API. By the end of this programming book, you’ll be equipped with the skills you need to use Crystal programming for building and understanding any application you come across.
Перевод описания: Кристалл — это язык программирования с лаконичным и удобным синтаксисом, а также бесшовной системой и производительным ядром, достигающим скорости языка Си. Эта книга поможет вам глубоко понять основные концепции Кристалла и покажет, как применять их для создания различных типов приложений. Эта книга содержит пошаговые объяснения основных концепций и практические примеры. Вы узнаете, как использовать возможности Кристалла для создания сложных и организованных проектов, основанных на ООП и его наиболее распространенных шаблонах проектирования. По мере продвижения вы получите прочное понимание как основных, так и расширенных возможностей Кристалла. Это позволит вам создавать любые приложения, включая программы с интерфейсом командной строки (CLI) и веб-приложения с использованием ввода-вывода, параллелизма и привязок Си, HTTP-серверов и JSON API. К концу этой книги по программированию вы будете вооружены навыками, необходимыми для программирования на языке Кристалл, создания и понимания любого приложения, с которым вы столкнетесь.
Оглавление
Part 1: Getting Started
Chapter 1: An Introduction to Crystal
Technical requirements
A bit of history
Exploring Crystal's expressiveness
Crystal programs are also FAST
Setting up the environment
Creating our first program
Summary
Chapter 2: Basic Semantics and Features of Crystal
Technical requirements
Values and expressions
Controlling the execution flow with conditionals
Exploring the type system
Organizing your code in methods
Data containers
Organizing your code in files
Summary
Further reading
Chapter 3: Object-Oriented Programming
Technical requirements
The concept of objects and classes
Creating your own classes
Working with modules
Values and references – using structs
Generic classes
Exceptions
Summary
Part 2: Learning by Doing – CLI
Chapter 4: Exploring Crystal via Writing a Command-Line Interface
Technical requirements
Project introduction
Scaffolding the project
Writing the basic implementation
Summary
Chapter 5: Input/Output Operations
Technical requirements
Supporting terminal input/output
Supporting other IO
Performance testing
Explaining IO behavior
Summary
Chapter 6: Concurrency
Technical requirements
Using fibers to complete work concurrently
Using channels to communicate data safely
Transforming multiple files concurrently
Summary
Chapter 7: C Interoperability
Technical requirements
Introducing C bindings
Binding libnotify
Integrating the bindings
Summary
Part 3: Learn by Doing – Web Application
Chapter 8: Using External Libraries
Technical requirements
Using Crystal Shards
Finding Shards
Summary
Chapter 9: Creating a Web Application with Athena
Technical requirements
Understanding Athena's architecture
Getting started with Athena
Implementing database interactions
Leveraging content negotiation
Summary
Further reading
Part 4: Metaprogramming
Chapter 10: Working with Macros
Technical requirements
Defining macros
Understanding the macro API
Exploring macro hooks
Summary
Chapter 11: Introducing Annotations
Technical requirements
What are annotations?
Storing data within annotations
Reading annotations
Summary
Chapter 12: Leveraging Compile-Time Type Introspection
Technical requirements
Iterating type variables
Iterating types
Iterating methods
Summary
Further reading
Chapter 13: Advanced Macro Usages
Technical requirements
Using annotations to influence runtime logic
Exposing compile-time data at runtime
Determining a constant's value at compile time
Creating custom compile-time errors
Summary
Part 5: Supporting Tools
Chapter 14: Testing
Technical requirements
Why test?
Unit testing
Integration testing
Summary
Chapter 15: Documenting Code
Technical requirements
Documenting Crystal code
Documentation directives
Generating the documentation
Summary
Chapter 16: Deploying Code
Technical requirements
Versioning your shard
Creating production binaries
Distributing your binary
Summary
Further reading
Chapter 17: Automation
Technical requirements
Formatting code
Linting code
Continuous integration with GitHub Actions
Summary
Other Books You May Enjoy