Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release post for 1.9.0 #468

Merged
merged 7 commits into from
Jul 11, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 102 additions & 0 deletions _releases/2023-07-11-1.9.0-released.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
title: Crystal 1.9.0 is released!
version: 1.9.0
summary:
thumbnail: +
author: straight-shoota
---

We are delivering a new Crystal release with several bugfixes and improvements.

Pre-built packages are available on [GitHub Releases](https://github.com/crystal-lang/crystal/releases/tag/1.9.0)
and our official distribution channels.
See [crystal-lang.org/install](https://crystal-lang.org/install/) for
installation instructions.

## Stats

This release includes [XXX changes since 1.8.2](https://github.com/crystal-lang/crystal/pulls?q=is%3Apr+milestone%3A1.9.0)
by XX contributors. We thank all the contributors for all the effort put into
straight-shoota marked this conversation as resolved.
Show resolved Hide resolved
improving the language! ❤️

## Changes

Below we list the most remarkable changes in the language, compiler and stdlib.
For more details, visit the [changelog](https://github.com/crystal-lang/crystal/releases/tag/1.9.0).

### Breaking: Big number comparisons with floats

Comparison of Big number types against floats were fixed to respect special
straight-shoota marked this conversation as resolved.
Show resolved Hide resolved
values such as `NAN`. As a result, the implementation of the comparison operator
`#<=>` between `Big*` (`BigDecimal`, `BigFloat`, `BigInt`, `BigRational`) and
`Float` (`Float32`, `Float64`) number types is now nilable.
straight-shoota marked this conversation as resolved.
Show resolved Hide resolved
When invoking these comparisons, `Nil` values must be handled explicitly.

### Windows

The compiler and standard library take a big step improving Windows support.
Only few outstanding issues remain and we expect them to be resolved in the
following months.

Most notable features are a GUI installer (available in the [release artifacts](https://github.com/crystal-lang/crystal/releases/tag/1.9.0))
and dynamic linking of DLLs (currently available via compiler flag
`-Dpreview_dll`).
Comment on lines +41 to +43

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth mentioning this issue with respect to -Dpreview_dll?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is necessary. The behaviour is fixed (no delay loading by default) and everything else explained in the Windows article.


More details and additional features are listed in a separate post about
[Windows support in Crystal 1.9](/2023/07/06/windows-support-1.9.md).

### Language

There are two new macros in the language:

* `ASTNode#warning` is similar to `#raise` but only creats a warning ([#13262](https://github.com/crystal-lang/crystal/pull/13262)).
straight-shoota marked this conversation as resolved.
Show resolved Hide resolved
* `::print` is similar to `::puts` but without the trailing newline ([#13336](https://github.com/crystal-lang/crystal/pull/13336)).

### Standard library

Default interrupt handlers are now in place to trigger `at_exit` handlers
in case of process is interrupted ([#13568](https://github.com/crystal-lang/crystal/pull/13568)).
straight-shoota marked this conversation as resolved.
Show resolved Hide resolved

Instead of a single boolean parameter, file matching behaviour of `Dir.glob`
is controlled by `File::MatchOptions` with portable options ([#13550](https://github.com/crystal-lang/crystal/pull/13550)).

The stdlib spec suite makes good use of the spec helper `assert_prints` and it's
now available for user specs as well ([#13599](https://github.com/crystal-lang/crystal/pull/13599)).

There's a new method `Regex#match!` whith a non-nilable return type
straight-shoota marked this conversation as resolved.
Show resolved Hide resolved
(`Regex::MatchData`) which is helpful if the regex is expected to match.
`regex.match!(x)` is a convenient replacement for `regex.match(x).not_nil!` ([#13285](https://github.com/crystal-lang/crystal/pull/13285)).

All methods accepting a `Regex` for matching now also have a parameter for
`Regex::MatchOptions` ([#13353](https://github.com/crystal-lang/crystal/pull/13353)).

### Compiler

A new compiler command `crystal clear_cache` offers a convenient way to clean
the compiler cache ([#13553](https://github.com/crystal-lang/crystal/pull/13553)).

This release adds support for LLVM 16 ([#13181](https://github.com/crystal-lang/crystal/pull/13181)).

The docs generator now features dark mode ([#13512](https://github.com/crystal-lang/crystal/pull/13512))
and improved support for small viewports ([#13515](https://github.com/crystal-lang/crystal/pull/13515)).

### Deprecations

* `Dir.[]` with `match_hidden` parameter: Use the overload with a `match`
parameter instead.
* `Dir.glob` with `match_hidden` parameter: Use the overload with a `match`
parameter instead.
* `LLVM::Module#write_bitcode_with_summary_to_file`: ThinLTO is no longer
supported; use `#write_bitcode_to_file` instead.
* `LLVM::FunctionPassManager`: The legacy pass manager was removed in LLVM 17.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not 100% correct to say these are deprecated, because LLVM 8-12 are not themselves deprecated, in which case only the legacy API is available (we should definitely deprecate the older LLVM versions some time though)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, conditional deprecations are a bit weird. I think it makes sense though. New code should not use these methods unless they explicitly wish to support LLVM < 13. Otherwise, (keep) using them is totally fine until the next major release.

Use `LLVM::PassBuilderOptions` instead.
* `LLVM::FunctionPassManager::Runner`: The legacy pass manager was removed in
LLVM 17. Use `LLVM::PassBuilderOptions` instead.
* `LLVM::Module#new_function_pass_manager`: The legacy pass manager was removed
in LLVM 17. Use `LLVM::PassBuilderOptions` instead.
* `LLVM::ModulePassManager`: The legacy pass manager was removed in LLVM 17.
Use `LLVM::PassBuilderOptions` instead.
* `LLVM::PassManagerBuilder`: The legacy pass manager was removed in LLVM 17.
Use `LLVM::PassBuilderOptions` instead.
* `LLVM::PassRegistry`: The legacy pass manager was removed in LLVM 17. Use
`LLVM::PassBuilderOptions` instead.
Loading