Coding My Own Text Editor Again (Ded S02E01)

Поділитися
Вставка
  • Опубліковано 12 січ 2025

КОМЕНТАРІ • 133

  • @alexs6986
    @alexs6986 2 роки тому +306

    I think it would be really cool if you did Advent of Code using only tools that you built: text editor (ded), programming language (porth), ...

  • @gustavoh5143
    @gustavoh5143 2 роки тому +177

    the most impressive skill this man has in my opinion is to be able to code without having a colorful code

    • @kiryls1207
      @kiryls1207 Рік тому +5

      at the beginning of my dev journey i didn't like colors so i programmed without syntax highlighting black text on white background
      also I can't see s#it anymore

    • @nofeah89
      @nofeah89 Рік тому +3

      isnt he using syntax highlighting?

    • @0ia
      @0ia Рік тому

      Took me a month to get used to no syntax highlighting. Improved my ability to reason about code.

    • @SoftBreadSoft
      @SoftBreadSoft Рік тому +2

      @@nofeah89 a minimal syntax highlighting yea, keywords, variable names, comments.

  • @mitya
    @mitya 2 роки тому +42

    It's nice to see the way of thinking and the insights of a fellow developer :)
    One small note: your way of handling line ends assumes that EOL is always one character. You may want to reconsider that, in order to be able to handle files with '
    '

    • @jan_harald
      @jan_harald 2 роки тому +3

      just store the line ending char, replace it with one character (like
      ) and then replace back ;P
      basically dos2unix file.c;$EDITOR file.c;unix2dox file.c

    • @ocaly
      @ocaly 2 роки тому +7

      I was about to comment this. Microsoft Windows problems :D

    • @mitya
      @mitya 2 роки тому

      @@jan_harald well, hey, good luck with that and to whoever hires you to do a software engineer job :)

    • @mitya
      @mitya 2 роки тому +3

      @@ocaly No, it is not. We don't always choose the source of the files we need to work with. It a complex world, with multiple OSes and their quirks. Basic compatibility is important.
      Otherwise you're just going the way of Microsoft, Apple and others whose motto is: "It's our way or the highway".
      Linux is about freedom of choice as well.

    • @jan_harald
      @jan_harald 2 роки тому +1

      @@mitya you basically never want mixed line endings anyway, and use tr, unix2dos, sed, python, or whatever, with text files it's easy and common to convert them like that, heck, git loves to auto-convert the files FOR you, so go ahead and fire git's developers while at it ;P
      obviously nothing applies 100% of the time, but I doubt that you'll be working with text files which must contain mixed line endings, or which cannot be converted like that, nobody sane writes literal newlines into strings and stuff, if they care about what bytes come out the other side

  • @jimmyporter8941
    @jimmyporter8941 2 місяці тому +1

    The sensible data structure to use for text editors is a gap buffer. Text before the cursor is stored at the beginning of the buffer. Text after the cursor is stored at the end. As you move through the file, one character or one line at a time moves from beginning to the end of the buffer. Always leaving a gap between the two, where any text gets inserted or deleted.
    When you need more (or less) space, grow or shrink the buffer just as you would with a dynamic array. Doubling or halving the buffer size as appropriate. Or page multiple malloced blocks together to make a big gap buffer with only a bit more logic required.

  • @ecosta
    @ecosta 2 роки тому +7

    About the limits of C around 46:00. I never thought about it, but I would love to see what Tsoding thinks about using a subset of C++ just to overcome C limitations, since C++ is meant to be compatible with C.

    • @Bobbias
      @Bobbias Рік тому +3

      I can't speak for him, but I get the feeling that if he viewed that approach favorably he'd be writing code that way in his videos. It's not difficult to write C with a few C++ features sprinkled in if you want to (though I believe there would need to be some changes to accommodate the switch).
      If I had to guess, I suspect the downsides of C++ would outweigh the benefits, even given that you can still write C++ in a very C-like manner.

  • @Zwiebelgian
    @Zwiebelgian 2 роки тому +55

    1:57 „… like all other text editors…“
    Vim:

    • @TsodingDaily
      @TsodingDaily  2 роки тому +27

      Interesting! I never noticed that! Even though I've been using vim for quite some time already...

    • @root317
      @root317 2 роки тому +3

      exactly my thought lol

    • @batatavoadora1136
      @batatavoadora1136 2 роки тому +9

      @@TsodingDaily I'm pretty sure you can enable the cursor wrap, but the default is off

    • @mndtr0
      @mndtr0 2 роки тому +3

      @@batatavoadora1136 set whichwrap+=,h,l,[,] I'm find that

  • @lucaslindgren3237
    @lucaslindgren3237 2 роки тому +11

    You're really good at coding bro

  • @kurciqs8355
    @kurciqs8355 2 роки тому +10

    finally saw the keyboard

  • @amosnimos
    @amosnimos Рік тому +2

    The text editor I coded added nothing original, but yours actually inovated the ehole concept by using a dynamic camera system. It may not be the most practical thing but it's very cool and unique, I don't like the rainbow color and would like a green crt glow instead but that's a good start. By taking some inspiration from the cool retro terminal this project could really shine.

    • @Jack-sy6di
      @Jack-sy6di Рік тому +1

      a realistic green phosphor look, so when it's very zoomed in you can actually see scanlines and bloom, would be cool

  • @NateROCKS112
    @NateROCKS112 Рік тому +2

    7:02 I haven't finished yet, but couldn't you just store the indices to the beginning of each line? The next newline is just at the next `lines` index minus one.

  • @D-V-O-R-A-K
    @D-V-O-R-A-K Рік тому

    7:30 Why store the location of
    , when
    always == (the next line's start position - 1)?

  • @j-wenning
    @j-wenning 2 роки тому +11

    I was kinda hoping this would involve some sort of interacting with a piece table. I guess the point of this isn't necessarily to make an absurdly efficient editor though.

  • @Tiger_CZ
    @Tiger_CZ 2 роки тому +4

    Hello, great video. I just want to point out (idk how to say it politely, but I dont want to offend you) you have or youtube has a mistake in references. The link to rope data structure is missing ")", but it is actually written after the link.

  • @MrRegdis
    @MrRegdis 2 роки тому +24

    have you ever considered setting another camera just for your hands/keyboard?

    • @pedropesserl
      @pedropesserl 2 роки тому +7

      actually GREAT idea. I would be very entertained by that

  • @peduran1987
    @peduran1987 2 роки тому +2

    Awesome stream, thank you thank you thank you!

  • @energyman100
    @energyman100 2 роки тому

    What did you use to do that zoom in and highlight with your mouse at 0:20 ?

  • @luizfelipeg.5364
    @luizfelipeg.5364 2 роки тому

    Okay, in my mind noed, cannonically stands for 'no one escapes ded'

  • @berndeckenfels
    @berndeckenfels 8 місяців тому

    48:50 when doubling clamp it to a max increment (2gb) and also to maxinteger

  • @CarterColeisInfamous
    @CarterColeisInfamous 2 роки тому +1

    YATTSE - Yet Another Text TSoding Editor

  • @mndtr0
    @mndtr0 2 роки тому +4

    Is you usually use Emacs?

  • @alexvitkov
    @alexvitkov 2 роки тому +1

    the 2nd link in description is missing the closing bracket

  • @abdullahkhaled6162
    @abdullahkhaled6162 2 роки тому +1

    0:20 how do you do this in x11?

    • @flleaf
      @flleaf 2 роки тому

      his application called "boomer" on github. can't post links on youtube because youtube

  • @ValuedValue
    @ValuedValue 2 роки тому +3

    ? Bro what's written in the bottom?
    Corn folder : 8.1gb

    • @Solomonwo
      @Solomonwo 2 роки тому +1

      Lmaooo

    • @twentyeightO1
      @twentyeightO1 2 роки тому

      He probably made his own porn in C, you know using his own graphics library.

  • @IveGotBeef
    @IveGotBeef 2 роки тому

    41:06
    i did not expect that reference

  • @lucifer-5ybtn
    @lucifer-5ybtn 2 роки тому

    1:25 what is the name (model) of the keyboard that you’re using? It sounds really nice

    • @rubenarce5514
      @rubenarce5514 2 роки тому

      It seems like HappyHacking keyboard

    • @c4llv07e
      @c4llv07e 2 роки тому +7

      It is qwerty keyboard.

    • @SimGunther
      @SimGunther 2 роки тому

      HHKB2

    • @hanqnero
      @hanqnero 2 роки тому

      @@SimGunther Hell that costs a lot

    • @ValuedValue
      @ValuedValue 2 роки тому

      @@c4llv07e 😑

  • @bibliusz777
    @bibliusz777 Рік тому

    could you do a video on using GPU framework independent?

  • @nvpyt2235
    @nvpyt2235 2 роки тому

    Hey man, I was looking for a great place to start learning python (or how and where to learn it) and I was wondering if you have any good places that you know of that I can learn? Nice video BTW

  • @TheApgreyd
    @TheApgreyd 2 роки тому +2

    Рад, что наткнулся на канал

  • @rakanottrubick1857
    @rakanottrubick1857 2 роки тому +1

    dude im quite new to programming and tell me how it is even possible to make text float like that, changing color mid-character? That seems literally impossible

    • @TsodingDaily
      @TsodingDaily  2 роки тому +27

      But if a video game was doing something like that you would not be surprised?

  • @awlam23
    @awlam23 2 роки тому +7

    ne again, a snova

  • @noeldc
    @noeldc 2 роки тому +2

    What's with the stats at the bottom of the screen? :)

  • @starc0w
    @starc0w 2 роки тому

    50:42 Thx for sharing your stuff!
    Isn't it a problem if you lose your old pointer (da)->items when realloc fails?

    • @rndtrash
      @rndtrash 2 роки тому +4

      as you can see in the code, after failed realloc tsoding is gonna ram-shame you :)

    • @starc0w
      @starc0w 2 роки тому

      @@rndtrash Haha, yes, true! :-)
      (Nonsense was written here)

    • @VojtěchJavora
      @VojtěchJavora 2 роки тому

      @@starc0w you have to define NDEBUG for assert to do nothing. Just don't do that and problem solved.

    • @starc0w
      @starc0w 2 роки тому

      @@VojtěchJavora(Nonsense was written here)

    • @VojtěchJavora
      @VojtěchJavora 2 роки тому

      @@starc0w what release mode?

  • @abrarmasumabir3809
    @abrarmasumabir3809 Рік тому

    He is using hhkb that's a great keyboard!

  • @CaterpillarOGM
    @CaterpillarOGM 2 роки тому +10

    porn folder 8.1 Gb?

  • @LongestYardstick
    @LongestYardstick 2 роки тому

    where did you go? I miss your videos :( we will support you with patreon if you want money

  • @wubsyman5796
    @wubsyman5796 Рік тому

    Hahah took me way too long to realise the text at the bottom is a joke lmao

  • @ltvnf
    @ltvnf 2 роки тому +1

    seems like Apple epic keynote shit. :o
    "One more thing to C"

  • @KoshakMine
    @KoshakMine Рік тому

    Чел харош, редактор "Дед"

  • @Ryan-xq3kl
    @Ryan-xq3kl 2 роки тому

    holy fuck amazing work dude

  • @robimuhammad95
    @robimuhammad95 2 роки тому

    This is lit 🔥🔥
    This will be great if we use it on VR virtual monitor 🔥
    Is this the future of text editor? 🔥

  • @titanovsky
    @titanovsky 2 роки тому

    с новым годом!

  • @Omena0
    @Omena0 7 місяців тому

    Bussin GriddyCode????

  • @RuslanKovtun
    @RuslanKovtun 2 роки тому

    You are moving 4M of data on each insert/remove operation and caring about view/representation of the cursor..

  • @BryanChance
    @BryanChance Рік тому

    Briliant!

  • @crazygames1144
    @crazygames1144 2 роки тому

    How bout you make a text editor inside your text editor

  • @OggieSutrisna
    @OggieSutrisna 2 роки тому

    what font is he use?

    • @effede6365
      @effede6365 2 роки тому

      Victor Mono

    • @auntiecarol
      @auntiecarol 2 роки тому

      @@effede6365 Looks more like Iosevka to me.

    • @effede6365
      @effede6365 2 роки тому

      @@auntiecarol Thanks for a nice font I didn't know! Tsoding said he used Victor on a previous video.

    • @auntiecarol
      @auntiecarol 2 роки тому

      @@effede6365 I am happy to be proved wrong! How else do we learn?

  • @xnhp3
    @xnhp3 10 місяців тому

    1:07:26 still see some tea left.

  • @gsilva877
    @gsilva877 2 роки тому +2

    My text editor
    🤣🤣🤣🤣🤣🤣

  • @eyephpmyadmin6988
    @eyephpmyadmin6988 2 роки тому

    Have your text editor have an auto word finishing but with some python or rust, I've always wanted one that works for rust

  • @chriskerwell-gresla4403
    @chriskerwell-gresla4403 2 роки тому

    Hhkb - tasteful

  • @sangramsingha11
    @sangramsingha11 2 роки тому

    Here me configuring neovim.. 😀

  • @antropod
    @antropod 5 місяців тому

    People don't buy RAM these days, they download it from internet

  • @zyxyuv1650
    @zyxyuv1650 2 роки тому

    My comment got censored check your quarantine.

  • @OSeuGall
    @OSeuGall 2 роки тому

    sorry, maybe this is not, but i read: "Porn-folder" in the code editors footer. just commenting

  • @FelixNielsen
    @FelixNielsen 2 роки тому +8

    C is a good language.
    C is a proper language.
    C is great!
    Seriously, it hurts me to my soul, to hear you say such things about C, not because I feel any need to defend C, it is hardly necessary, but because it rather affects my (for lag of a better term) respect for you. I thought you where one of the few who actually understood C, end perhaps even understood the value of not abstracting away, everything that is fun and interesting, and how counterproductive it really is to do so.
    This is not to say that C is perfect, not even close, and it never will be, until such time as we can all agree on what makes the perfect language, and I think we can at least agree, that this is never going to happen, so we have to make due with the resemblance of perfection, that is C, for the foreseeable future at least, as I very much fear that C is, slowly but surely, going the way of C++, looking at the C23 specs. I sure hope that I am wrong.
    There was a time when C++ too was great, when even I, used and appreciated it, but now there's basically nothing left, of the C++ I knew, so I do C instead, and quite frankly, I'm happy to do so. I'm glad to be forced into comprehension, in order for things to actually work, and I do not believe for a second, that any other language is really more efficient or enables higher productivity, as so many would claim. In short, it simple creates harder problems/bugs, which can then be solved after release, maybe, when the paying user has had plenty of time to appreciere the flaws, which will then, in turn, create other problems, and so on and so forth, for no other reason, than not enforcing the comprehension that enables developers to do their work properly, because of the illusion of increased productivity.
    Well, enough ranting, and I may well be an utter moron, but I firmly believe these things, and I have a very hard time respecting anyone, who actually labels C, a bad language. Seriously, I cannot believe you're actually serious. Must be a language barrier, or something.

    • @Ryan-xq3kl
      @Ryan-xq3kl 2 роки тому

      Modern C++ is quite nice too, it is just not fun for messing around with or writing small scripts. Whenever I write C++ with a focused goal and design for my program I get clean fast small highly abstractable code. Smart pointers for example are a blessing and clean up much of the issue with raw pointers and garbage collection in one swing.

    • @FelixNielsen
      @FelixNielsen 2 роки тому +1

      @@Ryan-xq3kl I must admit that I have been out of the loop, when it comes to C++, for rather a long time, since I gave up, keeping up, but that being said, back they, it was rather my impression that many, if not most, wrote wrote code in C++, including myself, didn't really write C++, but rather C, employing a few nice too haves from the C++ superset, but never really using the language, as indented.
      Perhaps it is indeed the case, that the days of constant and significant changes, and not least additions, to the language, quite often in an entirely wrong direction, seemingly without any consideration for the larger picture, are over. Perhaps I should investigate further, though it won't really change all that much, as I will never become a fan of OOP and excessive, and unnecessary, abstraction.
      In fact, I am rather of the opinion, arrogant though it may sound, that any programmer who honestly prefer that kind of abstraction, that outright discourages fundamental comprehension, is not any more of a programmer, than the average jocker, is an Olympic sprinter.
      Learning a programming language, does not a programmer make, anymore than learning Chinese makes you, well, Chinese. You have to understand their society, history and culture, to even come close, and even then, it may be so foreign to you, that you're really not able to.
      This is exactly what I see as the greatest problem, in the software industry. You take what others have done, and blindly add what is missing, and expect things to just work, because that is how it is supposed to work, lean back, and accept people to just accept the status que, and hand over their money, in return for a defektive product that may, at some point in the future, get fixed to a point, where it is actually useable.
      I really don't know why I cannot sit down, at a keyboard, without ranting for hours on end, about things, that normal people care little about, but there you have it.
      The sad thing is, i actually mis rather significant parts of C++, still, but at least I know what I'm doing, even though I'm getting nowhere fast.

    • @reinhold1616
      @reinhold1616 2 роки тому +8

      he says he hates all languages equally. plus you put way too many commas.

    • @_inetuser
      @_inetuser 2 роки тому

      @@FelixNielsen but do you think in a complicated world it is feasable to not use others peoples code and still be time effective?

    • @FelixNielsen
      @FelixNielsen 2 роки тому

      ​@@_inetuser Yes and no. It's a balance act. I'm not saying not to stand on the shoulders of others, simply not to do so blindly, and to not have others stand on your shoulders, at the same time, to employ, I think, a reasonably apt analogy.
      As for the time efficiency argument, if you keep your deadline, and thus am time efficient, but release a product that is so flawed, that it doesn't live up to even the most reasonable of expectations, which rather seem to be the norm these days, considering the time you'll spend fixing it, customer support, not to speak of the bad press, administration of refunds and so on, I hardly think you can actually claim to have kept your deadline, but of course, on paper, it very much looks like it, and that is what matters to those in power.

  • @texoport
    @texoport 2 роки тому

    pog

  • @SimGunther
    @SimGunther 2 роки тому

    If you take the good parts of C, JAI, Odin, Racket, Rust, Erlang, Prolog, Verse, HolyC, and Smalltalk, I'm sure that'll make for a much better language that most would be willing to work in. The big problem however is that legacy code exists, so we'll just have to empower people to make new legacy code with this "uber-language" that fixes plenty of problems with C but introduces its own problems like you said in the C rant ;)

    • @5omebody
      @5omebody 2 роки тому

      but what are the good parts of each language?!
      it's worth noting that many of the languages have conflicting goals... a lot of things exist as a duality - you can have one at a time, or the other, but not both.
      and often optimizing for one means your language needs to be designed around it, preventing you from optimizing for the other.
      and if you try to do everything... y'know what they say - jack of all trades, master of none. in this case it's forced, by not prioritizing one over the other you _must not_ optimize for one usecase by making another usecase less optimized. and as a result you end up with a language architecture well suited for none of the things, and badly suited for all of them

  • @______9364
    @______9364 2 роки тому +2

    41:05 :)

  • @krillin3613
    @krillin3613 2 роки тому

    This is so cool i would love to get this working on windows! does anyone have the current version working on windows?

  • @yashkalyan
    @yashkalyan 2 роки тому

    Code - Gym - Temple - Repeat.
    But you look like just code bro, take your health also in consideration.

  • @kawaikaede2269
    @kawaikaede2269 2 роки тому

    yay

  • @neilvninja
    @neilvninja 9 місяців тому

    HHKB :D

  • @cyanmargh
    @cyanmargh 2 роки тому +7

    ha, дед

  • @markcuello5
    @markcuello5 2 роки тому

    HELP

  • @ItsSchwifty
    @ItsSchwifty 2 роки тому

    ded

  • @BrainChili
    @BrainChili 2 роки тому +1

    WHY ARE YOU WEIRD

  • @kamal3777
    @kamal3777 2 роки тому

    The waffle house has found its new host

  • @ruman3726
    @ruman3726 2 роки тому

    Че по английски шпрехаешь, а не на родном великом и могучем?

  • @hahamartin6595
    @hahamartin6595 2 роки тому

    hi tsoding ,my english is bad ,but l like your stream about programming , recently i watch your stream about context free grammar but now l can't find the stream url . can u packing the stream ,and upload the youtube? thanks @Tsoding Daily

  • @callisto960
    @callisto960 2 роки тому

    What keyboard

    • @rubenarce5514
      @rubenarce5514 2 роки тому

      It seems like HappyHacking keyboard