←back to thread

Parse, Don't Validate (2019)

(lexi-lambda.github.io)
389 points melse | 7 comments | | HN request time: 1.498s | source | bottom
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 #
1. pwdisswordfish8 ◴[] No.27640177[source]
‘A square is a rectangle’ means squares are isomorphic to rectangles?
replies(1): >>27640269 #
2. 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 #
3. 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 #
4. ukj ◴[] No.27640310{3}[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

5. jhgb ◴[] No.27641887[source]
> "A square is a rectangle" means "A square is a TYPE of rectangle" (at least, that is what I am parsing it as).

In that case your former statement that 'The word "is" implies an isomorphism' seems to be wrong.

replies(1): >>27645179 #
6. ukj ◴[] No.27645179{3}[source]
It may be wrong in your model/interpretation of my words, but it's not wrong in my interpretation of my words.
replies(1): >>27655456 #
7. jhgb ◴[] No.27655456{4}[source]
In what interpretation is it consistent for 'A square is a rectangle" means "A square is a TYPE of rectangle"' and 'The word "is" implies an isomorphism' to be simultaneously true? No matter how I cut it, the latter seems to prevent the former to me.