aantron / markup.ml

Error-recovering streaming HTML5 and XML parsers
http://aantron.github.io/markup.ml
MIT License
146 stars 16 forks source link

Introduce continuations, e.g. by linking to a good explanation #23

Open aantron opened 7 years ago

aantron commented 7 years ago

Markup.ml is written in continuation-passing style. For the vast majority of programmers on Earth, this means "using callbacks." So, I suggest renaming 'a cont to 'a callback to make the code ever so slightly more comprehensible to more people.

Good suggestions for what to rename 'a cps to are also welcome.

dbuenzli commented 7 years ago

I don't know how you use the type in question but note that continuation is much more precise than callback. I personally would be more confused by 'a callback than with 'a cont to denote a continuation.

It is certainly a noble goal to try to make things more comprehensible to more people but don't do it at the expense of preciseness and conceptual clarity. Besides it's also certainly good if these "more" people try to learn about new concepts they might initially not understand, it won't be lost time for them, it might turn them into better programmers.

aantron commented 7 years ago

Ok, have to agree with this. I'll turn this into an issue about using Markup.ml to teach continuations a bit, provide some good links, rather than eliminating the terminology (which is indeed correct).