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
2.1. Structs & Records
2.2. Structs
-
Structs (& Records) are immutable data structures - these are
safe
when used in a concurrent/parallel context.
2.3. Records
-
Structs (& Records) are immutable data structures - these are
safe
when used in a concurrent/parallel context.
3. WebSockets
Making long-lived client-server connections over a TCP.
4. Concurrency & Parallelism
An intro into the basics of how things like websockets work
4.1. Concurrency Basics
-
Basics on starting processes concurrently
4.2. Concurrent Objects
-
Examples of using concurrency with objects
4.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).
4.4. Channel Buffers
-
What to do when messages come faster than collected
4.5. Channel Callbacks
-
Safely share state information when its available
4.6. Crystal Promises
4.7. Parallelism
-
Compiling to use multiple CPUs (add
-Dpreview_mt
) to the compile command
4.8. Actor Model (not done)
-
Using macros to build async message sending, callbacks and state sharing.
5. TO-DOs
-
Add Macros
-
Write Channel Buffering
-
Reseach Promises in Crystal
-
Finish Callbacks & (Notification)
-
Research/Add Crystal Value Objects
-
Build a Macro to make a simple Actor Class
-
Add Parallelism (Ideally with WebSockets example — to extend
chat
) -
Add, review, augment and adapt content using: https://blog.golang.org/pipelines
6. 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
Note
|
Crystal Lang Gitter is a great group of people willing to help. (special mention to: @stnluu_twitter, @watzon, @repomaa, @randiaz95, @straight-shoota & @paulcsmith) |
7. Webpage & Code Repo
Webpage and associated code can be found at: https://github.com/btihen/crystal_explorations
8. Generating these Docs
$ asciidoctor -D docs adoc/*
9. Corrections & Improvements
-
make a pull request with your suggestion(s)
-
or a Github issue
Thanks!