←back to thread

Parse, Don't Validate (2019)

(lexi-lambda.github.io)
389 points melse | 1 comments | | HN request time: 0s | source
Show context
ukj ◴[] No.27639995[source]
Software Engineers: Parse, don't validate.

Mathematicians: Parsing is validation

https://gallais.github.io/pdf/draft_sigbovik21.pdf

replies(3): >>27640078 #>>27640121 #>>27640235 #
pwdisswordfish8 ◴[] No.27640078[source]
The point being, the converse of ‘parsing is validation’ is not true.
replies(2): >>27640111 #>>27641094 #
ukj ◴[] No.27640111[source]
The word "is" implies an isomorphism.

If you see it differently you are implicitly assuming a non-formalist perspective on what "validation" means. Tell us about it.

replies(4): >>27640132 #>>27640147 #>>27640155 #>>27640177 #
pwdisswordfish8 ◴[] No.27640177[source]
‘A square is a rectangle’ means squares are isomorphic to rectangles?
replies(1): >>27640269 #
ukj ◴[] No.27640269[source]
You are tripping up over polymorphism. "Is" means many things - which meaning you infer is precisely parsing!

"A square is a rectangle" means "A square is a TYPE of rectangle" (at least, that is what I am parsing it as).

"Parsing is Validation" means Parsing is isomorphic to Validation.

How do I know? Because that is how I want you to parse it.

replies(2): >>27640298 #>>27641887 #
pwdisswordfish8 ◴[] No.27640298[source]
> 'When I use a word,' Humpty Dumpty said in rather a scornful tone, 'it means just what I choose it to mean — neither more nor less.'
replies(1): >>27640310 #
1. ukj ◴[] No.27640310[source]
+∞

parse verb. resolve (a sentence) into its component parts and describe their syntactic roles.

In computer science what we do is precisely syntax analysis. Determining the meaning of operators.

Mathematicians have the exact same problem with respect to the equality operator.

https://ncatlab.org/nlab/show/equality#DifferentKinds