How Desmos uses Pratt Parsers (2018)
engineering.desmos.com
engineering.desmos.com
I’m so curious about how their graphing calculator and their geometric construction tools work. I’ve spent marginal amounts of time researching their stack, and it appears to be custom software. If anyone’s familiar with writing about how these systems are built (particularly the display side of things), I’d appreciate some links or titles!
Sources, under the GPLv3 (code) or Creative Commons (documentation): https://github.com/orgs/geogebra/repositories?type=all
PS Hi!
https://github.com/dheera/fooplot
git clone https://github.com/dheera/fooplot
cd fooplot
your-favorite-browser sample.html
It should support mouse panning and scroll wheel zooming.John Gage (who was on Richard Nixon's enemy list) is the good troublemaker who thought of turning it 45 degrees like a diamond. He was Sun's Science Officer.
> John Gage (who was on Richard Nixon's enemy list) is the good troublemaker who thought of turning it 45 degrees like a diamond. He was Sun's Science Officer.
Just to have it said, without taking anything away from the admiration of the logo, a square that is rotated 45 degrees is still a square.
PostScript Sun Logo by Bill Meine:
https://donhopkins.com/home/archive/news-tape/pictures/sun-l...
PostScript Sun Logo by Craig Leres:
https://donhopkins.com/home/archive/news-tape/pictures/sun-l...
Sure, I would have been very surprised at the thought that you weren't. I was just responding to the statement that the logo was "originally square", which seemed like an odd way to describe something that is still (more or less) square (except as the set-up for a Mitch Hedberg joke). But, of course, it is not wrong.
> PostScript Sun Logo by Bill Meine:
> PostScript Sun Logo by Craig Leres:
I don't have a native PS viewer, but, when I ran those through PS2PDF, both were in the same orientation, only one had solid black characters and one had white characters with black outlines. Is that a problem with my PDF distiller? (But now I see that those are not attributed to Pratt and Gage, as in your original post, so maybe you are just showing later variations on the theme.)
Slowlaris: so bad I left the company.
That would be Dijkstra's "shunting yard" algorithm.
https://en.wikipedia.org/wiki/Shunting_yard_algorithm
https://stackoverflow.com/a/13637731/1250772
Shunting Yard in TXR Lisp [2015]
I think you skipped the 3rd prompt, which I suspect was (pretty-truth-table '(not a)).
I went with the shunting yard algorithm because it's not recursive so you don't need to worry about stack overflows. It's basically the iterative version of the other two.
Also note that most implementations of the shunting yard algorithm don't actually check that the expression is valid (e.g. they accept "1 2 +") but it's trivial to fix that with a state machine to check which tokens are acceptable.
This was also the first thing I've tried writing using Copilot and it was a huge time saver. Conservatively I'd say it halved the time it took me to write it. Ok admittedly it's probably a best case - there are a gazillion parser examples out there for it to learn from, but it was still great. I'm going to pay for a subscription.