public inbox for ~johnnyrichard/olang-devel@lists.sr.ht
 help / color / mirror / code / Atom feed
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
Date: Sun, 22 Sep 2024 15:46:41 +0200	[thread overview]
Message-ID: <7tcastledx6vb2bvmt4d6qshmlkdb5yy5ou3ihapyqgf2h6cs2@2fhe63kf7l4c> (raw)
In-Reply-To: <D4CA15JPNCUM.VRM2YG1CDU7T@maniero.me>

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?


  reply	other threads:[~2024-09-22 13:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-21  8:24 [PATCH olang 0/5] extend unsined integers types (u8, u16, u64) Carlos Maniero
2024-09-21  8:24 ` [PATCH olang 1/5] parser: replace type enum to an struction string id representation Carlos Maniero
2024-09-21 17:59   ` Johnny Richard
2024-09-21  8:24 ` [PATCH olang 2/5] checker: scope: populate symbol's type Carlos Maniero
2024-09-21 18:47   ` Johnny Richard
2024-09-21 21:23     ` Carlos Maniero
2024-09-22 13:46       ` Johnny Richard [this message]
2024-09-21  8:24 ` [PATCH olang 3/5] codegen: fix map simbol list type Carlos Maniero
2024-09-21 18:50   ` Johnny Richard
2024-09-21  8:25 ` [PATCH olang 4/5] codegen: calculate the variable offset based on symbol type Carlos Maniero
2024-09-21 18:56   ` Johnny Richard
2024-09-21  8:25 ` [PATCH olang 5/5] codegen: perform mov instructions based on variable type Carlos Maniero
2024-09-21  8:26   ` [olang/patches/.build.yml] build success builds.sr.ht
2024-09-21 19:17   ` [PATCH olang 5/5] codegen: perform mov instructions based on variable type Johnny Richard
2024-09-21 21:30     ` Carlos Maniero
2024-09-22 14:16 ` [PATCH olang 0/5] extend unsined integers types (u8, u16, u64) Johnny Richard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7tcastledx6vb2bvmt4d6qshmlkdb5yy5ou3ihapyqgf2h6cs2@2fhe63kf7l4c \
    --to=johnny@johnnyrichard.com \
    --cc=carlos@maniero.me \
    --cc=~johnnyrichard/olang-devel@lists.sr.ht \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.johnnyrichard.com/olang.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox