Тёмный

Unreasonably Easy Console Apps in Rust 

Tsoding Daily
Подписаться 127 тыс.
Просмотров 98 тыс.
50% 1

Опубликовано:

 

28 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 193   
@tialaramex
@tialaramex 10 месяцев назад
ncurses is actually newer than the web - it's from 1993 and Tim starts the web in 1991 But it's called ncurses because it's the *new* curses. The curses library was invented to improve Rogue, over a decade earlier, so curses does pre-date the web and even most GUIs
@monad_tcp
@monad_tcp 10 месяцев назад
I always thought it meant new cursings, compared to the old cursings. Because that's what you say when you have to use such libraries.
@HalfMonty11
@HalfMonty11 9 месяцев назад
​@@monad_tcp ah old difficult cursing... like, "damn your lineage and let the fields run barren wherever you rest your head" as opposed to new more efficient cursing, "fuck you".
@hugo4it
@hugo4it 10 месяцев назад
fun fact: crossterm supports all UNIX and Windows terminals down to Windows 7
@monad_tcp
@monad_tcp 10 месяцев назад
Windows without VT , amazing.
@redpepper74
@redpepper74 10 месяцев назад
features: crossterm supports all UNIX and Windows terminals down to Windows 7
@SzásaTabasov
@SzásaTabasov 2 месяца назад
And as a matter of fact, crossterm supports all UNIX and Windows terminals down to Windows 7
@NSA.
@NSA. 20 дней назад
source: trust me bro jk source: the crossterm rust docs
@yannick5099
@yannick5099 10 месяцев назад
59:26 the vim beginner experience
@lowlevelcodingch
@lowlevelcodingch 6 месяцев назад
lol
@oxydiass
@oxydiass 10 месяцев назад
I speak french and it cannot do that 11:43 Best I can think of is «eaux», «noyaux» or «accueil»
@Glazer209
@Glazer209 10 месяцев назад
Didn’t even realize that cargo doc would build local docs for deps, that’s incredibly useful
@TonyUnderscore
@TonyUnderscore 10 месяцев назад
you also have the option to skip them with "--no-deps" I believe. Sometimes even docs take a while if you have a massive dependency tree and you just cargo cleaned lol
@lame_lexem
@lame_lexem 10 месяцев назад
i like to use `anyhow::Result` in my projects cos it's shorter to use `?` than `unwrap` and it's basically `Box` but instead of `Box` they use `Own` or something and provide helper functions like `context` and `bail!`
@yaksher
@yaksher 10 месяцев назад
Specifically, `Box` puts the vtable pointer in the box struct itself, turning it into a wide pointer; by contrast, `anyhow` puts the vtable pointer on the heap next to the thing that's boxed. This is slower, since it requires two dependent indirection where the first approach allows for parallel access (which with CPU pipelining is faster), but you don't really care if accessing your error is marginally slower usually and it means that if your non-error type in result is
@Notoriousjunior374
@Notoriousjunior374 10 месяцев назад
You certainly don’t need a crate for handling errors and be able to use the ? operator.. All you need is a generic error struct and just implement From for MyError and you can use question mark operator everywhere.
@Bobbias
@Bobbias 10 месяцев назад
@@yaksher Ideally your system shouldn't be throwing errors often enough for a performance impact like that to matter. I realize that's not always possible though, so of course there will be times where that may actually matter. But in general, that shouldn't be something you should worry about until the problem actually happens.
@yaksher
@yaksher 10 месяцев назад
​@@BobbiasThat was... exactly the point I made, yes.
@Bobbias
@Bobbias 10 месяцев назад
​@@yaksher People on the internet love to think that some practically irrelevant difference in performance somehow actually matters in their code, and nowhere did you say "this performance difference is meaningless". I just wanted to make that crystal clear to the sizable portion of Tsoding's audience who are not experienced programmers and who have that tendency to be terrified of anything that remotely sounds like it might hurt performance without actually understanding things.
@bwestbro
@bwestbro 9 месяцев назад
Thanks for the great videos! You inspired me to start a project I've been thinking about for a while and to use crossterm instead of a GUI.
@ME0WMERE
@ME0WMERE 10 месяцев назад
The hybrid Gopher/Ferris mascot is one of the most cursed programming-related things I've seen
@rikokante
@rikokante 10 месяцев назад
Maybe a weird question I guess but in your recent AMA, your answer to the question “how to learn programming” was to just fuck around. I personally struggle with getting an idea for a project and having the motivation for it. If someone makes me write some program or code, I will do research and do the best I can but I just struggle with getting an idea for a person project. What would you (or anyone) recommend?
@avidrucker
@avidrucker 10 месяцев назад
I think he's encouraging people to follow their curiosity. That said, you might not feel any particular inspiration or passion for making projects, and that can be OK too. Have you tried making tutorials to teach others? Or, have you tried taking any courses? Some people learn better with structure, accountability, and clear goals, versus exploratory/self-directed learning.
@emptybottle1200
@emptybottle1200 10 месяцев назад
i was inspired to have a simple personal project because of a movie, i watch some things that may inspire me to create something, you could try it this way.
@Mrme-cn9je
@Mrme-cn9je 10 месяцев назад
Would you think of making a rust tutorial series to teach people rust?
@PilarczykM
@PilarczykM 4 месяца назад
I like his folder size at the bottom of the terminal 😎😈😎
@opsJson_
@opsJson_ 10 месяцев назад
i'm missing C videos
@c4llv07e
@c4llv07e 10 месяцев назад
i'm missing Haskell videos
@dieSpinnt
@dieSpinnt 8 месяцев назад
"Oh it even can handle mouse events. I am intrigued!" Me: On the console? HERETIC!!! Hehehe, thanks for the video, Tsoder!:)
@Lanbyteach
@Lanbyteach 24 дня назад
I'm from Brazil and I like your videos
@Ma_X64
@Ma_X64 10 месяцев назад
It seems that the import section is growing noticeably faster than the program code itself. :D
@angelcaru
@angelcaru 6 месяцев назад
"Can your French do that?" - Tsoding
@thederpykrafter
@thederpykrafter 3 месяца назад
I still find it easier to just write a bash script with escape sequences
@raidensama1511
@raidensama1511 10 месяцев назад
Actually the “{x:.
@gishee18
@gishee18 10 месяцев назад
"-" * 30
@raidensama1511
@raidensama1511 10 месяцев назад
@@gishee18 yes and that too
@Bobbias
@Bobbias 10 месяцев назад
Rust's use of a sensible format syntax is much nicer to work with. C's format syntax is awful, even disregarding how broken printf et. al. are.
@monad_tcp
@monad_tcp 10 месяцев назад
​@@BobbiasC would be awful if it had a format capability. printf is just a 0-day enabler. Shots fired.
@v2ike6udik
@v2ike6udik 7 месяцев назад
29:37 smooth :)
@brdevll
@brdevll 10 месяцев назад
the jokes are on point with this one
@matteo.veraldi
@matteo.veraldi 8 месяцев назад
I cannot accept that you are not using autocomplete in Rust.
@ankitdange1749
@ankitdange1749 10 месяцев назад
India💔
@liminal6823
@liminal6823 8 месяцев назад
legacy-go-version
@youtubeforcinghandlessucks
@youtubeforcinghandlessucks 10 месяцев назад
I don't get why urmom wasn't queued but still waited for the clear and move with no flush
@iglobrothers645
@iglobrothers645 10 месяцев назад
Your killing my productivity... That's how awesome you are 🎉
@plumcakey
@plumcakey 10 месяцев назад
i love how i am learning stuff in a better way by just watching your videos instead of tutorials
@ivanjermakov
@ivanjermakov 10 месяцев назад
Building stuff yourself is even better.
@maximus1172
@maximus1172 10 месяцев назад
@@ivanjermakov My hands and mind stop working when I have to think about it lol
@javierflores09
@javierflores09 10 месяцев назад
@@maximus1172 it is just fear of making trash, you have to be humble and accept that anything you'll make at the beginninng will in fact be trash and then just iterate it till you have something that resembles a working program
@iamdozerq
@iamdozerq 10 месяцев назад
@@javierflores09Not always. I can do all kind of trash but my mind is white noise 90% of time.
@rogo7330
@rogo7330 10 месяцев назад
@@iamdozerq sleep better, intake tea with teaspoon of sugar, do not eat while thinking (makes you brain go into yum-yum-mode), eat before.
@VivekYadav-ds8oz
@VivekYadav-ds8oz 10 месяцев назад
The goal you mentioned at the start of the video (reserve the last line of the terminal for input and have conversations go on above it), reminds me when I was in high school and wanted to make my own terminal chat application. I also didn't want to use any library, and more importantly, was too lazy to learn ncurses. So I did it the non-portable hacky way as one would. Whenever a new message was received, I would just print "\b" `our_length` amount of times, where `our_length` is the length of the message our user is currently typing. Then print " " (space) `our_length` amount of times (\b doesn't remove the characters, it just makes ur cursor go back, so u need to write over them with a whitespace character). Now again print \b `our_length` amount of times to go back to the start of the line. Now print the received message, and then in the next line, print the user's currently typed-out message. This gave the illusion that the user has a dedicated text field.
@hariranormal5584
@hariranormal5584 10 месяцев назад
I am starting to like this guy. I hate anyone coding. But your commentary also just is amazing
@slicerabbit6166
@slicerabbit6166 10 месяцев назад
you hate programmers?
@hariranormal5584
@hariranormal5584 10 месяцев назад
@@slicerabbit6166 Ye. Dw, I hate myself first. My opinions anyways shouldn't matter.
@GRAYgauss
@GRAYgauss 9 месяцев назад
why do you hate anyone wut @@hariranormal5584
@avidiaa
@avidiaa 10 месяцев назад
You had become my first source of knowledge in programming and ... entertainment! Thank you really Tsoding
@callyral
@callyral 10 месяцев назад
youtube compression really dislikes scrolling
@yes-ni1od
@yes-ni1od 9 месяцев назад
Downloaded this video and watched it on a flight can’t complain
@jimhrelb2135
@jimhrelb2135 10 месяцев назад
I learned about `cargo tree` today. Love the paranoia-oriented programming approach, helps keep react andys from `npm install` onto 800+ deps for a hello world project at bay
@Bobbias
@Bobbias 10 месяцев назад
That's partly due to node's godawful community though. When you're developing a library, you need to be extra aware of any dependencies you pull in. For small things which are only like 1 or 2 functions, it's often a better idea to just recreate that functionality yourself rather than include an otherwise unnecessary extra dependency. When writing something which isn't intended to be consumed as a dependency itself there's less need to be quite so paranoid about things.
@Jack-sy6di
@Jack-sy6di 10 месяцев назад
@@Bobbias A decent model might be to have two ways of adding a library, either as a "dependency" or just copy-pasting it into your source tree. You could imagine something like "npm copy" to just stick the files right in your src/ so you can use them or modify them as if they were your own source code.
@monad_tcp
@monad_tcp 10 месяцев назад
​@@Bobbiasthe literally can't do that, imagine duplicating code that already exists elsewhere in the world. Imagine writing your own code. Totally "invented here" syndrome. Which is the opposite of not-invented-here in which you never use something you didn't make yourself. (which to be fair greatly simplifies and speeds up things, cut extremely the need for using outside libraries to a minimum)
@monad_tcp
@monad_tcp 10 месяцев назад
​@@Jack-sy6dithere's also the problem that JS is stupid and doesn't have a proper STL
@FDominicus
@FDominicus 10 месяцев назад
It seems the more often I see Rust, the more I dislike it ...
@peter9477
@peter9477 10 месяцев назад
Your loss, I guess. The benefits are well worth pushing past that early prejudice based on an emotional reaction to the syntax (assuming that's all it is).
@FDominicus
@FDominicus 10 месяцев назад
@@peter9477 You may be right. But I doubt it really is a loss ....
@prezes4478
@prezes4478 10 месяцев назад
Very informative video! I finally know how to flush, and how to clean
@wtfisgoingon535
@wtfisgoingon535 10 месяцев назад
In my humble opinion crossterm is here to stay. Lots of big crates/projects use it. In the worse case a fork will be made like for tui-rs (aka ratatui now) and the transition was seamless !
@TsodingDaily
@TsodingDaily 10 месяцев назад
> In my humble opinion crossterm is here to stay. lol
@real_ouss
@real_ouss 10 месяцев назад
What? Is it dead already? 😜
@wtfisgoingon535
@wtfisgoingon535 10 месяцев назад
@@TsodingDaily Hehe don't quote me later but i use crossterm since 2019/2020 so i don't see it go away anytime soon.
@monad_tcp
@monad_tcp 10 месяцев назад
Why do people feel this need for validation. Does the library do what you need ? Do any other libraries have a feature the one you are using doesn't have, no, then I fail to see the problem. If they have then you swap the libraries, or implement the feature in the library you're using , this is open source, baby. And you literally have the source to fix shit later if it's needed. Why must people only use what's popular. I don't get it, what a stupid metric. If something works, it works, this is engineering, not fashion.
@wtfisgoingon535
@wtfisgoingon535 10 месяцев назад
@@monad_tcp Is this message addressed to me ?
@dieSpinnt
@dieSpinnt 8 месяцев назад
terminal raw mode? It is good practice to safe the original states of the terminal settings that you change and restore them on exit (guaranteed by something like an exit or defer mechanism). That is the first and last thing you should always do. Well, besides that little ctrl-c problem, hehehe
@ademmohammed3939
@ademmohammed3939 7 месяцев назад
This guy is prime on crack!
@fhools
@fhools 10 месяцев назад
this is what coding is meant to be like. just having fun learning a library. none of this learn what a hook is, why we dont want class components,, call back vs async. I dont want a new paradigm of coding, i just want to show something on the screen.
@mire6134
@mire6134 10 месяцев назад
11:24 ~ 11:50 was hilarious
@Ma_X64
@Ma_X64 10 месяцев назад
Я так яростно закивал about that idiomatic shit, что ёжнулся головой о полку.
@aqibyaseen2122
@aqibyaseen2122 10 месяцев назад
28:47 😵‍💫😵‍💫 i am supposed to be developing web right now. . . . . ..
@thoriqadillah7780
@thoriqadillah7780 10 месяцев назад
As of 39:13, I don't know if you will explain more on the terminal flickering or not. But i tried build a terminal animation but a lot more simpler, and it was because of your previous video about bouncing ball on the terminal. I think the flickering can be solved by rendering it really fast like 60 frame per second
@monad_tcp
@monad_tcp 10 месяцев назад
It's amazing when terminals can stream text at tens of megabytes per second.
@Anton_Sh.
@Anton_Sh. 9 месяцев назад
@@monad_tcp can they&
@kxxxk_
@kxxxk_ 10 месяцев назад
this channel is simply gold
@nathanoy_
@nathanoy_ 10 месяцев назад
bump
@GrindAlchemyTech
@GrindAlchemyTech 10 месяцев назад
😅 you make it a fun journey... thankyou
@dieSpinnt
@dieSpinnt 8 месяцев назад
... does INCLUDE a call to if needed. Just because you guys otherwise hate superfluous keystrokes (Emacs-User, hehe) like the devil, don't you?:) :P But I get it. You do this because of your "IDE" and the headless duck programming style (error -> correct, error -> correct, error -> correct, and so on, hehehe) (secret-pro-200-iq-monster-tip-hint: rust-analyzer in the IDE/Emacs ... )
@Simon-xi8tb
@Simon-xi8tb 10 месяцев назад
React bros don't even know that Windows was written before React.
@TankorSmash
@TankorSmash 10 месяцев назад
I recently boosted the sensitivity of my mousewheel, hearing yours each time you scroll reminded me. It is so nice to just go one notch and a bunch of lines now.
@costelinha1867
@costelinha1867 7 месяцев назад
"Queue can fail" Wait... if it can fail... shouldn't the rust compiler just have... rejected the code altogether? I thought you weren't allowed to ignore fail cases in Rust... at least not without unrwapping or something...
@thirdvect0r
@thirdvect0r 10 месяцев назад
Malding over skill issues, classic zozing
@fiona9891
@fiona9891 5 месяцев назад
watching you manually type out all of the use items is driving me insane i have gotten too used to autocomplete. it's eroding my brain
@lamprospitsillou6325
@lamprospitsillou6325 10 месяцев назад
Why did raw mode fix the issue?
@tauraamui
@tauraamui 10 месяцев назад
At about 13:59ish minutes in you got annoyed about the compiler telling you you had unused imports and to remove them, but it then required you to put it back. The reason you initially had the unused import warning was because of your unwrap being in the wrong place, and therefore it was never actually requiring that type to be in scope, until you moved unwap to the correct line. I am no fan of Rust, but to be fair that isn't something that the compiler would have known to account for.
@anon_y_mousse
@anon_y_mousse 10 месяцев назад
That it warns of unused imports is something it can handle. It just shouldn't do that.
@monad_tcp
@monad_tcp 10 месяцев назад
Except it is, why do you need to import things you don't use directly, aka transitive dependencies. Just do Hindley&Milter type inference on that. I'm kidding, that would make compile times almost infinite . Unless Rust is full of extension namespaces . Then it really is fair
@konstantinrebrov675
@konstantinrebrov675 10 месяцев назад
This is a very good knowledge for RUST developers! Spasibo
@johanngambolputty5351
@johanngambolputty5351 10 месяцев назад
GUI is also very easy in rust with something like egui & egui_inspect (fork, because egui_inspect is kinda dead). I've been meaning to try clap and ratatui for cli and tui, but not sure there's that much point (for me, since adding egui_inspect to my structs is trivial enough, except for maybe headless access).
@eyemotif
@eyemotif 10 месяцев назад
i can attest as someone who isnt that good at making actual guis that ratatui and clap/argh are very nice and easy to work with
@barbiefan3874
@barbiefan3874 10 месяцев назад
egui_inspect is a fork of egui? egui is dead? what are you on about? egui_inspect is a crate with derive macros for egui itself egui is alive and well, last commit 6h ago
@johanngambolputty5351
@johanngambolputty5351 10 месяцев назад
​@@barbiefan3874 egui_inspect is dead, egui is of course fine and there are other inspect crates that are probably alive
@johanngambolputty5351
@johanngambolputty5351 10 месяцев назад
@@barbiefan3874 I mean I use a fork of egui_inspect
@not_ever
@not_ever 10 месяцев назад
@@barbiefan3874 I dont think that is what they said. They said they use egui and a fork of egui_inspect "because egui_inspect is kinda dead"
@Lanbyteach
@Lanbyteach 23 дня назад
1:12:00
@vanvothe4817
@vanvothe4817 10 месяцев назад
Do you use lsp in emacs?
@Eugensson
@Eugensson 5 месяцев назад
English: «Queueable» Luxembourgish: hold my beer... «Zweeeeëg»!
@Eugensson
@Eugensson 5 месяцев назад
Dutch: «koeieuier»
@rotteegher39
@rotteegher39 9 месяцев назад
54:47 It's an Ukrainian flag? What is it doing there?
@uncleabe8147
@uncleabe8147 5 месяцев назад
tats was awesome
@xsamuelx3603
@xsamuelx3603 10 месяцев назад
Felca Programador :)
@xsamuelx3603
@xsamuelx3603 10 месяцев назад
:)
@okage_
@okage_ 10 месяцев назад
yay
@AlexK544
@AlexK544 10 месяцев назад
Thank you for way how you do stuff. I learned a lot about workflow. Btw how you edit multiple lines in vim when adding second binary?
@10inall28
@10inall28 10 месяцев назад
Sir! Can you please explain Rust Lifetimes concept from ground
@notSoAnonyymus
@notSoAnonyymus 10 месяцев назад
Funny this video just popped up as im switching from nodejs to rust. Coincidentally I learned about CLI just before switching. Will be fun.
@christopher8641
@christopher8641 10 месяцев назад
Would you mind telling me how i should feel about the rust programming language? I need something topical and snappy. Please I'm trying to base my whole personality off of this programming tool. Dude please
@VivekYadav-ds8oz
@VivekYadav-ds8oz 10 месяцев назад
This communiity seems divided.. you'll end up having a bipolar personality lol
@frandrumming
@frandrumming 7 месяцев назад
I have a question, why is it so hard to center an element in rust? ^^
@ryanleemartin7758
@ryanleemartin7758 9 месяцев назад
This is Rust program.. so be patient. lol nice.
@Shahnawaz_Laghari
@Shahnawaz_Laghari 10 месяцев назад
Hey i wanna know what code editor you use for gui of c++
@rogo7330
@rogo7330 10 месяцев назад
Actually not having a client and make everything work over something simple as netcat can be beneficial. The only problem is that server must do all the work of setting up terminal for you. Otherwise you can do netcat with rlwrap, but this limits you to one-line input, or do pipes in folders like ii does for IRC, where you can just cat file 'out' and write to other pipe 'in'.
@monad_tcp
@monad_tcp 10 месяцев назад
26:31 yes, but only if you use Canvas
@mrcrafter_y
@mrcrafter_y 10 месяцев назад
Another tsoding vod to get to sleep.
@jhtakalo
@jhtakalo 10 месяцев назад
Good stuff. Thanks a lot!
@im-anomalies
@im-anomalies 10 месяцев назад
You really deserve more subs dude, a lot more
@abzrg
@abzrg 10 месяцев назад
thank you x 3
@toskito123
@toskito123 10 месяцев назад
Is that Neovim?
@AlexGalchenko
@AlexGalchenko 10 месяцев назад
it is emacs
@yaksher
@yaksher 10 месяцев назад
@1:01:30 Named loops + breaks crying in the distance. @1:10:10 Range indexing, crying in the distance. Why would you just index from where you need instead of iterating the entire thing every time. That would be insane. @1:18:20 Sees it asking for parenthesis, immediately gives up instead of just putting the parenthesis where it said to (granted, the thing he ended up with is better, but still)
@ElPikacupacabra
@ElPikacupacabra 9 месяцев назад
Yeah, that iterator being consumed from index 0 was cringe. 😂 Maybe the quit flag is OK, because you don't know what your cleanup needs, long-term.
@yaksher
@yaksher 9 месяцев назад
@@ElPikacupacabra I mean, in Rust: - you very rarely need cleanup because it's almost always done through destructors - you can just... put the cleanup after the loop? Like you would anyway?
@MurtagBY
@MurtagBY 10 месяцев назад
At minute 10 it is sort of strange to see you making "fun" of the term queue and telling that the authors didn't know the term batch. Are you deadly sure one preceeds and fully includes the another?
@adarshdhital007
@adarshdhital007 10 месяцев назад
Hi, currently addicted to Rust because of your rust videos...
@OmOhm-gn7yz
@OmOhm-gn7yz 7 месяцев назад
You keep repeating yourself, I've noticed that it comes more often when you are out of the script. It denotes that your body is making use of Alternate Current for tasks that asks for Continuous Current. It is a backup so your system won't stall, but renders a choppier experience, undermining all your apparent strengths. Perfection comes primarily from brushing off imperfections. But it doesn't mean that the signal at the end will be better. In our case, perfection is when everything functions as expected, without extra loops.
@abcdefg-nu4xj
@abcdefg-nu4xj 10 месяцев назад
is rust still the future or was it ruined because all the drama in the community ..?
@TsodingDaily
@TsodingDaily 10 месяцев назад
Have you even tried programming in it or do you treat as just a fashion item?
@vinos1629
@vinos1629 10 месяцев назад
Rust is a tool, imagine saying I will not use a hammer because I don’t like the hammer making company
@nyyakko
@nyyakko 10 месяцев назад
@@vinos1629 i mean, well, in some contexts this argument may apply. what if the said company makes shitty hammers? 😅
@poggybitz513
@poggybitz513 10 месяцев назад
@@vinos1629 I say that. But then again, I work in hardware design, we love politics in our industry. The company I work for, arm, has a policy to only use tools from the people who aren't total dipsticks and is very anti open source. Not saying rust is that, rust is baby compared to drama in our industry.
@vinos1629
@vinos1629 10 месяцев назад
@@nyyakko you can argue rust is shitty, but for me it’s a useful tool in a lot of applications, If they make it shit I will stop using jt
@ferdynandkiepski5026
@ferdynandkiepski5026 10 месяцев назад
You can now add the -Zthreads=8 environment flag on the nigthly build to use the specified number of threads during frontend compilation which should make it faster.
@youtubeforcinghandlessucks
@youtubeforcinghandlessucks 10 месяцев назад
i wonder if this terminal library can put a character in the lower right corner of the terminal without causing it to scroll to a new line. thats like the ultimate challenge for terminal libraries
@redpepper74
@redpepper74 10 месяцев назад
I was working along with this video to make my own terminal app and unfortunately the answer seems to be no for windows
@bassguitarbill
@bassguitarbill 10 месяцев назад
41:39 lol I've been rereading the perl book, and one of their fundamental operators, alongside `+` and `*`, is `x`, the "string multiplication" operator, so literally `stdout.write("-" x w)` would do what you need here. I still don't know if perl is a good language but it's definitely a fun language
@aspectreishauntingeurope
@aspectreishauntingeurope 10 месяцев назад
that's so cursed
@potatomaaan1757
@potatomaaan1757 10 месяцев назад
In python you can also do `"-" * w`
@benisrood
@benisrood 10 месяцев назад
How is string multiplication defined as an operation?
@peter9477
@peter9477 10 месяцев назад
​@@benisroodOperator overloading? Heck, you might even be able to define a trait in Rust that lets you do the same.
@ElPikacupacabra
@ElPikacupacabra 9 месяцев назад
Perl is quite powerful for string manipulations, but a real pain to read. It leads people to write very cryptic code.
@goose_clues
@goose_clues 9 месяцев назад
やっぱrustってクソっすね、忌憚の無い意見ってやつっす
Далее
Forbidden Rust
2:02:07
Просмотров 45 тыс.
Rust Functions Are Weird (But Be Glad)
19:52
Просмотров 136 тыс.
Главное рыба есть, а воды нет..
00:54
Rust Powered Polymorphism ⚡️ With Traits
9:55
Просмотров 99 тыс.
Nix explained from the ground up
23:39
Просмотров 33 тыс.
I tried React and it Ruined My Life
1:19:10
Просмотров 132 тыс.
but what is 'a lifetime?
12:20
Просмотров 73 тыс.
Writing a game the hard way - from scratch using C. #1
34:20
Microservices are Technical Debt
31:59
Просмотров 332 тыс.
Being Competent With Coding Is More Fun
11:13
Просмотров 81 тыс.
Rust's Alien Data Types 👽 Box, Rc, Arc
11:54
Просмотров 145 тыс.
Let's make an htop-like in your browser (with Rust)
51:25