2 ms·
C was my first language, but I hadn't used it (outside of C++) for a long time. In recent days it suddenly crashed my little "use new cool languages for the hec
by fauigerzigerk 10y ago
C was my first language, but I hadn't used it (outside of C++) for a long time. In recent days it suddenly crashed my little "use new cool languages for the heck of it" party.
I was experimenting with Swift, trying to make it fit my rather performance/memory critical string processing needs. As it turns out, you can use C code from Swift about as easily as you can use Java code from another JVM language.
So I implemented a variant of the short string optimization in a few lines of C code. It's amazing how well C fits the bill as a lingua franca for code that does questionable things to bits and/or is meant to be used from other languages.
There's very little competition for C in that role.