The story behind this language begins in calculus II. I was introduced by Prof. Patrick Shanahan to the concept of parametrics, functions whose variables could be independently controlled by multiple discrete functions. I used what I had learned to expedite the design of bespoke graphical components for freelance animations.
This inspiration led me down a rabbit hole of mathematical discovery, which culminated in the development of my current senior project, Parametrix, a functional animation programming suite leveraging parametric notation for quickly automating short animations. I initially developed Funktion as a helpful way to make programming in this paradigm as quick and intuitive as possible. Although its syntax may be read by others as terse, it makes up for it with its brevity.
Funktion is a functional, generational, concise programming language that leverages aspects of parametric math notation, perfect for people who love math. Functions are defined as generators that are stepped through according to a global or local time step. The time step varies over an interval from a starting to ending point, allowing several independently-running functions to interact at different points in the program.
// This is a comment! Oooga Booga
print("Hello, World!")
425.2Each character is wrapped in single quotation marks.
'a''\n' - Line Feed (New Line)'\t' - Horizontal Tab'\r' - Carriage Return'\b' - Backspace'\\' - Backslash Character (\)'\"' - Double Quotation Character (")Each string is wrapped in double quotation marks.
"Hello!""24t4t""Bob says \"Hello\" to you!"| Operator | Description | Example |
|---|---|---|
+ | Addition | 4 + 5 |
- | Negation | -9 |
- | Subtraction | 7 - 2 |
* | Multiplication | 4 * 8 |
/ | Division | 12 / 3 |
** | Exponentiation | 2 ** 9 |
% | Modulus (Not Remainder) | 11 % 2 |
| Operator | Description | Example |
|---|---|---|
~ | Bitwise Not | ~9 |
& | Bitwise And | 7 & 3 |
| | Bitwise Or | 2 | 8 |
<< | Left Bit Shift | 7 << 2 |
>> | Right Bit Shift | 64 >> 4 |
| Operator | Description | Example |
|---|---|---|
== | Equals | 9 == 9 |
!= | Not Equals | 9 != 9 |
< | Less Than | 9 < 9 |
<= | Less Than or Equals | 9 <= 9 |
> | Greater Than | 9 > 9 |
>= | Greater Than or Equals | 9 >= 9 |
| Operator | Description | Example |
|---|---|---|
+ | String Concatenation | "Hi" + " Joe" |
Ranges are the building blocks of Funktion programming. They allow programmers to perform the same function multiple times.
`0..10` → 0 1 2 3 4 5 6 7 8 9 10`0..10 t1t` → 0 1 2 3 4 5 6 7 8 9 10`10..0` → 10 9 8 7 6 5 4 3 2 1 0`0..10 t-1t` → 0`0..5 t0.2t` → 0 0.2 0.4 0.6 ... 4.6 4.8 5`0..` → 0 1 2 3 4 5 6 7 8 9 10 11 12 13...`..0` → 0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13...`'a'..'e'` → a b c d e`'y'..'t'` → y x w v u t`'a'..'h' t2t` → a c e g`'Y'..'c'` → Y Z [ \ ] ^ _ ` a b cf(x) = 2xg(x) = xf(x).step(3) - Calls the function 3 times.print(f(x):2) - Prints the output of the function until 2.The chain of questioning allows you to perform a series of conditional checks using consecutive ? symbols. Each ? represents a case to be checked, and the : symbol represents the "else" condition.
? condition1 => action1
? condition2 => action2
? condition3 => action3
: defaultAction
The consecutive action operator (,) allows you to chain multiple actions together on a single line. Actions are evaluated from left to right.
action1, action2, action3
print - A print statement that prints the item into the console.
print("Bonjour!!!")Program below prints "Hello, World!".
// This example prints the simple program "Hello, World!"
print("Hello, World!")
Hello, World!
Program below prints the factorial of 5, which will output 120 after iterating through each product. This is created using a method that outputs the answer using a recursive algorithm.
`5..1` t1t
factorial(x) = ? x > 1 => x * factorial(x - 1) : 1
factorial(x).step(5) // Step through 5 times
print(x:1)
120 24 6 2 1
`1..5` t1t
f(x) = x
f(x).step(2)
G(x) = number(input("Give me a value and I will multiply that sequence with that value."))
(f(x) * G(x)).step(2)
print(f(x):5)
1 2 3 20 25
`15..1` t1t
fizzbuzz(x) =
? x % 15 == 0 => print("fizzbuzz"), fizzbuzz(x).step()
? x % 3 == 0 => print("fizz"), fizzbuzz(x).step()
? x % 5 == 0 => print("buzz"), fizzbuzz(x).step()
: print(x), fizzbuzz(x).step()
fizzbuzz 14 13 fizz 11 buzz fizz 8 7 fizz buzz 4 fizz 2 1
`1..9` t3t
f(x) = x \ x + 1 \ x + 2
f(x).step(2)
print(f(x):7)
1 2 3 4 5 6 7 8 9
Wesley is a computer science major student who is interested in programming languages, video game development, and speedrunning. He currently is working on an 3-dimensional esolang that is intended to be interesting and difficult to program. He has worked on other projects for gaming including a 2D platformer and a slap card game, with some familiarity in Unity, Adobe Animate, and Aesprite. He is also working for professor Ray Toal on his research for Programming Languages Exploration where he explored 40+ languages and wrote many code snippets.
Matthew is a computer science major student who has a passion for technical animation, illustration, and roguelike video games. He currently is working on a suite of web-based animation software that allows for functional programming of animations. He has worked on other projects including Squibble, a web based public whiteboard, and works as a freelance cartoonist and animator. He hopes to one day design software that can make animation faster while remaining deeply personalizable.
Reed is a computer science and statistics & data science major who is interested in video game design and mathematics. He is currently working on a strategic 4-player board game, a research paper for approximating mathematical constants using Minecraft, and a graphics library for a customizable underwater aquarium. He has worked on other projects such as a mobile app that can search for new songs based on the user's music preferences.