GNU-compatible, BSD-licensed bc
Conrad Meyer
cem at freebsd.org
Mon Jan 7 19:55:27 UTC 2019
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 at freebsd.org> wrote:
>
> On 7 Jan 2019, at 19:35, Gavin Howard <gavin.d.howard at 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
>
More information about the freebsd-arch
mailing list