First release of SPVM::Resource::RE2 Resourcing the regular expression library Google RE2
Tags: perl, spvm
Published: 2023-03-03 23:36:09

This week we made the first release of <a href="https://metacpan.org/pod/SPVM::Resource::RE2">SPVM::Resource::RE2</a>, a regular expression engine developed by <a href="https://github.com/google/re2">Google RE2</a> is characterized by the fact that it does not return exponentially growing response times for the input of regular expressions themselves. This is an essential feature for implementations such as search engines that accept regular expressions as input.

Google RE runs on Linux, Mac, and Windows; the Google RE2 CI has not tested MinGW on Windows, but SPVM has tested this on Windows because it uses MinGW as a compiler on Windows. Windows. We have confirmed that Google RE2 works on the latest version of Windows Server 2022, and we have confirmed that it also works on Windows Server 2019.

The previous release of <a href="https://metacpan.org/pod/SPVM::Resource::Re2::V2022_06_01">SPVM-Resource-Re2-V2022_06_01</a> did not pass the test on the latest version of Windows Server 2022, but SPVM::Resource::RE2 does. However, PVM::Resource::RE2 requires C++17.

The version of RE2 is 2023-02-01, which is almost the latest version of RE2 as a resource.

## What are SPVM resources?

<a href="https://metacpan.org/dist/SPVM/view/lib/SPVM/Document/Resource.pm">SPVM resources</a> are a collection of C/C++(or GPGPU/cuda, etc) source and header files and compilation instructions. It is accompanied by documentation to set up the linker for user use. These are called SPVM resources.

Resources are independent of binding modules; SPVM::Resource::RE2 is a resource and the binding module is <a href="https://metacpan.org/pod/SPVM::Regex">SPVM::Regex</a>.

Thus, resources and bindings share roles independently. It took some time for this to be clearly recognized. It took a while for this to be clearly recognized, because such a mechanism did not exist in Perl, or if it did, it could not be found.

For example, Perl's <a href="https://metacpan.org/pod/Tk">Tk</a> module contains the source code and headers for tcl/tk and its bindings. The resources and the bindings are tightly coupled.

The <a href="https://metacpan.org/pod/Compress::Raw::Zlib">Compress::Raw::Zlib</a> module contains zlib source code and headers, and its bindings. The resources and bindings are tightly coupled.

On the other hand, SPVM::Resource::RE2 contains source code and headers, but no bindings. The binding role is played by SPVM::Regex.

The usefulness of this approach will be further recognized as we create other resource modules, binding modules, and applications.

## SPVM has finally included regular expression functionality

SPVM, through Google RE2, has gotten regular expression functionality. In order to create file path related modules such as <a href="https://metacpan.org/pod/SPVM::FindBin">SPVM::FindBin</a>, <a href="https://metacpan.org/pod/SPVM::File::Spec">SPVM::File::Spec</a>, <a href="https://metacpan.org/pod/SPVM::File::Find">SPVM::File::Find</a>, <a href="https://metacpan.org/pod/SPVM::File::Copy">SPVM::File::Copy</a>, <a href="https://metacpan.org/pod/SPVM::File::Path">SPVM::File::Path</a>, etc., the regular expression feature must work on Linux, Mac and Windows. Windows.

SPVM::Resource::RE2 makes this possible.

## Symbolic Link Enhancements

Next week, we would like to work on enhancing symbolic link functionality. Recent versions of Windows have made it possible to create symbolic links that are somewhat compatible with Linxu, albeit with some limitations. The next release of the latest version of Perl will allow this functionality. Therefore, SPVM will also implement this feature in <a href="https://metacpan.org/pod/SPVM::Sys">SPVM::Sys</a>.

The Go language already has this feature, and we plan to implement it in SPVM as well.


Translated with www.DeepL.com/Translator (free version)