|
Micah
|
|
Reply #16 Posted on: March 28, 2010, 05:26:02 pm |
|
|
Joined: May 2008
Posts: 128
|
I want my beautiful C++ types. Eh? Where? Try looking at Haskell, or better, Epigram, before you say that C++ has beautiful types...
|
|
|
Logged
|
|
|
|
|
|
Josh @ Dreamland
|
|
Reply #19 Posted on: March 28, 2010, 07:25:27 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
Oh, but they're just universally fleeting in the eyes of any beholder who has experienced a functional language? Certainly I'd hate them if I ever got an amazing implicit list type.
It's wonderful if you like other languages. Please quit pretending that everyone does/will accordingly. <_<"
|
|
|
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
|
|
|
|
|
Josh @ Dreamland
|
|
Reply #22 Posted on: March 28, 2010, 07:56:14 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
Not perfect, just beautiful. I like explicitly stating things; it shows me I'm still in control of something. The modern movement is towards throwing performance to the wind and letting the compiler do everything for you. That was the spark of so many errors in GM, I decided to avoid it entirely. Not to mention it's the little 'helpful' things like that which end up seeming unintuitive, at least to me.
I remember the first time I wrote anything useful in PHP. I didn't know continue; was the same as break; in a switch statement. Well, learned that one the hard way.
The only reason I don't have a type-related example of how I got really burned on not seeing a certain behavior coming is that I never gave it the chance.
To me, C++'s types are beautiful because they do my work for me in a manner I could predict from a coma. I never have the surprise, pleasant or otherwise, of a new feature. That to me, is beautiful. If you want to explain to me how that isn't beautiful or shouldn't be beautiful to me, go ahead.
|
|
|
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 #24 Posted on: March 29, 2010, 09:19:20 am |
|
|
Joined: May 2008
Posts: 128
|
C++'s type system doesn't catch nearly enough problems for you, but it's restrictive enough to get annoying. It has static, weak typing. Haskell's type system catches way more errors than C++'s does (although not as many as dependent typing), but it's not nearly as restrictive since it has generics in the form of parametric types and typeclasses, so it's not nearly as restrictive. Haskell has static, strong typing with powerful generics. The modern movement is towards throwing performance to the wind and letting the compiler do everything for you. The two are not intertwined. Compile-time verification has nothing to do with runtime performance. In fact, it can enhance it, since you need less runtime checks to be safe (or you can have neither compile-time nor runtime checks and use ASM). That was the spark of so many errors in GM, I decided to avoid it entirely. Stronger typing than C++'s (Haskell's, or better, dependent typing) result in catching many, many normally runtime errors at compile-time. I remember the first time I wrote anything useful in PHP. I didn't know continue; was the same as break; in a switch statement. Well, learned that one the hard way.
The only reason I don't have a type-related example of how I got really burned on not seeing a certain behavior coming is that I never gave it the chance. PHP is a horrible example of a type system. I would rather use C++'s type system than PHP's.
|
|
|
Logged
|
|
|
|
Josh @ Dreamland
|
|
Reply #25 Posted on: March 29, 2010, 09:41:48 am |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
> since you need less runtime checks to be safe Last I checked, C++ doesn't make any of those, either.
> "Compile-time verification has nothing to do with runtime performance. In fact, it can enhance it," lolwut And yes, it can enhance performance for you if you've paid attention to nothing you've been doing with your types.
>PHP is a horrible example of a type system. I was talking only of PHP's continue behaving entirely different than in other languages. I expect the same to happen with compiler-determined types. Like when Dylan templated fuck-everything in ENIGMA and we started getting problems when dividing int/int. I would hope Haskell is a little better at resolving a type for that, being less afraid to waste memory, but I don't really want to give it a chance to make life hard for me. Explicitly stating types has never caused me grief. Now, array bounds are another story...
|
|
|
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
|
|
|
luiscubal
|
|
Reply #26 Posted on: March 29, 2010, 12:45:32 pm |
|
|
Joined: Jun 2009
Posts: 452
|
dynamic_cast<T> is mostly runtime. I used it to implement instanceof in an ancient version of PineDL.
And, indeed, compile-time checks can be good for performance because they can, for instance, remove the need for NULL checks(just an example). Either way, C++ is not a perfect language, but it's good enough for most purposes.
Haskell has some interesting concepts, but I tend to think of it as a proof-of-concept language(although I know it is a real one). I tend to think functional languages are a bunch of ideas waiting to be adopted by imperative languages(like closures did).
(no flamewar intended and I know it is off-topic, but this topic has gone far away from its original purpose long long ago)
|
|
« Last Edit: March 29, 2010, 12:47:16 pm by luiscubal »
|
Logged
|
|
|
|
|
Josh @ Dreamland
|
|
Reply #28 Posted on: March 29, 2010, 01:11:53 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
> So much better than compile-time checks. I can't think of any good compile-time checks for any segfaults I've had.
> Umm what? Yes, if you want to disregard your actions and leave it to the compiler, I'm sure Haskell will perform better than C++.
> If an expression's type is ambiguous, you can specify it. Nobody's stopping you from specifying all your types in Haskell. I don't see what an odd behavior in PHP has to do with that. Which is why I always would. And PHP was just an example of how shit goes bad when you don't know absolutely everything about something's behavior.
> dynamic_cast<T> is mostly runtime. I used it to implement instanceof in an ancient version of PineDL. I never use that. Almost used it once, before I realized I couldn't even think of a time I'd need it for ENIGMA. Maybe later for instance_change. I can't see removing the need for runtime checks on if a dynamic allocation returned NULL.
|
|
« Last Edit: March 29, 2010, 01:13:42 pm by Josh @ Dreamland »
|
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
|
|
|
|
|