User Defined Functions & Closures - Programming Language From Scratch

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 พ.ย. 2024

ความคิดเห็น • 76

  • @coolcsgo
    @coolcsgo ปีที่แล้ว +21

    You should continue with this series, so many other exciting things of a language that's left!

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

    I followed this tutorial and I notice you never started on strings so after I did this one, I made a String type and now it works. So I just want to say thanks for making this tutorial it helped me a lot and now I know how to add new things to it. so thanks!

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

      Yay! Yea I kinda stopped with the series sadly. I’m so happy you enjoyed and found use out of it.

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

      my next step is to make while loops!@@tylerlaceby

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

    ive used this tutorial for 2 languages (mainly for fun) and i got to say that I love it! it goes over the logic without making a fuss about the non-important stuff.
    Thank you for your work! Would love to see a new part about structs/classes, but i guess that's a pretty big scope :')

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

    I was kinda disappointed to find that this was your last video in the series but that just made me add more features!

  • @koby9340
    @koby9340 ปีที่แล้ว +20

    is there a chance you may continue this serie please :(

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

    The rust inspiration is there lol
    Awesome video as usual btw !

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

      Haha thanks. I always like languages that have implied return statements inside of blocks.
      Glad you enjoyed

  • @devaughntimoll9493
    @devaughntimoll9493 5 หลายเดือนก่อน +1

    Hi, you are so amazing bro I made my programming language in python but I stopped at loops because I didn’t know how to do it but you really help after making it in python I made a exe added it to my path and realized it was slow so I remade it in c++
    Amazing series my guy

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

    really enjoyed this series, i've been wanting to make my own language and this tutorial was pretty helpful, thanks! (also i think you forgot to add functionality for getting stuff from objects)

    • @tylerlaceby
      @tylerlaceby  22 วันที่ผ่านมา +1

      I sadly had some health issues arise earlier in the year and then I never got back into the series recently.
      However, I want to resume it sometime soon 🤠

  • @SaNsPendakwah
    @SaNsPendakwah 7 หลายเดือนก่อน +2

    This series is amazing!!!

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

    I've been replicating this tutorial in Lua for the last couple of weeks and it works perfectly!.
    I have been playing with the idea of a transpiler for Lua for a couple of years now and in my current version I've been trying to develop a custom AST parser for my proposed language that I can later transpile to pure Lua, so your tutorial has been most helpful.
    Hope we can see and end to this series some day!
    Thanks for everything.

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

      Bro same, I'm making this in luau aswell, also thanks Tyler, you definitely taught me something

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

    @tylerlaceby when can we expect the next videos in the series???? I'm eagerly waiting for them!!!

  • @yadavdhakal2044
    @yadavdhakal2044 11 หลายเดือนก่อน

    Great series, quite nice. Will definitely suggest my friends at college!!

  • @Егор-д3у4с
    @Егор-д3у4с 13 วันที่ผ่านมา

    Это шикарно. Ты просто гений!

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

    Absolutely love this series, have been following along but used Go instead! Any plans to pick this back up and cover any more concepts?

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

      Thanks. I’m trying to find out how to improve my video quality before I start anything new. However I would love to make a new series which goes more in depth into say parsing, or compiling, type-checking etc ….

    • @ChriisWiing
      @ChriisWiing 9 หลายเดือนก่อน

      @@tylerlaceby Compiling would be awesome, it would be a good compliment to this interpreted series. An LLVM/ ASM compilation series would be great

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

    Awesome. Can you show me how to do it with if ..else . statements?

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

      Hello there. Glad you like the video. I would love too show you those things in upcooming videos. However if you want a more personal approach then feel free to message me on discord and I would not mind hopping on a video call and answering and questions or showing some code samples. Cheers!
      tylerlaceby#9121 Is my discord

  • @silly.goose101
    @silly.goose101 ปีที่แล้ว +4

    when do you think your going to add strings, lists/arrays, support for negative numbers (currently you have to type 0-[the number you want to be negative]), mabye even some basic logic like, not, or, and, less than, greater than, equal to, etc? Great tutorials btw, love em!

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

      Hey bananamanreacts4972, if you still want strings and your on ts files then I can give you my version of strings that I made!

  • @482migs
    @482migs 11 หลายเดือนก่อน

    Hey dude, this series is an absolute lifesaver. I've been trying to find one that works for ages now! Any chance of strings, arrays, control flow, imports, or classes, or anything like that in the near future?

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

    will you be doing If/for/while statements?

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

      Definitely 👍

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

      @@tylerlaceby you dont need it, when you can call functions recusivley

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

    How would you parse an arrow function? Using the function keyword syntax, its easy to parse the parameters since thats the only reason parentheses would be there, but considering that the arrow follows the parentheses, how can the parser know not to parse the parentheses as a group?
    Can we expect arrow functions in the next part of this series?

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

      Arrow syntax would just have its own token. An arrow token would follow the closing paren. Then on the FunctionExpression ast mode you can state whether the function is an arrow function.
      Take a look at how the website ASTExplorer does it and you will see arrow function are simply. Boolean added to the AST node for functions.
      As for parsing then it’s just a simple if check after the closing paren. If you see an arrow then you would eat the arrow and parse a Expression if you don’t you will e or t a Block for the body.

  • @devaughntimoll9493
    @devaughntimoll9493 3 หลายเดือนก่อน

    And know I’m making a compiler lol I came back for the ast really helpful

    • @tylerlaceby
      @tylerlaceby  3 หลายเดือนก่อน

      Awesome. Yea i have a separate series on Pratt parsing which is only about parsing. Also I think it's much better done.

    • @devaughntimoll9493
      @devaughntimoll9493 3 หลายเดือนก่อน

      @@tylerlacebyohh I’ll check it out!

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

    lets gooo

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

    implementing string would be cool as well

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

      I’ll discuss this in the future but it is the exact same thing as a number type. It’s just a wrapper type over the js string primitive.
      I don’t think I’ll implement it as it is fundamentally the same as the null type and number types.

  • @baptisteleroyer3758
    @baptisteleroyer3758 8 หลายเดือนก่อน

    A wonderful video thx.
    It just just missing the loops to make it perfect 👌

    • @DemidCode
      @DemidCode 3 หลายเดือนก่อน

      and if/elif/else conditions, as well as string type. But we can add it all by ourselves as this series build up understanding how it all works :)

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

    I have loved all of the tutorials! This also gave me a brand new look at TypeScript and it's functionalities! I got a suggestion for a tutorial; could you possibly add classes, or would that be too complicated?

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

      I don’t want to make any promises lol but classes revolve around the idea of closures just like functions.
      Think of a class like a closed over environment where a class is a closed over Block. They both need to know where they were defined and they both can be instantiated at runtime.
      If you want help feel free to reach out. I also suggest checking out books like writing a interpreter in go as well as CraftingInterpreters

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

      @@tylerlaceby Thanks for replying! I'll just try for myself then and hopefully I will make it a success!

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

    Hi, really good serie of videos, thanks for your work and its qualitu. I was wondering if you planned on continuing it?
    Thanks!

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

      Not this series. However I’m currently working on a new series in Go which will be much better imo.
      Check on my discord for more news.

    • @martinvacheron3839
      @martinvacheron3839 9 หลายเดือนก่อน

      @@tylerlacebythanks for your reply, Iooking forward the new one 😊

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

    GOAT

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

    This is awesome! I have expanded on it even more. The one thing I am having trouble with though is adding in arrays and strings. Do you have any suggestions on how to do this?

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

      I can definitely help you with those data types. Message me on discord and maybe Monday or tonight after work I can hop on a call and we can get those working.
      Cheers

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

      @@tylerlaceby Thank you! Just let me know when

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

    My guy!

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

    question are you gonna continue the call member expression for the interpreter?

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

      I might get to objects too yea. I mainly wanted to show how to parse them as they can be tricky.

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

      @@tylerlaceby ah ok

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

    which design patterns have you implemented there?

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

    awesome stuff

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

    I wish you had also added conditionals and loops too.

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

      Also loved the series. Learned so much!!!

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

    I love you bro.

  • @oledolof2252
    @oledolof2252 11 หลายเดือนก่อน

    will there be more episodes?

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

    Are you gonna continue the series??

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

      I probably will finish the series with a few episodes. However I can’t say when that will happen.
      If you have any questions or wanna talk about the series I would be more than happy to do that.
      Reach out on discord if you want. Cheers

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

    Honestly you could make a whole course on udemy (or other platform) from that and I would happily pay!

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

      Well I’m glad you enjoy this series. Sadly I’m very inactive on TH-cam and don’t have good enough production quality to feel okay charging money 💰. But I hood you and other a still learn things from this.
      If you need anything or want related help please feel free to reach out on discord.
      Cheers

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

    How would I differentiate between a subtraction and a negative number in the lexer?

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

      You would not in the lexer. Instead you would handle this in the parser. A negation is called a UnaryExpression and has a separate AST node.
      Unary nodes are things like -+!( += etc. this is a very high precedence node and is higher than a binary expression.

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

      @@tylerlaceby Thank you

  • @JefftheGDPlayer
    @JefftheGDPlayer 2 หลายเดือนก่อน

    series is awesome! but how can i get it to be a different file format, like uhhh… .gay instead of .txt

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

    vscode is a lot slower from the last time i used it.

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

    will you be doing reflection?

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

      No just the basic constructs of a language. variables, scope, expressions, logic, loops, control-flow, and I added object access/member to show how it would be parsed as some people find them quiet tricky to get the precedendce correct.

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

      Will you be using LLVM (I am not sure if u even can outside c++)?

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

    Love you pls keep em coming

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

    What icon and theme are you using, thanks