Hacker News new | ask | show | jobs
by addcn 2862 days ago
Hey -- thanks for checking us out!

You're definitely understanding the premise of our parser. It evaluates a regex-like set of rules on an AST tree to match different forms of code. These rules can be recursive as you can see in the first example of our home page [0]. In that example Optic matches an express js route and the headers, parameters and responses inside it. The result is a nice json object with shape {method, url, parameters: [], headers: [], responses" []}. OOTB the JS interpreter couldn't do this because it doesn't encounter the calls to req.query.param_name until that code runs.

PG wrote about building the language/abstraction to fit your problem [1]. In an ideal world we all would do this, but in practice there's always a gap between our program and the abstraction we describe it in. Today that gap is only bridged by a human understanding the code. Until now...Optic is allowing us to programmatically deal with these implicit abstractions.

We believe most of the dev tools created over the next decade will be built on top of your code in a way that allows them to collaborate with real developers. To realize this world we need a programatic interface to read, generate and mutate code so we created Optic.

[0] https://useoptic.com [1] http://www.paulgraham.com/progbot.html

1 comments

I was really fascinated by this as well. I think it's a great idea. Where does the 15 hours/per developer/per week come from. Couldn't find more information about that anywhere on your website.
Before I started Optic I watched 20 developers code for 1 day each. I kept logs of what they were working on and asked people to rate how they felt throughout the process. The 15/hrs/wk is a rough estimate of what we could automate. Our most avid users over the last month self report a little less but I think once we add better support for a few more things we’ll catch up.

I never thought to publish those results. Sounds like something people would be interested in?

I'm sure neither the technical-minded audience here wouldn't nor the prospective clients wouldn't mind having a look at them at all.
Would love to see your findings!