4 ms·
With all respect to you, looking a gift horse in the mouth is not very nice. I invite you to re-write it in a higher level language, prove that it ends up short
by 0x12 15y ago
With all respect to you, looking a gift horse in the mouth is not very nice. I invite you to re-write it in a higher level language, prove that it ends up shorter and less buggy. He's made the code available (as he would) to ease your task to one of 'mere' translation.
Linus is a master carpenter using his favorite tools, because for him, given his expertise with them they are the right tools for the job. What is the right tool for the job is not an absolute, you should take in to account the user of the tools as well.
Also, I think it is not very nice to say that it is 'buggy' without any evidence to back it up. Funny how this comment is made on the same day that another post on the homepage lauds C for making it fairly easy to write 'damn reliable' programs.
- kia 15y agoMaybe I used a bad word here. What I meant by 'buggy' is that if you'll look at commit history there are a lot of fixes for problems that could be easily avoided in other languages (like memory leak here [1]). [1] https://github.com/torvalds/subsurface/commit/6eefcf40e68c2a5cf35c35b92ed7529072e5da64 https://github.com/torvalds/subsurface/commit/6eefcf40e68c2a...
- 0x12 15y agoIn my experience just about every language has its own pitfalls. The reason that C has memory leaks is that the programmer is responsible for allocating and de-allocating memory. In a language with a more complex runtime that might be taken care of but the trade-off will be that you get some other class of problems in return. Linus writes his code, fixes the bugs that are found. The end result will most likely be a solid and fast piece of software with a minimum of dependencies and bloat. If that is not your cup of tea then do a better job but don't bitch about the way he chooses to do it. What do you expect? For a guy like Linus to write a utility in a language that he feels is not optimal for himself and/or the problem at hand? To pick installing a 100M runtime to run a 50K binary? Linus is a systems programmer, not someone that would go for an overkill solution in some high level stack, launched on Monday, forgotten by Friday. Code like this has staying power and has a chance of surviving its creator. Script stuff is typically throwaway.
- deleted 15y ago[deleted]
- icebraining 15y agoWhile I think writing it in C, especially for Linus, makes perfect sense, I disagree with some of your points: > To pick installing a 100M runtime to run a 50K binary? Well, first that's a false dichotomy: there are higher level languages that are still compiled and don't require a runtime. And 100M? Really? Lua uses 150K. The libraries he's using are probably way bigger than that. > Code like this has staying power and has a chance of surviving its creator. Script stuff is typically throwaway. Script is more throwaway because if the developer had to write it in C, it probably wouldn't be worth the effort. Why exactly would the same program written in a higher level language have less chances of surviving its creator?
- jodrellblank 15y agoWho appointed you Linus's defender? All this aggressive defensiveness because someone said "I wonder"? What's wrong with you?