From nobody Thu Dec 02 17:02:17 2021 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D3AA918C726E for ; Thu, 2 Dec 2021 17:02:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J4j1R3pxLz4mMj; Thu, 2 Dec 2021 17:02:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from [10.0.1.4] (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id E38EC2E535; Thu, 2 Dec 2021 17:02:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Thu, 2 Dec 2021 09:02:17 -0800 List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Content-Language: en-US To: "Bjoern A. Zeeb" , Ed Maste Cc: FreeBSD Hackers References: <202111260909.1AQ99LY2023877@gndrsh.dnsmgr.net> From: John Baldwin Subject: Re: Retiring WITHOUT_CXX In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638464539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=f+uboWmUsWwQHo7mNh4W6ff2IbiiPyYcPsS4xsSqKcE=; b=isg2+yhSdtjP9EtSju4Dy6DR8Y7duxBX8fScdmIgn0XBbiS0JEqO9sJMnBQ9+S1MjzOu59 glillY2F05DypR4XEN9Z32fDW9/5BrI5nCJgd/kET6W3MyAvXhdXqjAZ0MWLGaRZ8ZNmbo W4Hs8ZPL2x7zeRfxX7J7onVkixlpcUl/CuSeFWFGSZn6yjVS35kxY5OPyzsYb5dVcETSnj U9EHbqcjq8g+rjqgZpDOnWbaODYGM/PYlGjBHwwR6sLIdP7lr73ExVt3F3dFlWOUcn+FPm sK1uGlWE0rvTX4DMzmhFQIPefbsVkVKHXO78ZRRc09RWaWbc3Lr4mtWt+DQXzQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638464539; a=rsa-sha256; cv=none; b=tgyeAnffgQLR/ZFL/huo+VXuiuepv/UwdFOiYOvCwvLPpdY8JAzl0WKd1JwBvekMkR1AMZ tQASZ7flc3a7ZFeKtQDMnT8AEFMW3aTzi/5IWt0jwwlJP2ECOXZ1e7tq5ZOh8QaKgqi3P2 hmQZK3UCWl5Jz/VinjV/aKPLxi85atoOQczIxrwb1b5JF4sQ+K/iooFwBKzpSDqBSjCPZB kpPtmLeoyUaVmAfHKnDVkPCSVrOqOyF+Dmz4fVfXn2AOEUUMKPCkPBqnXYT3Zu2gJ/GgSX IiNL9dNske8nEO4zW63g43C+FjVWm+yHjoPSO5FH5QjH5jV44pvrv7ciAD0A/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On 11/26/21 11:06 AM, Bjoern A. Zeeb wrote: > On Fri, 26 Nov 2021, Ed Maste wrote: > >> On Fri, 26 Nov 2021 at 04:09, Rodney W. Grimes >> wrote: >>> >>> So is the feature model of FreeBSD becoming, oh it gets broken >>> cause it is not regularly tested, so lets remove that feature. >> >> I don't agree with that. We have a large and growing CI infrastructure >> to regularly test functionality and are continually adding to it over >> time. But it's important to test and maintain what is actually used >> and is useful. Disabling C++ support made sense when obrien@ added the >> original knob in 2000, but it makes less sense today when parts of >> FreeBSD are written in C++. > > I used to disable it in my images but started to need devd and that is > really the only reason its there currently > > #WITHOUT_CXX= # devd needs it > > I used to have a conversation with Warner a while ago about it and the > conclusion was the bits of C++ could be reimplemented in C if needed > but obviously no one ever got to that. I honestly think that's the wrong direction. I'm currently hacking on a libiscsi for shared bits of iscsid and ctld and right now it has some home-grown containers (struct keys) that would be much better as a std::vector<> of a struct with two strings. It would also benefit from having an actual class for the instead of the typical C inheritance I've added. Similarly, I've wanted to use std::unordered_map in truss to handle the syscall counts since hash tables in C require a lot of boilerplate code. This is no longer 1985, or even 2003. I'm not ready to write a kernel in C++ with templates, but I think for userspace utilities you can buy a fair bit of robustness with RAII, unique_ptr, etc. and we shouldn't be crippling ourselves. Also, have you looked at what WITHOUT_CXX actually removes? c++ is just a hard link to clang. That's the big space eater, not libc++.so.1 or libcxxrt.so.1. For reference, on my 13.x desktop, libc.so.7 is about 3 times the size of libc++.so.1: -r--r--r-- 1 root wheel 1986208 Aug 19 15:28 /lib/libc.so.7 -r--r--r-- 1 root wheel 112200 Aug 19 15:29 /lib/libcxxrt.so.1 -r--r--r-- 1 root wheel 846200 Aug 19 15:29 /usr/lib/libc++.so.1 -- John Baldwin