22 comments

[ 13.4 ms ] story [ 905 ms ] thread
My go-to library for parsing in Python is https://github.com/pyparsing/pyparsing, a https://en.wikipedia.org/wiki/Parsing_expression_grammar -based https://en.wikipedia.org/wiki/Parser_combinator library. I generally find it much easier to get my head around parser combinators than parser generators.
As the author says:

> because the parser generator knows about all patterns you want to match in advance, it will match longer terminals before shorter—more ambiguous—terminals

If you don't mind manually ordering your choices in your alt operators, then PEG and parser combinators are OK.

Oh, and you often need to restructure your grammar to avoid left recursion.

Am I the only person who looks at Jeremy Kun's output and thinks "Nope, this guy is not actually a gifted communicator dedicated to sharing knowledge, he's just a postdoc on an annoyingly self-aggrandizing narcissism trip"?
I can't see that him being "just" a postdoc has very much to do with anything, especially when covering stuff like this which is foundational rather than cutting-edge.
The "just" was supposed to apply to the whole self-aggrandizing trip.

My point is that there are a lot of people with math PhDs, but Kun is in a small unenviable minority that is driven to engage in self-promotion via all these blog post "primers", which of very dubious pedagogical quality.

“Oh no, someone is attempting to teach, how dare they!” is what this reads like. Writing articles like this is good for the author, in terms of finding new ways to explain things, and clarify knowledge they already had. The writing style of this author in particular is quite engaging for myself and (I would assume) many others.
I enjoy his content and I have found some of his explanations novel and enlightening.

I don't know why him spending untold hours producing detailed content is a bad thing. Even if it is for self-promotion.

He's not a postdoc, though?
Presumably you understand what I'm saying ("he's 'just a vain postdoc on an ego trip'"). Of course I know what his professional status is, it's the most prominent information on his website.

It's a shame that rather than actually considering the very evident pathology here (i.e. the production of mediocre vanity blog content that serves primarily to improve the author's profile) everyone is either downvoting or nitpicking.

You might have better luck if you were to expound upon the ways in which you found the content to be mediocre and how it might be improved rather than personally attacking the author for what you perceive his motives to be.
OTOH he might just be writing for the pleasure of it and getting self-feedback from it (the more you explain something the better you understand it).
I mean, if you know what his professional status is, why say that he's a postdoc when he isn't?
people are downvoting you because that's one the saltiest opinions I've ever seen on hn. the guy is a narcissist because he writes a blog and other people post it? how does make that sense in your head? or do you think that the people that post links to his blog are shills? not to mention his pedagogy is excellent - these blog posts (which are not his primers) are meant to be introductory and cursory.
> Our hero, a mathematician, is writing notes in LaTeX and needs to convert it to a format that her blog platform accepts. She’s used to using dollar sign delimiters for math mode, but her blog requires \( \) and \[ \].

Unless our hero mathematician is writing, like, several blog posts a day, using tools like parser generators and writing your grammar in BNF and the like is WAY overkill. Just use search/replace and manually fix it up. Or, like, maybe some kind of editor macro/multiple cursor nonsense in your fully-featured text editor. If she really wants to go nuts, she should write a four-line python script to do the search/replace a tiny bit smarter. Fixing it up with some manual oversight takes like three minutes per blog post at most, it's not worth trying to automate fully.

This is one of them "killing an ant with a nuclear bomb" situations.

But killing an ant with a nuclear bomb is moar funnier! Don't stop the fun!
I think he use vim. Last paragraph. This is click bait. Hooked myself.
Sadly, he don't understand what LaTeX is and what TeX is. And $$ is a TeX macro, should not be used in LaTeX, the are much better math display environments.
Regardless, this is a very common way of writing mathematics in LaTeX, and so will need to be addressed in any solution to this problem.