- eBook:Modern Systems Programming with Scala Native: Write Lean, High-Performance Code without the JVM
- Author:Richard Whaling
- Edition:1 edition
- Data:February 11, 2020
- Pages:262 pages
- Format:PDF, ePUB
Developers generally build systems on top of the work of those who came before, accumulating layer upon layer of abstraction. Scala Native provides a rare opportunity to remove layers. Without the JVM, Scala Native uses POSIX and ANSI C APIs to build concise, expressive programs that run unusually close to bare metal. Scala Native compiles Scala code down to native machine instructions instead of JVM bytecode. It starts up fast, without the sluggish warm-up phase that's common for just-in-time compilers. Scala Native programs can seamlessly invoke operating system APIs for low-level networking and IO. And Scala Native lets you control pointers, arrays, and other memory layout types for extreme performance.
Write practical, bare-metal code with Scala Native, step by step. Understand the foundations of systems programming, including pointers, arrays, strings, and memory management. Use the UNIX socket API to write network client and server programs without the sort of frameworks higher-level languages rely on. Put all the pieces together to design and implement a modern, asynchronous microservice-style HTTP framework from scratch.
Take advantage of Scala Native's clean, modern syntax to write lean, high-performance code without the JVM.
What You Need:
A modern Windows, Mac OS, or Linux system capable of running Docker. All code examples in the book are designed to run on a portable Docker-based build environment that runs anywhere. If you don't have Docker yet, see the Appendix for instructions on how to get it.
1. The Basics: Input and Output
2. Arrays, Structs, and the Heap
3. Writing a Simple HTTP Client
4. Managing Processes: A Deconstructed Shell
5. Writing a Server the Old-Fashioned Way
Part II. Modern Systems Programming
6. Doing I/O Right, with Event Loops
7. Functions and Futures: Patterns for Distributed Services
8. Streaming with Pipes and Files
9. Durability: An Embedded Key-Value Database with LMDB
10. Services: Encapsulation and Abstraction for Modern Designs