2025-10-06 19:51:54 +02:00
# Fun ([https://fun-lang.xyz](https://fun-lang.xyz))
2025-09-11 02:07:59 +02:00
2025-09-30 22:52:12 +02:00
## What is Fun?
2025-09-11 02:07:59 +02:00
2026-01-27 01:30:25 +01:00
Fun is a small, strict, and simple programming language that runs on a compact stack-based virtual machine. The C core is intentionally minimal; most functionality and standard libraries are implemented in Fun itself. The language emphasizes simplicity, consistency, and joy in coding.
2025-11-28 17:47:27 +01:00
Fun is an experiment, just for fun, but Fun works!
2025-09-30 22:52:12 +02:00
Fun is a highly strict programming language, but also highly simple. It looks like Python (My favorite language), but there are differences.
2025-11-28 17:47:27 +01:00
Influenced by * * [Bash ](https://www.gnu.org/software/bash/ )**, * * [C ](https://en.wikipedia.org/wiki/The_C_Programming_Language )**, * * [Lua ](https://www.lua.org/ )**, PHP, * * [Python ](https://www.python.org/ )**, and Rust (Most influences came from linked languages).
2025-09-30 22:52:12 +02:00
2025-10-08 04:07:00 +02:00
Fun is and will ever be 100% free under the terms of the [Apache-2.0 License ](https://opensource.org/license/apache-2-0 ).
2025-09-30 22:52:12 +02:00
## Idea
2025-10-02 00:53:51 +02:00
- Simplicity
- Consistency
2026-01-27 01:30:25 +01:00
- Simple to extend
- Hackable
2025-10-02 00:53:51 +02:00
- Joy in coding
- Fun!
2025-09-30 22:52:12 +02:00
## Characteristics
2025-10-02 00:53:51 +02:00
- Dynamic and optionally statically typed
- Type safety
2025-10-09 00:43:17 +02:00
- Written in C (C99) and Fun
2025-10-08 02:48:55 +02:00
- Internal libs are written with no_camel_case even when written in Fun, except class names
2025-10-02 00:53:51 +02:00
- Only a minimal function set is written in C, and most other core functions and libraries are implemented in Fun
2025-09-30 22:52:12 +02:00
## The Fun Manifesto
Fun is a programming language built on a simple idea:
Coding should be enjoyable, elegant, and consistent.
### Philosophy
- **Fun is Fun**<br>
Programming should spark creativity, not frustration. Code in Fun feels light, playful, and rewarding.
- **Fun Uses Nothing**<br>
Minimalism is power. No unnecessary features, no endless syntax variations, no formatting debates. Just clean, uniform code.
- **Indentation is Truth**<br>
Two spaces, always. No tabs, no four-space wars. Code should look the same everywhere, from your laptop to /usr/bin/fun.
- **One Way to Do It**<br>
No clutter, no 15 ways of writing the same thing. Simplicity means clarity.
- **Hackable by Nature**<br>
Fun should be small and embeddable, like Lua. Easy to understand, extend, and tinker with — true to the hacker spirit.
- **Beautiful Defaults**<br>
A language that doesn’ t need linters, formatters, or style guides. Beauty is built in.
## The Community
Fun is not about being the fastest or the most feature-rich. It’ s about sharing joy in coding. The community should be:
- Respectful
- Curious
- Creative
2026-01-27 01:30:25 +01:00
- Open for everyone
2025-09-30 22:52:12 +02:00
Like the name says: Fun Unites Nerds.
2025-10-13 00:03:18 +02:00
Please visit the [Fun Community Page ](https://fun-lang.xyz/community/ ) to get in touch.
2025-09-30 22:52:12 +02:00
## The Goal
A language that feels like home for developers who:
- Love minimal, elegant tools
- Believe consistency is freedom
- Want to write code that looks good and feels good
Fun may not change the world — but it will make programming a little more fun.
2025-11-27 01:31:11 +01:00
## Features
2025-11-28 17:47:27 +01:00
### Core
- functions/classes/objects
- if/else if/else
- try/catch/finally
2026-04-21 01:24:53 +02:00
And much more...! Look at the specs in [Spec ](./spec/ ) for more detailed information.
2026-04-10 21:53:50 +02:00
2025-12-28 19:08:15 +01:00
### Lib (./lib/)
2025-11-28 17:47:27 +01:00
2026-01-27 01:30:25 +01:00
See [./lib/ ](https://git.xw3.org/fun/fun/src/branch/main/lib ) for what the standard library provides.
2025-11-28 17:47:27 +01:00
2026-01-27 01:31:07 +01:00
### Optional extensions (build-time selectable / only testing this on Linux actually):
2025-11-28 17:47:27 +01:00
- [CGI ](https://en.wikipedia.org/wiki/Common_Gateway_Interface ) support builtin using [kcgi ](https://kristaps.bsd.lv/kcgi/ ) (optional) ☐ ;
2026-04-19 00:02:36 +02:00
- [cURL (libcurl) ](./docs/extensions/curl.md ) (optional) ☑ ;
- [INI (iniparser) ](./docs/extensions/ini.md ) (optional) ☑ ;
- [JSON (json-c) ](./docs/extensions/json.md ) (optional) ☑ ;
- [PCRE2 ](./docs/extensions/pcre2.md ) (optional) ☑ ;
- [PCSC (smart cards) ](./docs/extensions/pcsc.md ) (optional) ☑ ;
- [OpenSSL ](./docs/extensions/openssl.md ) (optional) ☑ ;
- [SQLite ](./docs/extensions/sqlite.md ) (optional) ☑ ;
- [XML (libxml2) ](./docs/extensions/xml2.md ) (optional) ☑ ;
2025-11-27 01:34:57 +01:00
2026-04-21 01:24:53 +02:00
☑ ; = Done (or basics implemented) / ☐ ; = Planned or in progress.
2025-11-27 01:34:57 +01:00
2025-11-28 17:47:27 +01:00
Note: Not all of the above features will be implemented. Those who are marked "Done" will probaly remain in Fun, but I don't know actually... ;)
2025-11-28 18:42:11 +01:00
There are some libs written in Fun available in the [./lib/ ](https://git.xw3.org/fun/fun/src/branch/main/lib ) diretory. In the future most Fun enhancements should be written in Fun itself.
2025-11-28 17:47:27 +01:00
2026-02-19 12:33:33 +01:00
### OpenSSL quickstart (MD5)
2026-04-21 01:24:53 +02:00
See the dedicated page: [./web/documentation/extensions/openssl/ ](./web/documentation/extensions/openssl/openssl.md )
2026-02-19 12:33:33 +01:00
2025-09-30 22:52:12 +02:00
## Documentation
2026-02-18 16:12:41 +01:00
Looking for docs? Start here:
2025-10-12 23:21:43 +02:00
2026-04-21 01:24:53 +02:00
- Local documentation index: [./web/documentation/documenatation.md ](./web/documentation/documentation.md )
- Handbook: [./web/documentation/handbook/handbook.md ](./web/documentation/handbook/handbook.md )
- Types overview: [./web/documentation/types/types.md ](./web/documentation/types/types.md )
- REPL guide: [./web/documentation/repl/repl.md ](./web/documentation/repl/repl.md )
- Testing: [./web/documentation/testing/testing.md ](./web/documentation/testing/testing.md )
- Troubleshooting: [./web/documentation/troubleshooting/troubleshooting.md ](./web/documentation/troubleshooting/troubleshooting.md )
2025-10-12 23:21:43 +02:00
2026-02-18 16:12:41 +01:00
Additional references:
2025-11-28 17:47:27 +01:00
2026-04-21 01:24:53 +02:00
- Specification: [./web/documentation/spec/v0.4.md ](./web/documentation/spec/v0.4.md ) (work in progress)
2026-04-10 21:53:50 +02:00
- Changelog: [CHANGELOG.md ](./CHANGELOG.md )
2026-04-21 01:24:53 +02:00
- Examples demonstrating most features: [./examples/ ](./examples/ )
- Internals and VM opcodes live in [./src/ ](./src/ ) (see [./src/vm/ ](./src/vm ) for opcode implementations)
2025-11-28 17:47:27 +01:00
2026-04-21 01:24:53 +02:00
Note: The project is evolving; some documents may lag behind. The docs index in [./web/documentation/documenatation.md ](./web/documentation/documentation.md ) is the most up‑ to‑ date entry point.
2025-09-30 22:52:12 +02:00
2025-09-30 23:26:34 +02:00
## Author
2025-12-09 03:59:49 +01:00
Johannes Findeisen - <you@hanez .org>