Skip to content

encrize/fuk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FUK1

License: GPL-2.0 Language: C OS: fukOS Status: Active

FUK1 is a small interpreted programming language originally created for fukOS. This repository contains a standalone portable interpreter, so .fuk programs can run directly on Linux without booting fukOS.

The Linux runtime supports terminal colors, cursor positioning, blocking input, non-blocking key polling, random numbers, timing, strings, integers, floats, arrays, labels, branches, and functions.

Example

FUK1

inputs name Enter your name:
if_seq name Dan success denied

label success
color 10
println Access granted!
exit

label denied
color 12
println Access denied!
exit

Features

  • Signed 32-bit integers
  • 32-bit floating-point values
  • Strings up to 127 bytes
  • Integer, float, and string comparisons
  • Direct true/false branches
  • Labels, jumps, calls, and returns
  • 4,096-element integer array
  • Conversions and safe string helpers
  • ANSI terminal colors and cursor control
  • Blocking input and non-blocking keyboard polling
  • Random numbers, sleep, and monotonic time
  • Small embeddable C API

Build on Arch Linux

Install the standard build tools:

sudo pacman -S --needed base-devel git python

Build and test:

git clone https://github.com/YOUR_USERNAME/fuk-lang.git
cd fuk-lang
make
make test

Run an application:

./fuk examples/hello.fuk
./fuk examples/types-and-branches.fuk
./fuk examples/tetris.fuk

Install globally:

sudo make install
fuk examples/hello.fuk

Uninstall:

sudo make uninstall

CLI

fuk program.fuk
fuk run program.fuk
fuk check program.fuk
fuk --version
fuk --help

check starts the VM with output, delays, and interactive input disabled. It catches header, label, and startup/runtime validation errors along the reached path.

Repository layout

include/fuk.h              public embedding API
src/fuk.c                  portable FUK1 VM
src/main.c                 command-line program
platforms/host.c           Linux/POSIX terminal adapter
docs/language-reference.md complete instruction reference
docs/tutorial.md           step-by-step tutorial
docs/embedding.md          embedding guide
examples/                   example .fuk applications
tests/                      automated VM tests
packaging/PKGBUILD          Arch package template

Documentation

Relationship to fukOS

The language started as the in-kernel FUK1 VM in fukOS. The standalone VM removes FAT, framebuffer, kernel heap, and hardware dependencies. Platform operations are provided through callbacks, allowing the same interpreter core to be embedded back into fukOS.

Limits

Resource Limit
Source size 512 KiB
Variables 256
String value 127 bytes
Integer array 4,096 elements
Source line 2,047 bytes
Executed instructions 100,000,000
Call depth 64
Labels 1,024
One sleep 60,000 ms

License

FUK1 is distributed under the GNU General Public License version 2. See LICENSE.

Check out my OPERATING SYSTEM

About

FUK1 is a small interpreted programming language originally created for fukOS. It supports integers, floats, strings, arrays, functions, branching, terminal colors, keyboard input, random numbers, and timing.

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors