TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Launch HN: Optic (YC S18) – Automate Routine Programming

183 pointsby addcnalmost 7 years ago
Hi — I’m Aidan YC (S18), the founder of Optic (<a href="https:&#x2F;&#x2F;useoptic.com" rel="nofollow">https:&#x2F;&#x2F;useoptic.com</a>). We’re building a smarter code generator that helps developers write and maintain the tedious parts of their codebase. Optic is fully open source (<a href="https:&#x2F;&#x2F;github.com&#x2F;opticdev" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;opticdev</a>) and all our code is MIT licensed.<p>A really simple use case that Optic enabled for some of our early users is keeping their backend and frontend in sync. Optic can read the endpoints in a backend and use that to generate the HTTP requests on the frontend. It even maintains that code over time so if the backend is updated, a pull request is generated to update the networking code. You can test that here: <a href="https:&#x2F;&#x2F;github.com&#x2F;acunniffe&#x2F;optic-networking-code-demo" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;acunniffe&#x2F;optic-networking-code-demo</a>.<p>We have also had teams configure Optic to:<p><pre><code> - Write&#x2F;Maintain standard tests for their React components - Migrate to GraphQL by generating wrappers for each endpoint - Generate&#x2F;Maintain CRUD routes from models - Wrap their Tensorflow models in APIs </code></pre> There’s a checkered history of optimism and failure around automated programming and many tools have promised to make developers&#x27; lives easier. In each generation of programmers there’s an acknowledgement that much of the code we write is routine, but none of the solutions have caught on. I failed once before when I founded Dropsource. While we built that product into one of the most popular tools for non-programmers to build mobile apps, we failed at our goal of building a tool we ourselves or other developers would use.<p>I left the company and went into research mode for around 18 months. A lot of the automated programming projects do their functional job well, but when it come time to integrating into a developer’s workflow they are littered with tradeoffs. Automation isn’t worth it if it means giving up control, rewriting lots of code, rebuilding your app visually, describing your project in some foreign dsl, or becoming tied to a vendor. Many of these projects haven’t caught on because the tradeoffs of using them have been too high.<p>When I started working on this problem again I was determined to get the developer experience right. For me this meant making Optic:<p><pre><code> - work with your existing code - plug in to your favorite IDE - useful throughout the lifetime of your project </code></pre> I knew that whatever product I ended up building would need to interface with source code so I started building an API for code that let you:<p>GET JSON objects describing different types of code. Powered by a regex like pattern matcher we wrote that walks AST Trees.<p>PUT new values of the same shape back to update the code. This was the hardest part by far. We ended up training decision trees on different programming languages using the raw code and the resulting AST tree as input. We use these models to regenerate code in the smallest sections possible so formatting and manual changes are preserved.<p>POST new code into the project. This was actually the easiest. A generator can be reformulated as a Parser + Mutator so we bootstrapped all the generation in Optic by combining the GET &#x2F; PUT functionality.<p>This API was really powerful and it became the foundation of Optic. Generating code, doing transformations, syncing projects — all Optic’s major features are built on top of this API. It’s such a solid foundation (you get parsing, generating and the round-trip problem in a box) that I believe a lot of new meta-programming tools will be built on our platform. Our work is open source (<a href="https:&#x2F;&#x2F;github.com&#x2F;opticdev" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;opticdev</a>) and there will always be a free-forever version available. We plan to make money from some specialty features aimed at larger teams.<p>It’s still the early days but we hope to build Optic into a valuable open source resource that improves the workflow of developers and their teams. I’m looking forward to hearing your feedback, experiences and ideas for tasks we should automate. Thanks!

15 comments

ilakshalmost 7 years ago
Looks very powerful especially if you can popularize it. Maybe mention the plugins and other platforms besides MacOS on the website. Also the chat thing wouldn&#x27;t allow me to click a reply on my Nexus Android phone.<p>I wonder if the parsing, schemas and the transformations etc. could be a starting point for an advanced neural network AI programmer. Perhaps if you could combine it with an interactive system that converts text to schemas.<p>For example, say you had a way (a skill?) to convert a schema to a web form. Then the AI would need to handle speech-to-schema-change such as &quot;add a field for Middle Name&quot;. Then perhaps there is a skill to go from the web form to a save data request and another to accept the request and another to update the database schema etc.<p>But the AI might come more in handy for interpreting more complex schemas such as nesting, grouping or workflow etc.<p>But besides an advanced domain specific AI it seems like this foundation of parsing, schemas and transformations would be a good start for speech-based or other higher level program generation tools. I can envision a web page that generates a CRUD application from mobile front end to Firebase back end and then spits out the code that you can then add more advanced features to.<p>So it seems a smart strategy to embrace open source because that can allow other developers to add mappings that you can leverage for your own app or program generation tools which you can sell.<p>To me the interactive web-based CRUD application generator is low hanging fruit but more interesting would be to combine your tech with a Google Duplex style interactive speech based AI programmer front end. Probably only Google and a relatively small number of companies could pull something like that off though.
评论 #17562781 未加载
Immortalinalmost 7 years ago
Optic looks amazing, congrats on shipping! Do you think it can be integrated with visual programming languages IDE development? There are a lot of such things in the IoT, industrial and laboratory control, game Dev, media synthesis industries and they all suffer from the limitation of poor coupling between generated code and the front end graphical elements as the type checker and static analysis on the graphical elements level have to match the syntactic rules of the language constructs.<p>We use it for algorithmic trading here at KloudTrader and this is an issue we suffers from. Looking forward to adding Optic to our CI pipeline.<p><a href="https:&#x2F;&#x2F;KloudTrader.com" rel="nofollow">https:&#x2F;&#x2F;KloudTrader.com</a><p>Business rules engines would be another really great application. For a lot of IFTTT type of applications, if the rules can be compiled into finite state machines instead of simply interpreted, that would be a great boost for productivity and efficiency!
评论 #17560720 未加载
Risordalmost 7 years ago
Nice podcast episode from earlier this year where Aidan talk about his work: <a href="http:&#x2F;&#x2F;futureofcoding.org&#x2F;episodes&#x2F;21" rel="nofollow">http:&#x2F;&#x2F;futureofcoding.org&#x2F;episodes&#x2F;21</a>
评论 #17562716 未加载
aaronm14almost 7 years ago
Hey, something where my two cents might actually be valuable :)<p>I created the VS Code plugin for Optic: <a href="https:&#x2F;&#x2F;github.com&#x2F;opticdev&#x2F;optic-vscode-plugin" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;opticdev&#x2F;optic-vscode-plugin</a>. It was actually my first time writing a text editor plugin, but between the VS Code docs, Optic SDK, and Optic plugin spec, it was surprisingly easy. The information just gets sent through web sockets under the hood, but it was all just basic javascript callbacks and some VS Code specifics for finding ranges, etc.<p>Optic itself isn&#x27;t particularly useful for me as a solo developer building small website frontends, but I must say I was a little jealous of those that this is geared towards because even developing the plugin gave me a couple of those &quot;magic&quot; moments. Getting to make a change to just some javascript object&#x27;s property and then get to keep it in sync was pretty satisfying.
评论 #17562847 未加载
carapacealmost 7 years ago
This looks really interesting. I hope it&#x27;s successful.<p>What kind of AST are you using? Can you translate code between languages?<p>Also, what do you think of the Graal&#x2F;Truffle project?<p>(BTW I&#x27;m getting 404 at <a href="https:&#x2F;&#x2F;useoptic.com&#x2F;docs&#x2F;what_is_optic&#x2F;what-is-optic&#x2F;" rel="nofollow">https:&#x2F;&#x2F;useoptic.com&#x2F;docs&#x2F;what_is_optic&#x2F;what-is-optic&#x2F;</a> )
评论 #17560408 未加载
davebryandalmost 7 years ago
This is awesome! I&#x27;d love if you could do things like help upgrade library versions that have breaking changes--say something like generate a PR to go from React 16 to React 17, for instance.<p>It would also be cool if this could help generate code in the best-practice style defined by third-party libraries. For instance, if the Redux team defined the canonical way to define a selector, it would be handy to be able to have Optic use that information to generate selectors for me. This would take something like create-react-app and break down the best practices into more bite sized chunks.<p>Really excited about this!
评论 #17562164 未加载
lancecotingkehalmost 7 years ago
Great work! We are definitely interested in maintaining our React ccodebase using this.<p>Other than that, one vertical usecase that would be super appealing would be the ability to automatically generate (and maintain) api servers ontop of AI modules. As in if we had a tensorflow model, can we automatically create an endpoint to serve live traffic? I guess more generally, if we can define the JSON input to a function (any python function doesnt have to be AI model), Optic can write all the boiler plate microservice for us!
评论 #17561196 未加载
jon49almost 7 years ago
Reminds me of F# type providers. Maybe more powerful? I think defining everything at the DB makes sense and then you can generate much of the code beyond that and then you only need to write the custom code that a programmer actually needs to do.<p>Glad you are doing this!
akavelalmost 7 years ago
What are your expectations on when you might publish variants for some non-Mac platforms? Which code&#x2F;modules specifically are platform-dependent? If it is only the GUI, can one already use the engine&#x2F;JSON API (if available) on some other platform?<p>The whole idea is still not fully clear to me. After watching the video, it initially looks like some kind of code templating engine. From further reading, I seem to understand it also links many &quot;instantiated&quot; templates together, so that changing one of them can change others; is that correct?<p>Also, one thing that is still not clear to me: do I have to build such templates by hand, or does the engine somehow automatically infer &#x2F; detect new templates from an existing codebase?
评论 #17563141 未加载
AlexCoventryalmost 7 years ago
This looks great. I&#x27;d be curious to see the decision trees, and the training corpus&#x2F;objective for them.
评论 #17562252 未加载
ilakshalmost 7 years ago
Where are the skills and schemas stored? Are they in the main GitHub repo somewhere or separate JSON files or what? Is it possible for me to add my own transformations?<p>Is there a package manager or common repository for sharing and searching Optics skills?
评论 #17562472 未加载
corndogealmost 7 years ago
I take it this only works for web dev? Might want to specify that.
评论 #17562137 未加载
scottbarstowalmost 7 years ago
What IDEs are you currently integrated with?<p>I&#x27;m particularly interested in VS Code and perhaps Intellij out of the gate
评论 #17560758 未加载
scottbarstowalmost 7 years ago
Could you post some samples of the JSON used to declare new code descriptors?
评论 #17560796 未加载
seanmaronialmost 7 years ago
Best of luck looks like a great protect!