General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
Vitaly L
ThePrimeTime
comments
Comments by "Vitaly L" (@vitalyl1327) on "Zig is FASTER and SAFER than Rust | Prime Reacts" video.
Zig does not have procedural macros, Rust does. Any language without procedural macros is infinitely inferior.
24
@devnexen I am talking about proper Lisp-style macros, not that preprocessor abomination. Rust procedural macros are much closer to the proper macros.
16
@baxiry. nope, it does not. Macros are much more than just some compile time computation. Macros are for implementing embedded DSLs, i.e., macro is a compiler that runs in compile-time, and does all the things a standalone compiler can do, including arbitrary optimisation.
14
@baxiry. to clarify - the critical part comptime is missing is functions that take AST as an input, and they don't produce AST as an output. Also, no way to access the current compilation context, making this thing inferior and pretty much useless in comparison to proper Lisp-style macros that Rust is (nearly successfully) trying to emulate.
11
@kanji_nakamoto Huh? It does not allow to do things in a more succint way. Any proper meta-language is infinitely more expressive than a fixed language. A meta-language, language with proper macros, can be easily turned into any language imaginable. It is an infinite power. It is funny when people even compara meta-languages with simple languages. Zig does not allow to construct efficient embedded DSLs, which makes it severely less productive than any language that have proper macros.
11
@purpasmart_4831 sadly, neither C nor Zig have procedural.macros, and language without procedural macros is inherently inferior. Hopefully someone will fork Rust....
5
@mr.mister311 so, you still don't understand what you can do with the proper macros. With this primitive abomination of Zig you cannot implement composable eDSLs With a proper CL-style macro I can wrap any arbitrarily complex compiler, pass an AST to it and get an AST as an output, all while reflecting on the context of the underlying compiler. Languages that cannot do it are worthless.
4
@kodingamedev yes, Nim is a worthy language, macros done the right way.
3
@camdustin9164 you don't understand macros then. A language with macros can be turned into ANY language you can imagine. Any feature that exist and even those not yet invented can be added, or a language can be completely turned into something else. Therefore, any language with macros is a superset of all existing and not yet existing languages. Any language without macros is nothing in comparison. Now, if you managed to live your entire life without a need for macros, you're programming wrong. Badly wrong. You avoided the most powerful tool for building abstraction. And, no, language popularity is not a measure of language quality in any way, because vast majority of programmers are incompetent monkeys.
3
@j.trades9691 what performance losses? DSLs are zero cost abstractions, unlile pretty mucb everything else. And, unlike everything else, DSLs allow to eliminate complexoty. Not just reduce, but elimiminate. If your problem can be expressed in terms of compilation (and DSL methodology is exacrly what allows to discover if it can be done), it is a solved problem. Compilation can be split into a sequence of trivial steps, as trivial as you want, thus eliminating complexity altogether. As for learning curve - see above on complexity.
3
@FaZekiller-qe3uf you're not a very competent developer, evidently. If you fail to comprehend that eDSLs is a zero-cost abstraction and a compile-time optimisation that is impossible to achieve any other way.
2
They picked the application that's deliberately very bad for Rust - bytecode interpreter. It's not good for Zig either. Plain C with computed goto extension allows to easily implement indirect threaded code interpreter, while Zig and Rust had to stick to puny slow switch statements. I'd never write a bytecode VM in Rust or Zig, they're simply not fit for this purpose.
1
@ThePrimeTimeagen there is no equivalent of a computed goto C extension, so there is no way to implement an indirect threaded code interpreter (see OCaml bytecode implementation for a nice and clean example of this approach). Threaded code is way faster than any switch can ever be.
1
@32gigs96 you don't undertand macros, do you? Where do you think your "ergonomic" language features come from? Will be really hilarious if you admit that for you some pathetic crap like Python is somehow "ergonomic".
1
@raffimolero64 DSLs place is exactly *everywhere*. If you're not using eDSLs for everything, you're inefficient and your code is bloated, unmaintainable and imperfect in so many ways that I just cannot list them all here. As for stability - only recently Rust started to stabilise, so it's clearly not the main selling point.
1
@j.trades9691 there are no performance lossess for eDSLs, and maintenance of a hierarchy of languages is far cheaper than maintenance of a mess of leaky abstractions.
1
@logicaestrex2278 code monkey detected. You should not be allowed anywhere close to any serious engineering, monkey.
1
@logicaestrex2278 I can see you're butthurt Good. It must be really hard for you to perform all the mental gymnastics justifying your ignorance and incompetence.
1
@SoftBreadSoft Indeed, Julia is a proper meta-language.
1
@TerminalAddict did I ever say Rust is ideal? It is just better than C in one specific aspect - macros. And Rust macros are.still not quite what you'd expect from a proper language - see Common Lisp for a reference of how things should be done.
1
found a whiny beta. We all know that real men only use FORTRAN.
1