TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Letter to John Carmack

149 点作者 austinhallock将近 13 年前

25 条评论

tumult将近 13 年前
I am 100% with Carmack. Sorry, guy. JavaScript is crap. The reasons that JavaScript sucks have been hashed to death in the past. If you are already disagreeing with me, then anything I say here won't change your mind, because you've already heard the arguments before and built up a repertoire of responses. That's fine, whatever floats your boat. Lots of fun games have been, and will be written, in silly languages like JavaScript and ActionScript and whatever. People used to write games in assembly, and they were still fun. In the end, it's the game that matters.<p>But don't tell John Carmack, or any of the other many people who have been writing simulation engines and 3D rendering engines since around when you were born to use your web browser scripting engine. Seriously. (Also before I was born.)<p>And unsecured access to the graphics stack is a terrible idea. Flash already randomly causes my GPU to crash.
评论 #4334305 未加载
评论 #4334174 未加载
评论 #4334273 未加载
评论 #4334501 未加载
评论 #4337097 未加载
评论 #4334297 未加载
评论 #4334052 未加载
评论 #4334838 未加载
评论 #4334676 未加载
评论 #4336204 未加载
评论 #4334780 未加载
评论 #4334139 未加载
评论 #4334487 未加载
chao-将近 13 年前
I don't have enough knowledge of native graphics libraries, nor of WebGL, to speak to the core issue in this article. But, as a young'n, the last line really strikes a chord with me.<p>I will never experience the joy people had fiddling around with their Apple II's and I <i>still</i> don't know the first thing about the Commodore 64 besides the name. My attitude toward the "How will the kids ever learn unless they can tinker with it?" nostalgia that comes up on HN has always been: "Meh. No one I work with had an Apple II, and we all still ended up as tech-types."<p>That said, the first computer I owned myself ran Windows 98, and the first thing I learned to do with it was noodle around in HTML and JavaScript. Well, Okay. It was second thing I learned to do, after installing Sim City 2000 and wasting a week's worth of time.<p>It was very poignant to realize all at once how the internet provided a chance to be part of an easily-accessible ecosystem, one where you could tell a computer <i>to do something</i> and it <i>just did it</i>. Even if it was in a browser.
评论 #4334029 未加载
评论 #4333941 未加载
debacle将近 13 年前
&#62; We're there again: take 3 lines of JavaScript and you're drawing an image to a canvas element. Take 20 more lines and you have a rendering loop and a sprite that moves with the arrow keys.<p>Processing (Java), PyGame (Python), and I'm sure many other libraries can do the same thing. They're also faster, cleaner, more robust, and you're not writing some insane garbled blend of JavaScript and GLSL with all the associated scaffolding code between the two vastly differently typed languages.<p>I would highly recommend Processing for any graphics playing that you might do. Yes, you have to write a bit more code (it is Java, after all), but it's also much more rewarding and just as portable as something written for WebGL.
评论 #4334422 未加载
评论 #4334388 未加载
评论 #4334437 未加载
aw3c2将近 13 年前
With Web/Local Storage you are limited to 5-10 Megabytes of data.<p>There will be a shitstorm once graphic drivers get exploited through WebGL.<p>The game the writer self-promotes is a completely different genre than what id Software does (2D shmup versus a 3D FPS with detailed graphics). It eats a whole CPU core for a seemingly trivial game (might just be missing sleeping in the code, I have no clue).<p>If you use a good codebase, you do not need to write 200 lines just to setup your screen, eg <a href="http://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Introduction#Initialization" rel="nofollow">http://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenG...</a> .<p>And never forget that web-based games are kinda non-free unless you can download them and play them locally. You are always at the whim of the developer/hoster/provider. I much prefer games that run natively, disconnected from the internet (attack vector) and whenever I want.
评论 #4333876 未加载
评论 #4334201 未加载
评论 #4334022 未加载
tsahyt将近 13 年前
&#62;We're there again: take 3 lines of JavaScript and you're drawing an image[...]<p>I think Carmack wasn't referring to how more abstractions could make his life easier. I've never had the time to dig deeply into id Software's sources (which get open sourced after a couple of years, in case someone didn't know), but what I've often heard him complain about were the abstractions themselves! This is basically about how we wrap a couple of layers around the drivers these days - drivers which have become increasingly complex.<p>See, abstractions are a good thing. General purpose abstractions might be a good thing for a lot of applications. For some, like graphics engines, they're not. Suppose you're working on a cutting edge 3D engine and you want to squeeze the last bit of performance from the machine. What you end up doing is talking to the graphics card as directly as possible, with the least amount of "layers of crap", as Carmack called them, inbetween you and the hardware.<p>General-purpose abstractions are loaded with stuff you don't necessarily need and come with quite a bit of overhead. Suppose you have 10 layers between you and the hardware, then everything you try to tell the hardware has to go through all those layers and possibly back to you. That's quite a drawback.<p>Since drivers have become rather complex themselves as GFX hardware has become more powerful in the last 2 decades you need quite a lot of code to talk to it properly.<p>The same thing goes for setting up the screen for rendering. Windows wants you to be quite verbose about what you're going to do (obviously). That's why you need 200 lines of code to do so.<p>The only way round that is using libraries that abstract those things away from you, but they do so at additional cost. Obviously it's possible to do the same thing in just one line of &#60;insert your favourite language here&#62; in the same way that it's possible to do the same thing in just a couple of lines of low level code <i>as long as you have a library doing it for you</i>.<p>However, as pointed out, in an AAA game engine, that's not what you want to do. There's a reason why the "highest common denominator" is usually D3D here. It's because D3D is still reasonably quick (although not as quick as OpenGL) and does enough things for you.
评论 #4334815 未加载
NinjaWarrior将近 13 年前
I totally agree with Carmack. Why the hell crap technologies dominate all the time? HTML5 and JavaScript is the most disgusting thing I've experienced in my 20 years game programming history.<p>"Nobody pretends that the next AAA-title will be written in JavaScript. The community understands that it's magnitudes slower than native code"<p>Obviously no. Most web standard adbocates insist that all software will and should be web based. They must be criticized.
评论 #4339248 未加载
评论 #4334787 未加载
rjzzleep将近 13 年前
op also completely misses the point. we're even further from the 4 lines than we were ever before.<p>sure john could just use someones library. but in the terms john was speaking, javascript + library + browser stack etc. etc. is not 4 lines it's hundreds of thousands.<p>there was only one prof at university i enjoyed. he would stand in the cpu design class and mock the java world and how things get slower despite us having faster cpus.<p>ps. i earn my money with web work<p>pps. javascript is a horrible language. holding my breath for dart and anything else thats not javascript
评论 #4333954 未加载
pwny将近 13 年前
It would be great if people stopped seeing native and web games as mutually exclusive. I'm a huge fan of native games and all the oomph they can dish out. Of course we're not going to see AAA titles in the browser any time soon and of course native games will ALWAYS have an advantage, at least performance wise, over browser games since they don't have the browser and javascript overheads.<p>That being said, there are both native and browser games that are great, just like there are some that are mediocre. The browser is imho a great place to prototype a game, make a first game as a newbie or even publish something that's not too resource hungry.<p>I'd even go as far as saying that WebGL will stimulate the development of native games as well. WebGL based game development is a lot closer to native game development in a way than Flash games are (at least from my limited experience) so new developers might make the switch more easily when their needs exceed what the browser can give them. Exactly the position John Carmack's company is in, although they never had the modern browser at their disposal in the past.<p>These are exciting times and I suffer a little bit inside whenever I see talented people arguing over them instead of making the best of them.
评论 #4334158 未加载
preshing将近 13 年前
Why does it matter whether Carmack likes JavaScript? If he doesn't like it, it won't vanish in a puff of smoke.
评论 #4334540 未加载
评论 #4334743 未加载
duaneb将近 13 年前
As far as I can see the only true parallel between the Javascript/HTML/Whatever environment and Apple II basic is that it comes pre-installed on every computer. This does NOT mean that it is a good way to teach anyone. It's not. It's pretty horrible, compared to pretty much everything else.<p>IMHO it's a much bigger revolution in terms of being able to teach your kid from across the globe over skype (or whatever).
mr_luc将近 13 年前
A quick aside for the people who say that Javascript stuff pegs their CPU: it's not always going to be that way.<p>We've got OpenGL now, and people are already writing shaders that do the work of physics and matrix rotations, etc, but OpenCL (with a C) is already popping up (you can get it running on node with a couple of different libraries, and there's a Ruby lib for it as well), which will let us write substantially more "general" code that runs on the gpu.<p>We were spoiled with traditional gaming; having unfettered access to the CPU, and all of the space we wanted when installing from physical media, is pretty crazy when you think about it.<p>I think the bigger question isn't "can Javascript be fast enough", because once the GPU is handling the physics and graphics, Javascript will be <i>almost</i> in the position of a traditional 3d engine's scripting language. It'll still have to do more than, say, UnrealScript. The networking code will be in JS, probably the model of the scene graph, etc. On the other hand, it's probably faster than UnrealScript; I know it's faster than TorqueScript.<p>Space requirements are the real killer, though. Current techniques rely on ever higher-resolution textures, 1024 pixels square or more, including additionally a displacement map (so that the textures appear three-dimensional) generally of equal resolution. These are for character textures -- the environments that they inhabit include literally gigabytes of resources that are streaming in and out of the GPU.<p>So almost any Modern Warfare game is never going to happen on the browser. We're talking gigabytes of content, as opposed to the megabytes we typically load even on content-heavy sites.<p>Nonetheless, a mixture of traditional and procedural techniques could get us a lot of the way there. Maybe use up a couple of MB on character textures, which contain difficult-to-generate details, and a few more on level geometry, but generate procedural textures and displacement maps for the environment.<p>I know it seems like the traditional wisdom is "never gonna happen", but that's only true so long as traditional games are "never gonna" get off the CPU and move most of their code onto the GPU (physics as well as drawing). Once the heavyweight tasks can be offloaded, a new and bewildering world opens up.
评论 #4339875 未加载
评论 #4334383 未加载
tszming将近 13 年前
If you have watched Carmack's previous keynote, he strongly believe in static typing and static analysis, not only features and performance.
quux将近 13 年前
Anyone have a link to a video of Carmack's keynote?
dsirijus将近 13 年前
Huh? I'm really not the one to pull in the generic argument but - there's a place for both and much more.<p>It's great not needing write hundreds of lines of boilerplate code to get a 2D physics game prototype running, and conversely, it is nice to get awesome graphical support using directx sdk, much of it handled in there by sane API.<p>Whatever floats your boat.
kabir_h将近 13 年前
Language arguments aside, it's hard not to look at the three.js 3D examples and not be impressed by how far browser 3D rendering has come: <a href="http://mrdoob.github.com/three.js/" rel="nofollow">http://mrdoob.github.com/three.js/</a>
ja30278将近 13 年前
As an aside, I find that I usually disagree with anyone who feels compelled to frame their argument as an 'open letter'.<p>In this case, I agree that javascript is ubiquitous, and has the advantage of being delivered to the end-user in (more or less) source code form. However, the language itself is a mess, and it's a bit of a shame that we seem to have gotten stuck with it for so long as the only dynamic web runtime.<p>I think the most annoying thing about javascript is that people who learn it for web-programming seem to insist on using it everywhere, without regard for whether it's the best tool for the job.
Avshalom将近 13 年前
An aside to anyone who does want to just push pixels with native code in 3 lines: <a href="http://code.google.com/p/pixeltoaster/" rel="nofollow">http://code.google.com/p/pixeltoaster/</a><p>Pixeltoaster is a dead easy to use framebuffer wrapped on top of GL/SDL. It also comes with a timer and keyboard/mouse input, it's pretty much as much fun as you can have in C++.
dinkumthinkum将近 13 年前
JavaScript is our generation's Apple II? Look I think Javascript is great but this is just ridiculous. But then I think it's also crazy to throw away all this great work on hardware and software and only innovate for the Web where we are re-solving problems that were solved long ago just so they are "Web based."
etanol将近 13 年前
&#62; <i>Right-Click -&#62; View Source is what made the web so successful and it's awesome that we now have this for 3D graphics as well.</i><p>That can't be serious. I bet he didn't try it on GMail.
评论 #4334842 未加载
huhtenberg将近 13 年前
Stage 3 of linked X-fire game on my super-duper 64bit laptop running latest FF is just plain laggy. Just saying.
vishaldpatel将近 13 年前
Dear John..
papsosouid将近 13 年前
Javascript doesn't have a monopoly on "you can move a sprite in only a few lines of code". I can do that in C too, libraries aren't new. None of the horribleness of javascript is justified simply because you don't feel like using a higher level library in a sane language.
goggles99将近 13 年前
Hmmm... well games these days come on a DVD with 2 gigs of graphics. How could a JavaScript game streaming over the web do something like that??? PC games with high end graphics and gamers have pretty much driven PC sales/upgrades for the last decade. I really doubt that gaming enthusiasts are going to be happy with their FPS going into the toilet and loading times taking 5 minutes to download all the textures.<p>Are we going backwards in terms of technology?<p>Lets make a distinction here. Javascript is fine for phone games and puzzle games. That is about it. Same reasons why embedded chips are STILL programmed using 35 year old assembly/C and always will be. It is the right tool for the job that wins.<p>Hype can be a very bad thing for technology. I realize that web developers are creating quite a clamor with their aspirations of becoming game developers (better money, more fun, and higher status among peers) but the real game devs are going to blow you and your toys away (you are using the wrong tool for the job). Basic programmers did this in the 80s and we all know what happened to that LOL.
goggles99将近 13 年前
The Web browser will eventually be an OS. It will provide a common language runtime for graphics and code execution.
Yuioup将近 13 年前
No, Python is what John should be teaching his son, not fucking JavaScript.
评论 #4334772 未加载