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

SATS: Flatten AlgebraicType (Nix BuiltinType) #379

Closed
wants to merge 2 commits into from

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Oct 6, 2023

Description of Changes

Flattens BuiltinType into AlgebraicType.
See note below on BSATN ABI breakage.

API and ABI

  • This is a breaking change to the module ABI
  • This is a breaking change to the module API
  • This is a breaking change to the ClientAPI
  • This is a breaking change to the SDK API

If the API is breaking, please state below what will break

BSATN does not change for AlgebraicValue but it does for AlgebraicType as this includes tags for each variant so the indirection of BuiltinType was present in the codec but is no longer.

@Centril Centril force-pushed the centril/flatten-algebraic branch 4 times, most recently from 940e117 to 90ec74f Compare October 7, 2023 13:41
@Centril Centril marked this pull request as ready for review October 7, 2023 13:43
@Centril Centril changed the title Centril/flatten algebraic Sats: Flatten AlgebraicType/Value (Nix BuiltinType/Value) Oct 7, 2023
@Centril Centril changed the title Sats: Flatten AlgebraicType/Value (Nix BuiltinType/Value) SATS: Flatten AlgebraicType/Value (Nix BuiltinType/Value) Oct 7, 2023
@Centril Centril force-pushed the centril/flatten-algebraic branch 7 times, most recently from 8617bc0 to b68b081 Compare October 9, 2023 07:58
@Centril Centril force-pushed the centril/flatten-algebraic branch 7 times, most recently from 9943679 to 17640ac Compare October 9, 2023 17:00
@jdetter jdetter self-requested a review October 9, 2023 18:58
@Centril Centril force-pushed the centril/flatten-algebraic branch 2 times, most recently from 5a6cc7c to 9399995 Compare October 10, 2023 14:04
@Centril Centril changed the title SATS: Flatten AlgebraicType/Value (Nix BuiltinType/Value) SATS: Flatten AlgebraicType (Nix BuiltinType) Oct 10, 2023
@Centril Centril force-pushed the centril/flatten-algebraic branch 2 times, most recently from 9a27676 to d8faed1 Compare October 10, 2023 18:42
@Centril Centril mentioned this pull request Oct 10, 2023
4 tasks
@Centril Centril force-pushed the centril/flatten-algebraic branch from d8faed1 to 21c9ed5 Compare October 11, 2023 08:03
@Centril Centril force-pushed the centril/flatten-algebraic branch 2 times, most recently from a6cc5f8 to 09bfc68 Compare October 11, 2023 20:34
@Centril Centril force-pushed the centril/flatten-algebraic branch 3 times, most recently from e5b42ac to 8105110 Compare October 26, 2023 09:34
Copy link
Contributor

@mamcx mamcx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Note: We don't have a way to assert the changes in the bindings are correct

@@ -342,7 +394,7 @@ mod tests {
fn algebraic_type() {
let algebraic_type = AlgebraicType::meta_type();
assert_eq!(
"(sum: (variants: Array<(name: (some: String | none: ()), algebraic_type: &0)>) | product: (elements: Array<(name: (some: String | none: ()), algebraic_type: &0)>) | builtin: (bool: () | i8: () | u8: () | i16: () | u16: () | i32: () | u32: () | i64: () | u64: () | i128: () | u128: () | f32: () | f64: () | string: () | array: &0 | map: (key_ty: &0, ty: &0)) | ref: U32)",
"(ref: U32 | sum: (variants: Array<(name: (some: String | none: ()), algebraic_type: &0)>) | product: (elements: Array<(name: (some: String | none: ()), algebraic_type: &0)>) | array: &0 | map: (key_ty: &0, ty: &0) | bool: () | i8: () | u8: () | i16: () | u16: () | i32: () | u32: () | i64: () | u64: () | i128: () | u128: () | f32: () | f64: () | string: ())",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Because the type is structural is not the order significant?

@kulakowski kulakowski added the abi-break A PR that makes an ABI breaking change label Nov 13, 2023
@cloutiertyler
Copy link
Contributor

Closing in favor of: #1559

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
abi-break A PR that makes an ABI breaking change release-1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants