How I RUINED My Rust Project

Sdílet
Vložit
  • čas přidán 24. 07. 2024
  • Leo's Portfolio: delta.is-a.dev/
    Lemon Foxmere's Github: github.com/LemonFoxmere
    Project Repository: github.com/conaticus/fileexpl...
    Original Video: • I Made a FAST File Exp...
    Join this channel to get access to perks:
    / @conaticus
    Discord: / discord
    Github: github.com/conaticus
    Twitter: / conaticus
    0:00 Intro
    0:15 Cache Invalidation
    1:40 Saving Cache to Disk
    2:25 File Opening
    2:58 Binary Serialization
    3:17 Context Menu
    3:36 Create & Delete Files
    How I RUINED My File Explorer (in Rust)
  • Zábava

Komentáře • 113

  • @conaticus
    @conaticus  Před rokem +74

    Thanks for checking out the video! Little mistake at 1:27, this is actually the interval for the disk caching.
    I should really stop editing these at 2am 😅

    • @and_rotate69
      @and_rotate69 Před rokem +2

      I started learning rust 3 days ago and after seeing that function i thought im so dumb to understand what's going on just from the name, but yaaay im not dumb, i lack confidence

  • @Floky
    @Floky Před rokem +404

    "I'm making a fast file explorer..." *Takes 3min to delete a .txt file* Lmao

    • @DBZM1k3
      @DBZM1k3 Před rokem +79

      Well... he's not make a fast file delete app. Its for exploring. 🙃

    • @FriedMonkey362
      @FriedMonkey362 Před rokem +17

      I mean he could just also delete it from the cache as soon as he deletes it, itll look nicer

    • @samllea1
      @samllea1 Před rokem

      Floky!!! i have been subbed for a long time! less then 500 i think

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

      Gives you time to reconsider, kinda like GMail waiting 5 secs before actually sending that message you might regret.

  • @tompov227
    @tompov227 Před rokem +29

    A React based file explorer. May god have mercy on us

    • @tacomies
      @tacomies Před rokem

      I'd argue that the GUI is not the main point here

    • @tompov227
      @tompov227 Před rokem +10

      @@tacomies I’d argue that I was making a joke

    • @tacomies
      @tacomies Před rokem

      @@tompov227 Can't really tell over text since hating on react is quite common

  • @KangJangkrik
    @KangJangkrik Před rokem +99

    For state manager, I usually use a simple state manager like React Recoil instead of full blown one like Redux. It saves a lot of time and effort

    • @anarchoyeasty3908
      @anarchoyeasty3908 Před rokem +3

      When you say time and effort, are you talking about raw redux? Or redux toolkit. In my experience, redux toolkit solves the biggest headaches about redux but I've not really looked into other state management solutions

    • @johnc0de
      @johnc0de Před rokem +5

      Zustand, jotai, valtio, nano store are all good options that seems better than redux or recoil in that occasion

    • @KangJangkrik
      @KangJangkrik Před rokem

      @@anarchoyeasty3908 if you delve into its source code, you'll know the reason why people are looking for alternative like jotai and react-recoil

    • @arivanhouten6343
      @arivanhouten6343 Před rokem +2

      I like Zustand since imo it's rather simple to set up and work with. Also provides devtools support

    • @conaticus
      @conaticus  Před rokem +7

      Yeah, I should definitely check those out. Redux is a pain 😂

  • @krtirtho
    @krtirtho Před rokem +36

    Look at this guy. It's always fun to see every new programmer step into this Open Source software found + maintainer rabbit hole🤣
    I'm crying

  • @Infinitay
    @Infinitay Před rokem +80

    Did you say you were caching all files every 30 seconds? Isn’t that going to eat through a disk or ssd’s read counts?

    • @manishsigdel824
      @manishsigdel824 Před rokem +1

      Ssds have read counts? I've almost only ever heard of storage deteriorating on writes only

    • @AlFredo-sx2yy
      @AlFredo-sx2yy Před rokem +8

      @@manishsigdel824 i think that based on the context of the message, it is safe to assume that they were talking about write counts because of the fact that they mentioned "caching all files every 30 seconds", which would mean writing to disk every 30 seconds. Unless i misunderstood what the OP meant.

    • @juh9870_projects
      @juh9870_projects Před rokem +9

      Just having chrome open will write more than 1 file per 30 seconds

    • @AlFredo-sx2yy
      @AlFredo-sx2yy Před rokem +7

      @@juh9870_projects yep, but that doesnt justify any program doing such a thing. I think its more of a testament to how badly designed chrome is and what a piece of sh*t software it is.

    • @juh9870_projects
      @juh9870_projects Před rokem +1

      @@AlFredo-sx2yy Except that A LOT of apps do it. 1 file per 30 seconds is not too much in a modern software world

  • @thunfischeis246
    @thunfischeis246 Před rokem

    Keep up the good work mate!

  • @thatnerd527
    @thatnerd527 Před rokem +2

    Something that someone may or may not have mentioned is that, for any filesystem (on Windows at least), you cannot delete folders directly just like that. Have you ever noticed that programs delete the subfolders and all files first before deleting the actual folder?. Thats why. Its a filesystem level limitation to my knowledge, since alot of stuff needs to happen to delete a folder before it can be deleted (checking permissions, checking if any files are not in use, etc.). So that's the reason why you are cant delete folders directly. As for why you are getting Access Denied when you are deleting a folder, idk why, its the error code Windows uses when you do that.

  • @sebastianwhiffen
    @sebastianwhiffen Před rokem

    Keep going for the love of all things holy

  • @omega_no_commentary
    @omega_no_commentary Před rokem +36

    Its a hassle to create cache, store it in memory, update it in the background... Handling all of that without any errors and no significant performance overhead is extremely difficult.
    You can (and will) get memory errors, out-of-sync problems, concurrency issues, low performance, etc.
    I dont even need to mention that choosing to use cache and building everything around it so that it works correctly and doesn't get out of sync translates into thousands of extra lines of code, and the more lines of code you have, the more bugs that will be introduced and the more expensive mantaining that codebase is gonna get.
    You will also have less money / time / motivation to invest in other parts of your project that are equally important like user experience, documentation, security and stability, etc.
    TLDR: If I were you, I'd drop the cache for the sake of code simplicity and less headaches.
    PD: Im at 1:43, still havent watched the whole video tho. Let me know if I predicted anything lol

    • @Afif87123
      @Afif87123 Před rokem +1

      it's kinda a tradeoff, having a cache really improves file searching (because it's literally walking through all the files) even though it's pain in the ass when you were there to add a new feature (or fix an existing bug)

  • @lolcat69
    @lolcat69 Před rokem +3

    ok but where is the button to easilly open a terminal window in that same folder? that would be a neat addition ( i could write it my self but i don't know any rust lol )

  • @x_techno_pro
    @x_techno_pro Před rokem +8

    use b-trees they are used for actual databases to keep memory usage and performance reasonable
    I recommend that you take a look at a book called "database internals" the second , the third and the forth chapter will help you a lot in understanding b-trees and how to store data on disk efficiently
    its not a long read don't worry
    EDIT:
    consider fetching sibling nodes to access similar filenames to what you searched for

    • @kuhluhOG
      @kuhluhOG Před 11 měsíci

      he went the manager route: delegating it

  • @hostgrady
    @hostgrady Před rokem +15

    I think instead of saving cache to disk every 30 seconds it would make more sense to save when you exit and maybe also after the program reaches a certain memory threshold

    • @lythd
      @lythd Před rokem

      i guess just the worry of crashing, so probably exit and every 30 seconds?

    • @hostgrady
      @hostgrady Před rokem +4

      @@lythd my main concern is the disk writes. I think there's a balance between getting accurate results and not destroying things like your disk and your memory. Thats why I think it's easier to simply calculate what's changed since you last left in the background and write that and from there just scan in the background for changes and add those into memory. Though to be fair I am not a programmer so idk how reasonable this is

    • @lythd
      @lythd Před rokem

      @@hostgrady that just sounds like redoing the cache, that would take too long.

    • @hostgrady
      @hostgrady Před rokem +1

      @@lythd counter point: his caching system sucks

    • @lythd
      @lythd Před rokem

      @@hostgrady possibly i wouldnt know i havent seen it. i just think rn itll be fine once he adds the save before exit.

  • @graffhyrum
    @graffhyrum Před rokem

    I saw you were using tauri for the app framework. Was there an issue with using surreal as the cache?

  • @sylviotv
    @sylviotv Před rokem +4

    Do you do this on live or twitch?

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

    4:00, is there no operator overloading?

  • @hyperskys
    @hyperskys Před rokem +5

    pretty cool, i like rust its cool! nice project i downloaded it, UI sucks tbh but pretty fast

  • @justine_chang39
    @justine_chang39 Před rokem +25

    bro tried to compare two objects and blamed Javascript 💀

    • @cfuendev
      @cfuendev Před rokem +4

      It's a canon event. All JS devs have to go through this

  • @ExediceWhyNot
    @ExediceWhyNot Před rokem +10

    Is HashCashMap some kind of asian dish or something?

    • @Floky
      @Floky Před rokem +1

      Sounds more like a drug tbh XD

  • @imsuck12
    @imsuck12 Před rokem +2

    I think you can abuse the Master File Table?

  • @sousoulefou
    @sousoulefou Před rokem +3

    I wonder if you can make it even faster xd

  • @dominiksramko
    @dominiksramko Před 10 měsíci

    Are you parsing the MFT or scanning the file system directly?

  • @user-pw5do6tu7i
    @user-pw5do6tu7i Před rokem

    A search in file would be nice too

  • @edwolt
    @edwolt Před 11 měsíci

    Could cache save the modification timestamp of the file/folder so it bacomes easy to validate and update cache during search?

    • @DaddyFrosty
      @DaddyFrosty Před 11 měsíci

      Interesting idea but there could be a lot of flaws, running a service in the background is probs the easiest solution to avoid cache issues.

    • @edwolt
      @edwolt Před 11 měsíci

      @@DaddyFrosty Wich kind of flaw could exist?

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

    I see some flightsim enyojer here (a320 checkilst and little navmap)

  • @Pollot
    @Pollot Před rokem

    I knew that I was watching a worthy channel as soon as I saw an A320 checklist and Little Navmap.

  • @lemonfoxmere
    @lemonfoxmere Před rokem +1

    We love objects!

  • @Firstnemonek
    @Firstnemonek Před rokem

    Can you make a tutorial where you explain how to create a file explorer?

  • @user-kn6uu8cc6l
    @user-kn6uu8cc6l Před rokem

    try to replace js with wasm rust, for example, yew (is very similar to react)

  • @Energy_on_yt
    @Energy_on_yt Před 8 měsíci +1

    how to run?

  • @s_m1010
    @s_m1010 Před rokem +5

    When You Try Something For First Time 😂

  • @pitachok4789
    @pitachok4789 Před rokem

    ggs

  • @FormalSnake
    @FormalSnake Před rokem

    I got to be in the video nice!

  • @tweney3452
    @tweney3452 Před rokem

    When next video about this

  • @TheGamingMaik
    @TheGamingMaik Před rokem

    Great video!

  • @skorp5677
    @skorp5677 Před rokem

    When part 3?

  • @peegee101
    @peegee101 Před rokem +1

    Whats the song at the very end?

    • @chris-xp9bc
      @chris-xp9bc Před rokem

      czcams.com/video/-ct3BNCty_g/video.html

    • @skorp5677
      @skorp5677 Před rokem

      +1 interested too

    • @conaticus
      @conaticus  Před rokem +1

      Here's a link: www.epidemicsound.com/track/504P66ZgB8/

    • @skorp5677
      @skorp5677 Před rokem

      @@conaticus Thanks!

  • @m4rt_
    @m4rt_ Před rokem

    Suggestion: add tabs

  • @marble_wraith
    @marble_wraith Před rokem +1

    4:05 It's even more fine to hate chatGPT... because that's where you got your code from.

  • @LiquidMark
    @LiquidMark Před rokem

    gaming

  • @zaper2904
    @zaper2904 Před rokem +10

    Ah rust a fast safe language where the safe code isn't fast and the fast code isn't safe.

  • @Perndoe
    @Perndoe Před rokem

    Use voidtool everything

  • @wattlefox
    @wattlefox Před rokem

    crab🦀

  • @realtristan288
    @realtristan288 Před rokem

    Try storing the cache in an sqlite database. Before you store it though, compress it. Storing that much in a json file is just a terrible idea🤣

  • @ItsObviousDude
    @ItsObviousDude Před rokem +1

    Every single programmer in the entire world be like 1:28 💀

  • @Omikronik
    @Omikronik Před rokem +2

    I dont recommend chatgpt for rust (sadly), what chatgpt knows is too outdated

    • @faeancestor
      @faeancestor Před rokem

      how should I code in rust then

    • @Omikronik
      @Omikronik Před rokem

      @faeancestor normally, with the docs and stackoverflow.
      Its still kinda helpful to get more info on errors you dont understand with chatgpt though. Just dont expect up to date code and library use.

  • @dave7244
    @dave7244 Před rokem

    My advice with any task. Do it the super dumb way until you need to add complexity.

  • @Dev-Siri
    @Dev-Siri Před rokem +1

    -This guy is officially a chad-

  • @RobLang
    @RobLang Před rokem +1

    "Coding better file explorer than Windows" ok then. Aim high.

  • @faultboy
    @faultboy Před rokem

    Now do it in C!

  • @the_true_dreamberddev
    @the_true_dreamberddev Před rokem +2

    nah bruh what you done now 💀

  • @ZeFoxii
    @ZeFoxii Před rokem

    Can you make it open source?

  • @batatanna
    @batatanna Před rokem

    I was gonna say all the mistakes in this video but youtube said the comment was too long

  • @luigidabro
    @luigidabro Před rokem

    It is going to use more RAM than Chrome

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

    I made it in python and its instant

  • @gamezuree
    @gamezuree Před rokem +1

    average experience of programming

  • @japlic
    @japlic Před rokem

    lol

  • @redstonebear
    @redstonebear Před rokem

    uhhh

  • @kenan2386
    @kenan2386 Před rokem +2

    successfully ruining a program my favorite

  • @jacobbutler5436
    @jacobbutler5436 Před rokem

    noti gang

  • @marcusrehn6915
    @marcusrehn6915 Před rokem +1

    We have a better file explorer, it's called ls

  • @joaopauloalbq
    @joaopauloalbq Před rokem +1

    plz stop T-T

  • @ntoes3378
    @ntoes3378 Před rokem

    just use c++, not some fake languages like rust or ts

  • @laundmo
    @laundmo Před rokem

    and during all this, "voidtools everything" is just out there searching terabytes as-you-type