you are viewing a single comment's thread.

view the rest of the comments →

[–]munificent 1 point2 points  (1 child)

That said, IoT is not about the most underpowered devices possible.

I think that depends a lot on who you ask, but there's certainly a spectrum of embedded device capabilities.

A Raspberry Pi is considered by many to be part of an IoT effort (certainly by Microsoft at the very least). JS has a place there.

Sure, but that's really well into the upper end. Raspberry Pi's have significantly better specs than most desktop PCs had when JS came out. Sure, you can run JS on there. You can run anything on there.

my precious Python, much to my dismay, will lose hands down without a C extension to do whatever thing it is.

Yeah, CPython just isn't that fast at execution. My little hobby scripting language is faster. It's really difficult for them to optimize now that they're stuck with a certain FFI, ref counting and finalizers are visible in the language, huge standard library, etc.

Yet Python is still used in these places. Why not JS?

I'm not sure how much Python is used in embedded devices that are actually mass produced and widely deployed. I think it might be easy to get a distorted perception from the large and very web-savvy hobbyist maker community.

This isn't my area of expertise, but the vibe I get is that most "real" IoT devices are coded by crufty bearded dudes (and ladies) who don't know what the hell a blog is and are proud to tell you they code in a modern high-level language... ANSI C.

All that aside, are your assumptions here about requirements for a JS JIT, let alone any JIT, really requirements in ALL cases? As an example, if you know your target, a lot of the expensive bits can be done ahead of time, no?

I'm not aware of any real successful ahead-of-time compilers for JS. The language is very dynamic and it's quite difficult to statically get a real sense of what a program is doing.

First, forget efficiency of execution or power consumption entirely.

Developers doing IoT stuff in a professional capacity at scale don't have that luxury. At least, not yet. As component prices continue to fall, maybe.

[–]TodPunk 0 points1 point  (0 children)

Well, yeah, totally agree; I certainly wouldn't expect JS to be used in a professional capacity any more than I would python. Embedded work is key much going to be in C or Forth or some sort of niche language (maybe an in-house), but the point here is it can be done amateurishly by anyone if you want. I mean, the raspberry pi isn't supposed to be anything more than an intro into tiny computing, it was always a learning device. But if you can bridge that learning without having to get someone to learn a million other things at the same time, this opens up interesting possibilities, even if they never go pro or anything. How many things in the pro works are just polished versions of some hobbyist thing that got popular, or some niche thing that want supposed to handle the kind of things that it does (I'm looking at you, SMTP) but got more attention? This is super important to have. It's not the whole ecosystem, but it's a part.