Live data from Hacker News

JavaScript right on the hardware

technical.io

191–200 of 320 posts

Re: JavaScript right on the hardware

#191
post #137

Earlier quoted context omitted.

I may know javascript, but my god I wish I didn't have to.

Many people do enjoy writing JavaScript and view it as just as good as Python and others.

I've dealt with these kind of programmers on numerous occasions. While they may claim to know other programming languages, they usually don't know much about them at all, in reality. If they do know another language, it's PHP, which is just about as bad as JavaScript in most respects.

Any programmer who has real experience with a variety of different programming languages will become very aware of how inferior JavaScript inherently is.

JavaScript's problems go much beyond the quirks or oddities we see with programming languages in general. They're severe deficiencies (the lack of proper modules or namespacing, and the lack of proper class-based OO), or inexcusably stupid design flaws (semicolon insertion, its broken scoping rules, its broken type system, its broken prototype-based OO, its broken comparison operators, and so on).

No intelligent, experienced, self-respecting programmer will want anything to do with such a ridiculously flawed and broken language. They surely will not see it as good as Python or any other language that isn't rife with the unjustifiable stupidity that permeates every aspect of JavaScript.

Re: JavaScript right on the hardware

#192

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?

just to answer you: I Like Javascript. I like my functions as first class citizens. I like my prototypes and my inheritance model. I like my callbacks and my closures. I like how I can move from client-side, to server-side, to my TV, all with the same language. I like how easy it is for beginners to produce something useful and for seasoned developers to produce something good. There are many other languages that sha…

How much experience do you personally have with other programming languages, aside from JavaScript (and perhaps PHP, if you're familiar with it)?

Re: JavaScript right on the hardware

#193

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?

I enjoy JS a lot, and will frequently choose it over Ruby or Python. A functional style plays nicely with a lot of the problems I'm solving, it's nearing ubiquity, and there's lots of big names and smart people working on optimizing it even more. In my day job, we write mostly Coffee - which is little more than a preprocessor to JS, IMHO. It's definitely nice to have, but I don't consider it an independent language u…

It's disappointing to see the false "JavaScript is functional" claim thrown around time and time again.

Just because it has first-class functions it does not mean that JavaScript is a "functional" language.

JavaScript does not promote the use of pure functions, referential transparency, and the minimization of state.

JavaScript does not encourage the use of recursion.

JavaScript has an atrociously broken type system, rather than a robust and theoretically sound one.

JavaScript does not offer pattern matching and other functionality offered by modern functional languages.

In fact, it goes out of its way to promote a very imperative, non-functional style of software development, even when efforts are made to try to use it in a functional way.

Re: JavaScript right on the hardware

#194
post #87

Earlier quoted context omitted.

I didn't say you couldn't, I just skimmed over them. The prototype stuff is funky to me, I'd rather just have a straightforward syntax with objects.

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 opinion that I'm not a fan of JavaScript.

Re: JavaScript right on the hardware

#195
a good example of hardware hobyism and of the modern days eletronics renaissance..

maybe its not this one.. but the next computer hardware revolution will born like this.. the same way jobs and wozniak did in the 70´s .. from pure passion

hope my kids create its own gadgets like we did with legos in our days..

long live to the hacker spirit!

Re: JavaScript right on the hardware

#196

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?

It's my fervent hope that developments like source maps and asm.js will eliminate what it basically Javascript's sole competitive advantage; that it's the only language that runs in a browser.

If it's possible to write performant, robust code with good tooling in CoffeeScript/Dart/TypeScript/Python/Clojure/etc., then the peculiarities of Javascript become a lot less important.

Re: JavaScript right on the hardware

#197
post #16

So much negativity in this thread & on HN in general. Not everyone has hardware experience, and this looks great for newcomers.

I completely agree. I'm a front end developer recently out of college and I decided recently that I wanted to expand my knowledge and learn hardware. This seems like a good place to start given my knowledge of JavaScript

If your college education for becoming a developer didn't teach you a lower level language it failed you. Even at my small liberal arts school we use multiple languages (they may all be really, really similar, but they're different languages), and work on low-level things.

I'm aghast that a CS education wouldn't include at least Java, especially considering that a large number of schools switched exclusively to Java at one point.

Re: JavaScript right on the hardware

#198
post #92

Earlier quoted context omitted.

JavaScript, and scripting languages in general (and, to be more specific, dynamically typed languages, too, but those tend to be scripting languages, anyways) tend to have a lot of gotchas, and when it comes to controlling physical things, I think that less gotchas are better. Yes, statically typed languages just put a bunch of metadata in the code, but I think it's useful to have the guarantees provided by a static…

Then just write more unit tests and you'll be fine.

[deleted]

Re: JavaScript right on the hardware

#199

Earlier quoted context omitted.

> the three primary factors affecting the adoption of a programming language by developers are, in this order: > 1. Libraries available Not just programming languages. Microcontrollers too. You could get much better performance out of a bare AVR, but where are the libraries and modules? Whereas an Arduino comes with a library for anything that moves - of course most people are going to prefer it.

What makes the Arduino non-"bare"? The Arduino language is just C++, which gets compiled using gcc and uploaded using avrdude. It's not exactly running on a VM or using an interpreted language.

The Arduino library provides a lot more flexibility compared to the bare AVR + libc, but at the expense of performance. Notably using digitalWrite() can be up to 50x slower than writing to the port registers directly.

Re: JavaScript right on the hardware

#200
post #71
post #54

Earlier quoted context omitted.

I don't have much problem with programming an embedded device in a high-level language, but why JS specifically? Why not Lua, which just as fast, and is better than javascript in many respects?

I would have thought this was obvious, but orders of magnitude more developers know Javascript than Lua[1], thanks largely to the popularity of browsers as a programming environment. According to some recent research[2], the three primary factors affecting the adoption of a programming language by developers are, in this order: 1. Libraries available 2. Familiarity 3. Performance And per the paper, this order of pref…

Language popularity is a pretty fickle thing. It was not too long ago that you'd be laughed out of the room if you suggested using Javascript for any kind of serious work. Perl, once the king of scripting languages by orders of magnitude, is now viewed as being something close to COBOL: a few old guys know it, but none of the cool kids will touch it.
Post reply on HN