I’m planning to post a write-up of how the decompiler prototype works on the blog, in the hope that this will convert a few non-believers. For those that need no conversion, I’d like to ask you to go forth and tell a few people about it, because I won’t be able to do all this on Joe Decuir’s contribution alone.
Crowdfunding pledge for a 6502 decompiler
-
White Flame
- Posts: 704
- Joined: 24 Jul 2012
Re: Crowdfunding pledge for a 6502 decompiler
There's been an update posted a few days ago. Unfortunately, I think he's missing the point.
Every technical feature that he's discussed adding is possible to implement to some degree, but doesn't help with the real problems. 
Quote:
Alright, so the campaign is public now, and I’m slowly recovering from being the nervous wreck I became five minutes after I pressed the “Go Live” button. The whole project has so far been met with a lot of enthusiasm, a couple of amusing anecdotes, and a really large amount of skepticism. Decompilation still seems to have an air of witchcraft to many people.
I’m planning to post a write-up of how the decompiler prototype works on the blog, in the hope that this will convert a few non-believers. For those that need no conversion, I’d like to ask you to go forth and tell a few people about it, because I won’t be able to do all this on Joe Decuir’s contribution alone.
I’m planning to post a write-up of how the decompiler prototype works on the blog, in the hope that this will convert a few non-believers. For those that need no conversion, I’d like to ask you to go forth and tell a few people about it, because I won’t be able to do all this on Joe Decuir’s contribution alone.
Re: Crowdfunding pledge for a 6502 decompiler
Hi White Flame (and welcome!)
I saw a rather unseemly mob, but I'm not sure I saw 'real problems' with the project.
The negative posts seem to be attacking a straw man: take a difficult example, suppose it to be necessary, and pronounce the project as hopeless.
In fact, I think the project has a loose goal, of producing C which is accurate and to some degree more useful for study than the machine code. (One might argue that C could never be useful, but again I don't see that as helpful - a decompilation will always have more potential readers than a disassembly.) Six months of full time effort by someone who knows what they are doing has every chance of producing something impressive. Much less time went into any of these forum posts than into that prototype, and yet the prototype actually does something interesting.
(As for my mob comment: I'd much rather see comments pitched as "I don't see how..." instead of "You can't possibly...", and "I wouldn't support this" instead of "This is hopeless and wrong-headed". If a friend comes up to a bunch of friends with a wild idea for building something, is rubbishing the idea the best response? Even if you know them well and have good reason to judge it over-ambitious, that seems unnecessarily hostile to me. In this case, we don't know well.)
Cheers
Ed
I saw a rather unseemly mob, but I'm not sure I saw 'real problems' with the project.
The negative posts seem to be attacking a straw man: take a difficult example, suppose it to be necessary, and pronounce the project as hopeless.
In fact, I think the project has a loose goal, of producing C which is accurate and to some degree more useful for study than the machine code. (One might argue that C could never be useful, but again I don't see that as helpful - a decompilation will always have more potential readers than a disassembly.) Six months of full time effort by someone who knows what they are doing has every chance of producing something impressive. Much less time went into any of these forum posts than into that prototype, and yet the prototype actually does something interesting.
(As for my mob comment: I'd much rather see comments pitched as "I don't see how..." instead of "You can't possibly...", and "I wouldn't support this" instead of "This is hopeless and wrong-headed". If a friend comes up to a bunch of friends with a wild idea for building something, is rubbishing the idea the best response? Even if you know them well and have good reason to judge it over-ambitious, that seems unnecessarily hostile to me. In this case, we don't know well.)
Cheers
Ed
- GARTHWILSON
- Forum Moderator
- Posts: 8774
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Re: Crowdfunding pledge for a 6502 decompiler
Quote:
The negative posts seem to be attacking a straw man: take a difficult example,
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
-
White Flame
- Posts: 704
- Joined: 24 Jul 2012
Re: Crowdfunding pledge for a 6502 decompiler
I will simply say that his list of "Use $TECHNOLOGY to reveal $INFO" features that he plans to include do not close the gap between hand-written assembly and his goal of "Derive readable C that can be ported", even if he implements them completely.
- BigDumbDinosaur
- Posts: 9428
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Crowdfunding pledge for a 6502 decompiler
BTW, I wonder what Samuel would have to say about this effort. He's definitely the language guru around here. 
x86? We ain't got no x86. We don't NEED no stinking x86!
- BigDumbDinosaur
- Posts: 9428
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Crowdfunding pledge for a 6502 decompiler
GARTHWILSON wrote:
Quote:
The negative posts seem to be attacking a straw man: take a difficult example,
Garth is right. Not only has the bar been set (to turn phrase on current events) to Olympic heights, the activity itself is not well defined. Over which part of the bar do you leap? How do you land? How is your performance scored? What's the ultimate goal? From what I've read on this project to date, it seems much of it is fuzzy and ill-defined.
x86? We ain't got no x86. We don't NEED no stinking x86!
Re: Crowdfunding pledge for a 6502 decompiler
BigDumbDinosaur wrote:
BTW, I wonder what Samuel would have to say about this effort. He's definitely the language guru around here. 
"I do like how it can already detect do/while loops. That's really cool.
(This was actually my internal prompt for the claim that the prototype can already do interesting things.)
(I'm not suggesting that gplus has become the place for 6502 discussions, but it's where he and I interact most these days)
Cheers
Ed
- BigDumbDinosaur
- Posts: 9428
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Crowdfunding pledge for a 6502 decompiler
BigEd wrote:
BigDumbDinosaur wrote:
BTW, I wonder what Samuel would have to say about this effort. He's definitely the language guru around here. 
"I do like how it can already detect do/while loops. That's really cool.
I don't do Google, so I didn't know that Samuel had seen and commented on this project.
x86? We ain't got no x86. We don't NEED no stinking x86!
Re: Crowdfunding pledge for a 6502 decompiler
Quote:
I don't do Google, so I didn't know that Samuel had seen and commented on this project.
Cheers
Ed
-
White Flame
- Posts: 704
- Joined: 24 Jul 2012
Re: Crowdfunding pledge for a 6502 decompiler
Well, the fundraiser is over and didn't draw much money. I feel kind of bad for the guy; if he just focused on the technical features he wanted to put in, but didn't frame it with generating "high-level, readable" handwaviness, he might have successfully raised funds.
- BigDumbDinosaur
- Posts: 9428
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Crowdfunding pledge for a 6502 decompiler
White Flame wrote:
Well, the fundraiser is over and didn't draw much money. I feel kind of bad for the guy; if he just focused on the technical features he wanted to put in, but didn't frame it with generating "high-level, readable" handwaviness, he might have successfully raised funds.
BigDumbDinosaur wrote:
While I would never discourage anyone from working on whatever it is that floats their boat, I stop at the point where funding is requested for something that will most likely prove to be an exercise in futility.
Case closed.
x86? We ain't got no x86. We don't NEED no stinking x86!
Re: Crowdfunding pledge for a 6502 decompiler
I see Ulrich has released his state-of-play code as open source:
https://github.com/uli/decomp#readme
There are pointers there to a few articles he's written about the techniques he used.
(As the crowdfunding didn't get any significant money, I would suppose future progress, if any, will be at a slow pace.)
Cheers
Ed
https://github.com/uli/decomp#readme
There are pointers there to a few articles he's written about the techniques he used.
(As the crowdfunding didn't get any significant money, I would suppose future progress, if any, will be at a slow pace.)
Cheers
Ed
Re: Crowdfunding pledge for a 6502 decompiler
I gave it a try with some of my own code. It's pretty impressive what it can do, but on the other hand there's still a lot that it can't. One particularly amusing bit:
This is part of my code that keeps track of the time. Apparently, the decompiler doesn't understand that the code after the 'bcc' always has the carry flag set, leading to:
I edited the code to fix the numbered variable names back into the original names.
Code: Select all
inc second
lda second
sbc #60
bcc @1
sta second
inc minute
lda minute
sbc #60
bcc @1
sta minute
inc hour
lda hour
sbc #24
bcc @1
sta hour
inc day
Code: Select all
sec = tmp2 = sec + 1;
if (sec >= (1 - c) + 60) {
sec = sec - c - 61;
minute = tmp3 = minute + 1;
if (minute >= (1 - (sec >= (1 - c) + 60)) + 60) {
minute = minute - (sec >= (1 - c) + 60) - 61;
hour = hour + 1;
a = hour - (minute >= (1 - (sec >= (1 - c) + 60)) + 60) - 25;
c = hour >= (1 - (minute >= (1 - (sec >= (1 - c) + 60)) + 60)) + 24;
if (c) {
hour = a;
}
}
}
Re: Crowdfunding pledge for a 6502 decompiler
Yes, he mentions the detection of branch-always idioms in his pieces. Doubtless you could never get 100% correct, so the question would be how often you get it wrong, and how your progress is in improving that. Also, what interactive tools you might have to assist.
Cheers
Ed
Cheers
Ed