You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.
Pretty printing is looking good, but we still need to fix a few issues before we can use it to normalize our source code. Here are my notes from a diff on miTLS files TLSConstants.fst and HandshakeLog.fsti.
perror __SOURCE_FILE__ __LINE__ should not be evaluated! Similarly \n etc should not be evaluated.
unnecessary empty lines are added, e.g. 9 lines above module at the start of the file.
comments need work, although I suspect this is hard to fix. Trailing comments as in 41 // or maybe 42? are moved to the line above, or below; this is confusing and often forces new line. For example
and similarly with infix (* foo *) comments.
It also seems that (**************************************************************************) is entirely dropped, and different kinds of successive comments are reordered.
Somes sequences of let..in are weird, e.g.
SIG_UNKNOWN of
((codepoint:lbytes 2{
let v = int_of_bytes codepoint
in
v <> 0x0401 /\ v <> 0x0501 /\ v <> 0x0601 /\ v <> 0x0403 /\ v <> 0x0503 /\ v <> 0x0603 /\
v <> 0x0804 /\
v <> 0x0805 /\
v <> 0x0806 /\
// /\ v <> 0x0807 /\ v <> 0x0808
v <> 0x0201 /\
v <> 0x0203 /\
v <> 0x0202 /\
v <> 0x0402 /\
v <> 0x0502 /\
v <> 0x0602 /\
v <> 0xFFFF }))
and
val parseCompressions :
b:bytes{ length b <= 254 } ->
Tot ((cms:compressions{ List.length cms = length b })) (decreases (length b))
let rec parseCompressions b =
if length b = 0
then
let cms : list compression = []
in
//libraries?
assert_norm (List.length cms = 0);
cms
else
(
let cmB, b' = split b 1ul
in
let cm = parseCompression cmB
in
let cms' = parseCompressions b'
in
let cms = cm :: cms'
in
//library?
assert_norm (List.length cms = 1 + List.length cms');
cms)
there a a few cases of double spaces in | h :: t -> let ct = certTypeBytes h in ct @| certificateTypeListBytes t
why does this force multiple newlines?
| NewSessionTicket13 _
| Finished _
->
true
Minor/subjective concrete-syntax issues:
We'd give up on aligning cases, as above (not a big deal)
Why we have both syntaxes 23z vs 23uy ?
I prefer function not to be preceded by a linebreak (see above)
I prefer to elide Tot. An ugly case is val parseCompression : b:lbytes 1 -> Tot ((cm:compression{ compressionBytes cm == b })) also with double parenthesing
I miss vertical lists for almost all ADTs, even if they fit on a line
I wish type x = would not force parentheses (a concrete syntax issue)
Not sure about spaces before/after :, {, and }
not sure private, unfold etc deserve their own line
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Pretty printing is looking good, but we still need to fix a few issues before we can use it to normalize our source code. Here are my notes from a diff on miTLS files
TLSConstants.fst
andHandshakeLog.fsti
.perror __SOURCE_FILE__ __LINE__
should not be evaluated! Similarly\n
etc should not be evaluated.unnecessary empty lines are added, e.g. 9 lines above
module
at the start of the file.comments need work, although I suspect this is hard to fix. Trailing comments as in
41 // or maybe 42?
are moved to the line above, or below; this is confusing and often forces new line. For examplebecomes
and similarly with infix
(* foo *)
comments.It also seems that
(**************************************************************************)
is entirely dropped, and different kinds of successive comments are reordered.Somes sequences of let..in are weird, e.g.
and
there a a few cases of double spaces in
| h :: t -> let ct = certTypeBytes h in ct @| certificateTypeListBytes t
why does this force multiple newlines?
Minor/subjective concrete-syntax issues:
23z
vs23uy
?function
not to be preceded by a linebreak (see above)Tot
. An ugly case isval parseCompression : b:lbytes 1 -> Tot ((cm:compression{ compressionBytes cm == b }))
also with double parenthesingtype x =
would not force parentheses (a concrete syntax issue):
,{
, and}
private
,unfold
etc deserve their own lineThe text was updated successfully, but these errors were encountered: