10 ms·
Tessel: A microcontroller that runs JavaScript
- johnohara 12y agoDevice looks to be based on an NXP LPC1830FET180 microcontroller which uses an ARM Cortex-M3 processor at 180MHz. http://www.nxp.com/products/microcontrollers/cortex_m3/LPC1830FET180.html http://www.nxp.com/products/microcontrollers/cortex_m3/LPC18... The product page seems to indicate it does a more than run JavaScript.
- dkersten 12y agoIt doesn't run javascript (not natively). It runs just like every other ARM microcontroller (so assembly, C, etc). This device has a lua interpreter running as its firmware (coded in C, it looks like) and these guys wrote a javascript to lua compiler. So it runs javascript by compiling it to lua bytecode and then intrepreting it in a C-based intrepreter.
- johnpmayer 12y agoThis is great. I have some small background in real time embedded systems, but I think that 99% of the "internet of things" need not be written in low-level C. I'll probably pick this up... ...however, I do hope that they can bring down the price for future models. $100 is a bit steep for a hobby project to control my AC. For now, I understand that the premuim is rewarding the software effort.
- deleted 12y ago[deleted]
- Timmmmbob 12y agoYou don't have to write in low-level C. You can write in high level C++, which is vastly preferable to javascript! Or hell, why not write in Lua! It's what this apparently transpiles to, and is much nicer. The only reason javascript became popular is because it was the only option on the web. Why does that mean we would want to use it when we have better options?
- bsder 12y ago> You can write in high level C++, which is vastly preferable to javascript! First, C++ compilers are not available everywhere. Second, C++ compilers do not always implement all corners of the language on embedded systems. Third, C++ is better than Javascript? That's going to take some explanation. > Or hell, why not write in Lua! Lua has it's own share of "Wat". 1-based indexing when a non-trivial amount of your stuff needs to interoperate with C is a big one. In addition, Lua is nicely configurable--read, "Every Lua implements a different set of modules." > The only reason javascript became popular is because it was the only option on the web. It's popular to hate on Javascript, but Javascript isn't that bad. Go back and take a look at Javascript in the Netscape 2.0 and Netscape 3.0 timeframe. It's a fairly straightforward, minimal language. Now, all that having been said, this isn't exactly impressive. A 180MHz ARM with 32MB of flash and 32MB of RAM is not a small processor. With that level of power, there are lots of options. If this were running on an 50MHz M0 with 256K flash and 16K RAM, it would be impressive.
- SamReidHughes 12y ago> Third, C++ is better than Javascript? That's going to take some explanation. It's statically typed, and the types you have to work with are a lot simpler.
- com2kid 12y ago.NETMF will run a C# Interpreter in 256KB of RAM and 1/2 a meg of code space. Give it a bit more and you can get a full UI up and running with a WPF variant!
- voltagex_ 12y agoI didn't think NETMF was interpreted. That said, the last time I looked at NETMF I was put off by forum arguments over who owned what code samples.
- dkersten 12y ago> First, C++ compilers are not available everywhere. Neither is javascript. If both are available for this micro, then his statement is as valid as yours. > Second, C++ compilers do not always implement all corners of the language on embedded systems. I've done a good bit of embedded programming in C and I wouldn't need all of C++ to make life a lot easier. > Third, C++ is better than Javascript? That's going to take some explanation. To-may-to/to-mah-to. Whichever way you want to spin it (C++ > javascript or javascript > C++) is going to take some explanation. > but Javascript isn't that bad No. But its also not as that great in comparison to how popular it is. Its certainly improved a lot since the early days, but it still has some pretty significant warts. Most languages do, of course, so if this is an issue or not kinda depends on the "third" above. > Now, all that having been said, this isn't exactly impressive. A 180MHz ARM with 32MB of flash and 32MB of RAM is not a small processor. With that level of power, there are lots of options. Indeed. I wonder how much overhead this has compared to running C on the same thing. I have nothing to back it up and certainly don't have time to benchmark, but I'm convinced I could write a forth interpreter running on a 60MHz PIC24E that would have competitive performance to this thing. Maybe I wouldn't beat it, but I reckon I could come close enough.
- HeyLaughingBoy 12y agoBeaglebone is cheaper and already runs a version of node.js that has extensions to do digital/analog I/O
- dzhiurgis 12y agoSTM32 + espruino. Lost my interest the first day. Couldnt manage to make it run.
- pjc50 12y agoArguably should not be written in low level C, but something safer, lest it become the Internet of Unfixable Botnets.
- GuiA 12y ago$100 for something vastly inferior to a Raspberry Pi, Beaglebone, etc. that cost 1/2 to 1/3 of that. What am I missing here?
- deleted 12y ago[deleted]
- eplanit 12y agoEqually as ill-conceived and/or misdirected as other "language du jour"-specific chips of times past? http://en.wikipedia.org/wiki/PicoJava http://en.wikipedia.org/wiki/PicoJava http://en.wikipedia.org/wiki/Jazelle http://en.wikipedia.org/wiki/Jazelle
- pjc50 12y agoJazelle still exists in newer ARMs; ARM shot its own foot off by keeping it closed, so its use is limited to a few corporates.
- justincormack 12y agoNot really, it has been replaced by ThumbEE https://en.wikipedia.org/wiki/Jazelle#Successor:_ThumbEE https://en.wikipedia.org/wiki/Jazelle#Successor:_ThumbEE
- noodle 12y agoLower barrier of entry for people interested in playing around with hardware development. No breadboards and wires, only pluggable modules. Javascript instead of C.
- kasbah 12y agoNo Linux, which can be an advantage or a disadvantage depending on whom you talk to.
- 12y ago
- rememberlenny 12y agoI won a Tessel at JSConf this year and love it. Are there ways to make our own module attachments? The $50 parts seem a bit steep.
- kam 12y agoYes. The module ports are documented here: https://github.com/tessel/hardware/blob/master/tessel-hardware-overview.md#pins-and-ports https://github.com/tessel/hardware/blob/master/tessel-hardwa... and the JS APIs for using them here: https://tessel.io/docs/hardwareAPI https://tessel.io/docs/hardwareAPI
- VLM 12y agoMy advice is the wrong tagline is up. If you want an embedded device running JS or higher level than C anyway, you toss in a raspi with much better hardware specs for much less money. The secret sauce appears to be (at a glance) great software support (edited to add, I'm talking about "high level bindings" like JS... there's plenty of C for arduino, not nearly as much non-C) for a bunch of off the shelf compatible debugged plugin hardware. Also deeply buried in the docs section it appears to draw a Lot less power than a pi when doin "stuff". Of course if you want to blink a LED I think a PIC 10F220 might just slightly have you beat by approximately six orders of magnitude (no kidding, well 4 to 7 depending on blah). Anyway that kind of stuff should be the primary advertising focus, or at least thats what I found interesting. I'm fuzzy on the "how easy is getting started" part, at least only after five minutes. Not being clear means it must be as bad as gearing up for FPGA work (just kidding I'm sure its not that bad). If its good, this might be an additional secret sauce. Here's a 60 second video from opening box to blinking LED (or, whatever) At least that was the first five minutes impression from a hardware guy who knows the market. And I've now spent more time typing and thinking than I spent looking.
- eudox 12y agoYou win, please, just stop the pain.
- angersock 12y agoJavascript: the embedded parts.
- mtdewcmu 12y agoLearn Javascript the Hardware Way
- pling 12y agoAs someone who does a bit of embedded stuff here and there (professionally), this. I cannot fathom why anyone would even poke this with a stick other than to appease the maker crowd who to be honest scare the shit out of me. And the price. Kill me now.
- batmansbelt 12y agoEspruino is a similar device (without the cool plugins though, so expect to use a soldering iron). Much cheaper too.
- pmontra 12y agoI got one and I'm starting to experiment. I discovered that soldering can be a problem. First, I had to buy a solder. Second, physics is merciless and a mistake can toast your card (didn't happened to me yet) vs the run-fail-debug loop we're used to in sw development. Anyway, some hw modules have been tested with Espruino and the web site explains how to use them. My understanding is that you can plug almost anything into it, you just (!) have to know its specs and how to wire it to the board.
- batmansbelt 12y agoYep, lots of good tutorials, and the creator of the board is quite helpful on email.
- goodbyegti 12y agoIt's absurdly expensive, even more so the modules. Looking at the BT module, the BLE112 can be purchased for $15 in quantities of 1. So you pay $35 for a small PCB, some pin headers and probably a wrapper around a UART.
- mschuster91 12y agoAs written above, everything related to radio has huge upfront costs in certifications. These costs are once-applicable, so if you're making a million-unit BT dongle, then the certification costs per device are fractions of cents. Here with thousand-unit series, the cost per device is massively higher.
- asdfs 12y agoIsn't the BLE112 already certified? Or does integrating it into a product require you to get the entire product certified?
- mschuster91 12y agoIn Europe, the one who imports the device must submit a certification document for the device... so even if you just stick already-approved products together you have to do a complete recertification. This, sadly, also includes selling a "Raspberry Pi computer" with you as distributor packing a Pi and a Wifi stick in a case. Only if you ship the individual components to the customer to self-assemble, you don't need certification...
- tlrobinson 12y agoWhere is the "individual components" line drawn?
- mschuster91 12y agoAs soon as you take anything and put it together, my lawyer has told me. Technically, even computer shops assembling computers from parts will need a full certification for every combination they sell... it's crazy. Add the WEEE regulation (valuable resource recycling) to the mess and you're out a couple thousand bucks if you do everything by the books.
- justincormack 12y agoActually, a microcontroller that runs Lua. They released the source for the JavaScript to Lua compiler today https://github.com/tessel/colony-compiler https://github.com/tessel/colony-compiler
- eurleif 12y agoI wonder if this can be used for redis scripting. I bet a lot of people writing node.js apps would like to be able to write redis scripts in JS.
- anonymoushn 12y agoI wonder if you can run code without going through the transpiler. Then you could program it in a sane language.
- sdegutis 12y agoThat's pretty awesome. I love Lua lately, for its simplicity both in design and implementation, and it's great to see that I can use it in an MCU! That said, it's pretty dumb that it has to have a JS transpiler in order to get popular.
- anonymoushn 12y agoApparently you cannot run code without using the transpiler, but it is planned. They also mention that the API will be awkward to use from Lua, but it's probably pretty easy to fix this. http://forums.tessel.io/t/running-lua-on-tessel/91 http://forums.tessel.io/t/running-lua-on-tessel/91
- justincormack 12y agoLua has actually had a microcontroller project for years see http://www.eluaproject.net/ http://www.eluaproject.net/ but without the nice slick deployment that tessel has.
- bruce_one 12y agoIt could be a really interesting tool for porting (some) javascript npm modules to luvit (a nodejs reimplementation with lua instead of js) as well :-) Just seems like an interesting way to bolster the ecosystem :-)
- habosa 12y agoRelevant: https://xkcd.com/801 https://xkcd.com/801
- ptk921 12y agoIn their code snippet, it seems that position is not defined for the first loop and would throw a ReferenceError.
- refrigerator 12y agoHow does this compare to http://www.espruino.com/ http://www.espruino.com/?
- cobookman 12y agoI wonder how the timing on the micro-controller is. Is the JavaScript still async? While JavaScript +/-10ms is fine on a computer, when messing with signals that really limits you. Mind you this could be overcome by adding some flag before the code to specify it to be run synchronously...or something like that.
- rtpg 12y agonothing in Javascript fundamentally forces IO libraries to be asynchronous, it's just that the domain in which JS is used (Node or Browsers) tend to have a lot of async IO due to networks.
- wyager 12y ago> nothing in Javascript fundamentally forces IO libraries to be asynchronous Javascript inherently relies on highly non-deterministic heap allocation, deallocation, and garbage collection. None of these are conducive to real-time IO. You can not make strong guarantees about javascript execution time. They probably partially get around this by having all the important IO stuff done in C, but then that's not really a javascript microcontroller, is it?
- mtdewcmu 12y agoIt's not clear to me exactly how it came about that javascript is asynchronous. My suspicion is that in the earliest days, javascript was single-threaded simply because that made the implementation simpler.
- ojanik 12y agoNot enough jQuery!
- zwieback 12y agoReally slick looking but way too expensive. Might buy it for $40, tops.
- pessimizer 12y agoWhen I think microcontroller, I think < $5. I'm not sure what this is supposed to be for - it's almost as expensive as a gumstix board.
- mpnordland 12y agoYes, because we really, really need something else to run JS.