Share your repls and programming experiences

← Back to all posts
🌕 Night - My Programming Language 🌑
DynamicSquid

Night

I feel like my logo is a little too fancy. I'm working on something simpler. Any suggestions?

Hey guys! This is my language I'm currently working on. It's still in early development, so it can't do much yet, but I still have a long way to go.

Also thanks to @ChezCoder and @targetfanttthat for helping me out in the early stages of my language. And thanks to @mathiasaboye as well for the logo idea.

You can also view my language on GitHub as well for more details and an inside look at future plans, and the code! And don't forget to leave star :)

Anyway, I modified it a bit here, so you can run the repl and code directly. All you have to do is run the repl, write your code in the console, and then, type in RUN, and hit ENTER to run the code.

Like this:

Try it out!

Note: To paste text in the console, use Ctrl + Shift + V.

Another Note: The RUN command actually isn't part of my language, but I added it in so it's easy for you guys to run the code here.


Documentation

Standard input:

It can basically print any expression (you'll see later).

Variables:

Expressions:

Note: operator precedence follows C++ style.

If Statements:

This is the good part :)

And that's it! Make sure to check out my GitHub page for more info! And feel free to leave any feedback or questions in the comments below.

Enjoy :)

Voters
forceofyoda
jeweledfox
ninja2k11
GellyBird
programmeruser
CuriousMonkey
firefish
HahaYes
fuzzyastrocat
PaperTomato
Comments
hotnewtop
pr0p3rno0b10

How did you make your logo? Did you use a website?

DynamicSquid

@pr0p3rno0b10 oh I use Processing

DynamicSquid

@pr0p3rno0b10 it's a coding language that let's you create graphics easily

pr0p3rno0b10

@DynamicSquid Cool, I like it.

DynamicSquid

@pr0p3rno0b10 thanks!!

HenryZelonka1

@DynamicSquid
That's pretty good for processing. Nice!

DynamicSquid

@HenryZelonka1 oh thanks!

BobTheTomatoPie

Its awesome! The code is so out of my mental range it is frightening

DynamicSquid

@BobTheTomatoPie lol, thanks!!

StringentDev

How did you create the programming language?
good job btw

DynamicSquid

@Lethdev2019 oh you can check out my github page for more info on the code. also thanks!!

StringentDev

i cannot keep this in anymore:
can i help build and refine the website?

I have been building a css library called "Flightcss" which is fully customisable in theme. (even MarcusWeinberger likes it)

If i am able to help - i will need a nodejs repl (also, if you create a team called "night" you can get a url like "web.night.repl.co") called "web" (if you have a team called Night). that is literally it.

also, the current website violates one design recommendation (google even recommends this) - do not use black and white.
this is due to eyestrain so it is better if you use #222 and #eee or #222 #ddd.

still though great work so far! :)

@DynamicSquid

DynamicSquid

@Lethdev2019 hmm... sure I guess. I'm not that good with html (the only html I know is from w3schools lol) so I probably won't be of much help. want me to invite you?

also about the url, I'm just coding on repl.it, but i'll definitely switch over to another domain name once i'm done

StringentDev
DynamicSquid
StringentDev

Hi dynamic squid - can i ask you to come look at the webpage. sadly, i could not accept the changes made as they would cramp the page on mobile and having search on references is not a good idea as the search is for the entire site. but search now works. search for "display" and then "hghhdgfj" (you need to press enter.) @DynamicSquid

StringentDev

@DynamicSquid we also, we have 17 results so far, come on to the night repl so we can talk further.
thanks,
lethdev2019.

CuriousMonkey

can you give me a link i cant find it [email protected]

DynamicSquid
CuriousMonkey

can you give me a link to your github page where it shows you how to make a [email protected]

DynamicSquid

@CuriousMonkey you mean a tutorial on how to make a language?

CuriousMonkey

ye you said it was on your github page but i couldn't find it there @DynamicSquid

DynamicSquid

@CuriousMonkey what no I didn't lol?

CuriousMonkey

@DynamicSquid OOF well can you make one in the future i wanna get 5000$ dollars for the jam xD

DynamicSquid

@CuriousMonkey too lazy lol. really busy with actually making the language. maybe once it's done idk

CuriousMonkey

ok thx :) @DynamicSquid

viraatvv

it's built around c# and python, right?

