Cross compilation: Difference between revisions

m
→‎{{header|Wren}}: Minor changes.
(Added Wren blurb.)
m (→‎{{header|Wren}}: Minor changes.)
Line 36:
The VM is very small compared to, say, those of the Java or .NET family languages. Although it is typically built as a shared or static library which the host can link to, its small size means that it's a practical proposition to incorporate its source code directly in a host application written in C/C++ which can then be built directly by including the wren.h/wren.hpp header file.
The VM compiles the Wren source code into aan intermediate bytecode which it then interprets at runtime. The compilation process is just 'single pass' which imposes some limitations on the Wren language but is so fast that the compile and runtime stages are virtually indistinguishable to the user.
 
Wren has a small standard library whose only dependency is the C99 standard library.
Line 44:
Pre-built Wren-cli executables exist and are [https://github.com/wren-lang/wren-cli/releases/tag/0.4.0 freely available] for 64-bit Linux, MacOS and Windows. However, as libuv runs on many more platforms than these and virtually all platforms have a C99 (or C++98) compiler available, it should be technically possible to build a version of Wren-cli for any such platform.
 
To build a Wren-cli (or any other C/C++ host) executable which runs on a different platform from the development platform then one needs, of course, to use a C99 compatible cross-compiler such as the ubiquitous GCC which can be set up to do this provided ''binutils'' is available for the target platform. For some platforms (such as embedded systems) it may be necessary to use the ''newlib'' subset of the standard C library.
 
Finally, it is worth mentioning that a [https://github.com/ppvk/wrenjs Wren to Javascript transpiler (via emscripten)] exists which enables Wren applications to be run in a browser though this does have a dependency on ''node.js'' and various other stuff.
9,476

edits