Skip to main content

Gofra [beta]

A Stack-based compiled programming language.

The project is made not for competing with other languages, rather it is another incomplete language almost same like others.

Compiler Testkit


Documentation and information is available here


Overview

Gofra is a concatenative (stack-based) programming language that compiles to native code. Programs are written using Reverse Polish notation, where operations follow their operands (e.g 2 + 2 is 2 2 +).

Pong Example Screenshot

Quick start

Here's a simple "Hello, World!" example:

include "std"

func void main
    "Hello, World!" println
end

Features

  • Native - Compiles to native machine code
  • C-like - Close to C, but has a few more high-level abstraction (for in, type generics)
  • C FFI - Seamless integration with C-FFI libraries
  • Low-level - Write unsafe, low-level code with direct memory access
  • Type System - Validate types at compile time, has compile-time warnings (Generics supports, typechecker)
  • Library - By default has support for math, random, network and other libraries
  • First class functions - Has support, and lambda definitions (no closures/capturing yet)

More complex examples

#include "std"

// Print each array element
var xs = ["Hello", " ", "world!", "\n"]

func void main[]
    for x in xs do
        x ?> print
    end
end

Showcase

Platform Support

ARCH OS Support Tested hardware
Aarch64 Darwin ✅* M1, MacOS Tahoe 26.1
WASM - ❗** Node.js v22, Safari
x86_64 Linux ❗**
ARCH OS Support Tested hardware
Aarch64 Windows ❌
Aarch64 Linux ❌
x86_64 Darwin ❌
x86_64 Windows ‼️***

* Main workflow of development, has all features
** Incomplete, has bugs and not all features
*** Windows x86_64 is not implemented, but has general wrappers for system calls and possibly can be compiled with some headache

Pre requirements

Before installing Gofra, ensure you have the following tools available system-wide:

  • Python >3.12.x
  • GNU/Mach-O Linker (ld) - For linking compiled objects
  • Assembler (as) - Typically included with Clang LLVM compiler

Installation

For full installation steps, please visit Installation page.

Gofra is distributed as single Python-based toolchain. To install:

(Step 1): Install toolchain

pip install gofra

(Step 2): Verify Installation

gofra --help

More information and next steps

Please refer to actual documentation!

Metadata

Release files for gofra 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gofra 0.1.2
File Size Uploaded
gofra-0.1.2.tar.gz 169.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gofra 0.1.2
File Interpreter ABI Platform
gofra-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 456.9 kB

Release files / gofra-0.1.2.tar.gz

Download URL gofra-0.1.2.tar.gz
Size 169.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6041164304ac2b7971b4db05b59138dd031f68d5852c8bae6cba1ec8c3094775
BLAKE2b-256 checksum
How to use checksums
fa80ceb59dcb6d940052d86f52908b275cb3287d37a2b4f8e8cf1e4c16ca040e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.3 CPython/3.12.7 Darwin/27.0.0

Release files / gofra-0.1.2-py3-none-any.whl

Download URL gofra-0.1.2-py3-none-any.whl
Size 287.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ecb7efede20dfd1eb3f57a165c8a78d73034830cf4669925b1effc2170eb90e5
BLAKE2b-256 checksum
How to use checksums
eda9b7fe4e0c01949a6023557a86c8b4055c708e8b0147ac4b49d8746aca77d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.3 CPython/3.12.7 Darwin/27.0.0

Release history Release notifications | RSS feed

0.1.3

2 release files

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page