Share your repls and programming experiences

← Back to all posts
CookeyLang
h
Coder100 (16773)

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

About

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);

Links

Documentation
NPM
Github
Repl.it
Tests
CookeyLang Make
Discord

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!

Comments
hotnewtop
coderbot100 (102)

CookeyLang is the greatest language!

Coder100 (16773)

Thanks for answering my question! @coderbot100

firefish (989)

@coderbot100 Been a while since surgery?

firefish (989)

@Coder100 Am I the only one that remembers the surgery thing? Lol?

Coder100 (16773)

oh no I forgot to check this thread hi @arivvid27 what do you want to join?

arivvid27 (24)

Can I join the Beta-testers? @Coder100

PythonPrograms (14)

@Coder100 Can I join the beta-testers
as well?

Coder100 (16773)

you guys should join the discord if you haven't already, we have a channel for beta testers there, but you guys will get pinged here as well @PythonPrograms

PythonPrograms (14)

@Coder100 so where do i start like what do i do? Do i get like any docs, should I make a website for ur docs

Coder100 (16773)

was mentioned in post but ig people overlook that lol @PythonPrograms

PythonPrograms (14)

Cool gtg tho byee ill join lster, my name is [email protected]

Seth01Master (5)

@Coder100 i also want to be a beta-tester plz

[deleted]

@Coder100 - I agree with coderbot100! CookeyLang is awesome! But is coderbot100 an alt of yours, or just a fan?

RayhanADev (1902)

@KelpHead coderbot100 is a Repl Talk bot!

Coder100 (16773)

doesn't mean he isn't a user @RayhanADev

Coder100 (16773)

dw i use my email for it and i promise you i get spammed @RayhanADev

[deleted]

@RayhanADev - I am going to pretend i know what a Repl Talk bot is...so thanks for telling me :)

Kudos (111)

@coderbot100
When a bot has more reputation than you lmao.
+ Are you on dvorak?

Kudos (111)

@Coder100
A fellow dvorak user, nice to know :D

Coder100 (16773)

imagine not pinging me instead @PYTHORE3605

PYTHORE3605 (103)

@Coder100 No but I can be a beta tester

Coder100 (16773)

oh yeah, sure
let me set up a repl for ya @PYTHORE3605

savageking65200 (0)

I didn't even know that was a thing you could do

JohnBarnhart (11)

How to make your own language?

Coder100 (16773)

https://craftinginterpreters.com
but really it's just a three-step process (usually):

  • lexing (reading the file and then making tokens)
  • parsing (turning those tokens into like an ast -- abstract syntax tree)
  • resolving (optional) -- check if all the types are intact, in my case, i used this to check if you put statements in valid places.
  • interpreting -- actually executing the code
    @JohnBarnhart
Wuru (42)

