From nobody Thu Sep 5 23:03:01 2024 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 4X0FJS5Dykz5VDrS for ; Thu, 05 Sep 2024 23:03:04 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: from sdaoden.eu (sdaoden.eu [217.144.132.164]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0FJS1BrXz4MBD for ; Thu, 5 Sep 2024 23:03:04 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=sdaoden.eu header.s=citron header.b=a6shKal1; dkim=pass header.d=sdaoden.eu header.s=orange header.b=iZYqkEPl; dmarc=none; spf=pass (mx1.freebsd.org: domain of steffen@sdaoden.eu designates 217.144.132.164 as permitted sender) smtp.mailfrom=steffen@sdaoden.eu DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sdaoden.eu; s=citron; t=1725577383; x=1726244049; h=date:author:from:to:subject: message-id:in-reply-to:references:openpgp:blahblahblah:author:from: subject:date:to:cc:resent-author:resent-date:resent-from:resent-sender: resent-to:resent-cc:resent-reply-to:resent-message-id:in-reply-to: references:mime-version:content-type:content-transfer-encoding: content-disposition:content-id:content-description:message-id: mail-followup-to:openpgp:blahblahblah; bh=m8EMiA/Am2sqcAo84z2jsHRbAjrn2lQOia2j7fVSYUw=; b=a6shKal1UqiozMRdo5SQNsVAvktW2A3uDcvXOukFAwsIYbiyO9FDp9HV1NDYV3tlpUae9Bk9 pwW7GBvR+2Hhl0dUgxa/eH8jIqg8Ylq6Bm1CtzGf1+zEmn+4TCAwsTm1pXveJohW4cS/uZU7cN CRPj3ZqSgbcDCZZzS0Ff2UopFk3zUqgxtttWxvXc+VlEUhMZKEBuxl5FeXhViDjRLWV4y1Nc26 VwdLyVOvmUAsxZS/mpLP97VS6ikUcbOh75XXS9At+jis/mttIsObzrPaOEhNVH0Qx/crqyAEyI 1cQPVoFKIXziFQgZCvmC1X1k4RWKTEV1RHI0/XHdqfbr+ePQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=sdaoden.eu; s=orange; t=1725577383; x=1726244049; h=date:author:from:to:subject: message-id:in-reply-to:references:openpgp:blahblahblah:author:from: subject:date:to:cc:resent-author:resent-date:resent-from:resent-sender: resent-to:resent-cc:resent-reply-to:resent-message-id:in-reply-to: references:mime-version:content-type:content-transfer-encoding: content-disposition:content-id:content-description:message-id: mail-followup-to:openpgp:blahblahblah; bh=m8EMiA/Am2sqcAo84z2jsHRbAjrn2lQOia2j7fVSYUw=; b=iZYqkEPlOKJdVMQd47pQrHAFSHa3DlShAhSuAE6iFCiHoaBDh4dffWp3dzsyXiywzjW3XBST +61wAZzEb9jDBQ== Date: Fri, 06 Sep 2024 01:03:01 +0200 Author: Steffen Nurpmeso From: Steffen Nurpmeso To: ske-89@pkmab.se, freebsd-hackers@freebsd.org Subject: Re: The Case for Rust (in any system) Message-ID: <20240905230301.XxRHheIX@steffen%sdaoden.eu> In-Reply-To: <20240905225129.UvYYMXDa@steffen%sdaoden.eu> References: <202409052313.aa18097@berenice.pkmab.se> <20240905225129.UvYYMXDa@steffen%sdaoden.eu> User-Agent: s-nail v14.9.25-608-ge479530e8d OpenPGP: id=EE19E1C1F2F7054F8D3954D8308964B51883A0DD; url=https://ftp.sdaoden.eu/steffen.asc; preference=signencrypt BlahBlahBlah: Any stupid boy can crush a beetle. But all the professors in the world can make no bugs. X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.37 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.87)[-0.875]; R_DKIM_ALLOW(-0.20)[sdaoden.eu:s=citron,sdaoden.eu:s=orange]; R_SPF_ALLOW(-0.20)[+a]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; ASN(0.00)[asn:15987, ipnet:217.144.128.0/20, country:DE]; RCVD_COUNT_ZERO(0.00)[0]; RCPT_COUNT_TWO(0.00)[2]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; DMARC_NA(0.00)[sdaoden.eu]; TO_DN_NONE(0.00)[]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[sdaoden.eu:+] X-Rspamd-Queue-Id: 4X0FJS1BrXz4MBD 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 Steffen Nurpmeso wrote in <20240905225129.UvYYMXDa@steffen%sdaoden.eu>: ... hihihi saw the Somers .. but wanted to add |Ie, if you implement some SCSI command .. | we_parse_THIS_SCSI_COMMAND([.]u8 *buf, u16 len){ |... | /* C99 */{ | struct a_mmc_cmd_x42_resp_data_head *dhp; | |^argument etc of THIS_SCSI_COMMAND | | dhp = R(struct a_mmc_cmd_x42_resp_data_head*,buf); | buf += sizeof(*dhp); | len -= sizeof(*dhp); |} |... | irp = R(struct a_mmc_cmd_x42_isrc_resp*,buf); This thing tested the lengths accordingly, of course. ... |very safely in C, if instead of strnlen() etc something more sane |would have been used. Like a string object. But it is more |typing work etc. *That* of course, yes. Now Option>> or Vec::with_capacity(262144) is not that much shorter than doing something in C proper types at hand provided. (Btw C object constructors usually initialize their types, too, .. that is why they are called constructors. Of course: you need these objects, stdlib has none, but FILE, which is horrific. Vec, hmhm...) ..etcetcetc. --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt)