Hacker News new | past | comments | ask | show | jobs | submit login
OCaPIC: PIC microcontrollers programmed in OCaml (algo-prog.info)
87 points by lelf on May 11, 2019 | hide | past | favorite | 6 comments



Just a note, this is for PIC18, which is C-friendly. The other 8-bit families (PIC10, PIC12, PIC24, PIC16), the popular ones, are not supported.

This isn't surprising since even a normal C compiler for those is VERY VERY hard. They are very C-hostile (hardware call stack, weirdly banked memory, etc). Some fixes exist in more recent chips (linear memory) but still these are hard for C.


To put it into perspective, the PIC10 has up to 512 instructions and 64 bytes of RAM. IMHO it's not something you'd really want to program in anything other than Asm, because even if a C compiler is available, the "dialect" of C you get is so far from "typical" that you're really just using it as a not-so-portable assembler.

I'm not sure why you included the PIC24, because that's a 16-bit family and more into the region of "not too bad to use C with".


I meant 14. 24 is basically a PDP11 isa and is great for c


Great news to see progress on this front. I'd love to see that for dsPIC33.


Neat! How portable is the VM?


VM is written in PIC18 assembly. It is not portable at all.




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

Search: