# "*": "https://raw.githubusercontent.com/wefindx/schema/master/intent/oo-item.yaml" # "base:title": "0oo - Automated API traversal - program synthesis" "og:title": "Automated API traversal - program synthesis" "og:description": "We have a REST API or standard library functions in our chosen programming language. Each rest call or method call takes arguments and returns data and causes side effects. Take a HTTP client for instance, it takes data in and returns data. We typically have to write interactions with APIs manually. What if the programming against APIs could be automatically generated and the source code or AST generated to interact with the API. We need a way to map a simple definition of the problem into a more detailed representation of the problem which uses APIs In other words, computers …" "og:image": "https://avatars0.githubusercontent.com/u/28134655" "og:url": "/intent/41001/" "base:css": "/static/css/bootstrap.min.9c25540d6272.css" "base:extra-css": "/static/css/base.57997aeac1df.css" "base:favicon": "/static/favicon.acaa334f0136.ico" "base:body_class": "" "layout:logo": "/static/0oo.8d2a8bbef612.svg" "layout:index": "/" "layout:menu": "/menu/" "layout:categories": "/intents/" "layout:ideas": "/methods/" "layout:projects": "/projects/" "layout:users": "/users/" "layout:about": "/about/" "layout:help": "/help/" "layout:bug_report": "https://github.com/wefindx/0oo" "layout:login": "/accounts/login/" "layout:light-off": "/darken/?darken=true" "layout:set-monolingual": "/mulang/?mulang=false" "layout:lang": "Language" "layout:set-language-post-action": "/i18n/setlang/" "layout:csrf-token": "GGcZTIDVWxa7rOCVKYOD9VhbQuhRDUKqhwpTl1sxKSXzBim3zL9R2IYZTH3OB5s9" "layout:input-next": "/intent/41001/" "layout:languages": [{"code": "ja", "is-active": "false", "name": "日本語"}, {"code": "lt", "is-active": "false", "name": "Lietuviškai"}, {"code": "zh-hans", "is-active": "false", "name": "简体中文"}, {"code": "en", "is-active": "true", "name": "English"}, {"code": "ru", "is-active": "false", "name": "Русский"}, {"code": "oo", "is-active": "false", "name": "O;o,"}] # "item:title": "Automated API traversal - program synthesis" "item:votes": +1 "item:add-vote": "#addnote" "item:intent": "/intent/41001/?l=en" "item:base-administration": false "item:body": | We have a REST API or standard library functions in our chosen programming language. Each rest call or method call takes arguments and returns data and causes side effects. Take a HTTP client for instance, it takes data in and returns data. We typically have to write interactions with APIs manually. What if the programming against APIs could be automatically generated and the source code or AST generated to interact with the API. We need a way to map a simple definition of the problem into a more detailed representation of the problem which uses APIs In other words, computers program themselves. Rather than general intelligence we rely on mappings and equivalencies and graph traversal and scheduling. Say I want to backup files on all my computers, compress them, encrypt them, sign them, deduplicate them, upload. That's a lot of APIs I need to talk to (encryption, operating system file APIs) and the APIs for them require multiple lines of code to perform. There's also a data flow through a pipeline of steps. The call graph of the code to fulfil the pipeline looks a certain way. Each step, "encrypt" takes in an input and has an output. These need to be defined. I want to be able to define a list of steps to perform and have the computer synthesise all the intermediate and data transformation steps in between. I give the computer this list: { "steps": ["deduplicate", "compress", "encrypt", "upload"] } The computer generates code to do the following, performing all intermediate conversions such as files to bytes. Upload(encrypt(compress(deduplicate(input))) The actual code may look more like A(b(c(d(e(f(g(h(I(j(k(input))))))))) But this is a simplified example, upload might be multiple steps or multiple steps in the AST. To implement this I need a database of records representing APIs and their inputs, outputs and types. We also need a database of code sequences (or code snippets) which are named sequences of code that perform an overarching task - such as signing or encrypting some bytes A sequence references API method calls in order and had variables used between method calls. We also have sequences to convert between types. And collections of types I tell the computer what I want to be done in a simple specification of the problem and the computer works out what APIs need to be used to perform the actions. It's synthesis of a set of steps or operators to perform a function. "item:permalink": "/intent/41001/?l=en" "item:source-date": "" "item:owner": "chronological" "item:ownerlink": "/user/198/chronological" "item:created": "2021-08-02T05:01:11.482695" "item:intent:child:add": "/admin/hlog/intent/add/?parent=41001" # "item:method:items": "item:method:add": "/admin/hlog/method/add/?parent=41001" "item:comment:add": "/intents/addnote?parent=41001" "item:comment:add:csrf_token": "GGcZTIDVWxa7rOCVKYOD9VhbQuhRDUKqhwpTl1sxKSXzBim3zL9R2IYZTH3OB5s9" "item:comment:form": |
  • Mark if the comment raises new questions.
  • Mark if the comment contributes potential solutions.
  • Mark if the comment contributes facts for reasoning.
  • Please, log in. # "item:comment:items": - "id": "r-46001" "text": | I should point out that OpenAPI is a specification format for rest APIs that could be used to traverse APIs the only problem is that it isn't very good. If programs advertised their functionality, types, inputs and outputs we could have systems that program themselves to talk to other systems. "owner": "chronological" "ownerlink": "/user/198/chronological" "permalink": "/intent/41001/?l=en#r-46001" "created": "2021-08-02T05:06:01.113102" "vote": "" - "id": "r-47001" "text": | I understand what you want, and understand that such program synthesis must be possible without a programmer in the loop. I had even attempted to write software for making APIs from software libraries and websites more reusable, which I call "[metadrive](https://0oo.li/project/854/)". I think we need drivers, because not every API is documented and not in the same standard, remember [UseMe Files](https://0oo.li/method/989/) files idea? Once we solve automatic reusability, the [graph of functions](https://0oo.li/method/222/) can definitely be traversed, and paths of execution to get final result composed like routes on a geographical map. Heck of a multilevel problem, but definitely solvable. "owner": "Mindey" "ownerlink": "/user/147/Mindey" "permalink": "/intent/41001/?l=en#r-47001" "created": "2021-08-02T09:43:03.179319" "vote": "[+]" - "id": "r-48001" "text": | UseMe files are definitely an application/related to this idea. I really like UseMe files. The unsolved problem in this idea is the expanding of one graph to another. Without defining what "encrypt" means - without marking the following code as "encrypt" - Generate key Get algorithm Algorithm.encrypt(input) You cannot expand "encrypt" to those steps. You've got to do a lot of work to indicate what encrypt means. Maybe we can use types to solve this problem. As long as you refer to the correct types, the system can infer the correct code operations. "owner": "chronological" "ownerlink": "/user/198/chronological" "permalink": "/intent/41001/?l=en#r-48001" "created": "2021-08-02T19:46:18.918818" "vote": "" "base:js": "/static/js/base.c7357c06cc89.js"