From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id YIK8KVc572YhEwAAqHPOHw:P1 (envelope-from ) for ; Sat, 21 Sep 2024 23:23:35 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id YIK8KVc572YhEwAAqHPOHw (envelope-from ) for ; Sat, 21 Sep 2024 23:23:35 +0200 X-Envelope-To: patches@johnnyrichard.com Authentication-Results: aspmx1.migadu.com; none Received: from mail-a.sr.ht (mail-a.sr.ht [46.23.81.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 99E0979FE3 for ; Sat, 21 Sep 2024 23:23:35 +0200 (CEST) DKIM-Signature: a=rsa-sha256; bh=P9eJF0vBdWNF/Vrp44wCqHDqnKwq2BYfdTbVvw6PVrQ=; c=simple/simple; d=lists.sr.ht; h=To:Cc:Subject:From:References:In-Reply-To:Date:List-Unsubscribe:List-Subscribe:List-Archive:List-Post:List-ID; q=dns/txt; s=20240113; t=1726953815; v=1; b=oKOir/A6FFpla9yQROTKED/op0YOW/xOMvKWolQ12hSJpVgKJdnUH6HKGF82cELh0uwSR+hB ASO6PLtRnxGAOy/eYz0Lr1wW1xpZ9rddImU14TmIpRv4WGDdLerKQCBcBDWbEnMfEx7W7hQUpc0 hQYBOoZsQbtQvQ6wEmxBxIg0MSAMboM2LjnAaeZs13n8aFzE2EIPzjnK9dZN8xYSJzmCWT7CkEd ENy8rz32VV/M2khlM+92/PjuIIoreJYfEK+5ayBH4xtllRrusz9BbrO0MQB8vKTrKed6VZOMGCr nfMSbOEca2YBtPrGDOUR1+wgAqJ5mP7TNY/8u1LD6x73g== Received: from lists.sr.ht (unknown [46.23.81.154]) by mail-a.sr.ht (Postfix) with ESMTPSA id 0269720300 for ; Sat, 21 Sep 2024 21:23:35 +0000 (UTC) Received: from weasel.tulip.relay.mailchannels.net (weasel.tulip.relay.mailchannels.net [23.83.218.247]) by mail-a.sr.ht (Postfix) with ESMTPS id 4F649202E9 for <~johnnyrichard/olang-devel@lists.sr.ht>; Sat, 21 Sep 2024 21:23:33 +0000 (UTC) X-Sender-Id: hostingeremail|x-authuser|carlos@maniero.me Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 8887D21549 for <~johnnyrichard/olang-devel@lists.sr.ht>; Sat, 21 Sep 2024 21:23:31 +0000 (UTC) Received: from uk-fast-smtpout10.hostinger.io (trex-13.trex.outbound.svc.cluster.local [100.99.103.168]) (Authenticated sender: hostingeremail) by relay.mailchannels.net (Postfix) with ESMTPA id D04DD21540 for <~johnnyrichard/olang-devel@lists.sr.ht>; Sat, 21 Sep 2024 21:23:30 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1726953811; a=rsa-sha256; cv=none; b=bALQn7QGH5F2viECEwpqe8m625XmM7uP4zRzuYLb49+RszVKc41iuDykPwfgUGKfYGA1jC mkkmKkDgl733cymJHjaoPbsWA/v6NUK58F5lxKxukUvvqW3iUTYSR8ueOIOqguz7eYtHnB JCkHonkJ8kSyD5TrLtXgdioqyZLSm1iRKwJBSgvcG1CxT4DBmGsWyyDQCyVUqo4sVmOJ71 FjNmiPnOK25jc2Gk5v4JzhmGOFs18LhPfjxPJ/r+VteLGPBcCeESIJ25QdgV703ywM5XPd X+90uP6LoB478yY/5zVayaHTpFx7VgjDKEO6q98rl1Kkz0bY+z6Qhht+yjCk9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1726953811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=L2NFygI6yzAXy2pBRTAc9HQrIZ55Ml8JNKWPjHD6kAU=; b=opsL2YBe25XVHF+1Gcgwfd+JhBjmn4YOaqzXIuFV0Qrw9A1y7hSos7u+W1hY05Ch8+lHvL rlBF15bEmsEikHEt5gVCDEKhJfrU9LA06z5j79Q9lztYyKUQrxmlOeh18Rpx3yMAY70ygE ISKr2VP1sjiM4mMWwx/PrWuwCVRIOcvlBHTs3itoiuVZzsk4UFBB3ZR1SprQO/PcrVGVXJ 1jKaxvsHbQEAee9zmKsnukzVb2QniYetsjX0WfxOcle7cTPqnDHc47IcW2Lpz5o698Klem yAN9bpjy7VbWZDE/gGMuWLPKdFTId5Gu50CfuTEZHSx6H8SYk+xQp6MtHIvp3Q== ARC-Authentication-Results: i=1; rspamd-5b46bcd97f-svd8d; auth=pass smtp.auth=hostingeremail smtp.mailfrom=carlos@maniero.me X-Sender-Id: hostingeremail|x-authuser|carlos@maniero.me X-MC-Relay: Neutral X-MailChannels-SenderId: hostingeremail|x-authuser|carlos@maniero.me X-MailChannels-Auth-Id: hostingeremail X-Glossy-Hook: 62aa86287d481375_1726953811339_997386297 X-MC-Loop-Signature: 1726953811339:3605632437 X-MC-Ingress-Time: 1726953811339 Received: from uk-fast-smtpout10.hostinger.io (uk-fast-smtpout10.hostinger.io [145.14.155.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.99.103.168 (trex/7.0.2); Sat, 21 Sep 2024 21:23:31 +0000 Mime-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maniero.me; s=hostingermail1; t=1726953809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=L2NFygI6yzAXy2pBRTAc9HQrIZ55Ml8JNKWPjHD6kAU=; b=OyVfqq4hWBNGKXfAqEtB4JrTcc8SiCyOyjO5D8Fs5Bnpk945ONGofYXfTVGh0kKoavsA6C Yzyvb62gQUZ0wCQ+n6mnoMKmeYUYXpV+IoZjw1mC5RO3vLFs5o3onK2v8sedQ0PfXhvHwm vHcy5VIj/2QaUhNgmm6ZKBaqN+DlsXLDXYvtfK2oqLsJKXH+YUDf0ejf7zjOJXcPdGFWNC zDkJBelNDR1arKDTAl3jRpzRtvo/LiV5C9AxHRTF5Qetf1DKwrRf7cbzcZIRzspGukbOOo /YxS2E4MOC41xNyunetf6pNWPuXYjvNRF6V4vf3s4S+PF2vaxf5LzLqIS3+zlA== Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Message-Id: To: "Johnny Richard" Cc: <~johnnyrichard/olang-devel@lists.sr.ht> Subject: Re: [PATCH olang 2/5] checker: scope: populate symbol's type From: "Carlos Maniero" X-Mailer: aerc 0.15.2-211-g37d5fc691aff References: <20240921082437.396691-1-carlos@maniero.me> <20240921082437.396691-3-carlos@maniero.me> In-Reply-To: Date: Sat, 21 Sep 2024 21:23:28 +0000 (UTC) X-CM-Analysis: v=2.4 cv=TcnEtgQh c=1 sm=1 tr=0 ts=66ef3951 a=WwxFCuf3mf1fs3oSi6/dng==:117 a=WwxFCuf3mf1fs3oSi6/dng==:17 a=IkcTkHD0fZMA:10 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=rlyyDqDwMv0S2kLiJF8A:9 a=QEXdDO2ut3YA:10 a=BXDaF_L80NY05PYiAFlV:22 X-CM-Envelope: MS4xfDi3hdLBhuYrRAapG+xj1kyI276T7YJ0Z+FdJKLDiecWdG606uJCiqnfduMbQwUKc5+kVHySzsAnjJFrTigaBuVDspwzfNGzQwWESpo4YE+WZyK7zOoD dP8C3dldP7SCD+xGJ9OWo2z639DzW88kCNPi10K+9EixUkbDFyCfpi/4aE/N9NVnj2kz0bk5VglA0+VTgoH6AYPAx7MwOeTULSg4nCaMTdDoAcpNNK7O2bwv O5u5ustg0bPWixHGWXqWPg== X-AuthUser: carlos@maniero.me List-Unsubscribe: List-Subscribe: List-Archive: Archived-At: List-Post: List-ID: ~johnnyrichard/olang-devel <~johnnyrichard/olang-devel.lists.sr.ht> Sender: ~johnnyrichard/olang-devel <~johnnyrichard/olang-devel@lists.sr.ht> X-Migadu-Flow: FLOW_IN X-Migadu-Country: NL X-Migadu-Queue-Id: 99E0979FE3 X-Migadu-Scanner: mx11.migadu.com X-Spam-Score: -4.00 X-Migadu-Spam-Score: -4.00 X-TUID: KmT7UoUnikxr On Sat Sep 21, 2024 at 3:47 PM -03, Johnny Richard wrote: > I also agree. I would change a little bit here and make the checker > calculate the size in bytes and add it to the symbol. > Let's include the size in bytes for the symbol. I believe this will > enhance our symbol and make it easier to verify in the next steps I originally did this way because we may have types that has platform-dependent sizes such as *pointers*. But we could address that later than. > We are traversing the tree twice to populate_scope. I think the > populate scope can set the type on scope at this moment. > If we set extra data to symbol's type we don't need to traverse the ast > again here. Makes sense! > Could you please enlighten the motivation behind setting extra data to > types on AST nodes? I don't know if you have anything different in mind, but the alternative I see is to be to create a type representation for the AST and another for the scope, which I also think it is fine. But since I was using the same representation, I opted to first fulfil the *type_t* on the AST and after to use the same information on the scope, so it is consistent and you can trust in both informations, the AST and the scope. I will change the AST to store the type as *string_view* and keep the *type_t* on the symbol only. WDYT? > I don't see other kinds in the future. What do you think about adding a > boolean property named "is_primitive"? Pointers can be a type kind.