Fun 0.41.5
The programming language that makes You have fun
Loading...
Searching...
No Matches
hello.c
Go to the documentation of this file.
1/*
2 * This file is part of the Fun programming language.
3 * https://fun-lang.xyz/
4 *
5 * Copyright 2026 Johannes Findeisen <you@hanez.org>
6 * Licensed under the terms of the Apache-2.0 license.
7 * https://opensource.org/license/apache-2-0
8 */
9
20
33
35#ifdef FUN_WITH_RUST
36 const char *s = fun_rust_get_string();
37 if (!s) s = "";
38 push_value(vm, make_string(s));
39#else
40 vm_raise_error(vm, "RUST_HELLO requires FUN_WITH_RUST=ON at build time");
41 push_value(vm, make_nil());
42#endif
43 break;
44}
@ OP_RUST_HELLO
Definition bytecode.h:278
uint32_t s
Definition rol.c:31
Value make_nil(void)
Construct a nil Value.
Definition value.c:126
Value make_string(const char *s)
Construct a string Value by duplicating the given C string.
Definition value.c:95
void vm_raise_error(VM *vm, const char *msg)
Raise a runtime error inside the VM, honoring try/catch/finally.
Definition vm.c:248
const char * fun_rust_get_string(void)