Fast as C, slick as Ruby
Exploring & Learning Crystal Language with code examples and augment the documentation.
1. Installation
2. Crystal CLI
-
Useful commands when using crystal
-
My most useful command while developing is:
crystal run src/file_name.cr
3. Blocks
4. Macros (Sort-of Meta-Code)
5. Data Structures
6. Code Patterns
6.1. Decorator
6.2. Value Object
6.3. East Oriented (Fluent Interface)
6.4. HTTP (Server and Client)
Non-stateful - short-term connections over TCP.
6.4.1. Basic Web Client
6.4.2. Basic Web Server
6.4.3. Processing Web Requests
6.5. HTTP (Server and Client)
Encrypted HTTP Interactions
6.5.1. Web Client (HTTPS)
6.5.2. Secure Web Server (HTTPS)
6.6. WebSockets (Server and Client)
Long-lived client-server connections over TCP.
6.6.1. WebSockets
6.6.2. WebSockets with SSL
6.6.3. WebSockets with Named Channels
7. Concurrency & Parallelism
An intro into the basics of how things like websockets work
7.1. Concurrency Basics
-
Basics on starting processes concurrently
7.2. Concurrent Objects
-
Examples of using concurrency with objects
7.3. Channels (Async Messaging)
-
Channels allow us to safely communicate between concurrent processes.
-
To safely share data/state send immutable data only (Structs are a good option).
7.4. Channel Buffers
-
What to do when messages come faster than collected
7.5. Channel Callbacks
-
Safely share state information when its available
7.6. Crystal Promises
7.7. Crystal Priority Queues
7.8. Parallelism
-
Compiling to use multiple CPUs (add
-Dpreview_mt
) to the compile command
7.9. Actor Model
-
Using macros to build async message sending, callbacks and state sharing.
8. Making Shards
9. Mini-Projects
9.1. Game of Life
9.2. Chat Room
10. Resources
-
Crystal Git Repo - https://github.com/crystal-lang/crystal/
-
Crystal Lang GitBook - https://crystal-lang.org/reference/guides
-
Crystal Lang API Docs - https://crystal-lang.org/api/0.32.1/index.html
-
Crystal Lang Gitter - https://gitter.im/crystal-lang/crystal
-
Exercism: https://exercism.io/my/tracks/crystal
Note
|
Crystal Lang Gitter is a great group of people willing to help. (special mention to: @stnluu_twitter, @watzon, @repomaa, @randiaz95, @straight-shoota & @paulcsmith) |
11. Generating these Docs
$ asciidoctor -D docs/crystal code/crystal/adoc/*