fast hm? Ill have to test that but non-compiled bytecode is hard to make fast. Also, how fast? There are no diagrams, no nothing. Is it C fast (it most definitely isn't) or eh fast?

Coder100 (16773)

fast enough to be competable with most industry-standard languages @Wuru

Wuru (42)

Ah, benchmarks? The industry standard can be pythonic-slow or C-fast or (don't mean to brag) Semble-dragster. @Coder100

AJDevelopment (151)

i tried it and it didn't taste good

[deleted]

can you add cookielang to python

cancrusher (4)

So this is basically javascript on steiroids??

Coder100 (16773)

basically
soon we are going to have even more:

  • enumerables (enum, maybe even algebraic)
  • namespaces
  • static methods
    @cancrusher
cancrusher (4)

@Coder100 alright, can I help with the dev?

Coder100 (16773)

yeah sure do you know typescript? @cancrusher

cancrusher (4)

@Coder100 Ugh, no not really, I started learning it at one point lol

Coder100 (16773)

lol that's ok, we will be making a VM in rust tho too
do you know rust?

but you should first learn TS, as that is where the first cookeylang3 release is planned to be @cancrusher

cancrusher (4)

@Coder100 Ugh, rust no only other language I know would be c++, I've actually attempted to make my own language with c++ lol. Anyways I'll look into or learn typescript. I'll get back to you once I learn it I'll get back to you.

Coder100 (16773)

lol ok
have fun, ts is actually super simple if you know js

https://github.com/CookeyLang/CookeyLang-TS @cancrusher

cancrusher (4)

@Coder100 Seems pretty simple, like you said. I'll help and hopefully learn some stuff as I go along with you guys lol... Also may I suggest a website for people to learn the langauge?

cancrusher (4)

@Coder100 I just finished reading about ts

LeviathanCoding (80)

Is it just like JS but with some shorthand languages?

JackNorwood (4)

@Coder100, where can I learn CookeyLang? One of the links will probably answer my question, though I'm on my school laptop so I won't click the links 'til I'm on my PC.

PythonPiboy314 (4)

If this gets popular... #1 language! Is this suitable for indie game dev?

GalaxyCoding (1)

This looks like JavaScript, to be honest.

Wuru (42)

I’m allergic to classes help

Coder100 (16773)

lmao fine, I'll try to do functional maybe @Waku

Wuru (42)

Btw, it’s uh (the middle school coder you have added on discord). @Coder100

xxpertHacker (864)

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

What does this even mean?

dynamic class-based strong language

Specifically the "strong language" part.

codewithmenow (2)

lmao is there compliers where you can write code for cookieLang on repl.it

Coder100 (16773)

@codewithmenow not compilers yet, only interpreters

realTronsi (914)

hol up why is it an npm package

realTronsi (914)

@realTronsi

fast interpreted

there is no such thing >:0
ps is it faster than python?

Flyingcrabs (7)

coder100 is going to check the thread every day. I think you needs some help from your team and make a new thread all about it?

Seth01Master (5)

it would be nice if you made a tutorial
also im a really good video editor ;)

Coder100 (16773)

@Seth01Master :o
yes, I will!!
But first we are trying to make cookeylang3 which will have so many features

poetaetoes (293)

Wow

This

Lang

Is

Awesome
  • I just wish I knew how to code anything possible with this
Coder100 (16773)

oh no sorry for the late reply!
Thanks!! :D @poetaetoes

raghavm (93)

my man literally just made JS on steroids, congrats bro

Coder100 (16773)

xD Thanks!!
Also sorry for the late reply :( @raghavm

fuzzyastrocat (1510)

@Coder100 CookeyLang seems like a fairly polished language. Want to add a package manager to it? If so, you might be interested in my new tutorial on it.

Coder100 (16773)

yes thats cookeylang 3 smh @fuzzyastrocat

fuzzyastrocat (1510)

@Coder100 Nice! (Just asking because it appears that new tutorials are placed way at the bottom unlike other boards, so I doubted anyone would see it.)

Coder100 (16773)

@fuzzyastrocat thx :)
tutorials are treated the same as share posts

fuzzyastrocat (1510)

@Coder100 No problem!
Oh odd, I guess it's just that there are so many good tutorials. As soon as one person upvoted it went to the top, so I guess it just needed one upvote or something.

firefish (989)

@Coder100 Bear in mind that that tutorial was ripped off of dusk, the github repo @firefish111/dusk should give you a better idea

fuzzyastrocat (1510)

@Coder100 Bear in mind that @firefish doesn't really have any concrete evidence for this. However, looking at the repo that they linked to, it appears dusk goes farther than the extent of the tutorial. So it would be a good reference material!

firefish (989)

@fuzzyastrocat (yet to add search... hm, if you want lok at the code, or have you already)

fuzzyastrocat (1510)

@firefish No, I just looked at the readme. I'll look at the code when I get time.

firefish (989)

@fuzzyastrocat Well what happened with Salmon and Apple (Shopping list) lang?

fuzzyastrocat (1510)

@firefish Unfortunately there's been no new development on that lang (at least of my doing)... still trying to figure out what that would do :D

BrysonVan (1)

I love the idea for this. And I love how you are willing to provide updates to keep it going. Keep up the great work!

firefish (989)

@Coder100 forrep coming to a C/C++ near you...

#define forrep(a, b, c, d) for(int a = b; a < c; a += d)
firefish (989)

@coder100 hehe, is it possible to write the entirety of Cookeylang in defines? #define el else we have the one above, I don't know...

Coder100 (16773)

hey that should be a feature in my lang @fuzzyastrocat

fuzzyastrocat (1510)

@Coder100 No, @firefish and I were attempting to express Cookeylang in terms of C/C++ defines.

If you want to add a macro system though, that would be cool. Macros are nice sometimes, but just beware of precedence issues.

fuzzyastrocat (1510)

@firefish #define printLine(fmt) printf(fmt); printf("\n")

fuzzyastrocat (1510)

@firefish Hey, I like a good challenge! :D

Unfortunately, I'm not sure if this is possible, since CookeyLang seems to share much more in common with JS than the C family... but I could be proven wrong :)

firefish (989)

@fuzzyastrocat Hm... you can't exactly do #defines in JS... well there are classes... maybe in C++?

firefish (989)

@fuzzyastrocat Argh... CookeyLang is typeless... C isn't... this is probably impossible unless we find somthing to typedef var to to create an effectively typeless langauge... a union with a macro together maybe? I don't know...

fuzzyastrocat (1510)

@firefish Yeah, I'm thinking (as @xxpertHacker suggested below) exec(readFileSync("filename", 'utf8').replace(/regex/)) in JS would be the way to do it.
Though I like the union idea — though you'd probably have to use pointers to every non-atomic type and then auto-dereference them....

firefish (989)

@fuzzyastrocat hm... The regex wouldn't exactly work. so oyu wanted to replace el { with else {. what if I have a string "haha cookeylang uses el {" will be converted to "haha cookeylang uses else {". Has nobody else seen this?

fuzzyastrocat (1510)

@firefish No, you can ignore things inside strings with regex — I don't remember the exact pattern off the top of my head but I know I've seen that somewhere.

fuzzyastrocat (1510)

@Coder100 Right, it's a little more complicated since you have to deal with \"'s but I definitely think it's possible (since you can't have nested strings)

