Live data from Hacker News

JavaScript right on the hardware

technical.io

241–250 of 320 posts

Re: JavaScript right on the hardware

#241

Earlier quoted context omitted.

It takes less than an hour to learn and get used to it if you know the standard Java-style OOP already. It's worth it and it'll give you a whole new opinion on what OOP means. I made this a while ago, see if you can figure out how it works: http://jsfiddle.net/AXTdj/

I know how it works, I just find it worse, by far. There's a whole lot more overhead to getting it working, specifically all of the foo.prototype stuff, and it doesn't require that everything be together. Sure, it's kinda nice that you're able to extends objects later on, but I'd rather have everything neatly declared in one place. It definitely does not "give me a whole new opinion on what OOP means", it furthers my…

You know that you can just do

foo.prototype = { dothis: function(){}, dothat: function(){}

}

In the beginning I wrote it more like

foo.prototype.dothat = function(){} foo.prototype.dothis = function(){}

Which was a lot more ugly.

Re: JavaScript right on the hardware

#243
post #125
post #28

First off, this is cool. It is tremendously exciting to see the bar for hardware hacking getting lower and lower. To the people complaining "Why JS? C is fine!", remember that once the complaint was "Why C? ASM is fine!". At the same time, I can't help but grin that we on the CS side find a way to erase all the gains in performance and efficiency as soon as the EE guys make them. There has to be come kind of universa…

At the same time, I can't help but grin that we on the CS side find a way to erase all the gains in performance and efficiency as soon as the EE guys make them. This is a long-noted phenomena. The old saying that summed it up was, "Andy giveth, Bill taketh away." (Referring to Andy Grove of Intel and Bill Gates of Microsoft.)

In its most extreme form it's also known as "Wirth's law" https://en.wikipedia.org/wiki/Wirth%27s_law

Re: JavaScript right on the hardware

#244
post #238
post #234

Earlier quoted context omitted.

People like yourself are the exception, usually the majority follows what the parent post was stating. As someone that codes since 1986 with a CS degree, I am often dismayed what many "programmers" seem to know nowadays.

To quote Sturgeon "90% of everything is CRUD". Majority of people that get CS now is due to money (how else to justify the expense of a diploma?), not the appeal computers have, and it's been like that for a while. Lowering barrier to entry is +EV move, almost always. It multiplies crud but more importantly multiplies the 10% that are worth the crud.

> Majority of people that get CS now is due to money (how else to justify the expense of a diploma?)

Not sure where you are, but universities in Europe are not like in USA.

In many countries public universities are more renowned than private ones and in some, it is even quite symbolic what you pay per semester.

Re: JavaScript right on the hardware

#245
post #30
post #14

Earlier quoted context omitted.

JavaScript is my favorite programming language. It's not perfect, but still. (Other languages I know: Ruby, Python, Java, Go, Scheme, C, Erlang).

Why? I really would like to understand, because I see JS as a necessary evil, and would rather use something else if given the option.

Reasons to like js:

1) There are very fast implementations in production, as well as an arms race between some of the world's most powerful titans of software development to outdo each other at js vm performance.

2) It is a thin abstraction over the Reactor Pattern, which is very useful for certain kinds of event-based applications.

3) Very lively and robust package ecosystems in npm (node) and jQuery (web). Virtually all packages are async by default.

Re: JavaScript right on the hardware

#247

Forgive me for not being hip but why try so hard to put JS in new places? It seems to be just an unfortunate historical accident that JS is one of the most popular languages in the world - does anyone actually like it compared to other modern scripting languages? Could we invest in CoffeeScript instead, at the very least?

CoffeeScript is JS. And to be more honest and judgemental, CoffeeScript is the sweeter-but-poorly-documented Javascript. The reason people are attempting to put javascript everywhere is because they can and because others enjoy it. And those who do enjoy JS, know what parts of JS are to be avoided at all costs. And I actually like it compared to other modern scripting languages for two reasons:(1) I don't have to wor…

What do you mean by "CoffeScript is JS"? CoffeeScript is not JavaScript. CoffeeScript compiles to JavaScript.

Re: JavaScript right on the hardware

#248
So, it's not actually JS in silicon (would that add much performance anyway, since JS is so dynamic? at best it would be asm.js-like, I'd guess...), but a supported language for an embedded device. I had a ghastly bizarro moment there: JS strikes me as bash + C syntax (not tsch)... in silicon...

Re: JavaScript right on the hardware

#249
post #136
post #26

Earlier quoted context omitted.

> poorly-documented what?

There still isn't any language specification, is there? JavaScript, TypeScript, and Dart have one.

But the one-page manual of coffeescript is far more useful to users than those looong specifications. No document about the syntax is better than the annotated source of the parser. And you can find specifications about all kinds of javascript runtimes elsewhere, they document the coffeescript runtime too.

Re: JavaScript right on the hardware

#250
post #23

Earlier quoted context omitted.

ARM tried this with Java, it was called Jazelle and was (is?) a complete disaster.

Various smartcards use subset of Java 2 bytecode (search for "Java Card") although I'm not sure if it's particularly better or worse than running some other kind of instruction set.

Jazelle basically turned into an extension of Thumb2, where there are few extra instructions for things like bounds checks. It should theoretically help make faster JITs in general (not necessarily just JVM ones).
Post reply on HN