Live data from Hacker News

Your code should be taken out back, lined up against a wall, and machine-gunned

cygwin.com

21–30 of 76 posts

Re: Your code should be taken out back, lined up against a wall, and machine-gunned

#22
Best part is in the follow-up discussion:

  > Do you actually realise that not all computer languages can 
  > be implemented with a model of one stack?
  > 

  Do you actually realize that there are far better ways to implement stacks
  for interpreters than dinking with esp?  Ways that actually have a chance of
  working?  I suggest you investigate those alternatives instead of trying to
  do something that cannot work, and then getting all pissy when people try to
  dissuade you from wasting your time.

  And don't make me break out my Turing Machine on you about that statement of
  yours.

Re: Your code should be taken out back, lined up against a wall, and machine-gunned

#23
I for one would pay good money to get a response like this.

He points out the errors,the incorrect assumptions and offers pointers of what to do. The general standard of discourse on most mailing lists tend to be quite a bit lower than this.

Re: Your code should be taken out back, lined up against a wall, and machine-gunned

#24
post #13
post #8

I'm a little bit slow with the low level stuff. Could someone explain what's so horrific about this code?

For one thing, he's using assembly of one type of machine and expects it to work on different type of machine. He confuses Linux as a machine abstraction and demands that Cygwin running on Windows to be the same. For the low level mess, he sets the stack frame pointer to a uninitialized heap-allocated buffer which contains God-know-what garbage. When main() returns, it pops its return address from the stack frame poi…

For further information http://insecure.org/stf/smashstack.html is an interesting read.

Re: Your code should be taken out back, lined up against a wall, and machine-gunned

#26
post #19

While I always enjoy a good rant, I don't see why it had to be so vicious and insulting. Yeah, the guy's clearly pretty confused (if he wanted to do these kind of tricks, I'd try to use setjmp, fiddle with the structure, then longjmp to it), but there's no reason to be mean about it.

I think it's because his indignant demand of the Cygwin team to fix this "bug" and make it work for him. Basically it's the attitude that I know my way is the right way, now fix the platform so that my program runs.

I don't see any demands in the original mail:

http://www.cygwin.com/ml/cygwin/2005-08/msg00504.html

He questions whether it "should be fixed" in Cygwin, a perfectly reasonable request, and he fully admits that he isn't sure whether it's a problem in Cygwin or not.

Re: Your code should be taken out back, lined up against a wall, and machine-gunned

#27
post #19

While I always enjoy a good rant, I don't see why it had to be so vicious and insulting. Yeah, the guy's clearly pretty confused (if he wanted to do these kind of tricks, I'd try to use setjmp, fiddle with the structure, then longjmp to it), but there's no reason to be mean about it.

I think it's because his indignant demand of the Cygwin team to fix this "bug" and make it work for him. Basically it's the attitude that I know my way is the right way, now fix the platform so that my program runs.

Yeah, but blunt brevity and "go read X instead, you're going about it wrong" would have been better for everyone involved.

Re: Your code should be taken out back, lined up against a wall, and machine-gunned

#28
There's a great story about a heckler at a Windows NT conference:

MS speaker: and we've got POSIX, and we've got POSIX ACLs, and we've got a Unix Subsystem and we've got Korn Shell, and it works just the same way as under Unix.

Heckler: NO IT DOESN'T

MS speaker: er, ok. It does work. Anyway...

Heckler: NO IT DOESN'T WORK

MS speaker: What doesn't work?

Heckler: (rattles off differences in behavior and brokenness of ksh on NT)

MS speaker: we'll we've had our top guys working on this ...

Heckler: I'M DAVID KORN.

Room erupts in laughter.

Update: source: http://slashdot.org/articles/01/02/06/2030205.shtml. See question 5.

Re: Your code should be taken out back, lined up against a wall, and machine-gunned

#30
post #11

Earlier quoted context omitted.

This might be a stupid question, but what are you meant to do if not cast malloc's return? My C is a bit rusty, but how else are you meant to allocate data of different types on the heap?

C allows implict casting of void* to any other kind of pointer. Hence, you never need to cast the return from a malloc if you're storing it in a pointer. C++, however, does not allow this. So, if for some reason you're calling malloc rather than new in C++, you need to cast.

You are not the poster who said "casting malloc's return is evil", so perhaps you don't agree with that statement, but I don't see how either of the points you make lead to the conclusion that it is "evil". You say that since void* is implicitly cast to all pointer types, you never need to explicitly cast it, but why would that make an explicit cast evil?
Post reply on HN