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=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 14475 invoked from network); 8 Jun 2020 00:25:38 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 8 Jun 2020 00:25:38 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 238119CA63; Mon, 8 Jun 2020 10:25:34 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id EC8E49C5F8; Mon, 8 Jun 2020 10:24:53 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="TvfENU8q"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id C82359C5F8; Mon, 8 Jun 2020 10:24:50 +1000 (AEST) Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) by minnie.tuhs.org (Postfix) with ESMTPS id 475729C5E5 for ; Mon, 8 Jun 2020 10:24:50 +1000 (AEST) Received: by mail-oi1-f182.google.com with SMTP id s21so13745170oic.9 for ; Sun, 07 Jun 2020 17:24:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IpqfyRthAYqCBRO357u/4BWk8p87/V0o+2O65Rxg+ZE=; b=TvfENU8qD4r3FDFpnsEmkZyZ0Kcf3Dn3lD3FzAC33nne0Q6mGsyBG5aC69ZeQ5UFpP qDMuc/WAljFmNCtklcrUXl3Ws3MeaLrTftId5K3qkfoKi484eeo4eOdXAppnkzDmt9SM KGD9ZywKicijfLCpUMooK8pP7H2lCv/+UT1NiRVyTghWtNKvrddeN7qHuDHVtI68e7ZC 6vCCMBF8WkuH6O9jQcESpFbDY+Pt0FtWedeQ4SqjngIX2AeVcQZVLFmlx4hCMaweTfrM cOGqjQYGd1pvfkiDYsHsLo2KpkJ+Hrr93b9nEkmgKaLTxKi1W5pbHE2/8BCWYQT39/jI piew== 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=IpqfyRthAYqCBRO357u/4BWk8p87/V0o+2O65Rxg+ZE=; b=lvAo1Pxk8Ltnz/f0NCvt9O+mVxV3TvWtBthLjiWwYVQdedTvs1q5OOKRMJIwX/v8LK TCjNgBb41mqhCScUXlrEQBSQYeURqsN8/Cu/so6qLmEDmsakPiIIqTr/zg87rFd9RcYS SekjFsY0WKYpOH5CO+H3krVhrLahTV9BFjZiyS3mehI9iXWGln5o3rVmlOJLotKkPRWD mExsH3HjruxYV/KxYdKg/gsdbIIR5lbN8ovczo7gw+LfK1nOc0iCBA7+UQKmTp38D2pR pzp5a5wP0jmLJnDyKbNQGlrjOyhBbFjFyAX4l3njP6SvDcfFE3sejFjcLdxYD2tI637+ EETA== X-Gm-Message-State: AOAM532i1o43jARQ4tX4RsmBpcJzM3u8IglJ5IlAjnarqaani9nopumH 0lJZOFNLxOGo7/OFbH66Eo3Jw1QMsmPfQm1UlghtbG0F X-Google-Smtp-Source: ABdhPJyy2RYeI11rw2dFfaMqBg1No0YB3yvANIAwA4/RpU53HtPqMbmXmn1DzbYoIVC0AdsSI6vai36W/1MHMAXeoiY= X-Received: by 2002:aca:7592:: with SMTP id q140mr8826883oic.66.1591575889522; Sun, 07 Jun 2020 17:24:49 -0700 (PDT) MIME-Version: 1.0 References: <202006072256.057Muo1h090326@elf.torek.net> In-Reply-To: <202006072256.057Muo1h090326@elf.torek.net> From: Bram Wyllie Date: Sun, 7 Jun 2020 21:24:38 -0300 Message-ID: To: Chris Torek Content-Type: multipart/alternative; boundary="0000000000008735ac05a787a3d2" Subject: Re: [TUHS] History of popularity of C X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: TUHS main list Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --0000000000008735ac05a787a3d2 Content-Type: text/plain; charset="UTF-8" Dependent types aren't needed for sum types though, which is what you'd normally use for an array that carries its size, correct? On Sun, Jun 7, 2020 at 7:57 PM Chris Torek wrote: > >Safe Rust code is data race free, but not free of race > >conditions, let alone thread safe in all ways. > > Er, yes. I mainly wanted to contrast to Go, where you look for > race conditions by building with a flag that enables runtime > checking. This can only detect races that actually occur, > and if there are paths that would still have races that didn't > occur on your test run, well... > > >>[rust array limitations] > > >I'm afraid this is incorrect. Rust arrays are indexed by a > >`usize`, which is basically whatever `size_t` would be in C. Rust > >arrays in general can be essentially arbitrarily large (up to > >limitations imposed by the target machine, of course). > > >However, Rust does not support dependent types, most certainly > >not for arrays. In other words, an array's size is considered > >part of its type and so when specializing traits on arrays, one > >must do so explicitly for each supported array size. For > >practical reasons such implementations are often limited to a > >relatively small number of distinct sizes; 32 is a believable > >number. Perhaps that's what you're thinking of? > > Ah, yes, that was it. (As I said, I never really had time to > do anything "real" in Rust.) > > Go's slices are nice to use, but slices (and maps, for that matter) > trip people up because they are headers that point to shared > spaces. > > Chris > --0000000000008735ac05a787a3d2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Dependent types aren't needed for sum types though, wh= ich is what you'd normally use for an array that carries its size, corr= ect?

On Sun, Jun 7, 2020 at 7:57 PM Chris Torek <torek@torek.net> wrote:
>Saf= e Rust code is data race free, but not free of race
>conditions, let alone thread safe in all ways.

Er, yes.=C2=A0 I mainly wanted to contrast to Go, where you look for
race conditions by building with a flag that enables runtime
checking.=C2=A0 This can only detect races that actually occur,
and if there are paths that would still have races that didn't
occur on your test run, well...

>>[rust array limitations]

>I'm afraid this is incorrect.=C2=A0 Rust arrays are indexed by a >`usize`, which is basically whatever `size_t` would be in C. Rust
>arrays in general can be essentially arbitrarily large (up to
>limitations imposed by the target machine, of course).

>However, Rust does not support dependent types, most certainly
>not for arrays.=C2=A0 In other words, an array's size is considered=
>part of its type and so when specializing traits on arrays, one
>must do so explicitly for each supported array size.=C2=A0 For
>practical reasons such implementations are often limited to a
>relatively small number of distinct sizes; 32 is a believable
>number.=C2=A0 Perhaps that's what you're thinking of?

Ah, yes, that was it.=C2=A0 (As I said, I never really had time to
do anything "real" in Rust.)

Go's slices are nice to use, but slices (and maps, for that matter)
trip people up because they are headers that point to shared
spaces.

Chris
--0000000000008735ac05a787a3d2--