Live data from Hacker News

The V8 Myth: Why JavaScript is not a Worthy Competitor

blogs.adobe.com

51–60 of 100 posts

Re: The V8 Myth: Why JavaScript is not a Worthy Competitor

#51

I have absolutely no idea how I would write Hello World in Flash. What compiler do I need. Do I need a compiler. Do I need to buy it? Is that all I need? Compared to: $ vim helo.html alert("hellooooo"); And if you can't write that from scratch, ViewSource on most web pages will give you a good clue. That looks like trump for mindshare, disputed performance questions aside.

A couple of months ago I was looking at Flex. It's a complete nightmare to try and play around with. I downloaded the SDK and tried to make some kind of hello world thing but just trying to make a module with a single function and then call that function was not straightforward at all. I didn't even want a module but I have to have one. Fine. How do I make one? The docs don't even cover this sort of thing. There is basically no tutorial or documentation I could find that told me how to do this. I gave up.

Oh, and that was after I had to add manifest types everywhere like I was writing Java, without a free IDE to complete that junk for me. All the docs I found assumed you have the Flex IDE or Flash Builder whatever it is. Which costs over $500. Apparently it's still 1995 at Adobe Inc.

And people say Haskell is hard to use. I had no trouble getting started with Haskell. `ghci` and away you go.

(I'd like to think that it wasn't my fault. Maybe I'm not as capable as I think I am, but I have written compilers and interpreters in C, Haskell, and Lisp. I have written an x86 assembler in Ruby that emits real x86 machine code as Mach-O binaries. I can write hello world in at least 10 languages. I feel like I have the capacity to understand this stuff. Hello world with an existing compiler should be a piece of cake, not an exercise in frustration.)

edit: Ok, I searched for "flex hello world" and did find something that looks like what I want. I deleted Flex and can't try to run it now though. Still don't like all the complexity but it does look like what I said I couldn't find: http://livedocs.adobe.com/flex/3/html/help.html?content=02_G...

Re: The V8 Myth: Why JavaScript is not a Worthy Competitor

#52
post #21
post #9

Oh, I guess all the JS devs who work in the language every day didn't get the memo. But in all seriousness, who couldn't have guessed that there would be some Flash/Actionscript dead-enders? Incredibly unsurprising that this was posted on adobe dot com.

I work with Javascript everyday. And I hate it. It is broken as a language (var hoisting, this can mean pretty much whatever you want it to, no types, not even a good damm s32int). But it works on all platforms and so it will always beat Flash.

Agreed that var hoisting can be tricky before you encounter a situation where it break something. (I suspect this happens to most JS devs at some point. Certainly has to me!)

However, what's wrong with not having types? Sounds like you're just not a fan of dynamic languages since this isn't a JS-specific issue.

Re: The V8 Myth: Why JavaScript is not a Worthy Competitor

#53
post #26
post #15

Earlier quoted context omitted.

"building some of the largest code bases in the world with JavaScript" You have over 100 MLoc?

You are focusing on the wrong part of the conjecture, the point is, large code bases are being written in JavaScript everyday. Yet, People with the position like the author continue to argue that it can't happen, despite the evidence being readily available. I don't want to dodge your question thought, the answer is yes I have worked on some JavaScript code bases that are several MLoc. Which I would consider for conj…

Project complexity tends to scale exponentially-ish, so I was wondering what you considered "Largest codebases"... according to Googling, Windows is 50M, Android 12M. So a couple million LoC is pretty awesome.

Static typing evangelists seem to have a blind spot: they persistently tend to assert that you can't write good and large dynamic codebases.

Re: The V8 Myth: Why JavaScript is not a Worthy Competitor

#54

I have absolutely no idea how I would write Hello World in Flash. What compiler do I need. Do I need a compiler. Do I need to buy it? Is that all I need? Compared to: $ vim helo.html alert("hellooooo"); And if you can't write that from scratch, ViewSource on most web pages will give you a good clue. That looks like trump for mindshare, disputed performance questions aside.

You need either the Adobe Flash CS5 authoring tool (for frame-based flash files) or the Adobe Flex Compiler (essentially actionscript embedded in XML, kind of like tags embedded in HTML, only nicer and laggier). The Flex compiler is open source, so you can run it from the command line and compile your application. I had a makefile lying somewhere.

Re: The V8 Myth: Why JavaScript is not a Worthy Competitor

#58
"Best performance" is irrelevant if the performance of javascript is good enough.

Maybe this illustrates the dichotemy between traditional engineering and computer science, but in most other forms of engineering you want just-good-enough-to-fulfill-the-requirements because any better means you are spending extra money or doing extra work uneccessarily.

If javascript lets you write a game that runs at a solid 30 frames per second, and write it easily and portably for free, any additional performance is overkill.

For many of the simple types of games people play in a web browser, javascript has been good enough for years. Increased hardware performance will only help javascript.

http://drblast.sourceforge.net/tetris.html

Re: The V8 Myth: Why JavaScript is not a Worthy Competitor

#59
post #49
post #26

Earlier quoted context omitted.

You are focusing on the wrong part of the conjecture, the point is, large code bases are being written in JavaScript everyday. Yet, People with the position like the author continue to argue that it can't happen, despite the evidence being readily available. I don't want to dodge your question thought, the answer is yes I have worked on some JavaScript code bases that are several MLoc. Which I would consider for conj…

Which javascript project did you work on that had several million lines of code? If you can't tell us that, at least tell us what _kind_ of project it was please.

I don't know what project the OP was working on, but right now I'm working on a crm/accounting/scheduling product with several hundred thousand lines of javascript code. Due to the modular nature of the code base, I don't see any reason why I can't break the million mark and keep going.

Although I probably won't. Because I don't have to.

Because unlike with a traditional code base, much of the functionality is provided by the browser (CSS, HTML, SVG, Canvas, Image Support, Geolocation, Storage, you get my point) and not by external libraries which add to the lines of code.

Re: The V8 Myth: Why JavaScript is not a Worthy Competitor

#60
post #21
post #9

Oh, I guess all the JS devs who work in the language every day didn't get the memo. But in all seriousness, who couldn't have guessed that there would be some Flash/Actionscript dead-enders? Incredibly unsurprising that this was posted on adobe dot com.

I work with Javascript everyday. And I hate it. It is broken as a language (var hoisting, this can mean pretty much whatever you want it to, no types, not even a good damm s32int). But it works on all platforms and so it will always beat Flash.

You might want to try out CoffeeScript with contracts:

http://disnetdev.com/contracts.coffee/

Compiles to beautiful JavaScript and gives programmers the ability to check types at compile-type. If you've never used it, I'd compare CoffeeScript to an amalgam of Ruby and Python, with a little Haskell thrown in (take a look at how you specify contracts, for example). If you like functional programming, you'll love CoffeeScript:

  ['fizz' unless i%3] + ['buzz' unless i%5] or i for i in [1..100]  
(fizzbuzz one-liner from http://ricardo.cc/2011/06/02/10-CoffeeScript-One-Liners-to-I...)
Post reply on HN