Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Jan 2019 11:24:30 -0800
From:      Conrad Meyer <cem@freebsd.org>
To:        Dimitry Andric <dim@freebsd.org>
Cc:        Gavin Howard <gavin.d.howard@gmail.com>,  "freebsd-arch@freebsd.org" <freebsd-arch@freebsd.org>
Subject:   Re: GNU-compatible, BSD-licensed bc
Message-ID:  <CAG6CVpU-rgUVvWYDA%2B2qw62hzK1xOEqVwmXGSx2yrfqNMX8e7w@mail.gmail.com>
In-Reply-To: <A6C4B09B-4156-47A4-89B0-80E8688D59FC@FreeBSD.org>
References:  <CAF=dzRNnurahLBOaKgq8_bDXNuM8biYPFbj6F2vp0t58Ejp8bg@mail.gmail.com> <A6C4B09B-4156-47A4-89B0-80E8688D59FC@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Thanks Gavin,

I think this could be valuable for us.  Our bc is not GNU-compatible
today and that causes some pain.

For example, fusefs-lkl requires the gnubc port to build because the
base bc lacks some functionality that GNU has, and of course lkl uses
the gnu bc functionality.  So a BSDL bc that is actually
GNU-compatible seems attractive to me.

The script in question can be found here:
https://github.com/torvalds/linux/blob/master/kernel/time/timeconst.bc
and it is invoked like: "echo 100 | bc -q path/to/timeconst.bc".

It can be reduced to the following short test case with the same invocation:

    a = read();
    print "a: ", a, "\n"

In-tree BSD bc prints "dc: not a string" on stderr and with the
simplified test case, "a: 0\n100\n" on stdout.

GNU bc prints "a: 100\n" on stdout, as expected.  (I have not tried Gavin's bc.)

Best,
Conrad

On Mon, Jan 7, 2019 at 11:06 AM Dimitry Andric <dim@freebsd.org> wrote:
>
> On 7 Jan 2019, at 19:35, Gavin Howard <gavin.d.howard@gmail.com> wrote:
> >
> > I am the author of a GNU-compatible, BSD-licensed bc
> > (https://github.com/gavinhoward/bc). I noticed (on
> > https://wiki.freebsd.org/GPLinBase) that FreeBSD used to use the GNU
> > bc until it was taken out because of the GPL. My bc is not licensed
> > under the GPL; it is under the 0BSD license. Thus, I think my bc might
> > be a great fit for FreeBSD.
> >
> > My bc is well-tested. I make sure that every single memory bug that I
> > can find is out before every single release. I also make sure that my
> > bc's math is correct by running millions of random math problems
> > before every release.
> >
> > My bc is extremely portable; it easily builds on any POSIX
> > platform. And it includes a full dc as well (except for the "!"
> > command).
> >
> > I would love to work with the core team to get my bc into FreeBSD, if
> > there is interest. I am about to do a release, and I am willing to
> > delay the release to get it up to par for FreeBSD.
> >
> > Would there be interest?
>
> You are 9 years late. :-)
>
> https://github.com/freebsd/freebsd/commit/bc4e1f6f87a770761be30eb708cbef88bc4d9536
>
> That said, are you aware of any great differences between your bc and
> the one originally from OpenBSD?
>
> -Dimitry
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAG6CVpU-rgUVvWYDA%2B2qw62hzK1xOEqVwmXGSx2yrfqNMX8e7w>