Scala Macros

Open-source Scala projects categorized as Macros | Edit details

Top 8 Scala Macro Projects

  • GitHub repo Wartremover

    Flexible Scala code linting tool

    Project mention: Newspeak and Domain Modeling | news.ycombinator.com | 2021-06-29

    or `NonUnitStatements` without explicit annotation.

    This effectively locks you into writing pure code (you can extend the linter to cover other things like not using `Future` or not using Java libs outside of `MonadError` from cats[4]). The linters operate on typed ASTs at compile time, and have plugins for the most popular scala build tools. Coupled with `-XFatalWarnings', you can guarantee that nothing unexpected happens unless you explicitly pop the escape hatch, for the most part.

    You can still bring in external libraries that haven't been compiled with these safties in place, so you aren't completely safe, but if you use ZIO[5]/Typelevel[6] libraries you can be reasonably assured of referentially transparent code in practice.

    There are three schools of thought, roughly, in the scala community towards the depth of using the type system and linters to provide guarantees and capabilities, currently:

    1) Don't attempt to do this, it makes the barrier to entry to high for Scala juniors. I don't understand this argument - you want to allow runtime footguns you could easily prevent at compile time because the verifiable techniques take time to learn? Why did you even choose to use a typesafe language and pay the compilation time penalty that comes with it?

    2) Abstract everything to the smallest possible dependency interface, including effects (code to an effect runtime, F[_] that implements the methods your code needs to run - if you handle errors, F implements MonadError, if you output do concurrent things, F implements Concurrent, etc.) and you extend the effect with your own services using tagless final or free.

    3) You still use effect wrappers, but you bind the whole project always to use a concrete effect type, avoiding event abstraction, thus making it easier to code, and limiting footguns to a very particular subset (mainly threadpool providers and unsafeRun or equivalent being called eagerly in the internals of applications).

    My opinion is that smallest interface with effect guarantees (#2) is best for very large, long maintenance window apps where thechoice of effect runtime might change(app), or is out of the devs' control (lib); and #3 is best for small apps.

    TL/DR; You can go a really, really long way to guaranteeing effects don't run in user code in scala. Not all the way like Haskell, but far enough that it's painful to code without conforming to referential transparency.

    1. https://github.com/scalacenter/scalafix

    2. https://github.com/scalaz/scalazzi

    3. http://www.wartremover.org/

    4. https://typelevel.org/cats/api/cats/MonadError.html

    5. https://zio.dev/

    6. https://typelevel.org/

  • GitHub repo Scala-Logging

    Convenient and performant logging library for Scala wrapping SLF4J. (by lightbend)

  • Scout APM

    Scout APM: A developer's best friend. Try free for 14-days. Scout APM uses tracing logic that ties bottlenecks to source code so you know the exact line of code causing performance issues and can get back to building a great product faster.

  • GitHub repo Accord

    Accord: A sane validation library for Scala

  • GitHub repo jsoniter-scala

    Scala macros for compile-time generation of safe and ultra-fast JSON codecs

    Project mention: jsoniter-scala with Spark - feedback wanted | reddit.com/r/apachespark | 2021-11-18

    Would extending of java.io.Serializable by its codecs and configs make it handier in use with Spark?

  • GitHub repo scala-commons

    AVSystem commons library for Scala

    Project mention: Performance of 12 JSON parsers for Scala | reddit.com/r/scala | 2021-03-29

    I've updated results of benchmarks of 12 JSON parsers for Scala: - AVSystem's scala-commons - Borer - Circe - DSL-JSON - Jackson - jsoniter-scala - Play-JSON, - play-json-jsoniter - Spray-JSON - uPickle - weePickle - zio-json

  • GitHub repo phobos

    Efficient and expressive XML data-binding library for Scala

    Project mention: Scala XML library | reddit.com/r/scala | 2021-01-12
  • GitHub repo scalingua

    A simple gettext-like internationalization (aka i18n) library for Scala and Play Framework

    Project mention: Is there a scala library to handle grammar in string messages? | reddit.com/r/scala | 2021-11-23

    Scalingua seems relevant https://github.com/makkarpov/scalingua

  • Nanos

    Run Linux Software Faster and Safer than Linux with Unikernels.

  • GitHub repo pos

    Macro based print debugging. Locates debug statements in your IDE. Supports logging.

NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020). The latest post mention was on 2021-11-23.

Index

What are some of the best open-source Macro projects in Scala? This list will help you:

Project Stars
1 Wartremover 982
2 Scala-Logging 838
3 Accord 521
4 jsoniter-scala 456
5 scala-commons 75
6 phobos 69
7 scalingua 50
8 pos 22
Find remote jobs at our new job board 99remotejobs.com. There are 33 new remote jobs listed recently.
Are you hiring? Post a new remote job listing for free.
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com