Crystal 1.11 has been released!

We have a new release: Crystal 1.11.0 is released! - The Crystal Programming Language

While we have tested it against several known and sizeable projects, that doesn’t preclude the existence of regressions. If you find an issue, please check the issue tracker and file a bug: it will be fixed in the following patch version.

The full changelog is available here: Release 1.11.0 · crystal-lang/crystal · GitHub
This is a quite a big release with many new features. Check out the release notes for details.

Builds are available on the supported platforms, check the install page for details. That includes docker images :whale:, snapcraft, .deb and .rpm packages, Windows builds and the brew formula :beer:.

Happy Crystallizing!

15 Likes

Does this update mean faster compile times for Crystal :eyes:?

I thought not really.

Hi, i built 1.11.0 use dynamic from source, it built successful no error, check following screenshot.

But, when i ran crystal i, it failed, please check following backtrace.

backtrace
╰─ $ crystal i
Crystal interpreter 1.11.0 [95d04fab4] (2024-01-08).
EXPERIMENTAL SOFTWARE: if you find a bug, please consider opening an issue in
https://github.com/crystal-lang/crystal/issues/new/
cannot find -lpthread (/usr/lib/libpthread.so: cannot open shared object file: No such file or directory)
Linker arguments: -L/home/zw963/Crystal/bin/../lib/crystal -lpcre2-8 -lpthread -ldl -levent
Search path: /home/zw963/Crystal/bin/../lib/crystal:/usr/lib32:/usr/lib/libfakeroot:/usr/lib/perf:/lib64:/usr/lib64:/lib:/usr/lib (Crystal::Loader::LoadError)
  from src/string.cr:5496:13 in 'loader'
  from src/compiler/crystal/interpreter/context.cr:431:5 in '??'
  from src/compiler/crystal/interpreter/compiler.cr:2004:17 in 'visit'
  from src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from src/compiler/crystal/semantic/bindings.cr:16:7 in 'compile_def'
  from src/compiler/crystal/interpreter/compiler.cr:2100:5 in 'create_compiled_def'
  from src/compiler/crystal/interpreter/compiler.cr:1898:22 in 'visit'
  from src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from src/compiler/crystal/semantic/bindings.cr:16:7 in 'compile_def'
  from src/compiler/crystal/interpreter/compiler.cr:2100:5 in 'create_compiled_def'
  from src/compiler/crystal/interpreter/compiler.cr:1898:22 in 'visit'
  from src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from src/compiler/crystal/interpreter/compiler.cr:3196:5 in 'accept'
  from src/compiler/crystal/interpreter/compiler.cr:3196:5 in 'accept'
  from src/enumerable.cr:510:7 in 'accept'
  from src/compiler/crystal/semantic/bindings.cr:16:7 in 'compile_def'
  from src/compiler/crystal/interpreter/compiler.cr:2100:5 in 'create_compiled_def'
  from src/compiler/crystal/interpreter/compiler.cr:1898:22 in 'visit'
  from src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from src/enumerable.cr:510:7 in 'accept'
  from src/compiler/crystal/semantic/bindings.cr:16:7 in 'compile_def'
  from src/compiler/crystal/interpreter/compiler.cr:2100:5 in 'create_compiled_def'
  from src/compiler/crystal/interpreter/compiler.cr:1898:22 in 'visit'
  from src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from src/compiler/crystal/interpreter/compiler.cr:3196:5 in 'accept'
  from src/compiler/crystal/interpreter/compiler.cr:1293:8 in 'accept'
  from src/enumerable.cr:510:7 in 'accept'
  from src/compiler/crystal/interpreter/compiler.cr:1293:8 in 'accept'
  from src/enumerable.cr:510:7 in 'accept'
  from src/compiler/crystal/semantic/bindings.cr:16:7 in 'compile_def'
  from src/compiler/crystal/interpreter/compiler.cr:2100:5 in 'create_compiled_def'
  from src/compiler/crystal/interpreter/compiler.cr:1898:22 in 'visit'
  from src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from src/enumerable.cr:510:7 in 'accept'
  from src/compiler/crystal/semantic/bindings.cr:16:7 in 'compile_def'
  from src/compiler/crystal/interpreter/compiler.cr:2100:5 in 'create_compiled_def'
  from src/compiler/crystal/interpreter/compiler.cr:1898:22 in 'visit'
  from src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from src/compiler/crystal/interpreter/compiler.cr:3196:5 in 'accept'
  from src/compiler/crystal/interpreter/compiler.cr:3196:5 in 'accept'
  from src/compiler/crystal/semantic/bindings.cr:16:7 in 'compile_def'
  from src/compiler/crystal/interpreter/compiler.cr:2100:5 in 'create_compiled_def'
  from src/compiler/crystal/interpreter/compiler.cr:1898:22 in 'visit'
  from src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from src/compiler/crystal/semantic/bindings.cr:16:7 in 'compile_def'
  from src/compiler/crystal/interpreter/compiler.cr:2100:5 in 'create_compiled_def'
  from src/compiler/crystal/interpreter/compiler.cr:1898:22 in 'visit'
  from src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from src/compiler/crystal/semantic/bindings.cr:16:7 in 'compile_def'
  from src/compiler/crystal/interpreter/compiler.cr:2100:5 in 'create_compiled_def'
  from src/compiler/crystal/interpreter/compiler.cr:1898:22 in 'visit'
  from src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from src/compiler/crystal/interpreter/compiler.cr:3196:5 in 'accept'
  from src/compiler/crystal/interpreter/compiler.cr:3196:5 in 'accept'
  from src/compiler/crystal/interpreter/compiler.cr:3196:5 in 'accept'
  from src/compiler/crystal/interpreter/compiler.cr:3196:5 in 'accept'
  from src/compiler/crystal/interpreter/compiler.cr:3196:5 in 'accept'
  from src/compiler/crystal/interpreter/compiler.cr:3196:5 in 'accept'
  from src/compiler/crystal/interpreter/compiler.cr:3196:5 in 'accept'
  from src/compiler/crystal/interpreter/compiler.cr:3196:5 in 'accept'
  from src/compiler/crystal/interpreter/compiler.cr:3196:5 in 'accept'
  from src/enumerable.cr:510:7 in 'accept'
  from src/compiler/crystal/semantic/bindings.cr:16:7 in 'compile_def'
  from src/compiler/crystal/interpreter/compiler.cr:2100:5 in 'create_compiled_def'
  from src/compiler/crystal/interpreter/compiler.cr:1898:22 in 'visit'
  from src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from src/compiler/crystal/semantic/bindings.cr:16:7 in 'compile_def'
  from src/compiler/crystal/interpreter/compiler.cr:2100:5 in 'create_compiled_def'
  from src/compiler/crystal/interpreter/compiler.cr:1898:22 in 'visit'
  from src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from src/compiler/crystal/interpreter/compiler.cr:472:7 in 'accept'
  from src/compiler/crystal/semantic/bindings.cr:16:7 in 'compile_def'
  from src/compiler/crystal/interpreter/compiler.cr:1497:5 in 'get_const_index_and_compiled_def'
  from src/compiler/crystal/interpreter/compiler.cr:2645:27 in 'visit'
  from src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from src/compiler/crystal/interpreter/compiler.cr:3196:5 in 'visit'
  from src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from src/compiler/crystal/semantic/bindings.cr:16:7 in 'compile_def'
  from src/compiler/crystal/interpreter/compiler.cr:1497:5 in 'get_const_index_and_compiled_def'
  from src/compiler/crystal/interpreter/compiler.cr:685:31 in 'accept'
  from src/compiler/crystal/interpreter/compiler.cr:3106:5 in 'accept'
  from src/enumerable.cr:510:7 in 'accept'
  from src/compiler/crystal/interpreter/compiler.cr:3195:5 in 'accept'
  from src/enumerable.cr:510:7 in 'accept'
  from src/compiler/crystal/semantic/bindings.cr:16:7 in 'visit'
  from src/enumerable.cr:510:7 in 'accept'
  from src/compiler/crystal/semantic/bindings.cr:16:7 in 'visit'
  from src/enumerable.cr:510:7 in 'accept'
  from src/compiler/crystal/interpreter/compiler.cr:3388:11 in 'compile'
  from src/compiler/crystal/interpreter/interpreter.cr:232:5 in 'interpret'
  from src/compiler/crystal/interpreter/repl.cr:96:5 in 'interpret_and_exit_on_error'
  from src/gc/boehm.cr:141:5 in 'run'
  from src/compiler/crystal/command/repl.cr:39:7 in 'repl'
  from src/compiler/crystal/command.cr:103:7 in 'run'
  from src/compiler/crystal/command.cr:54:5 in '__crystal_main'
  from src/crystal/main.cr:129:5 in 'main'
  from /usr/lib/libc.so.6 in '??'
  from /usr/lib/libc.so.6 in '__libc_start_main'
  from crystal in '_start'
  from ???

