From owner-freebsd-arch@freebsd.org Mon Jan 7 19:55:27 2019 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB082149DD0A for ; Mon, 7 Jan 2019 19:55:26 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f179.google.com (mail-it1-f179.google.com [209.85.166.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C50876835; Mon, 7 Jan 2019 19:55:26 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f179.google.com with SMTP id b5so2851380iti.2; Mon, 07 Jan 2019 11:55:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=5p3xY3RaDyYdl5e9dvHcJy/y3tNX/aRT4eyyNi/5gn4=; b=kmTpxCjEG5d6rMyzhBX+Sen16xSprFAqCvVFQ5LVleiaCLXpiWIbuJf3LKQmig2Yer cZO8LWcA41Gg9k2ikSkuYBgM4DoOTQuIpcsgdsH4x6eW8NwxsZdA465NrYr6Bzwz39HN 6/ca8zCO7huPFe1wY1I6UaVA++CGuPBReXouwSF1wkhT8jcIuCVz3vNdUWynuB+gYrcc yeXV94sok781sggSgNC4+uU3cbRbg58p2/d6+dt2qUJi1RQo4J90t4/amt9HDAhnNcj/ UJ5lVm91zDDVIWIWTpPt+qHfb535c3KH9r7etSb1GXKqlBhTTMyAxOAi2QQ67zv3ipwz Tddw== X-Gm-Message-State: AJcUukc4fxT6KoBreYD7gmEDh5TVLjEGmCmj6HU5dP3P0OkD/urgiS6N El4naN2ZCtAmYVFxrfBPnvglVlDs X-Google-Smtp-Source: ALg8bN6JfRriNQ4i7BBVbaHNIxlU4xy4Xq7BaNVSSm6SqIh6SCcVikZnq2m43LKqhHFDmIcr7ytMhw== X-Received: by 2002:a24:bc1:: with SMTP id 184mr8605927itd.50.1546889082252; Mon, 07 Jan 2019 11:24:42 -0800 (PST) Received: from mail-it1-f176.google.com (mail-it1-f176.google.com. [209.85.166.176]) by smtp.gmail.com with ESMTPSA id v3sm12952433ioj.79.2019.01.07.11.24.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Jan 2019 11:24:42 -0800 (PST) Received: by mail-it1-f176.google.com with SMTP id a6so2701849itl.4; Mon, 07 Jan 2019 11:24:42 -0800 (PST) X-Received: by 2002:a24:b64a:: with SMTP id d10mr8236473itj.149.1546889081847; Mon, 07 Jan 2019 11:24:41 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Mon, 7 Jan 2019 11:24:30 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: GNU-compatible, BSD-licensed bc To: Dimitry Andric Cc: Gavin Howard , "freebsd-arch@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 7C50876835 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; TAGGED_RCPT(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2019 19:55:27 -0000 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 wrote: > > On 7 Jan 2019, at 19:35, Gavin Howard 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 >