DynamicSquid

@viraatvv kind of yes. I tried to combine the simplicity of python with the type concepts of the C family

viraatvv

@DynamicSquid wow. also, this is unbelievable. I think your language could actually be successful when you release it

DynamicSquid

@viraatvv oh thanks!!

HenryZelonka1


Hey! Humans are smart.

DynamicSquid

@HenryZelonka1 huh? lol XD

WilkeWyoming

great job @DynamicSquid

Barry123


It seems like octopuses and squids are smarter

HenryZelonka1

@Barry123
Hmmmm... So strange considering that @DynamicSquid should not be biased at all.

DynamicSquid
Codemonkey51

Hey you forgot monkeys @DynamicSquid

DynamicSquid

@Codemonkey51

HenryZelonka1

@DynamicSquid
What about humans?

Codemonkey51
firefish

@DynamicSquid You should make it into a REPL... also Shift+Insert is another way to paste in console

[deleted]

Nice! Btw, You should add loops

DynamicSquid

@CarlosRosiles thank you!! also, you can take a look at my github page to see what I'm working on next. right now, I'm doing functions, but loops are coming after

[deleted]

@DynamicSquid All right. Keep up the good work!

AdCharityTester

Cool!

DynamicSquid
Codemonkey51

this looks amazing it could be added to repl. if you want to do that go here: https://github.com/replit/polygott and look thru some files in languages/ to see how it works and how you could add ur lang in a pr

DynamicSquid

@Codemonkey51 oh wow! I never knew I could add my language to repl. I'll take a look at it, thanks!!

Codemonkey51

thats just backend btw they would still have to add it to frontend @DynamicSquid

DynamicSquid

@Codemonkey51 wait I'm confused

Codemonkey51

thats the base docker image it will be on replservers but not a language makeable thru the new repl button @DynamicSquid

DynamicSquid

@Codemonkey51 oh, I see. is there a way to do the front end?

TheForArkLD

@DynamicSquid ill help you
1. make github account
2. fork polygott
3. open languages/
4. add night.toml
5. ill give you toml file to you by discord ( teach your discord name to me pls )

TheForArkLD

@DynamicSquid and you forgot add run program by file

DynamicSquid

@TheForArkLD I did steps 1-5, but I don't have discord. but I forked it though. could you send the info through like a pull request or something? https://github.com/DynamicSquid/polygott/tree/master/languages

DynamicSquid

@TheForArkLD also what do you mean when you say run by file? like when i coded my language I wrote the code in a file, but for this post, I changed it so you can write code in the condole

TheForArkLD

@DynamicSquid i want run program by file
example : ./night main.night

TheForArkLD

@DynamicSquid no, i send toml file for you.
and oh, ill send link here

DynamicSquid

@TheForArkLD oh okay

TheForArkLD

@DynamicSquid nvm i sended pr to you
(./night is for boot repl, ./night file is for run program by file)

DynamicSquid

@TheForArkLD okay, so now I wait?

Codemonkey51

check the circleci errors bc those need to pass for it to be merged @DynamicSquid

TheForArkLD

@DynamicSquid did you add ./night file?

DynamicSquid

@TheForArkLD wdym by that?

DynamicSquid

@Codemonkey51 what is circleci? I can see it building and testing, but what does that mean?

TheForArkLD

@DynamicSquid i want run program by file...

DynamicSquid

@TheForArkLD couldn't you type in ./night?

TheForArkLD

@DynamicSquid fixed bug, merge pls :)

TheForArkLD

@DynamicSquid HEY WE DID IT
TEST SUCCESS!!!!

TheForArkLD

@DynamicSquid BUILD_AND_TEST_CHANGED SUCCESS
BUILD_AND_TEST WILL SUCCESS!!!

DynamicSquid

@TheForArkLD YAY!!! wait, but what does that mean? like what do the tests actually do?

DynamicSquid

@TheForArkLD aw.. it failed

TheForArkLD

@DynamicSquid uhhh build_and_test failed
bc not night error

DynamicSquid

@TheForArkLD what do you mean by that?

TheForArkLD

@DynamicSquid that fail means you cant add that

DynamicSquid

@TheForArkLD oh, YAY! thank you!

TheForArkLD

@DynamicSquid sorry type miss i fixed comment

DynamicSquid

@TheForArkLD oh, aw.. is there a way to fix it?

