11 ms·
> the three primary factors affecting the adoption of a programming language by developers are, in this order: > 1. Libraries available Not just programming l
by Florin_Andrei 13y ago
> the three primary factors affecting the adoption of a programming language by developers are, in this order:
> 1. Libraries available
Not just programming languages. Microcontrollers too. You could get much better performance out of a bare AVR, but where are the libraries and modules? Whereas an Arduino comes with a library for anything that moves - of course most people are going to prefer it.
- icebraining 13y agoWhat makes the Arduino non-"bare"? The Arduino language is just C++, which gets compiled using gcc and uploaded using avrdude. It's not exactly running on a VM or using an interpreted language.
- Florin_Andrei 13y agoSure, but with Arduino you're still floating on top of the Wiring libraries for almost anything you do. Coding a bare-metal AVR is a bit different: http://florin.myip.org/blog/how-make-halloween-creepy-blinking-eyes-atmel-avr-microcontroller http://florin.myip.org/blog/how-make-halloween-creepy-blinki... There's no significant difference, unless you want fully predictable real-time behavior (of which my piece of code is NOT an example, but that's all I have online). Most people shouldn't care.
- euroclydon 13y agoThanks for sharing. I'm working (very slowly at the moment) on an AVR simulator in order to teach myself C. I think this is a great little program to compile and test with.
- marssaxman 13y agoYou can start with a straight-up Arduino program and mix in as much bare-metal AVR code as you like. There's nothing in between you and the hardware, and that's important when you discover that time matters. I've done a fair amount of embedded work, some with AVRs and some with various ARM chips, mostly Cortex-M3... I always start with the nice libraries because why waste your time reinventing that stuff if you don't have to? But when you have to reach deeper and gain finer-grained control over your hardware - and almost every project eventually has to do that eventually - it's really, really nice not to have some VM in the way, not to have to start over in a lower-level environment.
- ksrm 13y agoThe Arduino library provides a lot more flexibility compared to the bare AVR + libc, but at the expense of performance. Notably using digitalWrite() can be up to 50x slower than writing to the port registers directly.
- marssaxman 13y agoYes, but you can still write to the port registers directly. Using the Arduino libraries doesn't lock you out of anything. There's a smooth, continuous path from high-level C++ abstractions built on the Arduino primitives down to the bit-twiddling low-level C world. If you're walled off in a Javascript VM, you can never have that kind of transparent access to the hardware - which seems like a big problem when you are building electronics, and controlling the hardware is the entire point of the job.