Live data from Hacker News

Why are we limited to JS in browsers - would a bytecode standard help?

andrewducker.livejournal.com

51–60 of 187 posts

Re: Why are we limited to JS in browsers - would a bytecode standard help?

#51
post #43

Am I missing something, or did we all have a browser bytecode standard that everyone hopped on board with, and it turned out nobody really liked feeding browsers compiled programs after all?

It meant running as a plugin, which was (at the time) incredibly slow.

Re: Why are we limited to JS in browsers - would a bytecode standard help?

#52
post #46
post #43

Am I missing something, or did we all have a browser bytecode standard that everyone hopped on board with, and it turned out nobody really liked feeding browsers compiled programs after all?

It was never integrated into the DOM, though, was it? I am only aware of it being used in a separate, sandboxed area on the page, unable to interact with anything else except in a very limited way. (Never mind the slow loading time etc)

Have you not done the [java applet DOM] Google search, or is every link on the first SERP wrong in some way?

Re: Why are we limited to JS in browsers - would a bytecode standard help?

#53
post #3

[deleted]

Is JS a good bytecode? Is compiling to it from Java about as efficient as compiling to a bytecode would be? If so (within an order of magnitude, I'm not fussy), then that's awesome - I hadn't realised that things were so efficient.

Lars Bak (author of V8) talks about this quite a bit in this video with Erik Meijer.

http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-E...

summary version - there's not a lot to be gained by doing that(at least from a Goog perspective).

Re: Why are we limited to JS in browsers - would a bytecode standard help?

#54

Earlier quoted context omitted.

I find Javascript depressing. If it had a few more years to develop, it could have been a really great language. I understand why it wound up that way, but, sigh. If you want to see a much better language with the same general design, look at Lua. It's made for scripting C programs rather than web pages, and it has had over a decade longer to mature.

Why do you find it depressing? I'm not saying that there aren't better programming languages than Javascript. I'm just saying that there is a subset of Javascript which is really expressive and elegant.

That elegant, expressive subset is basically Lua. It's been able to jettison most cruft over the years.

I'm not a web developer, but every time I read/use Javascript, it feels like a broken fork of my favorite language. Javascript could have been that good, too. I like where Eich was going with it, but the browser wars etc. meant that shipping an early version made the most business sense, and design errors (which would have shaken out) got frozen in the spec.

Re: Why are we limited to JS in browsers - would a bytecode standard help?

#55
post #46
post #43

Am I missing something, or did we all have a browser bytecode standard that everyone hopped on board with, and it turned out nobody really liked feeding browsers compiled programs after all?

It was never integrated into the DOM, though, was it? I am only aware of it being used in a separate, sandboxed area on the page, unable to interact with anything else except in a very limited way. (Never mind the slow loading time etc)

You could integrate Java applets into the DOM. Now you have two problems. (Keep in mind that back when this was popular IE 4 was busy kicking the pants off of Netscape Navigator. Fancy programming against IE 4?)

Re: Why are we limited to JS in browsers - would a bytecode standard help?

#56
post #43

Am I missing something, or did we all have a browser bytecode standard that everyone hopped on board with, and it turned out nobody really liked feeding browsers compiled programs after all?

Java Applets never were a first class citizens in the browser. Same as Flash. I think it's a really good idea to have some LLVM-type of bytecode standard.

Re: Why are we limited to JS in browsers - would a bytecode standard help?

#57

Earlier quoted context omitted.

I find Javascript depressing. If it had a few more years to develop, it could have been a really great language. I understand why it wound up that way, but, sigh. If you want to see a much better language with the same general design, look at Lua. It's made for scripting C programs rather than web pages, and it has had over a decade longer to mature.

JavaScript was released in 1995 as part of Netscape Navigator 2.0. Lua was released in 1993. I don't know about a decade .

Lua has been able to make major, reverses-compatibility breaking changes to improve its design in ways Javascript hasn't. Where Javascript has "The Good Parts" and incrementally improving implementations, Lua has been able to fix things and evolve.

"One thing Mike [Pall] didn't highlight: get a simpler language. Lua is much simpler than JS." - Brendan Eich (http://lambda-the-ultimate.org/node/3851#comment-57671)

Re: Why are we limited to JS in browsers - would a bytecode standard help?

#58
post #52
post #46

Earlier quoted context omitted.

It was never integrated into the DOM, though, was it? I am only aware of it being used in a separate, sandboxed area on the page, unable to interact with anything else except in a very limited way. (Never mind the slow loading time etc)

Have you not done the [java applet DOM] Google search, or is every link on the first SERP wrong in some way?

From the first hit: "Java applets may need to perform Java to JavaScript communication to access the Document Object Model (DOM)..."

So it seems that it is hardly an alternative.

> ...or is every link on the first SERP wrong in some way?

What I don't expect to find quickly is exactly how long this has been possible in which browsers since when. Was it possible back in the days of IE4 and Netscape 4 or 4.5 or whatever it was?

Re: Why are we limited to JS in browsers - would a bytecode standard help?

#59
Discussions of technical feasibility aside, getting a sufficiently large installed base to make this interesting is (as usual) the "fun" part; your plan for getting to critical mass against an available and "good enough" solution.

As for previous bytecode approaches to consider, there are the Lisp Machines, or the Burroughs B5000 Algol box, or the EFI byte code (EBC) interpreter and the EBC I/O drivers, or UCSD pCode, or all the gonzo things you could do with the VAX User Writable Control Store, the JITs underneath Java and Lua and other languages, or...

And HTTP is printable, which means you're working within character-encoding constraints or with escapements.

There are the not-inconsequential security requirements.

And then there's the question of how a provider might make money with this, if you're not undertaking this effort for free.

Have at...

Re: Why are we limited to JS in browsers - would a bytecode standard help?

#60

Before speculating too much about "a bytecode standard", etc., it would probably be helpful to understand virtual machines and instruction sets. I know web programmers generally aren't big on assembly or writing virtual machines, but an instruction set (group of bytecodes) design and implementation predisposes a processor/VM to certain operations. A VM for an OO language is going to have bytecodes (and other infrastr…

Right, it's same reason we still have ARM despite the success of x86. Or why some hardware vendors bundle FPGAs rather than rely on GPUs or custom ASICs. The instruction set is absolutely vital for a given domain's performance.
Post reply on HN