Re: Adding a Builtin to EUPHORIA
- Posted by jimcbrown (admin) Apr 01, 2014
- 1507 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.
I don't understand why the existing type system (with regexes being a unique type) wouldn't work with PCRE being a shared library. Jeremy easily went back and forth on this in the code when we were debating this issue.
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
We can still do that. Just carry around both the shared and static versions of the PCRE library. If py2exe can turn a Python app (and all its required runtimes) into a single executable, I don't see why we'd have so much trouble with just one library.