Making My Own Programming Language and Coding a Game in It

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 พ.ค. 2024
  • I developed my own programming language, called Z-Sharp (Z#), using C++. Then I went through the process of coding an entire game in it.
    Source and Binaries
    Get it on Github: github.com/sam-astro/Z-Sharp
    Or get it on Itch.io: astrosam.itch.io/z-sharp
    Support:
    ● Patreon: / astrosam
    ● Ko-fi: ko-fi.com/astrosam
    ● Monero: 4AAjyAHKnYwCsgJp16v1YeeDPA1Z51QKUfCMWsiCDxkNBFCtbUfDHD7K5sZDrFH2pnGsDAH989XwXdudcoC4iqtVC9QLk8r
    --------------------------------------------------
    Related Links:
    ● Streaming Channel: / @astrosamstreams
    ● Itch.io: astrosam.itch.io/
    ● Github: github.com/sam-astro
    ● Discord Server: / discord
    --------------------------------------------------
    Music:
    Ocean Loader 3
    EarthBound (various songs)
    --------------------------------------------------
    Chapters:
    0:00 Intro
    1:36 Compiled or Interpreted?
    2:42 Syntax?
    4:08 What to name it?
    6:14 The game I chose
    6:48 Draw rectangles
    7:24 Movement
    7:40 Making a ball
    8:06 Displaying scores
    8:20 Troubleshooting performance
    8:54 Making AI
    9:05 Fun with sprites
    9:18 Source and Binaries
    --------------------------------------------------
    THIS VIDEO IS NOT SPONSORED
    #cpp
    #programming
    #coding
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 1.4K

  • @realrazoblast4643
    @realrazoblast4643 ปีที่แล้ว +1751

    I made my own planet, then made humans evolve, I then made them make PCs and then made them make their own programming language, and then I made my own game.

    • @willinton06
      @willinton06 ปีที่แล้ว +132

      Using the default fundamental forces? Weak

    • @your_name96
      @your_name96 ปีที่แล้ว +16

      God

    • @Mahlak_Mriuani_Anatman
      @Mahlak_Mriuani_Anatman ปีที่แล้ว +5

      God

    • @americansoil8260
      @americansoil8260 ปีที่แล้ว +31

      Would you be willing to share the code. That sounds cool

    • @realrazoblast4643
      @realrazoblast4643 ปีที่แล้ว +24

      @@americansoil8260 sure, except um like the code is 174 exabytes so help

  • @siddhantsingh802
    @siddhantsingh802 2 ปีที่แล้ว +2383

    I'm here before this channel explodes in popularity! Absolutely phenomenal AstroSam!!! I will also try to replicate this some day

    • @AstroSamDev
      @AstroSamDev  2 ปีที่แล้ว +117

      Thank you so much!

    • @ritomghosh
      @ritomghosh 2 ปีที่แล้ว +6

      Me too

    • @underscore__
      @underscore__ 2 ปีที่แล้ว +4

      yup.

    • @miplol
      @miplol 2 ปีที่แล้ว +1

      same

    • @Wallee580
      @Wallee580 2 ปีที่แล้ว +3

      Is 587th subscription before exploding?

  • @TuckerTheMandolinist
    @TuckerTheMandolinist 2 ปีที่แล้ว +1461

    This has been really inspiring, I've began work on my language called Red Squirrel, with syntax similar to Java, Lua, GML and Squirrel (Obviously) I've made literally everything already, besides the language itself.

    • @mek101whatif7
      @mek101whatif7 2 ปีที่แล้ว +25

      Memory management?

    • @TuckerTheMandolinist
      @TuckerTheMandolinist 2 ปีที่แล้ว +82

      @@mek101whatif7 its not really like squirrel at all xD Maybe the name, but everything else completly different. (besides the fact they are both inspired by lua)

    • @thegrandnil764
      @thegrandnil764 ปีที่แล้ว +32

      I'm finishing up writing my language, and then I'm going to write my OS in it.

    • @techlifejournal
      @techlifejournal ปีที่แล้ว +16

      Is it possible to built a language whose syntax is similar to python but can generate byte code like JAVA and perform like java to built mobile, web apps?

    • @TuckerTheMandolinist
      @TuckerTheMandolinist ปีที่แล้ว +5

      @@techlifejournal not sure

  • @bananacraft69
    @bananacraft69 9 หลายเดือนก่อน +90

    I think many people would be interested in a tutorial(series) on how you made this and how to make a language yourself.

    • @kernelpickle
      @kernelpickle 8 หลายเดือนก่อน +17

      Exactly, because I honestly couldn’t care less about how it differs from the languages that were his inspiration, or that he could use it to make a game as simple as Pong-he left out the most interesting part, which is the process he went through to make it.
      I’m now wondering if he just re-skinned another language, by writing a translation layer that just converts everything he typed into the original language which already has a functional way to translate the higher level code into the code executed by the CPU or if he got down into x86 assembly code, and worked his way up from the bare metal.
      Or was it something in between? If there’s nothing inherently different going on that one of the million other languages we have, then we’re at a point where we’re just making it easier to read and write, which is kind of pointless when we could just keep working on LLMs so that they can just be given a description of the parts of the program you’re trying to write, and it just translates that into a binary that compiled for your CPU. Why edit code when you can just edit a bunch of pseudo code and comments like the kind a king might bark at peasants forced to do his bidding. Then debugging would just be like grading an English paper, and admonishing it for it’s mistakes.

    • @Hapasan808
      @Hapasan808 5 หลายเดือนก่อน

      ​@@kernelpickle Agreed, the part I wanted to see was how he made his compiler.
      What you are thinking of is a "Source-to-source compiler." For example, coffeescript, which compiles to javascript.
      EDIT: That's a good question, I wouldn't know exactly how to create a binary off the top of my head without researching it.
      1: You could package your compiler with GCC, then your compiler just translates it to a CPP file, (source-to-source) then just run it through GCC to create a binary, which would be kind of lame but it would work.
      2: Or you could create an interpreted language (so not really a compiler) that just reads and runs your codes text file. It creates no binaries.
      To create a binary, you'd somehow have to translate it into machine code. I'm not exactly sure what's the best way to go about that, e.g. if there are some shortcuts without being an expert of machine code.

  • @andresdarklag
    @andresdarklag ปีที่แล้ว +629

    My automatons teacher made us make a language and a compiler, the language that I made is called "Monkey Script", and everything is monkey.
    Instead of using "+,*,-,+" I used "monkadd" "monktimes" "monkminus" and "monkplus"
    Data types where:
    int -> wholeMonke
    double -> decMonkey
    string -> strgMonke
    You get the idea, it was fun, but eventually we had to make the compiler where the not so fun part begins, where you use assembly language, and ended up cheesing the project mostly because of time, just making it so it translates my language to Java and execute it in the spot, teacher didn't notice lmao she never checks the source code for some reason

    • @AstroSamDev
      @AstroSamDev  ปีที่แล้ว +104

      Haha that is so funny! I would love to see a future of every developer using Monkey Script 👀. It's weird that any teacher that made you program something doesn't check the code, but ha I guess you were lucky then! 😁

    • @user-dh8oi2mk4f
      @user-dh8oi2mk4f ปีที่แล้ว +4

      What language did you write the compiler in?

    • @ducmhng
      @ducmhng ปีที่แล้ว +9

      @@user-dh8oi2mk4f He said he used assembly

    • @Solomonwo
      @Solomonwo ปีที่แล้ว +1

      @@user-dh8oi2mk4f shut

    • @user-dh8oi2mk4f
      @user-dh8oi2mk4f ปีที่แล้ว +6

      @@Solomonwo ????

  • @dynpallomah5918
    @dynpallomah5918 ปีที่แล้ว +80

    i have learnt all my computer-related knowledge by myself in almost 6 yrs and creating a language has been a dream almost from the very beginning. after 6-7 attempts i think i finally got it right. it is the best achievement in these yrs so far, i think. even tho its likely that no one will use or even know ur lang, u learn so much stuff from just trying. and in that regard writing a compiled lang (that compiles into asm) can help understand the fundamentals of computers

    • @madhuripendyala7930
      @madhuripendyala7930 ปีที่แล้ว +5

      MY DREAM IS MAKING A PROGRAMMING LANGUAGE

    • @NathanHedglin
      @NathanHedglin ปีที่แล้ว +7

      Congratulations! Making an interpreter or compiler is a huge task and really helps a developer level up.

  • @AshtonSnapp
    @AshtonSnapp 2 ปีที่แล้ว +453

    I’ve been working on a programming language called Rouge for a while. It’s primarily inspired by Rust (which I’m coding the compiler and runtime in), but also takes the compile-once-run-anywhere approach and a bit of the project structure from Java, and the syntax is primarily inspired by Ruby/Lua (end keyword so indentation can be ignored).
    I’ve still got a lot to figure out, such as:
    - how to write a parser
    - how to JIT compile from bytecode (until I figure this out the runtime will have to interpret the bytecode)
    - what should the bytecode instructions be
    - how to access stuff that is external to the runtime
    - how to make the runtime embeddable in other programs with custom hooks (for use cases like game modding or app plugins)

    • @AstroSamDev
      @AstroSamDev  2 ปีที่แล้ว +78

      Good luck, it seems your project scale is much larger than mine 😁. I still have much to learn, and this project was just my attempt at making something without research and just diving in. I could definitely make something much better if I first saw how others have done it. I hope you get it working soon!

    • @SimGunther
      @SimGunther 2 ปีที่แล้ว +52

      Anytime I hear "write once run everywhere", I keep hearing "write once debug everywhere" :D

    • @AshtonSnapp
      @AshtonSnapp 2 ปีที่แล้ว +18

      @@SimGunther That’s also true!
      Ideally, the runtime would be implemented in a way that any runtime or interpret-time bugs that show up wouldn’t be platform specific. But I don’t really know what I’m doing so don’t count on it happening!

    • @mek101whatif7
      @mek101whatif7 2 ปีที่แล้ว +11

      Maybe you could just compile it straight to WebAssembly, which is a bytecode standard.
      From that point you would only need on of the many WebAssembly compilers/JITs/interpreters to run it

    • @faceboy1392
      @faceboy1392 ปีที่แล้ว +1

      I've been trying to design some syntax ideas for a custom language that I'm calling Aspen, it's gonna be just a bytecode compiler since idk how to do stuff like JIT compiling. I don't really know what I'm gonna do with the language or if I'm even gonna try to turn it into anything more than just some project I work on, but hopefully I can do something interesting with it. Definitely not a project as large as yours, though. Good luck with your language!

  • @wonkywonky6307
    @wonkywonky6307 2 ปีที่แล้ว +10

    That is amazing, congratulations on such a good achievement! You're an awesome programmer, ncie job man.

  • @Red_Biker_Dude
    @Red_Biker_Dude ปีที่แล้ว +14

    This is a really good video that clearly has effort put into it. More people need to find this channel!

  • @AstroSamDev
    @AstroSamDev  2 ปีที่แล้ว +548

    Z# is still very early in development, and there are plenty of missing features and bugs. Feel free to make a small game or demo, but it is fairly limited 😄.
    Also, I have received a few comments regarding my choice of the letter "Z" and recent events. Before you comment about it, realize that I made this language in early January. Almost 2 months before Russia invaded Ukraine! And outlawing a letter from the alphabet we use every day is ridiculous. Please try to keep politics and negativity out of my comments. Thank you!
    I created a discord server recently, so if you want to talk about programming, art, game dev, or just hang out, feel free to join!
    discord.gg/9p82dTEdkN

    • @KanashimiMusic
      @KanashimiMusic 2 ปีที่แล้ว +102

      Are we really at a point where someone receives comments for choosing a letter that may be problematic in a COMPLETELY unrelated context? Is this really how far we have come?

    • @alexstone691
      @alexstone691 2 ปีที่แล้ว +42

      Could somebody explain what does letter Z have to do with russia/ukraine situation??

    • @KanashimiMusic
      @KanashimiMusic 2 ปีที่แล้ว +52

      @@alexstone691 Apparently, it's a Russian military symbol and it was used in propaganda or something like that

    • @mobius7745
      @mobius7745 ปีที่แล้ว

      @@alexstone691 It's just a symbol so Russian forces can know who is ally. Now people for some reason can't see a "Z" anymore because it's like being satanic or something lol

    • @SethReviews
      @SethReviews ปีที่แล้ว +39

      too late, just added Z# to my resume

  • @GGDev7
    @GGDev7 ปีที่แล้ว +2

    absolutely awesome, seeing you creating your own language is absolutely amazing, keep it up with your amazing video dude!
    YOU ROCK!

  • @FallofDarkness55-Resurrected
    @FallofDarkness55-Resurrected ปีที่แล้ว +97

    You should go through the process of how you created your programming language. This is so frickin' cool, man. You are an inspiration.

    • @itsAdopo_DevXD
      @itsAdopo_DevXD 10 หลายเดือนก่อน

      what if make with this language a GameIngine cause it looks a little bit ez than c# or c++ , i hop u ready my comment
      and why not make one if u can (Or u can"t do that :O ) just kidding :)
      Why not just make a simple one and make updates on it
      im just saying

    • @_syntaqs
      @_syntaqs 9 หลายเดือนก่อน +8

      ​@@itsAdopo_DevXDI'm designing a language right now, I'll think of making a discord server, but I'm not sure if you're old enough to be on discord after looking at your speech patterns.

    • @FluffScripts
      @FluffScripts 9 หลายเดือนก่อน +2

      @@_syntaqs So not knowing english as a native language means they're underaged? Nice logic buddy.

    • @_syntaqs
      @_syntaqs 9 หลายเดือนก่อน +8

      @@FluffScripts No, you clearly never saw an underaged person on the internet. Many people whose first language isn't English are generally more articulate than this. Pay attention.

    • @FluffScripts
      @FluffScripts 9 หลายเดือนก่อน +1

      @@_syntaqs You'd be surprised. I've been on the internet for over 14 years, I run an entire community and such. Quite able to distinguish, don't be so quick to judge people online.

  • @DevNoob
    @DevNoob 2 ปีที่แล้ว +34

    I'm always so intruiged about people making their own language. Very impressive. Really, really cool!

    • @AstroSamDev
      @AstroSamDev  2 ปีที่แล้ว +4

      Thank you very much!

  • @UnderfundedScientist
    @UnderfundedScientist 2 ปีที่แล้ว +118

    Absolutely legendary , I learned a ton and it was super interesting

    • @AstroSamDev
      @AstroSamDev  2 ปีที่แล้ว +16

      Glad you enjoyed it! I had a lot of fun making it.

    • @UnderfundedScientist
      @UnderfundedScientist 2 ปีที่แล้ว +7

      @@AstroSamDev it's always something magical when you enjoy what your doing

  • @dtikvxcdgjbv7975
    @dtikvxcdgjbv7975 5 หลายเดือนก่อน +2

    Congratulations, man! Your work is encouraging and inspiring to others.

  • @SuubUWU
    @SuubUWU ปีที่แล้ว +6

    We had a similar project for my Systems Software class. It’s not a creative as making everything from scratch but we did have a semester long assignment where we essentially built the PL/O language from scratch

  • @dsi-films1264
    @dsi-films1264 ปีที่แล้ว +19

    Wow I've always wanted to make my own programming langauge and have thought about it for quite a while just because although other reasons the thought of being able to control everything in it to be how you like and how it looks and also making it really good (design wise), Glad to see someone make one! I saw a comment earlier to this about making your own computer from scratch like it's own processor, and other computer parts etc., creating your own entire operating system for it and then possibly (this could be challenging) have your own computer language to run most of the things in it which would be really cool to see, I've always considered that too and it would be an awesome thing to see you make.
    I saw you reply about thinking of that idea and how it was similar to jdh and Ben Eater's projects in that comment which are some of the channels I was inspired by too and I was shocked when I saw that (but that was probably unsurprising), insane how you can find people with super similar interests. I'm really happy I found this channel and I can't wait to see you grow more, you have a great personality and voice and the editing+ideas in this video were all on point! It feels like i've struck gold and something super relatable, thank you and continue making more videos because it's been amazingly fun to watch

  • @Fr0stKnight0k0
    @Fr0stKnight0k0 2 ปีที่แล้ว +4

    Excellent content! I learned a lot from this!

  • @TheCardsmania
    @TheCardsmania ปีที่แล้ว

    Your project is super. I tried recently to create mine, and your hints could help me.

  • @kingpennotch8151
    @kingpennotch8151 ปีที่แล้ว +1

    Dude this is actually insane!🤯 I hope I can do this one day, I can't wait to see you blow up one of these days! 👏

  • @Nick-lx4fo
    @Nick-lx4fo 2 ปีที่แล้ว +3

    Thanks for explaining Pong, I really never heard of it until this video.
    Jokes aside, great explanations and aesthetics!

  • @cellmachiner
    @cellmachiner ปีที่แล้ว +3

    Your channel is criminally underrated bro, best luck to you in the future with your channel

  • @Blinkers2007GameDev
    @Blinkers2007GameDev ปีที่แล้ว

    That was amazing. Could use this for future projects!
    Thanks

  • @federico.r.figueredo
    @federico.r.figueredo ปีที่แล้ว

    What a beast my man! Can't wait to see a compiled language too.

  • @blacklistnr1
    @blacklistnr1 2 ปีที่แล้ว +187

    This video was such a roller coaster for me:
    *sees title * wow this must be an impressive series
    *sees video length* wtf!? do they add a text macro prepass to python?
    *talks about complexity and languages* oh this must be quite insightful after all
    *half the video done* Soo.. the important design decision are its name and syntax sugar? This must be a troll toy language after all
    *sees it syntax highlighted* wait wat? I blinked and now it has a language server, a formal syntax specification and the interpreter seems to work
    *Console only* I see.. this is a demo of an interpreter for this language, pretty cool
    *Game with real time graphics* Excuse me!? are skipping steps again, type inference, optimisations, JIT, LLVM + GPU shaders?
    *Performance issues with sprites* Phew no steps skipped this time, I get it
    *Debug mode* *Table Flip*. ...This goofball is actually a genius
    *checks github* *looks for AST and nodes* *finds only anyops.h* O_o
    I think I'll come back in an year when this channel blows up

    • @KanashimiMusic
      @KanashimiMusic 2 ปีที่แล้ว +8

      It was the interpreter (written in C++) running in debug mode, not the program he wrote in Z# :)

    • @madhuripendyala7930
      @madhuripendyala7930 ปีที่แล้ว

      @@KanashimiMusic Did You Know There Is ZenScript(ZS!?!?)

    • @azrealIPM
      @azrealIPM ปีที่แล้ว +2

      @@madhuripendyala7930 one thats not relevant and 2 thats ZS not Z#

    • @LostGameDev102
      @LostGameDev102 ปีที่แล้ว

      @@azrealIPM ZenScript and Z# both have the same file name .ZS

    • @Zytron
      @Zytron ปีที่แล้ว

      @@LostGameDev102 actually that's pretty interesting
      but still not relevant to what Nyde said
      would be relevant in general comment section though

  • @idoblenderstuffs
    @idoblenderstuffs 7 หลายเดือนก่อน +3

    honestly seems like a really really great beginner language, that doesnt bother with all the complicated parts of graphics libraries or stuff like that. if this got more people working on it, it could end up as something really really good.

  • @sixty502
    @sixty502 2 ปีที่แล้ว +2

    Can’t believe I’ve not found you before. This video is exactly the sort of thing I love

  • @adaai2384
    @adaai2384 ปีที่แล้ว

    This is incredibly cool. Keep working on it!

  • @v0xl
    @v0xl 2 ปีที่แล้ว +64

    I've written a couple of assembly-like langs before that compile to BrainFcuk, but you inspired me to create a better one.
    btw it looks like it was partially inspired by love2d

    • @KanashimiMusic
      @KanashimiMusic 2 ปีที่แล้ว +5

      Compiling to brainf*ck sounds fun, that's like a completely different level of messed up

    • @egg.loafffff
      @egg.loafffff ปีที่แล้ว

      Brainfcuk XD

  • @nickandres7829
    @nickandres7829 ปีที่แล้ว +45

    I've just started learning Python, and seeing this video was really inspiring. Often I see little programs written in other languages, and would like to try making them in Python, but don't always know the different syntaxes and keywords. I would like to write a program one day where you can code in one language and then translate it to another syntax (turing Python code into Java, etc)
    Right now though, I am trying to write a simple chess game where on the player's turn, the value of moves is shown by color, so you can "see" why certain moves are better than others.

    • @Andrei-qi4tm
      @Andrei-qi4tm ปีที่แล้ว

      you can convert python code to java with chatGPT :))
      maybe he might help you learn to code better, i'm using it and i learnt so much

  • @TheCodeTinkerer
    @TheCodeTinkerer ปีที่แล้ว

    You have a very great selectrion of background music in you vidoes. Great that you actually list it.

  • @officebatman9411
    @officebatman9411 10 หลายเดือนก่อน +1

    This is really inspiring! Would love to see you explain how you made everything and what are the different features you implemented

  • @wijiler5834
    @wijiler5834 2 ปีที่แล้ว +3

    I'm making a compiler and this was super inspiring for me

  • @TheStickCollector
    @TheStickCollector 2 ปีที่แล้ว +6

    I've always wanted to do this
    Seems like a good challenge when I learn how to code efficiently

  • @vakqdev
    @vakqdev ปีที่แล้ว

    This is awesome! I would love to see more dev-logs...

  • @teeraponjeamphue2941
    @teeraponjeamphue2941 ปีที่แล้ว

    I love this content. I feel like u did the really really big thing for this video and this make many of ppl's dream come true(at least me).
    Thx for your z#. I hope one day it's hit and everyone use it global.

  • @meercat1880
    @meercat1880 2 ปีที่แล้ว +4

    this is super cool. I actually really want to use this language at some point

    • @AstroSamDev
      @AstroSamDev  2 ปีที่แล้ว +1

      Thank you! I hope that by the time you do use it, I've made it better. There are issues with syntax pickiness, because the code needs to be absolutely perfect, even down to the spaces and parenthesis.

  • @festivityreal
    @festivityreal 2 ปีที่แล้ว +74

    I've been working on a Programming language called ENG, Which uses very english like syntax. There are primary and secondary functions, Primary is the say (print), and display (Explains itself0

    • @festivityreal
      @festivityreal 2 ปีที่แล้ว +15

      more info: display sucks, its the most difficult thing to use, you need to draw and reasset it

    • @SCRPXXL
      @SCRPXXL ปีที่แล้ว

      Damn I was thinking of doing something similar but I knew it would have been very inefficient, good luck.

    • @festivityreal
      @festivityreal ปีที่แล้ว +1

      @@SCRPXXL Thanks bro, the language will be getting new functions called spriting`s (display,if i am pressed(),etc.)

    • @guineanfootballlover
      @guineanfootballlover ปีที่แล้ว +7

      Make a discord server for its devolpment. I am very intrested in it

    • @waseemq1522
      @waseemq1522 ปีที่แล้ว +3

      Yes the discord server idea is lit

  • @abelkidanemariam6485
    @abelkidanemariam6485 ปีที่แล้ว

    The quality of the content is so amazing. we will watch your career with greater interest 😊😊

  • @mkpanda
    @mkpanda 2 ปีที่แล้ว +1

    This is awesome! Feels like you will explode in popularity.

  • @dm9910
    @dm9910 ปีที่แล้ว +42

    There's so much going on in this video I think you should have split it into 3 parts: the language design, the implementation, and then finally demoing the language with your pong game. It would have been nice to see you go into more depth on this, especially on how you actually went about writing the interpreter and graphics engine, 10 mins really doesn't do it justice

  • @TAPgiles
    @TAPgiles ปีที่แล้ว +6

    “Here’s how I made an interpretive language. I decided on a couple things I wanted to work differently, and came up with a name and logo. And it became real somehow.”

  • @jacksun1604
    @jacksun1604 2 ปีที่แล้ว +2

    Very high quality video, great job!

  • @aquamxrine
    @aquamxrine ปีที่แล้ว

    this is so high quality! i thought you would have had millions of subscribers! underrated as heck

  • @Venopon
    @Venopon ปีที่แล้ว +3

    A triangle calling a circle, "Pointless."
    Z-Sharp calling C-Sharp, "Pointless."

    • @Mudye
      @Mudye ปีที่แล้ว

      39 c'd, 0 z'd.

  • @wiking2888
    @wiking2888 2 ปีที่แล้ว +6

    Finally... A person who actually credits EarthBound for its songs

  • @thetiker9719
    @thetiker9719 ปีที่แล้ว

    Broooo, you are so underrated you deserve so much more! I love this video!

  • @TheCaptainMoo
    @TheCaptainMoo ปีที่แล้ว

    Super cool video! Really interesting to watch and very inspiring :D

  • @CallmeSamy
    @CallmeSamy ปีที่แล้ว +10

    so its basically Python with curly braces and without colons

  • @Guy_Sandler
    @Guy_Sandler ปีที่แล้ว +8

    What a coincidence, I wanted to make a similar thing to this and good thing I found an explanation to this
    Also you basically combined js, c# and python

  • @rubenuijtde
    @rubenuijtde 2 ปีที่แล้ว +1

    Here just before 1K subs. Can't wait to see you blow up! Within the first 10 seconds I literally already thought I was watching a channel with 100K subs. Amazing stuff!

    • @AstroSamDev
      @AstroSamDev  2 ปีที่แล้ว

      Wow, thank you! I'm so happy you enjoyed! 😁

  • @zoemarilyntuttle677
    @zoemarilyntuttle677 ปีที่แล้ว

    Perfect one with a complete step by step details u had shown.. thx u !!!

  • @yulin84
    @yulin84 2 ปีที่แล้ว +3

    very cool
    u almost sold me on getting rid of semi-colons but what about the cases where multi-lining some code makes it more readable

    • @AstroSamDev
      @AstroSamDev  2 ปีที่แล้ว +2

      You are right, I think there are some good use cases like that. I'm a person who normally uses C-based languages, which do end with the ";". I just wanted to make something a bit more unique, and a change of pace from what I normally might use. (Even though it's been pointed out to me that Z# really resembles python, so maybe not THAT unique.)

  • @porky1118
    @porky1118 2 ปีที่แล้ว +4

    You don't have to design both, the syntax and the semantics, when creating a programming language. They could be seen as separate projects.
    I hope, one day, all language semantics will be defined in terms of hierarchies (nested lists of symbols and lists) and all syntaxes will expand to these lists.

    • @petermuller608
      @petermuller608 ปีที่แล้ว

      I don't get your drift. Syntax and semantics are what define a language, how can they be seen as different projects?

    • @porky1118
      @porky1118 ปีที่แล้ว +1

      @@petermuller608 Not sure, where I should start to explain.
      I assume you don't know much about Lisp.
      Lisps have a very simple syntax:
      (operation arguments...)
      This syntax is also called S-Expressions.
      For example (+ 1 2) would be "1 + 2" or (+ 1 (* 2 3)) would be "1 + 2 * 3".
      The operation doesn't need to be a function.
      It can be what most languages use keywords or special syntax for.
      Most Lisps are garbage collected dynamically typed languages, similar to python.
      But it's possible to use this simple syntax for any kind of language.
      And there are some lower level Lisps like Scopes and Dale. Same basic syntax, but different semantics.
      What I mean when talking about semantics, is what features the language has. Dymamic/Static typing, GC, structs/classes, type system, borrow checker, compile time features, etc. There are many ways you could syntactically define them. They would still stay the same feature.
      If you have some general intermediate representation, which should basically be s-expressions, never as texutal representation, but as trees of symbols and sublists, you could have multiple syntaxes to map to the same semantics.
      There could be some general syntaxes like simple s-expressions or something indentation based like Scopes list notation (SLN), or some special purpose syntaxes, which only work with this specific semantic.
      I hope, this helps you to understand, else feel free to ask more concrete questions.
      I might also add some examples.

    • @petermuller608
      @petermuller608 ปีที่แล้ว

      @@porky1118 thanks for the in-depth reply! Since most languages are parsed into an AST, and an AST can be represented using s-expressions, isn't this already what you hope for?

    • @porky1118
      @porky1118 ปีที่แล้ว +1

      @@petermuller608 No, since language ASTs are normally not exposed to the programmer/user.
      The exact ASTs are some compiler internal thing, which might just change in the next version.
      But if some language had some stable AST, and exposes it to the user, we're almost there. Writing an S-Expression to AST converter should be pretty simple.
      (writing an S-Expression to language text converter also shouldn't be too difficult, but that seems like a lot of boilerplate without any real benefits)
      It would be best, if the compiler would just take in S-Expressions (preferably as lists, not as text) instead of some textual representation.
      (it should also be easy to have visual representations of S-Expressions, and that tool would basically work with any language; maybe you would need to add some language specific definitions to make it usable; I could go on a lot, but not sure, if it would even interest you).

  • @catriverr
    @catriverr ปีที่แล้ว

    Hello AstroSam, you were so correct about the programming dreams. It has always been my biggest dream to once make a programming language, and about a month ago when I saw this video I was inspired by you to make my own. I've looked at your code and tried to learn how I could make one myself, and today is the day I published it to github! Thank you.

    • @asapstudios3893
      @asapstudios3893 ปีที่แล้ว

      Hi like yours it’s mine to create my own language can you guide me in this where to begin and what to learn, if any guides to follow?

    • @catriverr
      @catriverr ปีที่แล้ว

      @@asapstudios3893 I recommend working on splitting strings into tokens, such as:
      "5 + 5" converted to num_5 plus num_5. After this you can add functions to these tokens, such as plus being add first value to second value.
      I personally did not follow any guides but I recommend checking youtube for building a programming language. mine is built in c#, but I recommend c++. Any compiled language works to be honest.
      Wish you luck with your language!

  • @doublepmcl6391
    @doublepmcl6391 2 ปีที่แล้ว +1

    NOICE video btw, also noice choice for the music in the background 😀

  • @tomsterbg8130
    @tomsterbg8130 2 ปีที่แล้ว +4

    Congratulations! You just made a language somewhere between C# and Lua

  • @MahmudShuaib
    @MahmudShuaib ปีที่แล้ว

    when i saw start() and update() a ghost from unity slapped me! lol nice 1 sam. i sure will checkout your programming language.

  • @arthurstrulev4380
    @arthurstrulev4380 2 ปีที่แล้ว +1

    Big improvement from your last videos. I'll be here for the ride.

  • @luger.
    @luger. ปีที่แล้ว +8

    Wow. This is amazing! I might try to make something in Z-Sharp, and look forward to doing so. Good job AstroSam! How long did it take to make the language?

    • @AstroSamDev
      @AstroSamDev  ปีที่แล้ว +5

      About 1.5 months, but I still took breaks and also had school

  • @deus8546
    @deus8546 ปีที่แล้ว +7

    How about building your own computer from scratch (by making our own components like processor, mother board ans so on), then developing your own operation system and finally building your own computer network?)))

    • @AstroSamDev
      @AstroSamDev  ปีที่แล้ว +6

      Really cool idea! I've actually been considering a project like that, similar to the projects jdh or Ben Eater have made. The biggest issue with building a custom processor though (instead of using something like a 6502 or similar) is a low efficiency and it could be slower.

    • @nikkiofthevalley
      @nikkiofthevalley ปีที่แล้ว +1

      @@AstroSamDev If you do end up doing that, I would suggest making it pipelined. This adds complexity, yes, but it allows for (some) parallelism. This (simplifying a bit) allows for more instructions to be completed per unit time.
      I'm actually working on a pipelined 16-bit processor with more advanced features than I've seen of 16-bit home-built processors before. Those being pipelining, 8 input and 8 output ports (usually there's only 1 or 2), integrated floating point hardware, and a couple more odds and ends. So if you have any questions or confusions, you can ask me.

  • @upwrdmusic
    @upwrdmusic ปีที่แล้ว

    I finally finished version 1 of my programming language yesterday. What a coincidence seeing your video!

    • @AstroSamDev
      @AstroSamDev  ปีที่แล้ว

      That's awesome! I hope you learned a lot while making it, I sure did! 😄

  • @dukkcc2
    @dukkcc2 2 ปีที่แล้ว +1

    WOW! This channel is underrated. Good job!

  • @beewyka819
    @beewyka819 ปีที่แล้ว +12

    It should also be noted that with semicolons you can spread a single instruction out over multiple lines, which is extremely useful for cleaning up long function headers, long lines of chaining operations (multiplications, additions bitwise, etc.). You can't really do this without semicolons and instead have to accept the fact that your single function header or chain of multiplication consists of a single 150 character long line.
    Also I always thought the JS and python way of not having to declare param types and return types overall harms code readability and forces you to compensate by writing additional comments saying what the variable types are. This is typically not a good thing. You want code to have a certain degree of readability in order to reduce necessary comments. Good code should not require many comments to be able to comprehend. B/c of this I always have significantly more trouble working on someone elses JS code than I've ever had working on someone elses C/C++ or Rust code.
    Ofc this is all mostly just my preference.

    • @volbla
      @volbla ปีที่แล้ว +2

      You can always define other ways to spread an expression over multiple lines. In python newlines and indentation are ordinarily integral syntax, but they are ignored inside enclosing brackets. This automatically applies to lists and function parameters.
      I agree that finishing statements with semicolons is more unambiguous, but on the other hand, for the majority of code you write they're just a tedious formality. To each their own :)

    • @fdwr
      @fdwr ปีที่แล้ว

      "You can't really do this without semicolons"
      Sure you can. A statement ends when the scope is complete and an expression is complete, and so any open parens or unresolved binary operators keep it open. As 20 year veteran of C++, I'm used to them, but I also see they are in 99% of cases just redundant visual noise.
      "not having to declare param types and return types overall harms code readability"
      Concur. A function that can accept anything and then blow up at runtime is not as robust as a function that can accept a contract-fulfilling interface caught at parse time.

  • @mycatsarefat6636
    @mycatsarefat6636 ปีที่แล้ว +4

    Not having return times or parameter types can cause a *ton* of runtime errors. I see it a lot in python too. It's easier to just deal with the types rather than risk a mountain-load of bugs. Also, having to stretch out every line of code no matter how small it is can just be the opposite of clean code (having to call 5 functions that are like 5 characters long).

  • @eboatwright_
    @eboatwright_ ปีที่แล้ว

    This is awesome! I also like making little programming languages :)

  • @sera_kath
    @sera_kath ปีที่แล้ว

    Z# looks actually pretty cool. Great job :)

  • @tegasteve8195
    @tegasteve8195 2 ปีที่แล้ว +9

    Please can you make a tutorial, on how you made the language? I really love this content, thank you

    • @AstroSamDev
      @AstroSamDev  2 ปีที่แล้ว +9

      I'm happy you enjoyed the video! Making a tutorial on this project would actually be pretty difficult, and would take multiple videos. What would you like to learn from a tutorial, if I made one? If you wish I could make a video explaining how it works, without doing much actual C++ programming. 🤔

    • @tegasteve8195
      @tegasteve8195 2 ปีที่แล้ว +3

      @@AstroSamDev yes 👏 please, I would really appreciate that. Thank you

    • @tegasteve8195
      @tegasteve8195 2 ปีที่แล้ว +5

      @@AstroSamDev I would love to see how the interpreter was designed and implemented

    • @pineapplerindm
      @pineapplerindm 2 ปีที่แล้ว

      I'd like to see how the interpreter parses the code

  • @yottabbb
    @yottabbb ปีที่แล้ว +3

    “zed sharp”

  • @frunzaverdero2163
    @frunzaverdero2163 ปีที่แล้ว +2

    So, i made pong in c++ a while ago and i was familiar with what you did, but i didn't understand how you choose the directions and the speed of the ball after it hit the lines. Watching this video was very inspiring and i feel motivated to do a new project.

    • @AstroSamDev
      @AstroSamDev  ปีที่แล้ว +2

      I forget the exact method I used, but it involved calculating the angle using the distance the ball was from the center of the paddle and some trigonometry functions.

  • @salem8909
    @salem8909 ปีที่แล้ว

    Ever since I finally decided to play earthbound, I always hear the OST in so many youtube videos great video AstroSam!

  • @Sybyh
    @Sybyh 2 ปีที่แล้ว +3

    I already made a language and it's funny how the syntax of Z-Sharp looks like the one I made otherwise well done :D

    • @AstroSamDev
      @AstroSamDev  2 ปีที่แล้ว +1

      Well I did attempt to make something similar to the languages I use often with the things I like about them. Mine reminds me most of C#, PHP, and Python. Thanks for watching! :)

    • @Sybyh
      @Sybyh 2 ปีที่แล้ว

      @@AstroSamDev the second language that I made remind me little bit to Typescript and Golang

  • @daxillion
    @daxillion ปีที่แล้ว +9

    Could you make a step by step tutorial to do something like this? I'm a 15 year old programming fan who is eager to learn anything and everything, dreaming about following in the steps of Markus Peerson and making a game from scratch without use of modern engines. I'd really love to at least try and make a language like you did!

    • @declan_youtube
      @declan_youtube ปีที่แล้ว

      Javidx9 has some really good tutorials on creating games without using modern game engines like SDL, check his channel out!

  • @michalkap9859
    @michalkap9859 7 หลายเดือนก่อน +1

    After clicking on this video I started imagining how would my own programming language look like, an then you do anything I imagined.

    • @michalkap9859
      @michalkap9859 7 หลายเดือนก่อน

      Also it's basically Go

  • @krishangopal2475
    @krishangopal2475 2 ปีที่แล้ว +1

    You really nailed it bro💥

  • @Owen_loves_Butters
    @Owen_loves_Butters ปีที่แล้ว +10

    Definitely seems like a mix between C# and Python, which might actually be useful.

  • @porky1118
    @porky1118 2 ปีที่แล้ว +3

    Compiled or interpreted is not something you have to decide on when creating a programming language. Every language can be compiled or interpreted.

    • @0xD1CE
      @0xD1CE ปีที่แล้ว +2

      While technically true, it still important to consider when designing the language. A dynamically typed language for example would not suit well as a compiled language since you would need to do a lot of runtime type checking & assertions. At that point you might as well just use an interpreter to do it for you.

  • @KivixMAIN
    @KivixMAIN ปีที่แล้ว +1

    ur toooo good at it! ur my inspiration tyy!

  • @rickv9180
    @rickv9180 ปีที่แล้ว +1

    This inspires me to excel in Computer Science, thank you really

  • @garrybogdanho
    @garrybogdanho 2 ปีที่แล้ว +6

    I've always wanted to code my own programming language. Sadly, I'm bad at coding and I don't know how to do that.

    • @AstroSamDev
      @AstroSamDev  2 ปีที่แล้ว +3

      Start simple, I'd recommend making an interpreter for a simple already existing language, like brainf*ck (it has only like 5 instructions), then expanding upon that knowledge. to create your own unique language and syntax

  • @orangeleaf36plus
    @orangeleaf36plus 2 ปีที่แล้ว +3

    This looks like a programming language i could make a game with (besides python)

  • @YagamiLighter
    @YagamiLighter ปีที่แล้ว

    amazing video, absolutely loved it

  • @hachimori_wtf
    @hachimori_wtf 2 ปีที่แล้ว +1

    underrated video, underrated channel. Good video and easy to understand

  • @ShiloBuff
    @ShiloBuff 2 ปีที่แล้ว +3

    I've always wanted to make my own language that was unique, intuitive and the simplest and straight forward language ever. Sadly I don't see there ever being a direction that hasnt already been done, or something thats not counter-intuitive to itself. Javascript really is almost the perfect language when it comes to ease and also common syntax.
    The only idea I can think of is some kind of AI language where you just type whatever you want in human language and the AI tries to understand and convert the code, but that's not a practical goal. I guess my idea would be best suited as a visual scripting language.

    • @zahhym
      @zahhym ปีที่แล้ว

      I would check out CodeX by openAI

  • @s-codes14
    @s-codes14 2 ปีที่แล้ว +5

    Damm, I've always dreamt of creating my own language but gave up after realizing the effort and time i takes to making a reality

    • @AstroSamDev
      @AstroSamDev  2 ปีที่แล้ว +2

      I'd start by making a Brainf*ck interpreter or something first, it has super simple instructions and could be done in less than 1 day. Then adapt and add your own things to make it unique and learn. Have fun programming! 😄

    • @user-dh8oi2mk4f
      @user-dh8oi2mk4f 2 ปีที่แล้ว +1

      @@AstroSamDev The problem with a bf interpreter is that it doesn't really teach you how to parse grammar. All you need is a loop and a switch statement, which doesn't accurately reflect how you would go about parsing a real language. Nonetheless, it does give you some basic knowledge of how lexers work, because a loop and a switch statement is all they really are.

  • @bluebukkitdev8069
    @bluebukkitdev8069 ปีที่แล้ว

    Friend of mine and I are making a web language called EML and are still in the design phase. It's been fun getting it set up.

  • @koder7738
    @koder7738 ปีที่แล้ว

    Z# looks cool! I did develop a own VM called L1VM. And also developed my own programming language "Brackets". The programs are compiled to byte code for my VM. I know how difficult it is to develop an own programming language!

  • @Michel-dx1bn
    @Michel-dx1bn ปีที่แล้ว +4

    the name didn't age well

  • @user-gt2gy8wo3h
    @user-gt2gy8wo3h 2 ปีที่แล้ว +3

    Apologies in advance as this might sound elitist, I noticed the trend of "no semi-colon" often liked by non-veteran developers. Back in the day, it was visual basic developers with the begin end keywords, javascript still suffers from not enforcing semicolons, restricting the expression of code blocks.

    • @AstroSamDev
      @AstroSamDev  2 ปีที่แล้ว

      Don't worry, I totally agree. I actually mostly use languages that use semicolons, and I think I prefer them. There may be a change in the future that enables them in ZSharp.

  • @ChrisM541
    @ChrisM541 ปีที่แล้ว +1

    Good video, thanks for the upload.
    Slight correction at the start...at the advent of computers and for some years later, the only language used was not a compiled one (that would come later) - it was assembly language, a 1:1 mnemonic version of the CPU's instruction set i.e. machine code. At the same time as writing in 'human-readable' assembly, programmers included the machine code equivalent opcode & operand beside each line (much like what you see in a disassembly today). The machine code would then be loaded into the computer.
    Remember, all opcode mnemonics (assembly instructions) are, obviously, known at the finalisation stage of creating a new CPU instruction set...assembly language is simply human readable machine code. Compilation is a whole different world to assembling !!

  • @renatmukhametshin7586
    @renatmukhametshin7586 ปีที่แล้ว +9

    Lol u just made python out of c#

  • @JavaVampire
    @JavaVampire 7 หลายเดือนก่อน +3

    You just modified a perfectly good programming language. You didn't make your own.

    • @_syntaqs
      @_syntaqs 7 หลายเดือนก่อน +3

      Agree, and it's source is also terrible. It literally just searches for words in strings and wraps it around a C++ function. It doesn't even have a lexer, parser or a bytecode compiler.

  • @JayCode_dev
    @JayCode_dev 2 ปีที่แล้ว +2

    That was a interesting video! Good job!

  • @dire284
    @dire284 ปีที่แล้ว

    Generally very surprised you don't have more subscriber's, bravo!

  • @takis76
    @takis76 ปีที่แล้ว +9

    This video didn't present how to create your own programming language.

    • @atlantic_love
      @atlantic_love ปีที่แล้ว +2

      It's just a stupid attempt at promoting his own skills.

  • @user-sm8iz3up9z
    @user-sm8iz3up9z 6 หลายเดือนก่อน +3

    Z??? нинадо дядя...💀

  • @RayanA2
    @RayanA2 ปีที่แล้ว

    Good job!!! You inspired me to make my own language

  • @AlwaysWinning
    @AlwaysWinning 2 ปีที่แล้ว +1

    this is gonna blow up gl man

  • @maroonmochi3426
    @maroonmochi3426 11 หลายเดือนก่อน +3

    so basically a downgraded c#

  • @dudosondosara2581
    @dudosondosara2581 ปีที่แล้ว +4

    Za nashih