10 ms·
I used to think similarly to you about C, or even Python for that matter, but after years of leaving C, I am back at it. This is while also learning Rust. Why?
by eggy 10y ago
I used to think similarly to you about C, or even Python for that matter, but after years of leaving C, I am back at it. This is while also learning Rust. Why? Because the easy languages are never self-contained to perform a specialized task, and you wind up going through dependency hell, or rolling your own libraries.
C takes work, but you stay in the same arena while sussing it out. And, in the end, it is truly portable and usually the fastest of any other implementation.
Horses for courses I guess.
- moosingin3space 10y agoI don't understand how using C lets you avoid dependency hell or rolling your own libraries. This comment doesn't make sense to me - dependency management/rolling your own libraries seems to be there in all languages.
- eggy 10y agoI am specifically referring to it in the context of the OP about an embedded device. For general computing, your objections may hold. In all my years of doing small devices, Python's libs wouldn't fit in the space of the unit if you could find the exact library to run on different architectures. The only other languages I have used aside from C for the small devices is Forth or assembler. There are usually ready-made libs or interfaces from the manufacturer. I haven't seem much provided in Python or other high-level languages. The NodeLua project is an exception, and it is promising. I have already began work on a Lisp of mine (written in C) for this device. Others have done so too. I guess if you have a Raspberry Pi or other, you can afford the space, and it is basically a small Linux box, so you can run anything you like. I was sticking to a discussion of small, embedded devices where those are not yet options. In the future, I am sure they will be big enough to fit high-level languages.
- StavrosK 10y ago> And, in the end, it is truly portable and usually the fastest of any other implementation It definitely is, and, when I need these things, I will write the program in C. It's very rare for me.
- eggy 10y agoWhat devices are you writing for, and what type of app? I was programming my Pic chips in assembler in the 90s, and C was high-level at that point ;) I needed C for the other chips because I was running timing-critical apps for high-speed CNC implementations.