From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 4629 invoked from network); 6 Feb 2022 12:50:35 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 6 Feb 2022 12:50:35 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id C7FE39B68F; Sun, 6 Feb 2022 22:50:34 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 2417C9B8B1; Sun, 6 Feb 2022 22:50:31 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="nB7+QRfA"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 998CD9B8B1; Sun, 6 Feb 2022 22:50:30 +1000 (AEST) Received: from mail-ot1-f43.google.com (mail-ot1-f43.google.com [209.85.210.43]) by minnie.tuhs.org (Postfix) with ESMTPS id 1F9D99B68F for ; Sun, 6 Feb 2022 22:50:30 +1000 (AEST) Received: by mail-ot1-f43.google.com with SMTP id g15-20020a9d6b0f000000b005a062b0dc12so9063545otp.4 for ; Sun, 06 Feb 2022 04:50:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JM88cpTPpBHn2xNq8tMXtoiuXxHrVlKxYWVonXISEaI=; b=nB7+QRfAuYRDvDAA7/7Ny2QVCNezpVjzJnswuzHW0ucU6oLccqpHAb5WbbMHWyCwHN U3P8venG8GMBkSPwMuVRK1n9JnE+gJk+ZeZ+ZC1wV4kNPDPigNLNjM5mPqoJiVenVxl+ JyUXMyeDx32fmGkHVgi75IuEkpHg5Hb8FcO2CwVCoAcwUGzZAaGuTKLhTEcshzITb3D/ nCwuIA8QlAIBGKxIYnxw3hu7OVwPiUSOAQ8ug3VLKwURTbnhmvNkQnNiPX2ZqBKTzJ2W i35WPJleoJTyL1X1Ce0Zz7tG5acH4AJYxturM9fmNcSMitaBukN3Zz5M13NpZTUp/fGR Cl4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JM88cpTPpBHn2xNq8tMXtoiuXxHrVlKxYWVonXISEaI=; b=bnFD+GuDbt5eyDvfTMqIeP7+sl46zpTLllg6rp/Xb92V1KT1VyI3iiX7+hrgXdcsbP zuseYfQejhVS+2j8mgEnyLzJmYpWlax86MkL2PeHFfLr7trjQkOQg3s7EG1+JQ7QQC5T zcgK2XF+9UxTXRwKhfHX2LlsDLlJBebZj59wywqJ5pi6o+wx5kpXkNHwir0BFG6itQKE TH4zws41AxOhczwYhX/zCMlK4aHmgaWb26ScN5sW4FJ8FLpQj6BTb2sofifNyzLN5grO bPqEwbSnvzPoc3U6cNWWU4AmS6uchMQUBoNKwMH3COW3BPqhginVwzsP7uCdoJ7uEDsM zVsw== X-Gm-Message-State: AOAM533leZTjqiKYH2jqiWUnlib306SsyyT6Rz+kerQ2jFcZlbmK/W75 1+exioHuawo/lh11KjnyXlK7NVRFs8nK6kNyJamBnGAs X-Google-Smtp-Source: ABdhPJxnTkI9sDEvCM2AJBJtxcXMXubyOCKDCVNrnKiEoAiBVf36jxh5MdfobAoe9fpYXyLH014+FqJPipyoLw19Aok= X-Received: by 2002:a05:6830:1554:: with SMTP id l20mr2611298otp.225.1644151829197; Sun, 06 Feb 2022 04:50:29 -0800 (PST) MIME-Version: 1.0 References: <202202011537.211FbYSe017204@freefriends.org> <20220201155225.5A9541FB21@orac.inputplus.co.uk> <202202020747.2127lTTh005669@freefriends.org> <7C19F93B-4F21-4BB1-A064-0307D3568DB7@cfcl.com> <1nFWmo-1Gn-00@marmaro.de> <202202040234.2142YeKN3307556@darkstar.fourwinds.com> In-Reply-To: From: Dan Cross Date: Sun, 6 Feb 2022 07:49:53 -0500 Message-ID: To: Derek Fawcus Subject: Re: [COFF] Zig (was Re: more about Brian... [really Rust]) X-BeenThere: coff@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Computer Old Farts Forum List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: COFF Content-Type: multipart/mixed; boundary="===============8487982517258522063==" Errors-To: coff-bounces@minnie.tuhs.org Sender: "COFF" --===============8487982517258522063== Content-Type: multipart/alternative; boundary="000000000000bc77ec05d758ed09" --000000000000bc77ec05d758ed09 Content-Type: text/plain; charset="UTF-8" On Sat, Feb 5, 2022 at 6:18 PM Derek Fawcus < dfawcus+lists-coff@employees.org> wrote: > On Fri, Feb 04, 2022 at 06:18:09PM -0500, Dan Cross wrote: > > [TUHS to Bcc, +COFF ] > > > > This isn't exactly COFF material, but I don't know what list is more > > appropriate. > > > > [snip] > > > However, right now? I think it > > sits at a local maxima for systems languages targeting bare-metal. > > Have you played with Zig? I've only just started, but it does seem to > be trying to address a number of the issues with C ub, and safety, > while sticking closer to the 'C' space vs where I see Rust targetting > the 'C++' space. > > It doesn't have Rust's ownership / borrow checker stuff, it does seem > to have bounds checking on arrays. > To be fair, I haven't given zig an honest shake yet. That said, the borrow checker and ownership are a major part of what makes Rust really useful: it dramatically reduces the burden of manual memory management. True, it also means that some of the things one would like to do are annoying (mutually self-referential data structures can be rough; self-referential structures similarly since a move is conceptually equivalent to memcpy). My cursory scan says that Zig already has a lot over C for this space, though. e.g. the UB for multiply example you give ends up as a run time panic > (which I suspect can be caught), or one can use a different (wrapping) > multiply operator similar to in Rust. > i.e. see the below test program and its output. > Nice. - Dan C. --000000000000bc77ec05d758ed09 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sat, Feb 5, 2022 at 6:18 PM Derek Fawc= us <dfawcus+lists-= coff@employees.org> wrote:
On Fri, Feb 04, 2022 at 06:18:= 09PM -0500, Dan Cross wrote:
> [TUHS to Bcc, +COFF <coff@minnie.tuhs.org> ]
>
> This isn't exactly COFF material, but I don't know what list i= s more
> appropriate.
>

