# Qi 3.0 Released

**URL:** <https://racket.discourse.group/t/qi-3-0-released/1194>\
**Category:** Languages\
**Tags:** release, qi\
**Created:** [July 30, 2022, 8:21pm UTC](https://racket.discourse.group/t/qi-3-0-released/1194 "2022-07-30T20:21:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![countvajhula](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/countvajhula/32/65_2.png) [@countvajhula](https://racket.discourse.group/u/countvajhula)\
**Post date:** [July 30, 2022, 8:21pm UTC](https://racket.discourse.group/t/qi-3-0-released/1194/1 "2022-07-30T20:21:22Z")

</div>

It's my pleasure to announce that Qi 3.0 is now available. Upgrade now via:

```scheme
raco pkg update qi

```

This ended up being a big release with contributions from many people. I will do my best to summarize the improvements. There's a lot here, and I hope some of it will be interesting even for non-Qi users.

# Qi Design Challenge #1 Results

The inaugural Qi Design Challenge was posed in June. The premise is simple -- a coding problem that is simple but not trivial, and write it in your favorite language. There were many entries in many different languages, and I found them insightful and even inspiring (they led to many improvements that are part of this release!). Take a look at the entries at the [Qi Wiki](https://github.com/countvajhula/qi/wiki/Design-Challenge-%231).

It's worth noting that keeping the problem relatively simple allows it to be a useful window into paradigms in other languages. Ideas for future problems are welcome!

# Performance Groundwork

In the original RacketCon talk about Qi, I brazenly suggested that Qi's performance is on par with Racket and could even exceed it in some cases 🕶 . It turns out I was wrong 🙃 . Thanks to an audit by Michael Ballantyne, the benchmarks are now more representative of actual performance, where Racket is indeed much faster on microbenchmarks.

The good news is, there's a lot of scope for improvement! Some of these improvements have already been begun, including:

- the addition of Continuous Performance Benchmarking, which tracks performance changes in the language across commits. These benchmarks have some known issues (in particular, they are not normalized for VM performance -- pointed out by Sam Phillips), but they serve as a useful start. Take a look at the charts here: [Qi Benchmarks](https://countvajhula.github.io/qi/benchmarks/), and keep this page open as we will refer to it below.

- The latency on calling `(require qi)` was formerly about half a second. It is now down to `~150 ms`, a factor of 3 improvement! This was achieved by Ben Knoble, with a clutch assist from Bogdan Popa's [dependency analyzer tool](https://github.com/Bogdanp/racket-import-profiler). This data point is tracked in the charts -- scroll all the way to the bottom. Many of the trends in the charts are currently invalid (for reasons..), but this is one of a few that aren't.

- Some users mentioned long build times for Qi. This should now be greatly improved thanks to the elimination of a lot of "incidental" documentation dependencies by using `#:indirect` links (Thanks to Jack Firth and Sorawee Porncharoenwase for the suggestion!). This data point isn't tracked, in case you were wondering.

# Other Features

- Qi now hosts [backup docs](https://countvajhula.github.io/qi/) in case the main ones are unavailable (using a CI recipe from Sam Phillips)
- A simpler application syntax in Qi that leverages fancy-app to support some new possibilities. This buzzer-beating entrant into this release was done by Noah Ma 🏀. Check this out: `(map (☯ (_ 10 2)) (list + - * /)) ;=> '(12 8 20 5)`
- Part the sea of values with [`partition`](https://docs.racket-lang.org/qi/Qi_Forms.html#%28form._%28%28lib._qi%2Fmain..rkt%29._partition%29%29), a new form introduced by Ben Knoble. (Incidentally, this is another tracked data point in the charts that happens to show a legitimate trend -- scroll to near the bottom to find "partition").
- A new doc, [Principles of Qi](https://docs.racket-lang.org/qi/Principles_of_Qi.html), starts to describe some of the ideas underlying Qi. Highlights: Qi is "Arrows", and Sunyata logic.

# Bugs Fixed

- Formerly, there were cases where fancy-app would inappropriately get control of parsing user input. That has been fixed (Thanks, Ross Angle (aka Nia)!)
- Some edge cases in the `divert` clause of [`switch`](https://docs.racket-lang.org/qi/Language_Interface.html#%28form._%28%28lib._qi%2Fmain..rkt%29._switch%29%29) were fixed
- Better error messages in some common cases of threading

If you'd like to participate in Qi development, follow updates at [the source repo](https://github.com/countvajhula/qi). At the moment, work is getting started on a Qi compiler -- the first stage of this will be to distill a small core language (Core Qi) for which we could define optimization rules after expansion of the higher-level language (Standard Qi). Contributions of any kind are welcome -- don't let us have all the fun 🙂

Finally, Stephen reminded me that new releases are a good time to join the [Summer #lang Party](https://racket.discourse.group/t/summer-lang-party/1128) where all the cool languages are hanging out, so, see you there!
