From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <lists@sr.ht>
Received: from mp1.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 oC4/BrAf8GYzAQAA62LTzQ:P1
	(envelope-from <lists@sr.ht>)
	for <patches@johnnyrichard.com>; Sun, 22 Sep 2024 15:46:24 +0200
Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp1.migadu.com with LMTPS
	id oC4/BrAf8GYzAQAA62LTzQ
	(envelope-from <lists@sr.ht>)
	for <patches@johnnyrichard.com>; Sun, 22 Sep 2024 15:46:24 +0200
X-Envelope-To: patches@johnnyrichard.com
Authentication-Results: aspmx1.migadu.com;
	dkim=pass header.d=lists.sr.ht header.s=20240113 header.b=PgsZI4ng;
	dkim=pass header.d=johnnyrichard.com header.s=key1 header.b=laWaGkIs;
	spf=pass (aspmx1.migadu.com: domain of lists@sr.ht designates 46.23.81.152 as permitted sender) smtp.mailfrom=lists@sr.ht;
	dmarc=pass (policy=quarantine) header.from=johnnyrichard.com
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed;
	d=johnnyrichard.com; s=key1; t=1727012783;
	h=from:from:sender:sender:reply-to:subject:subject:date:date:
	 message-id:message-id:to:to:cc:cc:mime-version:mime-version:
	 content-type:content-type:in-reply-to:in-reply-to:
	 references:references:list-id:list-unsubscribe:list-subscribe:
	 list-post:dkim-signature; bh=MOmfgarfyx8HspnToReeM8fOR4JJCYFEN7McZyEjWDU=;
	b=bChri4qpxBm9CA5x8H5/epNqUyL413HE1xRnZZeCp2AQ4KFqqaxuwhAQXpu/log7zJN1sr
	Usi+mQ3PTUcnbF80tTbbMoW1L1EnE6spglc7MvynxET4q/q7r8mAZc8/9Oj75zYLA+gcl5
	VSAmrF7roSINrXZ0mSkn2aBYRO34xIPE26QZDPpcgtKuetoZACRZyRGPdEPKYXwLGw1fHw
	/SfpcmP9fZ3XQQGPHAjEAnt9i2j9bK/beTjqhMcI0F7aqW2mCwWoT2hC3UjpB+BW7AHEXR
	iMMnyRnPUG5IZimABB4jXgQ/2LlD7TsHb6Po2cXvleBls0EU/xSwLr4lOAlSbA==
ARC-Authentication-Results: i=1;
	aspmx1.migadu.com;
	dkim=pass header.d=lists.sr.ht header.s=20240113 header.b=PgsZI4ng;
	dkim=pass header.d=johnnyrichard.com header.s=key1 header.b=laWaGkIs;
	spf=pass (aspmx1.migadu.com: domain of lists@sr.ht designates 46.23.81.152 as permitted sender) smtp.mailfrom=lists@sr.ht;
	dmarc=pass (policy=quarantine) header.from=johnnyrichard.com
ARC-Seal: i=1; s=key1; d=johnnyrichard.com; t=1727012783; a=rsa-sha256;
	cv=none;
	b=MmsgWJLkvoorKlSmwvgn2bXnX/L3dmz1Cko2+CHbbndXdhkfIZ74PtO6pcKkcwaprAoc3P
	/1fR7jAxxWi22j5pxutKP2pRv3Jg0bzb4GQu5HHoLJkMN1h8NXgFQzboXoDC5ihqKNM7SZ
	r4lD9Qqq2qJaRSTwl2Jx7y1l1iu4YEF3UeroCsDkmOrKeUroUGLp4xGrj++oXv6J1FmOV0
	4FVtxwT76tOJVGMCiYzBdWkws91k82NOXd5GmGCbnWjsoHXMiSqvM+aaYZdRQibQEN8Urc
	sBz9FQ083FLaZXFQeC1Db8Q9R3ZV8r2JbarnNssIfQ20+WhlvPBSw+hg8uGMxQ==
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 A4B556BDEE
	for <patches@johnnyrichard.com>; Sun, 22 Sep 2024 15:46:23 +0200 (CEST)
