Giter VIP home page Giter VIP logo

Comments (5)

michaelkirk avatar michaelkirk commented on June 19, 2024

It's nice to trim down dependencies, but I'm wondering how many people actually want to use this library without the WGS84 ellipsoid. Do you have this use case? Can you tell me more about it?

lazy_static is a very small, common, and well maintained dependency, so I'd guess that it's unlikely to cause any real damage.

More likely, in my estimation, is that some well meaning person will disable all the default features on their dependencies and then wonder why this library no longer works for them.

from geographiclib-rs.

Quba1 avatar Quba1 commented on June 19, 2024

Do you have this use case? Can you tell me more about it?

I have this exact case where lazy_static seems like suboptimal addition. I'm using geographiclib only in one part of my library, and thus I'm implementing my own Ellipsoid (much leaner) type which implements From/Into Geodesic. So I'm not using the internal geographiclib's wgs84 except for tests.

lazy_static is a very small, common, and well maintained dependency, so I'd guess that it's unlikely to cause any real damage.

That's why I'm not strongly arguing for implementing this change, but rather discussing it as something to consider.

More likely, in my estimation, is that some well meaning person will disable all the default features on their dependencies and then wonder why this library no longer works for them.

Personally, I would assume that mostly experienced Rust users disable default features and expect things to break because of that, and look for the smallest set of necessary features for their use-case.

from geographiclib-rs.

Dushistov avatar Dushistov commented on June 19, 2024

My idea is to add pre-defined ellipsoids (and thus lazy_static) as a default feature. This way no functionality will change for users, but they will be able to use one less dependency when needed.

It is possible just pre-calculate WGS84_GEOD:

static WGS84_GEOD: Geodesic = Geodesic {
   a: WGS84_A
...
};

and add unit test to verify that it equals to Geodesic::new(WGS84_A, WGS84_F)
to catch need of change pre-calculate code if Geodesic::new would modified.

So it would be possible unconditionally remove lazy_statics,
and also make code little faster because of there is no need for read/write atomic in every access.

from geographiclib-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.