V - Best Programming Language to Learn in 2023?

Sdílet
Vložit
  • čas přidán 6. 07. 2024
  • A walkthrough of what the V programming language is, what it aims to become, and what the current state of its community is.
    ---
    Stuff I use to make these videos - I absolutely love all of these products. Using these links is an easy way to support the channel, thank you so much if you do so!!!
    Camera: Canon EOS R5 amzn.to/3CCrxzl
    Monitor: Dell U4914DW 49in amzn.to/3MJV1jx
    Keyboard: Keychron Q1 amzn.to/3YkJNrB
    SSD for Video Editing: VectoTech Rapid 8TB amzn.to/3hXz9TM
    Microphone 1: Rode NT1-A amzn.to/3vWM4gL
    Microphone 2: Seinheiser 416 amzn.to/3Fkti60
    Microphone Interface: Focusrite Clarett+ 2Pre amzn.to/3J5dy7S
    Tripod: JOBY GorillaPod 5K amzn.to/3JaPxMA
    Mouse: Razer DeathAdder amzn.to/3J9fYCf
    Computer: 2021 Macbook Pro amzn.to/3J7FXtW
    Lens: Canon RF24mm F1.8 Macro is STM Lens amzn.to/3UUs1bB
    Caffeine: High Brew Cold Brew Coffee amzn.to/3hXyx0q
    More Caffeine: Monster Energy Juice, Pipeline Punch amzn.to/3Czmfox
    Building A Second Brain book: amzn.to/3cIShWf
  • Věda a technologie

