TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

DeviceScript – TypeScript for Tiny IoT Devices

264 点作者 stunt将近 2 年前

24 条评论

samwillis将近 2 年前
Previous discussed a couple of weeks ago: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=36059878" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=36059878</a> (101 comments)
评论 #36274772 未加载
iamflimflam1将近 2 年前
One of the biggest challenges will be drivers for the actual hardware - at the moment it looks like they have support for SPI and for built in LEDs. But it&#x27;s a big challenge to expose all the different peripherals that come with MCUs in a consistent way.<p>Actually, looks like they&#x27;ve got quite a lot of stuff done already:<p><a href="https:&#x2F;&#x2F;microsoft.github.io&#x2F;devicescript&#x2F;api&#x2F;clients" rel="nofollow">https:&#x2F;&#x2F;microsoft.github.io&#x2F;devicescript&#x2F;api&#x2F;clients</a> <a href="https:&#x2F;&#x2F;microsoft.github.io&#x2F;devicescript&#x2F;api&#x2F;servers" rel="nofollow">https:&#x2F;&#x2F;microsoft.github.io&#x2F;devicescript&#x2F;api&#x2F;servers</a>
评论 #36256805 未加载
评论 #36256055 未加载
nicce将近 2 年前
Is the only reason for this to make it possible for web developers or people who know TypeScript to write code for IoT Devices? To fill the lack of experienced low level programmers? Because as language alone, I don&#x27;t see a reason why I should I ever use this if I am not familiar with TypeScript already.
评论 #36256602 未加载
评论 #36257159 未加载
评论 #36255938 未加载
评论 #36261044 未加载
评论 #36257636 未加载
评论 #36256284 未加载
评论 #36256679 未加载
danielEM将近 2 年前
My personal opinion is that good typescript to C transpiller would do a way better job, tons of microcontrollers supported out of the box. I would be also happy to use it for desktop. With some tricks it could even support references and additional numeric data types (u8, i8 ... ) without breaking any syntax
评论 #36262989 未加载
评论 #36263641 未加载
评论 #36264171 未加载
评论 #36261233 未加载
andrewstuart将近 2 年前
I really want to be able to compile typescript to not javascript. Ideally to native but if it’s bytecode or whatever that’s fine I don’t care.<p>It’s a nightmare trying to deal with bundling and compiling and targets and different import schemes ugh.<p>I wish I could compile my programs it compiles all the stuff in node modules and gives me some working code.<p>Desperate to get away from nodejs I tried deno and bun …. neither of them are anything close to a drop in replacement for nodejs.
评论 #36256174 未加载
评论 #36256666 未加载
Benjamin_Dobell将近 2 年前
&gt; <i>== and != operators (other than == null&#x2F;undefined); please use === and !===</i><p>That&#x27;s a whole lot of equals signs.<p>Typos aside, this all looks really amazing!<p>Although by no means sound, the ergonomics of TypeScript&#x27;s type system are phenomenal. Really glad to see additional use cases beyond traditional JS runtimes.
评论 #36255800 未加载
评论 #36255724 未加载
评论 #36258468 未加载
biosboiii将近 2 年前
Main thing everyone overlooks: If you can run the same program in C on a MCU for 5 cents less, they are absolutely gonna go with that.<p>Cost cutting in high volume electronics is crazy.
评论 #36258013 未加载
geijoenr将近 2 年前
Is really hard for me to understand how running an VM on a resource constrained device has any benefit. There is a reason why those devices run using very lightweight &quot;OS&quot;s like FreeRTOS and Embedded C.<p>Why the constant obsession to apply a technology designed for a specific purpose everywhere else, even when it doesn&#x27;t make sense?
评论 #36256984 未加载
评论 #36255984 未加载
评论 #36256076 未加载
评论 #36263174 未加载
评论 #36256000 未加载
评论 #36256220 未加载
评论 #36256386 未加载
评论 #36256312 未加载
评论 #36256498 未加载
评论 #36256154 未加载
Etheryte将近 2 年前
This looks really promising and that&#x27;s coming from someone who used to hand roll assembly for my hardware projects in uni. Since my day to day focus is elsewhere these days I need a setup that will hold my hand and hide away as many footguns as possible. I&#x27;m already familiar with Typescript so using the same language in a different environment is a win. Having that system be backed by a large company is a great boon as well, as it means there&#x27;s a somewhat smaller chance of it disappearing from underneath me (Google&#x27;s projects notwithstanding).
samtho将近 2 年前
I’ve been mixed about using alternative languages or specialized runtimes on IoT devices and while I think an inherently event-driven language like JavaScript, with its first-class function as value support and widely used patterns, I’ve been of the mind lately that building firmware with these tools may be the wrong approach.<p>First, most IoT device behavior can be described with a finite number of actions, and usually revolves around reading and writing bits to a bus (I2C&#x2F;TWI, SPI, USART, CAN) or GPIO. Hardware is only really configured once and ran forever.<p>I think there is a place for a hardware system that self-describes to an entity and receives a bytecode procedure for each phase of its operation. This byte code can be made small because there are not many operations to really be done and the firmware would just directly execute it and handle updates, versions, and device abstractions.
评论 #36260302 未加载
jillesvangurp将近 2 年前
Sounds a bit similar to assemblyscript. I wonder if there&#x27;s a connection between those projects. Assembly script targeting WASM on small devices might be useful.
评论 #36258582 未加载
评论 #36258158 未加载
iamflimflam1将近 2 年前
There&#x27;s a lot more information on the marketing site:<p>* TypeScript for IoT: The familiar syntax and tooling, all at your fingertips.<p>* Small Runtime: Bytecode interpreter for low power&#x2F;flash&#x2F;memory.<p>* Hardware as Services: Client&#x2F;server architecture for sensors and actuators.<p>* Debugging: In Visual Studio Code, for embedded hardware or simulated devices.<p>* Simulation and Testing: Develop and test your firmware using hardware&#x2F;mock sensors. CI friendly.<p>* Development Gateway: Prototype cloud service with device management, firmware deployment and message queues.<p><a href="https:&#x2F;&#x2F;microsoft.github.io&#x2F;devicescript&#x2F;" rel="nofollow">https:&#x2F;&#x2F;microsoft.github.io&#x2F;devicescript&#x2F;</a>
eternityforest将近 2 年前
Microsoft is really doing amazing with FOSS lately. The only things I see missing are some kind of filesystem. It doesn&#x27;t seem quite ready to replace CircuitPython but probably will in time.<p>The big potential I see here is App-capable devices. That&#x27;s really the missing factor with the IoT right now, the apps are separate from the device. We have to adapt everything around it to be able to talk to it, and usually you can&#x27;t because it&#x27;s all proprietary.<p>But if we had an OS and an App store, any device would work with anything.<p>We could actually get some good use out of Matter being IP based, if we could run apps on our smart plug.<p>It would be especially great for things that have a display.<p>I&#x27;m not sure why nobody has made an IoT OS with an app store yet, but it would&#x2F;will be awesome.
juancampa将近 2 年前
&gt; The main difference in semantics between DeviceScript and JavaScript is that DeviceScript programs run in multiple fibers (threads). In practice, this behaves like JS with async&#x2F;await but without an ability to manipulate promises directly (that is fibers can only interleave at await points and at most one fiber runs at any given time).
tgv将近 2 年前
The language seems rather complete [L], which makes me wonder: would that byte interpreter be of any use in other environments? How fast is it compared to e.g. V8 and JavaScriptCore? And to µPython?<p>[L] <a href="https:&#x2F;&#x2F;microsoft.github.io&#x2F;devicescript&#x2F;language" rel="nofollow">https:&#x2F;&#x2F;microsoft.github.io&#x2F;devicescript&#x2F;language</a>
评论 #36258145 未加载
paulddraper将近 2 年前
(24 May 2023) <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=36059878" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=36059878</a><p>(26 May 2023) <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=36079842" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=36079842</a>
rkagerer将近 2 年前
No ESP32-S3?<p>This looks great but needs a non-frictiony way to bolt together with some C or assembly code where needed. Not sure about JADAC, and wondering how hard it would be to write libraries &#x2F; servers &#x2F; whatever for sensors, DMA, ADC, etc.<p>Also note docs say &quot;Serial, SPI, PWM are not supported yet at the DeviceScript level.&quot;
评论 #36258785 未加载
评论 #36257053 未加载
ostenning将近 2 年前
This might be suitable for dumb IoT devices that are connected to a power adapter, but as soon as you begin working with battery powered products, time critical systems, or require to reduce BoM costs, this sort of thing goes out the window.
ranguna将近 2 年前
Finally, I&#x27;ve been waiting for this for years now!<p>Now it&#x27;s just a matter of continuing to expand the integrations. Will have to look at what the process looks like for creating custom integrations for existing libraries when non exist.
评论 #36256328 未加载
user_account将近 2 年前
Do they really need to &quot;Embrace, extend, and extinguish&quot; micropython?
评论 #36257658 未加载
nimish将近 2 年前
Will this go the way of .NET micro framework and be abandoned eventually?
Already__Taken将近 2 年前
so kind of espruino but es6 and typescript? that would be very cool.
TheLoafOfBread将近 2 年前
Why not just use LUA?
评论 #36255568 未加载
评论 #36255527 未加载
评论 #36263558 未加载
NathanielBaking将近 2 年前
Microsoft has a long history of fracturing programming language markets. It&#x27;s not so much that it is a bad idea, more that it divides an already healthy market. There is MicroPython, Arduino, and Node-RED not to mention all of the C&#x2F;C++ based systems out there: mBed, Zephyr, and RIOT OS. Another addition is not helpful.
评论 #36256341 未加载