Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to implement AST nodes #2

Open
AniketKumar2500 opened this issue Apr 13, 2024 · 9 comments
Open

How to implement AST nodes #2

AniketKumar2500 opened this issue Apr 13, 2024 · 9 comments
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@AniketKumar2500
Copy link
Member

There are two ways we can implement our ast nodes

  1. Is to compile it down to machine code but the whole code should be written in C/C++
  2. Using a JIT
    Which one should we go with.
@AniketKumar2500 AniketKumar2500 added enhancement New feature or request question Further information is requested labels Apr 13, 2024
@gekkowrld
Copy link

I think there are some backend compilers for python, we just need to write the IR for them

@AniketKumar2500
Copy link
Member Author

Those IR or bytecodes are interpreted by Python Virtual Machine.

@AniketKumar2500
Copy link
Member Author

@gekkowrld or can we make our own codegen which generates asm code for execution?

@gekkowrld
Copy link

That is a lot of work, support for different architecture and manual optimization is pretty time consuming. Even when writing for only x86_64 architecture it would also be significant. Have you looked at the existing backend compilers yet that can do the job?

@AniketKumar2500
Copy link
Member Author

There is a jit compiler with numba and llvm

@gekkowrld
Copy link

I'll look at those and try to write a test version.

@gekkowrld
Copy link

@AniketKumar2500 I found llvmlite but I need that the tokenizer be a bit 'better' as I'm currently working on something else. After the tokenizer I'll write the backend part.

@AniketKumar2500
Copy link
Member Author

AniketKumar2500 commented May 4, 2024

@gekkowrld I am working on a different kind and finding ways for efficient codegen i found a way which many compiler already do that is that they convert their code into C so whats you're ideas about it?

@gekkowrld
Copy link

not bad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants