Skip to main content

Lightweight and expressive programming language similar to Python

Project description

Zink

Zink is a programming language that simplifies scripting with many tweaks and additions.

Why Zink and not other languages?

One of the problems developers face when writing in other languages is that it can sometimes be very complex to write simple expressions, like for example iterating through a list while also getting the current item's position in that list in Python, which uses the enumerate function, or simply the verbosity of class definitions.

Zink simplifies these kinds of operations by letting the developer write shorter code and still converting it to the correct functions.

Quick comparison

This Python script determines if a number is prime:

def is_prime(n: int) -> bool:
    if n <= 1: return False
    if n <= 3: return True
    if n % 2 == 0 or n % 3 == 0: return False

    i = 5
    while i * i <= n:
        if n % i == 0 or n % (i + 2) == 0:
            return False
        i += 6
    return True

This here is that same code written in Zink:

def is_prime(n: int): bool
    if n <= 1; <-False;.
    if n <= 3; <-True;.
    if n % 2 == 0 or n % 3 == 0; <-False;.

    i = 5
    while i * i <= n
        if n % i == 0 or n % (i + 2) == 0
            <-False
        .
        i += 6
    .
    <-True
.

It may seem stupid (and longer), but now look at Python classes:

class Animal:
    def __init__(self, name: str) -> None:
        self.name = name
    def eat(self, food: str) -> None:
        print(self.name, "is eating", food)

class Bird(Animal):
    def __init__(self, name: str, color: str) -> None:
        super().__init__(name=name)
        self.color = color
    def fly(self) -> None:
        print(self.color, self.name, "is flying")

And look at those same classes in Zink:

class Animal
    /* @name: str;;.
    def @eat(food: str): None
        print(@.name, "is eating", food)
    .
.

class Bird from Animal
    /* ^name: str, @color: str;;.
    def @fly: None
        print(@.color, @.name, "is flying")
    .
.

You can start to notice that it simplifies many things that require a lot of time to type: it replaces entire lines spent typing self.foo = foo to simply putting a @ before the argument, or automatically passing those arguments to the super().__init__ function with ^. In fact, that very function is abbreviated to @^.

Getting the length of an object is as easy as typing # before the object, and converting an object to a type is done with the repurposed keyword as.

Language support

Zink is also built with the idea of writing the same code while still converting it to many languages, like for example writing the source code in Zink and then converting it to both Python and Lua, which is much quicker than learning two languages' syntax individually.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zlang-2.8.3.tar.gz (19.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zlang-2.8.3-py3-none-any.whl (22.5 kB view details)

Uploaded Python 3

File details

Details for the file zlang-2.8.3.tar.gz.

File metadata

  • Download URL: zlang-2.8.3.tar.gz
  • Upload date:
  • Size: 19.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.7 Linux/6.17.1-arch1-1

File hashes

Hashes for zlang-2.8.3.tar.gz
Algorithm Hash digest
SHA256 5c585a5488a994782a046fc86856e5feb4b8eba0fe25f00b6a489704d54e1ba8
MD5 9e889951b8cc82f2352ad8146242aecc
BLAKE2b-256 51f89728ff308bac848fe3f2f4d730ff422bb76077a7783624c1b35848d8df41

See more details on using hashes here.

File details

Details for the file zlang-2.8.3-py3-none-any.whl.

File metadata

  • Download URL: zlang-2.8.3-py3-none-any.whl
  • Upload date:
  • Size: 22.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.7 Linux/6.17.1-arch1-1

File hashes

Hashes for zlang-2.8.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7f7bc769c89fc0489ad17c94d43ca5e2c091f24c7acaeaa4bbab3b60b9d79c6b
MD5 ab4850d3a220e276f528958db1d4857c
BLAKE2b-256 b2c521ff044c5224605590dabae7add7980117a13c1bf2b2c94c2dac686eb4ba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page