Coder100 (16773)

@fuzzyastrocat the problem is you even are using regex for that

Coder100 (16773)

but regex is greedy by default so \" gets ignored what a non-regexer @fuzzyastrocat

fuzzyastrocat (1510)

@Coder100 What do you mean by

the problem is you even are using regex for that

Also, if what you say is true then this would match as one:
"A string!" "Another string"
(And according to regex101.com, this is not true. What a non-regexerr :D)

Coder100 (16773)

yeah because its greedy didn't i say that already @fuzzyastrocat

fuzzyastrocat (1510)

@Coder100 but what you said is objectively wrong... regex will not skip over \", see here:
https://regex101.com/r/5vdTjF/1

firefish (989)

@fuzzyastrocat @Coder100 thanks for the 8 pings... thanks very much.

fuzzyastrocat (1510)

Wait, that pinged you? Odd, I never included your tag, sorry :P

fuzzyastrocat (1510)

@firefish Whoops, sorry — didn't realize that happened.

firefish (989)

@fuzzyastrocat It's fine, I just don't like having dinner then coming back to find 8 pings to answer. Otherwise, all is fine!

firefish (989)

@fuzzyastrocat typedef var auto; sorted. Now casts time

firefish (989)

@fuzzyastrocat here's cookey.h so far: (the typedef didn't work, had to swap it out for a #define)

#include <stdio.h>
#include <stdlib.h>
#define var auto
#define function auto
#define forrep(a, b, c, d) for(size_t a = b; a < c; a += d)
#define el else
#define ret return
#define NaV NULL
#define printLine(fmt) printf(fmt "\n")
#define true 1
#define false 0
firefish (989)

@Coder100 It's cookeylang except in C! :)

fuzzyastrocat (1510)

@firefish lol it's actually starting to work

firefish (989)

@fuzzyastrocat The casts are hideously broken... It doesn't like having a string as the name of the macro... If C++ used to be written in macros, then so can CookeyLang

Coder100 (16773)

ok well anyways im going to make cookeybad @firefish

