Modern Systems Programming with Scala Native: Write Lean, High-Performance Code without the JVM
Richard Whaling
- 出版商: Pragmatic Bookshelf
- 出版日期: 2020-03-03
- 定價: $1,575
- 售價: 9.5 折 $1,496
- 語言: 英文
- 頁數: 230
- 裝訂: Paperback
- ISBN: 1680506226
- ISBN-13: 9781680506228
-
相關分類:
JVM 語言
立即出貨 (庫存 < 3)
相關主題
商品描述
Access the power of bare-metal systems programming with Scala Native, an ahead-of-time Scala compiler. Without the baggage of legacy frameworks and virtual machines, Scala Native lets you re-imagine how your programs interact with your operating system. Compile Scala code down to native machine instructions; seamlessly invoke operating system APIs for low-level networking and IO; control pointers, arrays, and other memory management techniques for extreme performance; and enjoy instant start-up times. Skip the JVM and improve your code performance by getting close to the metal.
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.
商品描述(中文翻譯)
使用Scala Native,一個提前編譯的Scala編譯器,您可以利用裸機系統編程的威力。Scala Native不需要遺留框架和虛擬機的負擔,讓您重新想像程序與操作系統的互動方式。將Scala代碼編譯成本機機器指令;無縫調用操作系統API進行低級網絡和IO操作;控制指針、數組和其他內存管理技術以實現極致性能;並享受即時啟動時間。跳過JVM,通過接近底層硬件來提高代碼性能。
開發人員通常在前人的基礎上構建系統,累積了一層又一層的抽象。Scala Native提供了一個罕見的機會來去除這些層次。Scala Native不使用JVM,而是使用POSIX和ANSI C API來構建簡潔、表達力強的程序,運行在接近裸機的環境中。Scala Native將Scala代碼編譯成本機機器指令,而不是JVM字節碼。它啟動快速,沒有即時編譯器常見的緩慢啟動階段。Scala Native程序可以無縫調用操作系統API進行低級網絡和IO操作。Scala Native還允許您控制指針、數組和其他內存佈局類型,以實現極致性能。
使用Scala Native逐步編寫實用的裸機代碼。了解系統編程的基礎知識,包括指針、數組、字符串和內存管理。使用UNIX套接字API編寫網絡客戶端和服務器程序,而無需依賴高級語言的框架。將所有組件結合起來,從頭開始設計和實現一個現代的異步微服務風格的HTTP框架。
利用Scala Native的乾淨、現代的語法,無需JVM即可編寫精簡、高性能的代碼。
所需條件:
一台現代的Windows、Mac OS或Linux系統,能夠運行Docker。本書中的所有代碼示例都設計為在可在任何地方運行的可攜式基於Docker的構建環境上運行。如果您尚未安裝Docker,請參閱附錄中的說明以獲取安裝指南。