bottom-software-foundation / spec

A spec for the bottom encoding format.
MIT License
100 stars 1 forks source link

Expect separator after null byte during encoding (v0.2) #6

Open SebbyLaw opened 3 years ago

SebbyLaw commented 3 years ago

Currently the spec does not have the separator occuring after null bytes encoded to bottom. Below is a list of implementations that must be updated to follow this encoding change. Decoding should not need to be changed, as long as it already followed the spec.

Implementation Encode Compliant Decode Compliant
spec (README)
  • - [ ]
  • - [ ]
bottom-as
  • - [x]
  • - [x]
bottom-bash
  • - [x]
  • - [x]
bottom-c
  • - [x]
  • - [x]
bottom-d
  • - [x]
  • - [ ]
bottom-dart
  • - [x]
  • - [ ]
bottom-dotnet
  • - [x]
  • - [ ]
bottom-ex
  • - [x]
  • - [ ]
bottom-go
  • - [ ]
  • - [ ]
bottom-go-bindings
  • - [ ]
  • - [ ]
bottom-hs
  • - [x]
  • - [x]
bottom-hy
  • - [ ]
  • - [ ]
bottom-java
  • - [x]
  • - [x]
bottom-lua
  • - [x]
  • - [x]
bottom-matlab
  • - [ ]
  • - [ ]
bottom-php
  • - [ ]
  • - [ ]
bottom-py
  • - [ ]
  • - [ ]
bottom-py-bindings
  • - [ ]
  • - [ ]
bottom-rb
  • - [ ]
  • - [ ]
bottom-rs
  • - [x]
  • - [x]
bottom-swift
  • - [x]
  • - [ ]
bottom-web
  • - [ ]
  • - [ ]
bottom-webextension
  • - [ ]
  • - [ ]
bottom-wl
  • - [x]
  • - [ ]
bottom-workers
  • - [ ]
  • - [ ]
bottom-x86
  • - [x]
  • - [x]
oneline-bottom-py
  • - [x]
  • - [ ]
power-bottom
  • - [ ]
  • - [x]

Also see: #2, bottom-software-foundation/bottom-rs#8, bottom-software-foundation/bottom-go#1

nihaals commented 3 years ago

Maybe this should be changed into a table just so both encode and decode can be validated? Null byte was something I saw was ignored in a lot of implementations so it's possible some have a compliant encode but not a compliant decode.

nihaals commented 3 years ago

Here's a partial table:

Implementation Encode compliant Decode compliant
bottom-bash
  • - [ ] ​
  • - [ ] ​
bottom-c
  • - [ ] ​
  • - [ ] ​

Source

| Implementation | Encode compliant | Decode compliant |
|---|---|---|
| bottom-bash | <ul><li>- [ ] ​</li></ul> | <ul><li>- [ ] ​</li></ul> |
| bottom-c | <ul><li>- [ ] ​</li></ul> | <ul><li>- [ ] ​</li></ul> |
Note there are zero width spaces
nihaals commented 3 years ago

It might also be worth adding the version tested That also means you can differentiate between implementations that have been verified to be noncompliant and implementations that haven't been checked yet

Without a standard testing suite it's hard to get automated testing on all of them, so it could also be possible that an implementation changes from being complaint to noncompliant, so logging versions could help with being clear about what was tested (although tracking changes after an implementation has become completely compliant is probably out of scope for this issue)

SebbyLaw commented 3 years ago

I've added the table. Decode is assumed not compliant until I review it or someone reviews it for me.

It might also be worth adding the version tested That also means you can differentiate between implementations that have been verified to be noncompliant and implementations that haven't been checked yet

Without a standard testing suite it's hard to get automated testing on all of them, so it could also be possible that an implementation changes from being complaint to noncompliant, so logging versions could help with being clear about what was tested (although tracking changes after an implementation has become completely compliant is probably out of scope for this issue)

Out of the scope of this issue imo.

elldritch commented 3 years ago

FYI, null byte encoding works fine for bottom-hs, which has always encoded separators after null bytes.

For evidence:

a standard testing suite

You could build one of these pretty easily by adapting the bottom-hs test suite to accept adapters for other CLIs. It uses both the bottom-rs tests as well as randomized property-based testing via QuickCheck.

SebbyLaw commented 3 years ago

Thanks! I've updated the table to match