Jump to content

Category:Libwren

From Rosetta Code
Library
This is an example of a library. You may see a list of other libraries used on Rosetta Code at Category:Solutions by Library.

libwren is the static library to which a C (or C++) program needs to link during the compilation stage in order to embed the Wren virtual machine (VM) within that program. It contains the public header file wren.h (or wren.hpp for C++) for which an #include statement needs to appear in the program's source code in order to access Wren's embedding API.

There is also a dynamic version of libwren which is generated when Wren is built. However, it is very unlikely that this would be used for RC tasks.

RC tasks are usually written in Wren CLI (the command line tool for Wren) which is itself a C executable which embeds the VM and also depends on the cross-platform C library, libuv, for asynchronous input/output facilities.

Some of the modules listed on the language's main page also require a special C executable to embed the VM and access that module in order to provide functionality which would not otherwise be available from Wren CLI but may be needed for several tasks. These modules are: gmp, ecm, sql, i64, linear and psieve.

However, there are other tasks which require a C executable to embed the VM but where the Wren source code is only likely to be needed for that specific task and it is not therefore worthwhile to create a dedicated module for it. The reason for creating this category is to house those tasks where this criterion applies.

There is one other other way in which the VM can be embedded in a C or C++ program, namely by including its source directly in that program. As Wren is quite small, this is not out of the question for large programs but it's certainly not viable for RC tasks.

Pages in category "Libwren"

The following 65 pages are in this category, out of 65 total.

Cookies help us deliver our services. By using our services, you agree to our use of cookies.