Because this is my first build on new installed minipc recent days, and long time not install new system, may be i missing some package? (BTW:/usr/lib/libpthread.so.0 exists in glibc package)

Arch Linux, with following packages was installed.

pacman_check automake \
                 git \
                 libevent \
                 gmp \
                 pcre \
                 openssl \
                 libtool \
                 libxml2 libyaml \
                 llvm lld \
                 wasmer wasmtime \
                 libedit

Maybe. But probably not significantly for standard release builds.

The new optimization levels however give more options for partial optimizations. Instead of --release you could use just -O3 for example which trades some runtime performance, but builds significantly faster. This is mostly relevant for dev builds, of course.

Have you tried 1.10? Just to make sure this isn’t a regression.

Hi, @beta-ziliani , i almost can confirm there is something broken for build interpreter with version 1.11.0 (at least in Arch linux)

Because, I rebuilt 1.11.0 again use my old laptop (there, i built crystal for several times every time new version released, and interpreter always work), but it failed with same error when run crystal i after built on 1.11.0, can you try it?

I don’t have Arch

What you means crystal i works on other linux distro?

Anyway, whatever, I consider there is need a spec for check crystal i works on linux.

I can’t reproduce this issue. Works fine for me on a fresh archlinux docker image with crystal master branch.

$ pacman -Sy crystal make llvm gcc
$ make crystal interpreter=1
$ bin/crystal i hello-world.cr
Using compiled compiler at .build/crystal
Crystal interpreter 1.11.0 (2024-01-08).
EXPERIMENTAL SOFTWARE: if you find a bug, please consider opening an issue in
https://github.com/crystal-lang/crystal/issues/new/
sh: line 1: pkg-config: command not found
Hello World

