From owner-freebsd-hackers@freebsd.org Mon Dec 31 17:36:22 2018 Return-Path: Delivered-To: freebsd-hackers@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 5881C143A92C for ; Mon, 31 Dec 2018 17:36:22 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) (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 4F6D974E2D for ; Mon, 31 Dec 2018 17:36:21 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pl1-x62e.google.com with SMTP id w4so12856643plz.1 for ; Mon, 31 Dec 2018 09:36:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=9LDYam2WiwvxzCcAgoM358jX7sj2QBElJZoI7dFslzU=; b=rnEgbjxrsYoXqMMYH/HhGg4RtU9b4SuWJlJOwHjIX5jWdY21TmCxFQe+KJ3CL4bTF7 5MELXNGVdmQtkgDIjWRbm3vX4/Ske07+7DAEa3EzB1A9/O6ZUcT+HfvRpfbzzjaot36B RGoCewt4SpbgvOaApPwfVouR7gZ3JE7mKFctYsNpOUdeP0+L9EZidz1VaGGX/Pb4lgxf sjJgJS426dy+RvHyi0KsePdGrTf8NWI6yixlDaPMByL9JFLuOetg6GEByMwjp+5FlLTS t0hPqh1Vkz+/P2bD2HpVfRk8HDcURLfAU6sfwFFnAp+BY4uDX+wlKo8njn/+ZZF6T8bq M0hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=9LDYam2WiwvxzCcAgoM358jX7sj2QBElJZoI7dFslzU=; b=mPfUykvh5FFdawuN9R70cHLBsWNd/YfwVq1nHt6EIHWJKqhgjlPM8QGzkPgMy8jMRQ SIQQu8VLBARVHBHP7yKEnznnrnEHDX2D7BL3H7YipIVG7BHiW2OFNI7nmw5QLKrenbog jxYYeavXSdWxAtWyz3GzL2kBWi06iyGKq/ARD5YmXQr5ITu06J8ptVabqUJG6TwmlyUZ gH5OnEqDkK9wtS5ADLijt1y4QObwxvVSbQzqCR3qi0iTg2Ykto+nX4iuBd20SdtQ+udI Z+bCFLOQdSFjpeFc3/612bqesfi1RaGwzELiso3nN6hlxBAJIvwLew3YeXf1bVJFZYRf 0DQg== X-Gm-Message-State: AJcUukdJDkANNgI5+XVPjcKowRX02ptgYEo9eE7jpKACdwzKWWGsr6Q3 e2GiXLHsyUUpga8PARMT9rE= X-Google-Smtp-Source: ALg8bN6GQl+bVRyXphX4YNEMsNtqjlh9mCv71YmI4rIzuBjN8Ag2j1Wm8aXY7okh5XXMxRsrRshkvg== X-Received: by 2002:a17:902:30a3:: with SMTP id v32mr38256087plb.26.1546277779958; Mon, 31 Dec 2018 09:36:19 -0800 (PST) Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id d68sm67645907pfa.64.2018.12.31.09.36.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Dec 2018 09:36:19 -0800 (PST) From: Enji Cooper Message-Id: <713BA6E4-1C4E-4890-831F-6379D3AB4425@gmail.com> Content-Type: multipart/signed; boundary="Apple-Mail=_6C9CE56A-9633-4CBD-BFCA-F045A9DD52B4"; protocol="application/pgp-signature"; micalg=pgp-sha256 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: Speculative: Rust for base system components Date: Mon, 31 Dec 2018 09:36:18 -0800 In-Reply-To: Cc: Eric McCorkle , "freebsd-hackers@freebsd.org" To: Warner Losh References: X-Mailer: Apple Mail (2.3445.9.1) X-Rspamd-Queue-Id: 4F6D974E2D X-Spamd-Bar: -------- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=rnEgbjxr; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::62e as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com X-Spamd-Result: default: False [-8.09 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; HAS_ATTACHMENT(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; SIGNED_PGP(-2.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[e.2.6.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.49)[ip: (-8.88), ipnet: 2607:f8b0::/32(-1.95), asn: 15169(-1.56), country: US(-0.08)] X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Dec 2018 17:36:22 -0000 --Apple-Mail=_6C9CE56A-9633-4CBD-BFCA-F045A9DD52B4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Dec 31, 2018, at 7:02 AM, Warner Losh wrote: =E2=80=A6. > TBH, there's a stronger case for python than rust: there's actual = python > scripts in the tree today that we have to install a port to use. And = there > the benefit, while not zero, is small and the effort is large compared = to > just dragging it in as a port, so it hasn't been done. It's another = fast > evolving language that requires multiple versions as well... >=20 > So write something that everybody wants, that must be in base, and = that > requires rust, and then we can have the conversation=E2=80=A6 As someone who has been using python extensively over the past decade, I = think that using python versions less than 3.7 without type hints to = ensure that the data types are correct [1], mocked tests to ensure that = the code functions and is tested, is the wrong path to make. Rust is still a young language, but it has a number of benefits in terms = of: i. Being able to scale past JIT python. This fact doesn=E2=80=99t matter = on workstations/servers, but it definitely matters on the low end with = embedded systems and the upper end with distributed systems at scale = (there=E2=80=99s a reason why a number of critical services at my = previous longterm employment were written in C++, not python. Some argue = Rust can outperform C/C++ [2]. C++ I can see (managed pointers were = about an order of magnitude less performant in a microbenchmark I wrote = for grabbing the time in the Linux kernel vs malloc in C using llvm36). = However, outperforming C is up for debate. ii. It is easier to grok than C++ (even the most recent versions of the = C++ spec, the language is cryptic in areas). iii. It is more reusable than C out of the box. How often do we need to = rewrite common logic/routines in C and mimic an OOP language like C++ = (see libarchive, pkgng)? At the end of the day, I think the key is that the FreeBSD project needs = to start expressing more complicated subsystems in terms of OOP = languages, like C++, Rust, etc, instead of expressing most of the code = in C. I do think (for instance) a service management system would be a = good candidate for modern C++ or Rust. Cheers, -Enji 1. https://www.python.org/dev/peps/pep-0484/ = 2. = https://www.reddit.com/r/rust/comments/5urar1/is_rust_likely_the_next_fast= est_language_after_c/ = --Apple-Mail=_6C9CE56A-9633-4CBD-BFCA-F045A9DD52B4 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE5bk3FaGcY5rvqmb79YOpJmkwhhUFAlwqU5IACgkQ9YOpJmkw hhVtHw/+IvKHRnJaUQnSKrVPvYkOcJIdWPfo9NEPp3rArjYDI7igHdqsWoimZvn3 HsIG6D/Uv7u9Nh9//f1KA9Ru06pv8F57+6PoPU7/Rndm/tOCnfA50Ta8Mz9Z0Cvg H7bNqpQj27yc0xNgruPNl/Y52mOotBtBvgRY5llEepdjcckV0wn4TOVr4JoNEqgi wItiM970n/TGRDIqOuEQnP+WmiaDO5xuJcKrzh7TV7Vwk2IPOW4TTSlomkvZQeHO ddHhrwTYjlpw9inrnBcP3IdmQObI5D/GE1gLCLfOd2HKWZfjAKCPQwudMH7jBKWH If+s50q6r6bzOxdCxKEDiVyiFIug5pAKScq5zdeSizAEg4h/ph1eTJdUshxRU4ed mY7aoIPAu0evyzqXXor2t5/GXGPIAV4rtNjQo/a9p4SsPBhsxUAWxmmU+wxdc2Z9 XXgNkKV7WXERCrGGeDsZGVLF1cdzrQmSp5A0wQSlSYstlURwJe7f8AZArdQvfyiU Lb7SzZXpLvD5lTaTjqY4f7dqsDWgmGPQw7JbAcCPkhqsOfcnPk6u/JJLFKpkqDyk OA8tTVe2cswKBHmXij6aEX/0eXKzJJnT70XZPH6JZ1Og8PXpIV+eWTrwc+AIrOd8 dpSFVuaz2YmkcSHHNsvoY3VQp7lraBjLWtBcSw0i/5WOOn5bZlI= =LrDW -----END PGP SIGNATURE----- --Apple-Mail=_6C9CE56A-9633-4CBD-BFCA-F045A9DD52B4--