Live data from Hacker News

Show HN: XKCD-inspired StackSort

gkoberger.github.com

81–90 of 210 posts

Re: Show HN: XKCD-inspired StackSort

#82
post #42

Earlier quoted context omitted.

Try this in Forth, or Factor. And be sure to read up on genetic programming. http://en.wikipedia.org/wiki/Genetic_programming

I will read more about GP for future attempts, thanks.

If you want to learn about GP, the Genetic Programming Field Guide - http://www.gp-field-guide.org.uk/ - is an awesome book, it taught me a lot. In fact, I liked it so much, I bought a hard copy. Highly recommended!

Re: Show HN: XKCD-inspired StackSort

#83

Earlier quoted context omitted.

Can you also write code to detect whether a program will run forever for a given input? ducks

I looked for a way, but turns out it's not possible with JS. Browsers will stop infinite loops after a few seconds, though. EDIT: Ah, I missed the joke.. what I meant was that I looked for a way to stop the JS if it ran for more then a second.

> turns out it's not possible with JS.

No kidding... :-)

rm999 is correct; it was a joke about the halting problem. (The best kind of joke, obviously.) The broader point I was trying to make with the joke, though, is it's very hard to write code that will predict what another piece of code will do.

Re: Show HN: XKCD-inspired StackSort

#84

Earlier quoted context omitted.

I attempt to block anything that does DOM manipulation, uses Backbone or underscore, uses "Date()" (since it's probably a benchmark and those are slow), and a few others.

Can you also write code to detect whether a program will run forever for a given input? ducks

Pray, gkoberger, if you put into the machine wrong figures, will the right answers come out?

Re: Show HN: XKCD-inspired StackSort

#86

That's awesome. Think about it, if we were able to extract the meaning (what it does and under which assumptions) of the algorithms on SO we could use them as an API. You declare "what you need" and which assumptions and you just made a call to an API to download the best, peer reviewed, code. Like something code as service.

This is still a far way away from the program actually understanding the code to the point unnecessary for that. However, if I understand what you are describing, a simmalar system exists for Haskell (and possibly other languages)[1]. The idea behind hoogle is that you search for a type signature and get back functions with such a type. This idea probably would not work well for most languages, as it depends heavily on the strength of haskells type system. Also, hoogle only looks at standard libraries, but there is no reason we cannot use the same type system based search with SO.

[1] http://www.haskell.org/hoogle/

Re: Show HN: XKCD-inspired StackSort

#87
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?

Re: Show HN: XKCD-inspired StackSort

#88
post #5

If you give it about 30 seconds it works eventually, this is beautiful. I had a good laugh. Edit: It makes me want to do something crazy like setup a tool chain that cobbles whole programs together with trial and error like this. Throw enough resources at it maybe it will be faster and cheaper than your avg. developer. It will be an unmaintainable mess as if you used Brainfuck or Perl. But it will run, by god, it wil…

I tried a basic version of that 1.5 weeks ago. At first it was generating random characters, then I tried some Markov chains trained on valid code. After running it overnight (it was attempting 40+ programs per second), the very best program looked something like this: package main; func main() { i := 0 // wae64309i Next step I wanna try is to use tokens of the language instead of series of random characters. Edit: H…

If you actually want to go down this path then you want a language with as little redundancy as possible. Comments may be useful to humans but they needlessly complicate the search space. Abstractly you want to think about the how your language is parsed so you don't for example try different variable names.

Though if you spend enough time your probably going to be reimplementing some type of http://en.wikipedia.org/wiki/Genetic_programming

Post reply on HN