Refactored the directory structure in ./examples for Rust. No code changes. (0.39.16)
This commit is contained in:
parent
5d5b102252
commit
59484f5a85
3 changed files with 0 additions and 0 deletions
37
examples/rust/rust_hello_args.fun
Executable file
37
examples/rust/rust_hello_args.fun
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
#!/usr/bin/env fun
|
||||
|
||||
/*
|
||||
* This file is part of the Fun programming language.
|
||||
* https://fun-lang.xyz/
|
||||
*
|
||||
* Copyright 2026 Johannes Findeisen <you@hanez.org>
|
||||
* Licensed under the terms of the Apache-2.0 license.
|
||||
* https://opensource.org/license/apache-2-0
|
||||
*
|
||||
* Added: 2026-01-28
|
||||
*/
|
||||
|
||||
/*
|
||||
* Rust-backed opcode demo with argument: rust_hello_args(STRING)
|
||||
*
|
||||
* Build instructions:
|
||||
* - Rust integration is optional. Enable via:
|
||||
* cmake -S . -B build_debug -DFUN_WITH_RUST=ON
|
||||
* - Then build:
|
||||
* cmake --build build_debug --target fun
|
||||
*
|
||||
* Run:
|
||||
* build_debug/fun examples/rust_hello_args.fun
|
||||
*
|
||||
* Expected output (with FUN_WITH_RUST=ON):
|
||||
* Hello from Fun to Rust!
|
||||
*
|
||||
* Note:
|
||||
* The opcode prints from Rust and returns Nil, so there's nothing to print afterwards.
|
||||
*/
|
||||
|
||||
rust_hello_args("Hello from Fun to Rust!")
|
||||
|
||||
/* Expected output:
|
||||
Hello from Fun to Rust!
|
||||
*/
|
||||
Loading…
Add table
Add a link
Reference in a new issue