Vlang: The language of 2023?? | Prime React
HTML-код
- Опубликовано: 19 окт 2024
- Recorded live on twitch, GET IN
Original: • V - Best Programming L...
Author: / @codetothemoon
/ theprimeagen
MY MAIN YT CHANNEL: Has well edited engineering videos
/ theprimeagen
Discord
/ discord
It was a lot of fun watching this reaction, thanks for doing it!
Don't stop doing what you do :)
Yout doing great code to the moon. You got that skill to explain things clear, simple and concise. Please make a video on java vs c# vs go vs v languages
@@Bvngee That's what she said.
Wait till prime learns that lambdas in C++20 can use all four types of brackets eg. `auto fn = []() -> void {};` is a valid lambda in C++20.
21:16
Primagen is happy that naming doesn't have meaning like in go (upper case is public)
A few seconds later it's mentioned how naming has meaning (functions containing test are tests)
it's at 20:50
"If they'd done capital letter I would have lost it, [...] that was the greatest mistake of Go" this is probably the best thing Prime has ever said.
I like your content, but it seems like your community is sounding more like haters day by day. In my view, they are just looking for validation by the streamer. I bet less than 10% have their own true opinions nowadays, and instead just look to have an opinion Prime would agree with. Most tech youtubers who stream seem to have echo chambers behind them, which I guess is good for their community, but perhaps not the best for meaningful discussion. I'd like to see content with people who have contrarian viewpoints but in Prime's content I just see echoes 99% of the time. I am just one guy on the internet, and probably sound like a hater as well, but just as Prime criticizes or has contrarian viewpoints to the things he reacts to, it would be great to hear the counters of his points as well.
Idk, if you watched the OOP good video, a lot of his chat disagree with him.
Lol haters
shut up fool we are friendly and open minded u scrub
we could make a React of this React at how much rust sux.
They just want entertainment you can see in the chat they are mostly laughing at each other's puns and jokes. They don't care about starting an argument
I like rust’s arrow syntax. So easy to see what is what . Ts have colons everywhere, such a pain to know if its a type, a return type or another thing
Return type IS a type. What the heck you're talking about? But I hear you it's confusing because on object notation column is value assignment operator yet in ingerface/type its type declaration.
Agreed. In Kotlin and Python, I hunt down where the return types are. A big arrow helps a lot in that sense.
@@stevenhe3462 imho c/java style is cleanest when it comes to return types.
@@sk-sm9sh Nah. Rust does it best. It makes sense that the return is after the method signature. Much more intuitive.
The V community acts like they bet their life savings that it's going to be the next employable language.
"V coin to the moon" ahh behavior
It is by far better than 90% of langs to be be honest
@@EzequielRegaldo It's sure better than a lot of languages but that is not going to make a language successful. It needs to be significantly better than the current languages to choose from, and enough people need to thing that.
@@joranmulderij 1 lang, everything. Its the way
@@EzequielRegaldo Would be an amazing reality right? I think with current language development it would be possible to create a language so versatile it would fit most projects. It's just that the current state of software is an absolute mess with old frameworks, old code, and trying to fit backwards compatibility into any framework is going to push it away from that perfect language.
Vala, Genie, and others (original c++) have compiled to C for decades. It's low level enough to be similar to compiling to asm. It's really not _that_ different than LLVM, atleast not fundamentally.
Compiling to C also has the added benefit of the half-century worth of optimization out of the box. Also just like LLVM but at the same time C has a much more well known interface than LLVM.
Chicken scheme, ATS and many others also do this
Somebody mentioned Vale in your chat. That seems like a far more interesting language to me if I were to adopt a newish language. (do note, Vale, not Vala)
I've been trying to find Vale for awhile because I forgot the name. Thank you!
@@jsonisbored that's actually exactly what happened to me, this video triggered me to search a bit deeper :). I remembered a language beginning with V which had some interesting memory management ideas, went from there.
Vale last commit is 25 jan.. not looking very promising.. looks ded to me
@@_slier hmm, you're not wrong. There is more up to date activity on Verdagons branch, but thar suggests a bus factor of 1, and Vale is behind the Roadmap now that I check it.
looks interesting 🙂👍
though I'm already nitpick-level annoyed that they truncated "function" as "func" while simultaneously lengthening "export" as "exported". just. WHY 😂
Fyi: the name: Type annotation comes from Scala. Inventor Martin Odersky chose it, because the colon is a mathematical notation for element of a set (usually you learn in school the symbol that look like similar to €). So you could read a: Int as a is an element of the set of integers.
D can also run GC and Nogc and borrow check you tag it per function or structure. Except that D has been around for years and is not new
@live is a broken feature, very raw and as a borrow checker it probably wouldn't scale. D also has memory safe and pure tags out of the box, these are pretty cool. Not this but meta programming in D is probably the best out there in terms of easiness to read and write.
Yeah, But D is not cool. It has no cool mascot and it has no cool logo. So it is not hip and nobody will ever use it despite how good the language is.
@@voidwalker7774 give it a cute dog and I'll hop on the D train
D is a really, really cool language (now that there is a template for sumtypes)
@@ivymuncherDlang the big red dog 🐕
I'm primarily a Go dev. I also use some other languages at work but Go is my main one. V is definitely heavily inspired by Go. It has some nice improvements over Go, like having string interpolation and some other quality of life improvements. I'll keep an eye on it. It won't be a language I'd use for actual projects any time soon though. But it's promising .
Sounds like the language was made public waaaaaaaaaaaaaaay to soon when there is still so much to do and maybe not enough resources to do it.
Edit: so many people are just like "try it" instead of answering questions about languages. Sure, I'll just put a few hours if my day to every little new shiny thing that comes out in tech.
Too many "a"s, too few "o"s...
I disagree. With 600+ contributors and now more than half of the codebase written by the open source community, it's good it was released when it was.
What particular issues are you referring to?
Copy as default makes more sense if you're not constantly passing objects around, and only passing basic types like integers/floats/etc. In my game I'm working on in C++, i'd guess over half of all my functions operate on basic types, and the remainder is passing around pointers(which technically exists ITSELF as a variable and gets copied).
The cpu has no real problem just creating basic types like integers and shifting them around, while copying the address of a pointer then possibly needing to do a memory lookup is much more expensive - especially if the cpu was already working on the values being passed.
In something like javascript where ''everything is an object'', I'd guess basic types being copied might be more expensive(I'm not sure)?
There is no definition for arrays that says something has to be immutable and on the stack to be a technical array. Well in rust we call it array and vector, there this distinction is clearly made.
But it can be a dynamic, heap allocated list and still called array. Like it is commonly done in many langs.
For fixed sized arrays in v that are put on the stack, the syntax is e.g., `mut fnums := [3]int{}`.
Or the short syntax is to use ! at the end of your expression. This also allocates to the stack
arr := [1, 2, 3]!
V running doom is a lot less impressive after learning that it transpiles to C.
how? its a v program that translated doom C to V. thats pretty impressive
@@asad-ullahkhan2368 and then THAT V code is again compiled to a similar(less efficient even) C code
C is so "simple" that it could possibly be transpiled to many langs... You just lose efficiency... But V is compiled back down so that doesn't matter....
All you need are pointers, functions, integer types etc... Mostly just basic stuff
@@icoudntfindaname the impressive part is translating the C code to V, not the transpiler. It shows you can incrementally convert a codebase to V (or all at once even). Besides, the V compiler also has an LLVM emitter, which will eventually be able to run doom as well (if not already capable of that)
V is still pretty much in alpha stage. They transpile to C because they haven't implemented a direct compiler and for some reason the V developer hates LLVM and doesn't want to use it for compiling.
@@icoudntfindaname You missed the point of the past 30 years (at least) of language design then. Most languages abstract away from the simplicity to ensure security. Yes C is a simple low-level language, this is what makes it *difficult* to translate it into a high-level language. Precisely because that's the point of high-level languages! If we could do the same prone-to-errors manipulations in Haskell as in C, nobody would program in Haskell, everybody would program in C directly and not compromise on efficiency. (I took Haskell as an example, this would work for basically any language which is not a dictionary for C). So the fact that you can translate a fairly large project like Doom automatically from C and then compile it by any means (including transpiling back to C on the way) and still have something decently runnable is pretty impressive. That being said, I don't really see the big innovation that this V thing is supposed to be.
It seems that if the languages are arranged from low-level language to high-level language. it will be:
C < Zig < V < Go < Python
I never understood the following: what do developers mean when they say to “implement behavior”. What is behavior? What parts die behavior consists of? Or do they simply mean methods attached to some class or object?
There are people who hate classes, and so therefore they all have effectively see cell functions where you pass objects in to do things
@@ThePrimeTimeagen ok thx
@@ThePrimeTimeagen is there a particular reason why they hate classes?
@@paulholsters7932because it's kinda messy (at least for me), OOP is nice but sometimes it's too much especially with all that inheritance and abstraction
I love code to the moon please considering reacting to more of his stuff he does great rust vids
3:46 lol made my day. God bless you man you got great sense of humor.
I've been following the language for years now. I can assure you, all the things that are marked as WIP on their web site but advertised as practically working were in the same state years ago when I first encountered the project. The hard problems (main selling points) are not being solved. Pity, since the syntax and ergonomics are above probably any other statically typed language.
Can you list any examples? None of the features are WIP anymore, everything listed on the website works.
@@VLang Alex, please - you don't have to aggressively defend your language on literally every comment on the Internet
@@Puzomor how is it agressive? I was just wondering which issues you referred to.
@@VLang because the comment is more than a month old.....
@@Puzomor don't see the logic. So can you list the examples? You've been following for years, must be easy to list some examples so that I can update the website.
A new language with UI built-in. Is it the 90s?
ikr just use electron
@@inexistente nah gtk the queen
It's not built-in. It's a separate module installable via `v install ui`.
What's wrong with an official UI?
@@mgord9518 people on this channel are only looking to build web apps
8:00 - as a vim use you should know how awesome it is to have some separator before type to navigate quickly.
If nobody has said it (which I doubt, but still), I will:
Code to the Moon, if memory serves me, is also a huge Rust fan; in fact, every other video of his I've seen so far was about Rust, which begs the question:
collab w/ Code to the Moon when?
I mean, your collabs w/ TJ are great, obviously, but this dude deserves to be featured on your channel as well
I’m having a bit of deja vu right now, but V is already dead and Nim killed it.
Nim has 3 options for GC, including a no GC option. It can also transpile to JavaScript
I think it's a matter of taste. I don't like for example '&' for string concatenation and having 100500 ways to call functions which makes the code unclear in Nim.
Btw, V also has a JS backend.
@@petrmakhnev4037 wasm >
@@TheoParis you can compile C code into WASM and V has examples where this works great. Also, a native WASM backend is currently being developed, but it is still quite young.
@@petrmakhnev4037 You don't have to use & for concatenation. You can also use a comma.
Oh ALL HELL! If you bring Carmack into the conversation - I'M GOING INTO IT!
I think the whole thing about references was maybe a nod to performance considerations. I think perhaps he was conveying that if you have some big struct and you're passing it into a function that doesn't mutate it, the compiler passes a reference instead. This way, the function operates as if a tedious time consuming copy had been made to pass it by value, but without that overhead. I mean, the style of the video leaves open the possibility that he was describing some cool "optimization" vs something the user would ever really perceive semantically from the feature.
Oh, I remember V. The language which promises no null, but delivered nulls.
The language which promised no UB, but has documentation when UB occurs(closures).
Uses tcc to sustain high compilation speed, which means destroying runtime speed.
I would rather learn seed7
You're right about nulls, the language only gets first class Optional types, which will allow us to start saying that there are no nulls in the language (in safe code). As for UB, I also agree, now the language does not promise the absence of UB.
As for TCC, it's used for fast development, for production you can use GCC or Clang and get a super fast binary.
V as in vaporware. i miss those times. how is V nowadays?
@@socvirnylestela5878 evolving :)
It's still in development and isn't advertised as stable 1.0
@@petrmakhnev4037 It's dishonest to use TCC when benchmarking compilation times. Nim also has a TCC backend but you don't see people advertising Nim using benchmarks with it.
By the way, variables in V are immutable by default. The example at 6:59 won't run for this reason. The author of the video forgot to add `mut` i.e. `mut a := 5` instead of `a := 5`.
that was GoLang, it wasn't V
@@jacopo8100 That is not how you write Go, the code is in V. They were just comparing it to Go.
I think this was "just a teeny tiny bit" harsh on V. Too much comparison with Rust where it should've been overall and also ease of learning aspect being kept in mind to compare to rust.
Plus when lang is pre-alpha and things don't work and devs fix the issues you had, that shouldn't even be judged
I love V and would like to see it come to fruition. I've been using it since 2019. It's been in beta for a while now and I'm still reporting bugs that prevent the code from compiling several times a week. They're usually pretty quick about addressing the bug like you said. But I feel like the stability of the language has not improved enough to go from alpha to beta.
Thanks for the video, Prime!
34:34 "my corneas are burning"
"..felt that was short sighted.."
Perfect timing 😂😂😂
Why you don't like C++ capture list in lambda and what is best design in your opinion?
The problem with colons and arrows is they make the code harder to type. It doesn't flow as nicely through your fingers. You need to press shift a lot more, at least in some non american keyboards.
With everyday tasks, take your time estimate and double it.... With programming, cube it
1:40 yes Carmack works out these days. He's admitted it several times.
Becoming IRL Doomguy
It's go with snake case, string interpolation, range, autofree... It's like the perfect mix between rust and go
💯 Interfaces should not have properties
💯 The first thing i check with a new language is how it handles sum types aka enums. I want simple building blocks for building data on the right shape. Sum types and product types.
That xkcd about the proliferation of standards applies... I see a new language and think "i could design a better language than that, maybe i should" (no i shouldn't)
V does have sumtypes: `type Animal = Cat | Dog`, and exhaustive matching.
I think V is easy and maybe ok to read at this level, I think on complex code the lack of colons and other syntax of this lang will NOT help
maybe syntax highlighting would help.
Well, now (after 30 years of doing IT) I've finally met someone that pronounces SQL as squeal. Yippee.
Hey is this the channel of the guy who built the auto-play feature on Netflix ™?
why yes it is
By it's own admission, V is designed to be a slightly better version of Go. So on the one side you have a mature language with extensive tooling and libraries, funded by Google and built by some of the most respected folks in the history of computing. And on the other side you have a very similar language written by random guys with a highly controversial history. I would need more than a couple of marginal improvements before I'd dream of switching.
C++ style capture list? I dunno. There's this new concept they should read up on, it's called Lexical Scope.
Not related to the video here, but just some foodie for rustacean :
- Rust :
✅Strictly enforcing safe borrowing of data
✅Functions, methods, and closures to operate on data
✅Tuples, structs, and enums to aggregate data
✅Pattern matching to select and destructure data
✅Traits to define behaviour on data
the GC middle ground is the erlang per-actor GC that never stops the world
Hm, does Vala still exists? Just got reminded because programming language starting in V. Vala looked a little bit like a Java/C# kind of language last time I looked at it, but it compiles to C (or did back then, not sure if it was before LLVM was a thing).
absolutely, vala is used in several open source gui projects.
12:30 You can't technically define "methods" on structs in C (you can in C++ though), but having a struct with a field that is another struct is definitely a thing in C too. That is nothing new lol.
I don't have a colon, and I can tell you, you are definitely winning with a colon vs without
I read the thumbnail as "Vim in 2023?"
@rotteegher39 😮 So did I.
gotta love the `4h 53m 2s old` dunst notification
If only these features actually were implemented and worked as advertised for years.😂😢
I created library kirka for typescript . Could you give me your review? I think this library will be very usefull for js/typescript community
I agree with you on the properties and interfaces. Taking a language like C# or Java, if you can put properties in the interface, to me it really blurs the lines between what a class is and what an interface is. Interface should only describe behavior and be decoupled from internal data. Once an interface has internal data, it pretty much is a class.
V doesn't have classes so that's why you have properties on interfaces.
@@asandax6 Structs with methods are essentially roughly around the same thing without inheritance. A class at a high level is essentially data coupled with behavior. Taking this sample from Vlang
struct User {
age int
}
fn (u User) can_register() bool {
return u.age > 16
}
This is essentially a class, just without polymorphism and a different syntax. Why Do I need a property on an interface when I can just implement getters and setters or make a public property on the struct itself?
Under the hood the above example and the following are not really that different.
class User {
int age;
public bool can_register() {
return this.age > 16;
}
}
In most cases, these are not that functionally different from one another.
How does it blur the line? For most of its existence it was a specification. These days though they really have gone full retard with interfaces in C#. Properties are syntactic sugar around getters/ setters so methods backed by a field.
Why wouldnt they belong on an interface?
@@sacredgeometry Interfaces are more about guaranteeing same behavior without concrete implementators having to have the same data. If you want to guarantee two classes have the same data and behavior, well, that is what super and subclasses are for. Properties in an interface seems like it is trying to not only guarantee behavior, but also guarantee shared data. Getters and setters are not really behavior in my opinion since your directly working internal data to a struct or class. Or it opens the door to it.
@@toddmartin7030 I am not sure I agree with that at all.
It's not about guaranteeing they have the same data or behaviour.
Why use an interface if you wanted they had the same of either of those things.
It's about making sure they have the same interface.
"Getters and setters are not really behavior"
Of course they are they are essentially no different to having two methods
GetSomeState() and SetSomeState()
That is behaviour. Some examples from C# IEnumerator has a Current, IList without a Count, IDictionary has a property to retrieve the Keys and another for Values.
Its not exactly hard to imagine why you would want the interface to specify properties.
I'm very curious to know why people don't understand the difference between time estimation and time prediction
It compiles into C, so basically Nim, only with go-like syntax instead of python-like
Yes.
No. Many languages do compile into C, and Nim was not the first. Besides, there are many other significant differences with Nim - V for example has no macros, and no intention to have them at all. Nim is also more permissive for naming identifiers and variables, sometimes allowing you to call `xyz` as `xYz` or even `XYZ`, where all of them will refer to the same thing, while V does not.
Mutational (DNA changed)
Mutable (volume on/off)
Mut (mongrel dog)
Totally agree about interfaces. IMO interfaces shouldn’t have properties or default implementations. Default behavior should be defined in something like a trait.
Agree that they shouldn't have default implementations disagree that they shouldn't have properties.
19:13 JS isn’t pass by reference.
it’s pass by value. it’s just that sometimes that value is a reference
I'm excited for the lang tierlist 🤡
imho, V lang has a beautiful and easy to read syntax
I don't buy that UI should be in the stdlib. It's tech debt waiting to happen. Just look at python with tkinter. I have never seen someone use tkinter for UI in python. Provide a first-party library sure, with it's own version management etc. but as the old adage goes: the stdlib is where code goes to die.
It's not part of stdlib. It's a separate module installable via `v install ui`.
The arrow in the rust return statement helps us dyslexics
To me space says "new word" not "example of this type". That's why I prefer a colon or some delimiter over a blank space.
You might want to check out Ada.
"If" w/o parens, no dangling else.
Covering choices in a "case", works BEAUTIFULLY with enumerations.
Context-capture done via generic-parameter, actually really robust generics.
The "Task" construct for threading.
Parameter-passing denoted by usage.
I don't really understand why anyone would want this auto free thing. If you are writing something that ought to be in C++ or Rust, then resource management *is* a large part of the problem space. If it could be automated, then you wouldn't need to do custom resource management and a good garbage collector is going to be better than doing malloc and free -- those are inherently more expensive. Plus, by having the compiler do it like this, you lose out on the main benefit of not having a gc -- that how you handle memory is deterministic and visible to the programmer from the source code.
So I'm unclear on what you'd want to use V for.
The most American thing you could say: “what is this animal? … it looks like something you’d shoot”
😂😂 thought the same
It also looks like something that eats the rodentlike GO icon.
I hope you don't forget the nim language on your tier list
Golang couldn't do generics for the entirety of it's formative years. That didn't make Go "vaporware."
etur leo pharetra fringilla. In hendrerit tincidunt diam, in aliquet nisi viverra sed. Sed mollis vestibulum justo sed rutrum. In consectetur ultrices convallis. Integer semper volutpat porta. Sed maximus volutpat libero ut venenatis. Phasellus ullamcorper nisi vitae magna tempus hendrerit. Integer pretium a velit ut varius. Dev Test
was the title supposed to end w/ "Prime React"? or "Prime Reacts"
Narrator: it was not
Oh. They have UI AND Data Access?! And its cross platform? Oh my, Delphi, watch out.
V is two years away from replacing C++
If 2+ letters is long enough to it can always create an alias
Technically you can put it on the stack even though you only the length at compile time.. but it is a bit more complex to make it work
Tbh V’s features are besides the point. The main draw is how rich its tooling is (their UI and CLI libraries are fantastic!), and how tiny and portable it is, and it already delivers on those.
their libraries are attractive, but every other language has them too, they just have them separate from the language where they're supposed to be.
13:35 It masked another name to inheritance
THERE'S NO SEMICOLONS!!?!??!?!?!!!
it's a shame at 18:42 that prime won't create a language 😢
6:20 Borland did that with Kylix many years ago
I'm surprised this was even considered a language that can be popular in 2023.
GC(auto-free lmao) which cleans "most of the time".
Passing params which "passes either by value or reference but compiler knows" ... sure...
The fact that such ambiguity is still a thing in "newer languages" is funny to even consider using it.
Weasel was cute, but this one I also would hit with a car.
GC cleans 100% of the time. The value/reference optimization is being removed, there's an open PR.
By 100% of the time I mean it frees all variables, not "most".
I have consumed "you should learn rust" videos and articles and the decision is made to do so, just awaiting the opportunity.
Same with Swift, and opportunity already knocked.
I just watched the same for V and I now have zero reasons to learn V. However I gained several reasons not to. Well maybe if they can weave in a connection to the TV series V?
Thanks for reminding me that Go uses case for things.
3:15 prime went snoop mode
Feels like go+ (doesn't change enough for go++)
Go#
the arrow is good for searching return types tho (but yeah you could use a lsp)
I guess the people laughing about it being a frontend for C don't know how C++ started.
You can have a shared buffer in js with workers
I hate interfaces that defines parameter names because the type is the only thing that matters.
3:46 Ok, so _V_ is to _C_ what _TS_ is to _JS_ .
Why not using _Zig_ instead ?
Feels like a language that someone had the right idea but no idea how to make a practical language. Truth be told even the syntax feels a bit like "can we have Rust/Kotlin?" "We have Rust/Kotlin at home"
so that's basically go but that can be compiled to C, nice actually for embedded systems
To be honest, I think you should have a closer look into the V language yourself. Else you are missing a lot of things (e.g. the error management) and I think it's not really fair commenting on a summary of someone else.
Vlang is 90% Golang + 10% Rust. It has some of the bad things like go too, for example, using tabs instead of spaces.
what is the font of the code
Typescript for C sounds sick
prisma allows you to sql while being an orm.. i think prisma is the best orm.. but i still like my sql. i even have zero problem with unstructured in sql
It's a Veasel !
Did I hear C#?
V as a Vendetta or V as an alien lizards?