From owner-freebsd-hackers@freebsd.org Sun Jan 6 13:57:50 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 46B40148FD5A for ; Sun, 6 Jan 2019 13:57:50 +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 3E07C77E1C for ; Sun, 6 Jan 2019 13:57:49 +0000 (UTC) (envelope-from mozolevsky@gmail.com) Received: by mail-oi1-f174.google.com with SMTP id w13so33892401oiw.9 for ; Sun, 06 Jan 2019 05:57:49 -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=kZrmNGdkSjB5uB8A5HTUartSTLpvICJMbQ5nU3Z79uk=; b=spOim9BqhElOUD7fCHtwMaiNMWYIFZp266CfycNLmMZf51hSyfxGPHy/2eBLExD7sv DMdvmU1wadWwh2ev96253/rSgzKjSs2AuQX6DyJpTMxFd7hWNkZGJPE82iatUK9rZlDw XBRtpipKkDfy3Z2rl7zOXb8qi+rW+HoihbWE4Sf1M08HlYR367yHNRhR69IcnSdJCfGU KniPVkMqLcbdX8iNPCbJgOspEcaLJdULFrEnhvuurPHJNzv55gvMugWTEKHuVNNLKLsp x3kNAWEmAUTgPScNBaJxOHDHfmytGfpfPu+Kw77/xBvFsdQ7fpkN8j3PwpUhXex9USS3 GY6g== X-Gm-Message-State: AJcUukcAqJziL56a3X6+yKH/i8AIuxWh0j23YqoJ6V2cXXKZMkEPtHk6 x4PTvmU1QSwY3zgsNLcFx5bnsC7j2N08PV5WbF2gMQ== X-Google-Smtp-Source: ALg8bN66TKnZmcV0ruZPs4GYn/1MV/R8xvlAwsjmw71xRrvejHgdEy4saQmCAbuzvaF9xuq9WwoNGLtJ8A8uMEVY3tI= X-Received: by 2002:aca:3c06:: with SMTP id j6mr5600767oia.126.1546783068068; Sun, 06 Jan 2019 05:57:48 -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 13:57:11 +0000 Message-ID: Subject: Re: Speculative: Rust for base system components To: Pratyush Yadav Cc: Hackers freeBSD Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 3E07C77E1C 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.84 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-0.998,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)[cached: alt3.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.73)[-0.728,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 13:57:50 -0000 On Sun, 6 Jan 2019 at 13:50, Pratyush Yadav wrote: > When I allocate a C object, I think about its lifecycle first, > when/how it is allocated, when/how freed. Works pretty well for me and > helps avoid memory leaks in most cases. But, one time out of a > hundred, I might forget a free(). Bugs like these often don't stem > from ineptitude IMHO, but from honest mistakes. Languages that make > your job easier by taking care of these common pitfalls are not so > bad. That's because you simply engage your hands before engaging your brain, and that's exactly what I meant by _d_i_s_c_i_p_l_i_n_e_! Write documentation *first* then write the accompanying code, not the other way around. or skip the documentation step altogether---how is the reader of your code supposed to know that what you've written in code is what you _i_n_t_e_n_d_e_d_ in the first place? What you've just demonstrated there is astoninigly *poor* discipline! > Another thing is, if the language takes care of memory allocation, > synchronization, etc, I don't have to spend time and effort thinking > about them, making sure everything is correct. I can spend that effort > somewhere more useful, increasing my productivity. What you're wanting is something to compensate for your lack of discipline... Well there's an answer for that for C: lint/static analysis. -- Igor M.