TheForArkLD
DynamicSquid

@TheForArkLD oh, it's fine anyway. thanks for trying though!

Codemonkey51

well if you guys fix the error circle ci is throwing they can merge it :/ @DynamicSquid

DynamicSquid

@TheForArkLD oh, so, it turns out there was a bug preventing people from merging successfully. the updates are in the pr. but they said that it's better to just create a template with a binary of your language since they're not at that point yet where you can add languages easily

MocaCDeveloper

I LOVE the fact that you're taking it easy and making it simple since it is your first go at making a programming language. I should've done that. It is way easier to just make a copied version of a language then adapt the copied version of a language into your own as time goes on.
I, on the other-hand, tend to get myself caught up on a whole bunch of useless stuff(that probably don't even have a use) and waist my time when I could be fixing the hundreds of bugs my programming language has, lol.

But good job man! You're by far wayy smarter and wayy more advanced than me. Keep it up you're doing great!!

DynamicSquid

@targetfanttthat Oh thanks! I've learned the hard way that when trying something new, go the easy route first to learn what you're actually doing. Trust me, I've fell down that rabbit hole many times before and it was a pain. But thanks! You're going great with your language as well!

KimiTian08

umm

a smart human?
DynamicSquid

@KimiTian08 umm.... uh.... lol

mathiasaboye


I think it could look nice if you removed the "N"

and maybe add more stars?
DynamicSquid

@mathiasaboye oh interesting... thanks for the idea!

mathiasaboye

This took me 3 attempts x)

DynamicSquid
hhbo64

How do you make a Lang?

DynamicSquid

@hhbo64 long or short answer?

hhbo64
DynamicSquid

@hhbo64 Okay, so first you pass code input through something called the lexer. And what the lexer does is it tokenizes the input into tokens, like this:

A token is a struct/class. The type is an enum and the actual token is a string.

Then you pass that through a parser. There are many different types of parsers around, but mine looks like this:

So now we have a value. Then we do the runtime:

And that's it :) Let me know if there's parts in which you're confused. Check out the GitHub page for more info

hhbo64

Thanks! Any good tutorials you [email protected]cSquid

DynamicSquid

@hhbo64 umm... there really aren't any great tutorials out there for making a language. I just started coding and learning through trial and error, and I'm still learning a lot. You can try this tutorial to get started, but my best advice is to just start coding. Start with the lexer :)

hhbo64

K’@DynamicSquid

skiscratcher

@hhbo64 Crafting Interpreters is good. It's a full ebook, and it makes two different interpreters for a toy language. It's even freely available at craftinginterpreters.com

SwaroopBappanad

I visited your page a couple days ago and saw this. But when I looked at it, it had a bunch of folders. Right now it looks like a bunch of binary. How did you change this? (And how did you write and understand that gibberish?)

DynamicSquid

@SwaroopBappanad oh, that's just the .exe ELF file. I coded this in c++, and when you run a C++ program, it generates a .exe ELF file. the actual code can be found on my github page :)

AmazingMech2418

@DynamicSquid ELF, not .exe! This is Linux, not Windows.

DynamicSquid

@AmazingMech2418 I knew that lol

DynamicSquid

@AmazingMech2418 wait, is there an actual difference between the two?

AmazingMech2418

@DynamicSquid Yeah. LOL! ELF is on Linux and EXE is on Windows.

DynamicSquid

@AmazingMech2418 well, yes lol, but I meant other than that

AmazingMech2418

@DynamicSquid Well, they are both binary files on their respective systems, so not much other than that EXE files don't have as low-level control (i.e. you can't make an OS with an EXE file, but can with ELF)

DynamicSquid
StringentDev

It's also the way they are encoded, if they were endoed the same, you would have been able to just directly change the extension from .exe to .elf and back. @DynamicSquid

@AmazingMech2418 wouldn't low level access also allow you to create a really dangerous virus.

AmazingMech2418

@Lethdev2019 Yes, but access to certain parts of the memory storage device on Linux is restricted. Though, if someone could get root privileges, they could completely change the OS and that could cause a huge ransomware attack...

theangryepicbanana

Always nice to see real languages here :)

DynamicSquid
rediar

@theangryepicbanana I mean.. “real languages”? That’s pretty subjective, but I would agree if you said this was a higher quality language

[deleted]


