# \[ANN\] Rematch.jl

**URL:** <https://discourse.julialang.org/t/ann-rematch-jl/10362>\
**Category:** Community\
**Tags:** package, announcement\
**Created:** [April 16, 2018, 1:10pm UTC](https://discourse.julialang.org/t/ann-rematch-jl/10362 "2018-04-16T13:10:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamii](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jamii/32/1373_2.png) [@jamii](https://discourse.julialang.org/u/jamii)\
**Post date:** [April 16, 2018, 1:10pm UTC](https://discourse.julialang.org/t/ann-rematch-jl/10362/1 "2018-04-16T13:10:18Z")

</div>

[Rematch.jl](https://github.com/RelationalAI-oss/Rematch.jl) provides a macro for pattern matching.

Rematch started life as a series of PRs to [Match.jl](https://github.com/kmsquire/Match.jl) but eventually we reached the point where many of the features we wanted required breaking backwards compatibility and it was easier to just start from scratch. Rematch is [mostly backwards-compatible](https://github.com/RelationalAI-oss/Rematch.jl#differences-from-matchjl) but:

- is [much](https://github.com/RelationalAI-oss/Rematch.jl/blob/master/test/runtests.jl#L31-L34) [stricter](https://github.com/RelationalAI-oss/Rematch.jl/blob/master/test/runtests.jl#L148-L156) about matching
- fixes many of the [outstanding issues](https://github.com/RelationalAI-oss/Rematch.jl/blob/master/test/runtests.jl#L158-L184) in Match.jl
- use the same pattern matching algorithm for all patterns, rather than switching to `==` for simple patterns, thus avoiding some tricky edge cases where adding a variable to a pattern could change the matching semantics
- generates [more type-stable code](https://gist.github.com/jamii/21f35fcf6a025f8fb1442c67307fbda1)
- is much easier to maintain, thanks to MacroTools

---

<div class="post-metadata">

**Author:** ![lyonsquark](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lyonsquark/32/4483_2.png) [@lyonsquark](https://discourse.julialang.org/u/lyonsquark)\
**Post date:** [April 16, 2018, 3:32pm UTC](https://discourse.julialang.org/t/ann-rematch-jl/10362/2 "2018-04-16T15:32:03Z")

</div>

Out of curiosity, what is “CodeTools” and how does that help? Thanks! – Adam

---

<div class="post-metadata">

**Author:** ![tshort](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tshort/32/43_2.png) [@tshort](https://discourse.julialang.org/u/tshort)\
**Post date:** [April 16, 2018, 4:08pm UTC](https://discourse.julialang.org/t/ann-rematch-jl/10362/3 "2018-04-16T16:08:21Z")

</div>

I think they meant MacroTools, not CodeTools.

---

<div class="post-metadata">

**Author:** ![lyonsquark](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lyonsquark/32/4483_2.png) [@lyonsquark](https://discourse.julialang.org/u/lyonsquark)\
**Post date:** [April 16, 2018, 4:09pm UTC](https://discourse.julialang.org/t/ann-rematch-jl/10362/4 "2018-04-16T16:09:59Z")

</div>

That makes sense. Thanks!

---

<div class="post-metadata">

**Author:** ![jamii](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jamii/32/1373_2.png) [@jamii](https://discourse.julialang.org/u/jamii)\
**Post date:** [April 16, 2018, 4:19pm UTC](https://discourse.julialang.org/t/ann-rematch-jl/10362/5 "2018-04-16T16:19:06Z")

</div>

Ooops.

I typed CodeTools too many times today and it’s etched on my brain 🙂
