I made my own programming language, HERE'S HOW!

Sdílet
Vložit
  • čas přidán 22. 04. 2023
  • I always wondered how a programming language work. This video gives a basic but complete explication. For this, I developed my own programming language, called C--, using C++. I hope you like it!
    #cpp #programming #coding #programminglanguage #compiler
    Check out my discord server: / discord
    Check out my Steam game: store.steampowered.com/app/23...
    Source code:
    github.com/meemknight/C--
    Crafting interpreters:
    craftinginterpreters.com
    If you want to start learning C++ try this video:
    • How To Start or Contin...
    Music:
    less.people - Twilit chillhop.com

Komentáře • 123

  • @KelvinatorIsTaken
    @KelvinatorIsTaken Před rokem +83

    Thank you for adding Subway Surfer video, it extended my attention span.
    Anywho great vidoe!

  • @plasmarade
    @plasmarade Před rokem +42

    Very interesting and entertaining,
    The process isn't easy but it's very rewarding for sure.

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  Před rokem +7

      Yes, it actually has been quite enjoyable so I recommand trying it if you feel like you are up to the challenge!

    • @Real_Programa
      @Real_Programa Před měsícem

      ​@@lowlevelgamedev9330 I am trying and making a good Language!

  • @lorenacroitoru9232
    @lorenacroitoru9232 Před rokem +5

    Woow, it's very interesting! Well done, keep it up!😀

  • @SimGunther
    @SimGunther Před rokem +59

    C-- was already made by Simon Peyton Jones (of Haskell fame) and Norman Ramsey in 1998.
    We must be running out of cool names for languages! 👻😱

    • @ninja_raven256
      @ninja_raven256 Před rokem +9

      was about to comment that lol

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  Před rokem +10

      Didn't know that 😂😂 oh well it is what it is now he doesn't have a while else statement I do so 😂😂

    • @Sculman7
      @Sculman7 Před 7 měsíci +6

      how about C Sharpn't?

    • @user-tk2jy8xr8b
      @user-tk2jy8xr8b Před 5 měsíci +6

      @@Sculman7 C Blunt

    • @ThreeEy
      @ThreeEy Před 5 měsíci

      @@user-tk2jy8xr8b C Flat

  • @retop56
    @retop56 Před rokem +24

    Subtitles would really help in understanding this video better. Thanks for making this!

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  Před rokem +6

      I'll start adding subtitles because I got this complain multiple times. It will take me some time tho 😭😭

    • @jmvr
      @jmvr Před 7 měsíci

      ​@@lowlevelgamedev9330 yk, I don't think subtitles take more than 4 months? Maybe I'm just a god at subtitling tho

    • @nibbletrinnal2289
      @nibbletrinnal2289 Před 5 měsíci +5

      @@jmvr he said he'd *start* doing it, as in, he'll do it in future videos. a quick look at his most recent video shows that he does now do subtitles
      its a bit unfortunate that the older videos don't have subtitles, but its also really tedious (and, algorithmically speaking, not worth it) to go through a backlog of old videos to add subtitles, so its understandable imo

    • @jmvr
      @jmvr Před 5 měsíci +3

      @@nibbletrinnal2289 damn I was so passive aggressive a month ago, and I don't even remember why lol

    • @mikeuk1927
      @mikeuk1927 Před 5 měsíci +2

      ​@@jmvrYou really were xD. Thanks for recognizing it and admitting it. Most people would defend their douchebaggery despite knowing damn well that that was not ok.

  • @cyanuranus6456
    @cyanuranus6456 Před rokem +148

    There's Already a C-- Programming Language in Wikipedia. C-- Programming Language is Designed by Simon Peyton Jones and Norman Ramsey

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  Před rokem +47

      yeah I didn't know that when I started making this video, but it is just a joke after all so I think I'm ok 😂

    • @cyanuranus6456
      @cyanuranus6456 Před rokem +5

      @@lowlevelgamedev9330 Then Make a Different Name

    • @cyanuranus6456
      @cyanuranus6456 Před rokem +1

      @@lowlevelgamedev9330 Update The Syntax. Edit The Binary Code

    • @Sammysapphira
      @Sammysapphira Před rokem +45

      ​@@cyanuranus6456 it's just a joke dude

    • @andriiukraine6697
      @andriiukraine6697 Před 10 měsíci +1

      Used it last time in early 2000-x as I remember...

  • @vulnoryx
    @vulnoryx Před rokem +3

    Very informative

  • @xWatexx
    @xWatexx Před 8 měsíci +4

    Compilers just really read your intentions and turn them into machine code. You could write anything into a file and have a compiler of some kind understand it and make it work.

  • @astrahcat1212
    @astrahcat1212 Před 9 měsíci +5

    When making a game, you're probably gonna at least be creating a simple interpreter based scripting language, so you can run commands while the game is running. That's how I'd actually start making a game from scratch, that is, start with File I/O reading and writing to the system, then create basic actions like showimage() etc..., create an interpreter object if it's oop style and create a main loop that runs the vector list of interpreters. All this before touching graphics I think is a solid way of operating. Almost everyone puts the cart in front of the horse and seems to want to draw a 3d cube immediately to screen using opengl, but that's not where the game logic is actually happening. The graphics are the output, so in a sense focusing on the output last is a big help I think.

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  Před 9 měsíci +1

      well depends on what you want to make, I don't like for example scripting langiages for game dev so I would never do that, also you can't have gameplay without graphics so

    • @astrahcat1212
      @astrahcat1212 Před 7 měsíci

      @@lowlevelgamedev9330 Technically, you can have gameplay without graphics, if your monitor shuts off and the screen goes black, the game is still up and running.

    • @svenyboyyt2304
      @svenyboyyt2304 Před 5 měsíci +1

      What do you mean commands while the game is running? And if so, it doesn't need to be the primary way you program the game, because it's super inefficient

    • @PamellaCardoso-pp5tr
      @PamellaCardoso-pp5tr Před 5 měsíci

      I can see that If you want to add some sort of in-game console to debug shit or to give players superser Powers like most valve games does.
      But for anything else i dont really see a benefit...

    • @seanvogel8067
      @seanvogel8067 Před 5 měsíci

      @@lowlevelgamedev9330, how about adventure?

  • @realbytebit
    @realbytebit Před rokem +1

    good stuff

  • @deepL0
    @deepL0 Před rokem +4

    It can be benefitfull for being better developer and understanding how computers work

  • @cyrilemeka6987
    @cyrilemeka6987 Před 5 měsíci +3

    5:28 what construct is that? I know it's not BNF syntax, but it kinda looks like it though. I'm creating my own language too, i use EBNF to define my language syntax before implementing in the parser

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  Před 5 měsíci

      It is just a Regular Free Grammar, I'm not advanced in this field so I don't know if it follows any standard conventions, I just used it in the same way it was used in the article that I learned from, and it is kust a regex ish sintax, so it is more for me to help me than to be something standard.

    • @cyrilemeka6987
      @cyrilemeka6987 Před 5 měsíci

      @@lowlevelgamedev9330 oh, okay. Nice language btw

  • @anon-fz2bo
    @anon-fz2bo Před rokem +8

    Regex is a lifesaver for stuff like this. Also zig has a good builtin tokenizer

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  Před rokem

      yes, most programming languages write them from scratch however as far as I know but I might be wrong

    • @mikeuk1927
      @mikeuk1927 Před 5 měsíci

      Cue that StackOverflow post about parsing HTML with regex :p

  • @EdKolis
    @EdKolis Před 5 měsíci +1

    If C++ is a one dimensional grid of plusses and C# is a 2D grid of plusses, I'm waiting for C-Starbase with a 3 dimensional grid!

  • @griffindragon3562
    @griffindragon3562 Před 7 měsíci +1

    Damn it. This video loaded slowly and i distracted. When the video started, i thought some sparkiling sound in my surrounding and panicked only to realise that they are key strokes. 😅

  • @1Dr490n
    @1Dr490n Před rokem +7

    Here’s how to make a compiler: so I’ve made this interpreted language…
    (I haven’t fully watched this video, don’t know how it’s gonna be, this just seemed funny to me)

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  Před rokem

      🤣😂 Yeah so basically from interpreted to compiled there is one more step but the rest of the process is the same.

    • @1Dr490n
      @1Dr490n Před rokem +1

      @@lowlevelgamedev9330 Lexer and parser are the same, for compilers you then have to compile it (which is a really big step) and for interpreters you then have to write a virtual machine or something like that (which is really different)

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  Před rokem

      Yes

  • @DanyOriCe151
    @DanyOriCe151 Před 3 měsíci

    Salut, Vlad :))

  • @AE4i1
    @AE4i1 Před rokem

    While() { } else{ }
    I love that XDDDDDD

  • @tmahad5447
    @tmahad5447 Před 10 měsíci +3

    Web devs building a website: I'm genius
    Real Chad's building languages: 🗿 czcams.com/video/FSuGx2758Y4/video.html&ab_channel=FRANXD

  • @x_techno_pro
    @x_techno_pro Před 5 měsíci

    C-- already exist, it is a programming language made for compilers

  • @mamertvonn
    @mamertvonn Před 5 měsíci

    Why stop at while else. Make a while catch, for catch, if catch

  • @AntonioNoack
    @AntonioNoack Před 5 měsíci

    You should install a spellchecking extension. That will keep your code cleaner, and might help your pronunciation, too.
    E.g. "semicolin" 😅(you pronounced it like that, too xD). It's "semicolon".

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  Před 5 měsíci

      ye I should improve my spelling 😂 I don't want to use ine in code tho I thpught about it but I fell like that might just annoy me

    • @AntonioNoack
      @AntonioNoack Před 5 měsíci

      @@lowlevelgamedev9330 Just try it 😊. When you feel like it's incorrectly marking something, you can disable it for that term.

  • @vldg2712
    @vldg2712 Před 6 měsíci

    Same dude from the channel with Linux?

  • @ProfessionalNoun
    @ProfessionalNoun Před 5 měsíci +2

    Real men write compilers in machine code.

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  Před 5 měsíci

      yes, next video I'll write the code on a stone tablet on a stranded island 💪

    • @havenselph
      @havenselph Před 28 dny

      ​Why do that by hand? Make your language output to stone tablets, much easier. ​@@lowlevelgamedev9330

  • @abdelrahmanmohmed3185
    @abdelrahmanmohmed3185 Před rokem +1

    Can you make your own programming language with c++

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  Před rokem +1

      Yes and it is not that difficult actually

    • @abdelrahmanmohmed3185
      @abdelrahmanmohmed3185 Před rokem +1

      @@lowlevelgamedev9330 ok I want to make a programming language with c++ for making games or 3d like direct x or Open gl ,can I?

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  Před rokem +1

      It is defenetely possible but it will take a lot of time. You will learn a lot tho.

    • @abdelrahmanmohmed3185
      @abdelrahmanmohmed3185 Před rokem +1

      @@lowlevelgamedev9330 why its forbidden? If I made it what will happen for me?

    • @coolcatcher126
      @coolcatcher126 Před rokem +4

      @@abdelrahmanmohmed3185 The gods of DirectX and OpenGL will smite you with the power of GPU drivers and low level code.

  • @palapapa0201
    @palapapa0201 Před 5 měsíci

    Opperator vs Operator

  • @vk8a8
    @vk8a8 Před 9 měsíci +4

    Make C flat now.

  • @luckybutunlucky8937
    @luckybutunlucky8937 Před rokem +2

    Don't wanna throw shade and I don't know if this is what I'm doing but, I've made a compiler for my language that basically acts like assembly but easier. A single letter, char or byte can equal one instruction that is linked to a function in the interpreter. Depending on the instruction the next byte or bytes will be read to satisfy the function parameters. WHY THE FUCK you all have to make it complicated? Mine handles multithreading even and the compiler is still way smaller than yours it seems. O_O

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  Před rokem

      hm you will have to explain what part is complicated because I usually try to not overengineer stuff

    • @luckybutunlucky8937
      @luckybutunlucky8937 Před rokem

      ​@@lowlevelgamedev9330 I'm just talking about your syntax and all. Not to mention I try to not use any header files and stuff unless I'm gonna reuse the code later. So mainly most programs I do are just one .CPP file that I compile into a program. I'm not a professional or anything it's more of a hobby at the moment, so maybe workers require you to implement all that extra stuff.

    • @luckybutunlucky8937
      @luckybutunlucky8937 Před rokem

      @@numerius You do know you can make a C/C++ program from just a .CPP file right? You must be used to doing Python I guess.

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  Před rokem

      @@numerius Well specificatly because C++ is very bloated you have to take extra care. It has some nice features that are worth it so this is why my C++ code looks more like C.

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  Před rokem

      @@luckybutunlucky8937 yeah unity build. You can use headers tho. It compiles faster btw and there are some other small benefits.

  • @anonymous49125
    @anonymous49125 Před 6 měsíci

    unironically, a while+else would be baller

  • @IlliaZhdanov
    @IlliaZhdanov Před 11 měsíci +1

    C-- already exists.

  • @TheRealMangoDev
    @TheRealMangoDev Před 5 měsíci

    DUUUDE c- already exists. and if it didnt, i would make it. i thought c- wasnt a “joke”

  • @MundodasGuitarras
    @MundodasGuitarras Před 7 měsíci

    c-- already exists, it's just exremely unknown

  • @imabstrong
    @imabstrong Před rokem

    Next time call the language C?C--:0

  • @dionnix
    @dionnix Před 5 měsíci

    C Sharpn't

  • @tgp_assassin
    @tgp_assassin Před 6 měsíci +1

    c m m

  • @yarburart7242
    @yarburart7242 Před 5 měsíci

    it's not like a Slavic B++ . . .

  • @623-x7b
    @623-x7b Před 10 měsíci +1

    You created an entire programming language because you don't know about -Wfatal-errors 😂

  • @user-qt5nz7tn4l
    @user-qt5nz7tn4l Před 5 měsíci

    archanomigentoblawg made worse version of c

  • @Hellbending
    @Hellbending Před 5 měsíci

    Look, I’m gonna say this is respectfully as I possibly can.
    Please stop fucking flashbanging me 😂😂😂
    Your jump cuts between a dark background, and a fucking white webpage, killing me man… i’m only a minute and 15 seconds in and I am turning the video off sadly…
    (Who even browses the web without a fucking Dark Mode, psycho stuff 😂😂😂 - Dark Reader is your friend homie)

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  Před 5 měsíci +1

      good point, I have never thought about this aspect, thanks 💪

  • @Howtodo-oz2du
    @Howtodo-oz2du Před 8 měsíci

    Do you have discord?