26 ms·
Show HN: JavaScript Program Synthesis
- coolvision 6y agoThis post is about one of the most simple and straightforward methods of automatic program synthesis: inductive synthesis based on input-output examples specification and brute-force enumerative search.
- beaconstudios 6y agothanks for posting this, I've been meaning to start looking into program synthesis as it'll be useful for a program I'm working on at a later date. What kind of search methods are useful for this? Is it just a case of using hill climbing type searches to get closer to a solution or are there more program-synthesis-specific search techniques?
- coolvision 6y agoHill climbing works in some cases, but not very well. eventually it still goes towards full direct search. One of the interesting approaches, is hierarchical search, where first some smaller subrotines are found, and then they are included as building blocks for more high level complex programs.
- coolvision 6y agoHill climbing works in some cases, but not very well. eventually it still goes towards full direct search. One of the interesting approaches, is hierarchical search, where first some smaller subroutines are found, and then they are included as building blocks for more high level complex programs.
- beaconstudios 6y agoInteresting - is the division of the larger program into smaller subroutines done by the search function or is that something you have to do in the process of specifying the problem?
- diveanon 6y agoWould you mind describing some more advanced methods?
- coolvision 6y agoan alternative approach is to use an SMT solver, finding a valid program that satisfies some constraints (like, program syntax). Also deep learning has been showing promising results. But the most impressive results that I have seen are still implemented a brute force search, for example, winning entry for ARC challenge what implemented this way: https://www.kaggle.com/c/abstraction-and-reasoning-challenge/discussion/154314 https://www.kaggle.com/c/abstraction-and-reasoning-challenge...
- diveanon 6y agoDo you know of anyone who has taken a similar approach to ui design and development?
- coolvision 6y agodo you have some applications in mind? I guess there are some examples: https://components.ai/tachyons-theme/ https://components.ai/tachyons-theme/ https://uizard.io/ https://uizard.io/
- diveanon 6y agoNot in particular, its just an area of research I am interested in. Thanks for sharing :)
- diveanon 6y agoDo you see program synthesis eventually replacing the majority of development work? From my perspective most web development could be replaced by an advanced synthesizing algorithm and a product owner who understands the dsl. I feel like the majority of web development work these days is just stringing together apis, which could easily be automated. Coupled with next gen design tools for the front end I predict a huge reduction in development resources required for most projects.
- coolvision 6y agoYes, I hope so, first I hope that we will be using more DSLs (with easier ways to design them), and with DSLs program synthesis becomes more tractable.
- coolvision 6y agoUnfortunately, it's probably still in relatively far future, ~10-20 yrs...
- stevep98 6y agoThis reminds me that last week I was joking with a friend... someone should make an AI that solves leetcode problems. Instant hire!
- coolvision 6y agoyes, this is already possible, and a good application is teaching assistants that give tips on how to solve such problems.
- thomasikzelf 6y agoThis interesting method also brings some interesting bugs. On the last example (find max element in array) the following solution was generated: function run(input) { let output = [] for (let i0 in input) { // block let n2 = input[i0]; let n1 = n2 - i0; if(n1 > i0) { // block output[0] = n2; } } return output } console.log(run([4,3,8,2,5,1])) console.log(run([1,1,1,1,1,20,0,0])) // my counter example: console.log(run([10, 9])) It seems you still need to inspect the program to check if the program actually does what you expect it to do. This seems much harder to do with the generated code in the article.
- coolvision 6y agoyes, it's a common problem with inductive approach, can be resolver with adding more exammples.
- KateJones 6y agogood
- deleted 6y ago[deleted]
- miasusej1105 6y agoExcellent post
- deleted 6y ago[deleted]
- deleted 6y ago[deleted]
- deleted 6y ago[deleted]
- sundy 6y agoHello
- aheri 6y agogod
- omarjo01 6y agoI have to read more about, but I think it is good.
- rayman123 6y agoExcellent metode and explication clear and simple thank you
- ARQUIMEDES1959 6y agoExcellent method, very nice and very neat.
- omarjo01 6y agoI have to read more about this. It is ok for me.
- A1821 6y agosuch a interesting programming, i like this type of javascript program synthesis.
- fabiolaez 6y agovery good content, a very interesting page, keep it up!
- jackcelin 6y agoVery good