Live data from Hacker News

DeviceScript – TypeScript for Tiny IoT Devices

github.com

141–150 of 160 posts

Re: DeviceScript – TypeScript for Tiny IoT Devices

#141

Earlier quoted context omitted.

Yep. For example, it supports ESP32. Every problem sure starts to look like a ESP32 nail if I have this tool chain available.

Depending on the kind of work you do, this may not be a problem . For my day job, I use STM32/C++ because it's what the company has standardized on. For my side gig/consulting work, I've pretty much standardized on ESP32 because it's cheap, has lots of resources and good community, and I can leverage the Arduino ecosystem. It's grossly overkill for a lot of projects but no-one cares . Clients just care that you can s…

Agree 100%

That was my point - the ESP32 is so versatile and cheap, it's my go-to these days for pretty much everything.

Being about to have an easy and reasonably powerful js runtime for that sounds great.

Apparently node-red also has something for esp32?

And I haven't tried it, but low.js looks cool too [1]

[1] https://github.com/neonious/lowjs

Re: DeviceScript – TypeScript for Tiny IoT Devices

#142
Microsoft is really doing amazing with FOSS lately. The only things I see missing are some kind of filesystem. It doesn't seem quite ready to replace CircuitPython but probably will in time.

The big potential I see here is App-capable devices. That'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't because it's all proprietary.

But if we had an OS and an App store, any device would work with anything.

We could actually get some good use out of Matter being IP based, if we could run apps on our smart plug.

It would be especially great for things that have a display.

I'm not sure why nobody has made an IoT OS with an app store yet, but it would/will be awesome.

Re: DeviceScript – TypeScript for Tiny IoT Devices

#143

Earlier quoted context omitted.

Good luck understanding things like `if(!!!c) { ... }` or why a line-break after a return statement matters in JavaScript/TypeScipt ;) JS has its own footguns and legacy baggage.

I've never seen `!!!` in JavaScript, and I do a lot of it. Care to share?

And line breaks after return statement? Is that true? Haven't stumbled on that one. So this is probably misinformation.

Re: DeviceScript – TypeScript for Tiny IoT Devices

#144

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

I think a language that just transpiled to the equivalent C would be pretty awesome. I know Google is building Carbon, but it is more focused on C++. They pitch it as Typescript to JavaScript, Scala to Java, Carbon to C++. Instead of Rust or Zig trying to replace C++ or Java, is seems better to just integrate with it without linking through some FFI. I'm working on some C code for some microcontroller since it was to…

I use Nim on embedded precisely for that reason: https://github.com/elcritch/nesper

I wtapped much of zephyr as well but that ones less used: https://github.com/embeddednim/nephyr

Re: DeviceScript – TypeScript for Tiny IoT Devices

#146
post #143

Earlier quoted context omitted.

I've never seen `!!!` in JavaScript, and I do a lot of it. Care to share?

And line breaks after return statement? Is that true? Haven't stumbled on that one. So this is probably misinformation.

No, that one is true. JS automatic semicolon insertion is dumb.

   return
     

A JSX paragraph

is a common mistake from novices; it'll return void/undefined.

In TypeScript, at least, you get yelled at for this.

Re: DeviceScript – TypeScript for Tiny IoT Devices

#147

Earlier quoted context omitted.

I could be wrong, but doesn't vlang and nim do this?

Has vlang managed to get past its controversies and actually deliver on its promises? Last I heard it was still promising too much, under delivering and not handling the feedback too well.

It delivers on everything listed on the website/docs. You can check for yourself.

Re: DeviceScript – TypeScript for Tiny IoT Devices

#148

Previous discussed a couple of weeks ago: https://news.ycombinator.com/item?id=36059878 (101 comments)

Thanks! Macroexpanded:

DeviceScript: TypeScript for Tiny IoT Devices - https://news.ycombinator.com/item?id=36059878 - May 2023 (101 comments)

Re: DeviceScript – TypeScript for Tiny IoT Devices

#149
post #59

Earlier quoted context omitted.

LwIP (especially with Simcom’s SIM7000 via PPPoS underneath it) gives me PTSD. Even with decent JTAG debugging, it’s such a pain.

I think it's especially scary when most devkits come with it pre-integrated by the manufacturer, but the quality of that integration varied widely. My experience is nearly a decade out of date at this point, but when I was last going Cortex M3 stuff, I found that the integration of TI/Stellaris was excellent, and the integration on STM32 was one landmine after another— and the same held true for the USB stacks, even…

Yeah the STM32 dev kit (CubeMX etc) is all kinds of horrifying. ESP-IDF is better in some ways, worse in others. Its LwIP integration (esp_netif) is okay but has some interesting bugs you can hit. Like creating sockets leaking memory even after the socket is closed! Yay!

Re: DeviceScript – TypeScript for Tiny IoT Devices

#150
post #91

Earlier quoted context omitted.

You are completely missing my point. When I have C code and compile it, I will have opcodes which processor can run. All my bugs are going to happen only in C code and I can debug those using one debugging probe. When I have embedded scripting, then I have C code which represents my VM and I have also scripts. Then I am hunting for a bug in C code and script itself. I need two debugging stacks to get the problem solv…

DeviceScript comes with a source-level debugger for the VM code. Indeed, if you add C code and that crashes it maybe harder to debug than a pure C system, however it wasn't my experience while developing DeviceScript - it was either clearly a bug in C that didn't really depend much on the bytecode, or an exception in DeviceScript which you debug just like in TypeScript. We also support Jacdac [0] which makes it possi…

I appreciate your engagement throughout this post, including how you are gently educating the naysayers.
Post reply on HN