Show HN: Tiny Moon – Swift library to calculate the moon phase

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  1. TinyMoon

    A tiny Swift library to calculate the moon phase for any given date, works super fast, and works completely offline.

  2. CodeRabbit

    CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.

    CodeRabbit logo
  3. TinyMoonApp

    MacOS app for the current moon phase. Lives as an emoji in your toolbar. Updates daily and works completely offline.

    Tiny Moon is a tiny Swift library to calculate the moon phase for any given date, works super fast, and works completely offline.

    All of this started when I realized that we only have 12, sometimes 13, full moon's in a year. That doesn’t seem like that many.

    I set out to build a MacOS app to remind me when a full moon occurs, so that I could take a moment and step outside to appreciate it.

    The MacOS app I ended up creating can be found at https://apps.apple.com/us/app/tiny-moon/id6502374344 along with the source code [0], all powered by the Tiny Moon library.

    I knew that I wanted the app to work offline, so working with a network request was out of the picture. Taking inspiration from SunCalc [1] and Moontool for Windows [2], I decided to create my own library and wrote Tiny Moon as a Swift Package to power my app.

    The app tries to be as minimal as possible, does what it does very fast, and works completely offline.

    [0] https://github.com/mannylopez/TinyMoonApp

  4. suncalc

    A tiny JavaScript library for calculating sun/moon positions and phases.

  5. vsop87-multilang

    VSOP87 in multiple programming languages

    I think the point is that the lunations vary by a couple of days within a year, so you might confuse users by stating a phase is on the wrong day when they are unaware a low accuracy algorithm is being used. But that algorithm probably would be good enough for just drawing an icon, since the differences would be imperceptable.

    Honestly, I recommend people use the most accurate algorithm they practically can, even if it's overkill for the given application. This just avoids user confusion when different apps give different answers, even if it's not significant.

    E.g., I have ported VSOP87 which gives the position of the moon and planets to sub-arcsecond accuracy to a couple of dozen languages. They are much, much longer than the "snippets", but are not impractical, and users won't notice much difference in application size or computation time. https://github.com/gmiller123456/vsop87-multilang

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

Did you know that Swift is
the 15th most popular programming language
based on number of references?