Hacker News new | past | comments | ask | show | jobs | submit login

before it started I knew it was going to be another typing rant. I think you continue to present a false dichotomy on typing, as well as missing some of the reasons people desire it.

In particular, I like typing as machine readable documentation, that makes IDEs simpler and more accurate in code navigation and refactoring. Dart in particular shows this false dichotomy really well, but having a type system for human and machine readable docs, making the IDE experience far more pleasant, but which can be turned on or off. Unsound, untyped, programs can still run. Yes, dynamic languages can have nice IDEs too (Smalltalk), but they are harder to engineer.

In terms of optimization, typing is a must for many types of hard real time programming. You can bet that the Mars Curiosity rover isn't using a garbage collected dynamic language. Nor are the inner rendering loops of most mobile games or console games. (Lua is another story when it comes to actual game logic)

Lots of bold claims have been made for Javascript JITs for example over the years, include a lot of hype about tracing JITs, but the reality is, Javascript still doesn't even come close to native performance, and it's hideously slow on mobile platforms in comparisons, with basic, idiomatic programming (e.g. dictionaries with fields) having terrible numeric performance. All this has actually served to threaten the Web with a native-takeover because we don't have a fast web language CPU and memory efficient on these devices.

I don't think that Tim Sweeney or John Carmack are prematurely optimizing when they decide to write a game engine(rendering) in C++, because experience has taught them that it is highly unlikely they'll be able to optimize a dynamic language implementation later to a satisfactory level.

I think many people use a mix of languages depending on the context. I certainly wouldn't write a web service in C++, nor would I write a 3D game in BASIC. I wouldn't use anything but Perl to masage text files, and I'd use R for data analysis. 




> that makes IDEs simpler and more accurate in code navigation and refactoring

IMHO, that's one the OP's main arguments, that for example there is a whole class of (liberal?!) people to which IDEs don't matter at all, so that someone (a conservative?!) arguing "hey, this static typing thingie makes IDEs more easy to use" doesn't matter. So it makes sense to at least know on which side of the fence each of us sits, so that we won't argue as much :)

(just to be clear, I'm trying to use the concepts "liberal" and "conservative" as they're defined in the article)


In the examples given, Dart with its optional type system (and with type-checking that only triggers warnings) would actually fall in the liberal camp.

     You can bet that the Mars Curiosity rover isn't 
     using a garbage collected dynamic language
It's using 2.5 million lines of C. C is not a strongly typed language. C can't really be classified as dynamic or static. C is just low-level assembly with some structure attached.

     I don't think that Tim Sweeney or John Carmack 
     are prematurely optimizing ...
These people's jobs are building engines, not games. If you want to build a game, especially if you don't have their resources and knowledge, you're far better off by starting with friendlier tools, such as PyGame.

It's much cheaper to validate your idea that way and in the process you might end up with a hit like Angry Birds, which runs in the browser just fine.


> I don't think that Tim Sweeney or John Carmack are prematurely optimizing ...

Well, this is where the rant misses the mark, I think. Whether some programming thing is Liberal or Conservative really depends on the context, how much is at stake and where you're currently pushing the envelope.

The code for the Mars Rover has to be ridiculously safe and conservative, since it cost billions, is deployed in a harsh environment and if it crashes you've lost the lot.

If you're hacking and validating some startup idea, then something that's bloated and poorly tested is fine, since it's likely to be wrong at first, and speed of development is more important than safety.

Both of these are safe choices, and they're the choices that you'd make, but they're at opposite ends of the spectrum... but you're the same developer.

He has 9 points for each side, but my take is that they're all true.


1. Dart is less liberal than JS. For example, it is early bound. This fact alone allows the IDEs to do a much better job with less complexity.

As I mentioned, Carmack and Sweeney make engines, the artist interface is UnrealScript, or Lua, etc. But that's besides the point: performance matters. Carmack isn't trying to build yet another Box2D casual game (the Iphone Angry Birds uses a C implementation of Box2D, and Lua for game logic)

For someone like John Carmack, they are trying to push the state of the art, and starting off implementing say, idTech 7 in Python would yield unrealistic data if you're trying to see how feasible a given new rendering technique works on the large scale.

C is a typed language, there's no getting around it. It is in fact, a manifestly typed language, the types aren't optional. The fact that you can freely cast your way out of any situation doesn't really make it a dynamic language, anymore than Java reflection or bytecode rewriting makes Java a dynamic language.

The basic fact remains, the Mars rover is a highly performance critical piece of software with hard real time requirements, and it's simply not going to be written in a language that doesn't allow precise control over numeric types and memory allocation behavior. It's really those guarantees that many people associate with strongly typed systems programming languages, not the compile time checking.

Game programmers are very liberal, they want to escape straight jackets, and get deterministic and low level control over everything, often breaking the rules of the system. And in this regard, dynamic languages often taken away some freedom -- the freedom to control memory, stack, and cache behavior. They are conservative in a way.


"C is a typed language, there's no getting around it. It is in fact, a manifestly typed language, the types aren't optional. The fact that you can freely cast your way out of any situation doesn't really make it a dynamic language, anymore than Java reflection or bytecode rewriting makes Java a dynamic language."

C is statically and weakly typed language. That doesn't make it dynamic in the same sense as python or ruby, but it does make it a heck of a lot less safe, a heck of a lot more flexible, and thus a lot more liberal.


> C is just low-level assembly with some structure attached.

To make it clearer: By the standards of the article, C is quite liberal indeed. C++ is significantly more conservative.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: