[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Should we be touching goops?

From: David Kastrup
Subject: Re: Should we be touching goops?
Date: Sun, 05 Jun 2022 14:13:42 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Jean Abou Samra <> writes:

> Le 04/06/2022 à 13:16, Luca Fascione a écrit :
>> On Sat, Jun 4, 2022 at 12:47 PM David Kastrup <> wrote:
>>> LilyPond uses precise arithmetic.
>> Thanks David, just out of curiosity, where's a reference to the specific
>> implementation we're using?
> C++ code uses the Rational type, which is implemented in
> flower/ and flower/include/rational.hh. Scheme
> code uses plain Guile numbers. Scheme mixes "exact" (rational)
> and "inexact" (floating-point) numbers in a very lax way.
> This is documented at
> The conversion between the two is in lily/
> ({from,to,is}_scm<Rational>).
> The Moment type is defined in lily/ and lily/include/moment.hh.
> It has two Rational members, a main part and a grace part.
>> Further, besides the floating point math segment, does the rest feel like
>> it's on target to you?
> Honestly, I feel like we're making a big deal of something
> that doesn't have a lot of practical ramifications for LilyPond.

git grep 'ly:moment-\(add\|sub\|mul\|div\|mod\)'

puts out a good page or so, much of it in and
Admittedly, both of those files are of the kind we would want to
encourage people to write, and that kind of change makes it more

But indeed, in the overall code base very little would change and one
would want to carefully check the effect on performance (having the
generic `+` support more types will affect performance _outside_ of
actual uses with the Moment type, and it depends on GOOPS'
implementation just how much: this is supposed to be quite less
expensive with Guile 2 than it was with Guile 1, but I don't know just
how much so).

David Kastrup

reply via email to

[Prev in Thread] Current Thread [Next in Thread]