Crystal Operation Selenite

Selenite

This is the sixth operation on the Crystal track. Operations aim to deliver bigger content pieces compared to our ongoing work (like fixes, adding exercises, etc.).

Crystal exercises on Exercism

It is an operation since this will be released over a period, usually 1-2 weeks.

Summary:

  • five new concepts
  • Crystal 1.13
  • Analyzer improvements
  • Test Runner improvements
  • New tag system
  • Part two of reworking concepts

Crystal 1.13.1

Note: This may lead to some current solutions to break

This upgrade allows you to use the latest tools.
This also makes Crystal 1.13 an “officially” supported version.
This makes our list of “officially” supported versions: 1.9, 1.10, 1.11, 1.12, 1.13

With official means, we ensure that the version can solve all of the exercises and also that we will mention if some feature is unavailable for some of the versions.

As detailed in the last operation, Crystal 1.8 is no longer supported, and the subsequent operation will drop 1.9.

Test runner improvements

Well, let’s start with the most exciting news: In my own testing, I am recording an up to 40% speed improvement compared to 1.12.

TestName 1.12.2 1.13.1
example-all-fail 6.481 s 6.126 s
example-with-optional-tests 8.810 s 5.678 s
example-with-output 9.094 s 5.566 s
example-syntax-error 0.501 s 0.379 s

I’m not sure what caused it. It could be the new Alpine + LLVM version or internal changes of Crystal.

I know I said in operating agate that the test runner would not change:

This is intended to be the “final” version until Crystal releases a major version or exercism introduces v4 spec.

Well, the test runner has received yet another quite large update, namely a new tag system. This will be used on concept exercises to mark which task ID they have. Earlier, this was gathered through counting describe blocks, but using tags should be safer. What it allows is that when running locally, you can now write crystal spec --tag task_id=1, and that will run only the test for task 1.

We will also utilize this tag system to be able to add optional tests for practice exercises.

And you know what the best part is? This is a built-in feature so no dependencies!

Analyzer improvements

This update is relatively minor, it includes a smaller refactoring and some new comments for the following exercises:

  • Dart
  • Weighing machine

Concept Exercises

Five new concepts and four new concept exercises. The concepts include:

  • Error
  • Getter & Setter
  • Iteration
  • Symbol
  • Tuples

Part two of the concept rework was also implemented. This included the new tag system mentioned above and reworking the language to be clearer and more fluent. Some text has also received additions and more significant reworks.

The tag system is implemented on all concept exercises, but these did receive an update to its concept text:

  • Conditionals
  • While loops
  • Nil
  • Char
  • Modules
  • Ranges
  • Union-types
  • Case
  • Array
  • Array methods
  • Procs & blocks

Practice Exercises

Three new practice exercise are making their way to the track:

  • Custom set
  • Game of Life
  • markdown

Also, approaches have been added for the minesweeper exercise, and several exercises have been synced to the problem spec repo.

In this sync, did the anagram and reverse-string exercises get optional tests (which were described in the test runner section). These tests are for Unicode and are not runnable from the website and will only run locally. To not run these tests, you can write crystal spec --tag "~optional" (this is explained in an appended).

misc

  • Map over concepts were updated in repo to reflect latest additions
    It also includes a new concept namely Inheritance
  • A bug was fixed where the block & procs concept lacked concept text under its exercise.
  • The test generator have recived more tests

Future

I have just had my first week at University, which has been super fun. However, I have realized that the amount of time I can spend on other things has been limited. At the same time, I have started to feel that the Crystal track has started to approach completion. Of course, there are more things to be wished for, like more concepts, more analysis, and more exercises. But thinking this track only has 2,4 k (this is no complaint; I was douting making a syllabus from the being, but to this day, do I not regret it), students making more concepts might not have that much in return for creating more advanced concepts.

So what is the future? Well, I will see how much time/motivation I have left over. Still, I would say the significant content updates to the track are past and that you can expect a minor update this fall. However, I don’t promise any considerable amount of content (Contributions to the track are still welcome if you want something added, but open an issue or forum topic first pls).

I also want to give a special thanks to @iHiD, @ErikSchierboom, and @kytrinyx for creating this website, which is the reason I got into programming. Also, @BethanyG, for making the Python syllabus (it is really good, and a shout out to all the other people making the Python track) and helping me contribute to this platform. Also, thanks to @kotp for helping me with Ruby in the beginning. Lastly, special thanks to @ryanplusplus for being my partner in building the Crystal track; a lot of credit for the track being in the state it is in is because of your help. I have likely missed someone, so thanks to everyone else who has been in part of the website that I haven’t already mentioned.

8 Likes

Exciting perf improvement!

1 Like

Awesome work, and thanks for the update as ever. You’re an amazing contributor and I’m always grateful for your work :slight_smile:

2 Likes