From 567fa73796dfc025dadc74811a72c9ea3af3f90c Mon Sep 17 00:00:00 2001 From: hanez Date: Fri, 10 Apr 2026 23:27:55 +0200 Subject: [PATCH] Moved all docs from ./docs/ to ./web/documentation/ to be available on the website. No code changes. (0.40.5) --- docs/README.md | 58 ------ docs/examples/builtins_maps_and_more.md | 12 -- docs/examples/byte_for_demo.md | 9 - docs/examples/byte_overflow_try_catch.md | 9 - docs/examples/cast_demo.md | 9 - docs/examples/class_constructor.md | 9 - docs/examples/class_test.md | 12 -- docs/examples/class_without_object.md | 9 - docs/examples/classes_demo.md | 9 - docs/examples/cli_argv_dump.md | 9 - docs/examples/conversions_showcase.md | 9 - docs/examples/cpp_add.md | 12 -- docs/examples/data/htdocs/counter.md | 17 -- docs/examples/data/htdocs/form_post.md | 17 -- docs/examples/data/htdocs/hello.md | 17 -- docs/examples/data/htdocs/info.md | 17 -- docs/examples/data/htdocs/json_like_api.md | 17 -- docs/examples/data/htdocs/redirect.md | 17 -- docs/examples/datetime_basic.md | 9 - docs/examples/datetime_extended.md | 9 - docs/examples/datetime_timer.md | 9 - docs/examples/echo_example.md | 9 - docs/examples/env_all.md | 9 - docs/examples/error_handling.md | 9 - docs/examples/expressions_test.md | 9 - docs/examples/features.md | 9 - .../file_print_for_file_line_by_line.md | 9 - docs/examples/floats.md | 9 - docs/examples/for_range_test.md | 9 - docs/examples/functions_test.md | 9 - docs/examples/have_fun.md | 9 - docs/examples/have_fun_function.md | 9 - docs/examples/hex_example.md | 9 - docs/examples/if_else_test.md | 9 - docs/examples/include_lib.md | 9 - docs/examples/include_local.md | 9 - docs/examples/include_local_util.md | 9 - docs/examples/inheritance_demo.md | 9 - docs/examples/loops_break_continue.md | 9 - docs/examples/maps.md | 9 - docs/examples/match.md | 9 - docs/examples/namespaced_mod.md | 9 - docs/examples/nested_loops.md | 9 - docs/examples/net/http_static_server.md | 20 -- docs/examples/objects_basic.md | 9 - docs/examples/objects_more.md | 9 - docs/examples/os_env.md | 9 - docs/examples/process_example.md | 9 - docs/examples/progress.md | 9 - docs/examples/progress_inline.md | 9 - docs/examples/random_demo.md | 9 - docs/examples/random_number_example.md | 9 - docs/examples/regex_demo.md | 12 -- docs/examples/regex_procedural.md | 12 -- docs/examples/rust_hello.md | 12 -- docs/examples/rust_hello_args.md | 12 -- docs/examples/rust_hello_args_return.md | 12 -- docs/examples/serial_demo.md | 12 -- docs/examples/short_circuit_test.md | 9 - docs/examples/signed_ints.md | 9 - docs/examples/stdlib_showcase.md | 9 - docs/examples/strings_test.md | 9 - docs/examples/tcp_http_get.md | 12 -- docs/examples/tcp_http_get_class.md | 12 -- docs/examples/test_bits.md | 9 - docs/examples/test_dec_to_hex.md | 9 - docs/examples/test_hex_to_dec.md | 9 - docs/examples/test_include.md | 9 - docs/examples/test_rol.md | 9 - docs/examples/test_serial.md | 12 -- docs/examples/test_shl.md | 9 - docs/examples/test_types.md | 9 - docs/examples/test_xor.md | 9 - docs/examples/thread_class_example.md | 9 - docs/examples/threads_demo.md | 9 - docs/examples/try_catch_finally.md | 9 - docs/examples/type_safety.md | 9 - docs/examples/type_safety_fails.md | 9 - docs/examples/typeof.md | 9 - docs/examples/typeof_features.md | 9 - docs/examples/types_integers.md | 9 - docs/examples/types_overview.md | 9 - docs/examples/uint_types.md | 9 - docs/examples/unix_socket_echo.md | 12 -- docs/examples/version.md | 9 - docs/examples/while_test.md | 9 - docs/external/README.md | 23 --- docs/faq.md | 22 --- docs/roadmap.md | 21 --- .../2026-01-25-announcing-fun-0.37.62.md | 10 +- {docs => web/documentation}/arrays.md | 26 +++ {docs => web/documentation}/asyncio.md | 36 +++- {docs => web/documentation}/build.md | 30 ++- .../documentation}/bytecode-format.md | 28 ++- {docs => web/documentation}/cli.md | 32 +++- {docs => web/documentation}/contributing.md | 40 +++- web/documentation/documentation.md | 73 ++++++-- {docs => web/documentation}/embedding.md | 30 ++- .../documentation}/errors-and-diagnostics.md | 28 ++- {docs => web/documentation}/examples.md | 26 +++ .../documentation}/examples/README.md | 174 ++++++++++-------- .../examples/builtins_extended.md | 26 +++ .../examples/builtins_maps_and_more.md | 38 ++++ web/documentation/examples/byte_for_demo.md | 35 ++++ .../examples/byte_overflow_try_catch.md | 35 ++++ web/documentation/examples/cast_demo.md | 35 ++++ .../examples/class_constructor.md | 35 ++++ web/documentation/examples/class_test.md | 38 ++++ .../examples/class_without_object.md | 35 ++++ web/documentation/examples/classes_demo.md | 35 ++++ web/documentation/examples/cli_argv_dump.md | 35 ++++ .../examples/conversions_showcase.md | 35 ++++ web/documentation/examples/cpp_add.md | 38 ++++ .../examples/data/htdocs/counter.md | 43 +++++ .../examples/data/htdocs/form_post.md | 43 +++++ .../examples/data/htdocs/hello.md | 43 +++++ .../examples/data/htdocs/info.md | 43 +++++ .../examples/data/htdocs/json_like_api.md | 43 +++++ .../examples/data/htdocs/redirect.md | 43 +++++ web/documentation/examples/datetime_basic.md | 35 ++++ .../examples/datetime_extended.md | 35 ++++ web/documentation/examples/datetime_timer.md | 35 ++++ web/documentation/examples/echo_example.md | 35 ++++ web/documentation/examples/env_all.md | 35 ++++ web/documentation/examples/error_handling.md | 35 ++++ .../examples/expressions_test.md | 35 ++++ web/documentation/examples/features.md | 35 ++++ .../file_print_for_file_line_by_line.md | 35 ++++ web/documentation/examples/floats.md | 35 ++++ web/documentation/examples/for_range_test.md | 35 ++++ web/documentation/examples/functions_test.md | 35 ++++ web/documentation/examples/have_fun.md | 35 ++++ .../examples/have_fun_function.md | 35 ++++ web/documentation/examples/hex_example.md | 35 ++++ web/documentation/examples/if_else_test.md | 35 ++++ web/documentation/examples/include_lib.md | 35 ++++ web/documentation/examples/include_local.md | 35 ++++ .../examples/include_local_util.md | 35 ++++ .../examples/inheritance_demo.md | 35 ++++ .../examples/loops_break_continue.md | 35 ++++ web/documentation/examples/maps.md | 35 ++++ web/documentation/examples/match.md | 35 ++++ web/documentation/examples/namespaced_mod.md | 35 ++++ web/documentation/examples/nested_loops.md | 35 ++++ .../examples/net/http_mt_server.md | 30 ++- .../examples/net/http_mt_server_cgi.md | 30 ++- .../examples/net/http_server.md | 30 ++- .../examples/net/http_server_cgi.md | 30 ++- .../examples/net/http_server_cgi_lib.md | 30 ++- .../examples/net/http_static_server.md | 46 +++++ .../documentation}/examples/net/httpserver.md | 28 ++- web/documentation/examples/objects_basic.md | 35 ++++ web/documentation/examples/objects_more.md | 35 ++++ web/documentation/examples/os_env.md | 35 ++++ web/documentation/examples/process_example.md | 35 ++++ web/documentation/examples/progress.md | 35 ++++ web/documentation/examples/progress_inline.md | 35 ++++ web/documentation/examples/random_demo.md | 35 ++++ .../examples/random_number_example.md | 35 ++++ web/documentation/examples/regex_demo.md | 38 ++++ .../examples/regex_procedural.md | 38 ++++ web/documentation/examples/rust_hello.md | 38 ++++ web/documentation/examples/rust_hello_args.md | 38 ++++ .../examples/rust_hello_args_return.md | 38 ++++ web/documentation/examples/serial_demo.md | 38 ++++ .../examples/short_circuit_test.md | 35 ++++ web/documentation/examples/signed_ints.md | 35 ++++ web/documentation/examples/stdlib_showcase.md | 35 ++++ web/documentation/examples/strings_test.md | 35 ++++ web/documentation/examples/tcp_http_get.md | 38 ++++ .../examples/tcp_http_get_class.md | 38 ++++ web/documentation/examples/test_bits.md | 35 ++++ web/documentation/examples/test_dec_to_hex.md | 35 ++++ web/documentation/examples/test_hex_to_dec.md | 35 ++++ web/documentation/examples/test_include.md | 35 ++++ web/documentation/examples/test_rol.md | 35 ++++ web/documentation/examples/test_serial.md | 38 ++++ web/documentation/examples/test_shl.md | 35 ++++ web/documentation/examples/test_types.md | 35 ++++ web/documentation/examples/test_xor.md | 35 ++++ .../examples/thread_class_example.md | 35 ++++ web/documentation/examples/threads_demo.md | 35 ++++ .../examples/try_catch_finally.md | 35 ++++ web/documentation/examples/type_safety.md | 35 ++++ .../examples/type_safety_fails.md | 35 ++++ web/documentation/examples/typeof.md | 35 ++++ web/documentation/examples/typeof_features.md | 35 ++++ web/documentation/examples/types_integers.md | 35 ++++ web/documentation/examples/types_overview.md | 35 ++++ web/documentation/examples/uint_types.md | 35 ++++ .../examples/unix_socket_echo.md | 38 ++++ web/documentation/examples/version.md | 35 ++++ web/documentation/examples/while_test.md | 35 ++++ web/documentation/external/README.md | 49 +++++ {docs => web/documentation}/external/curl.md | 26 +++ {docs => web/documentation}/external/ini.md | 26 +++ {docs => web/documentation}/external/json.md | 26 +++ .../documentation}/external/openssl.md | 26 +++ {docs => web/documentation}/external/pcre2.md | 26 +++ {docs => web/documentation}/external/pcsc.md | 26 +++ .../documentation}/external/sqlite.md | 26 +++ {docs => web/documentation}/external/xml2.md | 26 +++ web/documentation/faq.md | 48 +++++ {docs => web/documentation}/fun.md | 38 +++- {docs => web/documentation}/funstx.md | 26 +++ {docs => web/documentation}/handbook.md | 26 +++ {docs => web/documentation}/includes.md | 28 ++- {docs => web/documentation}/internals.md | 28 ++- {docs => web/documentation}/maps.md | 28 ++- {docs => web/documentation}/numbers.md | 32 +++- {docs => web/documentation}/opcodes.md | 26 +++ {docs => web/documentation}/performance.md | 26 +++ {docs => web/documentation}/repl.md | 28 ++- web/documentation/roadmap.md | 47 +++++ {docs => web/documentation}/rust.md | 30 ++- .../documentation}/security-and-sandboxing.md | 26 +++ {docs => web/documentation}/stdlib.md | 30 ++- {docs => web/documentation}/strings.md | 30 ++- {docs => web/documentation}/style-guide.md | 28 ++- {docs => web/documentation}/testing.md | 26 +++ .../documentation}/troubleshooting.md | 28 ++- {docs => web/documentation}/types.md | 38 +++- {docs => web/documentation}/website.md | 26 +++ {docs => web/documentation}/writing-tests.md | 28 ++- 224 files changed, 4585 insertions(+), 1140 deletions(-) delete mode 100644 docs/README.md delete mode 100644 docs/examples/builtins_maps_and_more.md delete mode 100644 docs/examples/byte_for_demo.md delete mode 100644 docs/examples/byte_overflow_try_catch.md delete mode 100644 docs/examples/cast_demo.md delete mode 100644 docs/examples/class_constructor.md delete mode 100644 docs/examples/class_test.md delete mode 100644 docs/examples/class_without_object.md delete mode 100644 docs/examples/classes_demo.md delete mode 100644 docs/examples/cli_argv_dump.md delete mode 100644 docs/examples/conversions_showcase.md delete mode 100644 docs/examples/cpp_add.md delete mode 100644 docs/examples/data/htdocs/counter.md delete mode 100644 docs/examples/data/htdocs/form_post.md delete mode 100644 docs/examples/data/htdocs/hello.md delete mode 100644 docs/examples/data/htdocs/info.md delete mode 100644 docs/examples/data/htdocs/json_like_api.md delete mode 100644 docs/examples/data/htdocs/redirect.md delete mode 100644 docs/examples/datetime_basic.md delete mode 100644 docs/examples/datetime_extended.md delete mode 100644 docs/examples/datetime_timer.md delete mode 100644 docs/examples/echo_example.md delete mode 100644 docs/examples/env_all.md delete mode 100644 docs/examples/error_handling.md delete mode 100644 docs/examples/expressions_test.md delete mode 100644 docs/examples/features.md delete mode 100644 docs/examples/file_print_for_file_line_by_line.md delete mode 100644 docs/examples/floats.md delete mode 100644 docs/examples/for_range_test.md delete mode 100644 docs/examples/functions_test.md delete mode 100644 docs/examples/have_fun.md delete mode 100644 docs/examples/have_fun_function.md delete mode 100644 docs/examples/hex_example.md delete mode 100644 docs/examples/if_else_test.md delete mode 100644 docs/examples/include_lib.md delete mode 100644 docs/examples/include_local.md delete mode 100644 docs/examples/include_local_util.md delete mode 100644 docs/examples/inheritance_demo.md delete mode 100644 docs/examples/loops_break_continue.md delete mode 100644 docs/examples/maps.md delete mode 100644 docs/examples/match.md delete mode 100644 docs/examples/namespaced_mod.md delete mode 100644 docs/examples/nested_loops.md delete mode 100644 docs/examples/net/http_static_server.md delete mode 100644 docs/examples/objects_basic.md delete mode 100644 docs/examples/objects_more.md delete mode 100644 docs/examples/os_env.md delete mode 100644 docs/examples/process_example.md delete mode 100644 docs/examples/progress.md delete mode 100644 docs/examples/progress_inline.md delete mode 100644 docs/examples/random_demo.md delete mode 100644 docs/examples/random_number_example.md delete mode 100644 docs/examples/regex_demo.md delete mode 100644 docs/examples/regex_procedural.md delete mode 100644 docs/examples/rust_hello.md delete mode 100644 docs/examples/rust_hello_args.md delete mode 100644 docs/examples/rust_hello_args_return.md delete mode 100644 docs/examples/serial_demo.md delete mode 100644 docs/examples/short_circuit_test.md delete mode 100644 docs/examples/signed_ints.md delete mode 100644 docs/examples/stdlib_showcase.md delete mode 100644 docs/examples/strings_test.md delete mode 100644 docs/examples/tcp_http_get.md delete mode 100644 docs/examples/tcp_http_get_class.md delete mode 100644 docs/examples/test_bits.md delete mode 100644 docs/examples/test_dec_to_hex.md delete mode 100644 docs/examples/test_hex_to_dec.md delete mode 100644 docs/examples/test_include.md delete mode 100644 docs/examples/test_rol.md delete mode 100644 docs/examples/test_serial.md delete mode 100644 docs/examples/test_shl.md delete mode 100644 docs/examples/test_types.md delete mode 100644 docs/examples/test_xor.md delete mode 100644 docs/examples/thread_class_example.md delete mode 100644 docs/examples/threads_demo.md delete mode 100644 docs/examples/try_catch_finally.md delete mode 100644 docs/examples/type_safety.md delete mode 100644 docs/examples/type_safety_fails.md delete mode 100644 docs/examples/typeof.md delete mode 100644 docs/examples/typeof_features.md delete mode 100644 docs/examples/types_integers.md delete mode 100644 docs/examples/types_overview.md delete mode 100644 docs/examples/uint_types.md delete mode 100644 docs/examples/unix_socket_echo.md delete mode 100644 docs/examples/version.md delete mode 100644 docs/examples/while_test.md delete mode 100644 docs/external/README.md delete mode 100644 docs/faq.md delete mode 100644 docs/roadmap.md rename {docs => web/documentation}/arrays.md (90%) rename {docs => web/documentation}/asyncio.md (89%) rename {docs => web/documentation}/build.md (82%) rename {docs => web/documentation}/bytecode-format.md (65%) rename {docs => web/documentation}/cli.md (60%) rename {docs => web/documentation}/contributing.md (62%) rename {docs => web/documentation}/embedding.md (67%) rename {docs => web/documentation}/errors-and-diagnostics.md (62%) rename {docs => web/documentation}/examples.md (81%) rename {docs => web/documentation}/examples/README.md (50%) rename {docs => web/documentation}/examples/builtins_extended.md (52%) create mode 100644 web/documentation/examples/builtins_maps_and_more.md create mode 100644 web/documentation/examples/byte_for_demo.md create mode 100644 web/documentation/examples/byte_overflow_try_catch.md create mode 100644 web/documentation/examples/cast_demo.md create mode 100644 web/documentation/examples/class_constructor.md create mode 100644 web/documentation/examples/class_test.md create mode 100644 web/documentation/examples/class_without_object.md create mode 100644 web/documentation/examples/classes_demo.md create mode 100644 web/documentation/examples/cli_argv_dump.md create mode 100644 web/documentation/examples/conversions_showcase.md create mode 100644 web/documentation/examples/cpp_add.md create mode 100644 web/documentation/examples/data/htdocs/counter.md create mode 100644 web/documentation/examples/data/htdocs/form_post.md create mode 100644 web/documentation/examples/data/htdocs/hello.md create mode 100644 web/documentation/examples/data/htdocs/info.md create mode 100644 web/documentation/examples/data/htdocs/json_like_api.md create mode 100644 web/documentation/examples/data/htdocs/redirect.md create mode 100644 web/documentation/examples/datetime_basic.md create mode 100644 web/documentation/examples/datetime_extended.md create mode 100644 web/documentation/examples/datetime_timer.md create mode 100644 web/documentation/examples/echo_example.md create mode 100644 web/documentation/examples/env_all.md create mode 100644 web/documentation/examples/error_handling.md create mode 100644 web/documentation/examples/expressions_test.md create mode 100644 web/documentation/examples/features.md create mode 100644 web/documentation/examples/file_print_for_file_line_by_line.md create mode 100644 web/documentation/examples/floats.md create mode 100644 web/documentation/examples/for_range_test.md create mode 100644 web/documentation/examples/functions_test.md create mode 100644 web/documentation/examples/have_fun.md create mode 100644 web/documentation/examples/have_fun_function.md create mode 100644 web/documentation/examples/hex_example.md create mode 100644 web/documentation/examples/if_else_test.md create mode 100644 web/documentation/examples/include_lib.md create mode 100644 web/documentation/examples/include_local.md create mode 100644 web/documentation/examples/include_local_util.md create mode 100644 web/documentation/examples/inheritance_demo.md create mode 100644 web/documentation/examples/loops_break_continue.md create mode 100644 web/documentation/examples/maps.md create mode 100644 web/documentation/examples/match.md create mode 100644 web/documentation/examples/namespaced_mod.md create mode 100644 web/documentation/examples/nested_loops.md rename {docs => web/documentation}/examples/net/http_mt_server.md (53%) rename {docs => web/documentation}/examples/net/http_mt_server_cgi.md (59%) rename {docs => web/documentation}/examples/net/http_server.md (56%) rename {docs => web/documentation}/examples/net/http_server_cgi.md (58%) rename {docs => web/documentation}/examples/net/http_server_cgi_lib.md (58%) create mode 100644 web/documentation/examples/net/http_static_server.md rename {docs => web/documentation}/examples/net/httpserver.md (94%) create mode 100644 web/documentation/examples/objects_basic.md create mode 100644 web/documentation/examples/objects_more.md create mode 100644 web/documentation/examples/os_env.md create mode 100644 web/documentation/examples/process_example.md create mode 100644 web/documentation/examples/progress.md create mode 100644 web/documentation/examples/progress_inline.md create mode 100644 web/documentation/examples/random_demo.md create mode 100644 web/documentation/examples/random_number_example.md create mode 100644 web/documentation/examples/regex_demo.md create mode 100644 web/documentation/examples/regex_procedural.md create mode 100644 web/documentation/examples/rust_hello.md create mode 100644 web/documentation/examples/rust_hello_args.md create mode 100644 web/documentation/examples/rust_hello_args_return.md create mode 100644 web/documentation/examples/serial_demo.md create mode 100644 web/documentation/examples/short_circuit_test.md create mode 100644 web/documentation/examples/signed_ints.md create mode 100644 web/documentation/examples/stdlib_showcase.md create mode 100644 web/documentation/examples/strings_test.md create mode 100644 web/documentation/examples/tcp_http_get.md create mode 100644 web/documentation/examples/tcp_http_get_class.md create mode 100644 web/documentation/examples/test_bits.md create mode 100644 web/documentation/examples/test_dec_to_hex.md create mode 100644 web/documentation/examples/test_hex_to_dec.md create mode 100644 web/documentation/examples/test_include.md create mode 100644 web/documentation/examples/test_rol.md create mode 100644 web/documentation/examples/test_serial.md create mode 100644 web/documentation/examples/test_shl.md create mode 100644 web/documentation/examples/test_types.md create mode 100644 web/documentation/examples/test_xor.md create mode 100644 web/documentation/examples/thread_class_example.md create mode 100644 web/documentation/examples/threads_demo.md create mode 100644 web/documentation/examples/try_catch_finally.md create mode 100644 web/documentation/examples/type_safety.md create mode 100644 web/documentation/examples/type_safety_fails.md create mode 100644 web/documentation/examples/typeof.md create mode 100644 web/documentation/examples/typeof_features.md create mode 100644 web/documentation/examples/types_integers.md create mode 100644 web/documentation/examples/types_overview.md create mode 100644 web/documentation/examples/uint_types.md create mode 100644 web/documentation/examples/unix_socket_echo.md create mode 100644 web/documentation/examples/version.md create mode 100644 web/documentation/examples/while_test.md create mode 100644 web/documentation/external/README.md rename {docs => web/documentation}/external/curl.md (54%) rename {docs => web/documentation}/external/ini.md (65%) rename {docs => web/documentation}/external/json.md (56%) rename {docs => web/documentation}/external/openssl.md (83%) rename {docs => web/documentation}/external/pcre2.md (50%) rename {docs => web/documentation}/external/pcsc.md (59%) rename {docs => web/documentation}/external/sqlite.md (53%) rename {docs => web/documentation}/external/xml2.md (54%) create mode 100644 web/documentation/faq.md rename {docs => web/documentation}/fun.md (68%) rename {docs => web/documentation}/funstx.md (83%) rename {docs => web/documentation}/handbook.md (97%) rename {docs => web/documentation}/includes.md (89%) rename {docs => web/documentation}/internals.md (98%) rename {docs => web/documentation}/maps.md (90%) rename {docs => web/documentation}/numbers.md (85%) rename {docs => web/documentation}/opcodes.md (96%) rename {docs => web/documentation}/performance.md (66%) rename {docs => web/documentation}/repl.md (94%) create mode 100644 web/documentation/roadmap.md rename {docs => web/documentation}/rust.md (92%) rename {docs => web/documentation}/security-and-sandboxing.md (60%) rename {docs => web/documentation}/stdlib.md (78%) rename {docs => web/documentation}/strings.md (80%) rename {docs => web/documentation}/style-guide.md (81%) rename {docs => web/documentation}/testing.md (82%) rename {docs => web/documentation}/troubleshooting.md (84%) rename {docs => web/documentation}/types.md (80%) rename {docs => web/documentation}/website.md (85%) rename {docs => web/documentation}/writing-tests.md (62%) diff --git a/docs/README.md b/docs/README.md deleted file mode 100644 index 3260120..0000000 --- a/docs/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# Fun Documentation Index - -This file serves as an index of the documents in this directory. Links are relative and can be opened directly on Git hosting or locally. - -## Overview - -- [handbook.md](./handbook.md) - Comprehensive handbook for the Fun language and VM: install/build, configuration flags, usage, and full feature overview. -- [types.md](./types.md) - Core types (numbers, strings, arrays, maps, nil/bool), common operations, patterns, and interop notes. -- [numbers.md](./numbers.md) - Working with integers and floats: arithmetic, conversions, clamping, bitwise ops, and patterns. -- [strings.md](./strings.md) - Working with strings: literals/escaping, concatenation, substr/find, split, and conversions. -- [arrays.md](./arrays.md) - Working with arrays: creation, indexing/slicing, iteration patterns, helpers, and idioms. -- [maps.md](./maps.md) - Working with maps: construction, lookup/update, merging, iteration, and common patterns. -- [includes.md](./includes.md) - Using local vs. system includes, FUN_LIB_DIR, DEFAULT_LIB_DIR, and namespaced includes with `as`. -- [repl.md](./repl.md) - REPL guide: how to build/launch, editing and history, completions, REPL-on-error, and tips. -- [opcodes.md](./opcodes.md) - VM opcodes overview grouped by domain with brief behavior/stack notes. -- [internals.md](./internals.md) - Implementation details: bytecode format, VM architecture, stacks/frames, parser, and dispatch. -- [rust.md](./rust.md) - Writing Rust-backed opcodes and wiring them into the C VM; build/setup notes. -- [examples.md](./examples.md) - How to run the examples and the interactive showcase script, with environment tips. -- [testing.md](./testing.md) - How to build and run tests/targets with CMake/CTest, and where to add new tests. -- [troubleshooting.md](./troubleshooting.md) - Common issues and quick fixes for build, includes, and REPL usage. - -## New and supplemental guides - -- [build.md](./build.md) - How to build Fun with CMake, available targets, and build options (FUN_DEBUG, FUN_USE_MUSL, FUN_WITH_CPP, FUN_WITH_RUST, FUN_WITH_OPENSSL). -- [cli.md](./cli.md) - Command-line usage of the `fun` executable: synopsis, options, exit codes, includes and library paths. -- [fun.md](./fun.md) - Full usage guide for the `fun` executable: invocation patterns, REPL, env vars, include paths, examples, and install locations. -- [asyncio.md](./asyncio.md) - Async I/O primitives and patterns: non-blocking sockets, fd polling, examples, and best practices. -- [funstx.md](./funstx.md) - Syntax checker for .fun files with optional --fix auto-corrections; usage, exit codes, and limitations. -- [contributing.md](./contributing.md) - How to contribute: project structure, coding style, running tests, and PR guidelines. -- [style-guide.md](./style-guide.md) - Coding conventions for C and Fun (indentation, naming, idioms). -- [stdlib.md](./stdlib.md) - Overview of the standard library modules under ./lib with one-line summaries. -- [embedding.md](./embedding.md) - Embedding the VM from C/Rust, lifecycle, and host integration tips. -- [errors-and-diagnostics.md](./errors-and-diagnostics.md) - Understanding parser/runtime errors and enabling diagnostics. -- [performance.md](./performance.md) - Build/runtime tuning tips and patterns for better performance. -- [security-and-sandboxing.md](./security-and-sandboxing.md) - Trust boundaries, I/O expectations, and capability restrictions. -- [faq.md](./faq.md) - Frequently asked questions and quick answers. -- [website.md](./website.md) - Documentation for the [fun-lang.xyz](https://fun-lang.xyz) website in the `./web/` directory. -- [writing-tests.md](./writing-tests.md) - How to author new tests for Fun and opcode components. -- [bytecode-format.md](./bytecode-format.md) - Reference for the bytecode format (split out from internals for convenience). -- [roadmap.md](./roadmap.md) - High-level direction, planned features, and pointers to issues. - -## Examples - - - [examples/README.md](./examples/README.md) - Catalog of all example scripts under ./examples/: what each area contains, how to run them, required env vars, and extension requirements. - -## External extensions - -Documentation for optional, build-time selectable integrations lives in [external/](./external/): - -- [Index of extensions](./external/README.md) - - Highlights: [cURL](./external/curl.md), [INI](./external/ini.md), [JSON](./external/json.md), [XML (libxml2)](./external/xml2.md), [SQLite](./external/sqlite.md), [PCRE2](./external/pcre2.md), [PC/SC](./external/pcsc.md), [OpenSSL](./external/openssl.md) - -## Tips - -- When building from the repo without installing, set `FUN_LIB_DIR` to the local `./lib` directory so examples and the REPL can locate the stdlib. -- For a broader project overview and quickstart, see the repository root [README.md](../README.md). -- Crypto examples: - - If built with `-DFUN_WITH_OPENSSL=ON`, try `examples/crypto/openssl_md5.fun`. diff --git a/docs/examples/builtins_maps_and_more.md b/docs/examples/builtins_maps_and_more.md deleted file mode 100644 index 4e6db77..0000000 --- a/docs/examples/builtins_maps_and_more.md +++ /dev/null @@ -1,12 +0,0 @@ -# builtins_maps_and_more.fun — overview - -What it shows -- Exploring built‑ins while working with maps and related data structures. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/builtins_maps_and_more.fun -- Or: fun examples/builtins_maps_and_more.fun - -Notes -- Open the .fun file to see the exact behaviors and printed output. diff --git a/docs/examples/byte_for_demo.md b/docs/examples/byte_for_demo.md deleted file mode 100644 index 7233fb7..0000000 --- a/docs/examples/byte_for_demo.md +++ /dev/null @@ -1,9 +0,0 @@ -# byte_for_demo.fun — overview - -What it shows -- Iterating bytes with a for-loop; indexing and printing byte values. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/byte_for_demo.fun -- Or: fun examples/byte_for_demo.fun diff --git a/docs/examples/byte_overflow_try_catch.md b/docs/examples/byte_overflow_try_catch.md deleted file mode 100644 index 90dbe56..0000000 --- a/docs/examples/byte_overflow_try_catch.md +++ /dev/null @@ -1,9 +0,0 @@ -# byte_overflow_try_catch.fun — overview - -What it shows -- Error handling around byte/integer overflow using try/catch. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/byte_overflow_try_catch.fun -- Or: fun examples/byte_overflow_try_catch.fun diff --git a/docs/examples/cast_demo.md b/docs/examples/cast_demo.md deleted file mode 100644 index 70b14da..0000000 --- a/docs/examples/cast_demo.md +++ /dev/null @@ -1,9 +0,0 @@ -# cast_demo.fun — overview - -What it shows -- Conversions and casting helpers; demonstrates changing between numeric and string types safely. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/cast_demo.fun -- Or: fun examples/cast_demo.fun diff --git a/docs/examples/class_constructor.md b/docs/examples/class_constructor.md deleted file mode 100644 index 853e96b..0000000 --- a/docs/examples/class_constructor.md +++ /dev/null @@ -1,9 +0,0 @@ -# class_constructor.fun — overview - -What it shows -- Class basics and constructor behavior; initializing fields and using methods. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/class_constructor.fun -- Or: fun examples/class_constructor.fun diff --git a/docs/examples/class_test.md b/docs/examples/class_test.md deleted file mode 100644 index 81e982f..0000000 --- a/docs/examples/class_test.md +++ /dev/null @@ -1,12 +0,0 @@ -# class_test.fun — overview - -What it shows -- Simple class usage and method invocation; small sanity checks around classes. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/class_test.fun -- Or: fun examples/class_test.fun - -Notes -- Open the script to see the exact behavior and outputs. diff --git a/docs/examples/class_without_object.md b/docs/examples/class_without_object.md deleted file mode 100644 index 67dada0..0000000 --- a/docs/examples/class_without_object.md +++ /dev/null @@ -1,9 +0,0 @@ -# class_without_object.fun — overview - -What it shows -- Class features that can be used without creating an instance (static-like usage patterns). - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/class_without_object.fun -- Or: fun examples/class_without_object.fun diff --git a/docs/examples/classes_demo.md b/docs/examples/classes_demo.md deleted file mode 100644 index f842d1b..0000000 --- a/docs/examples/classes_demo.md +++ /dev/null @@ -1,9 +0,0 @@ -# classes_demo.fun — overview - -What it shows -- Class basics and usage: defining classes, instantiating objects, calling methods. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/classes_demo.fun -- Or: fun examples/classes_demo.fun diff --git a/docs/examples/cli_argv_dump.md b/docs/examples/cli_argv_dump.md deleted file mode 100644 index 050b8b0..0000000 --- a/docs/examples/cli_argv_dump.md +++ /dev/null @@ -1,9 +0,0 @@ -# cli_argv_dump.fun — overview - -What it shows -- Prints argv/argc handling to demonstrate CLI arguments parsing at a low level. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/cli_argv_dump.fun --foo bar 123 -- Or: fun examples/cli_argv_dump.fun --foo bar 123 diff --git a/docs/examples/conversions_showcase.md b/docs/examples/conversions_showcase.md deleted file mode 100644 index cde204b..0000000 --- a/docs/examples/conversions_showcase.md +++ /dev/null @@ -1,9 +0,0 @@ -# conversions_showcase.fun — overview - -What it shows -- Numbers, strings, and bytes conversions; typical idioms and edge cases. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/conversions_showcase.fun -- Or: fun examples/conversions_showcase.fun diff --git a/docs/examples/cpp_add.md b/docs/examples/cpp_add.md deleted file mode 100644 index b311335..0000000 --- a/docs/examples/cpp_add.md +++ /dev/null @@ -1,12 +0,0 @@ -# cpp_add.fun — overview - -What it shows -- Calling into the optional C++ extension from Fun. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/cpp_add.fun -- Or: fun examples/cpp_add.fun - -Notes -- Requires the optional C++ extension to be enabled in your build; otherwise this example may be unavailable. diff --git a/docs/examples/data/htdocs/counter.md b/docs/examples/data/htdocs/counter.md deleted file mode 100644 index 48b6952..0000000 --- a/docs/examples/data/htdocs/counter.md +++ /dev/null @@ -1,17 +0,0 @@ -# counter.fun (CGI) - -- Location: examples/data/htdocs/counter.fun -- Category: CGI script used by HTTP server examples - -Description -- Simple stateful counter example for CGI; demonstrates reading and updating a value across requests (implementation details in script). - -How to run -- Through one of the HTTP server examples, e.g.: - - export FUN_LIB_DIR="./lib" - - export FUN_EXEC="./build_debug/fun" - - ./build_debug/fun examples/net/http_server_cgi.fun - - Open: http://127.0.0.1:8080/counter.fun - -See also -- docs/examples/httpserver.md (deep-dive) diff --git a/docs/examples/data/htdocs/form_post.md b/docs/examples/data/htdocs/form_post.md deleted file mode 100644 index d0fb86f..0000000 --- a/docs/examples/data/htdocs/form_post.md +++ /dev/null @@ -1,17 +0,0 @@ -# form_post.fun (CGI) - -- Location: examples/data/htdocs/form_post.fun -- Category: CGI script used by HTTP server examples - -Description -- Demonstrates handling of POST form data via the CGI interface. - -How to run -- Through one of the HTTP server examples, e.g.: - - export FUN_LIB_DIR="./lib" - - export FUN_EXEC="./build_debug/fun" - - ./build_debug/fun examples/net/http_server_cgi.fun - - Submit a form to: http://127.0.0.1:8080/form_post.fun - -See also -- docs/examples/httpserver.md (deep-dive) diff --git a/docs/examples/data/htdocs/hello.md b/docs/examples/data/htdocs/hello.md deleted file mode 100644 index 3192ff6..0000000 --- a/docs/examples/data/htdocs/hello.md +++ /dev/null @@ -1,17 +0,0 @@ -# hello.fun (CGI) - -- Location: examples/data/htdocs/hello.fun -- Category: CGI script used by HTTP server examples - -Description -- Simple CGI .fun script that prints a greeting, optionally using query parameters (e.g., ?name=Fun). - -How to run -- Through one of the HTTP server examples, e.g.: - - export FUN_LIB_DIR="./lib" - - export FUN_EXEC="./build_debug/fun" - - ./build_debug/fun examples/net/http_server_cgi.fun - - Open: http://127.0.0.1:8080/hello.fun?name=Fun - -See also -- docs/examples/httpserver.md (deep-dive) diff --git a/docs/examples/data/htdocs/info.md b/docs/examples/data/htdocs/info.md deleted file mode 100644 index ee441a9..0000000 --- a/docs/examples/data/htdocs/info.md +++ /dev/null @@ -1,17 +0,0 @@ -# info.fun (CGI) - -- Location: examples/data/htdocs/info.fun -- Category: CGI script used by HTTP server examples - -Description -- CGI script that prints request/environment information, useful for debugging CGI variables. - -How to run -- Through one of the HTTP server examples, e.g.: - - export FUN_LIB_DIR="./lib" - - export FUN_EXEC="./build_debug/fun" - - ./build_debug/fun examples/net/http_server_cgi.fun - - Open: http://127.0.0.1:8080/info.fun - -See also -- docs/examples/httpserver.md (deep-dive) diff --git a/docs/examples/data/htdocs/json_like_api.md b/docs/examples/data/htdocs/json_like_api.md deleted file mode 100644 index 509dbf2..0000000 --- a/docs/examples/data/htdocs/json_like_api.md +++ /dev/null @@ -1,17 +0,0 @@ -# json_like_api.fun (CGI) - -- Location: examples/data/htdocs/json_like_api.fun -- Category: CGI script used by HTTP server examples - -Description -- Demonstrates returning JSON-like output from a CGI endpoint. - -How to run -- Through one of the HTTP server examples, e.g.: - - export FUN_LIB_DIR="./lib" - - export FUN_EXEC="./build_debug/fun" - - ./build_debug/fun examples/net/http_server_cgi.fun - - Open: http://127.0.0.1:8080/json_like_api.fun - -See also -- docs/examples/httpserver.md (deep-dive) diff --git a/docs/examples/data/htdocs/redirect.md b/docs/examples/data/htdocs/redirect.md deleted file mode 100644 index c968268..0000000 --- a/docs/examples/data/htdocs/redirect.md +++ /dev/null @@ -1,17 +0,0 @@ -# redirect.fun (CGI) - -- Location: examples/data/htdocs/redirect.fun -- Category: CGI script used by HTTP server examples - -Description -- Demonstrates issuing HTTP redirects from a CGI script (setting Status and Location headers). - -How to run -- Through one of the HTTP server examples, e.g.: - - export FUN_LIB_DIR="./lib" - - export FUN_EXEC="./build_debug/fun" - - ./build_debug/fun examples/net/http_server_cgi.fun - - Open: http://127.0.0.1:8080/redirect.fun - -See also -- docs/examples/httpserver.md (deep-dive) diff --git a/docs/examples/datetime_basic.md b/docs/examples/datetime_basic.md deleted file mode 100644 index bb79b11..0000000 --- a/docs/examples/datetime_basic.md +++ /dev/null @@ -1,9 +0,0 @@ -# datetime_basic.fun — overview - -What it shows -- Basic time/date helpers and formatting. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/datetime_basic.fun -- Or: fun examples/datetime_basic.fun diff --git a/docs/examples/datetime_extended.md b/docs/examples/datetime_extended.md deleted file mode 100644 index 3400db7..0000000 --- a/docs/examples/datetime_extended.md +++ /dev/null @@ -1,9 +0,0 @@ -# datetime_extended.fun — overview - -What it shows -- Extended datetime helpers: parsing, arithmetic, timers, and formatting variants. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/datetime_extended.fun -- Or: fun examples/datetime_extended.fun diff --git a/docs/examples/datetime_timer.md b/docs/examples/datetime_timer.md deleted file mode 100644 index efd4648..0000000 --- a/docs/examples/datetime_timer.md +++ /dev/null @@ -1,9 +0,0 @@ -# datetime_timer.fun — overview - -What it shows -- Measuring elapsed time and simple timers using datetime helpers. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/datetime_timer.fun -- Or: fun examples/datetime_timer.fun diff --git a/docs/examples/echo_example.md b/docs/examples/echo_example.md deleted file mode 100644 index 7d5350f..0000000 --- a/docs/examples/echo_example.md +++ /dev/null @@ -1,9 +0,0 @@ -# echo_example.fun — overview - -What it shows -- Simple echo of input/args; prints back what you type or pass as arguments. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/echo_example.fun hello world -- Or: fun examples/echo_example.fun hello world diff --git a/docs/examples/env_all.md b/docs/examples/env_all.md deleted file mode 100644 index dbd485e..0000000 --- a/docs/examples/env_all.md +++ /dev/null @@ -1,9 +0,0 @@ -# env_all.fun — overview - -What it shows -- Reading and listing environment variables. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/env_all.fun -- Or: fun examples/env_all.fun diff --git a/docs/examples/error_handling.md b/docs/examples/error_handling.md deleted file mode 100644 index 34d0e9e..0000000 --- a/docs/examples/error_handling.md +++ /dev/null @@ -1,9 +0,0 @@ -# error_handling.fun — overview - -What it shows -- Error patterns and handling strategies using try/catch/finally. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/error_handling.fun -- Or: fun examples/error_handling.fun diff --git a/docs/examples/expressions_test.md b/docs/examples/expressions_test.md deleted file mode 100644 index efd9adf..0000000 --- a/docs/examples/expressions_test.md +++ /dev/null @@ -1,9 +0,0 @@ -# expressions_test.fun — overview - -What it shows -- Operator precedence and expression grouping tests/demonstrations. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/expressions_test.fun -- Or: fun examples/expressions_test.fun diff --git a/docs/examples/features.md b/docs/examples/features.md deleted file mode 100644 index 000675b..0000000 --- a/docs/examples/features.md +++ /dev/null @@ -1,9 +0,0 @@ -# features.fun — overview - -What it shows -- Grab bag of language features in a single script. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/features.fun -- Or: fun examples/features.fun diff --git a/docs/examples/file_print_for_file_line_by_line.md b/docs/examples/file_print_for_file_line_by_line.md deleted file mode 100644 index 9b4a97a..0000000 --- a/docs/examples/file_print_for_file_line_by_line.md +++ /dev/null @@ -1,9 +0,0 @@ -# file_print_for_file_line_by_line.fun — overview - -What it shows -- Iterate a file line-by-line and print each line; basic file IO idioms. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/file_print_for_file_line_by_line.fun path/to/file.txt -- Or: fun examples/file_print_for_file_line_by_line.fun path/to/file.txt diff --git a/docs/examples/floats.md b/docs/examples/floats.md deleted file mode 100644 index 1aed894..0000000 --- a/docs/examples/floats.md +++ /dev/null @@ -1,9 +0,0 @@ -# floats.fun — overview - -What it shows -- Floating point operations and formatting details. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/floats.fun -- Or: fun examples/floats.fun diff --git a/docs/examples/for_range_test.md b/docs/examples/for_range_test.md deleted file mode 100644 index 1104bdb..0000000 --- a/docs/examples/for_range_test.md +++ /dev/null @@ -1,9 +0,0 @@ -# for_range_test.fun — overview - -What it shows -- Ranges and loops; iterating numeric ranges and verifying bounds. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/for_range_test.fun -- Or: fun examples/for_range_test.fun diff --git a/docs/examples/functions_test.md b/docs/examples/functions_test.md deleted file mode 100644 index 9726f8c..0000000 --- a/docs/examples/functions_test.md +++ /dev/null @@ -1,9 +0,0 @@ -# functions_test.fun — overview - -What it shows -- Functions, closures, and return behavior; call semantics basics. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/functions_test.fun -- Or: fun examples/functions_test.fun diff --git a/docs/examples/have_fun.md b/docs/examples/have_fun.md deleted file mode 100644 index 8335224..0000000 --- a/docs/examples/have_fun.md +++ /dev/null @@ -1,9 +0,0 @@ -# have_fun.fun — overview - -What it shows -- Playful demo showing off small language tricks. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/have_fun.fun -- Or: fun examples/have_fun.fun diff --git a/docs/examples/have_fun_function.md b/docs/examples/have_fun_function.md deleted file mode 100644 index 404e2d4..0000000 --- a/docs/examples/have_fun_function.md +++ /dev/null @@ -1,9 +0,0 @@ -# have_fun_function.fun — overview - -What it shows -- A playful function-centric demo; small utility behaviors. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/have_fun_function.fun -- Or: fun examples/have_fun_function.fun diff --git a/docs/examples/hex_example.md b/docs/examples/hex_example.md deleted file mode 100644 index 2abc1c3..0000000 --- a/docs/examples/hex_example.md +++ /dev/null @@ -1,9 +0,0 @@ -# hex_example.fun — overview - -What it shows -- Hex encode/decode helpers; working with hexadecimal representations. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/hex_example.fun -- Or: fun examples/hex_example.fun diff --git a/docs/examples/if_else_test.md b/docs/examples/if_else_test.md deleted file mode 100644 index acd3d17..0000000 --- a/docs/examples/if_else_test.md +++ /dev/null @@ -1,9 +0,0 @@ -# if_else_test.fun — overview - -What it shows -- Control flow with if/else; branching and comparisons. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/if_else_test.fun -- Or: fun examples/if_else_test.fun diff --git a/docs/examples/include_lib.md b/docs/examples/include_lib.md deleted file mode 100644 index 6e76b9d..0000000 --- a/docs/examples/include_lib.md +++ /dev/null @@ -1,9 +0,0 @@ -# include_lib.fun — overview - -What it shows -- Including modules from the standard library path using #include <...>. - -How to run -- export FUN_LIB_DIR="./lib" # ensure stdlib is discoverable -- ./build_debug/fun examples/include_lib.fun -- Or: fun examples/include_lib.fun diff --git a/docs/examples/include_local.md b/docs/examples/include_local.md deleted file mode 100644 index bc79792..0000000 --- a/docs/examples/include_local.md +++ /dev/null @@ -1,9 +0,0 @@ -# include_local.fun — overview - -What it shows -- Including local files relative to the script and reusing helpers. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/include_local.fun -- Or: fun examples/include_local.fun diff --git a/docs/examples/include_local_util.md b/docs/examples/include_local_util.md deleted file mode 100644 index 1cc2571..0000000 --- a/docs/examples/include_local_util.md +++ /dev/null @@ -1,9 +0,0 @@ -# include_local_util.fun — overview - -What it shows -- Local include mechanics with a small utility module. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/include_local_util.fun -- Or: fun examples/include_local_util.fun diff --git a/docs/examples/inheritance_demo.md b/docs/examples/inheritance_demo.md deleted file mode 100644 index 15b1921..0000000 --- a/docs/examples/inheritance_demo.md +++ /dev/null @@ -1,9 +0,0 @@ -# inheritance_demo.fun — overview - -What it shows -- Simple class inheritance and method overriding examples. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/inheritance_demo.fun -- Or: fun examples/inheritance_demo.fun diff --git a/docs/examples/loops_break_continue.md b/docs/examples/loops_break_continue.md deleted file mode 100644 index 310ffa9..0000000 --- a/docs/examples/loops_break_continue.md +++ /dev/null @@ -1,9 +0,0 @@ -# loops_break_continue.fun — overview - -What it shows -- Loop control: break and continue; demonstrating control flow within loops. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/loops_break_continue.fun -- Or: fun examples/loops_break_continue.fun diff --git a/docs/examples/maps.md b/docs/examples/maps.md deleted file mode 100644 index e5ab7f0..0000000 --- a/docs/examples/maps.md +++ /dev/null @@ -1,9 +0,0 @@ -# maps.fun — overview - -What it shows -- Working with maps: creation, indexing, iteration, and typical idioms. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/maps.fun -- Or: fun examples/maps.fun diff --git a/docs/examples/match.md b/docs/examples/match.md deleted file mode 100644 index e081070..0000000 --- a/docs/examples/match.md +++ /dev/null @@ -1,9 +0,0 @@ -# match.fun — overview - -What it shows -- Pattern matching constructs and examples of branching by value/shape. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/match.fun -- Or: fun examples/match.fun diff --git a/docs/examples/namespaced_mod.md b/docs/examples/namespaced_mod.md deleted file mode 100644 index b9ae6d9..0000000 --- a/docs/examples/namespaced_mod.md +++ /dev/null @@ -1,9 +0,0 @@ -# namespaced_mod.fun — overview - -What it shows -- Namespaced includes and using the "as" aliasing pattern for modules. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/namespaced_mod.fun -- Or: fun examples/namespaced_mod.fun diff --git a/docs/examples/nested_loops.md b/docs/examples/nested_loops.md deleted file mode 100644 index 6ee08bf..0000000 --- a/docs/examples/nested_loops.md +++ /dev/null @@ -1,9 +0,0 @@ -# nested_loops.fun — overview - -What it shows -- Control flow with nested loops; inner/outer loop coordination. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/nested_loops.fun -- Or: fun examples/nested_loops.fun diff --git a/docs/examples/net/http_static_server.md b/docs/examples/net/http_static_server.md deleted file mode 100644 index 16dbf82..0000000 --- a/docs/examples/net/http_static_server.md +++ /dev/null @@ -1,20 +0,0 @@ -# http_static_server.fun - -- Location: examples/net/http_static_server.fun -- Category: Networking / Sockets - -Description -- Minimal static HTTP server implemented directly on sockets. Accepts connections and always returns a small HTML page. - -How to run -- From the repository root: - - export FUN_LIB_DIR="./lib" - - ./build_debug/fun examples/net/http_static_server.fun - - Then open http://127.0.0.1:8088/ - -Requirements -- Uses core IO/socket stdlib (io/socket.fun). No optional extensions required. - -See also -- docs/examples/README.md -- docs/examples/httpserver.md (deep-dive over HTTP servers) diff --git a/docs/examples/objects_basic.md b/docs/examples/objects_basic.md deleted file mode 100644 index cb951ed..0000000 --- a/docs/examples/objects_basic.md +++ /dev/null @@ -1,9 +0,0 @@ -# objects_basic.fun — overview - -What it shows -- OO basics: defining objects, fields, and invoking methods. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/objects_basic.fun -- Or: fun examples/objects_basic.fun diff --git a/docs/examples/objects_more.md b/docs/examples/objects_more.md deleted file mode 100644 index f43512a..0000000 --- a/docs/examples/objects_more.md +++ /dev/null @@ -1,9 +0,0 @@ -# objects_more.fun — overview - -What it shows -- Additional object patterns: composition, methods, and utilities. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/objects_more.fun -- Or: fun examples/objects_more.fun diff --git a/docs/examples/os_env.md b/docs/examples/os_env.md deleted file mode 100644 index 7a2a67b..0000000 --- a/docs/examples/os_env.md +++ /dev/null @@ -1,9 +0,0 @@ -# os_env.fun — overview - -What it shows -- Reading and writing environment variables from the operating system. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/os_env.fun -- Or: fun examples/os_env.fun diff --git a/docs/examples/process_example.md b/docs/examples/process_example.md deleted file mode 100644 index e468a04..0000000 --- a/docs/examples/process_example.md +++ /dev/null @@ -1,9 +0,0 @@ -# process_example.fun — overview - -What it shows -- Spawning and capturing subprocess output; simple process management. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/process_example.fun -- Or: fun examples/process_example.fun diff --git a/docs/examples/progress.md b/docs/examples/progress.md deleted file mode 100644 index 12bc907..0000000 --- a/docs/examples/progress.md +++ /dev/null @@ -1,9 +0,0 @@ -# progress.fun — overview - -What it shows -- Simple progress display in the terminal. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/progress.fun -- Or: fun examples/progress.fun diff --git a/docs/examples/progress_inline.md b/docs/examples/progress_inline.md deleted file mode 100644 index 0168b57..0000000 --- a/docs/examples/progress_inline.md +++ /dev/null @@ -1,9 +0,0 @@ -# progress_inline.fun — overview - -What it shows -- Inline progress updates (same line updates) for simple terminal UIs. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/progress_inline.fun -- Or: fun examples/progress_inline.fun diff --git a/docs/examples/random_demo.md b/docs/examples/random_demo.md deleted file mode 100644 index 5867b4c..0000000 --- a/docs/examples/random_demo.md +++ /dev/null @@ -1,9 +0,0 @@ -# random_demo.fun — overview - -What it shows -- Random number generator usage and seeding basics. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/random_demo.fun -- Or: fun examples/random_demo.fun diff --git a/docs/examples/random_number_example.md b/docs/examples/random_number_example.md deleted file mode 100644 index 6bf7cbf..0000000 --- a/docs/examples/random_number_example.md +++ /dev/null @@ -1,9 +0,0 @@ -# random_number_example.fun — overview - -What it shows -- Generating random numbers and printing them; small utility demo. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/random_number_example.fun -- Or: fun examples/random_number_example.fun diff --git a/docs/examples/regex_demo.md b/docs/examples/regex_demo.md deleted file mode 100644 index 4df2726..0000000 --- a/docs/examples/regex_demo.md +++ /dev/null @@ -1,12 +0,0 @@ -# regex_demo.fun — overview - -What it shows -- Regex helpers usage; simple matching and replacement tasks. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/regex_demo.fun -- Or: fun examples/regex_demo.fun - -Notes -- Some regex examples depend on the optional PCRE2 extension; enable it in your build to run. diff --git a/docs/examples/regex_procedural.md b/docs/examples/regex_procedural.md deleted file mode 100644 index fa258de..0000000 --- a/docs/examples/regex_procedural.md +++ /dev/null @@ -1,12 +0,0 @@ -# regex_procedural.fun — overview - -What it shows -- Procedural approach to regex work: compiling patterns and iterating matches. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/regex_procedural.fun -- Or: fun examples/regex_procedural.fun - -Notes -- May require the optional PCRE2 extension in your build. diff --git a/docs/examples/rust_hello.md b/docs/examples/rust_hello.md deleted file mode 100644 index aa39c35..0000000 --- a/docs/examples/rust_hello.md +++ /dev/null @@ -1,12 +0,0 @@ -# rust_hello.fun — overview - -What it shows -- Using Rust opcodes from Fun (when built with Rust support). - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/rust_hello.fun -- Or: fun examples/rust_hello.fun - -Notes -- Requires building with FUN_WITH_RUST; otherwise this example will be unavailable. diff --git a/docs/examples/rust_hello_args.md b/docs/examples/rust_hello_args.md deleted file mode 100644 index 4fc7799..0000000 --- a/docs/examples/rust_hello_args.md +++ /dev/null @@ -1,12 +0,0 @@ -# rust_hello_args.fun — overview - -What it shows -- Passing arguments into Rust-backed opcodes and handling returns. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/rust_hello_args.fun -- Or: fun examples/rust_hello_args.fun - -Notes -- Requires building with FUN_WITH_RUST. diff --git a/docs/examples/rust_hello_args_return.md b/docs/examples/rust_hello_args_return.md deleted file mode 100644 index 6bac4ac..0000000 --- a/docs/examples/rust_hello_args_return.md +++ /dev/null @@ -1,12 +0,0 @@ -# rust_hello_args_return.fun — overview - -What it shows -- Demonstrates returning values from Rust-backed opcodes with arguments. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/rust_hello_args_return.fun -- Or: fun examples/rust_hello_args_return.fun - -Notes -- Requires building with FUN_WITH_RUST. diff --git a/docs/examples/serial_demo.md b/docs/examples/serial_demo.md deleted file mode 100644 index 75549dc..0000000 --- a/docs/examples/serial_demo.md +++ /dev/null @@ -1,12 +0,0 @@ -# serial_demo.fun — overview - -What it shows -- Serial port access and basic read/write (when available on your system). - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/serial_demo.fun -- Or: fun examples/serial_demo.fun - -Notes -- Requires serial device access; may depend on platform support and permissions. diff --git a/docs/examples/short_circuit_test.md b/docs/examples/short_circuit_test.md deleted file mode 100644 index 4da62d4..0000000 --- a/docs/examples/short_circuit_test.md +++ /dev/null @@ -1,9 +0,0 @@ -# short_circuit_test.fun — overview - -What it shows -- Boolean evaluation order and short-circuit behavior with && and ||. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/short_circuit_test.fun -- Or: fun examples/short_circuit_test.fun diff --git a/docs/examples/signed_ints.md b/docs/examples/signed_ints.md deleted file mode 100644 index db232eb..0000000 --- a/docs/examples/signed_ints.md +++ /dev/null @@ -1,9 +0,0 @@ -# signed_ints.fun — overview - -What it shows -- Signed integer types and operations; ranges and conversions. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/signed_ints.fun -- Or: fun examples/signed_ints.fun diff --git a/docs/examples/stdlib_showcase.md b/docs/examples/stdlib_showcase.md deleted file mode 100644 index c703052..0000000 --- a/docs/examples/stdlib_showcase.md +++ /dev/null @@ -1,9 +0,0 @@ -# stdlib_showcase.fun — overview - -What it shows -- Sampler of common standard library modules and utilities. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/stdlib_showcase.fun -- Or: fun examples/stdlib_showcase.fun diff --git a/docs/examples/strings_test.md b/docs/examples/strings_test.md deleted file mode 100644 index 5614af4..0000000 --- a/docs/examples/strings_test.md +++ /dev/null @@ -1,9 +0,0 @@ -# strings_test.fun — overview - -What it shows -- String helpers and edge cases; splitting, joining, trimming, and formatting. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/strings_test.fun -- Or: fun examples/strings_test.fun diff --git a/docs/examples/tcp_http_get.md b/docs/examples/tcp_http_get.md deleted file mode 100644 index ed26fbb..0000000 --- a/docs/examples/tcp_http_get.md +++ /dev/null @@ -1,12 +0,0 @@ -# tcp_http_get.fun — overview - -What it shows -- Manual HTTP client over raw TCP sockets: connect, write request, read response. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/tcp_http_get.fun -- Or: fun examples/tcp_http_get.fun - -Notes -- Requires network access to the target host used in the script. diff --git a/docs/examples/tcp_http_get_class.md b/docs/examples/tcp_http_get_class.md deleted file mode 100644 index 8a8624c..0000000 --- a/docs/examples/tcp_http_get_class.md +++ /dev/null @@ -1,12 +0,0 @@ -# tcp_http_get_class.fun — overview - -What it shows -- Manual HTTP client implemented with a small helper class over sockets. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/tcp_http_get_class.fun -- Or: fun examples/tcp_http_get_class.fun - -Notes -- Requires network access to the target host used in the script. diff --git a/docs/examples/test_bits.md b/docs/examples/test_bits.md deleted file mode 100644 index 32e98b7..0000000 --- a/docs/examples/test_bits.md +++ /dev/null @@ -1,9 +0,0 @@ -# test_bits.fun — overview - -What it shows -- Bitwise utilities demonstration (and/or/xor/shifts) and small tests. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/test_bits.fun -- Or: fun examples/test_bits.fun diff --git a/docs/examples/test_dec_to_hex.md b/docs/examples/test_dec_to_hex.md deleted file mode 100644 index 6596ddd..0000000 --- a/docs/examples/test_dec_to_hex.md +++ /dev/null @@ -1,9 +0,0 @@ -# test_dec_to_hex.fun — overview - -What it shows -- Decimal to hexadecimal conversion helper/tests. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/test_dec_to_hex.fun -- Or: fun examples/test_dec_to_hex.fun diff --git a/docs/examples/test_hex_to_dec.md b/docs/examples/test_hex_to_dec.md deleted file mode 100644 index d6c9a6f..0000000 --- a/docs/examples/test_hex_to_dec.md +++ /dev/null @@ -1,9 +0,0 @@ -# test_hex_to_dec.fun — overview - -What it shows -- Hexadecimal to decimal conversion helper/tests. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/test_hex_to_dec.fun -- Or: fun examples/test_hex_to_dec.fun diff --git a/docs/examples/test_include.md b/docs/examples/test_include.md deleted file mode 100644 index ae1d21a..0000000 --- a/docs/examples/test_include.md +++ /dev/null @@ -1,9 +0,0 @@ -# test_include.fun — overview - -What it shows -- Small include mechanics test; ensures local and stdlib includes work. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/test_include.fun -- Or: fun examples/test_include.fun diff --git a/docs/examples/test_rol.md b/docs/examples/test_rol.md deleted file mode 100644 index 82417cd..0000000 --- a/docs/examples/test_rol.md +++ /dev/null @@ -1,9 +0,0 @@ -# test_rol.fun — overview - -What it shows -- Bit rotation (ROL) helper/tests. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/test_rol.fun -- Or: fun examples/test_rol.fun diff --git a/docs/examples/test_serial.md b/docs/examples/test_serial.md deleted file mode 100644 index 774919d..0000000 --- a/docs/examples/test_serial.md +++ /dev/null @@ -1,12 +0,0 @@ -# test_serial.fun — overview - -What it shows -- Serial port test; opens a port and exchanges a few bytes (when available). - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/test_serial.fun -- Or: fun examples/test_serial.fun - -Notes -- Requires serial device access; may depend on platform support and permissions. diff --git a/docs/examples/test_shl.md b/docs/examples/test_shl.md deleted file mode 100644 index fd5669e..0000000 --- a/docs/examples/test_shl.md +++ /dev/null @@ -1,9 +0,0 @@ -# test_shl.fun — overview - -What it shows -- Bit shift left (SHL) helper/tests. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/test_shl.fun -- Or: fun examples/test_shl.fun diff --git a/docs/examples/test_types.md b/docs/examples/test_types.md deleted file mode 100644 index a98ffe0..0000000 --- a/docs/examples/test_types.md +++ /dev/null @@ -1,9 +0,0 @@ -# test_types.fun — overview - -What it shows -- Type checks and simple assertions around type behavior. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/test_types.fun -- Or: fun examples/test_types.fun diff --git a/docs/examples/test_xor.md b/docs/examples/test_xor.md deleted file mode 100644 index 4aaa45a..0000000 --- a/docs/examples/test_xor.md +++ /dev/null @@ -1,9 +0,0 @@ -# test_xor.fun — overview - -What it shows -- Bitwise XOR helper/tests. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/test_xor.fun -- Or: fun examples/test_xor.fun diff --git a/docs/examples/thread_class_example.md b/docs/examples/thread_class_example.md deleted file mode 100644 index f14bd18..0000000 --- a/docs/examples/thread_class_example.md +++ /dev/null @@ -1,9 +0,0 @@ -# thread_class_example.fun — overview - -What it shows -- Threading building blocks using a small thread class; start/join patterns. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/thread_class_example.fun -- Or: fun examples/thread_class_example.fun diff --git a/docs/examples/threads_demo.md b/docs/examples/threads_demo.md deleted file mode 100644 index 5526297..0000000 --- a/docs/examples/threads_demo.md +++ /dev/null @@ -1,9 +0,0 @@ -# threads_demo.fun — overview - -What it shows -- Threading building blocks and concurrent execution demo. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/threads_demo.fun -- Or: fun examples/threads_demo.fun diff --git a/docs/examples/try_catch_finally.md b/docs/examples/try_catch_finally.md deleted file mode 100644 index 4cb761c..0000000 --- a/docs/examples/try_catch_finally.md +++ /dev/null @@ -1,9 +0,0 @@ -# try_catch_finally.fun — overview - -What it shows -- Structured error handling with try/catch/finally blocks. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/try_catch_finally.fun -- Or: fun examples/try_catch_finally.fun diff --git a/docs/examples/type_safety.md b/docs/examples/type_safety.md deleted file mode 100644 index 38bdc4b..0000000 --- a/docs/examples/type_safety.md +++ /dev/null @@ -1,9 +0,0 @@ -# type_safety.fun — overview - -What it shows -- Static/dynamic type checks and enforcing type safety in small examples. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/type_safety.fun -- Or: fun examples/type_safety.fun diff --git a/docs/examples/type_safety_fails.md b/docs/examples/type_safety_fails.md deleted file mode 100644 index 2fa31c2..0000000 --- a/docs/examples/type_safety_fails.md +++ /dev/null @@ -1,9 +0,0 @@ -# type_safety_fails.fun — overview - -What it shows -- Examples that intentionally violate type expectations to illustrate safety checks. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/type_safety_fails.fun -- Or: fun examples/type_safety_fails.fun diff --git a/docs/examples/typeof.md b/docs/examples/typeof.md deleted file mode 100644 index 11c300d..0000000 --- a/docs/examples/typeof.md +++ /dev/null @@ -1,9 +0,0 @@ -# typeof.fun — overview - -What it shows -- Type inspection using typeof and related helpers. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/typeof.fun -- Or: fun examples/typeof.fun diff --git a/docs/examples/typeof_features.md b/docs/examples/typeof_features.md deleted file mode 100644 index 747baa7..0000000 --- a/docs/examples/typeof_features.md +++ /dev/null @@ -1,9 +0,0 @@ -# typeof_features.fun — overview - -What it shows -- A tour of typeof-related features and type introspection helpers. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/typeof_features.fun -- Or: fun examples/typeof_features.fun diff --git a/docs/examples/types_integers.md b/docs/examples/types_integers.md deleted file mode 100644 index 753083b..0000000 --- a/docs/examples/types_integers.md +++ /dev/null @@ -1,9 +0,0 @@ -# types_integers.fun — overview - -What it shows -- Integer type families, ranges, and basic operations. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/types_integers.fun -- Or: fun examples/types_integers.fun diff --git a/docs/examples/types_overview.md b/docs/examples/types_overview.md deleted file mode 100644 index 4976c86..0000000 --- a/docs/examples/types_overview.md +++ /dev/null @@ -1,9 +0,0 @@ -# types_overview.fun — overview - -What it shows -- Overview of language types with small examples. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/types_overview.fun -- Or: fun examples/types_overview.fun diff --git a/docs/examples/uint_types.md b/docs/examples/uint_types.md deleted file mode 100644 index 1801a68..0000000 --- a/docs/examples/uint_types.md +++ /dev/null @@ -1,9 +0,0 @@ -# uint_types.fun — overview - -What it shows -- Unsigned integer types and operations; ranges and conversions. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/uint_types.fun -- Or: fun examples/uint_types.fun diff --git a/docs/examples/unix_socket_echo.md b/docs/examples/unix_socket_echo.md deleted file mode 100644 index 48461a6..0000000 --- a/docs/examples/unix_socket_echo.md +++ /dev/null @@ -1,12 +0,0 @@ -# unix_socket_echo.fun — overview - -What it shows -- Local domain (UNIX) socket echo server/client demonstration. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/unix_socket_echo.fun -- Or: fun examples/unix_socket_echo.fun - -Notes -- Uses a UNIX domain socket path on the local filesystem; ensure you have permissions to create it. diff --git a/docs/examples/version.md b/docs/examples/version.md deleted file mode 100644 index d36afe0..0000000 --- a/docs/examples/version.md +++ /dev/null @@ -1,9 +0,0 @@ -# version.fun — overview - -What it shows -- Prints VM and version info for the Fun interpreter/runtime. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/version.fun -- Or: fun examples/version.fun diff --git a/docs/examples/while_test.md b/docs/examples/while_test.md deleted file mode 100644 index 2947d34..0000000 --- a/docs/examples/while_test.md +++ /dev/null @@ -1,9 +0,0 @@ -# while_test.fun — overview - -What it shows -- Simple while loop example; loop conditions and counters. - -How to run -- export FUN_LIB_DIR="./lib" -- ./build_debug/fun examples/while_test.fun -- Or: fun examples/while_test.fun diff --git a/docs/external/README.md b/docs/external/README.md deleted file mode 100644 index c9986d0..0000000 --- a/docs/external/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# External integrations (optional extensions) - -This section documents Fun's optional, build-time selectable extensions. Each page covers: -- How to enable the extension via CMake option (FUN_WITH_*) -- Build requirements and detection notes -- Available opcodes and/or helper functions -- Minimal usage examples and links to example scripts - -## Extensions: - -- [cURL (libcurl)](./curl.md) -- [INI (iniparser)](./ini.md) -- [JSON (json-c)](./json.md) -- [libxml2 (XML)](./xml2.md) -- [SQLite](./sqlite.md) -- [PCRE2 (Perl-compatible regex)](./pcre2.md) -- [PC/SC (Smart cards)](./pcsc.md) -- [OpenSSL](./openssl.md) - -## Notes: - -- These integrations are optional; the VM compiles without them. -- When disabled, related builtins usually return empty strings/neutral values rather than fail hard, mirroring existing optionality patterns. diff --git a/docs/faq.md b/docs/faq.md deleted file mode 100644 index 1fbc565..0000000 --- a/docs/faq.md +++ /dev/null @@ -1,22 +0,0 @@ -# FAQ - -Answers to common questions. - -## I built Fun but includes aren't found -Set `FUN_LIB_DIR` to the repository's `./lib` directory when running without installation: -``` -FUN_LIB_DIR=./lib ./build/fun examples/hello.fun -``` -See [includes.md](./includes.md). - -## How do I start the REPL? -Run `fun -i` (or run `fun` without a script, depending on version). See [repl.md](./repl.md). - -## Which build target should I use? -Use the aggregate `build` target to build `fun`, `fun_test`, and `test_opcodes`. See [build.md](./build.md). - -## Where are the standard libraries? -Under [`./lib/`](../lib/). See [stdlib.md](./stdlib.md) for an overview. - -## Where can I find internals and opcodes? -Browse [src/vm](../src/vm/) and [internals.md](./internals.md) / [opcodes.md](./opcodes.md). diff --git a/docs/roadmap.md b/docs/roadmap.md deleted file mode 100644 index 3235a4f..0000000 --- a/docs/roadmap.md +++ /dev/null @@ -1,21 +0,0 @@ -# Roadmap - -This page outlines high-level areas of focus and points to places where you can help. - -## Themes -- Developer experience: docs, examples, REPL polish -- Optional extensions: stabilize and document supported integrations -- Performance: steady improvements in hot paths and data structures -- Safety: clearer error messages, diagnostics, and sandboxing guidance - -## Near-term -- Expand CLI reference and examples ([cli.md](./cli.md)) -- Improve testing docs and coverage ([writing-tests.md](./writing-tests.md)) -- Fill gaps in stdlib documentation ([stdlib.md](./stdlib.md)) - -## Medium-term -- Bytecode/reference updates as internals evolve ([bytecode-format.md](./bytecode-format.md), [internals.md](./internals.md)) -- Embedding guides and host API stability ([embedding.md](./embedding.md), [rust.md](./rust.md)) - -## Contributing -See [contributing.md](./contributing.md) for how to propose and implement items. Track concrete tasks via repository issues and PRs. diff --git a/web/_posts/2026-01-25-announcing-fun-0.37.62.md b/web/_posts/2026-01-25-announcing-fun-0.37.62.md index 411e26c..51d92aa 100644 --- a/web/_posts/2026-01-25-announcing-fun-0.37.62.md +++ b/web/_posts/2026-01-25-announcing-fun-0.37.62.md @@ -148,8 +148,8 @@ If you're curious about Fun, check out: - [Website](https://fun-lang.xyz) - [Git Repository](https://git.xw3.org/fun/fun){:class="git"} -- [Fun Handbook](https://git.xw3.org/fun/fun/src/branch/main/docs/handbook.md){:class="git"} -- [Fun REPL Guide](https://git.xw3.org/fun/fun/src/branch/main/docs/repl.md){:class="git"} +- [Fun Handbook](https://fun-lang.xyz/documentation/handbook/){:class="git"} +- [Fun REPL Guide](https://fun-lang.xyz/documentation/repl/){:class="git"} - [Specification v0.3](https://git.xw3.org/fun/fun/src/branch/main/spec/v0.3.md){:class="git"} - [Examples](https://git.xw3.org/fun/fun/src/branch/main/examples){:class="git"} - [Standard Library](https://git.xw3.org/fun/fun/src/branch/main/lib){:class="git"} @@ -159,9 +159,9 @@ The examples directory contains demonstrations of most Fun features, from basic ### For Developers -- [Fun Internals](https://git.xw3.org/fun/fun/src/branch/main/docs/internals.md){:class="git"} -- [Fun Opcodes](https://git.xw3.org/fun/fun/src/branch/main/docs/opcodes.md){:class="git"} -- [Basic Rust Opcodes Support](https://git.xw3.org/fun/fun/src/branch/main/docs/rust.md){:class="git"} +- [Fun Internals](https://fun-lang.xyz/documentation/internals/){:class="git"} +- [Fun Opcodes](https://fun-lang.xyz/documentation/opcodes/){:class="git"} +- [Basic Rust Opcodes Support](https://fun-lang.xyz/documentation/rust/){:class="git"} ### The Road Ahead diff --git a/docs/arrays.md b/web/documentation/arrays.md similarity index 90% rename from docs/arrays.md rename to web/documentation/arrays.md index 76c0306..c5c45dd 100644 --- a/docs/arrays.md +++ b/web/documentation/arrays.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - Arrays in Fun +subtitle: Working with arrays, creation, indexing/slicing, iteration patterns, helpers, and idioms. +description: Working with arrays, creation, indexing/slicing, iteration patterns, helpers, and idioms. +permalink: /documentation/arrays/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # Arrays in Fun This guide focuses on arrays: creation, indexing, mutation, iteration, slicing, and common gotchas. It complements the quick overview in types.md with a deeper, example‑driven treatment. diff --git a/docs/asyncio.md b/web/documentation/asyncio.md similarity index 89% rename from docs/asyncio.md rename to web/documentation/asyncio.md index cace323..c04af73 100644 --- a/docs/asyncio.md +++ b/web/documentation/asyncio.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - Async I/O ("asyncio") in Fun +subtitle: Async I/O primitives and patterns, non-blocking sockets, fd polling, examples, and best practices. +description: Async I/O primitives and patterns, non-blocking sockets, fd polling, examples, and best practices. +permalink: /documentation/asyncio/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # Async I/O ("asyncio") in Fun This guide explains the new asynchronous I/O primitives in Fun and how to use them to build non-blocking network and file descriptor workflows. It covers the core concepts, available helpers, common patterns, and runnable examples from the repository. @@ -197,14 +223,14 @@ Q: Is there an async/await syntax? A: Not at this time. The model is explicit non-blocking I/O with polling helpers. You can build lightweight schedulers on top if desired. Q: Does this work on all platforms? -A: The helpers map to portable OS facilities exposed by the VM. Details may vary by platform; see docs/troubleshooting.md and open an issue if you hit differences. +A: The helpers map to portable OS facilities exposed by the VM. Details may vary by platform; see documentation/troubleshooting.md and open an issue if you hit differences. Q: How do I integrate with the REPL? A: You can prototype small non-blocking fragments in the REPL, but full networking examples are easier to run as scripts. ## See also -- [examples.md](./examples.md) — Running bundled examples -- [includes.md](./includes.md) — Include paths and library discovery -- [opcodes.md](./opcodes.md) — VM opcodes overview -- [troubleshooting.md](./troubleshooting.md) — Common issues and quick fixes +- [examples.md](./examples/) — Running bundled examples +- [includes.md](./includes/) — Include paths and library discovery +- [opcodes.md](./opcodes/) — VM opcodes overview +- [troubleshooting.md](./troubleshooting/) — Common issues and quick fixes diff --git a/docs/build.md b/web/documentation/build.md similarity index 82% rename from docs/build.md rename to web/documentation/build.md index e7b815b..95552aa 100644 --- a/docs/build.md +++ b/web/documentation/build.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - Building Fun +subtitle: How to build Fun with CMake, available targets, and build options (FUN_DEBUG, FUN_USE_MUSL, FUN_WITH_CPP, FUN_WITH_RUST, FUN_WITH_OPENSSL). +description: How to build Fun with CMake, available targets, and build options (FUN_DEBUG, FUN_USE_MUSL, FUN_WITH_CPP, FUN_WITH_RUST, FUN_WITH_OPENSSL). +permalink: /documentation/build/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # Building Fun This guide describes how to build Fun from source using CMake and the available build options. @@ -83,7 +109,7 @@ If `FUN_WITH_OPENSSL` is enabled, CMake must detect your system OpenSSL (libcryp ## Running - CLI: run the `fun` executable from your build directory. -- REPL: `fun -i` or just run `fun` without a script, depending on your CLI version (see [cli.md](./cli.md)). -- Examples: see [examples.md](./examples.md). +- REPL: `fun -i` or just run `fun` without a script, depending on your CLI version (see [cli.md](./cli/)). +- Examples: see [examples.md](./examples/). Tip: When running from the repository without installation, set `FUN_LIB_DIR` to the local `./lib` so includes can find the stdlib. diff --git a/docs/bytecode-format.md b/web/documentation/bytecode-format.md similarity index 65% rename from docs/bytecode-format.md rename to web/documentation/bytecode-format.md index 762188f..1014c69 100644 --- a/docs/bytecode-format.md +++ b/web/documentation/bytecode-format.md @@ -1,6 +1,32 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - Bytecode Format (Overview) +subtitle: Reference for the bytecode format (split out from internals for convenience). +description: Reference for the bytecode format (split out from internals for convenience). +permalink: /documentation/bytecode-format/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # Bytecode Format (Overview) -This document summarizes the Fun bytecode format. For deep VM details, see [internals.md](./internals.md). +This document summarizes the Fun bytecode format. For deep VM details, see [internals.md](./internals/). ## Goals - Compact representation for fast loading and dispatch diff --git a/docs/cli.md b/web/documentation/cli.md similarity index 60% rename from docs/cli.md rename to web/documentation/cli.md index c0b13be..794dee0 100644 --- a/docs/cli.md +++ b/web/documentation/cli.md @@ -1,15 +1,41 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - Fun CLI +subtitle: Command-line usage of the `fun` executable, synopsis, options, exit codes, includes and library paths. +description: Command-line usage of the `fun` executable, synopsis, options, exit codes, includes and library paths. +permalink: /documentation/cli/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # Fun CLI Reference for the `fun` command-line interface. -For a complete usage guide (including REPL details, environment variables, include paths, examples, and install locations), see [fun.md](./fun.md). +For a complete usage guide (including REPL details, environment variables, include paths, examples, and install locations), see [fun.md](./fun/). ## Synopsis ``` fun [options] [-- args...] ``` -If no script is supplied and interactive mode is available, `fun` starts a REPL (see [repl.md](./repl.md)). +If no script is supplied and interactive mode is available, `fun` starts a REPL (see [repl.md](./repl/)). ## Common options - `-i`, `--repl` - start an interactive REPL @@ -26,7 +52,7 @@ Options may vary between versions; run `fun --help` to see what your build suppo - `FUN_LIB_DIR` - environment variable that points to the stdlib location; when running from the repo, set this to `./lib`. - `DEFAULT_LIB_DIR` - compiled-in fallback path determined at build/install time. -See also: [includes.md](./includes.md) for namespaced includes and search order. +See also: [includes.md](./includes/) for namespaced includes and search order. ## Examples Run a script: diff --git a/docs/contributing.md b/web/documentation/contributing.md similarity index 62% rename from docs/contributing.md rename to web/documentation/contributing.md index 04191e0..e12113d 100644 --- a/docs/contributing.md +++ b/web/documentation/contributing.md @@ -1,27 +1,53 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - Contributing to Fun +subtitle: How to contribute, project structure, coding style, running tests, and PR guidelines. +description: How to contribute, project structure, coding style, running tests, and PR guidelines. +permalink: /documentation/contributing/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # Contributing to Fun Thanks for your interest in contributing! This guide covers the basics to get you productive quickly. ## Getting started -- Clone the repo and build (see [build.md](./build.md)). -- Run tests locally (see [testing.md](./testing.md)). -- Explore examples (see [examples.md](./examples.md)). +- Clone the repo and build (see [build.md](./build/)). +- Run tests locally (see [testing.md](./testing/)). +- Explore examples (see [examples.md](./examples/)). ## Project structure - `src/` - C core, VM, and opcode implementations ([src/vm](../src/vm/)). - `lib/` - Standard library written in Fun. - `examples/` - Example programs and showcases. -- `docs/` - Documentation. +- `documentation/` - Documentation. - `spec/` - Language specification drafts. ## Code style - C: C99, two-space indent, no tabs. Keep functions short and focused. - Fun: two-space indent, snake_case for functions, PascalCase for classes/constructors. -- Prefer clear names over abbreviations. See [style-guide.md](./style-guide.md). +- Prefer clear names over abbreviations. See [style-guide.md](./style-guide/). ## Development workflow 1. Create a small, focused branch. -2. Add/adjust tests for behavior changes (see [writing-tests.md](./writing-tests.md)). +2. Add/adjust tests for behavior changes (see [writing-tests.md](./writing-tests/)). 3. Update docs if user-visible behavior changes. 4. Submit a PR with a clear description and rationale. @@ -37,4 +63,4 @@ Please include: - `fun --version` output ## Code of Conduct -Be respectful and inclusive. See [CODE_OF_CONDUCT.md](../CODE_OF_CONDUCT.md) in the repository root. +Be respectful and inclusive. See [CODE_OF_CONDUCT.md](../CODE_OF_CONDUCT/) in the repository root. diff --git a/web/documentation/documentation.md b/web/documentation/documentation.md index 8354785..e9198ed 100644 --- a/web/documentation/documentation.md +++ b/web/documentation/documentation.md @@ -4,9 +4,9 @@ published: true noToc: true noComments: false noDate: false -title: Documentation -subtitle: Some documentation about the Fun programming language. -description: The Fun Documentation +title: Fun - Documentation +subtitle: Detailed documentation for the Fun programming language. +description: The Fun Documentation Index permalink: /documentation/ lang: en tags: @@ -24,26 +24,71 @@ tags: - repl --- +# Fun Documentation Index + +This file serves as an index of the documents in this directory. Links are relative and can be opened directly on Git hosting or locally. + ## Basics -[The Fun Handbook is found here](https://git.xw3.org/fun/fun/src/branch/main/docs/handbook.md){:class="git"}! - -Look at [https://git.xw3.org/fun/fun/src/branch/main/docs](https://git.xw3.org/fun/fun/src/branch/main/docs){:class="git"} for more detailed documentation! - -## More information - +- [handbook.md](./handbook.md) - Comprehensive handbook for the Fun language and VM: install/build, configuration flags, usage, and full feature overview. +- [Fun REPL Guide](./repl.md) - REPL guide: how to build/launch, editing and history, completions, REPL-on-error, and tips. - [Specification v0.3](https://git.xw3.org/fun/fun/src/branch/main/spec/v0.3.md){:class="git"} - [Specification v0.2](https://git.xw3.org/fun/fun/src/branch/main/spec/v0.2.md){:class="git"} - [Specification v0.1](https://git.xw3.org/fun/fun/src/branch/main/spec/v0.1.md){:class="git"} - [Examples](https://git.xw3.org/fun/fun/src/branch/main/examples){:class="git"} - [Standard Library](https://git.xw3.org/fun/fun/src/branch/main/lib){:class="git"} -- [Fun REPL Guide](https://git.xw3.org/fun/fun/src/branch/main/docs/repl.md){:class="git"} The examples directory contains demonstrations of most Fun features, from basic "Hello, World!" to threading, networking, classes, and more. The lib directory includes modules written in Fun itself. -## For Developers +## Overview -- [Fun Internals](https://git.xw3.org/fun/fun/src/branch/main/docs/internals.md){:class="git"} -- [Fun Opcodes](https://git.xw3.org/fun/fun/src/branch/main/docs/opcodes.md){:class="git"} -- [Basic Rust Opcodes Support](https://git.xw3.org/fun/fun/src/branch/main/docs/rust.md){:class="git"} +- [types.md](./types.md) - Core types (numbers, strings, arrays, maps, nil/bool), common operations, patterns, and interop notes. +- [numbers.md](./numbers.md) - Working with integers and floats: arithmetic, conversions, clamping, bitwise ops, and patterns. +- [strings.md](./strings.md) - Working with strings: literals/escaping, concatenation, substr/find, split, and conversions. +- [arrays.md](./arrays.md) - Working with arrays: creation, indexing/slicing, iteration patterns, helpers, and idioms. +- [maps.md](./maps.md) - Working with maps: construction, lookup/update, merging, iteration, and common patterns. +- [includes.md](./includes.md) - Using local vs. system includes, FUN_LIB_DIR, DEFAULT_LIB_DIR, and namespaced includes with `as`. +- [opcodes.md](./opcodes.md) - VM opcodes overview grouped by domain with brief behavior/stack notes. +- [internals.md](./internals.md) - Implementation details: bytecode format, VM architecture, stacks/frames, parser, and dispatch. +- [rust.md](./rust.md) - Writing Rust-backed opcodes and wiring them into the C VM; build/setup notes. +- [examples.md](./examples.md) - How to run the examples and the interactive showcase script, with environment tips. +- [testing.md](./testing.md) - How to build and run tests/targets with CMake/CTest, and where to add new tests. +- [troubleshooting.md](./troubleshooting.md) - Common issues and quick fixes for build, includes, and REPL usage. +## New and supplemental guides + +- [build.md](./build.md) - How to build Fun with CMake, available targets, and build options (FUN_DEBUG, FUN_USE_MUSL, FUN_WITH_CPP, FUN_WITH_RUST, FUN_WITH_OPENSSL). +- [cli.md](./cli.md) - Command-line usage of the `fun` executable: synopsis, options, exit codes, includes and library paths. +- [fun.md](./fun.md) - Full usage guide for the `fun` executable: invocation patterns, REPL, env vars, include paths, examples, and install locations. +- [asyncio.md](./asyncio.md) - Async I/O primitives and patterns: non-blocking sockets, fd polling, examples, and best practices. +- [funstx.md](./funstx.md) - Syntax checker for .fun files with optional --fix auto-corrections; usage, exit codes, and limitations. +- [contributing.md](./contributing.md) - How to contribute: project structure, coding style, running tests, and PR guidelines. +- [style-guide.md](./style-guide.md) - Coding conventions for C and Fun (indentation, naming, idioms). +- [stdlib.md](./stdlib.md) - Overview of the standard library modules under ./lib with one-line summaries. +- [embedding.md](./embedding.md) - Embedding the VM from C/Rust, lifecycle, and host integration tips. +- [errors-and-diagnostics.md](./errors-and-diagnostics.md) - Understanding parser/runtime errors and enabling diagnostics. +- [performance.md](./performance.md) - Build/runtime tuning tips and patterns for better performance. +- [security-and-sandboxing.md](./security-and-sandboxing.md) - Trust boundaries, I/O expectations, and capability restrictions. +- [faq.md](./faq.md) - Frequently asked questions and quick answers. +- [website.md](./website.md) - Documentation for the [fun-lang.xyz](https://fun-lang.xyz) website in the `./web/` directory. +- [writing-tests.md](./writing-tests.md) - How to author new tests for Fun and opcode components. +- [bytecode-format.md](./bytecode-format.md) - Reference for the bytecode format (split out from internals for convenience). +- [roadmap.md](./roadmap.md) - High-level direction, planned features, and pointers to issues. + +## Examples + + - [examples/README.md](./examples/README.md) - Catalog of all example scripts under ./examples/: what each area contains, how to run them, required env vars, and extension requirements. + +## External extensions + +Documentation for optional, build-time selectable integrations lives in [external/](./external/): + +- [Index of extensions](./external/README.md) + - Highlights: [cURL](./external/curl.md), [INI](./external/ini.md), [JSON](./external/json.md), [XML (libxml2)](./external/xml2.md), [SQLite](./external/sqlite.md), [PCRE2](./external/pcre2.md), [PC/SC](./external/pcsc.md), [OpenSSL](./external/openssl.md) + +## Tips + +- When building from the repo without installing, set `FUN_LIB_DIR` to the local `./lib` directory so examples and the REPL can locate the stdlib. +- For a broader project overview and quickstart, see the repository root [README.md](../../README.md). +- Crypto examples: + - If built with `-DFUN_WITH_OPENSSL=ON`, try `examples/crypto/openssl_md5.fun`. diff --git a/docs/embedding.md b/web/documentation/embedding.md similarity index 67% rename from docs/embedding.md rename to web/documentation/embedding.md index 321f9fb..cbcb3aa 100644 --- a/docs/embedding.md +++ b/web/documentation/embedding.md @@ -1,10 +1,36 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - Embedding Fun +subtitle: Embedding the VM from C/Rust, lifecycle, and host integration tips. +description: Embedding the VM from C/Rust, lifecycle, and host integration tips. +permalink: /documentation/embedding/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # Embedding Fun This guide outlines how to embed the Fun VM in a host application and extend it from C/Rust. ## Overview - The VM is implemented in C (see [src/vm](../src/vm/)). -- Optional Rust-based opcodes can be enabled via `FUN_WITH_RUST` (see [rust.md](./rust.md)). +- Optional Rust-based opcodes can be enabled via `FUN_WITH_RUST` (see [rust.md](./rust/)). ## Embedding from C While the exact API surface may evolve, a typical embedding flow looks like: @@ -26,4 +52,4 @@ When `FUN_WITH_RUST=ON`, a Rust static library from [`src/rust/`](../src/rust/) - Implement new opcodes/functions in Rust. - Expose a C ABI for the VM to call into. -See [rust.md](./rust.md) for details and example code. +See [rust.md](./rust/) for details and example code. diff --git a/docs/errors-and-diagnostics.md b/web/documentation/errors-and-diagnostics.md similarity index 62% rename from docs/errors-and-diagnostics.md rename to web/documentation/errors-and-diagnostics.md index fc92ee3..064f247 100644 --- a/docs/errors-and-diagnostics.md +++ b/web/documentation/errors-and-diagnostics.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - Errors and Diagnostics +subtitle: Understanding parser/runtime errors and enabling diagnostics. +description: Understanding parser/runtime errors and enabling diagnostics. +permalink: /documentation/errors-and-diagnostics/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # Errors and Diagnostics This guide helps you understand common error messages and how to collect useful diagnostics. @@ -8,7 +34,7 @@ This guide helps you understand common error messages and how to collect useful - Runtime errors: type mismatches, out-of-range access, invalid operations. ## Enabling diagnostics -- Build with `-DFUN_DEBUG=ON` to enable additional assertions and debug messages (see [build.md](./build.md)). +- Build with `-DFUN_DEBUG=ON` to enable additional assertions and debug messages (see [build.md](./build/)). - Run with smaller, focused scripts to isolate issues. ## Getting useful reports diff --git a/docs/examples.md b/web/documentation/examples.md similarity index 81% rename from docs/examples.md rename to web/documentation/examples.md index 93a792c..7f01dc5 100644 --- a/docs/examples.md +++ b/web/documentation/examples.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - Running the Examples +subtitle: How to run the examples and the interactive showcase script, with environment tips. +description: How to run the examples and the interactive showcase script, with environment tips. +permalink: /documentation/examples/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # Running the Examples This page shows how to run the example programs included with the repository and how to use the interactive showcase script. diff --git a/docs/examples/README.md b/web/documentation/examples/README.md similarity index 50% rename from docs/examples/README.md rename to web/documentation/examples/README.md index 32ca811..19cc64e 100644 --- a/docs/examples/README.md +++ b/web/documentation/examples/README.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - Examples catalog and how to run them +subtitle: Catalog of all example scripts under ./examples/, what each area contains, how to run them, required env vars, and extension requirements. +description: Catalog of all example scripts under ./examples/, what each area contains, how to run them, required env vars, and extension requirements. +permalink: /documentation/examples/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # Examples catalog and how to run them This page is a practical catalog of the example areas that ship with the Fun language. It explains what you’ll find in each folder under ./examples/, how to run the scripts, and where deeper walkthroughs live. @@ -10,7 +36,7 @@ If you’re building/running from the repository without installing, set FUN_LIB Notes - Most scripts are self‑documented with a short header comment at the top. Open them to see exact behavior and expected output. -- Some examples depend on optional extensions (cURL, PCRE2, SQLite, Notcurses, Tk, PC/SC, OpenSSL/LibreSSL). See docs/external/ for enablement and availability. +- Some examples depend on optional extensions (cURL, PCRE2, SQLite, Notcurses, Tk, PC/SC, OpenSSL/LibreSSL). See documentation/external/ for enablement and availability. - Networking examples often bind to 127.0.0.1 on high ports; read the file header for the exact port. Deep‑dives @@ -24,74 +50,74 @@ Run pattern: Highlights (selection): -- [builtins_extended.fun](./builtins_extended.md) — tour of core built‑ins beyond the basics -- [byte_for_demo.fun](./byte_for_demo.md) — iterating bytes with for -- [byte_overflow_try_catch.fun](./byte_overflow_try_catch.md) — error handling on overflow -- [cast_demo.fun](./cast_demo.md) — conversions and casting helpers -- [class_constructor.fun](./class_constructor.md) — basic constructor usage and init patterns -- [class_test.fun](./class_test.md) — small class feature checks -- [classes_demo.fun](classes_demo.md) — class basics and usage -- [class_without_object.fun](./class_without_object.md) — class features without an instance helper -- [cli_argv_dump.fun](./cli_argv_dump.md) — prints argv/argc handling -- [conversions_showcase.fun](./conversions_showcase.md) — numbers, strings, bytes conversions -- [cpp_add.fun](./cpp_add.md) — calling into the optional C++ extension (if enabled) -- [datetime_basic.fun](./datetime_basic.md) — minimal date/time helpers -- [datetime_extended.fun](./datetime_extended.md) — richer date/time operations -- [datetime_timer.fun](datetime_timer.md) — time/date helpers -- [echo_example.fun](./echo_example.md) — simple echo of input/args -- [env_all.fun](./env_all.md) — enumerate environment variables -- [os_env.fun](./os_env.md) — reading environment variables -- [error_handling.fun](./error_handling.md) — try/catch and error objects -- [try_catch_finally.fun](try_catch_finally.md) — error patterns -- [expressions_test.fun](./expressions_test.md) — precedence and grouping -- [features.fun](./features.md) — grab bag of language features -- [file_print_for_file_line_by_line.fun](./file_print_for_file_line_by_line.md) — iterate file content -- [floats.fun](./floats.md) — float ops and formatting -- [for_range_test.fun](./for_range_test.md) — ranges and loops -- [functions_test.fun](./functions_test.md) — functions, closures, returns -- [have_fun.fun](./have_fun.md) — playful starter demo -- [have_fun_function.fun](have_fun_function.md) — playful demos -- [hex_example.fun](./hex_example.md) — hex encode/decode -- [if_else_test.fun](./if_else_test.md) — conditional branching examples -- [nested_loops.fun](./nested_loops.md) — loops inside loops -- [loops_break_continue.fun](loops_break_continue.md) — control flow -- [include_local.fun](./include_local.md) — include a local file/module -- [include_lib.fun](./include_lib.md) — include from the stdlib path -- [include_local_util.fun](include_local_util.md) — include mechanics -- [inheritance_demo.fun](./inheritance_demo.md) — simple class inheritance -- [maps.fun](./maps.md), [match.fun](match.md) — data structures and pattern matching -- [namespaced_mod.fun](./namespaced_mod.md) — namespaced includes with as -- [objects_basic.fun](./objects_basic.md) — simple objects and methods -- [objects_more.fun](./objects_more.md) — OO basics -- [process_example.fun](./process_example.md) — spawn and capture subprocess output -- [progress.fun](./progress.md) — progress bar helper -- [progress_inline.fun](./progress_inline.md) — simple progress displays -- [random_demo.fun](./random_demo.md) — random helpers overview -- [random_number_example.fun](random_number_example.md) — RNG usage -- [regex_demo.fun](./regex_demo.md) — regex basics (PCRE2 when enabled) -- [regex_procedural.fun](./regex_procedural.md) — regex helpers (PCRE2 when enabled) -- [rust_hello.fun](./rust_hello.md), rust_hello_args*.fun — Rust opcodes (if FUN_WITH_RUST) -- [serial_demo.fun](./serial_demo.md) — serial port usage -- [test_serial.fun](./test_serial.md) — serial port (when available) -- [short_circuit_test.fun](./short_circuit_test.md) — boolean evaluation order -- [signed_ints.fun](./signed_ints.md) — signed integers overview -- [uint_types.fun](./uint_types.md) — unsigned integers overview -- [types_integers.fun](./types_integers.md) — integer families -- [stdlib_showcase.fun](./stdlib_showcase.md) — sampler of common stdlib modules -- [strings_test.fun](./strings_test.md) — string helpers and edge cases -- [tcp_http_get.fun](./tcp_http_get.md) — simple HTTP GET over raw TCP -- [tcp_http_get_class.fun](./tcp_http_get_class.md) — manual HTTP client over sockets -- [test_bits.fun](./test_bits.md) — /rol/shl/xor/dec_to_hex/hex_to_dec bitwise utilities -- [thread_class_example.fun](./thread_class_example.md) — define and run a thread class -- [threads_demo.fun](./threads_demo.md) — threading building blocks -- [typeof.fun](./typeof.md) — type inspection -- [typeof_features.fun](./typeof_features.md) — type inspection of declared integer subtypes and runtime categories -- [type_safety.fun](./type_safety.md) — static/dynamic type checks -- [type_safety_fails.fun](./type_safety_fails.md) — static/dynamic type checks -- [types_overview.fun](./types_overview.md) — language types tour -- [unix_socket_echo.fun](./unix_socket_echo.md) — local domain socket echo demo -- [version.fun](./version.md) — print VM/version info -- [while_test.fun](./while_test.md) — simple while loop example +- [builtins_extended.fun](./builtins_extended/) — tour of core built‑ins beyond the basics +- [byte_for_demo.fun](./byte_for_demo/) — iterating bytes with for +- [byte_overflow_try_catch.fun](./byte_overflow_try_catch/) — error handling on overflow +- [cast_demo.fun](./cast_demo/) — conversions and casting helpers +- [class_constructor.fun](./class_constructor/) — basic constructor usage and init patterns +- [class_test.fun](./class_test/) — small class feature checks +- [classes_demo.fun](classes_demo/) — class basics and usage +- [class_without_object.fun](./class_without_object/) — class features without an instance helper +- [cli_argv_dump.fun](./cli_argv_dump/) — prints argv/argc handling +- [conversions_showcase.fun](./conversions_showcase/) — numbers, strings, bytes conversions +- [cpp_add.fun](./cpp_add/) — calling into the optional C++ extension (if enabled) +- [datetime_basic.fun](./datetime_basic/) — minimal date/time helpers +- [datetime_extended.fun](./datetime_extended/) — richer date/time operations +- [datetime_timer.fun](datetime_timer/) — time/date helpers +- [echo_example.fun](./echo_example/) — simple echo of input/args +- [env_all.fun](./env_all/) — enumerate environment variables +- [os_env.fun](./os_env/) — reading environment variables +- [error_handling.fun](./error_handling/) — try/catch and error objects +- [try_catch_finally.fun](try_catch_finally/) — error patterns +- [expressions_test.fun](./expressions_test/) — precedence and grouping +- [features.fun](./features/) — grab bag of language features +- [file_print_for_file_line_by_line.fun](./file_print_for_file_line_by_line/) — iterate file content +- [floats.fun](./floats/) — float ops and formatting +- [for_range_test.fun](./for_range_test/) — ranges and loops +- [functions_test.fun](./functions_test/) — functions, closures, returns +- [have_fun.fun](./have_fun/) — playful starter demo +- [have_fun_function.fun](have_fun_function/) — playful demos +- [hex_example.fun](./hex_example/) — hex encode/decode +- [if_else_test.fun](./if_else_test/) — conditional branching examples +- [nested_loops.fun](./nested_loops/) — loops inside loops +- [loops_break_continue.fun](loops_break_continue/) — control flow +- [include_local.fun](./include_local/) — include a local file/module +- [include_lib.fun](./include_lib/) — include from the stdlib path +- [include_local_util.fun](include_local_util/) — include mechanics +- [inheritance_demo.fun](./inheritance_demo/) — simple class inheritance +- [maps.fun](./maps/), [match.fun](match/) — data structures and pattern matching +- [namespaced_mod.fun](./namespaced_mod/) — namespaced includes with as +- [objects_basic.fun](./objects_basic/) — simple objects and methods +- [objects_more.fun](./objects_more/) — OO basics +- [process_example.fun](./process_example/) — spawn and capture subprocess output +- [progress.fun](./progress/) — progress bar helper +- [progress_inline.fun](./progress_inline/) — simple progress displays +- [random_demo.fun](./random_demo/) — random helpers overview +- [random_number_example.fun](random_number_example/) — RNG usage +- [regex_demo.fun](./regex_demo/) — regex basics (PCRE2 when enabled) +- [regex_procedural.fun](./regex_procedural/) — regex helpers (PCRE2 when enabled) +- [rust_hello.fun](./rust_hello/), rust_hello_args*.fun — Rust opcodes (if FUN_WITH_RUST) +- [serial_demo.fun](./serial_demo/) — serial port usage +- [test_serial.fun](./test_serial/) — serial port (when available) +- [short_circuit_test.fun](./short_circuit_test/) — boolean evaluation order +- [signed_ints.fun](./signed_ints/) — signed integers overview +- [uint_types.fun](./uint_types/) — unsigned integers overview +- [types_integers.fun](./types_integers/) — integer families +- [stdlib_showcase.fun](./stdlib_showcase/) — sampler of common stdlib modules +- [strings_test.fun](./strings_test/) — string helpers and edge cases +- [tcp_http_get.fun](./tcp_http_get/) — simple HTTP GET over raw TCP +- [tcp_http_get_class.fun](./tcp_http_get_class/) — manual HTTP client over sockets +- [test_bits.fun](./test_bits/) — /rol/shl/xor/dec_to_hex/hex_to_dec bitwise utilities +- [thread_class_example.fun](./thread_class_example/) — define and run a thread class +- [threads_demo.fun](./threads_demo/) — threading building blocks +- [typeof.fun](./typeof/) — type inspection +- [typeof_features.fun](./typeof_features/) — type inspection of declared integer subtypes and runtime categories +- [type_safety.fun](./type_safety/) — static/dynamic type checks +- [type_safety_fails.fun](./type_safety_fails/) — static/dynamic type checks +- [types_overview.fun](./types_overview/) — language types tour +- [unix_socket_echo.fun](./unix_socket_echo/) — local domain socket echo demo +- [version.fun](./version/) — print VM/version info +- [while_test.fun](./while_test/) — simple while loop example Tip: If a file name is listed above but not present on your build, it may depend on an extension you did not enable. @@ -127,7 +153,7 @@ Hashing and cryptographic helpers. Availability depends on whether OpenSSL/Libre ## Data (./examples/data) Static assets for example servers; not meant to be run directly. -- htdocs/ — files used by HTTP server examples (index.html, hello.fun, info.fun, form_post.fun, counter.fun, redirect.fun, json_like_api.fun) +- htdocumentation/ — files used by HTTP server examples (index.html, hello.fun, info.fun, form_post.fun, counter.fun, redirect.fun, json_like_api.fun) ## Error handling and diagnostics (./examples/error) - debug_reporting.fun — enabling debug output and reading traces @@ -139,7 +165,7 @@ Static assets for example servers; not meant to be run directly. - try_catch_with_error.fun — capturing error objects ## Extra integrations (./examples/extra) -These require optional external libraries. See docs/external/. +These require optional external libraries. See documentation/external/. - curl_* — cURL HTTP client examples (download, GET JSON, POST) - ini_* — parsing INI files (simple to complex) - json_showcase.fun — JSON helpers @@ -174,8 +200,8 @@ Small, focused math helpers and demonstrations: - math_gcd_lcm ## Networking (./examples/net) -Servers and socket utilities. See docs/examples/net/httpserver.md for the HTTP family. -- HTTP servers: [httpserver.md](./net/httpserver.md) — end‑to‑end walkthrough of all HTTP server variants in examples/net/ +Servers and socket utilities. See documentation/examples/net/httpserver.md for the HTTP family. +- HTTP servers: [httpserver.md](./net/httpserver/) — end‑to‑end walkthrough of all HTTP server variants in examples/net/ - http_static_server.fun — minimal static server over sockets - http_server.fun — blocking static/CGI dispatcher using lib/net/http_server.fun - http_server_cgi.fun — blocking server with CGI via lib/net/http_cgi_server.fun @@ -215,4 +241,4 @@ Set up env if needed: - export FUN_EXEC="./build_debug/fun" # used by CGI examples - export FUN_HTDOCS="./examples/data/htdocs" # override docroot -When optional extensions are not enabled, their examples will not run; reconfigure the build with the required -D flags shown in docs/external/. +When optional extensions are not enabled, their examples will not run; reconfigure the build with the required -D flags shown in documentation/external/. diff --git a/docs/examples/builtins_extended.md b/web/documentation/examples/builtins_extended.md similarity index 52% rename from docs/examples/builtins_extended.md rename to web/documentation/examples/builtins_extended.md index 3bb9649..ce71237 100644 --- a/docs/examples/builtins_extended.md +++ b/web/documentation/examples/builtins_extended.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - builtins_extended.fun — overview +subtitle: Documentation for builtins_extended.fun — overview +description: Documentation for builtins_extended.fun — overview +permalink: /documentation/examples/builtins_extended/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # builtins_extended.fun — overview What it shows diff --git a/web/documentation/examples/builtins_maps_and_more.md b/web/documentation/examples/builtins_maps_and_more.md new file mode 100644 index 0000000..3fad30a --- /dev/null +++ b/web/documentation/examples/builtins_maps_and_more.md @@ -0,0 +1,38 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - builtins_maps_and_more.fun — overview +subtitle: Documentation for builtins_maps_and_more.fun — overview +description: Documentation for builtins_maps_and_more.fun — overview +permalink: /documentation/examples/builtins_maps_and_more/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# builtins_maps_and_more.fun — overview + +What it shows +- Exploring built‑ins while working with maps and related data structures. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/builtins_maps_and_more.fun +- Or: fun examples/builtins_maps_and_more.fun + +Notes +- Open the .fun file to see the exact behaviors and printed output. diff --git a/web/documentation/examples/byte_for_demo.md b/web/documentation/examples/byte_for_demo.md new file mode 100644 index 0000000..8a07647 --- /dev/null +++ b/web/documentation/examples/byte_for_demo.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - byte_for_demo.fun — overview +subtitle: Documentation for byte_for_demo.fun — overview +description: Documentation for byte_for_demo.fun — overview +permalink: /documentation/examples/byte_for_demo/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# byte_for_demo.fun — overview + +What it shows +- Iterating bytes with a for-loop; indexing and printing byte values. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/byte_for_demo.fun +- Or: fun examples/byte_for_demo.fun diff --git a/web/documentation/examples/byte_overflow_try_catch.md b/web/documentation/examples/byte_overflow_try_catch.md new file mode 100644 index 0000000..ada0410 --- /dev/null +++ b/web/documentation/examples/byte_overflow_try_catch.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - byte_overflow_try_catch.fun — overview +subtitle: Documentation for byte_overflow_try_catch.fun — overview +description: Documentation for byte_overflow_try_catch.fun — overview +permalink: /documentation/examples/byte_overflow_try_catch/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# byte_overflow_try_catch.fun — overview + +What it shows +- Error handling around byte/integer overflow using try/catch. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/byte_overflow_try_catch.fun +- Or: fun examples/byte_overflow_try_catch.fun diff --git a/web/documentation/examples/cast_demo.md b/web/documentation/examples/cast_demo.md new file mode 100644 index 0000000..9352b69 --- /dev/null +++ b/web/documentation/examples/cast_demo.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - cast_demo.fun — overview +subtitle: Documentation for cast_demo.fun — overview +description: Documentation for cast_demo.fun — overview +permalink: /documentation/examples/cast_demo/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# cast_demo.fun — overview + +What it shows +- Conversions and casting helpers; demonstrates changing between numeric and string types safely. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/cast_demo.fun +- Or: fun examples/cast_demo.fun diff --git a/web/documentation/examples/class_constructor.md b/web/documentation/examples/class_constructor.md new file mode 100644 index 0000000..7c8de48 --- /dev/null +++ b/web/documentation/examples/class_constructor.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - class_constructor.fun — overview +subtitle: Documentation for class_constructor.fun — overview +description: Documentation for class_constructor.fun — overview +permalink: /documentation/examples/class_constructor/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# class_constructor.fun — overview + +What it shows +- Class basics and constructor behavior; initializing fields and using methods. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/class_constructor.fun +- Or: fun examples/class_constructor.fun diff --git a/web/documentation/examples/class_test.md b/web/documentation/examples/class_test.md new file mode 100644 index 0000000..8b37d5c --- /dev/null +++ b/web/documentation/examples/class_test.md @@ -0,0 +1,38 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - class_test.fun — overview +subtitle: Documentation for class_test.fun — overview +description: Documentation for class_test.fun — overview +permalink: /documentation/examples/class_test/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# class_test.fun — overview + +What it shows +- Simple class usage and method invocation; small sanity checks around classes. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/class_test.fun +- Or: fun examples/class_test.fun + +Notes +- Open the script to see the exact behavior and outputs. diff --git a/web/documentation/examples/class_without_object.md b/web/documentation/examples/class_without_object.md new file mode 100644 index 0000000..d6cb45a --- /dev/null +++ b/web/documentation/examples/class_without_object.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - class_without_object.fun — overview +subtitle: Documentation for class_without_object.fun — overview +description: Documentation for class_without_object.fun — overview +permalink: /documentation/examples/class_without_object/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# class_without_object.fun — overview + +What it shows +- Class features that can be used without creating an instance (static-like usage patterns). + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/class_without_object.fun +- Or: fun examples/class_without_object.fun diff --git a/web/documentation/examples/classes_demo.md b/web/documentation/examples/classes_demo.md new file mode 100644 index 0000000..bd00e5c --- /dev/null +++ b/web/documentation/examples/classes_demo.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - classes_demo.fun — overview +subtitle: Documentation for classes_demo.fun — overview +description: Documentation for classes_demo.fun — overview +permalink: /documentation/examples/classes_demo/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# classes_demo.fun — overview + +What it shows +- Class basics and usage: defining classes, instantiating objects, calling methods. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/classes_demo.fun +- Or: fun examples/classes_demo.fun diff --git a/web/documentation/examples/cli_argv_dump.md b/web/documentation/examples/cli_argv_dump.md new file mode 100644 index 0000000..36b0f40 --- /dev/null +++ b/web/documentation/examples/cli_argv_dump.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - cli_argv_dump.fun — overview +subtitle: Documentation for cli_argv_dump.fun — overview +description: Documentation for cli_argv_dump.fun — overview +permalink: /documentation/examples/cli_argv_dump/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# cli_argv_dump.fun — overview + +What it shows +- Prints argv/argc handling to demonstrate CLI arguments parsing at a low level. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/cli_argv_dump.fun --foo bar 123 +- Or: fun examples/cli_argv_dump.fun --foo bar 123 diff --git a/web/documentation/examples/conversions_showcase.md b/web/documentation/examples/conversions_showcase.md new file mode 100644 index 0000000..b61d08d --- /dev/null +++ b/web/documentation/examples/conversions_showcase.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - conversions_showcase.fun — overview +subtitle: Documentation for conversions_showcase.fun — overview +description: Documentation for conversions_showcase.fun — overview +permalink: /documentation/examples/conversions_showcase/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# conversions_showcase.fun — overview + +What it shows +- Numbers, strings, and bytes conversions; typical idioms and edge cases. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/conversions_showcase.fun +- Or: fun examples/conversions_showcase.fun diff --git a/web/documentation/examples/cpp_add.md b/web/documentation/examples/cpp_add.md new file mode 100644 index 0000000..31e6a83 --- /dev/null +++ b/web/documentation/examples/cpp_add.md @@ -0,0 +1,38 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - cpp_add.fun — overview +subtitle: Documentation for cpp_add.fun — overview +description: Documentation for cpp_add.fun — overview +permalink: /documentation/examples/cpp_add/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# cpp_add.fun — overview + +What it shows +- Calling into the optional C++ extension from Fun. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/cpp_add.fun +- Or: fun examples/cpp_add.fun + +Notes +- Requires the optional C++ extension to be enabled in your build; otherwise this example may be unavailable. diff --git a/web/documentation/examples/data/htdocs/counter.md b/web/documentation/examples/data/htdocs/counter.md new file mode 100644 index 0000000..e47aac1 --- /dev/null +++ b/web/documentation/examples/data/htdocs/counter.md @@ -0,0 +1,43 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - counter.fun (CGI) +subtitle: Documentation for counter.fun (CGI) +description: Documentation for counter.fun (CGI) +permalink: /documentation/examples/data/htdocumentation/counter/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# counter.fun (CGI) + +- Location: examples/data/htdocumentation/counter.fun +- Category: CGI script used by HTTP server examples + +Description +- Simple stateful counter example for CGI; demonstrates reading and updating a value across requests (implementation details in script). + +How to run +- Through one of the HTTP server examples, e.g.: + - export FUN_LIB_DIR="./lib" + - export FUN_EXEC="./build_debug/fun" + - ./build_debug/fun examples/net/http_server_cgi.fun + - Open: http://127.0.0.1:8080/counter.fun + +See also +- documentation/examples/httpserver.md (deep-dive) diff --git a/web/documentation/examples/data/htdocs/form_post.md b/web/documentation/examples/data/htdocs/form_post.md new file mode 100644 index 0000000..d41b235 --- /dev/null +++ b/web/documentation/examples/data/htdocs/form_post.md @@ -0,0 +1,43 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - form_post.fun (CGI) +subtitle: Documentation for form_post.fun (CGI) +description: Documentation for form_post.fun (CGI) +permalink: /documentation/examples/data/htdocumentation/form_post/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# form_post.fun (CGI) + +- Location: examples/data/htdocumentation/form_post.fun +- Category: CGI script used by HTTP server examples + +Description +- Demonstrates handling of POST form data via the CGI interface. + +How to run +- Through one of the HTTP server examples, e.g.: + - export FUN_LIB_DIR="./lib" + - export FUN_EXEC="./build_debug/fun" + - ./build_debug/fun examples/net/http_server_cgi.fun + - Submit a form to: http://127.0.0.1:8080/form_post.fun + +See also +- documentation/examples/httpserver.md (deep-dive) diff --git a/web/documentation/examples/data/htdocs/hello.md b/web/documentation/examples/data/htdocs/hello.md new file mode 100644 index 0000000..fa6b3f5 --- /dev/null +++ b/web/documentation/examples/data/htdocs/hello.md @@ -0,0 +1,43 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - hello.fun (CGI) +subtitle: Documentation for hello.fun (CGI) +description: Documentation for hello.fun (CGI) +permalink: /documentation/examples/data/htdocumentation/hello/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# hello.fun (CGI) + +- Location: examples/data/htdocumentation/hello.fun +- Category: CGI script used by HTTP server examples + +Description +- Simple CGI .fun script that prints a greeting, optionally using query parameters (e.g., ?name=Fun). + +How to run +- Through one of the HTTP server examples, e.g.: + - export FUN_LIB_DIR="./lib" + - export FUN_EXEC="./build_debug/fun" + - ./build_debug/fun examples/net/http_server_cgi.fun + - Open: http://127.0.0.1:8080/hello.fun?name=Fun + +See also +- documentation/examples/httpserver.md (deep-dive) diff --git a/web/documentation/examples/data/htdocs/info.md b/web/documentation/examples/data/htdocs/info.md new file mode 100644 index 0000000..5e2f49f --- /dev/null +++ b/web/documentation/examples/data/htdocs/info.md @@ -0,0 +1,43 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - info.fun (CGI) +subtitle: Documentation for info.fun (CGI) +description: Documentation for info.fun (CGI) +permalink: /documentation/examples/data/htdocumentation/info/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# info.fun (CGI) + +- Location: examples/data/htdocumentation/info.fun +- Category: CGI script used by HTTP server examples + +Description +- CGI script that prints request/environment information, useful for debugging CGI variables. + +How to run +- Through one of the HTTP server examples, e.g.: + - export FUN_LIB_DIR="./lib" + - export FUN_EXEC="./build_debug/fun" + - ./build_debug/fun examples/net/http_server_cgi.fun + - Open: http://127.0.0.1:8080/info.fun + +See also +- documentation/examples/httpserver.md (deep-dive) diff --git a/web/documentation/examples/data/htdocs/json_like_api.md b/web/documentation/examples/data/htdocs/json_like_api.md new file mode 100644 index 0000000..6bf1db4 --- /dev/null +++ b/web/documentation/examples/data/htdocs/json_like_api.md @@ -0,0 +1,43 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - json_like_api.fun (CGI) +subtitle: Documentation for json_like_api.fun (CGI) +description: Documentation for json_like_api.fun (CGI) +permalink: /documentation/examples/data/htdocumentation/json_like_api/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# json_like_api.fun (CGI) + +- Location: examples/data/htdocumentation/json_like_api.fun +- Category: CGI script used by HTTP server examples + +Description +- Demonstrates returning JSON-like output from a CGI endpoint. + +How to run +- Through one of the HTTP server examples, e.g.: + - export FUN_LIB_DIR="./lib" + - export FUN_EXEC="./build_debug/fun" + - ./build_debug/fun examples/net/http_server_cgi.fun + - Open: http://127.0.0.1:8080/json_like_api.fun + +See also +- documentation/examples/httpserver.md (deep-dive) diff --git a/web/documentation/examples/data/htdocs/redirect.md b/web/documentation/examples/data/htdocs/redirect.md new file mode 100644 index 0000000..50cee04 --- /dev/null +++ b/web/documentation/examples/data/htdocs/redirect.md @@ -0,0 +1,43 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - redirect.fun (CGI) +subtitle: Documentation for redirect.fun (CGI) +description: Documentation for redirect.fun (CGI) +permalink: /documentation/examples/data/htdocumentation/redirect/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# redirect.fun (CGI) + +- Location: examples/data/htdocumentation/redirect.fun +- Category: CGI script used by HTTP server examples + +Description +- Demonstrates issuing HTTP redirects from a CGI script (setting Status and Location headers). + +How to run +- Through one of the HTTP server examples, e.g.: + - export FUN_LIB_DIR="./lib" + - export FUN_EXEC="./build_debug/fun" + - ./build_debug/fun examples/net/http_server_cgi.fun + - Open: http://127.0.0.1:8080/redirect.fun + +See also +- documentation/examples/httpserver.md (deep-dive) diff --git a/web/documentation/examples/datetime_basic.md b/web/documentation/examples/datetime_basic.md new file mode 100644 index 0000000..ef9c26e --- /dev/null +++ b/web/documentation/examples/datetime_basic.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - datetime_basic.fun — overview +subtitle: Documentation for datetime_basic.fun — overview +description: Documentation for datetime_basic.fun — overview +permalink: /documentation/examples/datetime_basic/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# datetime_basic.fun — overview + +What it shows +- Basic time/date helpers and formatting. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/datetime_basic.fun +- Or: fun examples/datetime_basic.fun diff --git a/web/documentation/examples/datetime_extended.md b/web/documentation/examples/datetime_extended.md new file mode 100644 index 0000000..6a57f5f --- /dev/null +++ b/web/documentation/examples/datetime_extended.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - datetime_extended.fun — overview +subtitle: Documentation for datetime_extended.fun — overview +description: Documentation for datetime_extended.fun — overview +permalink: /documentation/examples/datetime_extended/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# datetime_extended.fun — overview + +What it shows +- Extended datetime helpers: parsing, arithmetic, timers, and formatting variants. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/datetime_extended.fun +- Or: fun examples/datetime_extended.fun diff --git a/web/documentation/examples/datetime_timer.md b/web/documentation/examples/datetime_timer.md new file mode 100644 index 0000000..c072a25 --- /dev/null +++ b/web/documentation/examples/datetime_timer.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - datetime_timer.fun — overview +subtitle: Documentation for datetime_timer.fun — overview +description: Documentation for datetime_timer.fun — overview +permalink: /documentation/examples/datetime_timer/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# datetime_timer.fun — overview + +What it shows +- Measuring elapsed time and simple timers using datetime helpers. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/datetime_timer.fun +- Or: fun examples/datetime_timer.fun diff --git a/web/documentation/examples/echo_example.md b/web/documentation/examples/echo_example.md new file mode 100644 index 0000000..b4c4c9a --- /dev/null +++ b/web/documentation/examples/echo_example.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - echo_example.fun — overview +subtitle: Documentation for echo_example.fun — overview +description: Documentation for echo_example.fun — overview +permalink: /documentation/examples/echo_example/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# echo_example.fun — overview + +What it shows +- Simple echo of input/args; prints back what you type or pass as arguments. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/echo_example.fun hello world +- Or: fun examples/echo_example.fun hello world diff --git a/web/documentation/examples/env_all.md b/web/documentation/examples/env_all.md new file mode 100644 index 0000000..7cafdcc --- /dev/null +++ b/web/documentation/examples/env_all.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - env_all.fun — overview +subtitle: Documentation for env_all.fun — overview +description: Documentation for env_all.fun — overview +permalink: /documentation/examples/env_all/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# env_all.fun — overview + +What it shows +- Reading and listing environment variables. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/env_all.fun +- Or: fun examples/env_all.fun diff --git a/web/documentation/examples/error_handling.md b/web/documentation/examples/error_handling.md new file mode 100644 index 0000000..2113ba0 --- /dev/null +++ b/web/documentation/examples/error_handling.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - error_handling.fun — overview +subtitle: Documentation for error_handling.fun — overview +description: Documentation for error_handling.fun — overview +permalink: /documentation/examples/error_handling/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# error_handling.fun — overview + +What it shows +- Error patterns and handling strategies using try/catch/finally. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/error_handling.fun +- Or: fun examples/error_handling.fun diff --git a/web/documentation/examples/expressions_test.md b/web/documentation/examples/expressions_test.md new file mode 100644 index 0000000..6dfc1c2 --- /dev/null +++ b/web/documentation/examples/expressions_test.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - expressions_test.fun — overview +subtitle: Documentation for expressions_test.fun — overview +description: Documentation for expressions_test.fun — overview +permalink: /documentation/examples/expressions_test/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# expressions_test.fun — overview + +What it shows +- Operator precedence and expression grouping tests/demonstrations. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/expressions_test.fun +- Or: fun examples/expressions_test.fun diff --git a/web/documentation/examples/features.md b/web/documentation/examples/features.md new file mode 100644 index 0000000..4acec72 --- /dev/null +++ b/web/documentation/examples/features.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - features.fun — overview +subtitle: Documentation for features.fun — overview +description: Documentation for features.fun — overview +permalink: /documentation/examples/features/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# features.fun — overview + +What it shows +- Grab bag of language features in a single script. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/features.fun +- Or: fun examples/features.fun diff --git a/web/documentation/examples/file_print_for_file_line_by_line.md b/web/documentation/examples/file_print_for_file_line_by_line.md new file mode 100644 index 0000000..846cc91 --- /dev/null +++ b/web/documentation/examples/file_print_for_file_line_by_line.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - file_print_for_file_line_by_line.fun — overview +subtitle: Documentation for file_print_for_file_line_by_line.fun — overview +description: Documentation for file_print_for_file_line_by_line.fun — overview +permalink: /documentation/examples/file_print_for_file_line_by_line/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# file_print_for_file_line_by_line.fun — overview + +What it shows +- Iterate a file line-by-line and print each line; basic file IO idioms. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/file_print_for_file_line_by_line.fun path/to/file.txt +- Or: fun examples/file_print_for_file_line_by_line.fun path/to/file.txt diff --git a/web/documentation/examples/floats.md b/web/documentation/examples/floats.md new file mode 100644 index 0000000..f0bce67 --- /dev/null +++ b/web/documentation/examples/floats.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - floats.fun — overview +subtitle: Documentation for floats.fun — overview +description: Documentation for floats.fun — overview +permalink: /documentation/examples/floats/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# floats.fun — overview + +What it shows +- Floating point operations and formatting details. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/floats.fun +- Or: fun examples/floats.fun diff --git a/web/documentation/examples/for_range_test.md b/web/documentation/examples/for_range_test.md new file mode 100644 index 0000000..c8b9d0e --- /dev/null +++ b/web/documentation/examples/for_range_test.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - for_range_test.fun — overview +subtitle: Documentation for for_range_test.fun — overview +description: Documentation for for_range_test.fun — overview +permalink: /documentation/examples/for_range_test/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# for_range_test.fun — overview + +What it shows +- Ranges and loops; iterating numeric ranges and verifying bounds. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/for_range_test.fun +- Or: fun examples/for_range_test.fun diff --git a/web/documentation/examples/functions_test.md b/web/documentation/examples/functions_test.md new file mode 100644 index 0000000..4c54b0c --- /dev/null +++ b/web/documentation/examples/functions_test.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - functions_test.fun — overview +subtitle: Documentation for functions_test.fun — overview +description: Documentation for functions_test.fun — overview +permalink: /documentation/examples/functions_test/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# functions_test.fun — overview + +What it shows +- Functions, closures, and return behavior; call semantics basics. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/functions_test.fun +- Or: fun examples/functions_test.fun diff --git a/web/documentation/examples/have_fun.md b/web/documentation/examples/have_fun.md new file mode 100644 index 0000000..6cbe72f --- /dev/null +++ b/web/documentation/examples/have_fun.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - have_fun.fun — overview +subtitle: Documentation for have_fun.fun — overview +description: Documentation for have_fun.fun — overview +permalink: /documentation/examples/have_fun/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# have_fun.fun — overview + +What it shows +- Playful demo showing off small language tricks. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/have_fun.fun +- Or: fun examples/have_fun.fun diff --git a/web/documentation/examples/have_fun_function.md b/web/documentation/examples/have_fun_function.md new file mode 100644 index 0000000..ca84216 --- /dev/null +++ b/web/documentation/examples/have_fun_function.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - have_fun_function.fun — overview +subtitle: Documentation for have_fun_function.fun — overview +description: Documentation for have_fun_function.fun — overview +permalink: /documentation/examples/have_fun_function/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# have_fun_function.fun — overview + +What it shows +- A playful function-centric demo; small utility behaviors. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/have_fun_function.fun +- Or: fun examples/have_fun_function.fun diff --git a/web/documentation/examples/hex_example.md b/web/documentation/examples/hex_example.md new file mode 100644 index 0000000..e53c956 --- /dev/null +++ b/web/documentation/examples/hex_example.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - hex_example.fun — overview +subtitle: Documentation for hex_example.fun — overview +description: Documentation for hex_example.fun — overview +permalink: /documentation/examples/hex_example/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# hex_example.fun — overview + +What it shows +- Hex encode/decode helpers; working with hexadecimal representations. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/hex_example.fun +- Or: fun examples/hex_example.fun diff --git a/web/documentation/examples/if_else_test.md b/web/documentation/examples/if_else_test.md new file mode 100644 index 0000000..14de09a --- /dev/null +++ b/web/documentation/examples/if_else_test.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - if_else_test.fun — overview +subtitle: Documentation for if_else_test.fun — overview +description: Documentation for if_else_test.fun — overview +permalink: /documentation/examples/if_else_test/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# if_else_test.fun — overview + +What it shows +- Control flow with if/else; branching and comparisons. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/if_else_test.fun +- Or: fun examples/if_else_test.fun diff --git a/web/documentation/examples/include_lib.md b/web/documentation/examples/include_lib.md new file mode 100644 index 0000000..2ab6ecc --- /dev/null +++ b/web/documentation/examples/include_lib.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - include_lib.fun — overview +subtitle: Documentation for include_lib.fun — overview +description: Documentation for include_lib.fun — overview +permalink: /documentation/examples/include_lib/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# include_lib.fun — overview + +What it shows +- Including modules from the standard library path using #include <...>. + +How to run +- export FUN_LIB_DIR="./lib" # ensure stdlib is discoverable +- ./build_debug/fun examples/include_lib.fun +- Or: fun examples/include_lib.fun diff --git a/web/documentation/examples/include_local.md b/web/documentation/examples/include_local.md new file mode 100644 index 0000000..34bd98a --- /dev/null +++ b/web/documentation/examples/include_local.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - include_local.fun — overview +subtitle: Documentation for include_local.fun — overview +description: Documentation for include_local.fun — overview +permalink: /documentation/examples/include_local/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# include_local.fun — overview + +What it shows +- Including local files relative to the script and reusing helpers. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/include_local.fun +- Or: fun examples/include_local.fun diff --git a/web/documentation/examples/include_local_util.md b/web/documentation/examples/include_local_util.md new file mode 100644 index 0000000..17f2f39 --- /dev/null +++ b/web/documentation/examples/include_local_util.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - include_local_util.fun — overview +subtitle: Documentation for include_local_util.fun — overview +description: Documentation for include_local_util.fun — overview +permalink: /documentation/examples/include_local_util/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# include_local_util.fun — overview + +What it shows +- Local include mechanics with a small utility module. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/include_local_util.fun +- Or: fun examples/include_local_util.fun diff --git a/web/documentation/examples/inheritance_demo.md b/web/documentation/examples/inheritance_demo.md new file mode 100644 index 0000000..8e7542c --- /dev/null +++ b/web/documentation/examples/inheritance_demo.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - inheritance_demo.fun — overview +subtitle: Documentation for inheritance_demo.fun — overview +description: Documentation for inheritance_demo.fun — overview +permalink: /documentation/examples/inheritance_demo/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# inheritance_demo.fun — overview + +What it shows +- Simple class inheritance and method overriding examples. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/inheritance_demo.fun +- Or: fun examples/inheritance_demo.fun diff --git a/web/documentation/examples/loops_break_continue.md b/web/documentation/examples/loops_break_continue.md new file mode 100644 index 0000000..4bb542d --- /dev/null +++ b/web/documentation/examples/loops_break_continue.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - loops_break_continue.fun — overview +subtitle: Documentation for loops_break_continue.fun — overview +description: Documentation for loops_break_continue.fun — overview +permalink: /documentation/examples/loops_break_continue/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# loops_break_continue.fun — overview + +What it shows +- Loop control: break and continue; demonstrating control flow within loops. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/loops_break_continue.fun +- Or: fun examples/loops_break_continue.fun diff --git a/web/documentation/examples/maps.md b/web/documentation/examples/maps.md new file mode 100644 index 0000000..4489320 --- /dev/null +++ b/web/documentation/examples/maps.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - maps.fun — overview +subtitle: Working with maps, construction, lookup/update, merging, iteration, and common patterns. +description: Working with maps, construction, lookup/update, merging, iteration, and common patterns. +permalink: /documentation/examples/maps/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# maps.fun — overview + +What it shows +- Working with maps: creation, indexing, iteration, and typical idioms. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/maps.fun +- Or: fun examples/maps.fun diff --git a/web/documentation/examples/match.md b/web/documentation/examples/match.md new file mode 100644 index 0000000..4001803 --- /dev/null +++ b/web/documentation/examples/match.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - match.fun — overview +subtitle: Documentation for match.fun — overview +description: Documentation for match.fun — overview +permalink: /documentation/examples/match/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# match.fun — overview + +What it shows +- Pattern matching constructs and examples of branching by value/shape. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/match.fun +- Or: fun examples/match.fun diff --git a/web/documentation/examples/namespaced_mod.md b/web/documentation/examples/namespaced_mod.md new file mode 100644 index 0000000..94a97a1 --- /dev/null +++ b/web/documentation/examples/namespaced_mod.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - namespaced_mod.fun — overview +subtitle: Documentation for namespaced_mod.fun — overview +description: Documentation for namespaced_mod.fun — overview +permalink: /documentation/examples/namespaced_mod/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# namespaced_mod.fun — overview + +What it shows +- Namespaced includes and using the "as" aliasing pattern for modules. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/namespaced_mod.fun +- Or: fun examples/namespaced_mod.fun diff --git a/web/documentation/examples/nested_loops.md b/web/documentation/examples/nested_loops.md new file mode 100644 index 0000000..58a5f11 --- /dev/null +++ b/web/documentation/examples/nested_loops.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - nested_loops.fun — overview +subtitle: Documentation for nested_loops.fun — overview +description: Documentation for nested_loops.fun — overview +permalink: /documentation/examples/nested_loops/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# nested_loops.fun — overview + +What it shows +- Control flow with nested loops; inner/outer loop coordination. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/nested_loops.fun +- Or: fun examples/nested_loops.fun diff --git a/docs/examples/net/http_mt_server.md b/web/documentation/examples/net/http_mt_server.md similarity index 53% rename from docs/examples/net/http_mt_server.md rename to web/documentation/examples/net/http_mt_server.md index c038f2a..1fae357 100644 --- a/docs/examples/net/http_mt_server.md +++ b/web/documentation/examples/net/http_mt_server.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - http_mt_server.fun +subtitle: Documentation for http_mt_server.fun +description: Documentation for http_mt_server.fun +permalink: /documentation/examples/net/http_mt_server/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # http_mt_server.fun - Location: examples/net/http_mt_server.fun @@ -16,5 +42,5 @@ Requirements - Uses stdlib io/socket.fun and io/thread.fun. No external extensions required. See also -- docs/examples/README.md -- docs/examples/httpserver.md (deep-dive) +- documentation/examples/README.md +- documentation/examples/httpserver.md (deep-dive) diff --git a/docs/examples/net/http_mt_server_cgi.md b/web/documentation/examples/net/http_mt_server_cgi.md similarity index 59% rename from docs/examples/net/http_mt_server_cgi.md rename to web/documentation/examples/net/http_mt_server_cgi.md index 78298cb..dcd2955 100644 --- a/docs/examples/net/http_mt_server_cgi.md +++ b/web/documentation/examples/net/http_mt_server_cgi.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - http_mt_server_cgi.fun +subtitle: Documentation for http_mt_server_cgi.fun +description: Documentation for http_mt_server_cgi.fun +permalink: /documentation/examples/net/http_mt_server_cgi/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # http_mt_server_cgi.fun - Location: examples/net/http_mt_server_cgi.fun @@ -18,5 +44,5 @@ Requirements - Uses stdlib io/socket.fun, io/thread.fun, and net/cgi.fun. No external extensions required. See also -- docs/examples/README.md -- docs/examples/httpserver.md (deep-dive) +- documentation/examples/README.md +- documentation/examples/httpserver.md (deep-dive) diff --git a/docs/examples/net/http_server.md b/web/documentation/examples/net/http_server.md similarity index 56% rename from docs/examples/net/http_server.md rename to web/documentation/examples/net/http_server.md index bc97233..c918d17 100644 --- a/docs/examples/net/http_server.md +++ b/web/documentation/examples/net/http_server.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - http_server.fun +subtitle: Documentation for http_server.fun +description: Documentation for http_server.fun +permalink: /documentation/examples/net/http_server/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # http_server.fun - Location: examples/net/http_server.fun @@ -20,5 +46,5 @@ Requirements - Uses io/socket.fun and strings.fun; no external extensions required. See also -- docs/examples/README.md -- docs/examples/httpserver.md (deep-dive) +- documentation/examples/README.md +- documentation/examples/httpserver.md (deep-dive) diff --git a/docs/examples/net/http_server_cgi.md b/web/documentation/examples/net/http_server_cgi.md similarity index 58% rename from docs/examples/net/http_server_cgi.md rename to web/documentation/examples/net/http_server_cgi.md index caaa5ed..59fb059 100644 --- a/docs/examples/net/http_server_cgi.md +++ b/web/documentation/examples/net/http_server_cgi.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - http_server_cgi.fun +subtitle: Documentation for http_server_cgi.fun +description: Documentation for http_server_cgi.fun +permalink: /documentation/examples/net/http_server_cgi/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # http_server_cgi.fun - Location: examples/net/http_server_cgi.fun @@ -18,5 +44,5 @@ Requirements - Uses stdlib io/socket.fun, strings.fun, and net/cgi.fun. No external extensions required. See also -- docs/examples/README.md -- docs/examples/httpserver.md (deep-dive) +- documentation/examples/README.md +- documentation/examples/httpserver.md (deep-dive) diff --git a/docs/examples/net/http_server_cgi_lib.md b/web/documentation/examples/net/http_server_cgi_lib.md similarity index 58% rename from docs/examples/net/http_server_cgi_lib.md rename to web/documentation/examples/net/http_server_cgi_lib.md index 0b0dbca..98dff41 100644 --- a/docs/examples/net/http_server_cgi_lib.md +++ b/web/documentation/examples/net/http_server_cgi_lib.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - http_server_cgi_lib.fun +subtitle: Documentation for http_server_cgi_lib.fun +description: Documentation for http_server_cgi_lib.fun +permalink: /documentation/examples/net/http_server_cgi_lib/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # http_server_cgi_lib.fun - Location: examples/net/http_server_cgi_lib.fun @@ -18,5 +44,5 @@ Requirements - Uses stdlib io/socket.fun, strings.fun, net/cgi.fun. No external extensions required. See also -- docs/examples/README.md -- docs/examples/httpserver.md (deep-dive) +- documentation/examples/README.md +- documentation/examples/httpserver.md (deep-dive) diff --git a/web/documentation/examples/net/http_static_server.md b/web/documentation/examples/net/http_static_server.md new file mode 100644 index 0000000..3856537 --- /dev/null +++ b/web/documentation/examples/net/http_static_server.md @@ -0,0 +1,46 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - http_static_server.fun +subtitle: Documentation for http_static_server.fun +description: Documentation for http_static_server.fun +permalink: /documentation/examples/net/http_static_server/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# http_static_server.fun + +- Location: examples/net/http_static_server.fun +- Category: Networking / Sockets + +Description +- Minimal static HTTP server implemented directly on sockets. Accepts connections and always returns a small HTML page. + +How to run +- From the repository root: + - export FUN_LIB_DIR="./lib" + - ./build_debug/fun examples/net/http_static_server.fun + - Then open http://127.0.0.1:8088/ + +Requirements +- Uses core IO/socket stdlib (io/socket.fun). No optional extensions required. + +See also +- documentation/examples/README.md +- documentation/examples/httpserver.md (deep-dive over HTTP servers) diff --git a/docs/examples/net/httpserver.md b/web/documentation/examples/net/httpserver.md similarity index 94% rename from docs/examples/net/httpserver.md rename to web/documentation/examples/net/httpserver.md index cd4202e..3750815 100644 --- a/docs/examples/net/httpserver.md +++ b/web/documentation/examples/net/httpserver.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - HTTP server examples: architecture and how they work +subtitle: Documentation for HTTP server examples, architecture and how they work +description: Documentation for HTTP server examples, architecture and how they work +permalink: /documentation/examples/net/httpserver/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # HTTP server examples: architecture and how they work This guide explains the HTTP server examples under `./examples/net/http_*` and the supporting standard library modules under `./lib/net/`. @@ -21,7 +47,7 @@ It covers what each example does, how to run it, and how the request handling/CG - `net/http_cgi_lib_server.fun` — Variant of the CGI server with the same core behavior, explicitly wiring the Fun interpreter path and using `CGI().cgi_to_http_response()` from `net/cgi.fun`. - `net/cgi.fun` — Helpers to work with CGI-style programs and to translate CGI output (headers + body) into full HTTP/1.1 responses. -See docs/stdlib.md → net/ for a quick index of these modules. +See documentation/stdlib.md → net/ for a quick index of these modules. ## Example: http_static_server.fun - File: `examples/net/http_static_server.fun` diff --git a/web/documentation/examples/objects_basic.md b/web/documentation/examples/objects_basic.md new file mode 100644 index 0000000..c333f60 --- /dev/null +++ b/web/documentation/examples/objects_basic.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - objects_basic.fun — overview +subtitle: Documentation for objects_basic.fun — overview +description: Documentation for objects_basic.fun — overview +permalink: /documentation/examples/objects_basic/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# objects_basic.fun — overview + +What it shows +- OO basics: defining objects, fields, and invoking methods. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/objects_basic.fun +- Or: fun examples/objects_basic.fun diff --git a/web/documentation/examples/objects_more.md b/web/documentation/examples/objects_more.md new file mode 100644 index 0000000..43ac619 --- /dev/null +++ b/web/documentation/examples/objects_more.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - objects_more.fun — overview +subtitle: Documentation for objects_more.fun — overview +description: Documentation for objects_more.fun — overview +permalink: /documentation/examples/objects_more/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# objects_more.fun — overview + +What it shows +- Additional object patterns: composition, methods, and utilities. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/objects_more.fun +- Or: fun examples/objects_more.fun diff --git a/web/documentation/examples/os_env.md b/web/documentation/examples/os_env.md new file mode 100644 index 0000000..978db8c --- /dev/null +++ b/web/documentation/examples/os_env.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - os_env.fun — overview +subtitle: Documentation for os_env.fun — overview +description: Documentation for os_env.fun — overview +permalink: /documentation/examples/os_env/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# os_env.fun — overview + +What it shows +- Reading and writing environment variables from the operating system. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/os_env.fun +- Or: fun examples/os_env.fun diff --git a/web/documentation/examples/process_example.md b/web/documentation/examples/process_example.md new file mode 100644 index 0000000..d266391 --- /dev/null +++ b/web/documentation/examples/process_example.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - process_example.fun — overview +subtitle: Documentation for process_example.fun — overview +description: Documentation for process_example.fun — overview +permalink: /documentation/examples/process_example/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# process_example.fun — overview + +What it shows +- Spawning and capturing subprocess output; simple process management. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/process_example.fun +- Or: fun examples/process_example.fun diff --git a/web/documentation/examples/progress.md b/web/documentation/examples/progress.md new file mode 100644 index 0000000..4cc0bdb --- /dev/null +++ b/web/documentation/examples/progress.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - progress.fun — overview +subtitle: Documentation for progress.fun — overview +description: Documentation for progress.fun — overview +permalink: /documentation/examples/progress/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# progress.fun — overview + +What it shows +- Simple progress display in the terminal. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/progress.fun +- Or: fun examples/progress.fun diff --git a/web/documentation/examples/progress_inline.md b/web/documentation/examples/progress_inline.md new file mode 100644 index 0000000..2eb3791 --- /dev/null +++ b/web/documentation/examples/progress_inline.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - progress_inline.fun — overview +subtitle: Documentation for progress_inline.fun — overview +description: Documentation for progress_inline.fun — overview +permalink: /documentation/examples/progress_inline/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# progress_inline.fun — overview + +What it shows +- Inline progress updates (same line updates) for simple terminal UIs. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/progress_inline.fun +- Or: fun examples/progress_inline.fun diff --git a/web/documentation/examples/random_demo.md b/web/documentation/examples/random_demo.md new file mode 100644 index 0000000..e8d3bf1 --- /dev/null +++ b/web/documentation/examples/random_demo.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - random_demo.fun — overview +subtitle: Documentation for random_demo.fun — overview +description: Documentation for random_demo.fun — overview +permalink: /documentation/examples/random_demo/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# random_demo.fun — overview + +What it shows +- Random number generator usage and seeding basics. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/random_demo.fun +- Or: fun examples/random_demo.fun diff --git a/web/documentation/examples/random_number_example.md b/web/documentation/examples/random_number_example.md new file mode 100644 index 0000000..984276e --- /dev/null +++ b/web/documentation/examples/random_number_example.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - random_number_example.fun — overview +subtitle: Documentation for random_number_example.fun — overview +description: Documentation for random_number_example.fun — overview +permalink: /documentation/examples/random_number_example/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# random_number_example.fun — overview + +What it shows +- Generating random numbers and printing them; small utility demo. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/random_number_example.fun +- Or: fun examples/random_number_example.fun diff --git a/web/documentation/examples/regex_demo.md b/web/documentation/examples/regex_demo.md new file mode 100644 index 0000000..5782c77 --- /dev/null +++ b/web/documentation/examples/regex_demo.md @@ -0,0 +1,38 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - regex_demo.fun — overview +subtitle: Documentation for regex_demo.fun — overview +description: Documentation for regex_demo.fun — overview +permalink: /documentation/examples/regex_demo/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# regex_demo.fun — overview + +What it shows +- Regex helpers usage; simple matching and replacement tasks. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/regex_demo.fun +- Or: fun examples/regex_demo.fun + +Notes +- Some regex examples depend on the optional PCRE2 extension; enable it in your build to run. diff --git a/web/documentation/examples/regex_procedural.md b/web/documentation/examples/regex_procedural.md new file mode 100644 index 0000000..48a6407 --- /dev/null +++ b/web/documentation/examples/regex_procedural.md @@ -0,0 +1,38 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - regex_procedural.fun — overview +subtitle: Documentation for regex_procedural.fun — overview +description: Documentation for regex_procedural.fun — overview +permalink: /documentation/examples/regex_procedural/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# regex_procedural.fun — overview + +What it shows +- Procedural approach to regex work: compiling patterns and iterating matches. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/regex_procedural.fun +- Or: fun examples/regex_procedural.fun + +Notes +- May require the optional PCRE2 extension in your build. diff --git a/web/documentation/examples/rust_hello.md b/web/documentation/examples/rust_hello.md new file mode 100644 index 0000000..3614083 --- /dev/null +++ b/web/documentation/examples/rust_hello.md @@ -0,0 +1,38 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - rust_hello.fun — overview +subtitle: Documentation for rust_hello.fun — overview +description: Documentation for rust_hello.fun — overview +permalink: /documentation/examples/rust_hello/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# rust_hello.fun — overview + +What it shows +- Using Rust opcodes from Fun (when built with Rust support). + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/rust_hello.fun +- Or: fun examples/rust_hello.fun + +Notes +- Requires building with FUN_WITH_RUST; otherwise this example will be unavailable. diff --git a/web/documentation/examples/rust_hello_args.md b/web/documentation/examples/rust_hello_args.md new file mode 100644 index 0000000..15e4c08 --- /dev/null +++ b/web/documentation/examples/rust_hello_args.md @@ -0,0 +1,38 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - rust_hello_args.fun — overview +subtitle: Documentation for rust_hello_args.fun — overview +description: Documentation for rust_hello_args.fun — overview +permalink: /documentation/examples/rust_hello_args/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# rust_hello_args.fun — overview + +What it shows +- Passing arguments into Rust-backed opcodes and handling returns. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/rust_hello_args.fun +- Or: fun examples/rust_hello_args.fun + +Notes +- Requires building with FUN_WITH_RUST. diff --git a/web/documentation/examples/rust_hello_args_return.md b/web/documentation/examples/rust_hello_args_return.md new file mode 100644 index 0000000..d4f328a --- /dev/null +++ b/web/documentation/examples/rust_hello_args_return.md @@ -0,0 +1,38 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - rust_hello_args_return.fun — overview +subtitle: Documentation for rust_hello_args_return.fun — overview +description: Documentation for rust_hello_args_return.fun — overview +permalink: /documentation/examples/rust_hello_args_return/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# rust_hello_args_return.fun — overview + +What it shows +- Demonstrates returning values from Rust-backed opcodes with arguments. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/rust_hello_args_return.fun +- Or: fun examples/rust_hello_args_return.fun + +Notes +- Requires building with FUN_WITH_RUST. diff --git a/web/documentation/examples/serial_demo.md b/web/documentation/examples/serial_demo.md new file mode 100644 index 0000000..35ac56a --- /dev/null +++ b/web/documentation/examples/serial_demo.md @@ -0,0 +1,38 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - serial_demo.fun — overview +subtitle: Documentation for serial_demo.fun — overview +description: Documentation for serial_demo.fun — overview +permalink: /documentation/examples/serial_demo/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# serial_demo.fun — overview + +What it shows +- Serial port access and basic read/write (when available on your system). + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/serial_demo.fun +- Or: fun examples/serial_demo.fun + +Notes +- Requires serial device access; may depend on platform support and permissions. diff --git a/web/documentation/examples/short_circuit_test.md b/web/documentation/examples/short_circuit_test.md new file mode 100644 index 0000000..7a64125 --- /dev/null +++ b/web/documentation/examples/short_circuit_test.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - short_circuit_test.fun — overview +subtitle: Documentation for short_circuit_test.fun — overview +description: Documentation for short_circuit_test.fun — overview +permalink: /documentation/examples/short_circuit_test/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# short_circuit_test.fun — overview + +What it shows +- Boolean evaluation order and short-circuit behavior with && and ||. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/short_circuit_test.fun +- Or: fun examples/short_circuit_test.fun diff --git a/web/documentation/examples/signed_ints.md b/web/documentation/examples/signed_ints.md new file mode 100644 index 0000000..c6bd397 --- /dev/null +++ b/web/documentation/examples/signed_ints.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - signed_ints.fun — overview +subtitle: Documentation for signed_ints.fun — overview +description: Documentation for signed_ints.fun — overview +permalink: /documentation/examples/signed_ints/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# signed_ints.fun — overview + +What it shows +- Signed integer types and operations; ranges and conversions. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/signed_ints.fun +- Or: fun examples/signed_ints.fun diff --git a/web/documentation/examples/stdlib_showcase.md b/web/documentation/examples/stdlib_showcase.md new file mode 100644 index 0000000..0485483 --- /dev/null +++ b/web/documentation/examples/stdlib_showcase.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - stdlib_showcase.fun — overview +subtitle: Documentation for stdlib_showcase.fun — overview +description: Documentation for stdlib_showcase.fun — overview +permalink: /documentation/examples/stdlib_showcase/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# stdlib_showcase.fun — overview + +What it shows +- Sampler of common standard library modules and utilities. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/stdlib_showcase.fun +- Or: fun examples/stdlib_showcase.fun diff --git a/web/documentation/examples/strings_test.md b/web/documentation/examples/strings_test.md new file mode 100644 index 0000000..4a2ae92 --- /dev/null +++ b/web/documentation/examples/strings_test.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - strings_test.fun — overview +subtitle: Documentation for strings_test.fun — overview +description: Documentation for strings_test.fun — overview +permalink: /documentation/examples/strings_test/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# strings_test.fun — overview + +What it shows +- String helpers and edge cases; splitting, joining, trimming, and formatting. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/strings_test.fun +- Or: fun examples/strings_test.fun diff --git a/web/documentation/examples/tcp_http_get.md b/web/documentation/examples/tcp_http_get.md new file mode 100644 index 0000000..fd0309b --- /dev/null +++ b/web/documentation/examples/tcp_http_get.md @@ -0,0 +1,38 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - tcp_http_get.fun — overview +subtitle: Documentation for tcp_http_get.fun — overview +description: Documentation for tcp_http_get.fun — overview +permalink: /documentation/examples/tcp_http_get/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# tcp_http_get.fun — overview + +What it shows +- Manual HTTP client over raw TCP sockets: connect, write request, read response. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/tcp_http_get.fun +- Or: fun examples/tcp_http_get.fun + +Notes +- Requires network access to the target host used in the script. diff --git a/web/documentation/examples/tcp_http_get_class.md b/web/documentation/examples/tcp_http_get_class.md new file mode 100644 index 0000000..bad4aef --- /dev/null +++ b/web/documentation/examples/tcp_http_get_class.md @@ -0,0 +1,38 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - tcp_http_get_class.fun — overview +subtitle: Documentation for tcp_http_get_class.fun — overview +description: Documentation for tcp_http_get_class.fun — overview +permalink: /documentation/examples/tcp_http_get_class/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# tcp_http_get_class.fun — overview + +What it shows +- Manual HTTP client implemented with a small helper class over sockets. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/tcp_http_get_class.fun +- Or: fun examples/tcp_http_get_class.fun + +Notes +- Requires network access to the target host used in the script. diff --git a/web/documentation/examples/test_bits.md b/web/documentation/examples/test_bits.md new file mode 100644 index 0000000..22a56b4 --- /dev/null +++ b/web/documentation/examples/test_bits.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - test_bits.fun — overview +subtitle: Documentation for test_bits.fun — overview +description: Documentation for test_bits.fun — overview +permalink: /documentation/examples/test_bits/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# test_bits.fun — overview + +What it shows +- Bitwise utilities demonstration (and/or/xor/shifts) and small tests. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/test_bits.fun +- Or: fun examples/test_bits.fun diff --git a/web/documentation/examples/test_dec_to_hex.md b/web/documentation/examples/test_dec_to_hex.md new file mode 100644 index 0000000..1adb588 --- /dev/null +++ b/web/documentation/examples/test_dec_to_hex.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - test_dec_to_hex.fun — overview +subtitle: Documentation for test_dec_to_hex.fun — overview +description: Documentation for test_dec_to_hex.fun — overview +permalink: /documentation/examples/test_dec_to_hex/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# test_dec_to_hex.fun — overview + +What it shows +- Decimal to hexadecimal conversion helper/tests. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/test_dec_to_hex.fun +- Or: fun examples/test_dec_to_hex.fun diff --git a/web/documentation/examples/test_hex_to_dec.md b/web/documentation/examples/test_hex_to_dec.md new file mode 100644 index 0000000..256babe --- /dev/null +++ b/web/documentation/examples/test_hex_to_dec.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - test_hex_to_dec.fun — overview +subtitle: Documentation for test_hex_to_dec.fun — overview +description: Documentation for test_hex_to_dec.fun — overview +permalink: /documentation/examples/test_hex_to_dec/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# test_hex_to_dec.fun — overview + +What it shows +- Hexadecimal to decimal conversion helper/tests. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/test_hex_to_dec.fun +- Or: fun examples/test_hex_to_dec.fun diff --git a/web/documentation/examples/test_include.md b/web/documentation/examples/test_include.md new file mode 100644 index 0000000..9758d0f --- /dev/null +++ b/web/documentation/examples/test_include.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - test_include.fun — overview +subtitle: Documentation for test_include.fun — overview +description: Documentation for test_include.fun — overview +permalink: /documentation/examples/test_include/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# test_include.fun — overview + +What it shows +- Small include mechanics test; ensures local and stdlib includes work. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/test_include.fun +- Or: fun examples/test_include.fun diff --git a/web/documentation/examples/test_rol.md b/web/documentation/examples/test_rol.md new file mode 100644 index 0000000..fab84ad --- /dev/null +++ b/web/documentation/examples/test_rol.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - test_rol.fun — overview +subtitle: Documentation for test_rol.fun — overview +description: Documentation for test_rol.fun — overview +permalink: /documentation/examples/test_rol/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# test_rol.fun — overview + +What it shows +- Bit rotation (ROL) helper/tests. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/test_rol.fun +- Or: fun examples/test_rol.fun diff --git a/web/documentation/examples/test_serial.md b/web/documentation/examples/test_serial.md new file mode 100644 index 0000000..b1c842a --- /dev/null +++ b/web/documentation/examples/test_serial.md @@ -0,0 +1,38 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - test_serial.fun — overview +subtitle: Documentation for test_serial.fun — overview +description: Documentation for test_serial.fun — overview +permalink: /documentation/examples/test_serial/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# test_serial.fun — overview + +What it shows +- Serial port test; opens a port and exchanges a few bytes (when available). + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/test_serial.fun +- Or: fun examples/test_serial.fun + +Notes +- Requires serial device access; may depend on platform support and permissions. diff --git a/web/documentation/examples/test_shl.md b/web/documentation/examples/test_shl.md new file mode 100644 index 0000000..1b41dbe --- /dev/null +++ b/web/documentation/examples/test_shl.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - test_shl.fun — overview +subtitle: Documentation for test_shl.fun — overview +description: Documentation for test_shl.fun — overview +permalink: /documentation/examples/test_shl/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# test_shl.fun — overview + +What it shows +- Bit shift left (SHL) helper/tests. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/test_shl.fun +- Or: fun examples/test_shl.fun diff --git a/web/documentation/examples/test_types.md b/web/documentation/examples/test_types.md new file mode 100644 index 0000000..7581bbc --- /dev/null +++ b/web/documentation/examples/test_types.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - test_types.fun — overview +subtitle: Documentation for test_types.fun — overview +description: Documentation for test_types.fun — overview +permalink: /documentation/examples/test_types/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# test_types.fun — overview + +What it shows +- Type checks and simple assertions around type behavior. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/test_types.fun +- Or: fun examples/test_types.fun diff --git a/web/documentation/examples/test_xor.md b/web/documentation/examples/test_xor.md new file mode 100644 index 0000000..4f98a7e --- /dev/null +++ b/web/documentation/examples/test_xor.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - test_xor.fun — overview +subtitle: Documentation for test_xor.fun — overview +description: Documentation for test_xor.fun — overview +permalink: /documentation/examples/test_xor/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# test_xor.fun — overview + +What it shows +- Bitwise XOR helper/tests. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/test_xor.fun +- Or: fun examples/test_xor.fun diff --git a/web/documentation/examples/thread_class_example.md b/web/documentation/examples/thread_class_example.md new file mode 100644 index 0000000..4c89783 --- /dev/null +++ b/web/documentation/examples/thread_class_example.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - thread_class_example.fun — overview +subtitle: Documentation for thread_class_example.fun — overview +description: Documentation for thread_class_example.fun — overview +permalink: /documentation/examples/thread_class_example/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# thread_class_example.fun — overview + +What it shows +- Threading building blocks using a small thread class; start/join patterns. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/thread_class_example.fun +- Or: fun examples/thread_class_example.fun diff --git a/web/documentation/examples/threads_demo.md b/web/documentation/examples/threads_demo.md new file mode 100644 index 0000000..d91d9e4 --- /dev/null +++ b/web/documentation/examples/threads_demo.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - threads_demo.fun — overview +subtitle: Documentation for threads_demo.fun — overview +description: Documentation for threads_demo.fun — overview +permalink: /documentation/examples/threads_demo/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# threads_demo.fun — overview + +What it shows +- Threading building blocks and concurrent execution demo. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/threads_demo.fun +- Or: fun examples/threads_demo.fun diff --git a/web/documentation/examples/try_catch_finally.md b/web/documentation/examples/try_catch_finally.md new file mode 100644 index 0000000..2f40a5f --- /dev/null +++ b/web/documentation/examples/try_catch_finally.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - try_catch_finally.fun — overview +subtitle: Documentation for try_catch_finally.fun — overview +description: Documentation for try_catch_finally.fun — overview +permalink: /documentation/examples/try_catch_finally/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# try_catch_finally.fun — overview + +What it shows +- Structured error handling with try/catch/finally blocks. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/try_catch_finally.fun +- Or: fun examples/try_catch_finally.fun diff --git a/web/documentation/examples/type_safety.md b/web/documentation/examples/type_safety.md new file mode 100644 index 0000000..c591ec7 --- /dev/null +++ b/web/documentation/examples/type_safety.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - type_safety.fun — overview +subtitle: Documentation for type_safety.fun — overview +description: Documentation for type_safety.fun — overview +permalink: /documentation/examples/type_safety/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# type_safety.fun — overview + +What it shows +- Static/dynamic type checks and enforcing type safety in small examples. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/type_safety.fun +- Or: fun examples/type_safety.fun diff --git a/web/documentation/examples/type_safety_fails.md b/web/documentation/examples/type_safety_fails.md new file mode 100644 index 0000000..6df438d --- /dev/null +++ b/web/documentation/examples/type_safety_fails.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - type_safety_fails.fun — overview +subtitle: Documentation for type_safety_fails.fun — overview +description: Documentation for type_safety_fails.fun — overview +permalink: /documentation/examples/type_safety_fails/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# type_safety_fails.fun — overview + +What it shows +- Examples that intentionally violate type expectations to illustrate safety checks. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/type_safety_fails.fun +- Or: fun examples/type_safety_fails.fun diff --git a/web/documentation/examples/typeof.md b/web/documentation/examples/typeof.md new file mode 100644 index 0000000..7e84ea0 --- /dev/null +++ b/web/documentation/examples/typeof.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - typeof.fun — overview +subtitle: Documentation for typeof.fun — overview +description: Documentation for typeof.fun — overview +permalink: /documentation/examples/typeof/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# typeof.fun — overview + +What it shows +- Type inspection using typeof and related helpers. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/typeof.fun +- Or: fun examples/typeof.fun diff --git a/web/documentation/examples/typeof_features.md b/web/documentation/examples/typeof_features.md new file mode 100644 index 0000000..ed913ae --- /dev/null +++ b/web/documentation/examples/typeof_features.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - typeof_features.fun — overview +subtitle: Documentation for typeof_features.fun — overview +description: Documentation for typeof_features.fun — overview +permalink: /documentation/examples/typeof_features/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# typeof_features.fun — overview + +What it shows +- A tour of typeof-related features and type introspection helpers. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/typeof_features.fun +- Or: fun examples/typeof_features.fun diff --git a/web/documentation/examples/types_integers.md b/web/documentation/examples/types_integers.md new file mode 100644 index 0000000..0fee65d --- /dev/null +++ b/web/documentation/examples/types_integers.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - types_integers.fun — overview +subtitle: Documentation for types_integers.fun — overview +description: Documentation for types_integers.fun — overview +permalink: /documentation/examples/types_integers/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# types_integers.fun — overview + +What it shows +- Integer type families, ranges, and basic operations. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/types_integers.fun +- Or: fun examples/types_integers.fun diff --git a/web/documentation/examples/types_overview.md b/web/documentation/examples/types_overview.md new file mode 100644 index 0000000..e721aee --- /dev/null +++ b/web/documentation/examples/types_overview.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - types_overview.fun — overview +subtitle: Documentation for types_overview.fun — overview +description: Documentation for types_overview.fun — overview +permalink: /documentation/examples/types_overview/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# types_overview.fun — overview + +What it shows +- Overview of language types with small examples. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/types_overview.fun +- Or: fun examples/types_overview.fun diff --git a/web/documentation/examples/uint_types.md b/web/documentation/examples/uint_types.md new file mode 100644 index 0000000..fb3bbbd --- /dev/null +++ b/web/documentation/examples/uint_types.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - uint_types.fun — overview +subtitle: Documentation for uint_types.fun — overview +description: Documentation for uint_types.fun — overview +permalink: /documentation/examples/uint_types/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# uint_types.fun — overview + +What it shows +- Unsigned integer types and operations; ranges and conversions. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/uint_types.fun +- Or: fun examples/uint_types.fun diff --git a/web/documentation/examples/unix_socket_echo.md b/web/documentation/examples/unix_socket_echo.md new file mode 100644 index 0000000..0a48faf --- /dev/null +++ b/web/documentation/examples/unix_socket_echo.md @@ -0,0 +1,38 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - unix_socket_echo.fun — overview +subtitle: Documentation for unix_socket_echo.fun — overview +description: Documentation for unix_socket_echo.fun — overview +permalink: /documentation/examples/unix_socket_echo/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# unix_socket_echo.fun — overview + +What it shows +- Local domain (UNIX) socket echo server/client demonstration. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/unix_socket_echo.fun +- Or: fun examples/unix_socket_echo.fun + +Notes +- Uses a UNIX domain socket path on the local filesystem; ensure you have permissions to create it. diff --git a/web/documentation/examples/version.md b/web/documentation/examples/version.md new file mode 100644 index 0000000..cd9fb56 --- /dev/null +++ b/web/documentation/examples/version.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - version.fun — overview +subtitle: Documentation for version.fun — overview +description: Documentation for version.fun — overview +permalink: /documentation/examples/version/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# version.fun — overview + +What it shows +- Prints VM and version info for the Fun interpreter/runtime. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/version.fun +- Or: fun examples/version.fun diff --git a/web/documentation/examples/while_test.md b/web/documentation/examples/while_test.md new file mode 100644 index 0000000..6e6fb01 --- /dev/null +++ b/web/documentation/examples/while_test.md @@ -0,0 +1,35 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - while_test.fun — overview +subtitle: Documentation for while_test.fun — overview +description: Documentation for while_test.fun — overview +permalink: /documentation/examples/while_test/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# while_test.fun — overview + +What it shows +- Simple while loop example; loop conditions and counters. + +How to run +- export FUN_LIB_DIR="./lib" +- ./build_debug/fun examples/while_test.fun +- Or: fun examples/while_test.fun diff --git a/web/documentation/external/README.md b/web/documentation/external/README.md new file mode 100644 index 0000000..55c34a9 --- /dev/null +++ b/web/documentation/external/README.md @@ -0,0 +1,49 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - External integrations (optional extensions) +subtitle: Catalog of all example scripts under ./examples/, what each area contains, how to run them, required env vars, and extension requirements. +description: Catalog of all example scripts under ./examples/, what each area contains, how to run them, required env vars, and extension requirements. +permalink: /documentation/external/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# External integrations (optional extensions) + +This section documents Fun's optional, build-time selectable extensions. Each page covers: +- How to enable the extension via CMake option (FUN_WITH_*) +- Build requirements and detection notes +- Available opcodes and/or helper functions +- Minimal usage examples and links to example scripts + +## Extensions: + +- [cURL (libcurl)](./curl/) +- [INI (iniparser)](./ini/) +- [JSON (json-c)](./json/) +- [libxml2 (XML)](./xml2/) +- [SQLite](./sqlite/) +- [PCRE2 (Perl-compatible regex)](./pcre2/) +- [PC/SC (Smart cards)](./pcsc/) +- [OpenSSL](./openssl/) + +## Notes: + +- These integrations are optional; the VM compiles without them. +- When disabled, related builtins usually return empty strings/neutral values rather than fail hard, mirroring existing optionality patterns. diff --git a/docs/external/curl.md b/web/documentation/external/curl.md similarity index 54% rename from docs/external/curl.md rename to web/documentation/external/curl.md index e76f875..4636d76 100644 --- a/docs/external/curl.md +++ b/web/documentation/external/curl.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - cURL (libcurl) extension (optional) +subtitle: Documentation for cURL (libcurl) extension (optional) +description: Documentation for cURL (libcurl) extension (optional) +permalink: /documentation/external/curl/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # cURL (libcurl) extension (optional) - CMake option: FUN_WITH_CURL=ON diff --git a/docs/external/ini.md b/web/documentation/external/ini.md similarity index 65% rename from docs/external/ini.md rename to web/documentation/external/ini.md index aeb5ac5..3376194 100644 --- a/docs/external/ini.md +++ b/web/documentation/external/ini.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - INI (iniparser) extension (optional) +subtitle: Documentation for INI (iniparser) extension (optional) +description: Documentation for INI (iniparser) extension (optional) +permalink: /documentation/external/ini/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # INI (iniparser) extension (optional) - CMake option: FUN_WITH_INI=ON diff --git a/docs/external/json.md b/web/documentation/external/json.md similarity index 56% rename from docs/external/json.md rename to web/documentation/external/json.md index 4456174..95262b7 100644 --- a/docs/external/json.md +++ b/web/documentation/external/json.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - JSON (json-c) extension (optional) +subtitle: Documentation for JSON (json-c) extension (optional) +description: Documentation for JSON (json-c) extension (optional) +permalink: /documentation/external/json/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # JSON (json-c) extension (optional) - CMake option: FUN_WITH_JSON=ON diff --git a/docs/external/openssl.md b/web/documentation/external/openssl.md similarity index 83% rename from docs/external/openssl.md rename to web/documentation/external/openssl.md index f56a3ce..4a1d6c7 100644 --- a/docs/external/openssl.md +++ b/web/documentation/external/openssl.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - OpenSSL extension (optional) +subtitle: Documentation for OpenSSL extension (optional) +description: Documentation for OpenSSL extension (optional) +permalink: /documentation/external/openssl/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # OpenSSL extension (optional) - CMake option: FUN_WITH_OPENSSL=ON diff --git a/docs/external/pcre2.md b/web/documentation/external/pcre2.md similarity index 50% rename from docs/external/pcre2.md rename to web/documentation/external/pcre2.md index 2325e5d..cb4c132 100644 --- a/docs/external/pcre2.md +++ b/web/documentation/external/pcre2.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - PCRE2 (Perl-Compatible Regex) extension (optional) +subtitle: Documentation for PCRE2 (Perl-Compatible Regex) extension (optional) +description: Documentation for PCRE2 (Perl-Compatible Regex) extension (optional) +permalink: /documentation/external/pcre2/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # PCRE2 (Perl-Compatible Regex) extension (optional) - CMake option: FUN_WITH_PCRE2=ON diff --git a/docs/external/pcsc.md b/web/documentation/external/pcsc.md similarity index 59% rename from docs/external/pcsc.md rename to web/documentation/external/pcsc.md index 4519054..5ff1de1 100644 --- a/docs/external/pcsc.md +++ b/web/documentation/external/pcsc.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - PC/SC (smart cards) extension (optional) +subtitle: Documentation for PC/SC (smart cards) extension (optional) +description: Documentation for PC/SC (smart cards) extension (optional) +permalink: /documentation/external/pcsc/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # PC/SC (smart cards) extension (optional) - CMake option: FUN_WITH_PCSC=ON diff --git a/docs/external/sqlite.md b/web/documentation/external/sqlite.md similarity index 53% rename from docs/external/sqlite.md rename to web/documentation/external/sqlite.md index 6dcd00d..1ac4ce7 100644 --- a/docs/external/sqlite.md +++ b/web/documentation/external/sqlite.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - SQLite extension (optional) +subtitle: Documentation for SQLite extension (optional) +description: Documentation for SQLite extension (optional) +permalink: /documentation/external/sqlite/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # SQLite extension (optional) - CMake option: FUN_WITH_SQLITE=ON diff --git a/docs/external/xml2.md b/web/documentation/external/xml2.md similarity index 54% rename from docs/external/xml2.md rename to web/documentation/external/xml2.md index 9c22f30..787a98f 100644 --- a/docs/external/xml2.md +++ b/web/documentation/external/xml2.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - XML (libxml2) extension (optional) +subtitle: Documentation for XML (libxml2) extension (optional) +description: Documentation for XML (libxml2) extension (optional) +permalink: /documentation/external/xml2/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # XML (libxml2) extension (optional) - CMake option: FUN_WITH_XML2=ON diff --git a/web/documentation/faq.md b/web/documentation/faq.md new file mode 100644 index 0000000..5cc0aba --- /dev/null +++ b/web/documentation/faq.md @@ -0,0 +1,48 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - FAQ +subtitle: Frequently asked questions and quick answers. +description: Frequently asked questions and quick answers. +permalink: /documentation/faq/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# FAQ + +Answers to common questions. + +## I built Fun but includes aren't found +Set `FUN_LIB_DIR` to the repository's `./lib` directory when running without installation: +``` +FUN_LIB_DIR=./lib ./build/fun examples/hello.fun +``` +See [includes.md](./includes/). + +## How do I start the REPL? +Run `fun -i` (or run `fun` without a script, depending on version). See [repl.md](./repl/). + +## Which build target should I use? +Use the aggregate `build` target to build `fun`, `fun_test`, and `test_opcodes`. See [build.md](./build/). + +## Where are the standard libraries? +Under [`./lib/`](../lib/). See [stdlib.md](./stdlib/) for an overview. + +## Where can I find internals and opcodes? +Browse [src/vm](../src/vm/) and [internals.md](./internals/) / [opcodes.md](./opcodes/). diff --git a/docs/fun.md b/web/documentation/fun.md similarity index 68% rename from docs/fun.md rename to web/documentation/fun.md index 0104cc0..cd356ba 100644 --- a/docs/fun.md +++ b/web/documentation/fun.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - Fun executable: full usage guide +subtitle: Full usage guide for the `fun` executable, invocation patterns, REPL, env vars, include paths, examples, and install locations. +description: Full usage guide for the `fun` executable, invocation patterns, REPL, env vars, include paths, examples, and install locations. +permalink: /documentation/fun/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # Fun executable: full usage guide This document explains how to use the `fun` binary after building or installing it: invocation patterns, options, environment variables, include/search paths, REPL, and examples. @@ -30,7 +56,7 @@ Notes: Tips: - When running from the repository without installing, set `FUN_LIB_DIR` to the local `./lib` directory so examples can find the stdlib. -- See also: `docs/includes.md` for namespacing (`include ... as ...`) and search order details. +- See also: `documentation/includes.md` for namespacing (`include ... as ...`) and search order details. ## REPL If interactive mode is enabled at build time, starting `fun` with `-i` (or without a script) opens the REPL. @@ -38,7 +64,7 @@ If interactive mode is enabled at build time, starting `fun` with `-i` (or witho Useful commands/patterns in REPL: - Enter expressions and statements directly. - Use arrow keys/history for editing (availability depends on build flags). -- See `docs/repl.md` for details and tips. +- See `documentation/repl.md` for details and tips. ## Running scripts Basic run (installed system‑wide): @@ -70,7 +96,7 @@ DESTDIR=./tmp/stage cmake --build --target install ``` ## See also -- `docs/cli.md` — concise CLI reference (synopsis/options/exit codes) -- `docs/funstx.md` — syntax checker for `.fun` files with optional `--fix` -- `docs/examples.md` — how to run the bundled examples -- `docs/includes.md` — include paths, namespacing, and `FUN_LIB_DIR` +- `documentation/cli.md` — concise CLI reference (synopsis/options/exit codes) +- `documentation/funstx.md` — syntax checker for `.fun` files with optional `--fix` +- `documentation/examples.md` — how to run the bundled examples +- `documentation/includes.md` — include paths, namespacing, and `FUN_LIB_DIR` diff --git a/docs/funstx.md b/web/documentation/funstx.md similarity index 83% rename from docs/funstx.md rename to web/documentation/funstx.md index fe01a52..6fd2c13 100644 --- a/docs/funstx.md +++ b/web/documentation/funstx.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - funstx — Fun syntax checker and fixer +subtitle: Syntax checker for .fun files with optional --fix auto-corrections; usage, exit codes, and limitations. +description: Syntax checker for .fun files with optional --fix auto-corrections; usage, exit codes, and limitations. +permalink: /documentation/funstx/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # funstx — Fun syntax checker and fixer funstx is a small command‑line tool that parses .fun source files to verify syntax without executing them. It lives alongside the fun executable in the build directory and is installed by default. diff --git a/docs/handbook.md b/web/documentation/handbook.md similarity index 97% rename from docs/handbook.md rename to web/documentation/handbook.md index 3e6508a..34223d3 100644 --- a/docs/handbook.md +++ b/web/documentation/handbook.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - Fun Handbook (Second Edition) +subtitle: Comprehensive handbook for the Fun language and VM, install/build, configuration flags, usage, and full feature overview. +description: Comprehensive handbook for the Fun language and VM, install/build, configuration flags, usage, and full feature overview. +permalink: /documentation/handbook/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # Fun Handbook (Second Edition) This is a refreshed, de-duplicated, and fully up-to-date handbook for the Fun programming language and its virtual machine (VM). It keeps the same section layout as the original handbook while consolidating repeated content and documenting all currently available features, including the latest SQLite support. diff --git a/docs/includes.md b/web/documentation/includes.md similarity index 89% rename from docs/includes.md rename to web/documentation/includes.md index b56cd01..4e94c61 100644 --- a/docs/includes.md +++ b/web/documentation/includes.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - Includes in Fun: local vs. system and the FUN_LIB_DIR environment variable +subtitle: Using local vs. system includes, FUN_LIB_DIR, DEFAULT_LIB_DIR, and namespaced includes with `as`. +description: Using local vs. system includes, FUN_LIB_DIR, DEFAULT_LIB_DIR, and namespaced includes with `as`. +permalink: /documentation/includes/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # Includes in Fun: local vs. system and the FUN_LIB_DIR environment variable This document explains how to use local and system includes in Fun source files and how `FUN_LIB_DIR` controls where system includes are resolved from. It also covers namespaced includes with `as`. @@ -134,4 +160,4 @@ Tips: - `examples/include_local.fun` - `examples/include_lib.fun` - `examples/include_namespace.fun` -- REPL notes: `docs/repl.md` (explains completion that also scans `FUN_LIB_DIR`) +- REPL notes: `documentation/repl.md` (explains completion that also scans `FUN_LIB_DIR`) diff --git a/docs/internals.md b/web/documentation/internals.md similarity index 98% rename from docs/internals.md rename to web/documentation/internals.md index ecd45d7..8b8dcae 100644 --- a/docs/internals.md +++ b/web/documentation/internals.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - Fun Internals +subtitle: Implementation details, bytecode format, VM architecture, stacks/frames, parser, and dispatch. +description: Implementation details, bytecode format, VM architecture, stacks/frames, parser, and dispatch. +permalink: /documentation/internals/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # Fun Internals This document describes how Fun is implemented under the hood: the bytecode format, the virtual machine (VM) execution model, how opcodes are organized, error handling and debugging, and how the parser translates source code into bytecode. @@ -228,7 +254,7 @@ Feature flags (CMake): 1) Extend enum OpCode and opcode_names[] 2) Implement a handler (small C file) and include it from src/vm.c 3) Teach the parser/emitter to generate the opcode - 4) Update docs/spec and examples + 4) Update documentation/spec and examples ## Data limits and sizes diff --git a/docs/maps.md b/web/documentation/maps.md similarity index 90% rename from docs/maps.md rename to web/documentation/maps.md index 316984d..82587ab 100644 --- a/docs/maps.md +++ b/web/documentation/maps.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - Maps in Fun +subtitle: Working with maps, construction, lookup/update, merging, iteration, and common patterns. +description: Working with maps, construction, lookup/update, merging, iteration, and common patterns. +permalink: /documentation/maps/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # Maps in Fun This guide focuses on maps: creation, reading/writing by key, checking key presence, iterating keys/values, nesting, and common gotchas. It complements the quick overview in types.md with a deeper, example‑driven treatment. @@ -139,7 +165,7 @@ Depending on your build/stdlib configuration, these helpers are commonly availab - values(m): array of values (parallel to keys(m) order) - len(a) works on arrays; for maps, prefer keys(m) then len(keys(m)) if you need a count -Check your lib or VM docs (e.g., src/vm/maps) and docs/types.md for availability and details. +Check your lib or VM docs (e.g., src/vm/maps) and documentation/types.md for availability and details. ## Interop with arrays and strings diff --git a/docs/numbers.md b/web/documentation/numbers.md similarity index 85% rename from docs/numbers.md rename to web/documentation/numbers.md index a3092ea..41b0b33 100644 --- a/docs/numbers.md +++ b/web/documentation/numbers.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - Working with numbers and floats in Fun +subtitle: Working with integers and floats, arithmetic, conversions, clamping, bitwise ops, and patterns. +description: Working with integers and floats, arithmetic, conversions, clamping, bitwise ops, and patterns. +permalink: /documentation/numbers/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # Working with numbers and floats in Fun This guide covers the numeric types in Fun, with a focus on the integer "number" type and the 64‑bit floating point "float" type. You’ll find creation, arithmetic, conversion, clamping, bitwise operations, and common patterns. @@ -157,6 +183,6 @@ if find(raw, "0") >= 0 || find(raw, "1") >= 0 { // crude pre-check ## See also -- Core overview: [types.md](./types.md) -- Math helpers and advanced ops: check [math/opcodes](./opcodes.md) and the vm/math sources for available functions. -- Strings: [strings.md](./strings.md) +- Core overview: [types.md](./types/) +- Math helpers and advanced ops: check [math/opcodes](./opcodes/) and the vm/math sources for available functions. +- Strings: [strings.md](./strings/) diff --git a/docs/opcodes.md b/web/documentation/opcodes.md similarity index 96% rename from docs/opcodes.md rename to web/documentation/opcodes.md index 5b04a27..94af924 100644 --- a/docs/opcodes.md +++ b/web/documentation/opcodes.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - Fun VM Opcodes Overview +subtitle: VM opcodes overview grouped by domain with brief behavior/stack notes. +description: VM opcodes overview grouped by domain with brief behavior/stack notes. +permalink: /documentation/opcodes/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # Fun VM Opcodes Overview This document provides an overview of the available VM opcodes implemented under src/vm and its subdirectories. Opcodes are grouped by module. For each opcode, we briefly note its purpose and, where available, the expected stack arguments and return value. diff --git a/docs/performance.md b/web/documentation/performance.md similarity index 66% rename from docs/performance.md rename to web/documentation/performance.md index ed926cc..22c23f8 100644 --- a/docs/performance.md +++ b/web/documentation/performance.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - Performance Guide +subtitle: Build/runtime tuning tips and patterns for better performance. +description: Build/runtime tuning tips and patterns for better performance. +permalink: /documentation/performance/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # Performance Guide Tips for getting good performance from Fun programs and builds. diff --git a/docs/repl.md b/web/documentation/repl.md similarity index 94% rename from docs/repl.md rename to web/documentation/repl.md index e918406..1a3dafb 100644 --- a/docs/repl.md +++ b/web/documentation/repl.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - Fun REPL Guide +subtitle: REPL guide, how to build/launch, editing and history, completions, REPL-on-error, and tips. +description: REPL guide, how to build/launch, editing and history, completions, REPL-on-error, and tips. +permalink: /documentation/repl/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # Fun REPL Guide This document describes the interactive Read–Eval–Print Loop (REPL) for the Fun programming language: how to build/launch it, how input and execution work, line editing and completion, the REPL buffer workflow, commands, debugging helpers, and tips. @@ -237,5 +263,5 @@ Program output produced by VM execution is collected and then printed after each ## See also -- docs/handbook.md — full language and VM handbook, including build options and ecosystem overview. +- documentation/handbook.md — full language and VM handbook, including build options and ecosystem overview. - examples/error/repl_on_error.fun — example showing the REPL-on-error workflow. diff --git a/web/documentation/roadmap.md b/web/documentation/roadmap.md new file mode 100644 index 0000000..60a75a9 --- /dev/null +++ b/web/documentation/roadmap.md @@ -0,0 +1,47 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - Roadmap +subtitle: High-level direction, planned features, and pointers to issues. +description: High-level direction, planned features, and pointers to issues. +permalink: /documentation/roadmap/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + +# Roadmap + +This page outlines high-level areas of focus and points to places where you can help. + +## Themes +- Developer experience: docs, examples, REPL polish +- Optional extensions: stabilize and document supported integrations +- Performance: steady improvements in hot paths and data structures +- Safety: clearer error messages, diagnostics, and sandboxing guidance + +## Near-term +- Expand CLI reference and examples ([cli.md](./cli/)) +- Improve testing docs and coverage ([writing-tests.md](./writing-tests/)) +- Fill gaps in stdlib documentation ([stdlib.md](./stdlib/)) + +## Medium-term +- Bytecode/reference updates as internals evolve ([bytecode-format.md](./bytecode-format/), [internals.md](./internals/)) +- Embedding guides and host API stability ([embedding.md](./embedding/), [rust.md](./rust/)) + +## Contributing +See [contributing.md](./contributing/) for how to propose and implement items. Track concrete tasks via repository issues and PRs. diff --git a/docs/rust.md b/web/documentation/rust.md similarity index 92% rename from docs/rust.md rename to web/documentation/rust.md index 9145916..9781913 100644 --- a/docs/rust.md +++ b/web/documentation/rust.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - Writing Rust-backed opcodes for Fun VM +subtitle: Writing Rust-backed opcodes and wiring them into the C VM; build/setup notes. +description: Writing Rust-backed opcodes and wiring them into the C VM; build/setup notes. +permalink: /documentation/rust/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # Writing Rust-backed opcodes for Fun VM This guide explains how to implement VM opcodes in Rust, wire them into the C VM, and use them from Fun scripts. @@ -18,7 +44,7 @@ Fun’s VM is written in C, but you can implement opcode handlers in Rust and ca - src/rust/src/lib.rs — Rust library with exported opcode functions and FFI helpers. - src/vm/rust/ — C-side wiring examples and small opcode cases calling into Rust. - examples/rust_hello.fun — Example Fun script using a Rust-backed opcode. -- docs/opcodes.md — General overview of many built-in opcodes (mostly C-based). +- documentation/opcodes.md — General overview of many built-in opcodes (mostly C-based). ## Enabling Rust in the build @@ -183,7 +209,7 @@ The minimal helpers shown cover 64-bit integers and simple strings. Extending th - Rust lib with examples: src/rust/src/lib.rs - C-side hello wiring: src/vm/rust/hello.c - Demo script: examples/rust_hello.fun -- General opcode reference: docs/opcodes.md +- General opcode reference: documentation/opcodes.md ## Links diff --git a/docs/security-and-sandboxing.md b/web/documentation/security-and-sandboxing.md similarity index 60% rename from docs/security-and-sandboxing.md rename to web/documentation/security-and-sandboxing.md index 9bdf970..fa6e47b 100644 --- a/docs/security-and-sandboxing.md +++ b/web/documentation/security-and-sandboxing.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - Security and Sandboxing +subtitle: Trust boundaries, I/O expectations, and capability restrictions. +description: Trust boundaries, I/O expectations, and capability restrictions. +permalink: /documentation/security-and-sandboxing/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # Security and Sandboxing Understand the trust boundaries and how to run Fun code safely. diff --git a/docs/stdlib.md b/web/documentation/stdlib.md similarity index 78% rename from docs/stdlib.md rename to web/documentation/stdlib.md index 8510def..be2a475 100644 --- a/docs/stdlib.md +++ b/web/documentation/stdlib.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - Standard Library Overview +subtitle: Overview of the standard library modules under ./lib with one-line summaries. +description: Overview of the standard library modules under ./lib with one-line summaries. +permalink: /documentation/stdlib/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # Standard Library Overview This page provides a quick orientation to the standard library located under [`./lib/`](../lib/). @@ -56,7 +82,7 @@ The stdlib is written in Fun and organized by domain. Below is the current layou - `range.fun` - `result.fun` -Note: Availability of some modules can depend on optional extensions selected at build time (see [build.md](./build.md)). For instance, `regex/pcre2.fun` requires PCRE2 support; `ui/*` depends on chosen UI backends. +Note: Availability of some modules can depend on optional extensions selected at build time (see [build.md](./build/)). For instance, `regex/pcre2.fun` requires PCRE2 support; `ui/*` depends on chosen UI backends. ## Using modules ```fun @@ -66,4 +92,4 @@ let s = trim(" hello ") print(s) ``` -For search paths and namespacing details, see [includes.md](./includes.md) and [cli.md](./cli.md) (FUN_LIB_DIR and DEFAULT_LIB_DIR). +For search paths and namespacing details, see [includes.md](./includes/) and [cli.md](./cli/) (FUN_LIB_DIR and DEFAULT_LIB_DIR). diff --git a/docs/strings.md b/web/documentation/strings.md similarity index 80% rename from docs/strings.md rename to web/documentation/strings.md index e5c198b..acc60be 100644 --- a/docs/strings.md +++ b/web/documentation/strings.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - Working with strings in Fun +subtitle: Working with strings, literals/escaping, concatenation, substr/find, split, and conversions. +description: Working with strings, literals/escaping, concatenation, substr/find, split, and conversions. +permalink: /documentation/strings/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # Working with strings in Fun This guide covers string literals, common operations (length, concatenation, substring, search, split), and interop patterns. Strings in Fun are immutable sequences of bytes/text. @@ -95,5 +121,5 @@ path = base + "/" + file ## See also -- Core overview: [types.md](./types.md) -- Arrays guide (useful when splitting/collecting text): [arrays.md](./arrays.md) +- Core overview: [types.md](./types/) +- Arrays guide (useful when splitting/collecting text): [arrays.md](./arrays/) diff --git a/docs/style-guide.md b/web/documentation/style-guide.md similarity index 81% rename from docs/style-guide.md rename to web/documentation/style-guide.md index b2f1645..692a3f3 100644 --- a/docs/style-guide.md +++ b/web/documentation/style-guide.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - Fun Style Guide +subtitle: Coding conventions for C and Fun (indentation, naming, idioms). +description: Coding conventions for C and Fun (indentation, naming, idioms). +permalink: /documentation/style-guide/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # Fun Style Guide Conventions for writing C and Fun code in this repository. @@ -30,7 +56,7 @@ Conventions for writing C and Fun code in this repository. ## Additional details (merged from legacy MVP draft) -This section consolidates practical guidelines that were previously kept in docs/style_guide.md. +This section consolidates practical guidelines that were previously kept in documentation/style_guide.md. 1. Files and headers - Keep the standard header block with license and date when editing stdlib files. diff --git a/docs/testing.md b/web/documentation/testing.md similarity index 82% rename from docs/testing.md rename to web/documentation/testing.md index 8e754aa..3e80b7f 100644 --- a/docs/testing.md +++ b/web/documentation/testing.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - Building and Running Tests +subtitle: How to build and run tests/targets with CMake/CTest, and where to add new tests. +description: How to build and run tests/targets with CMake/CTest, and where to add new tests. +permalink: /documentation/testing/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # Building and Running Tests This page explains how to build and run Fun’s tests using the existing CMake targets. It also points to where opcode and language tests typically live and how to add new ones. diff --git a/docs/troubleshooting.md b/web/documentation/troubleshooting.md similarity index 84% rename from docs/troubleshooting.md rename to web/documentation/troubleshooting.md index 95fb6cf..c1d0de5 100644 --- a/docs/troubleshooting.md +++ b/web/documentation/troubleshooting.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - Troubleshooting Guide +subtitle: Common issues and quick fixes for build, includes, and REPL usage. +description: Common issues and quick fixes for build, includes, and REPL usage. +permalink: /documentation/troubleshooting/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # Troubleshooting Guide This page lists common issues when building and running Fun from a source checkout and how to fix them quickly. @@ -87,5 +113,5 @@ Fix: ## Getting help - Run the interpreter with `--help` to see supported flags. -- Explore docs/handbook.md and docs/repl.md. +- Explore documentation/handbook.md and documentation/repl.md. - Check the examples under `examples/` for an interactive tour. diff --git a/docs/types.md b/web/documentation/types.md similarity index 80% rename from docs/types.md rename to web/documentation/types.md index 759c820..2324ba0 100644 --- a/docs/types.md +++ b/web/documentation/types.md @@ -1,13 +1,39 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - Core datatypes in Fun: arrays, maps, strings, numbers, booleans and nil +subtitle: Core types (numbers, strings, arrays, maps, nil/bool), common operations, patterns, and interop notes. +description: Core types (numbers, strings, arrays, maps, nil/bool), common operations, patterns, and interop notes. +permalink: /documentation/types/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # Core datatypes in Fun: arrays, maps, strings, numbers, booleans and nil This guide shows how to create and use the most common Fun datatypes with practical examples. It focuses on arrays and maps, and also recaps numbers, floats, strings, booleans and nil so examples are self‑contained. See also: -- [arrays.md](./arrays.md) — Deeper dive into array creation, indexing/slicing, iteration, and helpers. -- [strings.md](./strings.md) — Practical guide to string literals, concatenation, substr/find, split, and conversions. -- [maps.md](./maps.md) — Detailed guide to map construction, lookup/update, merging, and patterns. -- [numbers.md](./numbers.md) — Numbers vs floats, arithmetic, conversions, clamping, bitwise ops, and common patterns. +- [arrays.md](./arrays/) — Deeper dive into array creation, indexing/slicing, iteration, and helpers. +- [strings.md](./strings/) — Practical guide to string literals, concatenation, substr/find, split, and conversions. +- [maps.md](./maps/) — Detailed guide to map construction, lookup/update, merging, and patterns. +- [numbers.md](./numbers/) — Numbers vs floats, arithmetic, conversions, clamping, bitwise ops, and common patterns. ## Quick overview @@ -201,8 +227,8 @@ print(typeof({})) // "map" ## See also -- docs/handbook.md — “Core types and operations”, arrays/maps helpers -- docs/includes.md — how to include modules and use namespaces +- documentation/handbook.md — “Core types and operations”, arrays/maps helpers +- documentation/includes.md — how to include modules and use namespaces - Examples in this repo: - examples/arrays.fun, examples/arrays_advanced.fun, examples/arrays_iter.fun - examples/maps.fun diff --git a/docs/website.md b/web/documentation/website.md similarity index 85% rename from docs/website.md rename to web/documentation/website.md index 9af31b8..03505c6 100644 --- a/docs/website.md +++ b/web/documentation/website.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - Website Documentation (fun-lang.xyz) +subtitle: Documentation for the [fun-lang.xyz](https,//fun-lang.xyz) website in the `./web/` directory. +description: Documentation for the [fun-lang.xyz](https,//fun-lang.xyz) website in the `./web/` directory. +permalink: /documentation/website/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # Website Documentation (fun-lang.xyz) This document describes the structure and maintenance of the website for the Fun programming language, located in the `./web/` directory. The website is hosted at [https://fun-lang.xyz](https://fun-lang.xyz). diff --git a/docs/writing-tests.md b/web/documentation/writing-tests.md similarity index 62% rename from docs/writing-tests.md rename to web/documentation/writing-tests.md index a371aed..b8c99a4 100644 --- a/docs/writing-tests.md +++ b/web/documentation/writing-tests.md @@ -1,3 +1,29 @@ +--- +layout: page +published: true +noToc: true +noComments: false +noDate: false +title: Fun - Writing Tests +subtitle: How to author new tests for Fun and opcode components. +description: How to author new tests for Fun and opcode components. +permalink: /documentation/writing-tests/ +lang: en +tags: +- documentation +- handbook +- installation +- usage +- introduction +- help +- guide +- howto +- docs +- specifications +- specs +- repl +--- + # Writing Tests How to author tests for Fun and its opcode implementations. @@ -6,7 +32,7 @@ How to author tests for Fun and its opcode implementations. - VM/opcode tests: exercise bytecode operations and VM behavior (target: `test_opcodes`). - Language/runtime tests: exercise user-visible features and stdlib behavior (target: `fun_test`). -See `docs/testing.md` for how to build and run these targets with CTest. +See `documentation/testing.md` for how to build and run these targets with CTest. ## Adding new tests The exact layout may evolve; generally: