Why -autofree -gc none must be the ultimate goal of V
#26886
Replies: 6 comments 3 replies
-
|
The language of the beloved in my dreams! Only after meeting V I realized comparing V is nature. |
Beta Was this translation helpful? Give feedback.
-
|
When Your Compiler Is Also Your Garbage Collector (But Only at Build Time) We spend so much time debating tracing vs. ownership that we forget a third path: Compile-Time Determinism. V's -autofree isn't a GC. It's not a Borrow Checker. It's a one-shot, compile-time layout analysis that inserts free() exactly where you would have written it—if you had infinite patience and zero typos. The strategic bet is simple: · C speed (because it's literally C code after translation). Is "Compile-Time Autofree" the silent majority's preferred memory model, or does it hide footguns we just haven't stepped on yet? |
Beta Was this translation helpful? Give feedback.
-
|
@medvednikov |
Beta Was this translation helpful? Give feedback.
-
Disagree and think this is likely to cause unnecessary confusion to users, especially any newbies and casuals. V's flexible memory management allows users to choose the one which is best for the situation. Consolidation of different methods, reduces choice, along with confusing purposes. Some other things: 1) Autofree implementation Autofree could be implemented in a different way, so keeping it separate, keeps that door open. 2) Ownership development As vlang's ownership flag is new, it should be allowed to continually develop and reach greater maturity. Let's see how far it can go and how well. Premature and unnecessary consolidation would likely hamper development and confuse objectives. |
Beta Was this translation helpful? Give feedback.
-
|
The Go language also has a runtime.free proposal, and v's autofree should become the default in v2 as soon as possible. |
Beta Was this translation helpful? Give feedback.
-
|
The autofree + gc-none goal is intellectually interesting but worth being precise about the tradeoffs at each stage. What autofree buys you: The gap to close vs manual memory management:
Why The pragmatic path: The goal is admirable and the direction is right. The question is whether it's achievable without something like Rust's borrow checker as the formal foundation. What's the current state of the escape analysis — are there classes of programs where it's known to work correctly? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
"Making v-autofree -gc none the ultimate goal is not a pursuit of technical perfectionism, but rather an effort to depict a highly differentiated future for the V language. In this future:
Go developers will marvel: 'I didn't know it could be so simple without GC!'! ’
Rust developers envy: 'You can achieve zero-cost abstraction without struggling with the borrow checker every day! ’
C/C++ developers will trust: 'This performance, this control, is exactly what I want! ’
This will become the nuclear weapon that allows V language to stand out in the fierce competition among programming languages. It can expand the application boundaries of V from ordinary web development to high-value fields currently dominated by C/C++/Rust, such as game engines, high-frequency trading, real-time audio and video, and embedded systems. This is not a feature request, but a strategic choice to make V the next generation of mainstream system-level programming language
Beta Was this translation helpful? Give feedback.
All reactions