So it seems to be an issue with your system configuration.

Wired, i follow exact the same step on my local laptop, still get same error.

On windows installed with scoop - anything I try to build I get:
Dependencies are satisfied
Building: msvc_env
Error target msvc_env failed to compile:
Error: Cannot locate the .lib files for the following libraries: libcmt, advapi32, libvcruntime, shell32, ole32, WS2_32, kernel32, legacy_stdio_definitions, DbgHelp, libucrt


Dependencies are satisfied
Building: ameba
Error target ameba failed to compile:
Error: Cannot locate the .lib files for the following libraries: libcmt, advapi32, libvcruntime, shell32, ole32, WS2_32, kernel32, legacy_stdio_definitions, DbgHelp, libucrt

Did you install the MSVC build tools? For example scoop install vs_2022_cpp_build_tools as suggested in GitHub - neatorobito/scoop-crystal: Scoop bucket for the Crystal programming language on Windows (I don’t use Scoop so maybe someone else has a better idea)

Hi, @straight-shoota , could you please try pacman -S pkgconf, and try again?

This issue was confirmed by several Arch user, as said by one of them

glibc does not package .so for pthread, just .so.0, even on Ubuntu, so that's probably correct, looks like crystal is messing up linking the correct file? ,

They made some changes in 1.11.0 to how linking is handled?


No clue who is at fault at this point, although, from my point of view, something must have changed, causing this issue.

Anyway, arch user can create a symlink for a temp fix.

sudo ln -s /usr/lib/libpthread.so.0 /usr/lib/libpthread.so
sudo ln -s /usr/lib/libdl.so.2 /usr/lib/libdl.so

But this is probably not the correct way to fix it.

I have visual studio Professional installed. I have the Desktop development with C++ workload installed as well as the Windows 10 sdk c++ build tools installed.

Does it work if you install using the installer off the GH release vs scoop?

That’s it. I can reproduce with pkg-config. And also outside of Arch Linux.

1 Like

Technically yes, at the tradeoff of performance. YMMV from my benchmarks.

Tracking the interpreter loader bug:

Having the ability to do some optimizations without using release will be nice at least. I mostly use Crystal for Raylib toys and having the ability to test with boosted performance can be handy. Thanks for sharing your benchmarks.

1 Like