Hello world/Line printer: Difference between revisions
m
→{{header|Wren}}: Minor tidy
m (→{{header|Alternative}}: ==> "=== Alternative ===") |
m (→{{header|Wren}}: Minor tidy) |
||
Line 1,164:
=={{header|Wren}}==
It is not currently possible to communicate with the printer using Wren-cli. So we need to write a minimal embedded program (no error checking) so the C host can do this for us.
<syntaxhighlight lang="
class C {
Line 1,173:
<br>
We now embed this in the following C program, compile and run it.
<syntaxhighlight lang="c">/* gcc
#include <stdio.h>
Line 1,228:
WrenVM* vm = wrenNewVM(&config);
const char* module = "main";
const char* fileName = "
char *script = readFile(fileName);
WrenInterpretResult result = wrenInterpret(vm, module, script);
|