HackerTrans
TopNewTrendsCommentsPastAskShowJobs

catpolice

no profile record

comments

catpolice
·5 tahun yang lalu·discuss
This is a weird policy for reddit. But also, Jesse Singal (and Graham Linehan, linked elsewhere in this thread) are infamous in the trans community for spreading hateful disinformation and encouraging harassment brigades and then complaining about "cancel culture" whenever anyone criticizes them or they say something hateful enough to actually get banned from a platform.

We wary of "free speech advocates" who have an axe to grind against a specific set of marginalized people and view any criticism they get or moderation techniques employed against them as authoritarian.
catpolice
·5 tahun yang lalu·discuss
This is a very strange claim. Just off the top of my head, this definition of "mainstream mathematics" would exclude, for instance, Gödel's more famous theorems, a good bit of Grothendieck, some of the Bourbaki collective, and a huge amount of work from rather high profile mathematicians working today.
catpolice
·5 tahun yang lalu·discuss
I'm not usually one to poke fun at these things but my friends who study formal logic/model theory/category theory/homotopy type theory/etc. will be excited to learn that they are not in fact doing mathematics.
catpolice
·6 tahun yang lalu·discuss
Yeah, I think there are reasons why a lot of big compilers use some recursive descent variant (even a few like gcc used YACC-generated parsers for a long time and switched back to hand-written recursive descent parsers) and error message generation is a big one.

IMO there's a kind of funny progression in which parsing approach turns out to be the most appropriate depending on the scope of your project that circles back on itself:

- For pretty simple languages a hand-written recursive descent is obviously easiest

- Once your grammar is complicated enough that you start hitting precedence and ambiguity issues, or get sick of rewriting a big chunk of your parser as the grammar changes, you look into generating your parser from a BNF-like specification and end up with some variant of LL or LR

- At some point your language's grammar has mostly stabilized and you're struggling with providing good error messages or parsing performance or you've had to add one too many hacks to get around limitations of your parser generator and recursive descent starts looking good again

For my money, I tend to think that Pratt parsing/precedence climbing can extend recursive descent in a way that makes a lot of the common complaints about the complexity of dealing with operator precedence and associativity seem overstated. The trick is just that as you're building an AST, some symbols will cause you to reparent nodes that you thought you'd already placed, according to various rules. See: https://www.oilshell.org/blog/2017/03/31.html

I wrote a compiler for a vaguely C-like language by hand in javascript a while back that's intended to show how simple a hand-written parser (and code generator) can end up: https://github.com/j-s-n/WebBS

It's not that hard to statically track type information along the way - the above example requires a second pass at the AST to nail things into place and make sure all our operators are operating on the right type of thing, but a lot of that information is captured during the first parser pass or even during lexing.