
Programming Crystal
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
Crystal is for Ruby programmers who want more performance, or for developers who enjoy working in a high-level scripting environment. Crystal combines native execution speed and concurrency with Ruby-like syntax, so you will feel right at home. This book, the first available on Crystal, shows you how to write applications that have the beauty and elegance of a modern language, combined with the power of types and modern concurrency tooling. Now you can write beautiful code that runs faster, scales better, and is a breeze to deploy.
Crystal is elegant to read and easy to program like Ruby, allowing full object-oriented development. Its compiler is powerful enough to nearly always infer the type of your variables. So you get the benefits of a statically typed language: more robust code, safety and execution speed, while still reaching high productivity in development. Null pointer exceptions as in JavaScript, Java or C#, are a thing of the past: Crystal annihilates them, just like Rust.
Explore the building blocks and design of the language, and how you can use the Crystal tool-chain to build and manage powerful applications. Harness the power of the macro system, as well as how to work with fibers and channels, making concurrency as easy as possible. Learn how to use the Kemal web framework and access databases, and how to tap the potential of existing Crystal libraries. Find the spot that Crystal fills in today's software world with real-world examples.
With Crystal, you can combine the best of both worlds: the high-level coding of dynamic languages, and the safety and blazing performance of a natively compiled language.
What You Need:
To develop in Crystal, you only need Crystal v 0.26 the latest version, a common text editor and a browser.
More details
Other editions
Additional editions

Person
Ivo Balbaert is a programming teacher and Crystal enthusiast. He has a Ph.D. in Applied Physics and has worked for 25 years in the software industry as a developer and project manager in several companies. Now he combines teaching and consultancy with technical writing. He is particularly interested in elegant emerging languages for concurrency and distributed processing.
Content
- Intro
- Programming Crystal
- About the Pragmatic Bookshelf
- Table of Contents 2: 3: 4: 5: 6: 7: 8: 9:
- Early praise for Programming Crystal
- Preface
- Who This Book Is For
- What's in This Book
- How to Read This Book
- Conventions Used in This Book
- Web Resources and Feedback
- Downloading Sample Code
- Acknowledgments
- Pa rt 1 Getting Started
- Chapter 1: Diving into Crystal
- A Programming Language for Humans and Computers
- Slick As Ruby, But Way Faster
- Almost As Fast As C
- Speeding Up the Web
- Talking to Databases
- More Safety Through Types
- No to the Billion-Dollar Mistake
- Batteries Included
- Putting Crystal to Good Use
- A Company's Story Crystallized: Red Panthers
- Wrapping Up
- Chapter 2: Crystal Foundations
- Using Basic Variables and Types
- Variable Operations
- Structuring Data with Container Types
- Controlling the Flow
- Using Methods
- Organizing Code in Classes and Modules
- Executing Code Concurrently Through Fibers
- A Company's Story Crystallized: Dev Demand
- Wrapping Up
- Part 2: Building Blocks
- Chapter 3: Typing Variables and Controlling the Flow
- Converting Data Between Types
- Getting Input
- Putting It Together-Converting Currencies 1
- Exception Handling for Faulty Input
- Chaining Methods
- Getting Input from Command-Line Arguments
- Using String Methods
- Using Symbols as Identifiers
- Using Enums
- Using Regular Expressions
- Putting It Together-Converting Currencies 2
- Beyond Hashes and Arrays: More Composite Types
- Nilable Types
- Controlling the Flow and Types
- A Company's Story Crystallized: Linkfeed
- Wrapping Up
- Chapter 4: Organizing Code in Methods and Procs
- Passing Arguments
- Returning Values
- Working with Yield, Procs, and Blocks
- Overloading and Multiple Dispatch
- Using a Shorter Syntax for Exception Handling
- Using Recursive Methods
- A Company's Story Crystallized: Duo Design
- Wrapping Up
- Chapter 5: Using Classes and Structs
- Converting a Ruby Class to Crystal
- Structuring a Class
- Applying Inheritance
- Controlling Visibility
- Working with Structs
- Viewing the Type Hierarchy
- Some Nice Tricks
- A Company's Story Crystallized: LI-COR Biosci ences
- Wrapping Up
- Chapter 6: Working with Modules
- Combining Files with Require
- Using Modules as Namespaces
- Letting Modules Extend Themselves
- Mixing in Modules
- How the Compiler Finds Methods
- Applying Built-In Modules
- A Company's Story Crystallized: Diploid
- Wrapping Up
- Chapter 7: Managing Projects
- Creating a Shard
- Formatting Code
- Documenting a Project
- Writing Tests with Spec
- Using External Libraries
- Benchmarking Your Code
- Deploying a Crystal App
- A Company's Story Crystallized: Diploid-Part 2:
- Wrapping Up
- Part 3: Advanced Crystal
- Chapter 8: Advanced Features
- DRY Your Code with Macros
- Low-Level Programming and C Bindings
- Creating Concurrent Code
- Accessing Databases
- A Company's Story Crystallized: NeuraLegion
- Wrapping Up
- Chapter 9: Using Web Frameworks and Shards
- Build Web Applications with the Kemal and Amber Frameworks
- A Brief Tour of the Shard Ecosystem
- A Company's Story Crystallized: Kemal in Prod uction
- Wrapping Up and Afterword
- Part 4: Appendices
- Appendix 1: Setting Up a Crystal Environment
- Working with Crystal Online
- Installing Crystal on Your Machine
- Compiling Code
- Using Editors and IDEs
- Working with Crystal Playground
- Using Crystal Documentation
- Wrapping Up
- Appendix 2: Porting Ruby Code to Crystal
- Ruby Extensions in Crystal
- Appendix 3: Your Turn Answers
- 2:
- 3: he Flow
- 4: cs
- 5:
- 6:
- 7:
- 8:
- 9: stem
- Appendix 1:: Setting Up a Crystal Environment
- You May Be Interested In.
System requirements
File format: ePUB
Copy protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (not Kindle).
The file format ePub works well for novels and non-fiction books – i.e., „flowing” text without complex layout. On an e-reader or smartphone, line and page breaks automatically adjust to fit the small displays.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our ebook Help page.