Lurker News

Comments (198) 66 threads

Earlier comments
milkshakes1 reply#
This reminds me of a project I was exposed to at school[1] It allows you to search for code by the test cases it passes. It was a little slow, but that was one of the first times computers truly felt magical to me.

[1]http://cs.brown.edu/~spr/research/s6.html

gridspy#
That is truly awesome! Thanks for sharing.

Quote from the linked article:
"
The system works by using the keywords to access one of the available code search engines (or a local code search engine for code available at Brown), to get candidate files. Each class or method in these files (depending on what the user is searching for) is considered a potential solution. These solutions are then transformed using a set of about 30 transformations in an attempt to map the code into exactly what the programmer specified. The transformations range from the simple (e.g. changing the name of the method to match the signature) to the complex (e.g. finding a line in the method that computes a value of the returned type and then doing a backward slice until the only free variables are values of the parameter types). All the solutions that can be transformed to match the signature are then tested using the given test cases, security constraints, and JML rules.
"

niggler#
It looks like the same order, and every time i run it stops at the same answer
pmelendez3 replies#
Wow.. beautiful!

I know this is only for fun, but it can start something bigger. Basically, given an input and output we could search for an algorithm that works. It reminds me a talk that PG gave in which he states people making bots to optimize code and then an intelligent compiler could be done. It sounded very futuristic, but maybe it is not that futuristic after all...

subb1 reply#
This is called TDD.
pmelendez1 reply#
Not really the same. TDD just give you the requirements for implementation. The intention of what I said is to given those requirements find a set of solutions. PG's idea is more ambitious, since is more like a set of plugins attached to the compiler so it could perform very high level optimizations (like finding an iterative solution given a recursive process)
subb#
I know. It was sort of a jab at TDD, implying that people following TDD only care about their tests. Oh well.
mayank1 reply#
Genetic programming; type that into google scholar and look at the late-80s and early-90s papers.
pmelendez1 reply#
Thanks!, I used to play with GP back in the university. It's really fun!

However, GP is more like an oriented random search where the space of search is really big. Here the space is somehow filtered by humans, where each hypothesis had been generated by a human and not by a machine. It would be interesting if the machine could evolve those solutions that are not quite but close to be the proper one :)

solistice2 replies#
I think it's also amazing what has been done with Field Programable Gate Arrays (FPGAs) running genetic algorithms. For those not in the know, FPGAs are programmable logic, so you essentially generate random logic codes and check for their ability to for example interpret a signal properly. There was an experiment where this was done for an FPGA with only several hundred gates, over several thousands of generations. It was tasked to differentiate between a 10khz and a 10hz wave. The most amazing thing is, the resulting code used only about 50 of these gates, some of them not connected to others, yet removal of the nonconnected gates would cause inability to carry out the task (Yay, Quantum weirdness). Nor would the code work on any other, larger FPGA. Essentially, it boils down to the Genetic Algorithm finding a code that used specific quirks in the structure of the hardware, utilizing effects we are currently not aware of, to solve a problem. I wish I could find the Article in question, but it's too late in the evening.

Continue this thread — 2 replies

Tichy#
A while ago I mused about a program that could also post questions on SO and implement a spec that way.

I also like this thought of an algorithm failing publicly and anybody being able to jump in and fix it.
I guess people have coded in Etherpad before, but still: how about implementing some program wiki-style, with editing rights for everyone?

Load more comments