[snip]

> However, right now? I think it
> sits at a local maxima for systems languages targeting bare-metal.

Have you played with Zig?=C2=A0 I've only just started, but it does see= m to
be trying to address a number of the issues with C ub, and safety,
while sticking closer to the 'C' space vs where I see Rust targetti= ng
the 'C++' space.

It doesn't have Rust's ownership / borrow checker stuff, it does se= em
to have bounds checking on arrays.

To b= e fair, I haven't given zig an honest shake yet. That said, the borrow = checker and ownership are a major part of what makes Rust really useful: it= dramatically reduces the burden of manual memory management. True, it also= means that some of the things one would like to do are annoying (mutually = self-referential data structures can be rough; self-referential structures = similarly since a move is conceptually equivalent to memcpy).
My cursory scan says that Zig already has a lot over C for this= space, though.

e.g. the UB for multiply example you give ends up as a run time panic
(which I suspect can be caught), or one can use a different (wrapping)
multiply operator similar to in Rust.

i.e. see the below test program and its output.

Nice.

=C2=A0 =C2=A0 =C2=A0 =C2=A0 - Dan C= .

--000000000000bc77ec05d758ed09-- --===============8487982517258522063== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KQ09GRiBtYWls aW5nIGxpc3QKQ09GRkBtaW5uaWUudHVocy5vcmcKaHR0cHM6Ly9taW5uaWUudHVocy5vcmcvY2dp LWJpbi9tYWlsbWFuL2xpc3RpbmZvL2NvZmYK --===============8487982517258522063==--