CookeyLang

# CookeyLang

Hello! Today we are introducing a brand new language! This brand new language is very easy to understand and it takes many different features and ideas from different languages making it easy to understand yet still being powerful! We are sure you will have an amazing experience try this language, and transitioning from and to this language will not be a problem! But, what is this language called?

Introducing CookeyLang. CookeyLang is a fast interpreted general-purpose dynamic class-based strong language for beginners, but advanced users can use it as well!

## Credits

Language

Design

Beta-Testers

CookeyLang was created for the 2020 language jam, but it will not stop there! We already have our very own GitHub repository and docs! We also plan to rewrite in C++ and maybe even a VM! Our plan is to add and update CookeyLang to make it even better! CookeyLang is a great language for beginners to learn!

## Purposes

CookeyLang is meant as a general-purpose language for beginners. It promotes good coding practices and is similar to C, JS, C#, and Python for an easy transition to and from the languages. It also contains many new features of its own and new takes on many of the old features of other languages. It aims to solve the problem of python being too "austere" and JavaScript being too "sloppy". It also fixes the problem of semicolons by requiring them throughout the code.

## Examples

Fibonacci

``````function fibonacci(num) {
if (num <= 1) ret 1;

ret fibonacci(num - 1) + fibonacci(num - 2);
}

for (var i = 0; i < 20; i ++) {
printLine(fibonacci(i));
}``````

99 bottles of beer

``````function bottle(num) {
ret num + " of bottles of beer on a wall, " + num + " of bottles of beer on a wall.";
}

function takeOneDown(num) {
ret "Take one down, pass it around, " + num + " bottles of beer on the wall.";
}

var bottles = 100;

function init(bottles) {
if (bottles > 0) {
printLine(bottle(bottles));
bottles --;
printLine(takeOneDown(bottles));
init(bottles);
} el {
printLine("No more bottles!");
}
}

init(bottles);``````

## Usage

``npx cookeylang [file]``

Easy as that!

You can also get a pretty welcome screen.

``npx -p cookeylang welcome``

## Closing

I hope you enjoyed this language as much as we did making it!

You are viewing a single comment. View All
Answered by coderbot100 (77) [earned 5 cycles]
i5 (9)

I want to see the global-scope environment
(and performance improvements)

Coder100 (10774)

@i5 what global-scope environment?

i5 (9)

@Coder100 equivalent of `window` in js (or `globalThis`)

Coder100 (10774)

@i5 thats very bad we will never have, but the closest thing rn is probably `includes`

Coder100 (10774)

`include`? That's for including files @i5

i5 (9)

@Coder100 thats not a global scope at all. or anything like it.
i mean, do you have some predefined vars?

Coder100 (10774)

@i5 it's the closest thing because it is in the highest scope "global" scope.

i5 (9)

@Coder100 got any predefined variables?

Coder100 (10774)

yeah of course

smh just look in the code @i5

i5 (9)

@Coder100 ok now does it have 'scoping'?

Coder100 (10774)

yes.... you have blocks smh @i5

Coder100 (10774)

literally what are you trying to do smh @i5

i5 (9)

@Coder100 so there IS a global scope?

Coder100 (10774)

yeah thats the outermost @i5

i5 (9)

@Coder100 a scope at the top. it has all vars like printLine

i5 (9)

@Coder100 thank you for finally answering my question! now can i have a full list of variables on the global scope please?

Coder100 (10774)

um thats in interpreter.js @i5

Codemonkey51 (890)

Lmfao not my super secret one :) @Coder100