lxol / handsonscala

Discussion and and code examples for the book Hands-on Scala Programming

Home Page:https://www.handsonscala.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hands-on Scala Programming

This repository is the online hub for the book Hands-on Scala Programming:

Executable Code Examples

The executable code examples from Hands-on Scala are freely available online, and open source under an MIT license. These examples are meant to be useful to anyone who is interested in learning Scala, whether or not they are working through Hands-on Scala Programming, though following along with the book will give you the best experience and help you get the most out of them.

Each example is:

  • Self-contained: to be run either using the Ammonite script runner or Mill build tool, with no other setup

  • Tested: with simple test suites provided and instructions on how to run each example in that folder's readme.md file

  • Executable: you can download the folder and run the example yourself to see it in action

Many of the examples are related, with only small code changes between them to illustrate a new feature or technique. The readme.md file of such downstream examples will show a diff from the upstream example that it was based upon, so you can focus your attention on the important code changes that are happening, with a link back up to the upstream example.

The executable code examples below are organized by each part and each chapter of the book.

Part I Introduction to Scala

Chapter 1: Hands-on Scala

Chapter 2: Setting Up

Chapter 3: Basic Scala

Chapter 4: Scala Collections

Chapter 5: Notable Scala Features

Part II Local Development

Chapter 6: Implementing Algorithms in Scala

Chapter 7: Files and Subprocesses

Chapter 8: JSON and Binary Data Serialization

Chapter 9: Self-Contained Scala Scripts

  • 9.1 - Printing: Listing blog-post-like files in a folder and printing them out
  • 9.2 - Index: Rendering an index.html for our static blog using Scalatags
  • 9.3 - Markdown: Rendering individual blog posts using Atlassian's Commonmark-Java library
  • 9.4 - Links: Adding links between our index.html and the individual blog posts
  • 9.5 - Bootstrap: Prettifying our static blog using the Bootstrap CSS framework
  • 9.6 - Deploy: Optionally deploying our static blog to a Git repository
  • 9.7 - DeployTimestamp: Displaying the .md file last-modified time on each blog post

Chapter 10: Static Build Pipelines

  • 10.1 - Simple: Simple linear build pipeline
  • 10.2 - Nonlinear: Simple non-linear build pipeline with two branches
  • 10.3 - Modules: Simple non-linear build pipeline, replicated in several modules
  • 10.4 - NestedModules: Nested modules in a Mill build pipeline
  • 10.5 - CrossModules: Using cross-modules to dynamically construct a build graph based on the filesystem
  • 10.6 - Blog: Our static blog generator, converted into an incremental Mill build pipeline
  • 10.7 - ExtendedBlog: Adding previews and bundled Bootstrap CSS to our static blog build pipeline
  • 10.8 - Push: Re-adding the ability to deploy our static blog by defining a T.command

Part III Web Services

Chapter 11: Scraping Websites

  • 11.1 - ScrapingWiki: Scraping headlines off the Wikipedia front page using Jsoup
  • 11.2 - ScrapingDocs: Scraping semi-structured content off of the Mozilla Development Network Web API docs
  • 11.3 - ApiStatus: Using Jsoup to scrape the status annotations for every Web API on MDN
  • 11.4 - ExternalLinks: Crawling the pages of a static website to extract every external link on the site

Chapter 12: Working with HTTP APIs

Chapter 13: Fork-Join Parallelism with Futures

Chapter 14: Simple Web and API Servers

Chapter 15: Querying SQL Databases

Part IV Program Design

Chapter 16: Message-based Parallelism with Actors

Chapter 17: Multi-Process Applications

  • 17.1 - Main: Simple two-process batch file synchronizer that could work over a network
  • 17.2 - FileSyncer: Simple two-process batch file synchronizer that could work over a network
  • 17.3 - Pipelined: Pipelined version of our two-process file synchronizer, minimizing the chattiness of the protocol
  • 17.4 - Deletes: Pipelined two-process file synchronizer that supports deletions

Chapter 18: Building a Real-time File Synchronizer

  • 18.1 - Simple: Simple real-time file synchronizer that uses os.watch to react to filesystem changes as they happen
  • 18.2 - Pipelined: Pipelined real-time file synchronizer, allowing RPCs and hashing to take place in parallel
  • 18.3 - InitialFiles: Real-time file synchronizer that supports syncing an initial set of files
  • 18.4 - ForkJoinHashing: Real-time file synchronizer that does hashing of files in parallel
  • 18.5 - Deletes: Real-time file synchronizer supporting deletion of files
  • 18.6 - VirtualFileSystem: Real-time file synchronizer that keeps track of synced files, avoiding RPCs for destination file hashes

Chapter 19: Parsing Structured Text

Chapter 20: Implementing a Programming Language

About

Discussion and and code examples for the book Hands-on Scala Programming

https://www.handsonscala.com/

License:Other


Languages

Language:TSQL 60.7%Language:Scala 27.3%Language:HTML 10.7%Language:Shell 1.1%Language:Jsonnet 0.1%Language:Java 0.0%Language:JavaScript 0.0%