firefish (989)

@Coder100 you wait until the grilled cookie game comes out (ironically, some of the code for it I stole from projects you have previously made... O_o)

Coder100 (16773)

whattt my code gets used????
Don't worry 90% of the code I make is stolen from a previous project @firefish

firefish (989)

@Coder100 (only the code from your repl.it auth tutorial, that's about it)

Coder100 (16773)

lmao thats not stealing code thats using code @firefish

firefish (989)

@Coder100 I don't see the difference tbh

fuzzyastrocat (1510)

@firefish Ha good point! (referring to the C++ written in C comment)

Coder100 (16773)

haha cookeylang just got compiled

@fuzzyastrocat

firefish (989)

@Coder100

Bye Cookey, Hello cookey.h
<= NaV

also why the weird spelling of cookie

fuzzyastrocat (1510)

@Coder100 Wait I'm confused... is that using something you made, or are you talking about firefish's cookey.h?

firefish (989)

@fuzzyastrocat

Wait I'm confused... is that using something you made, or are you talking about firefish's cookey.h?

Which comment does this reply to? If there are many comments, use quotes

fuzzyastrocat (1510)

@firefish @Coder100 Oh, I'm replying to Coder100's last comment.

haha cookeylang just got compiled

firefish (989)

@fuzzyastrocat

I have a sudden urge to make

I Wonder what the rest of that sentence was.. hmm...

fuzzyastrocat (1510)

@firefish Ha, that's weird... I thought I didn't post that comment, I guess it actually got posted (but only half-saved) and then deleted.

As for the rest of the sentence... you'll know if I make it :D

firefish (989)

@fuzzyastrocat I looked in the url of the comment form my notifications... the old trick

fuzzyastrocat (1510)

@firefish ahhhhh that makes more sense. Well, you'll just have to wait :D (I definitely am going to make it though)

firefish (989)

@fuzzyastrocat Is it a spin-off of cookey.h? hehe my suspicions

fuzzyastrocat (1510)

@firefish Nope (it actually wasn't in response to this post, not sure why it showed up here)

firefish (989)

@fuzzyastrocat Huh, it was actaully an educated guess as to which post, because it doesn't say

fuzzyastrocat (1510)

@firefish Ah ok. Well, you'll see it soon :D

firefish (989)

@fuzzyastrocat Oh, it's the wildest language ideas post, isn't it

fuzzyastrocat (1510)

@firefish EDIT nevermind I forgot where I put my own comment, yes it is

Seth01Master (5)

this is literally the longest thread of replies i've ever seen

xxpertHacker (864)

It also fixes the problem of semicolons by requiring them throughout the code.

You do realize that... no one else has that problem, right?

Also, I swear there is a 1 to 1 correlation between this language and JavaScript, I'm more than willing to bet it could be done in one line: exec(readFileSync(input).replace(cookieRegEx)).

Coder100 (16773)

I am the correct answer

AmazingMech2418 (1040)

@Coder100 Does this show like the ask board does for you too? On my post, it shows the "If your question has been answered, select it below." thing...

Miner36 (20)

im commenting and upvoting becouse @RaidTheWeb told me! ;-)

NZHacker808 (106)

@RaidTheWeb Why are you on repl.it while you are in class!

RaidTheWeb (75)

@NZHacker808 why are doing repl.it in class?

NZHacker808 (106)

@RaidTheWeb Cause we are doing clay today and I finished. (Why are you on repl.it again?)

NZHacker808 (106)

@RaidTheWeb Create something in our group

firefish (989)

@Miner36 @RaidTheWeeb shouldn't be telling you who to upvote

firefish (989)

@Coder100 Well, don't you know C/C++? That's how macros work...

fuzzyastrocat (1510)

How does the OOP system work here, or does it have one?

fuzzyastrocat (1510)

@Coder100 Is there inheritance or is it a C-like system?

firefish (989)

Hm.... grilled cookies looking more grilled than apricots...

firefish (989)

@Coder100 Grilled cookie game coming soon! (after I figure out how to get auth working in node without express)