GithubHelp home page GithubHelp logo

Comments (7)

krinart avatar krinart commented on June 21, 2024 2

My intuition was that one third-party library for linear algebra will be enough in any language

This is how assumptions work. They always seem to make sense until they don't :)

In general I always try to make as few assumptions as possible, as every assumption creates a dependency. In this case we would create an artificial dependency "Every language will have only one implementation with linear algebra library". It seems like it makes sense (and it probably does), but why would we bring this unnecessary limitation?

Especially given that we are talking about our API, which should arguably be the most though-out component as that is exactly what users depend on and making backward incompatible changes in a well established API has never been an easy problem.

from m2cgen.

StrikerRUS avatar StrikerRUS commented on June 21, 2024

Ooops! I just typed my comment practically about the same as stated in this issue! I definitely should use F5 more often 😃 .

I would like to introduce option 3:
3. Adding parameter with_deps to all existing methods which would be False by default.

It will unify the dependence policy for all languages.

from m2cgen.

krinart avatar krinart commented on June 21, 2024

Having it as a parameter would require users to see possible values in documentation, whereas having it as a separate method is self-explanatory.

Moreover if with_deps is boolean, it's not flexible enough to accommodate for use cases when we would want to implement support for multiple libraries.

If it's not boolean, we again have 2 options:

  • One parameter with_deps with multiple values, like numpy etc. The disadvantage here is the necessity of reading documentation (for users) and validating the value (for us).
  • Multiple boolean parameters like with_numpy. The disadvantage here (except from need to read documentation for users) is the need to validate those multiple params, like only one of them could be True.

Having dependency-specific methods still seems like a more clear and better API to me which doesn't require reading documentation or validating any parameters,

from m2cgen.

StrikerRUS avatar StrikerRUS commented on June 21, 2024

Moreover if with_deps is boolean, it's not flexible enough to accommodate for use cases when we would want to implement support for multiple libraries.

My intuition was that one third-party library for linear algebra will be enough in any language. In that case using with_deps=True/False will be enough and easy to interpret.

I think that your approach with separate methods seems to be more general and I like it now. Also, it can benefit from class inheritance and allow to build different combinations of dependencies easier. And class naming schema Language[Dep1Dep2...]Interpreter looks very clear to understand from the first glance.

from m2cgen.

StrikerRUS avatar StrikerRUS commented on June 21, 2024

Hi guys @krinart @izeigerman ! Have you come to any agreement? I can work on this issue.

from m2cgen.

StrikerRUS avatar StrikerRUS commented on June 21, 2024

@izeigerman

Seems that two first steps have been done. I wonder do we really need to implement the third one, namely

potentially implement PythonNumpyInterpreter to use in cases where it would be beneficial.

?
To be honest, I don't see any particular reasons for that.

from m2cgen.

izeigerman avatar izeigerman commented on June 21, 2024

@StrikerRUS
Yeah, I agree. I see no benefits either. I think we should close this. Thank you!

from m2cgen.

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.