DKIM-Signature: a=rsa-sha256; bh=zfNaB9bFfuVeQ4ceDB2dEGuZSb8gE4vPP+9FJ9+ayX4=;
 c=simple/simple; d=lists.sr.ht;
 h=Date:From:To:Cc:Subject:References:In-Reply-To:List-Unsubscribe:List-Subscribe:List-Archive:List-Post:List-ID;
 q=dns/txt; s=20240113; t=1727012782; v=1;
 b=PgsZI4ngHC0tQXIQYCOiKz6r2ns1Tk5i7ajPmTvdHwl4rxS9dIQZit5RJn9u4ZsIt9mNwNuo
 dzcshlXYWbKo0+R6Cp5ftGVvzuvZwQdR5/z5CLibf1FcQIYnMRV/63dM4j86l9ZeGEPaaVRLlAO
 C6edlIxIZ1QOs4lWXrtmJCjY/D1GPZ7oCIG8tHJKRAmzQutpYx2wSiGZhOgq2pi+7g0RW22V1SQ
 zP5W1CzWRMhAU/x/7HHtZpq8CRsPj03VYbYR6iZqbkQJK1ctdHMhYswHjMFBU0jvUWgxnAvB+B1
 N+o0zKfAblVab0VgMnL7UFtrnTHuD6lpnDRS4NVAhmdiQ==
Received: from lists.sr.ht (unknown [46.23.81.154])
	by mail-a.sr.ht (Postfix) with ESMTPSA id BA9732023D
	for <patches@johnnyrichard.com>; Sun, 22 Sep 2024 13:46:22 +0000 (UTC)
Received: from out-174.mta1.migadu.com (out-174.mta1.migadu.com [95.215.58.174])
	by mail-a.sr.ht (Postfix) with ESMTPS id EE50C2011A
	for <~johnnyrichard/olang-devel@lists.sr.ht>; Sun, 22 Sep 2024 13:46:21 +0000 (UTC)
Date: Sun, 22 Sep 2024 15:46:41 +0200
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=johnnyrichard.com;
	s=key1; t=1727012781;
	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:
	 in-reply-to:in-reply-to:references:references;
	bh=MOmfgarfyx8HspnToReeM8fOR4JJCYFEN7McZyEjWDU=;
	b=laWaGkIsxcxZx+HK91N2WYP4A6LBJqKGI0aYy3pvyatF7a3vBuXTslvG1aFmr9G1tqPPdz
	AMBz5UJUHVLACYgzg8RGaT+iWamcHoEnYgITuzG7sK+wTXf4yv7/qYEawbIy1NnLmNdG4h
	crimTS8Lca8Mw4fu4QRC7HL6k9sZen4UrAAW5KxN8Jkam73Sh5gDJyecwcsLDpPBJY/kHd
	VHP1Qc3ekhnfqgdGw78P+QQyUeJ6wu9OMDrlInmi2aRLduQ4KwALifV0FEqaRxr90RArQl
	RsG58HIJ550D+uQvgBXL1k/TNTv/0rMt43eV1Ahs9EKHwCZnkhXOGgheQzcnBA==
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Johnny Richard <johnny@johnnyrichard.com>
To: Carlos Maniero <carlos@maniero.me>
Cc: ~johnnyrichard/olang-devel@lists.sr.ht
Subject: Re: [PATCH olang 2/5] checker: scope: populate symbol's type
Message-ID: <7tcastledx6vb2bvmt4d6qshmlkdb5yy5ou3ihapyqgf2h6cs2@2fhe63kf7l4c>
References: <20240921082437.396691-1-carlos@maniero.me>
 <20240921082437.396691-3-carlos@maniero.me>
 <yp4wjlsbosy4qjmlwundl6zudonhp5sbe3jc4y6khztvpych5a@ttmfupdsc4qf>
 <D4CA15JPNCUM.VRM2YG1CDU7T@maniero.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <D4CA15JPNCUM.VRM2YG1CDU7T@maniero.me>
List-Unsubscribe: <mailto:~johnnyrichard/olang-devel+unsubscribe@lists.sr.ht?subject=unsubscribe>
List-Subscribe: <mailto:~johnnyrichard/olang-devel+subscribe@lists.sr.ht?subject=subscribe>
List-Archive: <https://lists.sr.ht/~johnnyrichard/olang-devel>
Archived-At: <https://lists.sr.ht/~johnnyrichard/olang-devel/%3C7tcastledx6vb2bvmt4d6qshmlkdb5yy5ou3ihapyqgf2h6cs2%402fhe63kf7l4c%3E>
List-Post: <mailto:~johnnyrichard/olang-devel@lists.sr.ht>
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: A4B556BDEE
X-Migadu-Scanner: mx11.migadu.com
X-Spam-Score: -6.90
X-Migadu-Spam-Score: -6.90
X-TUID: SwSTpkx9CZ05

On Sat, Sep 21, 2024 at 09:23:28PM GMT, Carlos Maniero wrote:
> 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.

Looks good to me.  We are going to understand better when we need them.

> > 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.

I think this is a good idea, probably they might hold different info for
different proposes.

> 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 am super okay with that.

> > 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.

what happens to a primitive pointer? which kind it would be?