Keylang full logo KEYwords Downloads

Keylang!!!

v3.0.0+

Keylang logo

This key lime pie is almost perfectly baked :| ↓

Report bugs! Report bugs!

This is currently Windows only ↓

In v4.0.0, this will be fixed!!!

btw error handling sucks right now so expect it to spew Python code on a line you didn't make
wait till v4.00 that update will focus primarily on errors

Keylang is a simple, game oriented programming language that puts emphasis on built in functions and KEYwords.

It uses a preprocessor with Python (specifically PyPy)
It can also embed Lua :D (specifically LuaJIT)

Here's the Python page

If you’re coming from Python:

If not -> Get Started

def is replaced with func for simplicity
: is replaced with opening ‘{‘ and closing ‘}’
() is optional for functions that don’t have arguments. However, calling them you still use () haha
Tabs and spaces are optional. Put them anyways they’re helpful
Variables are defined using the var keyword
's is an alias for the . accessor for better grammar, it may have a few bugs though
Yep you know Keylang now (ish)

If you’re coming from Lua:

You can embed Lua in Keylang!

To embed Lua, simply type


embed_lua{}

and write Lua in the curly brackets! Great if you need Lua for certain sections


Setting up (Windows only until v4.0.0)

1. Download

Easiest part

2. Extract files

Right click on the zip folder and press "Extract All..." or something else if you're not on Windows idk

3. Run the batch file called keylang.bat

Open keylang-x.x.x -> keylang_files -> runner
Right click keylang.bat and press "Run as administrator"
It does cool stuff and sets up your .kl files

4. You're basically done

Now, running .kl files will do the code!!!

Preview of valid Keylang


var vari_name = dict("a" = random(67, 68), "b" = 2763)

func cool_func{
    print("hi")
	loop(3){
		wait(1)
		self 's scale *= random(vari_name)
		}
	}
	
cool_func()
	
# prints hi, then, repeating 3 times, waits 1 second before multiplying self's scale by a random value from the dictionary vari_name.

Helpful new functions and KEYwords:

Variable keywords What it does
var Defines a variable
array() Creates a LIST not array
dict() Creates a dictionary
the_array_name[index] Access one of an LIST’s value
dictionary_array_name[key] Access one of a dictionaries value
random(n, n) Picks one of the numbers provided
random_range(from, to) Picks one of the numbers in the range of the numbers provided
keyword Makes a custom keyword that compiles into the EXACT code it was assigned
Loop functions What it does
loop(n) {} Loops the code in the block an amount of times
loop {} Infinite loop
looprate Gets the rate of the last time it was called. Still may be buggy but should work for now
once {} Won’t repeat code in the block after running it once
Wait functions What it does
wait()

Variants:
wait~async() - Async version

wait~until() - Waits until a condition is met

wait~thread() {} - Waits to run the code in the block without blocking

Waits an amount of time
Background functions What it does
spawn func_name() Calls a function… but it runs in the background
when

Variants:
when~once - Stops checking after true once

Runs the code in the block WHEN an event occurs (non blocking)
when()

Variants:
when~once() - Stops checking after true once

Same thing as when, but the number in the parentheses state how frequent it checks
print keywords What it does
print_vars Prints all variables and their values
print_nones Prints all variables with a value of None
print_all Prints a LOT of stuff basically
print_python Prints the unpreprocessed Python
Miscellaneous What it does
's Keyword alias of the . accessor, useful when you're fed up with . and want good grammar
embed_lua {} Runs Lua code
python {} Runs Python code
private func_name() Alias of 2 underscores (name mangling)
protected func_name() Alias of 1 underscore (useless)
if key() {} Runs the code inside the block if the key inside the parentheses was pressed
do Alias of {
end Alias of }

Some shortcuts you should know when using the editor:

Shortcut What it does
Ctrl K or Ctrl / Comment out or uncomment out
Ctrl Shift K or Ctrl Shift / Uncomment out
Ctrl F Find
Ctrl D Select word
Ctrl Shift D Duplicate line
Alt ↑ / Alt ↓ Move line up or down
Ctrl L Select line
Tab and Shift+Tab Indent or unindent selection

Downloads

You can download it directly from here

v3.0+

Download Keylang v3.0.0

v2.0+

Download Keylang v2.0.0

v1.0+

Download Keylang v1.0.0

Or if for some reason you want the early releases:

Download Keylang v0.2.0 Download Keylang v0.1.1

Or you can download from the GitHub repository

Go to GitHub repo

Feedback

PLEASE if you find bugs (very likely), send them here
Open an issue on GitHub