Skip to content

Migrate to new roc#198

Draft
ageron wants to merge 163 commits into
mainfrom
migrate-to-new-roc
Draft

Migrate to new roc#198
ageron wants to merge 163 commits into
mainfrom
migrate-to-new-roc

Conversation

@ageron

@ageron ageron commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

This PR migrates the Roc track to the new zig-based Roc compiler and its new syntax.

At the time of writing:

  • 92 exercises have been migrated and all their tests pass.
  • 4 exercises have been migrated but compilation fails: alphametics, complex-numbers, protein-translation and strain.
  • 14 exercises are partially migrated (i.e., only the tests):
    • 7 exercises shouldn't be too hard to finish migrating: forth, go-counting, grep, poker, rational-numbers, tournament, and zebra-puzzle.
    • 7 exercises depend on external libraries, so they will be impossible to migrate until these libraries are migrated. This includes anagram (unicode), gigasecond (isodate), meetup (isodate), micro-blog (unicode), rest-api (json), reverse-string (unicode) and sgf-parsing (roc-parser)

ageron added 30 commits June 9, 2026 16:55
Comment thread exercises/practice/error-handling/.docs/instructions.append.md Outdated
Comment thread exercises/practice/error-handling/.docs/instructions.append.md Outdated
Comment thread exercises/practice/complex-numbers/ComplexNumbers.roc Outdated
Comment thread exercises/practice/complex-numbers/ComplexNumbers.roc Outdated
Comment on lines +1 to +7
RationalNumbers :: {}.{
Rational : { num : I64, den : I64 }

add : Rational, Rational -> Rational
add = |{ num: num1, den: den1 }, { num: num2, den: den2 }| {
{ num: num1 * den2 + num2 * den1, den: den1 * den2 }->reduce()
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

My feedback from ComplexNumbers applies here as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Indeed, I'll update this as well.

Comment thread exercises/practice/list-ops/.docs/instructions.append.md
Comment on lines +2 to +5
new : { real : F64, imag : F64 } -> Complex
new = |{ real, imag }| {
crash "Please implement the 'new' function"
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Constructors are redundant in Roc, is there a special reason why it was introduced here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants