Re: Adding a Builtin to EUPHORIA
- Posted by mattlewis (admin) Apr 01, 2014
- 1526 views
I don't think [regex] would have been that much slower. It's how we handle a lot of the stuff in the stdlib, like msgboxes and mmap.
There would be *a lot* more manual memory management. And not just the stuff we have to do to convert a sequence into a C string, but a lot of the structures and things that get passed around. Stuff that goes right on the stack in C (very fast) would be allocated on the heap. For one off stuff, it's not a big deal, but regexes are often used (I know I do) for processing lots of data, over and over.
Requiring a separate library to be distributed would be crazy.
Agreed, if it had to be distributed separately. I don't see it being a big deal to have to ship the one PCRE library with Euphoria though. You ever see how many dlls a Windoze installation of Python comes with?
Except one of the selling points of euphoria is how easy it is to distribute stuff. You can easily put it all together into a single executable (plus whatever else you add, of course). But requiring an additional runtime to go along with it is a dangerous and painful path (MSVCRT, VBRUN, etc).
Matt