Komentáře • 535

  • @codetothemoon
    @codetothemoon  Před rokem +40

    ERRATA: At around 7:00, I explain what the vision for autofree is. I say that it aims to automatically distinguish between cases where something needs to be deallocated at the end of the scope it was defined in, and cases where runtime reference counting is needed. But I skirted over one of its core value props - and that is that it aims to determine at compile time when memory is no longer needed and deallocate that memory, even when that place is not in the same scope where the memory was allocated. The claim is that it can do this *without* a runtime reference count in the vast majority of scenarios, but will fall back to runtime reference counting in the cases where it can't.

    • @fionawashere1086
      @fionawashere1086 Před rokem +5

      Don't forget to pin this comment.

    • @codetothemoon
      @codetothemoon  Před rokem +5

      @@fionawashere1086 ahh thanks for pointing this out! Pinned.

    • @godofbiscuitssf
      @godofbiscuitssf Před rokem +2

      Objective C has been around for nearly 40 years and for most -- if not all -- of its lifetime it's had the autorelease that the dev invokes manually. The boundary conditions are pretty clear: values declared in local scope / stack that are not assigned to references that exist beyond that scope. In ref-counted systems, it's a +1 ref count followed immediately by a -1 so that it's at 0. then when scope ends, it gets freed.

    • @codetothemoon
      @codetothemoon  Před rokem +2

      ​@@godofbiscuitssf Right - I think the novel thing here that memory is freed when it is no longer needed, even if that is prior to or after the end of the scope where the memory was allocated and even if there are multiple references to it - in many cases without even needing an RC.

    • @godofbiscuitssf
      @godofbiscuitssf Před rokem

      @@codetothemoon does this differ to ARC in Swift and Objective C? Because I was describing the situation before ARC came along. ARC has been around quite some time now.

  • @n_kwadwo
    @n_kwadwo Před rokem +262

    As a Go programmer I think I already know V

    • @esquilo_atomico
      @esquilo_atomico Před rokem +10

      exactly, so similar

    • @MrMashyker
      @MrMashyker Před rokem +9

      selective variable capturing by closures is dope, though

    • @morgengabe1
      @morgengabe1 Před rokem +3

      The docs say you should

    • @paul1
      @paul1 Před rokem +21

      Go++

    • @RootsterAnon
      @RootsterAnon Před rokem +1

      that was my very same thought when he started coding V.

  • @theherk
    @theherk Před rokem +57

    Been following it for a few years now, and it doesn't ever seems to be moving along as quickly as its claims do. Pretty uninteresting when the field is filled with so many great languages currently.

  • @sinom
    @sinom Před rokem +61

    C++ smart pointers (unique_ptr and shared_prt) exist and have existed in the standard for over a decade now (2011) and have existed in the boost library for almost 2 decades (2004). They handle the freeing for when the variable goes out of scope.
    Yes you can also use manual new/delete and manual malloc/free but you only rarely actually have to do that and usually _shouldn't_ do that.

    • @mister-ace
      @mister-ace Před rokem +13

      imo c++ isn’t so bad language as it described by rustaceans , I think it’s easy to avoid memory issues now.

    • @SkyyySi
      @SkyyySi Před rokem

      Aren't those using reference counting, though?

    • @chiragsingla.
      @chiragsingla. Před rokem

      @@mister-ace thread safety tho

    • @qookie
      @qookie Před rokem +1

      @@SkyyySi shared_ptr is ref-counted, but unique_ptr isn't, and only uses language features (destructor, deleted copy ctor, custom move ctor) to implement it's functionality

    • @sinom
      @sinom Před rokem

      @@chiragsingla. relatively new to the standard but atomic shared pointers also exist. They were added as a TS in 2016 introduced into the main draft in 2017 and are in the standard as of C++20. Also if you can't use C++20 for a project boost has also had them since at least 2017

  • @wertzui123
    @wertzui123 Před rokem +7

    That's a really good video, keep it up!

  • @diadetediotedio6918
    @diadetediotedio6918 Před rokem +13

    Hmmm, I did not know, it appears to have some curious problems with this approach of using ref-counting automatically, it makes the code very less explicit than it proably should be, and I wonder if the switch from autofree to manual memory management wouldn't hurt a lot when people actually need to change. It is surely an interesting language, but I think it is not, at least for now when it is not stable yet, worth learning more than other already working languages, maybe in the future it could be great.

  • @VeitLehmann
    @VeitLehmann Před rokem +101

    It's like Go and Rust had a baby - very slick language, I really dig its design! Very smart and pragmatic choices all over the place! Thanks so much for the intro, I learned a lot and might give it another shot! I had a look a couple of years ago, it was already very promising back then but it still was very immature.

    • @pixobit5882
      @pixobit5882 Před rokem +3

      I had exactly the same thoughts. It looks syntactically similar to go and got some variables from Rust. Since it is transpiling to C code, it could be potentially used for bare metal programming in a go-style.

  • @luisfelipebaptista
    @luisfelipebaptista Před rokem +12

    Am I the only one who thinks this video is going a bit too fast? Great content but it would be nice to see the code at the end for a few seconds before it cutting away to the next part. Had to watch it in .75 speed and pause constantly

    • @codetothemoon
      @codetothemoon  Před rokem +5

      I don't think you're the only one. It's very tricky getting the pacing right so that folks stay engaged but the video doesn't become confusing. Probably one of the most difficult aspects of doing YT 😕

    • @kivimangoproductions9655
      @kivimangoproductions9655 Před rokem +4

      @@codetothemoon you should leave a 0.5-1 sec part before transitioning/sliding to the next part of the video.I can t even read the code on the screen and listen to the talk without pausing the video.

    • @bunny_the_lifeguard9789
      @bunny_the_lifeguard9789 Před rokem +6

      @@kivimangoproductions9655 💯 Take your time! I think your core audience is not teens with an attention span for tiktok shorts.

  • @phenanrithe
    @phenanrithe Před rokem +59

    Very interesting! I'm also wondering how the autofree works. I'm a little concerned that it conceals potential leaks by circular references without the user knowing from just looking at the code. Or just very late freeing of objects.

    • @fdimb
      @fdimb Před rokem +7

      From what I found on the reddit discussion and other places in the internet, that's the current situation, at the moment it cannot guarantee that no leaks will happen for a 100% of the cases (although that's the goal), that's why the --autofree flag ships with the GC anyway for that 10% of the cases when autofree missed some borrowing at compile time.
      There's also a discussion (not for v specific) about optimized, multi-core GCs that could outperform by miles the current implementations, which could mean that this current mix of autofree and a gc might not even be a bad choice, as that could work best for cases where memory deallocation occurs frequently. Ultimately, the goal would be to find a balance between performance, predictability, and ease of use.

    • @gagagero
      @gagagero Před rokem +8

      It leaks in a hello world. This project is vaporware.

    • @fdimb
      @fdimb Před rokem +3

      @@gagagero Are you talking about a blog post from 2019 or from a recent, 2023 test with autofree+gc?

    • @awwastor
      @awwastor Před rokem +3

      (currently, it doesn’t)

    • @gagagero
      @gagagero Před rokem +1

      @@fdimb A friend of mine tested it a few days ago, it leaks.

  • @eduardabramovich1216
    @eduardabramovich1216 Před rokem +33

    Now that you mention Nim, I really feel it deserves a lot more attention, hopefully you can dive into it with some practical examples.

    • @codetothemoon
      @codetothemoon  Před rokem +2

      absolutely, I'm hoping to dive further into nim. I've only worked with it very briefly but I found it to be very enjoyable

    • @airman122469
      @airman122469 Před rokem +1

      I agree. Nim is a good language. V is promising, but Nim is already good. I think V has the advantage that it’s syntax is very go-like.

    • @a0um
      @a0um Před rokem

      There is a published book by Manning on Nim: “Nim in Action”! I Think this is a sign of its maturity.
      I liked V at first sight, but I also had an impression it’s memory management was not fully implemented yet! I got quite suspicious after that (3 years ago).
      On the other hand I reckon that Nim is already used in commercial projects.
      But as a Java developer switching tech stack, I’m focusing all my energies on Go: a much safer bet than Nim or V.

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

      @@a0um There is also Mastering Nim book by the language creator Andreas Rumpf, physical version only. I have yet to get that one.

  • @sp.n7401
    @sp.n7401 Před rokem +11

    Nim also has ARC memory management that's becoming default in 2.0 (current devel).

    • @codetothemoon
      @codetothemoon  Před rokem

      This is interesting - I'm guessing they only add reference counting where needed. Given that, I'm curious whether they handle some of the tricky scenarios where reference counting actually isn't needed, but maybe a naive compiler would think it is needed.

  • @al1gned
    @al1gned Před rokem +3

    As a go programmer I already feel entitled to try it, thanks for such a detailed video.
    Also, what colorscheme are you using in your editor? Monokai? Looks so calm and classy.

    • @codetothemoon
      @codetothemoon  Před rokem

      Yeah I think the Go crowd will feel right at home with V. Good guess, I'm using doom-monokai-pro 😎

  • @LAlvarez321
    @LAlvarez321 Před rokem

    What font are you using for doom emacs?

  • @HyruIia
    @HyruIia Před rokem +14

    I'd stick and improve my skills with Rust than learning another language.

    • @codetothemoon
      @codetothemoon  Před rokem +8

      wouldn't fault you for doing so! there's definitely a cost associated with always diving into the bleeding edge stuff that has an uncertain future. There's something to be said for keeping your focus on one thing and not getting distracted!

    • @HyruIia
      @HyruIia Před rokem +1

      @@codetothemoon Exactly! Thank you.

  • @lardosian
    @lardosian Před rokem +1

    Thanks, never heard of this language before!

    • @codetothemoon
      @codetothemoon  Před rokem +1

      Happy I was able to get it on your radar! It wasn't on mine either until very recently

  • @ViktorFerenczi
    @ViktorFerenczi Před rokem +3

    We're in the age of too many similar programming languages. - Do we even need more at this point?

  • @user-qp9ks1yo6r
    @user-qp9ks1yo6r Před 10 měsíci

    What font are you using?

  • @coveloper
    @coveloper Před rokem +15

    Swift / Obj-C are great examples of ARC that really, really work. It's totally possible, although I'm sure it's tricky to get right

    • @codetothemoon
      @codetothemoon  Před rokem +2

      This is interesting - I wonder if there is a gap between what they do and what autofree aims to do. Because I think they have acceptable performance but definitely aren't known for top tier performance.

  • @MegaMage79
    @MegaMage79 Před rokem +1

    Cool video. What font are you using ?

  • @bunny_the_lifeguard9789
    @bunny_the_lifeguard9789 Před rokem +10

    Haha, the mascot is indeed better :D

  • @Viralvlogvideos
    @Viralvlogvideos Před rokem +1

    Great video learned a lot, bro can you please tell me what extension your using to add that sound effect when your typing the code. It sounds too good

    • @codetothemoon
      @codetothemoon  Před rokem

      Nice glad you got something out of it! I actually just mic up the keyboard when I'm recording myself typing.

    • @Viralvlogvideos
      @Viralvlogvideos Před rokem

      @@codetothemoon what keyboard you use?? It really sounds good

  • @rachelraja7188
    @rachelraja7188 Před rokem +1

    Hi, it's like an all in one,universal language so far with aspects of the other languages.Illmake sure I learn V as well. Cool. Thanks for the well explained video as I'm new to programming and am learning SO much it's getting addictive 😅I love to code!

    • @codetothemoon
      @codetothemoon  Před rokem

      Thanks Rachel, congrats on starting your programming journey! I share your passion for it, and feel gratitude every day for the opportunity to be a practitioner

  • @joebarhouch2742
    @joebarhouch2742 Před rokem +1

    Cool might actually learn it. what's the font name and theme you have!

  • @phelix3395
    @phelix3395 Před rokem +1

    May I ask what font you are using in the editor?

  • @shapedthought
    @shapedthought Před rokem +2

    Funny you posted this video I bought the book last weekend, very promising but there are some bits I'm still not sold on.

  • @sinom
    @sinom Před rokem +3

    3:40 that looks a lot like captures in c++ lambdas. Looking at the doc's they are similar just that they don't support wildcards and are always capture by copy.
    The docs for function captures also showcase that references in V are in themselves also basically just pointers that if you copy you get another reference instead of a copy of the underlying object which I don't really like.

  • @dkwdvnte
    @dkwdvnte Před rokem +2

    Interesting video, although it reminds me a lot of Go, thank you anyways! Could you review Crystal lang next?

    • @codetothemoon
      @codetothemoon  Před rokem +1

      Thanks! I actually took a brief look at Crystal in the video "Rust vs 7 other languages you probably haven't tried". I was extremely impressed with it during the brief time I used it, i'm hoping to get more time with it at some point.

  • @delian66
    @delian66 Před rokem +53

    Thanks for trying V, and for the unbiased review about it.

    • @codetothemoon
      @codetothemoon  Před rokem +9

      Thanks for watching! Glad it came off as unbiased, that's exactly what I was going for.

  • @viktorshinkevich3169
    @viktorshinkevich3169 Před rokem +5

    I loved explicit closure params. All the other, idk, it’s confusing to be able doing similar things in many different ways, reminds me ruby

    • @yuartv
      @yuartv Před rokem +1

      Hi, can you pinpoint what exactly you found confusing?

  • @soanvig
    @soanvig Před rokem +1

    Last time I used it, year ago or so, it compiled not working code, even if syntactilly it was correct. Telling from various readmes that list projects in V it is ORM, GUI and freakin Linux replacement and others. Without fully working and documented compiler. What the hell went wrong

  • @iwolfman37
    @iwolfman37 Před rokem +2

    A lot of people saying it's like Go++ but if it doesn't have the Go standard library, it's more like Go--

    • @codetothemoon
      @codetothemoon  Před rokem +1

      haha! yeah i think the next logical step would be to do a deep dive comparison of V and Go, and take a look at language features, performance, ecosystem, etc. When I made this video I didn't realize the full extent of V's similarity to Go

  • @andrei-speedy5786
    @andrei-speedy5786 Před rokem +1

    what font do you use for emacs?

  • @gamcd
    @gamcd Před rokem +5

    It’s just a weirder go with a really fast compiler

  • @mwnkt
    @mwnkt Před rokem +1

    really loving the videos, btw what editor do you use

    • @codetothemoon
      @codetothemoon  Před rokem +1

      thank you, glad you're getting something out of them! I'm using DOOM Emacs

    • @mwnkt
      @mwnkt Před rokem

      @@codetothemoon thanks

    • @mwnkt
      @mwnkt Před rokem

      @@codetothemoon thanks, i forgot to ask the font and theme also

  • @WebGuyAron
    @WebGuyAron Před 3 měsíci

    What is that font tho? it's so nice

  • @ujjawalsinha8968
    @ujjawalsinha8968 Před rokem

    Concurrency support? Does it have channels and v-routines like golang?

    • @zkshulgin
      @zkshulgin Před rokem +1

      Yes it does. It uses the go keyword for them haha

  • @FedericoViscomi
    @FedericoViscomi Před rokem +12

    The koka programming language claims to have achieved something similar to the autofree feature mentioned in this video

    • @codetothemoon
      @codetothemoon  Před rokem +7

      Thought I'd heard of all the new bleeding edge languages at this point, but this is the first I've heard of Koka. Thanks for the mentioning it, I've added it to my "to check out" list!

    • @PhosphorusMoscu-code
      @PhosphorusMoscu-code Před rokem +1

      @@codetothemoon the effects system feature that was talked about a couple of blog posts ago in Rust is possible that it originates from Koka

    • @SaHaRaSquad
      @SaHaRaSquad Před rokem +1

      ​@@codetothemoon To me Koka seems like a purely functional Rust. If I'm being honest some of what I've seen goes straight over my head but it has some amazing ideas.

  • @BD-hx9lf
    @BD-hx9lf Před 9 měsíci +1

    which font are you using in this video?

  • @SaHaRaSquad
    @SaHaRaSquad Před rokem +35

    A huge problem I see with V is target audience. If I'm okay with slight performance compromises (garbage collection/autofree) I can use Go or target WASM. If I need C-like performance I want full control over memory management, which makes Zig or Rust preferrable. How is V supposed to compete?
    Also, autofree is a huge challenge and will likely influence the language's design, delaying it in favor of GUI features etc seems like a questionable order of priorities.

    • @holthuizenoemoet591
      @holthuizenoemoet591 Před rokem

      they should introduce an option to disable it

    • @dealloc
      @dealloc Před rokem +1

      @@holthuizenoemoet591 You can. But then what's the point of a language that doesn't provide actual value? Not that autofree does this anyway. But the syntax is nothing to run home for. So what is?

    • @casper64
      @casper64 Před rokem

      V is compiled to C so every lib written in C can be used in V and (almost) be converted to V. Development time is very fast and you can learn everything of the language in an hour

    • @casper64
      @casper64 Před rokem

      I work in cyber security and the language helps me write code fast like python, but with the performance and control of C.Also inline assembly code is a plus for me.

    • @the_mastermage
      @the_mastermage Před rokem

      it could be usefull in science where you want quick prototyping but also dont necessarily want to deal with the slowness of some interpreted languages (I am looking at you Python)

  • @oleksiilobodiev9446
    @oleksiilobodiev9446 Před rokem +1

    What font and theme are you use?

  • @ewertonls_
    @ewertonls_ Před rokem +11

    That clojure syntax is criminal

  • @pumpkinjutsu1249
    @pumpkinjutsu1249 Před rokem +2

    What is the font used? The parentheses are gorgeous!

  • @homursumpsen8748
    @homursumpsen8748 Před rokem

    what is the color scheme you are using?

  • @UnDarkVader
    @UnDarkVader Před rokem +4

    A question: Can V to programming for Esp8266 or esp32 boards?

    • @K5RTO
      @K5RTO Před rokem

      seems possible if it compiles initially to C anyway.

    • @Ether_Void
      @Ether_Void Před rokem

      With Arduino it shouldn't be a huge issue.
      However with ESP-IDF it might be a bit difficult adding bindings for all the IDF functions especially considering that the available functions change depending on the IDF config. It should be possible as we also see with Rust bindings. But some features might be unavailable without falling back to C and the IDE support might not be great depending on how the tool chain will handle that case.

  • @jimmyneutron129
    @jimmyneutron129 Před 9 měsíci +1

    the idea seems cool, will wait to see how it evolves. a bit strange to incorporate gui right into when it is on version 0.4

    • @codetothemoon
      @codetothemoon  Před 9 měsíci

      agree, wouldn't fault anyone for holding off until it gets a bit more mature

  • @shouNen_FPS
    @shouNen_FPS Před rokem +1

    What is the name of the font you are using?

  • @cristianchira3615
    @cristianchira3615 Před rokem +1

    Hey, can you tell us what theme and font you're using?

  • @Innengelaender
    @Innengelaender Před rokem

    ok I like the idea but already hate the syntax after just the first minute - don't know exactly why - maybe it is just hard to read what exactly is going on because I am not used to it
    especially the := vs = just feels wrong - what's wrong with a declaration keyword?
    and damn the closures look ugly / hard to read
    Also for some reason I have a lot of difficulty with programming languages that leave the brackets around conditions (but that is a me-issue I guess)

  • @flamakespark
    @flamakespark Před rokem

    I was a bit confused with memory handling when passing a variable (non-reference) into a scope/function. Is this variable moved into scope? Is it copied? Is this a mutable reference? This moment is unclear tbh, and not well described in docs.
    In GC languages you pass a reference, in Rust it depends on the annotation, in V lang it depends on the... scope??? I'd really appreciate an explanation to this memory behavior

    • @casper64
      @casper64 Před rokem

      Currently V depend on entirely GC, but you can enable auto free and that inserts most of the necessary free calls in your code during compilation time. The rest is handled by GC

    • @casper64
      @casper64 Před rokem

      So when you would allocate a variable on the heap V inserts a free call in the code during compilation time. So at runtime the program is faster and it won’t leak memory, because the other cases are handled by a GC

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

    0:48 whats arena allocation

  • @encapsulatio
    @encapsulatio Před rokem +1

    What coding font and theme is that?

  • @EdouardTavinor
    @EdouardTavinor Před rokem +1

    The syntax reminds me a lot of go. I wonder if it also copies the bits of go that are absolute genius? (channels, goroutines, duck typing for interfaces etc)

    • @codetothemoon
      @codetothemoon  Před rokem

      that's a great question - I didn't encounter any of the features you mention, though I could have overlooked them.

    • @delian66
      @delian66 Před rokem +1

      There are channels, and OS threads for now, goroutines/green threads are planned, but not implemented yet. Starting a new OS thread is done similar to Go, with `spawn fn() { println('hello') }`, launching a new green thread will use `go fn() { println('hello') }` .
      Duck typing for interfaces is also already supported.

  • @urits3719
    @urits3719 Před rokem +3

    LOVE YOUR VIDEOS. + 2 questions:
    1. will you make a video about c++?
    2. the code's font is insanely beautiful, what it's name?

    • @codetothemoon
      @codetothemoon  Před rokem +1

      1. Not sure about C++, it was my first language but it is also one of my least favorite. It'll be around for a very long time but it doesn't really seem to be a nucleus of innovation at the moment
      2. Thanks, it's Monaco!

  • @kylegaijin
    @kylegaijin Před rokem +2

    I'd really like to see a Nim video. For some intangible reason, I feel like Nim is more solid than V. I think maybe it's because the tutorials just didn't compile or behave as advertised when I went through them. I wasn't able to get Doom to work, etc.

  • @PouriyaJamshidi
    @PouriyaJamshidi Před rokem +2

    Would love to see a video on Nim as well

    • @codetothemoon
      @codetothemoon  Před rokem +1

      Would love to make one, feels like that's one of the main centers of innovation in the elusive goal of terse syntax + memory safety + optimal performance

    • @PouriyaJamshidi
      @PouriyaJamshidi Před rokem

      @@codetothemoon True that

  • @ME-dg5np
    @ME-dg5np Před 10 měsíci

    Hei V vs Val vs Circle ?
    Can y m ?

  • @mzg147
    @mzg147 Před rokem

    Are the sounds made by your real keyboard? If so, what is it?

    • @reinhold1616
      @reinhold1616 Před rokem

      i wonder why that matters lol

    • @mzg147
      @mzg147 Před rokem

      @@reinhold1616 Cause they are really nice and I want to buy it!

  • @godofbiscuitssf
    @godofbiscuitssf Před rokem +1

    Apple platforms with Objective C and Swift have had ARC (automatic reference counting) for a decade. before that, Objective C had manual reference counting with semi-automatic reference counting using autorelease pools.
    the LLVM front-end, Clang, inserts allocs and deallocs into the code on your behalf with each trip through the compiler, not as part of your source code. No performance hit above what manual memory management would cost you otherwise, and autorelease pools would in many circumstances *improve* performance by allowing you to use/reuse local memory pools (say, within tighter loops) that you could free up upon exiting scope or keep around but clear out if you know you're going to reuse it.
    But like I said, a decade or more.

    • @codetothemoon
      @codetothemoon  Před rokem

      At 7:00 I left out a key piece about what's I think is novel about autofree, as compared to the languages you mention. Check out the pinned comment - basically I think (again, the documentation on this is harder to come by than it should be) it aims to also do something like Rust's borrow checking and ownership changes, but without requiring the developer to be involved in them. Long story short, I believe the aim is to take some of the cases that would require RC in the languages you refer to, and eliminate the need for that RC. Without this, I'm not sure if there would be much to see here.

  • @vanillaface6097
    @vanillaface6097 Před rokem +3

    Autofree will likely have problems just like garbage collection. The performance of a program will depend on V compiler version, where some values are stack allocated, heap allocated etc.
    Golang does the exact same thing with its analysis, golang and V are on the same playing field.

    • @codetothemoon
      @codetothemoon  Před rokem

      I think the goal of autofree is to not have the same performance issues as garbage collection, remains to be seen whether that will be achieved.
      Re: Golang, regardless of the static analysis done at compile time, you'll still have the overhead of the garbage collector right?

    • @vanillaface6097
      @vanillaface6097 Před rokem

      @@codetothemoon If you don't create pointers in Golang there's no garbage to collect, and if compiler detects with escape analysis that variables can be freed in the same scope it essentially becomes stack allocated, essentially what happens in autofree. I don't think there's any real solution to Rust's ownership model today.

  • @rajusharma823
    @rajusharma823 Před rokem +1

    Does that font exist in vscode? I guess you are using vim.

    • @codetothemoon
      @codetothemoon  Před rokem +1

      It should (it's Monaco) you should be able to get a similar theme as well (Monokai)

  • @theappearedone
    @theappearedone Před rokem +3

    I still prefer switching each transistor manually, or if it HAS to be super high level like V, ill just use asm

  • @MagicThanos7
    @MagicThanos7 Před rokem +1

    What font do you use?

  • @ko_fes
    @ko_fes Před rokem

    6:17 - 7:00 - rust objects just copied (arc/rc are reference counted objects, that contains heap-allocated memory-blocks with objects inside), - there is no heap allocations for stack-allocated objects, - it's not the same as in C/C++ giving a pointer to heap-allocated memory block.

  • @kwkfortythree39
    @kwkfortythree39 Před rokem +1

    You say C program to V but the code is C++, is it possible too to pass from C++ to V automatically?

    • @codetothemoon
      @codetothemoon  Před rokem +1

      you're right! This was an example pulled directly from the V website where it talks about C to V conversion, and I hadn't even realized that the code was C++. Upon taking another look, it actually says that C++ to V is currently under development as well

  • @ilijasargic4201
    @ilijasargic4201 Před rokem +1

    What is the name of the theme in doom emacs?

  • @cheebadigga4092
    @cheebadigga4092 Před rokem +1

    4:47 there's 2 assert statements, the last one says "should fail". Then you run the tests but the tests all pass? How? :D

    • @codetothemoon
      @codetothemoon  Před rokem +1

      yeah, I think I used the wrong clip there. The Primeagen pointed this out in hilarious fashion here czcams.com/video/j47Hk5qE9As/video.html

  • @alathreon8315
    @alathreon8315 Před rokem

    Wait, if it uses reference counting, how does it manage objects referencing themselves ?

    • @mihaimanole2643
      @mihaimanole2643 Před rokem +5

      That’s a reference cycle and will be not collected unless the developer replaces one of the references with a weak one. I know that from Swift which uses RC too.

    • @alathreon8315
      @alathreon8315 Před rokem +1

      @@mihaimanole2643 Yes, but I was wondering that because you can't simply use this auto ref counting blindly then, and it's even more problematic that if you don't know if a variale wilol be freed at the end of a method or by rc, then how can you manage cases like that

    • @mihaimanole2643
      @mihaimanole2643 Před rokem

      @@alathreon8315 I guess you must do some tests and use some tools that inspect the memory leakage or use Rust if you want memory safety.

    • @alathreon8315
      @alathreon8315 Před rokem

      -_-

    • @shadamethyst1258
      @shadamethyst1258 Před rokem

      One (costly and very similar to gc) option is to group together circularly-referencing objects into a collective reference counter, which will free all of those objects if it reaches zero. You could also track how many references to and from the collective Rc each object has, so you can dynamically remove it from the collective Rc

  • @Mempler
    @Mempler Před rokem +33

    It is just straight up incredible how fast V developes, literally a year ago and there was like nothing, almost no docs and such.

    • @rudde7251
      @rudde7251 Před rokem +10

      How fast it develops is a little misleading, since it's still nowhere near it's initial promises.

    • @andrewrobinson2985
      @andrewrobinson2985 Před rokem +13

      it doesn't develop that fast. I've been following it for 4 years. I quit looking at it because in those four years, it feels like it's made no progress toward becoming what it promises, and they keep adding language-nonessential library features instead of actually working on the features that they initially used to draw in devs.
      Using it feels too broken to even consider doing a hobby project in it.

    • @nicktreleaven4119
      @nicktreleaven4119 Před rokem +2

      Actually in 2020 the main docs were there.

    • @andrewrobinson2985
      @andrewrobinson2985 Před rokem +3

      @@nicktreleaven4119 main docs are pointless when the features themselves are incomplete

    • @nicktreleaven4119
      @nicktreleaven4119 Před rokem +1

      @@andrewrobinson2985 far from pointless. They documented what was implemented so far and what was planned at the time

  • @ashtonmiddlefield9819
    @ashtonmiddlefield9819 Před rokem +1

    Could you do a video on sql and v, please?

  • @Im_Ninooo
    @Im_Ninooo Před rokem +2

    as a Go developer this seems pretty promising!

    • @codetothemoon
      @codetothemoon  Před rokem +2

      there definitely seems to be a strong Go influence on the language!

  • @stysner4580
    @stysner4580 Před rokem

    I love Rust, but Vs ? operator representing either an option or an error is really nice.

  • @minzhou4275
    @minzhou4275 Před rokem +1

    Does V support macros like lisp?

  • @anon_y_mousse
    @anon_y_mousse Před rokem +2

    I'm confused as to why you said that it converts C to V while you showed C++, and what's more is the output didn't actually match the input functionally. The V code built up a string and then printed in one go while the C++ printed as it went. As for V itself, it just looks like a less awful syntax version of Rust. One of the things I hate about Rust is the inconsistency in syntax, but the manual interventions you have to take as the programmer that C++ doesn't make you take really irks me. I've always hated C++, despite loving certain features, but the more of Rust I learn and the more of the source code for its implementation I read, the more I despise Rust. In fact, the more I learn of other languages, the more I appreciate the cold, calculating consistency of C++. It's butt ugly, but it does a lot right that other languages really screw up. That said, I still prefer C over everything else and use it for nearly every personal project.

  • @BAMBAMBAMBAMBAMval
    @BAMBAMBAMBAMBAMval Před rokem +1

    The sound of your switches makes my brain vibrate
    Edit: its a good thing

    • @codetothemoon
      @codetothemoon  Před rokem +2

      If you're referring to the keyboard switches, watch out for the next video this week, you might like it 😎

  • @PaulSebastianM
    @PaulSebastianM Před rokem +2

    I hate having to explicitly declare a field as required, as opposed to explicitly declaring a default value. It's so much cleaner if you know exactly what a field's default value would be if you don't specify it otherwise on initialization. The required keyword feels exactly like the bolted on solution they are currently adding to C#.

    • @petrmakhnev4037
      @petrmakhnev4037 Před rokem +2

      In V you can also declare default values for fields

    • @PaulSebastianM
      @PaulSebastianM Před rokem

      @@petrmakhnev4037 That's great but I still feel like the default behavior of having an initialized struct while some fields or all its fields can remain uninitialzied, is bad default behavior.

    • @petrmakhnev4037
      @petrmakhnev4037 Před rokem

      ​@@PaulSebastianM All fields are initialized to zero-value by default, 0 for numbers, empty string for strings, and so on.

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

    You recommend to learn this language?

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

      Depends on your specific situation - if you're a programming language geek and enjoy learning bleeding edge languages, have at it. But if need something that will work for you right away, I think your time might be better spent learning something like Rust or nim. The nice part is that learning V isn't a huge commitment - it's a very easy language to pick up (like its main source of inspiration, Go)

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

      @@codetothemoon Okay thanks, I know rust before but im searching languages easy and fast like rust, V was my first look language

  • @iritesh
    @iritesh Před rokem +4

    Autofree will take decades and decades to be perfect

    • @codetothemoon
      @codetothemoon  Před rokem +2

      That appears to be a concern shared by many folks!

  • @draakisback
    @draakisback Před 10 měsíci +2

    Personally I think zig has more promise because the creators behind v seem to be somewhat hostile towards their own community. As you highlighted at the end of the video, there have been quite a few controversial decisions with this language. The thing is, autofree doesn't actually seem that farfetched if the compiler can assign lifetimes to variables under the hood. In this way you'd effectively have ownership but you wouldn't have to worry about the borrow checker because the compiler would determine if the object can be dropped by scope or if it needs reference counting. That being said, I'm not confident in the v contributors to be able to properly implement this feature. Zig on the other hand has multiple memory management schemes and it has already delivered on a lot of the promises that the language originally promoted. Another language that is really exciting in 2023 is ocaml. There have been so many cool editions to that language recently which make it very appealing for anybody who uses rust or go.

  • @WouterStudioHD
    @WouterStudioHD Před rokem +102

    Doesn't look that interesting to me tbh. I didn't really see something that really sets it apart in a useful way and the syntax seems worse. Explicitly capturing and using fn keywords for closures & lambdas are annoying to me.

    • @SimGunther
      @SimGunther Před rokem

      Haskell's function/closure definitions = sublime because everything is a function :)

    • @shadamethyst1258
      @shadamethyst1258 Před rokem +1

      @@leeroyjenkins0 I don't think people would add it to rust. The solution that's described in the video would have a serious runtime impact, and making it a default in rust would go against the language's philosophy.
      That being said, a Rust version of Rc that automatically optimizes away the Rc would be nice, and would lead to an easier experience using the language for newcomers. Or maybe a clippy warning that an Rc can be optimized away manually.

  • @lockbert99
    @lockbert99 Před 6 měsíci +1

    Who does have the better mascot between Go and V?

  • @markussagen3778
    @markussagen3778 Před rokem +5

    This is really cool! Would love to see more examples of the V language in the future

    • @mkrzyzowski
      @mkrzyzowski Před rokem

      There are tons of examples in the examples folred in V. Clone it and take a look on them.

    • @codetothemoon
      @codetothemoon  Před rokem +1

      I hope to cover it more as the language grows in maturity!

  • @llothar68
    @llothar68 Před rokem

    Autofree is just like the Objective-C and i guess Swift compiler tries to do it's release/retain optimizations.

  • @simonfj20
    @simonfj20 Před rokem

    great video and all, but at 0:23 you said "an entire c project" and then showed c++ code

  • @snippletrap
    @snippletrap Před 9 měsíci

    In C++ you would use `std::unique_ptr` not `new`

  • @petrmakhnev4037
    @petrmakhnev4037 Před rokem +15

    Thanks for the review. As a young language, V has many problems, some of them are being solved, some of them are not yet. Such reviews will help the language to become more known and attract more people interested in the development and improvement of languages.
    Calling people for questions about memory management and speed like C as trolls is a known problem, but as far as I can see it is already much less, although there are people like the author of that comment who spoil the impression of the language, which is very sad.
    I think in 3-4 years we will get a good language with its own advantages and disadvantages. Let's see how it goes.

  • @DwayneRobinsonMS
    @DwayneRobinsonMS Před rokem +1

    0:38 "Looks like Go..." Hmm, yeah, looks like Go except kinda oxidized, converting the semireadable fragment "func" to an unpronounceable utterance "fn" and requiring every variable to be prefixed with "mut" to vary.

    • @codetothemoon
      @codetothemoon  Před rokem +1

      hah yeah I think some aspects of it will make Rust devs feel more at home than they will for Go devs

  • @MrAbrazildo
    @MrAbrazildo Před rokem

    1:48, ouch! I don't want to specify the returning type! 3:03, ouch! I want this to be automatic!
    6:31, std::unique_ptr frees that memory automatically. 6:42, C++'s std::shared_prt is meant for this RC.
    6:55, are you saying 'deallocate' meaning 'free from stack' too? Because in C++ things are build on stack by default. For instance: auto a = Thing. It's recommended freeing the stack as soon as possible, because it's precious memory, as small as faster.

  • @CasimiroBukayo
    @CasimiroBukayo Před rokem +1

    Tried V, still defaulted back to Zig. There's just something about Zig that makes it a joy to work with.

    • @codetothemoon
      @codetothemoon  Před rokem +1

      out of curiosity - why do you choose Zig over something like Rust? I feel like I'm missing some pieces of the Zig puzzle and am eager to learn from those who are immersed in it.

    • @CasimiroBukayo
      @CasimiroBukayo Před rokem

      @@codetothemoon Aw, my bad. I actually love both Rust and Zig. It just so happens that Zig is a lot easier and simpler for me to work with, compared to Rust.
      As a worn out C++ dev with horrendous nightmares of failed projects 😅, Rust and Zig gave me a chance to redeem myself. I'm in my 40s now, so I highly gravitate towards simplicity and ease of use.

  • @nullzeon
    @nullzeon Před rokem +15

    I'm really rooting for V to get to 1.0, until then I really hope the LSP support gets better, so I can have a better time playing with it

  • @laviray5447
    @laviray5447 Před rokem +1

    I was so excited about language but totally lost interest after realizing that it doesn't have a good memory management and it's not clear what they are really doing about it. I switched to Rust and it's good.

    • @codetothemoon
      @codetothemoon  Před rokem

      can't go wrong with Rust. I agree that it doesn't seem ultra clear how they are going to get to where they intend to go in terms of memory management.

  • @Flowlackstalent
    @Flowlackstalent Před 4 měsíci

    3:27 this is so good

  • @torarinvik4920
    @torarinvik4920 Před 9 měsíci +1

    If a programmer can do a certain task manually there is only a question of time before the computer will become better at it. Just like compilers usually write better assembly than humans can, in the future computers will be better at parallelising and doing memory management than any human can. If a human can do it, then a computer can do it, it's that simple. The question is how long time will that take? Im guessing it will probably be between 6-12 years. But it could be sooner with the advancements in AI. “You insist that there is something a machine cannot do. If you tell me precisely what it is a machine cannot do, then I can always make a machine which will do just that.”
    - John von Neumann

    • @codetothemoon
      @codetothemoon  Před 9 měsíci

      yes, I do feel like there is a bit of an existential threat to software developers at least in the current form of the role. Best case is that AI innovations will cause the role to change in nature. But I think there's a real possibility things could turn out worse...

    • @torarinvik4920
      @torarinvik4920 Před 9 měsíci

      @@codetothemoon Agree. But at the same time, chess software will beat any human player regardless of skill easily. Even if AI will become better at memory management, or even writing entire programs we can still enjoy programming. People chop wood, fish, program in old assembly language(like NES ect.). I believe in the transition period where computers need some steering from humans it will be very enjoyable. Our productivity will increase tremendously, but at the same time we can have the satisfaction of bringing something new to this world. Btw this is a great channel!

  • @BryanChance
    @BryanChance Před 2 měsíci +1

    Elixir is really nice, too.

    • @codetothemoon
      @codetothemoon  Před 2 měsíci

      i was very impressed with it in the brief time that I tried it

  • @JasonMitchellofcompsci
    @JasonMitchellofcompsci Před 5 měsíci

    C with colsures. All the other features look great but that's all I need. All it needs now is a repl like Holy-C has. Then it would be good enough to take over an operating system.

  • @yaus0527
    @yaus0527 Před rokem +1

    Why file extension is ".v" ?????

    • @codetothemoon
      @codetothemoon  Před rokem

      I think because the language ls called V, similar to how C source has a .c extension

    • @yaus0527
      @yaus0527 Před rokem

      @@codetothemoon That is a problem, since .v file is the file extension of Verilog.

  • @codegambit2507
    @codegambit2507 Před rokem +2

    Syntax is like Rust and Go made a baby

  • @jimmyneutron129
    @jimmyneutron129 Před 9 měsíci +1

    i will wait until it gets into 1.0 to test it

  • @motbus3
    @motbus3 Před 25 dny +1

    What about VVVV?

    • @codetothemoon
      @codetothemoon  Před 10 dny

      I hadn't heard of this, thanks for pointing it out!

  • @adicide9070
    @adicide9070 Před rokem +1

    so syntax like Go :D

  • @endode9
    @endode9 Před rokem +2

    V is pretty cool