Micah
|
|
Reply #75 Posted on: April 10, 2010, 09:58:36 pm |
|
|
Joined: May 2008
Posts: 128
|
See Unity. Marbs is presently writing Dominoes 3 in JavaScript. Because JavaScript was designed for Unity. Exactly. Also, you can use C# or Boo with Unity if you don't like JavaScript's divide-by-zero handling. And vice-versa, mind you. Vice-versa what? That one good high-level language doesn't mean that they're all better than C++? So, your point? I never claimed that they're all better than C++. Yes, yes, yes. Now tell me what size type int x[ftoi((scanf("%d",&a),a))] has, and how many witty optimizations can be done around it. It wouldn't be able to determine the size at compile time, of course. But it can check if you're checking that the length is greater than the indices you're using on it. Rusky stated how such was handled (though then dropped out): runtime. No. Rusky said that dependent typing tells you where you need to put runtime checks yourself. From there, it's down to personal preference. I suppose it would be, but you're misunderstanding what this debate is about. This has never been about low-level languages versus high-level languages. This has been about using the right tool for the job--using low-level languages for low-level tasks and high-level languages for high-level tasks. Valgrind and dependent typing we've decided to be the same, so. We have not decided that Valgrind and dependent typing are the same. I have no idea how much Valgrind does for you. Anyway, a diagnostics tool is no substitute for a good high-level language. In the event of the unforseen, I prefer the program to die rather than to waste time every access making sure it lives. You wouldn't be wasting time every access. See above.
|
|
|
Logged
|
|
|
|
RetroX
|
|
Reply #76 Posted on: April 10, 2010, 10:24:27 pm |
|
|
Master of all things Linux
Location: US Joined: Apr 2008
Posts: 1055
|
PHP: All web languages are interpreted. PHP is the best one. Both of those statements are completely false.
False, or not in your opinion? What do you prefer? ASP.NET? Python: Shell script replacement. That's not what it's used for in almost all cases...
You haven't seen most Python scripts. Lua: what Lua is used very often for a scripting language in games and game engines.
Like I rest my case. I know that you are giving some fairly decent arguments for C#/Java, but a lot of them that I've seen have been opinion and/or biased statements that cannot be proven. If you have some decent facts, that would be nice.
|
|
« Last Edit: April 10, 2010, 10:26:19 pm by RetroX »
|
Logged
|
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)Why do all the pro-Microsoft people have troll avatars?
|
|
|
Josh @ Dreamland
|
|
Reply #77 Posted on: April 10, 2010, 10:25:54 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
Because JavaScript was designed for Unity. Exactly. Also, you can use C# or Boo with Unity if you don't like JavaScript's divide-by-zero handling. Never stated the former. I stated merely that JavaScript was not designed in a manner that only supports web browsers. The latter is irrelevant. I never claimed that they're all better than C++. Likewise, I assure you. But it can check if you're checking that the length is greater than the indices you're using on it. All these buts are just beating around the bush. Now, in the rest of your post, you finally start building an argument. Which quickly runs invalid. This is how you show an argument is invalid. i. We decided that Valgrind and dependent typing are the same in that "Valgrind is a hack to replace dependent typing; both let you do the debugging up front." ii. What was not defined, to this point, is how Valgrind is a hack. I asserted "So, it's non-hackish because it's done automatically instead of by request" without resistance. iii. You assert that dependent typing only informs of what needs checked. iv. Valgrind only informs of what needs checked. Seeing that premise ii implies an inequality which premise iv destroys, one of those must be false. Care to define a new grounds by which Valgrind is a hack? "This has never been about low-level languages versus high-level languages. This has been about using the right tool for the job--using low-level languages for low-level tasks and high-level languages for high-level tasks." My, what a perfect world it would be if you could just embed a low level language into a high, or even just mix--ffffffffffffffffffuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
Micah
|
|
Reply #78 Posted on: April 10, 2010, 10:46:25 pm |
|
|
Joined: May 2008
Posts: 128
|
I rest my case. I know that you are giving some fairly decent arguments for C#/Java, but a lot of them that I've seen have been opinion and/or biased statements that cannot be proven. If you have some decent facts, that would be nice. I was never arguing for C#/Java. I was arguing that C++ is not perfect for everything, and higher-level languages than it are much better choices for tasks that do not need its low-level capabilities. But it can check if you're checking that the length is greater than the indices you're using on it. All these buts are just beating around the bush.
How? You said that there have to be runtime checks. I was saying how there do not have to be runtime checks. How is that beating around the bush? Now, in the rest of your post, you finally start building an argument. Which quickly runs invalid. This is how you show an argument is invalid. LOL INVALID IS JUST A WORD YOU USE TO SOUNDS SMART Care to define a new grounds by which Valgrind is a hack? Valgrind is a hack because it's meant to work around the limits of C++. And Valgrind does not provide even close to what high-level languages provide. And you still haven't shown that it provides even just what dependent typing provides. "This has never been about low-level languages versus high-level languages. This has been about using the right tool for the job--using low-level languages for low-level tasks and high-level languages for high-level tasks." My, what a perfect world it would be if you could just embed a low level language into a high, or even just mix--ffffffffffffffffffuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu Care to explain what you mean by this remark? I'm not sure what you're getting at.
|
|
|
Logged
|
|
|
|
Josh @ Dreamland
|
|
Reply #79 Posted on: April 10, 2010, 11:09:12 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
"How? You said that there have to be runtime checks. I was saying how there do not have to be runtime checks. How is that beating around the bush?" You've provided one more case to cling to the idea that a runtime check isn't necessary. You've in no way shown that they are rendered unnecessary.
"LOL INVALID IS JUST A WORD YOU USE TO SOUNDS SMART" Note the italicized word "argument." A premise, as I said before, can not be invalid. It can be true or false. Describing a premise as invalid is done in a failed attempt to sound smart. ...Nice try, though.
"Valgrind is a hack because it's meant to work around the limits of C++. And Valgrind does not provide even close to what high-level languages provide. And you still haven't shown that it provides even just what dependent typing provides." So it's a limit of a language only if every implementation of said language doesn't come with the feature. Hm. Also, you've nothing to back that up, and I have no idea what proof you could want of what valgrind can do. Look it up. Find a project worth using it on.
"Care to explain what you mean by this remark? I'm not sure what you're getting at." No. I chose to leave that open to interpretation.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
Micah
|
|
Reply #80 Posted on: April 10, 2010, 11:17:59 pm |
|
|
Joined: May 2008
Posts: 128
|
"How? You said that there have to be runtime checks. I was saying how there do not have to be runtime checks. How is that beating around the bush?" You've provided one more case to cling to the idea that a runtime check isn't necessary. You've in no way shown that they are rendered unnecessary. You haven't provided any cases where a runtime check for array bounds is necessary. Whether type information is needed at runtime depends on how much the type system allows. If you are allowed to make generic functions that take both floats and ints, then either copying code (like templates) or runtime type information would be needed. But you can have dependent typing that catches 100% possible out-of-bounds indices for you with no type information or checks at runtime. "LOL INVALID IS JUST A WORD YOU USE TO SOUNDS SMART" Note the italicized word "argument." A premise, as I said before, can not be invalid. It can be true or false. Describing a premise as invalid is done in a failed attempt to sound smart. ...Nice try, though. Hooray! Let's quibble over semantics. So it's a limit of a language only if every implementation of said language doesn't come with the feature. Hm. Valgrind is a tool that can (probably; I have not investigated it beyond glancing at their homepage) accomplish the same checking that dependent typing can. But it does not give you the productivity of a high-level language.
|
|
« Last Edit: April 10, 2010, 11:20:27 pm by miky »
|
Logged
|
|
|
|
Josh @ Dreamland
|
|
Reply #81 Posted on: April 10, 2010, 11:48:44 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
"You haven't provided any cases where a runtime check for array bounds is necessary."
int x[ftoi((scanf("%d",&a),a))]; for (int i=0; i<25; i++) x[i] = properties[i]; "But it does not give you the productivity of a high-level language." Sure. That's up to a good library. And/or a good set of macros. Like serp's continue(2) hack. Or a separate parser, which often isn't even the most efficient answer itself, but seems to be the best option.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
Micah
|
|
Reply #82 Posted on: April 11, 2010, 12:07:03 am |
|
|
Joined: May 2008
Posts: 128
|
"You haven't provided any cases where a runtime check for array bounds is necessary."
int x[ftoi((scanf("%d",&a),a))]; for (int i=0; i<25; i++) x[i] = properties[i]; You couldn't just plop dependent typing into C. But that would give an error, since the size of x could be smaller than 25. You'd have to be checking that i is less than the size of the array, and then you'll pass the type checker with no runtime information. int size = ftoi((scanf("%d",&a),a)); int x[size]; for (int i=0; i<size; i++) x[i] = properties[i]; "But it does not give you the productivity of a high-level language." Sure. That's up to a good library. And/or a good set of macros. Like serp's continue(2) hack. Or a separate parser, which often isn't even the most efficient answer itself, but seems to be the best option. Libraries definitely cannot provide everything that a high-level language can provide. Stop arguing this. Using C's macro language is a horrible idea to make it higher-level. It's disgusting. And what do you mean by "a separate parser"? Something like what you're doing with Enigma and EDL? Because that is very, very far from being the best option.
|
|
« Last Edit: April 11, 2010, 12:13:00 am by miky »
|
Logged
|
|
|
|
Josh @ Dreamland
|
|
Reply #83 Posted on: April 11, 2010, 12:17:39 am |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
"You couldn't just plop dependent typing into C. But that would give an error, since the size of x could be smaller than 25. You'd have to be checking that i is less than the size of the array, and then you'll pass the type checker with no runtime information." So, we've gone from it fixing things for you, to it informing you a check is a good idea, to it actually erroring if you don't check. At this point, I can't even tell if you're referring to one concept, let alone one language.
"Libraries definitely cannot provide everything that a high-level language can provide. Stop arguing this. Using C's macro language is a horrible idea to make it higher-level. It's disgusting. And what do you mean by "a separate parser"? Something like what you're doing with Enigma and EDL? Because that is very, very far from being the best option." Since all of this is either opinionated or unreinforced, I've no response.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
|
|
Rusky
|
|
Reply #87 Posted on: April 11, 2010, 06:15:21 pm |
|
|
Joined: Feb 2008
Posts: 954
|
While both Valgrind and dependent typing are intended to find bugs beforehand, they are not the same thing- dependent typing is much more powerful. It's built into the language- the language's semantics are designed alongside it and it allows the programmer to give it more information if necessary.
Dependent typing is a general concept. The common idea is that types can depend on values, which generally means that code can be analyzed to find possible buffer overruns, null pointer dereferences, etc. Anything else (e.g. whether the code is checked automatically or by request) is completely orthogonal to this concept.
When I say dependent typing can eliminate runtime checks, I'm talking about the kind a human or Java might make- missing a required check and crashing or making too many and slowing down like Java. If dependent typing finds such a problem, it can possibly insert its own check, error and tell you about the problem or warn you and let you ignore if it necessary.
Non-trivial programing is anything beyond simple examples and experiments. If you're making a real program, that's non-trivial and you will end up with some low-level errors if you're using a low-level language. High level languages prevent these errors and let you focus solely on the real errors.
Javascript was originally created to run in the browser. Not crashing is a high priority in browsers and websites. Defining x/0 to have some non-numerical value is not a glitch, merely a way to keep the webpage running smoothly.
Lua is used in applications, embedded software and games. Examples include Photoshop, Nmap, Wireshark, lighttpd, VLC, Crysis, Escape From Monkey Island, Garry's Mod, Battlefronts I and II and World of Warcraft.
|
|
|
Logged
|
|
|
|
RetroX
|
|
Reply #88 Posted on: April 11, 2010, 08:43:21 pm |
|
|
Master of all things Linux
Location: US Joined: Apr 2008
Posts: 1055
|
I rest my case. I know that you are giving some fairly decent arguments for C#/Java, but a lot of them that I've seen have been opinion and/or biased statements that cannot be proven. If you have some decent facts, that would be nice. I was never arguing for C#/Java. I was arguing that C++ is not perfect for everything, and higher-level languages than it are much better choices for tasks that do not need its low-level capabilities.
I agree, and had I know that that was what you were arguing, I would have agreed earlier. I use Python, PHP, and Bash script all the time for parsing text and stuff that would otherwise be tedious and annoying in regular C/C++.
|
|
|
Logged
|
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)Why do all the pro-Microsoft people have troll avatars?
|
|
|
|
|