This sounds awesome. C is my preferred language and I use it whenever I can and when it makes sense. I'd love to see this code. Is there a public repo for it?
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.
Yes, very nice. What I've learned about C recently is that while the default language and standard library has no type safety and is generally horrible, it has all the tools you need to build something that is type safe and not horrible. And, most of the time, it doesn't even incur a speed hit.
Now I just need to teach the people writing 99% of the C programs I encounter to not do it so horribly :)
Excited to see the code. C isn't known for being great for writing high level applications like this, so I'm really curious what the source looks like. Especially since it has no dependencies!
reply