Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If as a 14 year old your plan is to write an operating system, learning C might make some sense. It just seems like a very unlikely scenario to me.

Also I think a lot of tools for example in Linux are written in other languages.

Most likely scenario for using C as a 14 year old might be doing electronics projects, but I think Arduino is most commonly programmed in Java.



Arduino is C/C++. It's mostly a C++ abstraction built on top of the avr-libc library. The Arduino IDE is written in Java though.


I think you can program the Arduino in C/C++ (like every other Microcontroller), but I was under the impression that it actually has a Java Runtime and the usual way is to code Arduino programs in Java.


The Arduino is based around Atmel's 8 bit AVR architecture which really doesn't have what it takes to run a JVM. The ATmega328P which the Arduino Uno board uses has 32KB of code space and 2KB of SRAM which isn't really enough for something like Java. The normal way Arduino projects are built is by defining a "setup" function and a "loop" function which, when compiled, are actually just called by a hidden C++ file with a main function that essentially does this:

    int main(void) {
        setup();
        for (;;)
            loop();
    }
The actual file does a bit more and can be found in their git repository here: https://github.com/arduino/Arduino/blob/master/hardware/ardu...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: