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

__log using new encode/decode #5312

Closed
8 of 10 tasks
Tracked by #4769
xunilrj opened this issue Nov 29, 2023 · 0 comments
Closed
8 of 10 tasks
Tracked by #4769

__log using new encode/decode #5312

xunilrj opened this issue Nov 29, 2023 · 0 comments
Assignees
Labels
ABI Everything to do the ABI, especially the JSON representation compiler General compiler. Should eventually become more specific as the issue is triaged team:compiler Compiler Team

Comments

@xunilrj
Copy link
Contributor

xunilrj commented Nov 29, 2023

This issue is part of the new encode/decode scheme. See #4769.

To implement the new encoding for __log we need:

  • to have a standard trait that all types can implement. We are going to call it AbiEncode. This trait will live inside the core module.
  • to implement the functions and structs necessary to support the generated code. For example:
__log(1)

will be desugared into something like this:

let mut buffer = CodecBuffer::new();
encode(1, &mut buffer);
__log(buffer);

All this will live inside core::codec.
We may allow customization of the desugaring with attributes like rustc does with the panic handler.

  • to implement AbiEncode for basic types such as integers, Vec, String etc...
  • to support auto impl in the sense that if all Struct fields are AbiEncode, the compiler will auto-magically implement the obvious impl that will call encode on each field following declaration order;
  • to implement the desugaring itself for the __log intrinsics;
  • put the new encoding behing --experimental-codec
  • to implement the rust codec crate that will be used by whoever needs it (Rust SDK etc...)
@xunilrj xunilrj added compiler General compiler. Should eventually become more specific as the issue is triaged ABI Everything to do the ABI, especially the JSON representation labels Nov 29, 2023
@xunilrj xunilrj self-assigned this Nov 29, 2023
@xunilrj xunilrj closed this as completed Feb 1, 2024
@IGI-111 IGI-111 added the team:compiler Compiler Team label Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ABI Everything to do the ABI, especially the JSON representation compiler General compiler. Should eventually become more specific as the issue is triaged team:compiler Compiler Team
Projects
None yet
Development

No branches or pull requests

2 participants