News for hackers. Stuff that matters.
Re:A virtual machine for microcontrollers by irjustin on Tuesday June 01, 2021 @08:59AM (#27353723)
Ugh this article was a total bait and switch.

Kasper Lund has a lot of my respect for work he did on V8 and Dart so I was hoping this was going to be super interesting article about trying to struggle to.... make V8 run on a specific microcontroller!

I think I feel more cheated because of his background and that it's highly featured on HNews.

Re:A virtual machine for microcontrollers by sebe on Tuesday June 01, 2021 @09:38AM (#27354242)
The article does answer the question in the title. "Why doesn’t V8 fit on my microcontroller?"

"It is fast, but prohibitively expensive in terms of memory."

So there's no room for v8 on a $2 board, Toit vm and toit language have been designed from the ground up for the iot world.

Tidbit, Dart team did have an iot project called dartino, before flutter took over the dart world.

Anyway the article was posted on the toit website.

I've been following their progress via twitter. https://twitter.com/toitware https://twitter.com/toitlang

Re:A virtual machine for microcontrollers by jeremyjh on Tuesday June 01, 2021 @09:35AM (#27354196)
So this is a shameless bit of marketing collateral but I also learned from it. I hadn't heard of Toit before.
Re:A virtual machine for microcontrollers by finnthehuman on Tuesday June 01, 2021 @11:00AM (#27355366)
> Ugh this article was a total bait and switch.

Yeah, as someone who works with microcontrollers professionally and would always love better tools to work with, this article didn't do much to sell me.

It is a nice bit of marketing in the way it positioned itself. I don't think I'd be able to articulate why I'm not rushing to use this without getting called an old fogey.

Re:A virtual machine for microcontrollers by tyingq on Tuesday June 01, 2021 @09:02AM (#27353745)
He does offer a few indirect references as to why running V8 on a microcontroller would suck. Like the section on polymorphic inline cache for method resolution.
Re:A virtual machine for microcontrollers by zozbot234 on Tuesday June 01, 2021 @09:08AM (#27353813)
Running V8 implies JIT and there is no JIT on most microcontrollers because they're based on Harvard architecture where no code can be written in data memory.
Re:A virtual machine for microcontrollers by codys on Tuesday June 01, 2021 @09:30AM (#27354107)
A large number of microcontrollers are ARM based, which isn't Harvard architecture. I presume the thinking is that there's some massive number of Harvard architecture chips in mundane things that lets us say "most" are Harvard arch?
Re:A virtual machine for microcontrollers by jeremyjh on Tuesday June 01, 2021 @09:38AM (#27354251)
ARM Cortex-M is a harvard architecture microcontroller. What ARM Cortex-M has in common with ARMv8 are the letters "ARM".
Re:A virtual machine for microcontrollers by zozbot234 on Tuesday June 01, 2021 @09:41AM (#27354306)
Some Cortex-M cores are described as Von Neumann. It varies by specific sub-architecture within Cortex M.
Re:A virtual machine for microcontrollers by tyingq on Tuesday June 01, 2021 @10:44AM (#27355186)
"Modified" Harvard though. The M0 has unified main memory, so JIT wouldn't be immediately ruled out.
Re:A virtual machine for microcontrollers by zozbot234 on Tuesday June 01, 2021 @09:40AM (#27354285)
Many ARM microcontrollers have Harvard architecture as well, for improved interrupt latency compared to plain Von Neumann.
Re:A virtual machine for microcontrollers by phpnode on Tuesday June 01, 2021 @09:16AM (#27353918)
V8 has an interpreter now FWIW https://v8.dev/blog/ignition-interpreter
Re:A virtual machine for microcontrollers by tyingq on Tuesday June 01, 2021 @09:25AM (#27354030)
The ESP32 has IRAM, which you can write to and execute from.