From 4309ec2a521829124d8e28f6b0fbad579489bb11 Mon Sep 17 00:00:00 2001 From: hanez Date: Fri, 1 May 2026 15:15:42 +0200 Subject: [PATCH] Doxygen code comment cleanups and new blog post. No code changes. (0.41.5) --- .gitignore | 3 + src/array_utils.c | 2 +- src/bytecode.c | 2 +- src/bytecode.h | 2 +- src/extensions/curl.c | 2 +- src/extensions/ini.c | 2 +- src/extensions/json.c | 2 +- src/extensions/openssl.c | 2 +- src/extensions/pcre2.c | 2 +- src/extensions/pcsc.c | 2 +- src/extensions/sqlite.c | 2 +- src/extensions/xml2.c | 2 +- src/fun.c | 2 +- src/fun_test.c | 2 +- src/funstx.c | 2 +- src/iter.c | 2 +- src/map.c | 2 +- src/parser.c | 2 +- src/parser.h | 2 +- src/parser_utils.c | 2 +- src/repl.c | 2 +- src/repl.h | 2 +- src/rust/src/lib.rs | 2 +- src/rust/src/vm/mod.rs | 2 +- src/str_utils.c | 2 +- src/string.c | 2 +- src/test_opcodes.c | 2 +- src/value.c | 2 +- src/value.h | 2 +- src/vm.c | 2 +- src/vm.h | 2 +- src/vm/arithmetic/add.c | 5 +- src/vm/arithmetic/div.c | 5 +- src/vm/arithmetic/mul.c | 5 +- src/vm/arithmetic/sub.c | 5 +- src/vm/arrays/apop.c | 5 +- src/vm/arrays/clear.c | 5 +- src/vm/arrays/contains.c | 5 +- src/vm/arrays/enumerate.c | 5 +- src/vm/arrays/index_get.c | 5 +- src/vm/arrays/index_of.c | 5 +- src/vm/arrays/index_set.c | 5 +- src/vm/arrays/insert.c | 5 +- src/vm/arrays/join.c | 5 +- src/vm/arrays/make_array.c | 5 +- src/vm/arrays/push.c | 5 +- src/vm/arrays/remove.c | 5 +- src/vm/arrays/set.c | 5 +- src/vm/arrays/slice.c | 5 +- src/vm/arrays/zip.c | 5 +- src/vm/bitwise/band.c | 27 ++++----- src/vm/bitwise/bnot.c | 27 ++++----- src/vm/bitwise/bor.c | 27 ++++----- src/vm/bitwise/bxor.c | 11 ++-- src/vm/bitwise/rol.c | 11 ++-- src/vm/bitwise/ror.c | 11 ++-- src/vm/bitwise/shl.c | 11 ++-- src/vm/bitwise/shr.c | 11 ++-- src/vm/cast.c | 2 +- src/vm/core/call.c | 5 +- src/vm/core/dup.c | 5 +- src/vm/core/exit.c | 4 +- src/vm/core/halt.c | 5 +- src/vm/core/jump.c | 5 +- src/vm/core/jump_if_false.c | 5 +- src/vm/core/load_const.c | 5 +- src/vm/core/load_global.c | 5 +- src/vm/core/load_local.c | 5 +- src/vm/core/nop.c | 5 +- src/vm/core/pop.c | 5 +- src/vm/core/return.c | 5 +- src/vm/core/store_global.c | 5 +- src/vm/core/store_local.c | 5 +- src/vm/core/swap.c | 5 +- src/vm/core/throw.c | 2 +- src/vm/core/try_pop.c | 2 +- src/vm/core/try_push.c | 2 +- src/vm/cpp/add.cpp | 2 +- src/vm/curl/download.c | 16 +++--- src/vm/curl/get.c | 16 +++--- src/vm/curl/post.c | 14 ++--- src/vm/echo.c | 2 +- src/vm/ini/free.c | 3 +- src/vm/ini/get_bool.c | 3 +- src/vm/ini/get_double.c | 3 +- src/vm/ini/get_int.c | 3 +- src/vm/ini/get_string.c | 3 +- src/vm/ini/handles.c | 2 +- src/vm/ini/handles.h | 1 + src/vm/ini/load.c | 3 +- src/vm/ini/save.c | 3 +- src/vm/ini/set.c | 3 +- src/vm/ini/stubs.c | 9 +++ src/vm/ini/unset.c | 3 +- src/vm/io/input_line.c | 3 +- src/vm/io/read_file.c | 5 +- src/vm/io/write_file.c | 5 +- src/vm/json/from_file.c | 2 +- src/vm/json/parse.c | 2 +- src/vm/json/stringify.c | 2 +- src/vm/json/to_file.c | 2 +- src/vm/len.c | 2 +- src/vm/line.c | 2 +- src/vm/logic/and.c | 5 +- src/vm/logic/eq.c | 5 +- src/vm/logic/gt.c | 5 +- src/vm/logic/gte.c | 5 +- src/vm/logic/lt.c | 5 +- src/vm/logic/lte.c | 5 +- src/vm/logic/neq.c | 3 - src/vm/logic/not.c | 5 +- src/vm/logic/or.c | 5 +- src/vm/maps/has_key.c | 5 +- src/vm/maps/keys.c | 5 +- src/vm/maps/make_map.c | 5 +- src/vm/maps/values.c | 5 +- src/vm/math/abs.c | 2 +- src/vm/math/ceil.c | 2 +- src/vm/math/clamp.c | 2 +- src/vm/math/cos.c | 2 +- src/vm/math/exp.c | 2 +- src/vm/math/floor.c | 2 +- src/vm/math/fmax.c | 2 +- src/vm/math/fmin.c | 2 +- src/vm/math/gcd.c | 2 +- src/vm/math/isqrt.c | 2 +- src/vm/math/lcm.c | 2 +- src/vm/math/log.c | 2 +- src/vm/math/log10.c | 2 +- src/vm/math/max.c | 5 +- src/vm/math/min.c | 5 +- src/vm/math/mod.c | 5 +- src/vm/math/pow.c | 5 +- src/vm/math/random_int.c | 5 +- src/vm/math/random_seed.c | 5 +- src/vm/math/round.c | 2 +- src/vm/math/sign.c | 2 +- src/vm/math/sin.c | 2 +- src/vm/math/sqrt.c | 2 +- src/vm/math/tan.c | 2 +- src/vm/math/trunc.c | 2 +- src/vm/openssl/md5.c | 25 +++++++-- src/vm/openssl/ripemd160.c | 20 ++++++- src/vm/openssl/sha256.c | 18 +++++- src/vm/openssl/sha512.c | 18 +++++- src/vm/os/clock_mono_ms.c | 2 +- src/vm/os/date_format.c | 2 +- src/vm/os/env.c | 2 +- src/vm/os/env_all.c | 2 +- src/vm/os/fd_poll_read.c | 2 +- src/vm/os/fd_poll_write.c | 2 +- src/vm/os/fd_set_nonblock.c | 2 +- src/vm/os/fun_version.c | 2 +- src/vm/os/list_dir.c | 2 +- src/vm/os/proc_run.c | 2 +- src/vm/os/proc_system.c | 2 +- src/vm/os/random_number.c | 2 +- src/vm/os/serial_close.c | 2 +- src/vm/os/serial_config.c | 2 +- src/vm/os/serial_open.c | 2 +- src/vm/os/serial_recv.c | 2 +- src/vm/os/serial_send.c | 2 +- src/vm/os/sleep_ms.c | 2 +- src/vm/os/socket_close.c | 2 +- src/vm/os/socket_recv.c | 2 +- src/vm/os/socket_send.c | 2 +- src/vm/os/socket_tcp_accept.c | 2 +- src/vm/os/socket_tcp_connect.c | 2 +- src/vm/os/socket_tcp_listen.c | 2 +- src/vm/os/socket_unix_connect.c | 2 +- src/vm/os/socket_unix_listen.c | 2 +- src/vm/os/thread_common.c | 2 +- src/vm/os/thread_join.c | 2 +- src/vm/os/thread_spawn.c | 2 +- src/vm/os/time_now_ms.c | 2 +- src/vm/pcre2/findall.c | 2 +- src/vm/pcre2/match.c | 2 +- src/vm/pcre2/test.c | 4 +- src/vm/pcsc/connect.c | 2 +- src/vm/pcsc/disconnect.c | 2 +- src/vm/pcsc/establish.c | 2 +- src/vm/pcsc/list_readers.c | 2 +- src/vm/pcsc/release.c | 2 +- src/vm/pcsc/transmit.c | 2 +- src/vm/print.c | 2 +- src/vm/rust/get_sp.c | 2 +- src/vm/rust/hello.c | 2 +- src/vm/rust/hello_args.c | 2 +- src/vm/rust/hello_args_return.c | 2 +- src/vm/rust/set_exit.c | 2 +- src/vm/sclamp.c | 2 +- src/vm/sqlite/close.c | 2 +- src/vm/sqlite/exec.c | 2 +- src/vm/sqlite/open.c | 2 +- src/vm/sqlite/query.c | 2 +- src/vm/strings/find.c | 2 +- src/vm/strings/regex_match.c | 2 +- src/vm/strings/regex_replace.c | 2 +- src/vm/strings/regex_search.c | 2 +- src/vm/strings/split.c | 2 +- src/vm/strings/substr.c | 2 +- src/vm/to_number.c | 2 +- src/vm/to_string.c | 2 +- src/vm/typeof.c | 2 +- src/vm/uclamp.c | 2 +- src/vm/xml/name.c | 4 +- src/vm/xml/parse.c | 4 +- src/vm/xml/root.c | 4 +- src/vm/xml/text.c | 4 +- web/Makefile | 2 + ...2026-05-01-announcing-api-documentation.md | 56 +++++++++++++++++++ web/documentation/documentation.md | 1 + 212 files changed, 423 insertions(+), 476 deletions(-) create mode 100644 web/_posts/2026-05-01-announcing-api-documentation.md diff --git a/.gitignore b/.gitignore index 12fe3d8..76fe259 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,12 @@ CMakeCache.txt +Doxyfile .* !.editorconfig !.gitignore !.github !.gitkeep .venv +api/ build/* build_debug/* build_release/* @@ -23,4 +25,5 @@ src/rust/target tmp* web/_cache/* web/_site/* +web/api/ web/Gemfile.lock diff --git a/src/array_utils.c b/src/array_utils.c index 967830e..db526a7 100644 --- a/src/array_utils.c +++ b/src/array_utils.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/bytecode.c b/src/bytecode.c index 3490aa4..fd7f95b 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/bytecode.h b/src/bytecode.h index 58b10fb..ad816f2 100644 --- a/src/bytecode.h +++ b/src/bytecode.h @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/extensions/curl.c b/src/extensions/curl.c index f3a3718..c3cf7ad 100644 --- a/src/extensions/curl.c +++ b/src/extensions/curl.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/extensions/ini.c b/src/extensions/ini.c index 56b8153..f86252c 100644 --- a/src/extensions/ini.c +++ b/src/extensions/ini.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/extensions/json.c b/src/extensions/json.c index 1c70d0e..6e812fb 100644 --- a/src/extensions/json.c +++ b/src/extensions/json.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/extensions/openssl.c b/src/extensions/openssl.c index ee347f9..3b26efe 100644 --- a/src/extensions/openssl.c +++ b/src/extensions/openssl.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/extensions/pcre2.c b/src/extensions/pcre2.c index 8ebc739..21e92ba 100644 --- a/src/extensions/pcre2.c +++ b/src/extensions/pcre2.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/extensions/pcsc.c b/src/extensions/pcsc.c index 8d535d9..fb43a99 100644 --- a/src/extensions/pcsc.c +++ b/src/extensions/pcsc.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/extensions/sqlite.c b/src/extensions/sqlite.c index 961098e..87d69cb 100644 --- a/src/extensions/sqlite.c +++ b/src/extensions/sqlite.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/extensions/xml2.c b/src/extensions/xml2.c index 5229917..964e03e 100644 --- a/src/extensions/xml2.c +++ b/src/extensions/xml2.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/fun.c b/src/fun.c index a829a37..5bd2e17 100644 --- a/src/fun.c +++ b/src/fun.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/fun_test.c b/src/fun_test.c index a721627..87f4cfa 100644 --- a/src/fun_test.c +++ b/src/fun_test.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/funstx.c b/src/funstx.c index 9cd9910..7fb7cbd 100644 --- a/src/funstx.c +++ b/src/funstx.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/iter.c b/src/iter.c index a888a02..22f029a 100644 --- a/src/iter.c +++ b/src/iter.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/map.c b/src/map.c index 3b6b1fb..772ea08 100644 --- a/src/map.c +++ b/src/map.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/parser.c b/src/parser.c index 11fe86b..d040f88 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/parser.h b/src/parser.h index 8c89a30..6841a17 100644 --- a/src/parser.h +++ b/src/parser.h @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/parser_utils.c b/src/parser_utils.c index 68bf2db..e09152c 100644 --- a/src/parser_utils.c +++ b/src/parser_utils.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/repl.c b/src/repl.c index da6ec09..458886f 100644 --- a/src/repl.c +++ b/src/repl.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/repl.h b/src/repl.h index 922c7dd..d9bfd4f 100644 --- a/src/repl.h +++ b/src/repl.h @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/rust/src/lib.rs b/src/rust/src/lib.rs index a77bbd2..e831ced 100644 --- a/src/rust/src/lib.rs +++ b/src/rust/src/lib.rs @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/rust/src/vm/mod.rs b/src/rust/src/vm/mod.rs index 1a68cf5..841a733 100644 --- a/src/rust/src/vm/mod.rs +++ b/src/rust/src/vm/mod.rs @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/str_utils.c b/src/str_utils.c index 5fe10b4..ed88c4d 100644 --- a/src/str_utils.c +++ b/src/str_utils.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/string.c b/src/string.c index 503902f..ff6bcf8 100644 --- a/src/string.c +++ b/src/string.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/test_opcodes.c b/src/test_opcodes.c index 43958e3..506e10c 100644 --- a/src/test_opcodes.c +++ b/src/test_opcodes.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/value.c b/src/value.c index 29196eb..65cc6d9 100644 --- a/src/value.c +++ b/src/value.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/value.h b/src/value.h index 9c61572..0381801 100644 --- a/src/value.h +++ b/src/value.h @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm.c b/src/vm.c index 1a4abf7..1893f26 100644 --- a/src/vm.c +++ b/src/vm.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm.h b/src/vm.h index 37a2585..2c021fd 100644 --- a/src/vm.h +++ b/src/vm.h @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/arithmetic/add.c b/src/vm/arithmetic/add.c index 360b210..f8d0090 100644 --- a/src/vm/arithmetic/add.c +++ b/src/vm/arithmetic/add.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -30,9 +30,6 @@ * // Bytecode: OP_ADD * // Stack before: [2, 3] * // Stack after: [5] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_ADD: { diff --git a/src/vm/arithmetic/div.c b/src/vm/arithmetic/div.c index bc6d025..f2c9018 100644 --- a/src/vm/arithmetic/div.c +++ b/src/vm/arithmetic/div.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -31,9 +31,6 @@ * // Stack after: [5] * // Stack before: [5.0, 2] * // Stack after: [2.5] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_DIV: { diff --git a/src/vm/arithmetic/mul.c b/src/vm/arithmetic/mul.c index 3e63310..cd63051 100644 --- a/src/vm/arithmetic/mul.c +++ b/src/vm/arithmetic/mul.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -30,9 +30,6 @@ * // Stack after: [12] * // Stack before: [2.5, 4] * // Stack after: [10.0] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_MUL: { diff --git a/src/vm/arithmetic/sub.c b/src/vm/arithmetic/sub.c index 7602620..8ccbeb5 100644 --- a/src/vm/arithmetic/sub.c +++ b/src/vm/arithmetic/sub.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -30,9 +30,6 @@ * // Stack after: [6] * // Stack before: [10.0, 3] * // Stack after: [7.0] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_SUB: { diff --git a/src/vm/arrays/apop.c b/src/vm/arrays/apop.c index 40ce90b..ec3cfb6 100644 --- a/src/vm/arrays/apop.c +++ b/src/vm/arrays/apop.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -27,9 +27,6 @@ * // Bytecode: OP_APOP * // Stack before: [[10, 20, 30]] * // Stack after: [30] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_APOP: { diff --git a/src/vm/arrays/clear.c b/src/vm/arrays/clear.c index ce7a8ae..eb3ccfd 100644 --- a/src/vm/arrays/clear.c +++ b/src/vm/arrays/clear.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -27,9 +27,6 @@ * // Bytecode: OP_CLEAR * // Stack before: [[10, 20, 30]] * // Stack after: [0] - - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_CLEAR: { diff --git a/src/vm/arrays/contains.c b/src/vm/arrays/contains.c index 71b9d6f..1e36a75 100644 --- a/src/vm/arrays/contains.c +++ b/src/vm/arrays/contains.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -26,9 +26,6 @@ * // Bytecode: OP_CONTAINS * // Stack before: [20, [10, 20, 30]] * // Stack after: [1] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_CONTAINS: { diff --git a/src/vm/arrays/enumerate.c b/src/vm/arrays/enumerate.c index 716e8b0..a42c129 100644 --- a/src/vm/arrays/enumerate.c +++ b/src/vm/arrays/enumerate.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -26,9 +26,6 @@ * // Bytecode: OP_ENUMERATE * // Stack before: [[10, 20, 30]] * // Stack after: [[[0, 10], [1, 20], [2, 30]]] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_ENUMERATE: { diff --git a/src/vm/arrays/index_get.c b/src/vm/arrays/index_get.c index 69da0f5..52a460b 100644 --- a/src/vm/arrays/index_get.c +++ b/src/vm/arrays/index_get.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -28,9 +28,6 @@ * // Bytecode: OP_INDEX_GET * // Stack before: [1, [10, 20, 30]] * // Stack after: [20] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_INDEX_GET: { diff --git a/src/vm/arrays/index_of.c b/src/vm/arrays/index_of.c index 6ce8c7e..f1bb38f 100644 --- a/src/vm/arrays/index_of.c +++ b/src/vm/arrays/index_of.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -26,9 +26,6 @@ * // Bytecode: OP_INDEX_OF * // Stack before: [20, [10, 20, 30]] * // Stack after: [1] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_INDEX_OF: { diff --git a/src/vm/arrays/index_set.c b/src/vm/arrays/index_set.c index 1ebc783..2691ddd 100644 --- a/src/vm/arrays/index_set.c +++ b/src/vm/arrays/index_set.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -27,9 +27,6 @@ * // Bytecode: OP_INDEX_SET * // Stack before: [42, 1, [10, 20, 30]] * // Stack after: [[10, 42, 30]] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_INDEX_SET: { diff --git a/src/vm/arrays/insert.c b/src/vm/arrays/insert.c index fb73d5b..49beed7 100644 --- a/src/vm/arrays/insert.c +++ b/src/vm/arrays/insert.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -28,9 +28,6 @@ * // Bytecode: OP_INSERT * // Stack before: [42, 1, [10, 20, 30]] * // Stack after: [4] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_INSERT: { diff --git a/src/vm/arrays/join.c b/src/vm/arrays/join.c index eddcfff..a5031ef 100644 --- a/src/vm/arrays/join.c +++ b/src/vm/arrays/join.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -27,9 +27,6 @@ * // Bytecode: OP_JOIN * // Stack before: [", ", ["a", "b", "c"]] * // Stack after: ["a, b, c"] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_JOIN: { diff --git a/src/vm/arrays/make_array.c b/src/vm/arrays/make_array.c index 65c0ef2..b454f2b 100644 --- a/src/vm/arrays/make_array.c +++ b/src/vm/arrays/make_array.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -27,9 +27,6 @@ * // Bytecode: OP_MAKE_ARRAY 3 * // Stack before: [1, 2, 3] * // Stack after: [[1, 2, 3]] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_MAKE_ARRAY: { diff --git a/src/vm/arrays/push.c b/src/vm/arrays/push.c index 28f3f4c..2dd74c9 100644 --- a/src/vm/arrays/push.c +++ b/src/vm/arrays/push.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -28,9 +28,6 @@ * // Bytecode: OP_PUSH * // Stack before: [42, [10, 20, 30]] * // Stack after: [4] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_PUSH: { diff --git a/src/vm/arrays/remove.c b/src/vm/arrays/remove.c index ff1f43a..10da29c 100644 --- a/src/vm/arrays/remove.c +++ b/src/vm/arrays/remove.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -28,9 +28,6 @@ * // Bytecode: OP_REMOVE * // Stack before: [1, [10, 20, 30]] * // Stack after: [20] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_REMOVE: { diff --git a/src/vm/arrays/set.c b/src/vm/arrays/set.c index 70534c0..bf0e4a5 100644 --- a/src/vm/arrays/set.c +++ b/src/vm/arrays/set.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -28,9 +28,6 @@ * // Bytecode: OP_SET * // Stack before: [42, 1, [10, 20, 30]] * // Stack after: [42] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_SET: { diff --git a/src/vm/arrays/slice.c b/src/vm/arrays/slice.c index 9afdcca..e057413 100644 --- a/src/vm/arrays/slice.c +++ b/src/vm/arrays/slice.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -27,9 +27,6 @@ * // Bytecode: OP_SLICE * // Stack before: [3, 1, [10,20,30,40]] * // Stack after: [[20,30]] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_SLICE: { diff --git a/src/vm/arrays/zip.c b/src/vm/arrays/zip.c index 142179f..3a284df 100644 --- a/src/vm/arrays/zip.c +++ b/src/vm/arrays/zip.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -27,9 +27,6 @@ * // Bytecode: OP_ZIP * // Stack before: [[1,2], ['a','b']] * // Stack after: [[[1,'a'], [2,'b']]] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_ZIP: { diff --git a/src/vm/bitwise/band.c b/src/vm/bitwise/band.c index 92e80da..fc41de8 100644 --- a/src/vm/bitwise/band.c +++ b/src/vm/bitwise/band.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -9,25 +9,22 @@ /** * @file band.c - * @brief Implements the OP_BAND opcode (bitwise AND). + * @brief Implements the OP_BAND opcode bitwise AND (uint32). * * Opcode snippet included by vm.c. Performs a 32-bit unsigned bitwise AND * on two integer operands from the VM stack. + * + * Stack effects: + * - pops: b, a + * - pushes: (uint32_t)(a & b) + * + * Notes: + * - Operands are interpreted as 32-bit unsigned when of type VAL_INT; + * non-integer values are treated as 0. + * - The result is pushed as VAL_INT with the 32-bit value preserved in the + * low bits. */ -/** - * OP_BAND: bitwise AND (uint32) - * - * Stack effects: - * - pops: b, a - * - pushes: (uint32_t)(a & b) - * - * Notes: - * - Operands are interpreted as 32-bit unsigned when of type VAL_INT; - * non-integer values are treated as 0. - * - The result is pushed as VAL_INT with the 32-bit value preserved in the - * low bits. - */ case OP_BAND: { Value vb = pop_value(vm); Value va = pop_value(vm); diff --git a/src/vm/bitwise/bnot.c b/src/vm/bitwise/bnot.c index 19ed68f..5cd13b4 100644 --- a/src/vm/bitwise/bnot.c +++ b/src/vm/bitwise/bnot.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -9,25 +9,22 @@ /** * @file bnot.c - * @brief Implements the OP_BNOT opcode (bitwise NOT). + * @brief Implements the OP_BNOT opcode bitwise NOT (uint32). * * Opcode snippet included by vm.c. Performs a 32-bit unsigned bitwise NOT * on a single integer operand from the VM stack. + * + * Stack effects: + * - pops: a + * - pushes: (uint32_t)(~a) + * + * Notes: + * - Operand is interpreted as 32-bit unsigned when of type VAL_INT; + * non-integer values are treated as 0. + * - The result is pushed as VAL_INT with the 32-bit value preserved in the + * low bits. */ -/** - * OP_BNOT: bitwise NOT (uint32) - * - * Stack effects: - * - pops: a - * - pushes: (uint32_t)(~a) - * - * Notes: - * - Operand is interpreted as 32-bit unsigned when of type VAL_INT; - * non-integer values are treated as 0. - * - The result is pushed as VAL_INT with the 32-bit value preserved in the - * low bits. - */ case OP_BNOT: { Value va = pop_value(vm); uint32_t a = (va.type == VAL_INT) ? (uint32_t)va.i : 0u; diff --git a/src/vm/bitwise/bor.c b/src/vm/bitwise/bor.c index b9012f4..bb8f77c 100644 --- a/src/vm/bitwise/bor.c +++ b/src/vm/bitwise/bor.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -9,25 +9,22 @@ /** * @file bor.c - * @brief Implements the OP_BOR opcode (bitwise OR). + * @brief Implements the OP_BOR opcode bitwise OR (uint32). * * Opcode snippet included by vm.c. Performs a 32-bit unsigned bitwise OR * on two integer operands from the VM stack. + * + * Stack effects: + * - pops: b, a + * - pushes: (uint32_t)(a | b) + * + * Notes: + * - Operands are interpreted as 32-bit unsigned when of type VAL_INT; + * non-integer values are treated as 0. + * - The result is pushed as VAL_INT with the 32-bit value preserved in the + * low bits. */ -/** - * OP_BOR: bitwise OR (uint32) - * - * Stack effects: - * - pops: b, a - * - pushes: (uint32_t)(a | b) - * - * Notes: - * - Operands are interpreted as 32-bit unsigned when of type VAL_INT; - * non-integer values are treated as 0. - * - The result is pushed as VAL_INT with the 32-bit value preserved in the - * low bits. - */ case OP_BOR: { Value vb = pop_value(vm); Value va = pop_value(vm); diff --git a/src/vm/bitwise/bxor.c b/src/vm/bitwise/bxor.c index 95f9787..511e1c8 100644 --- a/src/vm/bitwise/bxor.c +++ b/src/vm/bitwise/bxor.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -9,15 +9,11 @@ /** * @file bxor.c - * @brief Implements the OP_BXOR opcode (bitwise XOR). + * @brief Implements the OP_BXOR opcode bitwise XOR (uint32). * * This file is an opcode snippet included by vm.c. It implements a * 32-bit unsigned bitwise XOR of two integer operands from the VM stack. - */ - -/** - * OP_BXOR: bitwise XOR (uint32) - * + * * Stack effects: * - pops: b, a * - pushes: (uint32_t)(a ^ b) @@ -28,6 +24,7 @@ * - Result is pushed back as VAL_INT, preserving 32-bit value in the * low bits of the 64-bit integer storage. */ + case OP_BXOR: { Value vb = pop_value(vm); Value va = pop_value(vm); diff --git a/src/vm/bitwise/rol.c b/src/vm/bitwise/rol.c index 5e32bed..91c90c4 100644 --- a/src/vm/bitwise/rol.c +++ b/src/vm/bitwise/rol.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -9,15 +9,11 @@ /** * @file rol.c - * @brief Implements the OP_ROTL opcode (rotate-left). + * @brief Implements the OP_ROTL opcode rotate-left (uint32). * * Opcode snippet included by vm.c. Performs a 32-bit unsigned rotate-left of * an integer operand by a masked rotation count. - */ - -/** - * OP_ROTL: rotate left (uint32) - * + * * Stack effects: * - pops: s, a * - pushes: (a << s) | (a >> (32 - s)), with s masked to 0..31 @@ -27,6 +23,7 @@ * - The rotation count is masked to 0..31. A zero rotation returns a unchanged. * - Result is pushed as VAL_INT with the 32-bit value preserved in the low bits. */ + case OP_ROTL: { Value vs = pop_value(vm); Value va = pop_value(vm); diff --git a/src/vm/bitwise/ror.c b/src/vm/bitwise/ror.c index 6b46aad..b87d67c 100644 --- a/src/vm/bitwise/ror.c +++ b/src/vm/bitwise/ror.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -9,15 +9,11 @@ /** * @file ror.c - * @brief Implements the OP_ROTR opcode (rotate-right). + * @brief Implements the OP_ROTR opcode rotate-right (uint32). * * Opcode snippet included by vm.c. Performs a 32-bit unsigned rotate-right of * an integer operand by a masked rotation count. - */ - -/** - * OP_ROTR: rotate right (uint32) - * + * * Stack effects: * - pops: s, a * - pushes: (a >> s) | (a << (32 - s)), with s masked to 0..31 @@ -27,6 +23,7 @@ * - The rotation count is masked to 0..31. A zero rotation returns a unchanged. * - Result is pushed as VAL_INT with the 32-bit value preserved in the low bits. */ + case OP_ROTR: { Value vs = pop_value(vm); Value va = pop_value(vm); diff --git a/src/vm/bitwise/shl.c b/src/vm/bitwise/shl.c index 6ac9acc..e2db30b 100644 --- a/src/vm/bitwise/shl.c +++ b/src/vm/bitwise/shl.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -9,15 +9,11 @@ /** * @file shl.c - * @brief Implements the OP_SHL opcode (logical left shift). + * @brief Implements the OP_SHL opcode logical left shift (uint32). * * Opcode snippet included by vm.c. Performs a 32-bit unsigned logical left * shift of an integer operand by a masked shift count. - */ - -/** - * OP_SHL: logical left shift (uint32) - * + * * Stack effects: * - pops: s, a * - pushes: (uint32_t)(a << (s & 31)) @@ -27,6 +23,7 @@ * - The shift count is masked to 0..31. A zero shift returns a unchanged. * - Result is pushed as VAL_INT with the 32-bit value preserved in the low bits. */ + case OP_SHL: { Value vs = pop_value(vm); Value va = pop_value(vm); diff --git a/src/vm/bitwise/shr.c b/src/vm/bitwise/shr.c index 8daba6a..406d663 100644 --- a/src/vm/bitwise/shr.c +++ b/src/vm/bitwise/shr.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -9,15 +9,11 @@ /** * @file shr.c - * @brief Implements the OP_SHR opcode (logical right shift). + * @brief Implements the OP_SHR opcode logical right shift (uint32). * * Opcode snippet included by vm.c. Performs a 32-bit unsigned logical right * shift of an integer operand by a masked shift count. - */ - -/** - * OP_SHR: logical right shift (uint32) - * + * * Stack effects: * - pops: s, a * - pushes: (uint32_t)(a >> (s & 31)) @@ -28,6 +24,7 @@ * - Logical (zero-filling) right shift is used (no sign extend). * - Result is pushed as VAL_INT with the 32-bit value preserved in the low bits. */ + case OP_SHR: { Value vs = pop_value(vm); Value va = pop_value(vm); diff --git a/src/vm/cast.c b/src/vm/cast.c index c075e9a..8cd13cb 100644 --- a/src/vm/cast.c +++ b/src/vm/cast.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/core/call.c b/src/vm/core/call.c index aec2279..f51d3a0 100644 --- a/src/vm/core/call.c +++ b/src/vm/core/call.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -22,9 +22,6 @@ * Error Handling: * - Exits with error if not enough args * - Exits if function isn't callable - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_CALL: { diff --git a/src/vm/core/dup.c b/src/vm/core/dup.c index 55dd134..d6912cc 100644 --- a/src/vm/core/dup.c +++ b/src/vm/core/dup.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -25,9 +25,6 @@ * // Bytecode: OP_DUP * // Stack before: [42] * // Stack after: [42, 42] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_DUP: { diff --git a/src/vm/core/exit.c b/src/vm/core/exit.c index 7abf45f..7a05f1f 100644 --- a/src/vm/core/exit.c +++ b/src/vm/core/exit.c @@ -1,12 +1,10 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * * Copyright 2025 Johannes Findeisen * Licensed under the terms of the Apache-2.0 license. * https://opensource.org/license/apache-2-0 - * - * Added: 2025-10-04 */ /** diff --git a/src/vm/core/halt.c b/src/vm/core/halt.c index 0c37ad1..d53a37e 100644 --- a/src/vm/core/halt.c +++ b/src/vm/core/halt.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -21,9 +21,6 @@ * // Bytecode: OP_HALT * // Stack before: [42] * // Stack after: [42] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_HALT: diff --git a/src/vm/core/jump.c b/src/vm/core/jump.c index 67caab7..a8a839d 100644 --- a/src/vm/core/jump.c +++ b/src/vm/core/jump.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -22,9 +22,6 @@ * - Loops * - Function returns * - Conditional control flow - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_JUMP: { diff --git a/src/vm/core/jump_if_false.c b/src/vm/core/jump_if_false.c index 78c1534..b8f7568 100644 --- a/src/vm/core/jump_if_false.c +++ b/src/vm/core/jump_if_false.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -23,9 +23,6 @@ * - If statements * - While loops * - Logical expressions - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_JUMP_IF_FALSE: { diff --git a/src/vm/core/load_const.c b/src/vm/core/load_const.c index 61d2d41..43d7e74 100644 --- a/src/vm/core/load_const.c +++ b/src/vm/core/load_const.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -20,9 +20,6 @@ * * Error Handling: * - Exits if invalid constant index - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_LOAD_CONST: { diff --git a/src/vm/core/load_global.c b/src/vm/core/load_global.c index 3a0f08c..6c873d8 100644 --- a/src/vm/core/load_global.c +++ b/src/vm/core/load_global.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -25,9 +25,6 @@ * // Bytecode: OP_LOAD_GLOBAL 0 * // Stack before: [] * // Stack after: [global_value] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_LOAD_GLOBAL: { diff --git a/src/vm/core/load_local.c b/src/vm/core/load_local.c index 2a16f1b..b12fcd1 100644 --- a/src/vm/core/load_local.c +++ b/src/vm/core/load_local.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -25,9 +25,6 @@ * // Bytecode: OP_LOAD_LOCAL 0 * // Stack before: [] * // Stack after: [local_value] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_LOAD_LOCAL: { diff --git a/src/vm/core/nop.c b/src/vm/core/nop.c index 37779a9..eb2331e 100644 --- a/src/vm/core/nop.c +++ b/src/vm/core/nop.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -21,9 +21,6 @@ * // Bytecode: OP_NOP * // Stack before: [42] * // Stack after: [42] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_NOP: diff --git a/src/vm/core/pop.c b/src/vm/core/pop.c index de20120..891b81e 100644 --- a/src/vm/core/pop.c +++ b/src/vm/core/pop.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -23,9 +23,6 @@ * // Bytecode: OP_POP * // Stack before: [42] * // Stack after: [] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_POP: { diff --git a/src/vm/core/return.c b/src/vm/core/return.c index 9ff29ed..32501eb 100644 --- a/src/vm/core/return.c +++ b/src/vm/core/return.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -26,9 +26,6 @@ * // Bytecode: OP_RETURN * // Stack before: [42] * // Stack after: [42] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_RETURN: { diff --git a/src/vm/core/store_global.c b/src/vm/core/store_global.c index fe46065..c20b52e 100644 --- a/src/vm/core/store_global.c +++ b/src/vm/core/store_global.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -25,9 +25,6 @@ * // Bytecode: OP_STORE_GLOBAL 0 * // Stack before: [42] * // Stack after: [] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_STORE_GLOBAL: { diff --git a/src/vm/core/store_local.c b/src/vm/core/store_local.c index 0243b05..776b713 100644 --- a/src/vm/core/store_local.c +++ b/src/vm/core/store_local.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -25,9 +25,6 @@ * // Bytecode: OP_STORE_LOCAL 0 * // Stack before: [42] * // Stack after: [] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_STORE_LOCAL: { diff --git a/src/vm/core/swap.c b/src/vm/core/swap.c index 78e98f6..8cf2488 100644 --- a/src/vm/core/swap.c +++ b/src/vm/core/swap.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -20,9 +20,6 @@ * * Error Handling: * - Exits if stack underflow - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_SWAP: { diff --git a/src/vm/core/throw.c b/src/vm/core/throw.c index d292643..f86cfe7 100644 --- a/src/vm/core/throw.c +++ b/src/vm/core/throw.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/core/try_pop.c b/src/vm/core/try_pop.c index c2721ec..824f3ec 100644 --- a/src/vm/core/try_pop.c +++ b/src/vm/core/try_pop.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/core/try_push.c b/src/vm/core/try_push.c index 41aebd5..97153e5 100644 --- a/src/vm/core/try_push.c +++ b/src/vm/core/try_push.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/cpp/add.cpp b/src/vm/cpp/add.cpp index cfb3b06..506bd7b 100644 --- a/src/vm/cpp/add.cpp +++ b/src/vm/cpp/add.cpp @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/curl/download.c b/src/vm/curl/download.c index f3af315..7fe8f0d 100644 --- a/src/vm/curl/download.c +++ b/src/vm/curl/download.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -19,6 +19,11 @@ * - Pops: path:string, url:string (values are converted via value_to_string_alloc) * - Pushes: int (1 on success, 0 on error or when CURL is disabled) * + * Pops a destination path and URL, streams the HTTP response body + * into the file, and pushes 1 on success or 0 on any error. Without + * FUN_WITH_CURL, behaves as a no-op that consumes two values and + * pushes 0. + * * Error handling: * - Returns 0 if URL/path conversion fails, file open fails, CURL init * or perform fails. @@ -29,14 +34,7 @@ * - All temporary allocations (URL, path) are freed; FILE* is closed. * - On builds without FUN_WITH_CURL, consumes two values and pushes 0. */ -/** - * @brief Opcode handler for OP_CURL_DOWNLOAD. - * - * Pops a destination path and URL, streams the HTTP response body - * into the file, and pushes 1 on success or 0 on any error. Without - * FUN_WITH_CURL, behaves as a no-op that consumes two values and - * pushes 0. - */ + case OP_CURL_DOWNLOAD: { #ifdef FUN_WITH_CURL Value vpath = pop_value(vm); diff --git a/src/vm/curl/get.c b/src/vm/curl/get.c index 730abb5..31919a9 100644 --- a/src/vm/curl/get.c +++ b/src/vm/curl/get.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -21,6 +21,11 @@ * - Pops: url:string (any value is converted via value_to_string_alloc) * - Pushes: body:string ("" on error or when CURL is disabled) * + * Converts the top stack value to a URL string, issues a GET request + * using libcurl, and pushes the response body as a string. When + * compiled without FUN_WITH_CURL, the opcode becomes a no-op that + * consumes one value and pushes an empty string. + * * Error handling: * - If URL conversion fails or CURL initialization/performance fails, * the opcode pushes an empty string. @@ -30,14 +35,7 @@ * - Uses FunCurlBuf and fun_curl_write_cb from the curl extension helpers. * - Memory allocated for temporary strings and buffers is freed before exit. */ -/** - * @brief Opcode handler for OP_CURL_GET. - * - * Converts the top stack value to a URL string, issues a GET request - * using libcurl, and pushes the response body as a string. When - * compiled without FUN_WITH_CURL, the opcode becomes a no-op that - * consumes one value and pushes an empty string. - */ + case OP_CURL_GET: { #ifdef FUN_WITH_CURL Value vurl = pop_value(vm); diff --git a/src/vm/curl/post.c b/src/vm/curl/post.c index e6af2e8..c9ddcf6 100644 --- a/src/vm/curl/post.c +++ b/src/vm/curl/post.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -21,6 +21,10 @@ * - Pops: body:string, url:string (values are converted via value_to_string_alloc) * - Pushes: body:string (server response; "" on error or when CURL is disabled) * + * Pops the POST body and URL, performs an HTTP POST, and pushes the + * response as a string. Without FUN_WITH_CURL, consumes two values and + * pushes an empty string. + * * Error handling: * - If URL conversion fails, the opcode pushes an empty string and discards * any converted body. @@ -31,13 +35,7 @@ * - Uses FunCurlBuf and fun_curl_write_cb from the curl extension helpers. * - All temporary allocations (URL, body, response buffer) are freed. */ -/** - * @brief Opcode handler for OP_CURL_POST. - * - * Pops the POST body and URL, performs an HTTP POST, and pushes the - * response as a string. Without FUN_WITH_CURL, consumes two values and - * pushes an empty string. - */ + case OP_CURL_POST: { #ifdef FUN_WITH_CURL Value vbody = pop_value(vm); diff --git a/src/vm/echo.c b/src/vm/echo.c index c6c9b87..1aa041e 100644 --- a/src/vm/echo.c +++ b/src/vm/echo.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/ini/free.c b/src/vm/ini/free.c index 41799ec..f8e9594 100644 --- a/src/vm/ini/free.c +++ b/src/vm/ini/free.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -29,6 +29,7 @@ * See also * - ini_alloc_handle(), ini_free_handle() in src/vm/ini/handles.c */ + /* OP_INI_FREE: pops handle; pushes 1/0 */ #ifdef FUN_WITH_INI case OP_INI_FREE: { diff --git a/src/vm/ini/get_bool.c b/src/vm/ini/get_bool.c index e9b9b5a..b03e25e 100644 --- a/src/vm/ini/get_bool.c +++ b/src/vm/ini/get_bool.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -28,6 +28,7 @@ * Errors * - Invalid handle or arguments simply yield the default value; no exception. */ + /* OP_INI_GET_BOOL */ #ifdef FUN_WITH_INI case OP_INI_GET_BOOL: { diff --git a/src/vm/ini/get_double.c b/src/vm/ini/get_double.c index 0533242..03d4709 100644 --- a/src/vm/ini/get_double.c +++ b/src/vm/ini/get_double.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -22,6 +22,7 @@ * Errors * - Invalid handle/args simply produce the default; no exception raised. */ + /* OP_INI_GET_DOUBLE */ #ifdef FUN_WITH_INI case OP_INI_GET_DOUBLE: { diff --git a/src/vm/ini/get_int.c b/src/vm/ini/get_int.c index 4f04cf7..3f6bf10 100644 --- a/src/vm/ini/get_int.c +++ b/src/vm/ini/get_int.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -22,6 +22,7 @@ * Errors * - Invalid handle/args produce the default; no VM exception is raised. */ + /* OP_INI_GET_INT */ #ifdef FUN_WITH_INI case OP_INI_GET_INT: { diff --git a/src/vm/ini/get_string.c b/src/vm/ini/get_string.c index a6f108f..2bff013 100644 --- a/src/vm/ini/get_string.c +++ b/src/vm/ini/get_string.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -22,6 +22,7 @@ * Errors * - Invalid handle/args result in pushing the default (or empty string). */ + /* OP_INI_GET_STRING */ #ifdef FUN_WITH_INI case OP_INI_GET_STRING: { diff --git a/src/vm/ini/handles.c b/src/vm/ini/handles.c index 6bcbd99..4039506 100644 --- a/src/vm/ini/handles.c +++ b/src/vm/ini/handles.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/ini/handles.h b/src/vm/ini/handles.h index a43eb00..72d1d5d 100644 --- a/src/vm/ini/handles.h +++ b/src/vm/ini/handles.h @@ -11,6 +11,7 @@ * @file handles.h * @brief INI handle registry for iniparser 4.2.6 used by INI VM opcodes. */ + #pragma once #ifdef FUN_WITH_INI diff --git a/src/vm/ini/load.c b/src/vm/ini/load.c index 87f33e7..272d73e 100644 --- a/src/vm/ini/load.c +++ b/src/vm/ini/load.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -23,6 +23,7 @@ * - The returned handle must later be released with OP_INI_FREE to avoid * leaking dictionary objects. */ + /* OP_INI_LOAD: pops path string; pushes handle (>0) or 0 */ #ifdef FUN_WITH_INI case OP_INI_LOAD: { diff --git a/src/vm/ini/save.c b/src/vm/ini/save.c index cdc9551..bcbdcb9 100644 --- a/src/vm/ini/save.c +++ b/src/vm/ini/save.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -22,6 +22,7 @@ * Errors * - Failing fopen() or invalid handle simply return 0; no exception is thrown. */ + /* OP_INI_SAVE */ #ifdef FUN_WITH_INI case OP_INI_SAVE: { diff --git a/src/vm/ini/set.c b/src/vm/ini/set.c index e759f1a..e9b1eb9 100644 --- a/src/vm/ini/set.c +++ b/src/vm/ini/set.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -23,6 +23,7 @@ * Errors * - No VM exception is thrown; failures return 0. */ + /* OP_INI_SET */ #ifdef FUN_WITH_INI case OP_INI_SET: { diff --git a/src/vm/ini/stubs.c b/src/vm/ini/stubs.c index 00b9164..7a02cf0 100644 --- a/src/vm/ini/stubs.c +++ b/src/vm/ini/stubs.c @@ -1,3 +1,12 @@ +/* + * This file is part of the Fun programming language. + * https://fun-lang.xyz/ + * + * Copyright 2025 Johannes Findeisen + * Licensed under the terms of the Apache-2.0 license. + * https://opensource.org/license/apache-2-0 + */ + /** * @file stubs.c * @brief Stub opcode implementations for INI support when FUN_WITH_INI is disabled. diff --git a/src/vm/ini/unset.c b/src/vm/ini/unset.c index 58c8d7c..207a320 100644 --- a/src/vm/ini/unset.c +++ b/src/vm/ini/unset.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -23,6 +23,7 @@ * - iniparser 4.2.6 dictionary_unset() returns void; we assume success when * called with valid parameters. */ + /* OP_INI_UNSET */ #ifdef FUN_WITH_INI case OP_INI_UNSET: { diff --git a/src/vm/io/input_line.c b/src/vm/io/input_line.c index 5b52286..d6cfb86 100644 --- a/src/vm/io/input_line.c +++ b/src/vm/io/input_line.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -48,6 +48,7 @@ * // Stack before (bit0=1): ["Enter password: "] * // Stack after: ["user-typed-line"] */ + case OP_INPUT_LINE: { /* operand bit flags: * bit0 (1): has prompt (string or any value convertible to string) — top of stack holds prompt when set diff --git a/src/vm/io/read_file.c b/src/vm/io/read_file.c index f0b10a1..8813368 100644 --- a/src/vm/io/read_file.c +++ b/src/vm/io/read_file.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -26,9 +26,6 @@ * // Bytecode: OP_READ_FILE * // Stack before: ["file.txt"] * // Stack after: ["file contents"] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_READ_FILE: { diff --git a/src/vm/io/write_file.c b/src/vm/io/write_file.c index 7f1e0c7..e77812f 100644 --- a/src/vm/io/write_file.c +++ b/src/vm/io/write_file.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -26,9 +26,6 @@ * // Bytecode: OP_WRITE_FILE * // Stack before: ["file.txt", "data"] * // Stack after: [1] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_WRITE_FILE: { diff --git a/src/vm/json/from_file.c b/src/vm/json/from_file.c index 4352072..9d71a7f 100644 --- a/src/vm/json/from_file.c +++ b/src/vm/json/from_file.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/json/parse.c b/src/vm/json/parse.c index 6112218..4ff3efb 100644 --- a/src/vm/json/parse.c +++ b/src/vm/json/parse.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/json/stringify.c b/src/vm/json/stringify.c index c0583e5..c02b29f 100644 --- a/src/vm/json/stringify.c +++ b/src/vm/json/stringify.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/json/to_file.c b/src/vm/json/to_file.c index 1b12809..9b2bab9 100644 --- a/src/vm/json/to_file.c +++ b/src/vm/json/to_file.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/len.c b/src/vm/len.c index 67101b2..06583f0 100644 --- a/src/vm/len.c +++ b/src/vm/len.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/line.c b/src/vm/line.c index 36f180b..2cc7a6b 100644 --- a/src/vm/line.c +++ b/src/vm/line.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/logic/and.c b/src/vm/logic/and.c index 32e1fb7..ddb6123 100644 --- a/src/vm/logic/and.c +++ b/src/vm/logic/and.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -26,9 +26,6 @@ * // Bytecode: OP_AND * // Stack before: [1, 0] * // Stack after: [0] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_AND: { diff --git a/src/vm/logic/eq.c b/src/vm/logic/eq.c index 26fda7c..715a031 100644 --- a/src/vm/logic/eq.c +++ b/src/vm/logic/eq.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -26,9 +26,6 @@ * // Bytecode: OP_EQ * // Stack before: [42, 42] * // Stack after: [1] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_EQ: { diff --git a/src/vm/logic/gt.c b/src/vm/logic/gt.c index ef34675..3d9691f 100644 --- a/src/vm/logic/gt.c +++ b/src/vm/logic/gt.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -27,9 +27,6 @@ * // Bytecode: OP_GT * // Stack before: [42, 10] * // Stack after: [1] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_GT: { diff --git a/src/vm/logic/gte.c b/src/vm/logic/gte.c index b77989b..1121777 100644 --- a/src/vm/logic/gte.c +++ b/src/vm/logic/gte.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -26,9 +26,6 @@ * // Bytecode: OP_GTE * // Stack before: [42, 42] * // Stack after: [1] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_GTE: { diff --git a/src/vm/logic/lt.c b/src/vm/logic/lt.c index 291dec5..103f334 100644 --- a/src/vm/logic/lt.c +++ b/src/vm/logic/lt.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -26,9 +26,6 @@ * // Bytecode: OP_LT * // Stack before: [10, 42] * // Stack after: [1] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_LT: { diff --git a/src/vm/logic/lte.c b/src/vm/logic/lte.c index 7dff85d..721d000 100644 --- a/src/vm/logic/lte.c +++ b/src/vm/logic/lte.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -26,9 +26,6 @@ * // Bytecode: OP_LTE * // Stack before: [42, 42] * // Stack after: [1] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_LTE: { diff --git a/src/vm/logic/neq.c b/src/vm/logic/neq.c index 2bc30db..92720a9 100644 --- a/src/vm/logic/neq.c +++ b/src/vm/logic/neq.c @@ -26,9 +26,6 @@ * // Bytecode: OP_NEQ * // Stack before: [42, 10] * // Stack after: [1] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_NEQ: { diff --git a/src/vm/logic/not.c b/src/vm/logic/not.c index d23ceef..8a78370 100644 --- a/src/vm/logic/not.c +++ b/src/vm/logic/not.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -26,9 +26,6 @@ * // Bytecode: OP_NOT * // Stack before: [0] * // Stack after: [1] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_NOT: { diff --git a/src/vm/logic/or.c b/src/vm/logic/or.c index 3f7c8b6..6c89029 100644 --- a/src/vm/logic/or.c +++ b/src/vm/logic/or.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -26,9 +26,6 @@ * // Bytecode: OP_OR * // Stack before: [1, 0] * // Stack after: [1] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_OR: { diff --git a/src/vm/maps/has_key.c b/src/vm/maps/has_key.c index 5b8ddb3..72a1c3b 100644 --- a/src/vm/maps/has_key.c +++ b/src/vm/maps/has_key.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -20,9 +20,6 @@ * * Error Handling: * - Exits if arguments wrong types - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_HAS_KEY: { diff --git a/src/vm/maps/keys.c b/src/vm/maps/keys.c index 84b66ad..074342e 100644 --- a/src/vm/maps/keys.c +++ b/src/vm/maps/keys.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -26,9 +26,6 @@ * // Bytecode: OP_KEYS * // Stack before: [{"a": 1, "b": 2}] * // Stack after: [["a", "b"]] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_KEYS: { diff --git a/src/vm/maps/make_map.c b/src/vm/maps/make_map.c index 6bb199a..b39f433 100644 --- a/src/vm/maps/make_map.c +++ b/src/vm/maps/make_map.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -28,9 +28,6 @@ * // Bytecode: OP_MAKE_MAP 2 * // Stack before: ["key1", 1, "key2", 2] * // Stack after: [{"key1": 1, "key2": 2}] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_MAKE_MAP: { diff --git a/src/vm/maps/values.c b/src/vm/maps/values.c index 7dca58c..3a2838a 100644 --- a/src/vm/maps/values.c +++ b/src/vm/maps/values.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -26,9 +26,6 @@ * // Bytecode: OP_VALUES * // Stack before: [{"a": 1, "b": 2}] * // Stack after: [[1, 2]] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_VALUES: { diff --git a/src/vm/math/abs.c b/src/vm/math/abs.c index e0a4671..537a998 100644 --- a/src/vm/math/abs.c +++ b/src/vm/math/abs.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/math/ceil.c b/src/vm/math/ceil.c index 2efbc01..21d68f9 100644 --- a/src/vm/math/ceil.c +++ b/src/vm/math/ceil.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/math/clamp.c b/src/vm/math/clamp.c index bb27104..c155596 100644 --- a/src/vm/math/clamp.c +++ b/src/vm/math/clamp.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/math/cos.c b/src/vm/math/cos.c index 01ce6b9..db290e4 100644 --- a/src/vm/math/cos.c +++ b/src/vm/math/cos.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/math/exp.c b/src/vm/math/exp.c index b354e6f..2d5586e 100644 --- a/src/vm/math/exp.c +++ b/src/vm/math/exp.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/math/floor.c b/src/vm/math/floor.c index f7a0480..4eb5229 100644 --- a/src/vm/math/floor.c +++ b/src/vm/math/floor.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/math/fmax.c b/src/vm/math/fmax.c index 08a5ad4..108156a 100644 --- a/src/vm/math/fmax.c +++ b/src/vm/math/fmax.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/math/fmin.c b/src/vm/math/fmin.c index c6883cc..291eb22 100644 --- a/src/vm/math/fmin.c +++ b/src/vm/math/fmin.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/math/gcd.c b/src/vm/math/gcd.c index f9af580..89ecf9f 100644 --- a/src/vm/math/gcd.c +++ b/src/vm/math/gcd.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/math/isqrt.c b/src/vm/math/isqrt.c index f3da284..3fdc8b5 100644 --- a/src/vm/math/isqrt.c +++ b/src/vm/math/isqrt.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/math/lcm.c b/src/vm/math/lcm.c index 98498ac..bc45957 100644 --- a/src/vm/math/lcm.c +++ b/src/vm/math/lcm.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/math/log.c b/src/vm/math/log.c index 0a788ad..a88fc29 100644 --- a/src/vm/math/log.c +++ b/src/vm/math/log.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/math/log10.c b/src/vm/math/log10.c index 52d8023..4c5bfd2 100644 --- a/src/vm/math/log10.c +++ b/src/vm/math/log10.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/math/max.c b/src/vm/math/max.c index ec2e903..7b8913a 100644 --- a/src/vm/math/max.c +++ b/src/vm/math/max.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -26,9 +26,6 @@ * // Bytecode: OP_MAX * // Stack before: [10, 42] * // Stack after: [42] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_MAX: { diff --git a/src/vm/math/min.c b/src/vm/math/min.c index 7931382..4e0086b 100644 --- a/src/vm/math/min.c +++ b/src/vm/math/min.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -26,9 +26,6 @@ * // Bytecode: OP_MIN * // Stack before: [10, 42] * // Stack after: [10] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_MIN: { diff --git a/src/vm/math/mod.c b/src/vm/math/mod.c index b0319e7..e5213c6 100644 --- a/src/vm/math/mod.c +++ b/src/vm/math/mod.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -27,9 +27,6 @@ * // Bytecode: OP_MOD * // Stack before: [10, 3] * // Stack after: [1] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_MOD: { diff --git a/src/vm/math/pow.c b/src/vm/math/pow.c index 0db1434..a2c9b16 100644 --- a/src/vm/math/pow.c +++ b/src/vm/math/pow.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -26,9 +26,6 @@ * // Bytecode: OP_POW * // Stack before: [2, 3] * // Stack after: [8] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_POW: { diff --git a/src/vm/math/random_int.c b/src/vm/math/random_int.c index 7f871a3..4b7811d 100644 --- a/src/vm/math/random_int.c +++ b/src/vm/math/random_int.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -28,9 +28,6 @@ * // Bytecode: OP_RANDOM_INT * // Stack before: [10, 1] * // Stack after: [7] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_RANDOM_INT: { diff --git a/src/vm/math/random_seed.c b/src/vm/math/random_seed.c index fe0bc34..c59df89 100644 --- a/src/vm/math/random_seed.c +++ b/src/vm/math/random_seed.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -25,9 +25,6 @@ * // Bytecode: OP_RANDOM_SEED * // Stack before: [42] * // Stack after: [] - * - * @author Johannes Findeisen - * @date 2025-10-16 */ case OP_RANDOM_SEED: { diff --git a/src/vm/math/round.c b/src/vm/math/round.c index 0e44c48..af30a4b 100644 --- a/src/vm/math/round.c +++ b/src/vm/math/round.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/math/sign.c b/src/vm/math/sign.c index 58a1faf..b12f123 100644 --- a/src/vm/math/sign.c +++ b/src/vm/math/sign.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/math/sin.c b/src/vm/math/sin.c index 255e183..e73cad3 100644 --- a/src/vm/math/sin.c +++ b/src/vm/math/sin.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/math/sqrt.c b/src/vm/math/sqrt.c index 983ff34..3c8c268 100644 --- a/src/vm/math/sqrt.c +++ b/src/vm/math/sqrt.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/math/tan.c b/src/vm/math/tan.c index 8400415..b4df94d 100644 --- a/src/vm/math/tan.c +++ b/src/vm/math/tan.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/math/trunc.c b/src/vm/math/trunc.c index ac9b1d6..d34de0a 100644 --- a/src/vm/math/trunc.c +++ b/src/vm/math/trunc.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/openssl/md5.c b/src/vm/openssl/md5.c index 4c20d9d..722761d 100644 --- a/src/vm/openssl/md5.c +++ b/src/vm/openssl/md5.c @@ -7,14 +7,27 @@ * https://opensource.org/license/apache-2-0 */ - /** - * @file md5.c - * @brief VM opcode snippet: compute MD5 hash (OP_MD5). Included by vm.c. - */ - /** - * OpenSSL MD5 builtin + * @file md5.c + * @brief Implements OP_OPENSSL_MD5 to compute an MD5 hash in hexadecimal. + * + * Behavior: + * - Pops one value from the VM stack and converts it to a byte sequence by + * obtaining its string representation using value_to_string_alloc(). + * - Computes the MD5 digest of the resulting bytes via fun_openssl_md5_hex() + * and pushes the lowercase hexadecimal string back onto the stack. + * - On allocation or hashing failure, pushes an empty string (""). + * + * Notes: + * - Non-string inputs are accepted; they are stringified first. + * - This snippet is included by vm.c and executed when OP_OPENSSL_MD5 is + * dispatched. + * + * Errors: + * - This opcode does not terminate the VM. Failures result in an empty + * string being pushed. */ + case OP_OPENSSL_MD5: { Value vdata = pop_value(vm); char *s = value_to_string_alloc(&vdata); diff --git a/src/vm/openssl/ripemd160.c b/src/vm/openssl/ripemd160.c index ef3f5f6..ffef303 100644 --- a/src/vm/openssl/ripemd160.c +++ b/src/vm/openssl/ripemd160.c @@ -7,9 +7,25 @@ * https://opensource.org/license/apache-2-0 */ -/* - * OpenSSL RIPEMD-160 builtin +/** + * @file ripemd160.c + * @brief Implements OP_OPENSSL_RIPEMD160 to compute a RIPEMD-160 hash in hex. + * + * Behavior: + * - Pops one value from the VM stack and converts it to bytes by first + * producing its string representation with value_to_string_alloc(). + * - Computes the RIPEMD-160 digest via fun_openssl_ripemd160_hex() and + * pushes the lowercase hexadecimal string. + * - On allocation or hashing failure, pushes an empty string (""). + * + * Notes: + * - Accepts any value type; non-strings are stringified first. + * - Included by vm.c and executed for OP_OPENSSL_RIPEMD160. + * + * Errors: + * - Does not abort the VM; failures result in an empty string. */ + case OP_OPENSSL_RIPEMD160: { Value vdata = pop_value(vm); char *s = value_to_string_alloc(&vdata); diff --git a/src/vm/openssl/sha256.c b/src/vm/openssl/sha256.c index e72bc5f..567ec10 100644 --- a/src/vm/openssl/sha256.c +++ b/src/vm/openssl/sha256.c @@ -8,8 +8,24 @@ */ /** - * OpenSSL SHA-256 builtin + * @file sha256.c + * @brief Implements OP_OPENSSL_SHA256 to compute a SHA-256 hash in hex. + * + * Behavior: + * - Pops one value from the VM stack and converts it to bytes by first + * producing its string form with value_to_string_alloc(). + * - Computes the SHA-256 digest via fun_openssl_sha256_hex() and pushes the + * lowercase hexadecimal string. + * - On allocation or hashing failure, pushes an empty string (""). + * + * Notes: + * - Non-string inputs are allowed; values are stringified first. + * - Snippet is included by vm.c and executed for OP_OPENSSL_SHA256. + * + * Errors: + * - No hard VM error is raised; failures push an empty string. */ + case OP_OPENSSL_SHA256: { Value vdata = pop_value(vm); char *s = value_to_string_alloc(&vdata); diff --git a/src/vm/openssl/sha512.c b/src/vm/openssl/sha512.c index c1ca5b1..db9eed0 100644 --- a/src/vm/openssl/sha512.c +++ b/src/vm/openssl/sha512.c @@ -8,8 +8,24 @@ */ /** - * OpenSSL SHA-512 builtin + * @file sha512.c + * @brief Implements OP_OPENSSL_SHA512 to compute a SHA-512 hash in hex. + * + * Behavior: + * - Pops one value from the VM stack and converts it to bytes by first + * turning it into a string with value_to_string_alloc(). + * - Computes the SHA-512 digest via fun_openssl_sha512_hex() and pushes the + * lowercase hexadecimal string back on the stack. + * - On allocation or hashing failure, pushes an empty string (""). + * + * Notes: + * - Non-string inputs are accepted and stringified first. + * - This file is included by vm.c and handles OP_OPENSSL_SHA512. + * + * Errors: + * - Does not abort the VM; failures return an empty string. */ + case OP_OPENSSL_SHA512: { Value vdata = pop_value(vm); char *s = value_to_string_alloc(&vdata); diff --git a/src/vm/os/clock_mono_ms.c b/src/vm/os/clock_mono_ms.c index 49eea55..be09e0b 100644 --- a/src/vm/os/clock_mono_ms.c +++ b/src/vm/os/clock_mono_ms.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/os/date_format.c b/src/vm/os/date_format.c index 05c93f5..24a7b81 100644 --- a/src/vm/os/date_format.c +++ b/src/vm/os/date_format.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/os/env.c b/src/vm/os/env.c index 272da09..e2de615 100644 --- a/src/vm/os/env.c +++ b/src/vm/os/env.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/os/env_all.c b/src/vm/os/env_all.c index 7d03bd6..7cf5033 100644 --- a/src/vm/os/env_all.c +++ b/src/vm/os/env_all.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/os/fd_poll_read.c b/src/vm/os/fd_poll_read.c index 8ae2248..28ca7f0 100644 --- a/src/vm/os/fd_poll_read.c +++ b/src/vm/os/fd_poll_read.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/os/fd_poll_write.c b/src/vm/os/fd_poll_write.c index 3b5c846..d20ee7a 100644 --- a/src/vm/os/fd_poll_write.c +++ b/src/vm/os/fd_poll_write.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/os/fd_set_nonblock.c b/src/vm/os/fd_set_nonblock.c index f73dbd9..abdf4e9 100644 --- a/src/vm/os/fd_set_nonblock.c +++ b/src/vm/os/fd_set_nonblock.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/os/fun_version.c b/src/vm/os/fun_version.c index 613350f..ab043d3 100644 --- a/src/vm/os/fun_version.c +++ b/src/vm/os/fun_version.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/os/list_dir.c b/src/vm/os/list_dir.c index 4aa4d20..56fe28a 100644 --- a/src/vm/os/list_dir.c +++ b/src/vm/os/list_dir.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/os/proc_run.c b/src/vm/os/proc_run.c index 35c9ae9..31ce81f 100644 --- a/src/vm/os/proc_run.c +++ b/src/vm/os/proc_run.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/os/proc_system.c b/src/vm/os/proc_system.c index e16bdcd..238b18f 100644 --- a/src/vm/os/proc_system.c +++ b/src/vm/os/proc_system.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/os/random_number.c b/src/vm/os/random_number.c index 18ba5fd..df2d895 100644 --- a/src/vm/os/random_number.c +++ b/src/vm/os/random_number.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/os/serial_close.c b/src/vm/os/serial_close.c index 8229019..04b98d3 100644 --- a/src/vm/os/serial_close.c +++ b/src/vm/os/serial_close.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/os/serial_config.c b/src/vm/os/serial_config.c index e0524c9..4643e48 100644 --- a/src/vm/os/serial_config.c +++ b/src/vm/os/serial_config.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/os/serial_open.c b/src/vm/os/serial_open.c index 0c5de61..b7c7cb3 100644 --- a/src/vm/os/serial_open.c +++ b/src/vm/os/serial_open.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/os/serial_recv.c b/src/vm/os/serial_recv.c index 73359ef..895cb55 100644 --- a/src/vm/os/serial_recv.c +++ b/src/vm/os/serial_recv.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/os/serial_send.c b/src/vm/os/serial_send.c index ef32da0..4ed330a 100644 --- a/src/vm/os/serial_send.c +++ b/src/vm/os/serial_send.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/os/sleep_ms.c b/src/vm/os/sleep_ms.c index 5ba1489..3436c3e 100644 --- a/src/vm/os/sleep_ms.c +++ b/src/vm/os/sleep_ms.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/os/socket_close.c b/src/vm/os/socket_close.c index 90fbb72..386f2aa 100644 --- a/src/vm/os/socket_close.c +++ b/src/vm/os/socket_close.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/os/socket_recv.c b/src/vm/os/socket_recv.c index 9e02b1a..e7dbb77 100644 --- a/src/vm/os/socket_recv.c +++ b/src/vm/os/socket_recv.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/os/socket_send.c b/src/vm/os/socket_send.c index 10ff8d3..d119381 100644 --- a/src/vm/os/socket_send.c +++ b/src/vm/os/socket_send.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/os/socket_tcp_accept.c b/src/vm/os/socket_tcp_accept.c index 3265759..a1ef211 100644 --- a/src/vm/os/socket_tcp_accept.c +++ b/src/vm/os/socket_tcp_accept.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/os/socket_tcp_connect.c b/src/vm/os/socket_tcp_connect.c index 58cfb39..2bf6076 100644 --- a/src/vm/os/socket_tcp_connect.c +++ b/src/vm/os/socket_tcp_connect.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/os/socket_tcp_listen.c b/src/vm/os/socket_tcp_listen.c index 0c324f3..51eb18b 100644 --- a/src/vm/os/socket_tcp_listen.c +++ b/src/vm/os/socket_tcp_listen.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/os/socket_unix_connect.c b/src/vm/os/socket_unix_connect.c index 4eee7b6..0880ff7 100644 --- a/src/vm/os/socket_unix_connect.c +++ b/src/vm/os/socket_unix_connect.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/os/socket_unix_listen.c b/src/vm/os/socket_unix_listen.c index 2b176a7..f08f12a 100644 --- a/src/vm/os/socket_unix_listen.c +++ b/src/vm/os/socket_unix_listen.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/os/thread_common.c b/src/vm/os/thread_common.c index 9a91482..3a8dd42 100644 --- a/src/vm/os/thread_common.c +++ b/src/vm/os/thread_common.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/os/thread_join.c b/src/vm/os/thread_join.c index 6ad39b2..72d4c2d 100644 --- a/src/vm/os/thread_join.c +++ b/src/vm/os/thread_join.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/os/thread_spawn.c b/src/vm/os/thread_spawn.c index 27085f8..51cf2fb 100644 --- a/src/vm/os/thread_spawn.c +++ b/src/vm/os/thread_spawn.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/os/time_now_ms.c b/src/vm/os/time_now_ms.c index f9cded7..35a693e 100644 --- a/src/vm/os/time_now_ms.c +++ b/src/vm/os/time_now_ms.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/pcre2/findall.c b/src/vm/pcre2/findall.c index 40786ce..0915312 100644 --- a/src/vm/pcre2/findall.c +++ b/src/vm/pcre2/findall.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/pcre2/match.c b/src/vm/pcre2/match.c index c7a6db7..f69037b 100644 --- a/src/vm/pcre2/match.c +++ b/src/vm/pcre2/match.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/pcre2/test.c b/src/vm/pcre2/test.c index 9154b93..c4dca4c 100644 --- a/src/vm/pcre2/test.c +++ b/src/vm/pcre2/test.c @@ -1,12 +1,10 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * * Copyright 2025 Johannes Findeisen * Licensed under the terms of the Apache-2.0 license. * https://opensource.org/license/apache-2-0 - * - * Added: 2025-11-25 */ /** diff --git a/src/vm/pcsc/connect.c b/src/vm/pcsc/connect.c index e53fc20..3f79293 100644 --- a/src/vm/pcsc/connect.c +++ b/src/vm/pcsc/connect.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/pcsc/disconnect.c b/src/vm/pcsc/disconnect.c index 4d86449..4c01da2 100644 --- a/src/vm/pcsc/disconnect.c +++ b/src/vm/pcsc/disconnect.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/pcsc/establish.c b/src/vm/pcsc/establish.c index 4d2047f..d6af7c2 100644 --- a/src/vm/pcsc/establish.c +++ b/src/vm/pcsc/establish.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/pcsc/list_readers.c b/src/vm/pcsc/list_readers.c index 4e583a0..8cbf7e1 100644 --- a/src/vm/pcsc/list_readers.c +++ b/src/vm/pcsc/list_readers.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/pcsc/release.c b/src/vm/pcsc/release.c index 909b00d..72d2c58 100644 --- a/src/vm/pcsc/release.c +++ b/src/vm/pcsc/release.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/pcsc/transmit.c b/src/vm/pcsc/transmit.c index e1fb8fb..5d37368 100644 --- a/src/vm/pcsc/transmit.c +++ b/src/vm/pcsc/transmit.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/print.c b/src/vm/print.c index afbc506..0c4a78b 100644 --- a/src/vm/print.c +++ b/src/vm/print.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/rust/get_sp.c b/src/vm/rust/get_sp.c index 5e37f8c..09c3b42 100644 --- a/src/vm/rust/get_sp.c +++ b/src/vm/rust/get_sp.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/rust/hello.c b/src/vm/rust/hello.c index 7de8c69..8cfaa04 100644 --- a/src/vm/rust/hello.c +++ b/src/vm/rust/hello.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/rust/hello_args.c b/src/vm/rust/hello_args.c index f365def..09f9703 100644 --- a/src/vm/rust/hello_args.c +++ b/src/vm/rust/hello_args.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/rust/hello_args_return.c b/src/vm/rust/hello_args_return.c index 4c94425..8b06521 100644 --- a/src/vm/rust/hello_args_return.c +++ b/src/vm/rust/hello_args_return.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/rust/set_exit.c b/src/vm/rust/set_exit.c index 66dd271..27622e0 100644 --- a/src/vm/rust/set_exit.c +++ b/src/vm/rust/set_exit.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/sclamp.c b/src/vm/sclamp.c index 10a7afb..f212df8 100644 --- a/src/vm/sclamp.c +++ b/src/vm/sclamp.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/sqlite/close.c b/src/vm/sqlite/close.c index d2d4e2d..3b5ecc7 100644 --- a/src/vm/sqlite/close.c +++ b/src/vm/sqlite/close.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/sqlite/exec.c b/src/vm/sqlite/exec.c index 8580d21..9ebff9d 100644 --- a/src/vm/sqlite/exec.c +++ b/src/vm/sqlite/exec.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/sqlite/open.c b/src/vm/sqlite/open.c index 9b1f537..ff71228 100644 --- a/src/vm/sqlite/open.c +++ b/src/vm/sqlite/open.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/sqlite/query.c b/src/vm/sqlite/query.c index ac88673..1f6fe09 100644 --- a/src/vm/sqlite/query.c +++ b/src/vm/sqlite/query.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/strings/find.c b/src/vm/strings/find.c index 24d9415..6a1248d 100644 --- a/src/vm/strings/find.c +++ b/src/vm/strings/find.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/strings/regex_match.c b/src/vm/strings/regex_match.c index d083ade..d0cab8f 100644 --- a/src/vm/strings/regex_match.c +++ b/src/vm/strings/regex_match.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/strings/regex_replace.c b/src/vm/strings/regex_replace.c index f0a92f8..368fd28 100644 --- a/src/vm/strings/regex_replace.c +++ b/src/vm/strings/regex_replace.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/strings/regex_search.c b/src/vm/strings/regex_search.c index 192f2ca..7149729 100644 --- a/src/vm/strings/regex_search.c +++ b/src/vm/strings/regex_search.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/strings/split.c b/src/vm/strings/split.c index 626f876..6806bcb 100644 --- a/src/vm/strings/split.c +++ b/src/vm/strings/split.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/strings/substr.c b/src/vm/strings/substr.c index 763036c..6875932 100644 --- a/src/vm/strings/substr.c +++ b/src/vm/strings/substr.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/to_number.c b/src/vm/to_number.c index 9cb43f4..aa8c135 100644 --- a/src/vm/to_number.c +++ b/src/vm/to_number.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/to_string.c b/src/vm/to_string.c index 227f1a7..3f34b51 100644 --- a/src/vm/to_string.c +++ b/src/vm/to_string.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/typeof.c b/src/vm/typeof.c index 8dcc09d..e98e63e 100644 --- a/src/vm/typeof.c +++ b/src/vm/typeof.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/uclamp.c b/src/vm/uclamp.c index 2560a6f..74aedf1 100644 --- a/src/vm/uclamp.c +++ b/src/vm/uclamp.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * diff --git a/src/vm/xml/name.c b/src/vm/xml/name.c index a0d5c79..df2d56b 100644 --- a/src/vm/xml/name.c +++ b/src/vm/xml/name.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -8,7 +8,7 @@ */ /** - * @file + * @file name.c * @brief VM opcode snippet for XML node name retrieval. * * This file is included into the main VM dispatch switch in vm.c and diff --git a/src/vm/xml/parse.c b/src/vm/xml/parse.c index c915752..6f69b95 100644 --- a/src/vm/xml/parse.c +++ b/src/vm/xml/parse.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -8,7 +8,7 @@ */ /** - * @file + * @file parse.c * @brief VM opcode snippet for parsing XML text into a document handle. * * This snippet is included by vm.c and implements OP_XML_PARSE. diff --git a/src/vm/xml/root.c b/src/vm/xml/root.c index fdcc61a..68eacc0 100644 --- a/src/vm/xml/root.c +++ b/src/vm/xml/root.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -8,7 +8,7 @@ */ /** - * @file + * @file root.c * @brief VM opcode snippet for retrieving the root node of an XML document. * * Included by vm.c; implements OP_XML_ROOT. diff --git a/src/vm/xml/text.c b/src/vm/xml/text.c index 7acefad..c03e5a8 100644 --- a/src/vm/xml/text.c +++ b/src/vm/xml/text.c @@ -1,4 +1,4 @@ -/** +/* * This file is part of the Fun programming language. * https://fun-lang.xyz/ * @@ -8,7 +8,7 @@ */ /** - * @file + * @file text.c * @brief VM opcode snippet for retrieving the concatenated text of an XML node. * * Included by vm.c; implements OP_XML_TEXT. diff --git a/web/Makefile b/web/Makefile index 00aecff..f151b24 100644 --- a/web/Makefile +++ b/web/Makefile @@ -3,6 +3,8 @@ all: build: bundle exec jekyll b --incremental + rm -rf _site/api + cp -Rv ../api/html ./_site/api clean: rm -rf _site/* diff --git a/web/_posts/2026-05-01-announcing-api-documentation.md b/web/_posts/2026-05-01-announcing-api-documentation.md new file mode 100644 index 0000000..f72f33e --- /dev/null +++ b/web/_posts/2026-05-01-announcing-api-documentation.md @@ -0,0 +1,56 @@ +--- +layout: post +published: true +author: hanez +author_email: hanez@fun-lang.xyz +author_url: https://hanez.org +noToc: false +title: Announcing the Fun API Documentation +description: A new API documentation hub is now available at fun-lang.xyz/api to explore the Fun VM internals and get contributors started faster. +date: 2026-05-01 +categories: +- news +- docs +- project +tags: +- fun +- api +- documentation +- vm +- developers +- contributors +--- + +We are excited to announce that the official Fun API documentation is now live at: + +- [https://fun-lang.xyz/api/](https://fun-lang.xyz/api/) + +This new documentation hub is intended to make it easier to understand the internals of the Fun Virtual Machine (VM) and related components. It serves as a central entry point for participants, contributors, and anyone interested in building on top of Fun. + +This is actually a work in progress, and we are continuously improving and expanding it. + +### What you can expect to find: + +- VM internals and module overviews. +- Detailed API references generated from the source. +- Cross-links to examples, libraries, and relevant parts of the codebase. +- A consistent structure designed to help you discover how things work under the hood. + +### Who is this for? + +- New contributors looking for a starting point. +- Power users exploring advanced capabilities of the Fun VM. +- Researchers and curious minds wanting to understand implementation details. + +### How to get involved + +- Browse the API docs at [https://fun-lang.xyz/api/](https://fun-lang.xyz/api/) and send feedback. +- Open issues and ideas in our Git repository: [https://git.xw3.org/fun/fun](https://git.xw3.org/fun/fun){:class="git"}. +- Join the discussion: [https://fun-lang.xyz/community/](https://fun-lang.xyz/community/). +- Reach out directly: [hanez@fun-lang.xyz](mailto:hanez@fun-lang.xyz){:class="mail"}. + +This is just the beginning — we will keep iterating on structure, coverage, and examples. If you notice gaps or have suggestions, please let us know. + +Happy hacking! + +Johannes Findeisen (hanez) — [hanez@fun-lang.xyz](mailto:hanez@fun-lang.xyz){:class="mail"} diff --git a/web/documentation/documentation.md b/web/documentation/documentation.md index 7b65f10..145b09f 100644 --- a/web/documentation/documentation.md +++ b/web/documentation/documentation.md @@ -21,6 +21,7 @@ This file serves as an index of the documents in this directory. Links are relat - [Handbook](./handbook/) - Comprehensive handbook for the Fun language and VM: install/build, configuration flags, usage, and full feature overview. - [REPL](./repl/) - REPL user guide: how to build/launch, editing and history, completions, REPL-on-error, and tips. +- [API](../api/) - API documentation for the Fun language and VM. - Specification - [v0.4](https://git.xw3.org/fun/fun/src/branch/main/spec/v0.4/){:class="git"} - [v0.3](https://git.xw3.org/fun/fun/src/branch/main/spec/v0.3/){:class="git"}