1
0
Fork 0
forked from fun/fun
The programming language that makes you have fun!
  • C 75.3%
  • Standard ML 13.8%
  • CMake 3.1%
  • SCSS 1.9%
  • JavaScript 1.5%
  • Other 4.4%
Find a file
2025-10-06 20:49:27 +02:00
examples Tons of more debug capabilities.(0.26.0) 2025-10-06 05:53:30 +02:00
extra/examples Jump into REPL when executing with --repl-on-error and an error occurs, when the REPL is builtin you will have access to the full stack then. (0.25.0) 2025-10-06 04:10:36 +02:00
lib Jump into REPL when executing with --repl-on-error and an error occurs, when the REPL is builtin you will have access to the full stack then. (0.25.0) 2025-10-06 04:10:36 +02:00
scripts Updated ./scripts/check_op_includes.py for debugging and some fixes. (0.15.4) 2025-10-01 00:02:54 +02:00
spec Added basic threading support, changed license back to Apache-2.0 and many fixes. (0.15.0) 2025-09-30 22:52:12 +02:00
src Only cosmetics... No version update. (0.26.3) 2025-10-06 19:26:32 +02:00
.editorconfig Added sha256_str to class sha256.fun + a demo and some .editorconfig update. (0.12.1) 2025-09-29 09:11:18 +02:00
.gitignore Fully migrated from GNU Make to CMake and removed the Makefile. (0.17.2) 2025-10-02 22:04:28 +02:00
CMakeLists.txt Reverted some cosmetics to make Fun fun again... ;) (0.26.3) 2025-10-06 18:50:14 +02:00
CODE_OF_CONDUCT.md Added code_of_conduct()... ;) (0.9.0) 2025-09-28 15:38:01 +02:00
demo.fun Added basic threading support, changed license back to Apache-2.0 and many fixes. (0.15.0) 2025-09-30 22:52:12 +02:00
LICENSE License fix. (0.15.3) 2025-09-30 23:42:40 +02:00
play.fun Added sha384.fun to std library and alot of fixes. (0.16.3) 2025-10-01 19:08:08 +02:00
README.md README update. No code changes. (0.26.3) 2025-10-06 20:49:27 +02:00

Fun (https://fun-lang.xyz)

What is Fun?

Fun is a highly strict programming language, but also highly simple. It looks like Python (My favorite language), but there are differences.

Influenced by Bash, C, Go, Lua, Python, and Rust (Most influences came from linked languages).

Fun is and will ever be 100% free under the terms of the Apache-2.0-License.

Idea

  • Simplicity
  • Consistency
  • Joy in coding
  • Fun!

Characteristics

  • Dynamic and optionally statically typed
  • Type safety
  • Written in C (C11) and Fun
  • Internal libs are written with no_camel_case even when written in Fun, except class Names
  • Only a minimal function set is written in C, and most other core functions and libraries are implemented in Fun

The Fun Manifesto

Fun is a programming language built on a simple idea: Coding should be enjoyable, elegant, and consistent.

Philosophy

  • Fun is Fun
    Programming should spark creativity, not frustration. Code in Fun feels light, playful, and rewarding.
  • Fun Uses Nothing
    Minimalism is power. No unnecessary features, no endless syntax variations, no formatting debates. Just clean, uniform code.
  • Indentation is Truth
    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
    No clutter, no 15 ways of writing the same thing. Simplicity means clarity.
  • Hackable by Nature
    Fun should be small and embeddable, like Lua. Easy to understand, extend, and tinker with — true to the hacker spirit.
  • Beautiful Defaults
    A language that doesnt need linters, formatters, or style guides. Beauty is built in.

The Community

Fun is not about being the fastest or the most feature-rich. Its about sharing joy in coding. The community should be:

  • Respectful
  • Curious
  • Creative

Like the name says: Fun Unites Nerds.

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.

Documentation

Actually, there does not exist any documentation. In the examples/ directory should be an example of most Fun features.

Development

This section is a work in progress... Please excuse the lack of more information. There are daily updates here.

Requirements

A C compiler, a libc and Git.

FreeBSD

Linux

  • CMake
  • GCC (Clang should work here too, not tested!)

Windows

This requires Cygwin to be installed and configured. I will not cover this here.

Rules

  • Every commit requires a version incremantion in CMakeLists.txt before committing
  • Every commit message must contain the version at the end in the following format (1.2.3)
  • Version numbering follows "Semantic Versioning 2.0.0"

Development systems

Other systems

  • macOS, NetBSD, OpenBSD, etc. should fully work, but I don't know. I do not use these systems actually. You wanna try and report?

To Do

Everything... ;) No, a lot of stuff works already, but only a tiny set of functionality is available in the Fun programming language. It grows from day to day...

Build Fun

Linux/UNIX only covered here for now.

Clone repository:

git clone https://git.xw3.org/fun/fun.git

Change directory:

cd fun

Build:

cmake -S . -B build -DFUN_DEBUG=OFF -DFUN_WITH_PCSC=OFF -DFUN_WITH_REPL=ON
cmake --build build --target fun

That's it! For testing it, run:

FUN_LIB_DIR="$(pwd)/lib" ./build/fun ./demo.fun

To see what's going on, run:

FUN_LIB_DIR="$(pwd)/lib" ./build/fun --trace ./demo.fun

To switch into the REPL after an error, run:

FUN_LIB_DIR="$(pwd)/lib" ./build/fun --repl-on-error --trace ./demo.fun

Both --repl-on-error and --trace are optional but can always be combined. To get more debug information, you need to build Fun with -DFUN_DEBUG=ON.

To directly run the REPL, you have to run:

FUN_LIB_DIR="$(pwd)/lib" ./build/fun

But be sure to build Fun with -DFUN_WITH_REPL=ON.

Author

Johannes Findeisen - you@hanez.org