An open API service indexing awesome lists of open source software.

https://github.com/doubledotstudios/linkage

A next generation programming language that allows you to draw elements from other languages.
https://github.com/doubledotstudios/linkage

Last synced: 29 days ago
JSON representation

A next generation programming language that allows you to draw elements from other languages.

Awesome Lists containing this project

README

        

# Linkage

> [!NOTE]
> You are on the `main` C branch.
> For the Rust rewrite see the [`rust`](https://github.com/DoubleDotStudios/linkage/tree/rust) branch.

Linkage is a next generation programming language that allows for the use of other languages' features.
It has easy to use syntax and a simple compiler.

---

## Compilation

Compilation using Linkage is simple.

```console
llsc file/to/compile.lk
```

Then the compiled file can be run.

```console
./executable_name
```

## Syntax

Linkage's syntax is as follows:

### The Main Function

```
# main.lk

fn main (argc: num, argv: arr): int {
return argc # argc can be replaced with other integers
}
```

### Variables

```
;foo = 32 # variable
;;bar = 16 # constant

;baz: str = "Hello, World!" # typed variable
;;buz: arr = [1, 2, 3] # typed constant
```

### Reassignment

```
foo = bar
foo += 2 # foo = foo + 2
foo *= 3 # foo = foo * 3
foo /= 3 # foo = foo / 3
foo -= 2 # foo = foo - 2
foo ^= 2 # foo = foo ^ 2
foo `= 2 # foo = foo ` 2
```

### Binary Operations

```
foo + bar # + operator used for addition
foo - bar # - operator used for subtraction
foo / bar # / operator used for division
foo * bar # * operator used for multiplication
foo ^ bar # ^ operator used for powers
foo ` bar # ` operator used for roots
```

### Unary Operators

```
-foo # negative foo
foo-- # decrement foo
foo++ # increment foo
foo^^ # square foo
foo`` # square root foo
```