r/compsci • • Jul 30 '15

Code 'transplant' could revolutionise programming (Wired UK)

http://www.wired.co.uk/news/archive/2015-07/30/code-organ-transplant-software-myscalpel
2 Upvotes

19 comments sorted by

5

u/ginger_beer_m Jul 30 '15

It seems to me this will produce a code that is entirely unmaintainable by human after a successful transplant?

5

u/aneryx Jul 30 '15

Probably. That's why I rarely let my IDE generate code for things such as GUIs. It's sure easier at first, but eventually you want to end up with clean, maintainable code.

1

u/neofatalist Jul 30 '15

The source is still these to edit but i kind of look at the end result as an api that doesbt need to be modified.

5

u/aneryx Jul 30 '15

Until it doesn't work and needs to be debugged.

2

u/pardoman Jul 31 '15

The transplant is applied to binary code. That's part of the beauty of it. I'll admit I didn't read this article, because I remember reading the published paper like a month ago. http://people.csail.mit.edu/rinard/paper/pldi15.pdf

1

u/fullouterjoin Jul 30 '15

I haven't read the papers yet, but it might infer an interface to splice the new feature into. This is still better than what I first thought, that it was using some binary translation to splice multiple frankensteins monster type programs together. You know, like wget+photoshop+excel so you can spreadsheet with images downloaded off the internet.

5

u/paul_miner Jul 30 '15

But when a code transplant fails the system can simply try again, potentially hundreds or even thousands of times.

Ah, the 'ol "throw shit at a wall and see what sticks" methodology. Also known as "keep changing stuff until it compiles".

4

u/ex_ample Aug 01 '15

The all new "permutation auto-debugger" Changes every character in a program until your unit tests pass. Stunning O(N!) runtime!

1

u/monty20python Aug 02 '15

You can make it even better by changing random characters until it works

2

u/BS_in_BS Jul 30 '15

keep changing stuff until it compiles

See also FuckItJS

5

u/WhackAMoleE Jul 30 '15

could free human programmers from tedious, manual work and make developing software faster and cheaper.

LOL. We've never heard that before. COBOL was supposed to do that. Graphic programming was supposed to do that. Object oriented programming was supposed to do that. What kind of credulous reporters write this kind of stuff year after year after year, decade after decade? We ask if computers can be self-aware, but what about technology reporters? Can they be self-aware?

5

u/aneryx Jul 30 '15

Well each of those do make certain parts of programming a lot easier, and cut down on manual work.

3

u/aneryx Jul 30 '15

Shit I'm a compSci student. Does this mean my job will be automated by the time I graduate? /s

Good luck maintaining computer-generated code.

4

u/[deleted] Jul 30 '15

I thought this was going to be an Onion article.

2

u/[deleted] Jul 30 '15

Dafuq did I just read?

1

u/hzhou321 Aug 03 '15

In human organ transplant, the donor and receptor have the same infrastructure, so the process is simply to replace a non-working organ with a working organ. However, in the article's analogy, this is like transplanting an organ to a body with no infra-structure for that organ exist in the first place, how would that work? It cited an example of codec, which is kind of special. A codec is an add-on feature for both side (the x.264 and VLC), so the transplant is rather an interface stitching, sort of like connecting a donkey-ear to your existing blood vessels and nerve network. That is different from the typical transplant we would imagine (transplanting a heart to a heartless plant -- impossible, which might be the same conclusion for arbitrary program feature transplant).

0

u/ex_ample Aug 01 '15 edited Aug 01 '15

So, like, they figured out how to copy and paste?

seriously, what the fuck is this article even saying? It's always been possible to move code from one program to another.

Also even the metaphor is completely messed up. When you do a heart transplant - you don't inject a new heart into someone's vein. WTF.

I could see automated tools that help with conflicting library dependance or something being useful for C programs.

5

u/[deleted] Jul 30 '15

[removed] — view removed comment

5

u/ReginaldIII PhD Student | Computer Graphics Jul 30 '15

That article read like a brain aneurysm. The pre-print paper reads better but I just can't see this being feasible for actual use.

Their method seems to be to keep stabbing blindly into the dark until it compiles, and then until "correct" results come back. Good luck trying to create safe code with this. The bitch of any algorithm is in the edge cases!