$ ./bin/crystal --version
Using compiled compiler at .build/crystal
Crystal 1.8.0-dev [58fb584cb87] (2023-01-21)
LLVM: 14.0.1
Default target: aarch64-apple-darwin21.6.0
$ ./bin/crystal --version
Using compiled compiler at .build/crystal
Crystal 1.8.0-dev [58fb584cb87] (2023-01-21)
LLVM: 14.0.1
Default target: aarch64-apple-darwin21.6.0
These configuration will let you use CodeLLDB extension to debug Crystal programs.
Store them as .vscode/tasks.json and .vscode/launch.json in your project.
When starting the debugging the current file will be built in the bin/ folder (as in shards build).
Note: You will need to set the crystal binary path in tasks.json "command" field and the whole path in launch.json "initCommands". Read more at #8538
| FROM ruby:2.2 | |
| RUN \ | |
| # node | |
| curl -sL https://deb.nodesource.com/setup_5.x | bash - && \ | |
| apt-get install -y nodejs && \ | |
| # cleanup | |
| apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* |
| # The lock is at the end of the unions | |
| # | |
| # CHECK: %"(Bool | Int32)" = type { i32, [1 x i64], i32 } | |
| local_var = uninitialized Int32 | Bool | |
| # After the alloca the lock is initialized as free (1) | |
| # | |
| # CHECK: %local_var = alloca %"(Bool | Int32)" | |
| # CHECK: %0 = getelementptr inbounds %"(Bool | Int32)", %"(Bool | Int32)"* %local_var, i32 0, i32 2 |
| # The lock is at the end of the unions | |
| # | |
| # CHECK: %"(Bool | Int32)" = type { i32, [1 x i64], i32 } | |
| local_var = uninitialized Int32 | Bool | |
| # After the alloca the lock is initialized as free (1) | |
| # | |
| # CHECK: %local_var = alloca %"(Bool | Int32)" | |
| # CHECK: %0 = getelementptr inbounds %"(Bool | Int32)", %"(Bool | Int32)"* %local_var, i32 0, i32 2 |
| # $ crystal run -Dpreview_mt synchronized.cr | |
| struct Synchronized(T) | |
| @lock = Mutex.new | |
| getter inner : T | |
| def initialize(@inner : T) | |
| end |
Try it on https://www.jsonschemavalidator.net/
| # A Logger allow sending logging information to a stream. | |
| # Each logger instance is built and binded to a specific | |
| # context that is sent on each entry. | |
| # | |
| # When requesting a logger via `Logger#get` a context needs to be | |
| # specified. Context are meant to be dot seperated path as: | |
| # `"http.client"`. Class names and modules are translated into that format. | |
| # | |
| # ``` | |
| # class HTTP::Client |
| # A Logger allow sending logging information to a stream. | |
| # Each logger instance is built and binded to a specific | |
| # context that is sent on each entry. | |
| # | |
| # When requesting a logger via `Logger#get` a context needs to be | |
| # specified. Context are meant to be dot seperated path as: | |
| # `"http.client"`. Class names and modules are translated into that format. | |
| # | |
| # ``` | |
| # class HTTP::Client |