Hacker News new | ask | show | jobs
by willcipriano 1567 days ago
Same here, I need something like this for my Lisp interpreter. I was thinking about Simple Dynamic Strings but I like this better.

https://github.com/willcipriano/Connery

3 comments

(author here)

> I was thinking about Simple Dynamic Strings but I like this better.

Oh! here's my chance to plug https://github.com/alcover/stricks ! It follows the same principle as SDS (i.e user-facing type is char*) but is much faster (see bench) and frankly nicer to read through.

Not as feature complete, though.*

I used https://github.com/kumkee/utf8 (along with a bit of hacking) in my toy scheme interpreter to get Unicode strings.

Had to adapt some script I found to generate character class lookup functions to make it fully work IIRC and still need to plug-in some sort of copy on write mechanism since the strings are managed in a shared buffer but other than that it works pretty well…if you’re into the unicorn strings that is.

have you looked into sds: https://github.com/antirez/sds/
Have you read the parent comment?
so used to just calling it sds. it took me a second . my bad homes