Cool

DynamicSquid

@GoofyGus thanks!!

StringentDev

@DynamicSquid That kinda makes me think of a commodore in which you would type the code and then type run.

Don't use goto 0 alone on a commodore, it creates an infinite loop that goes on forever.

VulcanWM

This is amazing man!

DynamicSquid

@VulcanWM thank you!!!

VulcanWM
Jakman

I like the way your recent projects have been heading lately. Also would you like to give me some programming advice on a project i have been building lately?

DynamicSquid

@Jakman oh yeah thanks! every since summer rolled around, I've been spending much more time programming. and sure, what's the project?

Jakman

@DynamicSquid A File corrupter. It uses both Rust and python. Are you up for it?

DynamicSquid

@Jakman that sounds interesting, but I'm not that familiar with rust or python

Jakman

@DynamicSquid I think i just need advice with my thought process. As I haven't used anything as a glue language before.

DynamicSquid

@Jakman oh sure I guess, I can help

Jakman

@DynamicSquid alright cool

DynamicSquid

@Jakman multiplayer repl?

AphixDev

How did you do this? The file is heavily encrypted lol

DynamicSquid

@nt998302 oh, that's an .exe file. the actual code can be found on GitHub: https://github.com/DynamicSquid/Night

AphixDev

@DynamicSquid Ohhhhhhh. COOL

[deleted]

guys upvote this its purely amazing

DynamicSquid

@NullVoidxA thank you!!!

CodeLongAndPros

This feels like BAPy++L:
BASIC + Python + C++.

(Not a thing.)

DynamicSquid

@CodeLongAndPros kinda of. I tried to combine the simplicity of Python, with the type concepts of C++. notice how there is no main function/class like in C++ or Java, but it's still statically typed

CodeLongAndPros

@DynamicSquid The next thing is to make it golfable.
for example:
int x = 0; == ix0

DynamicSquid

@CodeLongAndPros umm... I don't think I want to do that lol

CodeLongAndPros

@DynamicSquid For golfing!

DynamicSquid

@CodeLongAndPros For actual readable code! lol

mathiasaboye
yay I got pinged!
DynamicSquid
CodingRobot12

This is a cool language. Do you want me to add this to my upcoming search engine?

DynamicSquid

@CodingRobot12 oh sure! and thanks!!

CodingRobot12

ok added you and the repl @DynamicSquid

PizzaisGood

@DynamicSquid I can't wait to learn (or try to anyways)your new language! :)

DynamicSquid

@PizzaisGood oh thanks!! I'll also make a website and everything once I'm done

PizzaisGood
ELDER054

How does Night turn tokens into an AST?

firefish

Now it's perfect.

DynamicSquid
programmeruser

@DynamicSquid is there a way to make syscalls in the current version? I can build File I/O and other things from there

DynamicSquid

@programmeruser no, I'm working on v4 which will be able to support file IO though

programmeruser

@DynamicSquid with syscalls you can have access to the linux kernel

DynamicSquid

@programmeruser Yeah, but im trying not to complicate things yet. Im definitly going to add those later though

DynamicSquid

@programmeruser Hey, if you don't mind, could you create an issue on the GitHub repo about sys calls with the label feature? I'm going to start working on them, and it would be nice to have an issue to keep track of it

CuriousMonkey

did you put this in the jam cuz its not there

DynamicSquid
CuriousMonkey

@DynamicSquid ohh ok i got confused cuz there was a programin glanguage here on share not jam

StringentDev

@DynamicSquid the repl has stopped working.

firefish

@Lethdev2019 What do you mean?

StringentDev

it does not load up. @firefish

firefish

@Lethdev2019 It's a REPL, you type in raw night code and it evaluates it, prints it, and starts again, that's what a REPL is, Read Evaluate Print Loop.

firefish

@Lethdev2019 type your code, then type RUN to execute it, bear in mind it's an ancient version, so prints are done print "a"; not print("a");

fuzzyastrocat

Is Night compiled or intepreted? If it's compiled what does it compile to?
(And, if it happens to be compiled to x86, mind giving suggestions for Sea?)

DynamicSquid

@fuzzyastrocat interpreted

fuzzyastrocat

@DynamicSquid Wow thanks for the quick reply. Just realizing how stupid I am for not looking at the github, where the first sentence is "An interpreted programming language".