Giter Club home page Giter Club logo

Comments (4)

l4l avatar l4l commented on June 16, 2024

Hi there, thank you for a proposal and sorry for a long response!
To be honest this proposal sounds quite a strange feature request for me, hah. While it may seem like a useful feature to you I'd like to note some downsides:

  • Broken single responsibility principle (i.e. it's no longer just a app launcher, but also a calculator);
  • Potential code complexity (code for parsing, evaluating and additional code for rendering may take up to +30-40% of current codebase size);
  • Current version supports several "magical" separators (#19), which may increase parsing complexity.

Personally I use a python interpreter for that case (any other interpreted language also should work fine). Is there any problem with that solution for you? What kind of complexity from these expressions do you expect, only a basic arithmetic (i.e. +/-/*//) or something else as well? Do you need/expect an arbitrary precision calculation? What behavior do you expect when the expression and the result does not fit a single line? Do you have any other examples where the similar feature is integrated besides Spotlight?

from yofi.

gbaranski avatar gbaranski commented on June 16, 2024

Broken single responsibility principle (i.e. it's no longer just a app launcher, but also a calculator);

Or just advanced app launcher 😆

Potential code complexity (code for parsing, evaluating and additional code for rendering may take up to +30-40% of current codebase size);

We can just use fastval crate or something like that.

Personally I use a python interpreter for that case (any other interpreted language also should work fine). Is there any problem with that solution for you?

I also use python for that, but it takes some time to launch and it's easier to just use $mod+d and write expression.

What kind of complexity from these expressions do you expect, only a basic arithmetic (i.e. +/-/*//) or something else as well?

Basic arithmetic would be great, however functions like sqrt() or cos() would be great to add.

Do you need/expect an arbitrary precision calculation?

Yeah that would be great.

What behavior do you expect when the expression and the result does not fit a single line?

Not sure about that, Spotlight solves that by expanding search view.

Do you have any other examples where the similar feature is integrated besides Spotlight?

Yeah, Ulauncher and Albert.

If you don't find this feature useful, it's completely fine.

Thanks for response

from yofi.

l4l avatar l4l commented on June 16, 2024

Cool, thanks for detailed answers!
I don't consider the feature useless, just felt it slightly outside of project scope. But potentially it's indeed might be very handy. Unfortunately I have no time for that, but still I would like to accept a PR (and help with the code if needed).

What behavior do you expect when the expression and the result does not fit a single line?

Not sure about that, Spotlight solves that by expanding search view.

So far, it's easier implement it without handling that case. For now there's no handling for overflowed input value.

from yofi.

RichardFevrier avatar RichardFevrier commented on June 16, 2024

Math expr evaluations is something that I miss the most from OSX too (paste & copy the result also).
Thank you for pointing Albert @gbaranski I will have to try it!

from yofi.

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.