Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C String Libraries

Name: Anonymous 2010-02-20 10:48

What are your experiences from using C string libraries (bstring and friends)? I'm starting a project that I'm going to write in ANSI C and that is quite heavy on string processing, and having support for actual strings (as opposed to null-terminated arrays) would be a real time saver. And no, I'm not going to use glib or any other `let's make C something else entirely' solution.

Name: Anonymous 2010-02-20 13:35

>>5
Ever heard of the ECL (Embeddable Common Lisp, CL to C) and Gambit-C (Scheme to C) implementations. You could compile your code to C and just use that, unless you want C programmers to edit/work on that code afterwards, which would mean you would either have to write it in C, or use something like thinlisp.

Personally I always found string handling in C somewhat tedious, but it's not too hard. Write yourself a structure which can hold: 1) string length 2)string encoding (optional if you will only work with one encoding) 3)character buffer, and then write operations on that, usually extending on standard libc ones. You'll end up with a fairly safe way to handle strings, but it won't make you less of a human compiler, unless you add yourself enough functionality for string manipulation (formatting, reading patterns, regexps, maybe some lex/yacc,...). If I were you I'd prefer writing this in any high-level language which has decent string handling capabilities (Common Lisp, C#, Java, Perl, ...).

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List