From owner-freebsd-hackers@freebsd.org Sun Jan 6 14:18:22 2019 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 87EE8149079C for ; Sun, 6 Jan 2019 14:18:22 +0000 (UTC) (envelope-from mozolevsky@gmail.com) Received: from mail-oi1-f174.google.com (mail-oi1-f174.google.com [209.85.167.174]) (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 D01D7808AD for ; Sun, 6 Jan 2019 14:18:21 +0000 (UTC) (envelope-from mozolevsky@gmail.com) Received: by mail-oi1-f174.google.com with SMTP id x23so33949155oix.3 for ; Sun, 06 Jan 2019 06:18:21 -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:from:date :message-id:subject:to:cc; bh=FLFWNzaWx/6pvLqle+9wfmXF0vqermFCBI0AzrOkahQ=; b=RGYLtunped/BvWTF05EWtoR18wZwtluvKCL7/Iztk0fluQuMeA5gKLNykYA+9l1aF3 o66SBd1GZPx6dfjfVFGptZSVIIB610Gmpn55xIyvwIaDoEN4O2os+GfrviQzwEm6X5J4 P7hkyogO2ZmT/rrvJA96Cut3cuM7EtrqjOsq8sX2yg9P06Nui7lhqNKNETZjMevrTJxt qaFDv9GXVjkVu77JpgE4WD/MdSO9pAfR9/DltNtL3zRApXxrwBoFmIrbpcz2wzaOMh1z EWko0q/AYvGm/8b+UI83gTw1Cfv90hjqwQt4zU1tv1yKXLz5sQZB74F9Zn8+MUA67Ydp wP6A== X-Gm-Message-State: AJcUukeVj+8ePxQBumt47xKzG45iPAYmJHjS2MgD7SKdZG7prW4p0FuJ /1Na8LBa3chnB7ZDy/CC4Un3LMLrIMoUVu0LK8eOpA== X-Google-Smtp-Source: ALg8bN4pKBDqfcFWhdbCkAW26XBqDkFYjYVqut8Wa1FmLkgTvtqUYwioNlm/5DXjC08M8I1/LAqQxIwj57/Cw2pxXbE= X-Received: by 2002:aca:5987:: with SMTP id n129mr6016283oib.174.1546784300765; Sun, 06 Jan 2019 06:18:20 -0800 (PST) MIME-Version: 1.0 References: <201901021829.x02IT4Kc064169@slippy.cwsent.com> <361CCB81-AEB6-4EAC-9604-CD8F4C63948C@gmail.com> <6DF138FB-E730-477A-A992-8FE1944DDE94@exonetric.com> <451787DE-0659-4F7D-B011-904F90866DDB@gmail.com> In-Reply-To: From: Igor Mozolevsky Date: Sun, 6 Jan 2019 14:17:44 +0000 Message-ID: Subject: Re: Speculative: Rust for base system components To: Sidju Cc: Hackers freeBSD Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: D01D7808AD X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of mozolevsky@gmail.com designates 209.85.167.174 as permitted sender) smtp.mailfrom=mozolevsky@gmail.com X-Spamd-Result: default: False [-3.96 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; DMARC_NA(0.00)[hybrid-lab.co.uk]; MIME_TRACE(0.00)[0:+]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[alt3.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[174.167.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.85)[-0.847,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; FORGED_SENDER(0.30)[igor@hybrid-lab.co.uk,mozolevsky@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[igor@hybrid-lab.co.uk,mozolevsky@gmail.com]; IP_SCORE(-1.11)[ipnet: 209.85.128.0/17(-3.78), asn: 15169(-1.67), country: US(-0.08)]; RCVD_COUNT_TWO(0.00)[2] 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: Sun, 06 Jan 2019 14:18:22 -0000 On Sun, 6 Jan 2019 at 14:09, Sidju wrote: > >Don't know where you've been for the earlier discussion, but someone > >did an experiment, and guess what: Rust yielded a massive increase in > >instruction count for a a simple sum-of-integers program, so it's not > >just "runtime library" issue. As for "potential bugs," see below. > > Wasn't that the experiment that sparked the "statically linked by default" > sidetrack? > From all that I have been able to find ( https://benchmarksgame-team.pages.debian.net/benchmarksgame/faster/rust-gpp.html ) > rust performs far better than java and go (which is what I contrasted > to) and is not very far behind c and c++ (which I doubt anything will > beat for the next 10 years). > > Admittedly the codesize is increased even with dynamic linking and > there is some cost for those ownership checks when they occur, > but it is not horrendous. Java was given by me as a parody example, don't know why you've taken comparison against Java so seriously... The second experiment was purely on executable instruction count, if I recall correctly, not the binary size; and I'd rather my processor did little work and slept than did a lot of work to achieve the same result and ate electricity. > >> Rust isn't a silver bullet that will fix all bugs. It is a slightly more > >> abstracted and type checking language that is slightly better for a lot > >> of things. If you don't find that slight improvement worth the difficulty > >> it is to learn it, then don't. > > >The gist is: learn a better discipline of programming to make better > >code, not yet-another-many-promises-but-few-deliveries language. > > By that reasoning we should never have left the glorious days of > assembly programming. I'm very much in favour of that---you wouldn't believe how often I think "this is so trivial to do in asm" while fighting "safeguards" and other "curiosities" of C! -- Igor M.