Earlier quoted context omitted.
I don't think the language has been the problem. Just look at the Arduino. For me, the main challenges always were getting the program onto a chip and wiring everthing so that is does not break or shortcut.
Errrrm, if you ever look at the AVR C library that Arduino was based off of, you would probably not be so quick to say that it isn't a language issue. Not having to know the weird unpronounceable mnemonic for a certain register as well as the specific bit in that register that you set in order to trigger the ADC is a huge plus. Greater abstraction is always welcome if the hardware can handle it. Although I agree with…
JavaScript right on the hardware
211–220 of 320 posts
Re: JavaScript right on the hardware
#212Earlier quoted context omitted.
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 JavaSc…
Why is "class-based OO" necessary? There's nothing wrong with prototypal inheritance. The way modules are done in Node is pretty powerful compared to other languages I've used. The scoping rules are different, for sure, but I don't really see why you'd call them "broken". They're internally consistent and easily comprehensible.
Semicolon insertion is, admittedly a problem. The solution, of course, is to put in your own semicolons. If you do that, and use something approaching reasonable whitespace conventions, there isn't really a problem. JavaScript's `==` the like are, for sure, broken, but that's nothing a `===` can't fix. It's not like the other languages you mentioned wouldn't have issues without reasonable conventions.
Re: JavaScript right on the hardware
#213Earlier quoted context omitted.
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 JavaSc…
Re: JavaScript right on the hardware
#214So much negativity in this thread & on HN in general. Not everyone has hardware experience, and this looks great for newcomers.
To add to this, abstracting away from hardware is exactly what C (which most people consider low-level) was built for. No one wants to write assembly, and even less people want to write 0s and 1s or punchcards. Successfully-executed abstraction is a wonderful thing, people have been trying to abstract away (but retain performance) of C for decades. I welcome newcomers, maybe someone will get it right
Re: JavaScript right on the hardware
#215Hmm, I can see some potential difficulties with making JS work efficiently on that MC. It only has single precision floating point instructions, for one thing, and I can't tell how many cycles those instructions take. I'm guessing they'll just do a variant of JS that uses single precision, but even so, it seems like it would be hard to squeeze any kind of performance out of it.
I took a brief glance at the LPC1830 and it seems it doesn't have hardware floating-point at all. (None of the mainstream Cortex M3 products that I've seen do). Do you have better info on this? So, I believe its FP support is through software and could be written to be double or greater precision. If this is true and if JS can only do floats, it would be bad news for many basic mathematical operations running on this…
By spec, JS only has double-precision floats. However, since that means that 32-bit integers can be exactly represented, V8 optimizes to integer calculations unless actually using floats becomes necessary. I would guess that on this device floating point operations are done in software, but also that they rarely occur in practice.
Re: JavaScript right on the hardware
#216Earlier quoted context omitted.
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
#217Forgive 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…
Re: JavaScript right on the hardware
#218Earlier quoted context omitted.
Okay, maybe Racket and OCaml are relatively obscure options, but quite a lot of people know Java and Python. And I can't say Lua's not popular, too.
I'd expect Javascript programmers dwarf Lua programmers by a couple of orders of magnitude. At least one OOM if you want to limit to people who only know the language "well."
Re: JavaScript right on the hardware
#219Earlier quoted context omitted.
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.
Imagine if the only way you could script Linux servers was in Perl -- it's hard to imagine it falling off in popularity the way it did in our universe. Other languages supplanted it because other languages could supplant it.
Re: JavaScript right on the hardware
#220Earlier 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?
Bare metal Lua: http://www.eluaproject.net/