Threads for volt_dev

  1. 2

    The first line compiles all V files in doom_v/ directory into a single doom.o object file. -translated tells V that the code was translated from C, so the compiler is less strict. For example it allows using i++ as an expression (in V it always must be a statement).

    Given the controversies about the accuracy of claims made about V (see the thread from a few days ago) this makes me a little bit suspicious. This could be interpreted as “the translator leaves in a bunch of C stuff we can’t do in V yet, and then the -translated flag tells the V compiler to just accept that C stuff.” I’m not saying that’s what’s happening, just that it’s a possibility.

    It would be interesting to know what other illegal syntax the -translated flag allows.

    1. 1

      This is not true, you can read the resulting V code yourself and git grep for pref.is_translated in the compiler.

      It’s for the mentioned i++ expression, casting ints to pointers, fixed arrays to pointers etc.

      The article you linked was mostly about a single checker bug that allowed mutability via mut x := y. It was fixed 2 days ago.

      1. 33

        This is starting to look like bullying. I think the post is fine, but posting it here to point and gawk isn’t. :(

        1. 25

          If someone makes bold claims about a project, then there’s nothing wrong with pointing out when those claims aren’t accurate.

          1. 36

            If we had a post for every software project that was still shit in spite of bold claims, the frontpage would be worthless.

            1. 13

              It’s fair to say we don’t need a post for every piece of software that isn’t living up to its claims, but that doesn’t make this bullying.

              1. 17

                I think there are two differences here:

                1. @cadey wrote it but didn’t post it. I’m assuming @calvin shared it because he thought it was genuinely interesting content, not to bully V.
                2. It’s not just that V is still shit in spite of bold claims, it’s that V is still shit in spite of bold claims and incredibly toxic behavior by its community. The interplay between all three- toxicity, grandiosity, vaporware- makes this analysis especially interesting to me.
                1. -8

                  What toxicity are you talking about?

                  If V is vaporware then how are so many of us using it for our projects? https://github.com/vlang/v

                  Here’s a cool one: a first-person shooter game bot https://github.com/EasyHax/Vack

                  1. 16

                    What toxicity are you talking about?

                    You, in this thread, right now.

                    This is the only time I’m going to reply to you. And I only replied because nobody else has explicitly called out your hostility.

                    1. -4

                      Defending V from misleading attacks – so misleading that the author has just retracted her original post – is not exactly a defensible definition of “toxic”.

                      I don’t like seeing slander against important projects I care about. Surely you can understand!

                      1. 13

                        All I can see here is that the V community lives up to its infamy by bullying someone into taking down a critical piece on it.

                        1. 15

                          I retracted the post because of people like you. It wasn’t just you, but I just wanted an end to it.

                          1. -5

                            If your post would have been factual then I wouldn’t have criticized it…

                            I hope you are in a better headspace for your future posts. I’m sure many of us would love to read more articles about WasmCloud, which is honestly one of the coolest projects I’ve ever heard of; would solve many important problems at once, and do so without reinventing the wheel.

                            (Dear readers: FWIW I didn’t ask for the post to be taken down. I was arguing against its content.)

                2. 3

                  Did I miss some drama about this project?

                  1. 3
                  2. -3

                    Which claims aren’t accurate, specifically?

                    1. 9

                      As far as I can tell, compiling 1.2 million lines of code in a second (second bullet point). I would also like to see some citations backing up the safety guarantees with respect to C to V translation. C has way too many gotchas for a bold claim like that. Also, the safety guarantee with the C and Javascript backends.

                      1. -1

                        You can download the project, generate 1 million lines of code using tools/gen_1mil.v and build it in 1 second with v -x64 x.v

                        “ safety guarantee with the C backend” makes no sense, because you write the code in V, not in C. V won’t allow you globals, or shadowing etc. C can be thought of as an assembly language.

                        1. 7

                          If only this benchmark actually worked. First I compiled the generator using:

                          ./v -prod cmd/tools/gen1m.v
                          

                          This already takes 1.3 seconds. I then ran the resulting binary as follows:

                          ./cmd/tools/gen1m > big.v
                          

                          The size of the resulting file is 7.5 megabytes. I then tried to compile it as follows:

                          ./v -prod big.v
                          

                          This takes 2.29 seconds, produces 7 errors, and no output binary. This is the same when using the -64 option, and also when leaving out the -prod option.

                          Even a simple hello world takes longer than a second in production mode:

                          v $ cat hello.v
                          fn main() {
                              println("Hello world")
                          }
                          v $ time ./v -prod hello.v
                          
                          ________________________________________________________
                          Executed in    1,44 secs   fish           external
                             usr time  1372,26 millis  350,00 micros  1371,91 millis
                             sys time   64,93 millis   28,00 micros   64,90 millis
                          

                          In debug mode it already takes 600 milliseconds:

                          v $ time ./v hello.v
                          
                          ________________________________________________________
                          Executed in  666,51 millis    fish           external
                             usr time  613,46 millis  307,00 micros  613,15 millis
                             sys time   52,61 millis   26,00 micros   52,59 millis
                          

                          With -x64 a debug build takes about 2 milliseconds.

                          Based on the above I find it hard to believe V would really be able to compile over a million lines of code in less than one second; even without optimisations enabled. I hope I am wrong here.

                          The hardware used is as follows:

                          • CPU: AMD Ryzen 5 1600X
                          • RAM: 4x Kingston KHX2400C15D4/4G, a total of 16GB
                          • SSD: Samsung 860 EVO 250GB
                  3. 13

                    maybe, but as icefox said I also feel like christine is giving V too much PR with it

                    1. 5

                      I agree that it’s unnecessary, though I can’t decide if it’s really bullying.

                      I’ve heard about V two times since the last post hit lobste.rs. One time I posted Christine’s observations, one time someone else did. I think the message is out there, and at this point, it’s really only noteworthy if something changes.

                      1. -5

                        What message is out there? That the misleading attacks on V continue?

                      2. 5

                        Yeah there is some interesting technical content in the post, but the tone is offputting.

                        1. 4

                          I was amused to see it tagged “performance”, wonder if the pun was intentional on the submitter’s part.

                          1. 7

                            Abuse that gets a lot of “positive engagement” is deemed entertainment.

                          1. 2

                            As someone who is in V’s Discord every day being constantly blown away at the progress being made, I am shocked at the level of dishonesty that this strangely anti-V hit piece achieves.

                            In particular, the degree of cherry-picking (and often then still misrepresenting) a few facts in order to make V appear in the worst possible light is truly breathtaking.

                            She cites vlang.io saying

                            V can be bootstrapped in under a second by compiling its code translated to C with a simple

                            cc v.c

                            No libraries or dependencies needed.

                            then argues against it, preposterously, by saying in part,

                            Git is a dependency, which means perl is a dependency, which means a shell is a dependency, which means glibc is a dependency, which means that a lot of other things (including posix threads) are also dependencies. …

                            Downloading a .c source file requires git? Does this person know what a “dependency” is? Should JavaScript developers include depending upon the laws of physics in package.json?

                            Amusingly, the documentation still claims that memory management is both a work in progress and has perfect accuracy for cleaning up things at compile time.

                            No, the documentation correctly says that memory management is a work in progress, and also that, once completed, will clean up after itself in much the way that Rust does.

                            An Honest Depiction of Progress

                            Here are the combined release notes from all of the V releases since December:

                            Release 0.1.23:

                            - [Direct x64 machine code generation](https://github.com/vlang/v/issues/2849). Hello world being built in 3 milliseconds.
                            - Bare metal support via the `-freestanding` flag, allowing to build programs without linking to libc.
                            - Prebuilt V packages for Linux, macOS, and Windows.
                            - `string.index()` now returns `?int` instead of `int/-1`.
                            - Lots of fixes in Generics.
                            - vweb framework for developing web applications is back.
                            - Vorum, the forum/blogging software written in V/vweb, can now be compiled and has been added to CI.
                            - REPL, `v up` have been split up into separate applications to keep the core V compiler small.
                            - V now enforces short enum syntax (`.green` instead of `Color.green`) when it's enough.
                            - V UI for macOS.
                            - Interfaces have been rewritten. `[]interface` support.
                            - `os.cp()` for copying files and directores.
                            - Additional compile-time flags: `$if clang, msvc, mingw, x32, x64, big_endian, little_endian {`.
                            - All C functions now have to be declared, all missing C functions have been defined.
                            - Global variables (only with the `--enable-globals` flag) for low level applications like kernels and drivers.
                            - Nothing can be cast to bool (previously code like `if bool(1) {` worked.
                            - `<<` and `>>` now work with all integer types.
                            - V detects Cygwin and shows an error. (V supports Windows natively)
                            - Improved type checking of some operators (`%, |, &` etc).
                            - Windows 7 support.
                            - `println(true)` now prints `true` instead of `1`.
                            - `os.exec()` now uses `CreateProcess` on Windows.
                            - fast.vlang.io website for monitoring the performance of V after every commit.
                            - On Windows Visual Studio is now used automatically if GCC is not installed.
                            - vfmt!
                            - Lots of cleaning up in the compiler code.
                            - Multi-level pointers in unsafe code (`****int`).
                            - MSVC backtrace.
                            - `$if os {` blocks are now skipped on a different OS.
                            - C string literals (`c'hello'`).
                            - AlpineLinux/musl fixes + added to CI.
                            - Inline assembly.
                            - Clipboard module (Windows, macOS, X).
                            - `foo()?` syntax for error propagation.
                            - Docs have been migrated from HTML to `doc/docs.md`.
                            - `eventbus` module.
                            - Haiku OS support.
                            - `malloc/free` on bare metal.
                            - `utf8` helper functions (`to_lower()`, `to_upper()`, etc).
                            - Optimization of `for c in str {`.
                            - `string/array.left/right/slice/substr` were removed (`[a..b]` slicing syntax should be used instead).
                            

                            Release 0.1.24:

                            - A new parser/generator built on top of an AST that simplifies code greatly and allows to implement new
                              backends much faster.
                            - Sum types (`type Expr = IfExpr | MatchExpr | IntegerLiteral`).
                            - B-tree map (sped up the V compiler by ~10%).
                            - `v fmt -w`.
                            - The entire code base has been formatted with vfmt.
                            - Generic structs.
                            - SDL module.
                            - Arrays of pointers.
                            - os: `is_link()`, `is_dir()`, `exists()`.
                            - Ranging through fixed size arrays.
                            - Lots of fixes in ORM and vweb.
                            - The first tutorial: [building a simple web application with vweb](https://github.com/vlang/v/blob/master/tutorials/building-a-simple-web-blog-with-vweb.md).
                            - Match expressions now must be exhaustive.
                            - freestanding: `malloc()`/`free()`.
                            - `++` is now required instead of `+= 1` for consistency.
                            - Interpolated strings now allow function calls: `println('val = $get_val()')`.
                            - `string.replace_each([])` for an efficient replacement of multiple values.
                            - More utf8 helper functions.
                            - `-prealloc` option for block allocations.
                            - `type` aliases.
                            - Running `v` with an unknown command will result in an error.
                            - `atof` implementation in pure V.
                            - Enums can now have negative values.
                            - New `filepath` module.
                            - `math.factorial`.
                            - `ftp` module.
                            - New syntax for casting: `val as Type`.
                            - Fewer libc functions used (soon V will have no dependency on libc).
                            

                            Release 0.1.27:

                            - `vfmt` has been re-written from scratch using the new AST parser. It's much faster, cleaner, and can format
                            files with compilation errors.
                            - `strconv`, `sprintf`, and `printf` in native V, without any libc calls.
                            - Interfaces are now a lot more stable and have all expected features.
                            - Lots of x64 backend improvements: function calls, if expressions, for loops, local variables.
                            - `map()` and `filter()` methods can now be chained.
                            - New `[]int{cap:cap, len:len}` syntax for initializing array length and capacity.
                            - New `is` keyword for checking the type of sum types and interfaces.
                            - `as` can now be used to cast interfaces and sum types.
                            - Profiling with `-profile`. Prints a nice table with detailed information about every single function call:
                            number of calls, average time per call, total time per function.
                            - `import(xxx)` syntax has been removed in favor of `import xxx` for simplicity and greppability.
                            - Lots of fixes and improvements in the type checker.
                            - `time.StopWatch`
                            - `dl` module for dynamic loading.
                            - Automatic `str()` method generation for every single type, including all arrays and fixed size arrays.
                            - Short struct initialization syntax for imitating named function args: `foo(bar:0, baz:1)`.
                            - New operator `!in`.
                            - Performance improvements in critical parts of the builtin data structures (array, map).
                            - High order functions improvements (functions can now be returned etc).
                            - Anonymous functions that can be defined inside other functions.
                            - Built-in JSON module is back.
                            - Closures.
                            - Lots and lots of new tests added, including output tests that test error messages.
                            - Multiple errors are now printed, the compiler no longer stops after the first error.
                            - The new JS backend using the AST parser (almost complete).
                            - Variadic functions.
                            - `net.websocket` module (early stage).
                            - `vlib` is now memory leak free, lots of `autofree` improvements.
                            - Simplified and cleaned up `cmd/v`, `v.builder`.
                            - V UI was updated to work with the new backend.
                            

                            After she COMPLETELY ignores the MASSIVE progress mademore than 3000 commits worth from a brilliant and fiercely dedicated team – and judges the current state of V based exclusively on misunderstandings, nitpicks, and on its memory management status after acknowledging that it’s not done yet and that the language is in an alpha state, she snarkily ends with:

                            Overall, V looks like it is making about as much progress as I had figured it would.

                            This is almost as bad as the quote she ended with in her previous post on V:

                            Don’t ever, ever try to lie to the Internet, because they will catch you. …


                            Honesty, Please!

                            If you want to know how well V is actually progressing, try it yourself, check out the Discord, look on GitHub, but whatever you do, do not focus on ignorant, dishonest, cherry-picked commentary from haters; that doesn’t serve anyone well, and is incredibly unfair to those who are pouring themselves into this important project.


                            The Brilliance of V

                            After my 11 years of programming, including 9.5 of programming in Go (which is the most similar language to V), I consider V to easily be the best-designed programming language that exists.

                            Yes, it’s learned a lot from Go and C, and maybe Lisp people prefer Lisp, but V successfully combines the simplicity of Go, the programmer ergonomics of Python, the speed C, and almost as many safety guarantees as Rust (once V has finished implementing these latter aspects, of course!).

                            What I thought would take the V team 5 years to implement has taken less than 1 year. Alex (V’s creator) thought it would take even less time, and now he’s being unfairly raked over the coals for setting extremely ambitious timelines while the same naysayers and bullies ignore everything that has been done.


                            V Resources

                            Website (including code examples): https://vlang.io/

                            GitHub: https://github.com/vlang/v

                            Wiki page explaining why C is used as in intermediate representation rather than LLVM (another brilliant move that allows V to build on the shoulders of giants and avoid reinventing the wheel in order to bootstrap a new language, but a move that is misunderstood and absurdly used to argue against V for doing things differently/better): https://github.com/vlang/v/wiki/On-the-benefits-of-using-C-as-a-language-backend

                            1. 27

                              I understand that you have strong feelings for your language of choice. Nonetheless, language designers are not entitled to a community, nor are they entitled to shelter from criticism. Indeed, one of the most important parts of programming language design is rejecting new languages based on showstoppingly-unacceptable design choices.

                              V does not offer any compelling design choices. Its advertised features can be sorted into libraries, compiler/toolchain offerings, and roughly the level of safety advertised in the 80s when memory-safety was still controversial. Just like Go, V has not learned many lessons, and refuses to offer programmers a more interesting way to express themselves. Even if V were literally Go but better, this would be sufficient to damn it.

                              I understand that you might not like it when people point out that the release dates keep slipping; I think it’s curious that you are willing to link to V’s wiki and source code, but not to bumping release dates.

                              As a language designer, I think that it is important to not advertise what you don’t yet have written. Monte has had one release, a developer preview, and we are intending to complete another iteration of bootstrapping before even considering another release. We know that almost every feature that typical end users will want is not yet written, and so we are not loudly advertising our offering as usable for everyday general-purpose programming, regardless of how much everyday general-purpose programming I or anybody else actually achieves with it.

                              I consider V to easily be the best-designed programming language that exists.

                              What’s your favorite ML? I have lately played with OCaml. There are entire universes of language designs which I suspect that you have yet to explore.

                              1. -4

                                Just like Go, V has not learned many lessons, and refuses to offer programmers a more interesting way to express themselves.

                                FP diehards will never understand why Go has been so wildly successful – and V will be even more successful than Go.

                                V is like Go but fixes all ~10 things wrong with it, providing a lot more flexibility due to its generic functions, generic structs, generic channels (still in the works), sum types, and TypeScript-style interfaces (also still partially in the works).

                                Plus there’s the raw speed factor; V is translated to C before being compiled to machine code, cleverly piggybacking on decades of speed optimizations made by gcc/clang/tcc/etc.

                                The simplicity of Go or Python + almost as much safety as Rust + almost exactly as much speed as C + a flexible type system + familiar syntax == a winning combination, I insist!

                                1. 17

                                  The simplicity of Go or Python + almost as much safety as Rust + almost exactly as much speed as C + a flexible type system + familiar syntax == a winning combination, I insist!

                                  Except all of these are “some time in the future”, and widely incompatible with one another. There’s nothing to support any of these claims. What’s the design for “almost as much safety as rust” (without GC, of course)? The whole thing only just got an AST, and we’re supposed to believe it’s going to be revolutionary? There’s been a lot of grand promises with release dates being pushed back repeatedly, but nothing specific about how the promises will actually be achieved. Making a good language is hard, it takes years (if not decades), and you can’t just magically make something both simple, fast, safe, gc-free, etc. in a field where it’s known that some tradeoffs are inevitable.

                                  1. -3

                                    Except all of these are “some time in the future”, and widely incompatible with one another.

                                    Nope, totally wrong. The simplicity is there, the speed is there, the flexible type system is there, and the familiar syntax is there. A safe subset of C is generated then compiled but not all the safety guarantees are implemented yet.

                                    There’s been a lot of grand promises with release dates being pushed back repeatedly

                                    V is the first software project in history to be finished later than originally intended ;-).

                                    The whole thing only just got an AST

                                    Completely false; V has always had an AST. The AST-related thing that’s new is representing the generated C code as an AST before outputting it.

                                    … you can’t just magically make something both simple, fast, safe, gc-free, etc. in a field where it’s known that some tradeoffs are inevitable.

                                    The big “a-ha” moment for me was this: I now realize that I had falsely assumed that just because prior languages took certain trade-offs that it was impossible to check all these boxes at once. But I was wrong.

                                    The only inherent tension between any of the things I listed is between simplicity and flexibility. But as I said in the comment you’re replying to,

                                    V is like Go but fixes all ~10 things wrong with it, providing a lot more flexibility due to its generic functions, generic structs, generic channels (still in the works), sum types, and TypeScript-style interfaces (also still partially in the works).

                                    The limiting factor is not some innate impossibility of making a language that is simple, fast, and safe. The limiting factor is creativity. But V has learned much from Go, Rust, Python, and other languages, and has unique insights of its own (like its error handling!).

                                    New things are, in fact, possible… and spelled out in detail on the website and in the docs, in this case. See for yourself: https://github.com/vlang/v/blob/master/doc/docs.md .

                                    1. 10

                                      the flexible type system is there

                                      hydraz below convincingly demonstrated that if function calls have generic types, type is not checked at all(!) in current V. How can you say type system is “there”? I guess it is “there” in terms of code generation, but if you are not checking types, saying type system is there is at best deceptive.

                                      1. -4

                                        How can you say type system is “there”?

                                        …because there are types you can define and instantiate and do all the usual things that programming languages let you do with types…

                                        hydraz said,

                                        type errors for parameters in functions with a slapped on them are still silently ignored…

                                        Silently ignored? If you use a generic type in a way that’s invalid then the program won’t compile (yes, during the C -> machine code step).

                                        1. 11

                                          I think you need to read my comments - and indeed, the compiler code that I linked - again. V has roughly no type system at all. The function, foo, that I wrote, isn’t generic!

                                          • It does have a <T>, but there’s nothing to infer that T from (This should be a type error. It isn’t)
                                          • It takes a string, but I can give it an int, and this should be an error, but the compiler has code specifically for silently ignoring these errors.
                                      2. 8

                                        spelled out in detail

                                        Let’s see memory management: there’s no explanation, just claims there are (or will be, it’s wip after all) no leaks, no gc, not refcounting, but also no manual memory management (it’s hardly leak free, after all, even in rust). What magic justifies that? Is there just no dynamic allocation? Otherwise I’d like to see the papers and subsequent Turing award for solving memory management once and for all.

                                        As for the deadlines: the author of V has made ridiculous deadlines so many times, for no good reason (why promise something in a few weeks or months instead of just waiting for it to be polished?!). It’s not like open source projects are tied to pointy haired boss deadlines.

                                    2. 13

                                      Interestingly, I’m not an “FP diehard”; I come from an object-based tribe, and I work on object-based designs.

                                      None of the listed improvements to V over Go are related to what makes Go bad; I have a thread from last year exploring the worst of Go’s flaws. In short, the problem isn’t even an upper limit on abilities, but a lower limit on how much code is required to do even the bare minimum, and a surprising lack of safety in common situations.

                                      As the original post author and several others have repeatedly indicated throughout current and past discussion about V, the speed claims simply aren’t being substantiated in an open and reproducible configuration which the community can examine and test themselves. Simply changing the host language does not grant speed, unfortunately, because of interpretative overhead, and the only cure is putting effort into the compiler.

                                      At the same time, it is toolchains and not languages that are fast, and so any novel speed improvements in V should be explicable to the rest of us. For example, in Monte, we use nanopass design and ANF style, originally explored in Scheme. We have a JIT in the Smalltalk/Java tradition, using an off-the-shelf toolkit, RPython.

                                      As an aside, I would imagine that V would be able to more efficiently take advantage of GCC/LLVM/etc. by picking just one backend, and emitting code just for that backend. This would be due to C’s relatively poor guarantees about how memory will be used.

                                      1. 5

                                        V is translated to C before being compiled to machine code

                                        That, right there, is enough for me to question any safety guarantee V offers (and I like C).

                                        1. 4

                                          Nim compiles to C and it’s garbage collected. I believe the reasons they do that are runtime reach and whole program optimization.

                                          If you can statically guarantee safety it shouldn’t be a problem. (However, its not necessarily a trivial thing to suggest.)

                                          1. 3

                                            ATS compiles to C too, if I understand it correctly. And there have been Haskell compilers that compiled to C too and many other programming languages that provide some aspects of safety that the underlying C language, like the machine code, do not provide.

                                            1. 4

                                              Why does using C as an intermediate language in the compilation process necessarily imply that a language’s safety guarantees are bad? Compilers that compile to some kind of bytecode - like rustc compiling to LLVM bitcode, or JVM langauges’ compilers compiling to JVM bytecode - are perfectly capable of being safe, even though they output code in an unsafe language (which may or may not be the final compilation output - it is (I think) in the JVM case, but LLVM bitcode is further transformed into machine-specific machine code). I don’t see why C should be any different in this respect.

                                              1. 3

                                                I don’t know the guarantees of LLVM or JVM, but at the language level, C has a ton of unspecified and undefined behaviors. Skipping the dangers around pointers and arrays, you still have the following undefined behavior as outlined in the C standard:

                                                • shifting an integer by a negative value
                                                • shifting an integer more than its size in bits
                                                • left shifting a negative value
                                                • signed integer representation (sign-magnitude, 1s complement, 2s complement [1])
                                                • (quoting from the C99 standard for this one): Whether certain operators can generate negative zeros and whether a negative zero becomes a normal zero when stored in an object
                                                • signed integer trap representations
                                                • signed integer wrap sematics
                                                • padding value
                                                • padding in general
                                                • reading a union member that wasn’t the last one written to

                                                Now, it seems that V is targeting GCC/clang, but even so, you’ll get differences in behavior across different architectures, specifically with shifting (some architectures will mask the shift count, some won’t). When I see “safety” as applied to a computer language, I would expect these issues will be spelled out as to what to expect.

                                                [1] In my research, there aren’t many systems in use today that are not 2s complement. They are:

                                                • Unisys 1100/2200
                                                • Unisys ClearPath A
                                                • IBM 700/7000 series

                                                I know one of the Unisys systems is still be produced today and has a C compiler (which one, I don’t recall, I think the 1100/2200).

                                                1. 2

                                                  you do realize that source code gets compiled to machine code, which is not safe by definition.

                                                  The generated C code doesn’t use any of these, and doesn’t have to.

                                                  1. 3

                                                    Then what’s your definition of “safe” then? There is way less that’s undefined in assembly than in C. Give me an architecture, and I can look up what it does for the above list. The reason C has so much undefined behavior is precisely because it runs on many architectures and the designers of C didn’t want to favor one over the other. Different languages can make different trade offs .

                                            2. 5

                                              FP diehards will never understand why Go has been so wildly successful – and V will be even more successful than Go.

                                              Do you? Go succeeded because it was created and backed by veteran Bell Labs people and Google, to solve existing problems. I’m not talking about marketing only, but also the level of sophistication and simplicity those people were able to bring in.

                                              It also succeeded because it didn’t promise anything it didn’t deliver.

                                              1. -4

                                                Yes. I spotted Go as great technology in November of 2010. Go is simple and fairly powerful considering that simplicity.

                                                The original version of V was written in Go, V has learned many lessons from Go, both from its strengths that V builds on and the weaknesses it shores up with generic functions, generic structs, sum types, and more.

                                          2. 14

                                            I’d be interested in seeing what kind of these “lots of fixes in Generics are”, because as far as I can tell from reading the compiler source code, type errors for parameters in functions with a <T> slapped on them are still silently ignored…

                                              if !c.check_types(typ, arg.typ) {
                                                // str method, allow type with str method if fn arg is string
                                                if arg_typ_sym.kind == .string && typ_sym.has_method('str') {
                                                  // note: str method can return anything. will just explode in the C compiler -- hydraz
                                                  continue
                                                }
                                                if typ_sym.kind == .void && arg_typ_sym.kind == .string {
                                                  continue
                                                }
                                                if f.is_generic {
                                                  // ignore errors in functions with a <T> -- hydraz
                                                  continue
                                                }
                                                if typ_sym.kind == .array_fixed {
                                                }
                                            

                                            Try this code:

                                            fn  foo<T>(y string) int {
                                              return 0
                                            }
                                            
                                            fn main() {
                                              foo(123)
                                            }
                                            
                                            1. -3

                                              You had foo take a string then passed in an int :-)

                                              EDIT: This works, for example:

                                              fn foo<T>(y string) int {
                                                return 0
                                              }
                                              
                                              fn main() {
                                                println(foo<int>('hi'))
                                              }
                                              
                                              1. 23

                                                … Yes, that’s my point. I passed an int to a string parameter, and the V compiler didn’t give a type error: the C compiler did.

                                                % make
                                                cd ./vc && git clean -xf && git pull --quiet
                                                cd /var/tmp/tcc && git clean -xf && git pull --quiet
                                                cc  -g -std=gnu11 -w -o v ./vc/v.c  -lm -lpthread
                                                ./v self
                                                V self compiling ...
                                                make modules
                                                make[1]: Entering directory '/home/abby/Projects/v'
                                                #./v build module vlib/builtin > /dev/null
                                                #./v build module vlib/strings > /dev/null
                                                #./v build module vlib/strconv > /dev/null
                                                make[1]: Leaving directory '/home/abby/Projects/v'
                                                V has been successfully built
                                                V 0.1.27 b806fff
                                                
                                                % ./v test.v
                                                ==================
                                                /home/abby/.cache/v/test.tmp.c: In function ‘main’:
                                                /home/abby/.cache/v/test.tmp.c:9476:2: error: implicit declaration of function ‘foo’ [-Werror=implicit-function-declaration]
                                                 9476 |  foo(123);
                                                      |  ^~~
                                                /home/abby/.cache/v/test.tmp.c: In function ‘vcalloc’:
                                                /home/abby/.cache/v/test.tmp.c:4597:1: warning: control reaches end of non-void function [-Wreturn-type]
                                                 4597 | }
                                                      | ^
                                                /home/abby/.cache/v/test.tmp.c: In function ‘byte_is_white’:
                                                /home/abby/.cache/v/test.tmp.c:7227:1: warning: control reaches end of non-void function [-Wreturn-type]
                                                 7227 | }
                                                      | ^
                                                ...
                                                ==================
                                                (Use `v -cg` to print the entire error message)
                                                
                                                builder error: 
                                                ==================
                                                C error. This should never happen.
                                                
                                            2. 17

                                              Author of the post here, let me see if I can try to clear some things up.

                                              She cites vlang.io saying

                                              V can be bootstrapped in under a second by compiling its code translated to C with a simple

                                              cc v.c

                                              No libraries or dependencies needed.

                                              then argues against it, preposterously, by saying in part,

                                              Git is a dependency, which means perl is a dependency, which means a shell is a dependency, which means glibc is a dependency, which means that a lot of other things (including posix threads) are also dependencies. …

                                              Downloading a .c source file requires git? Does this person know what a “dependency” is? Should JavaScript developers include depending upon the laws of physics in package.json?

                                              Okay I was being a bit unfair, but if we look at the makefile we see that it has the following dependencies:

                                              • make (which depends on perl, glibc, autotools and all that nonsense)
                                              • git (which depends on perl (even at runtime), glibc, autotools and all that nonsense)
                                              • gcc (which depends on perl, glibc, autotools, automake, autoconf and more libraries than I care to list right now)

                                              So if you want to be completely honest, even if you cut out the make and git steps (which i care about as someone who builds packages for linux boxes using the unmodified build system as much as possible so I can maintain whatever shred of sanity I have left), it still depends on a C compiler to get bootstrapped. This is a dependency. Then you have to download the bootstrap file from somewhere, which requires dependencies in terms of root certificates and the compiler to bootstrap with (not to mention the server that hosts the bootstrap file both existing and serving the right file back). Given that V in its current form requires you to download files from the internet in order to build it, mathematically it cannot be dependency free (this actually precludes it from being packageable in NixOS, because NixOS doesn’t allow package builds to access the network, all of the tarball/assets need to be explicitly fetched outside the build with fetchgit, fetchurl and similar). Pedantically, requiring someone to have an internet connection is a dependency.

                                              Pedantically, the v binary lists the following dynamically linked dependencies when using lld(1):

                                              $ ldd ./v
                                                      linux-vdso.so.1 (0x00007fff2d044000)
                                                      libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f2fb3e4c000)
                                                      libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2fb3a5b000)
                                                      /lib64/ld-linux-x86-64.so.2 (0x00007f2fb4345000)
                                              

                                              If the binary was truly dependency-free, the ldd output would look something like this:

                                              $ ldd $HOME/bin/dhall
                                                      not a dynamic executable
                                              

                                              This leads me to assume that the v binary has dependencies that the runtime system will need to provide, otherwise the program will not be able to be loaded by the Linux kernel and executed. Binaries produced by v have similar limitations:

                                              $ ldd ./hello
                                                      linux-vdso.so.1 (0x00007ffdfdff2000)
                                                      libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fed25771000)
                                                      /lib64/ld-linux-x86-64.so.2 (0x00007fed25d88000)
                                              

                                              Additionally, I am banned from the V discord and GitHub. The V programming language has censored a neuro-diverse trans woman from being able to contribute to the project in any capacity. I would love to be able to contribute to things at least to make the documentation and website not filled with misleading statements, but I cannot. This is why I ask other people to make issues for me in my posts.

                                              I realize things might look snarky when the article is viewed from a certain worldview/lens, but there is a total scalar lack of snark intended in that article when it was written. If you cannot realize that, then I am sorry that my intended tone didn’t have the effect I wanted and I will use this feedback to further refine my writing ability.

                                              Direct x64 machine code generation

                                              In my testing I was unable to get this working on my Ubuntu server. It still used gcc.

                                              1. 8

                                                You ended your piece (which utterly trashes V) by saying

                                                Overall, V looks like it is making about as much progress as I had figured it would.

                                                I criticized your snark, and you replied with

                                                I realize things might look snarky when the article is viewed from a certain worldview/lens, but there is a total scalar lack of snark intended in that article when it was written.

                                                Do you really expect anyone to believe that?

                                                Additionally, I am banned from the V discord and GitHub. The V programming language has censored a neuro-diverse trans woman from being able to contribute to the project in any capacity.

                                                Do you really think that’s why you were banned? Does Alex even know you’re trans? You don’t think you were banned for your vicious and misleading attacks on this project?

                                                1. 6

                                                  You’re just ignoring the points she made here, and keep talking besides her and banging on about the article.

                                                  1. 6

                                                    @cadey didn’t say they were banned for who they are, they just stated they were X and were banned.

                                                    You don’t think you were banned for your vicious and misleading attacks on this project?

                                                    If my memory serves me right, @cadey was banned because of their disagreements with V, such as those voiced in this and the previous (https://christine.website/blog/v-vvork-in-progress-2020-01-03) blog post. I could be wrong. Also “vicious” is being overly dramatic and frankly not productive.

                                                    1. 4

                                                      @cadey didn’t say they were banned for who they are, they just stated they were X and were banned.

                                                      Then why bring it up?

                                                      If my memory serves me right, @cadey was banned because of their disagreements with V, … . I could be wrong.

                                                      Is that actually true?

                                                      Also “vicious” is being overly dramatic …

                                                      It doesn’t sound like you’re paying very close attention… Two other people criticized her for bullying in this very thread before I even got here. If you read my comments here then I’d hope you would change your mind about how unfairly harsh she has been to Alex, to his project, and to the V team.

                                                      Consider starting here: https://lobste.rs/s/nfjifq/v_update_june_2020#c_vuofat

                                                      1. 22

                                                        You almost never comment except in V threads.

                                                        Further, many of those comments seem to be today, in last year’s thread.

                                                        Please just let this be. Flag the submission if you must and move on.

                                                        1. 6

                                                          I have removed the post as of this commit. In a few minutes the article will be gone, but a tombstone of the former article will remain.

                                                          1. 21

                                                            I don’t think you did anything wrong by posting it, I don’t think you made any mistakes, and I enjoyed reading it. Not saying this to convince you to put the essay back; I just know that I personally feel awful when I get really harsh criticism, even when I don’t respect or care about the person giving it. So wanted to provide a bit of positivity to balance it out ツ

                                                          2. 8

                                                            Then why bring it up?

                                                            I can’t answer that question. While I’m not sure what the benefit is of bringing it up, I don’t see the harm either; it was pretty clear from the comment they were not saying they were banned because of who they are.

                                                            Is that actually true?

                                                            Feel free to show otherwise. I can’t, because I’m not the person who banned @cadey; nor am I in contact with them.

                                                            It doesn’t sound like you’re paying very close attention

                                                            Please do not make such assumptions. It’s unproductive starting an argument as such, as well as factually incorrect.

                                                            Two other people criticized her for bullying in this very thread before I even got here.

                                                            Only one person said it’s starting to look like bullying (https://lobste.rs/s/nfjifq/v_update_june_2020#c_cdxvwk). Other comments mentioning “bullying” either state they are not sure, or don’t see it as bullying. I don’t see anybody else mentioning this is bullying. Am I perhaps overlooking something?

                                                            If you read my comments here then I’d hope you would change your mind about how unfairly harsh she has been to Alex, to his project, and to the V team.

                                                            I agree the tone in the blog post is not the most productive. While some parts of the post are a bit pedantic, overall I think it’s not unfairly harsh. V made many big claims both before and after its release. Here are just a few examples:

                                                            • https://github.com/vlang/v/issues/35
                                                            • Translating C++ to V, which now has the note “TODO: translating C to V will be available in V 0.3. C++ to V will be available later this year.”
                                                            • Claiming V has pure functions when they can still have side-effects. “Pure” has a well defined meaning. If you mean “pure but with IO”, then call it something else; otherwise it’s just misleading. This was brought up in this issue, which was closed, but I can’t find any mention of this in the docs here.
                                                            • Various claims about certain components not having dependencies, only to have dependencies; despite the website advertising “Compiles to native binaries without any dependencies”
                                                            • Advertising “V is written in V and compiles itself in under a second.”, when according to https://fast.vlang.io/ compiling V with optimisations (if I’m reading the table correctly) takes over one second most of the time.

                                                            There is a lot more from past discussions (e.g. those on Hacker News), so I suggest taking a look at those.

                                                            With that all said, I really do hope V succeeds and wish the authors the best of luck. But the authors really need to make sure that what they advertise is actually implemented as advertised, or make it very clear what the current state is. Don’t go around saying “We support X” followed by “oh by the way we’ll release that end of this year”.

                                                  1. 11

                                                    My response to this copied from https://news.ycombinator.com/item?id=20258485

                                                    Thanks :) It’s 0.0.12, the first public release. What’s with all this “vaporware”?

                                                    The compiler can already compile itself in 0.3 seconds and is written 100% in V: https://github.com/vlang/v#installing-v-from-source

                                                    It allows building easy cross platform graphical apps: https://github.com/vlang/v/tree/master/examples/tetris

                                                    It has easy cross compilation and can even compile itself for another platform: https://twitter.com/v_language/status/1137537130887077890

                                                    It allows to build small performant GUI apps like Volt: https://volt-app.com/ (Volt 1.0 RC 1 for macOS has been used by thousands of happy users for several months.)

                                                    It powers a simple forum: https://blog.vlang.io/forum And the entire forum is one 65 KB binary.

                                                    It can translate and build DOOM: https://github.com/vlang/doom

                                                    It has very extensive and simple to read documentation that covers pretty much the entire language: https://vlang.io/docs

                                                    I think it’s pretty good for 0.0.12.

                                                    Come back when it’s v1.0 by the end of this year.

                                                    1. 9

                                                      Now that you have added WIP, I am satisfied. Now it is not misleading and people can decide for themselves.

                                                      Keep it like this and I won’t complain any more. Keep up the good work, you are doing something right.

                                                      1. 8

                                                        It can translate and build DOOM: https://github.com/vlang/doom

                                                        I only see one file there, can you please push the rest?

                                                        1. 2

                                                          It seems like people are kind of dogpiling on your project here, and perhaps the criticism is warranted. I haven’t looked that much into V, but I’m hoping this is a case of just over-hyping and trying to deliver something too early (although you’ve made it clear this is an alpha), and that you continue to work on this and make it something great.

                                                        1. 5

                                                          I am curious why v.c isn’t in the repo, but on the web site. Seems odd… perhaps a thing that’s meant to be addressed at some point, but low priority…

                                                          1. 1

                                                            It’s 15k lines of code with constant changes, it’s not really supposed to be in the repo. It’s more like install.exe :)

                                                            1. 6

                                                              It should definitely be versioned in one way or another to avoid versions confusions. Having a record of changes and also precise versions that you can point people to is essential for packaging. You can put it in a different repo if you don’t want to spoil the history.

                                                          1. 36

                                                            This guy is a far better hype man than he is anything else.

                                                            edit:

                                                            Try to use it yourself if you think it is good. Send me a message later if I was right or wrong.

                                                            I didn’t say he was bad, actually I think he is a great hype man, one of the best in this space. The way he appeals to surface level curiosity while keeping facts just obscure enough to solicit donations[1] is a work of art. It is a valuable lesson to know how to manipulate people at a large scale. If he starts a marketing consultancy, I think he might do very well.

                                                            To the author of V: I really want you to succeed, if everything promised worked as advertised It would be a great thing for everyone.

                                                            [1] https://www.patreon.com/vlang

                                                            1. 3

                                                              In fairness I assumed this was work done in spare time and not something being paid for with $800 monthly donations, maybe I should have done more research.

                                                              1. 3

                                                                I am a bit jealous, I don’t know how to start an OSS project with so many donations. Being liberal with what you promise seems to help.

                                                                I hope it is a “fake it till you make it” more than a “cut and run”. Obviously if everything promised worked as advertised It would be a great thing for everyone.

                                                                1. 3

                                                                  Rates vary and my city tends to be expensive, but 800/mo seems unlikely to fund more than a little hobby work a week. I suppose if you were already setup (no debts to service) you could make it work in a cheap area…

                                                                  1. 7

                                                                    I think lots of stuff like this is done for ego and personal satisfaction rather than the money. The money is icing on the cake. There’s another benefit that hyping projects might bring. So, the job interview goes like this:

                                                                    Interviewer: “Do you have any prior projects with the impact that justifies the high-paying position you’re applying for?”

                                                                    V developer: “I made a language that (big claims here). Easier than Rust. I open-sourced it on Github. As you see, it had four, thousand stars in no time.”

                                                                    Interviewer: “Wow, that’s pretty impressive to pull that off and get so many users.”

                                                                    Yet, hardly anything was delivered. Add this project as another data point on why Github stars are meaningless to me. If anything, they make me more skeptical of a project.

                                                                    1. -1

                                                                      Hi there, it’s a year later and your comments have not aged well. Check out https://vlang.io and https://github.com/vlang/v .

                                                                      Here is my response to ac’s latest misleading attacks against V: https://lobste.rs/s/nfjifq/v_update_june_2020#c_vuofat

                                                                    2. 3

                                                                      I never said it is livable, I just just think that is enough incentive to exaggerate the truth.

                                                                2. 4

                                                                  Are you aware your comment above, as it appears at the time of me writing this reply, is a raw and pure ad hominem, with absolutely no merit-based argument at all? Could you please try to provide some verifiable technical criticism instead?

                                                                  1. 29

                                                                    Ok, the language itself has more than 3800 stars on github, but most of the libraries in this repository are empty stubs:

                                                                    Let’s compare to zig, an equivalent project made by a serious person with many contributors and 3000 stars on github:

                                                                    The difference? The V guy is a better hype man. The Zig guy spent far more time working on things. I didn’t say he was bad, actually I think he is a great hype man.

                                                                    1. 27

                                                                      musl-libc is another example of a project that has very little hype, but represents a significant contribution to the open source community at large, with incredibly high quality standards. It’s been around for years, yet making less than V on Patreon.

                                                                      I honestly feel a little guilty about this. I’ve done some marketing to hype up Zig and so I’m making more than Rich does with musl, even though it has been around longer than Zig as well. Furthermore Zig ships with musl and a lot of the standard library is ported from musl, so the Zig project benefits in a huge way from musl. I’m donating $5/mo on Patreon to musl, but I dunno, it doesn’t seem fair to give that low amount. But I’m also not making a living wage yet, so… it also doesn’t feel right to just give a large portion of my income away.

                                                                      1. 7

                                                                        For now everyone should look after themselves and not feel guilty, but I do think collectively we need to do something to fix the broken nature of open source funding.

                                                                        1. 6

                                                                          And create a funding model that isn’t contingent on HN hype/Github stars.

                                                                          1. 3

                                                                            This is tantamount to, “nullify the power social influence has over allocation of resources.” Not saying some progress can’t be made, but realize what you’re up against here.

                                                                            There are some political ideologies inadvertently end up trying to shift society towards social power being even more influential rather than less. Given how easy it is to monopolize celebrity, this is bad for solidarity & equality.

                                                                        2. 2

                                                                          Thank you so much! That is exactly the kind of a comment I was hoping for, backed with some concrete references. This gives so much more substance and weight/value to me as a reader than the original one, significantly boosting the speed with which I can evaluate the subject. Thanks again!

                                                                          1. 0

                                                                            Language version 0.0.12 that’s been just released has not very mature libraries. Developed by 1 person. Sorry about that.

                                                                            1. 6

                                                                              For all the hype you’ve been generating, I think people expected some kind of 1.0 release, or at least all the promised features to actually be implemented.

                                                                          2. 10

                                                                            From the patreon page:

                                                                            C/C++ translation
                                                                            V can translate your entire C/C++ project and offer you the safety, simplicity, and up to 200x compilation speed up.
                                                                            
                                                                            Hot code reloading
                                                                            Get your changes instantly without recompiling!
                                                                            Since you also don't have to waste time to get to the state you are working on after every compilation, this can save a lot of precious minutes of your development time.
                                                                            

                                                                            Maybe it will reach these goals one day, but it doesn’t do them now.

                                                                            I will give you some time to find that in the repository and verify it.

                                                                            1. 1

                                                                              https://github.com/vlang/doom

                                                                              Full code next week, but you can already build a major file transpiled from C to V and replace the object file in the project.

                                                                              1. 6

                                                                                is that C++ too? How about the hot code reloading? It isn’t a full project either like you say.

                                                                                1. 6

                                                                                  That’s one file though, not the entire game like you seem to be implying.

                                                                            2. 2

                                                                              I don’t know man, just from a few moments glance through this it looks like a serious effort that probably took him a significant amount of time. I can’t imagine it would be so great to have invested so much time and then see people being so critical, especially in an unfounded way.

                                                                              1. 23

                                                                                There’s some context here: for the past few months he’s been making pretty extreme claims about V’s features, and attacking anyone who expressed any skepticism. He also refused to explain how any of it works, just saying we should wait until the open release. Well… it’s the open source release and it turns out the skeptics were right.

                                                                                1. 0

                                                                                  I never attacked anyone. Do you have examples of my attacks or extreme claims?

                                                                                  1. 43

                                                                                    My examples will be released in 2 weeks.

                                                                                    1. -2

                                                                                      Thanks a lot for the snark, really productive…

                                                                                      The difference is that @volt_dev has fulfilled his promises, though yes, timelines are tough: https://github.com/vlang/v

                                                                                      1. 2

                                                                                        Why are you replying to 12 month old comments?

                                                                                        1. 0

                                                                                          Because these comments are relevant to a new post from earlier today: https://lobste.rs/s/nfjifq/v_update_june_2020

                                                                                          1. 1

                                                                                            Well my opinion is that its great work continued on V and it has such devoted fans. I won’t be spreading any hatred on V.

                                                                                            1. 0

                                                                                              Thank you!

                                                                                2. 7

                                                                                  It isn’t unfounded, see comment above - and any time anyone posts anything, you can expect criticism. It happens all the time.

                                                                                  I didn’t say he was bad, actually I think he is a great hype man.

                                                                                  1. 0

                                                                                    I only receive constant criticism like from you in this thread :) I don’t bother to post criticism. Any examples?

                                                                                    1. 6

                                                                                      I’d like to note that, to me, most of your replies here just look like damage control. This kind of comment is usually not well-received in technical forums such as Lobste.rs. Don’t respond to every comment you don’t like - let your work speak for itself!

                                                                                3. 1

                                                                                  Hi

                                                                                  Can you please point out specific things that don’t work as expected or things that I “hype” on the website?

                                                                                  Thanks

                                                                                  1. 23
                                                                                    • hot code reloading
                                                                                    • C++ translation
                                                                                    • “a strong modularity” (this isn’t grammatically correct)
                                                                                    • compiles to native binaries without dependencies…except libcurl or other libraries you obviously depend on, not to mention a C compiler. That is a dependency whether you like it or not.
                                                                                    • you mention doom being translated to V, your repo only shows what looks like a single file being translated
                                                                                    • you give an example of a “powerful web framework” yet show no code to back up that claim
                                                                                    • you do concurrency in the most lazy and inefficient way possible and promise to have something that big companies struggle with by the end of this year
                                                                                    • you claim being able to cross compiling…except from non-macOS to macOS
                                                                                    • it only looks like you support amd64 processors from the code I read
                                                                                    • you claim no null yet have both perfect c interoperability and optionals. What happens when the c libraries the user wants to use require the use of null? What happens when the optional is not filled with the target data?

                                                                                    Need I go on?

                                                                                    1. 4

                                                                                      Can you substantiate your claim that

                                                                                      V compiles ≈1.2 million lines of code per second per CPU core

                                                                                      from the website?

                                                                                      1. 5

                                                                                        Generating 1.2 million lines of code with:

                                                                                        print "fn main() {"
                                                                                        
                                                                                        for i = 0, 1200000, 1
                                                                                        do
                                                                                          print "println('hello, world ')"
                                                                                        end
                                                                                        
                                                                                        print "}"
                                                                                        

                                                                                        I got the following error:

                                                                                        $ time v 1point2mil.v
                                                                                        pass=2 fn=`main`
                                                                                        panic: 1point2mil.v:50003
                                                                                        more than 50 000 statements in function `main`
                                                                                                2.43 real         2.13 user         0.15 sys
                                                                                        

                                                                                        Note that this is 50,000 ish lines of code in TWO SECONDS.

                                                                                        1. 4

                                                                                          Generating 1.2 million lines of code with: I patched the compiler to remove the arbitrary 50’000 statement restriction (and also disabled calling out to the C compiler, so that it doesn’t artificially inflate compilation times), and I got these times:

                                                                                          % time compiler/v test.v
                                                                                          
                                                                                          Edit: remembered another fun one: The generated C has a baseline of 69 warnings (I did not make that up) then one for every string literal, since the type of `tos` uses `unsigned char *` instead of `char *`.
                                                                                          /home/matheus//.vlang//test.c
                                                                                          14.58user 0.60system 0:15.61elapsed 97%CPU (0avgtext+0avgdata 1311836maxresident)k
                                                                                          0inputs+91504outputs (0major+316215minor)pagefaults 0swaps
                                                                                          

                                                                                          Some other things I also noticed:

                                                                                          • The 1000 byte global allocation at the start is used for format string literals suffixed with a !. If you generate a string that exceeds this length, the generated code aborts with an assertion failure from malloc().
                                                                                          % cat test.v
                                                                                          fn main() {
                                                                                          x := 1
                                                                                          println('$x [redacted repetitions]'!)}
                                                                                          % v test.v; clang ~/.vlang/test.c -w; ./a.out
                                                                                          /home/matheus//.vlang//test.c
                                                                                          malloc(): corrupted top size
                                                                                          fish: “./a.out” terminated by signal SIGABRT (Abort)
                                                                                          
                                                                                          • V supports goto but doesn’t check whether labels are defined, so they crash in the C compiler;
                                                                                          • V doesn’t ever convert their integer literals to integers internally; There’s a check for division by zero, but it’s comparing the literal to '0' - the string. So this won’t compile:
                                                                                          fn main() {
                                                                                            x := 1 / 0
                                                                                            println('$x')
                                                                                          }
                                                                                          

                                                                                          But this does:

                                                                                          fn main() {
                                                                                            x := 1 / 00
                                                                                            println('$x')
                                                                                          }
                                                                                          
                                                                                    2. -2

                                                                                      This guy is a far better hype man than he is anything else.

                                                                                      He’s even better at language design and implementation. If you were honest in your remarks then you would have commented on the substance of the issue, but instead you chose not to.

                                                                                      It is a valuable lesson to know how to manipulate people at a large scale.

                                                                                      Here you dishonestly pretend that you’re complimenting the creator of V while interspersing ad hominem attacks.

                                                                                      My response to cadey’s latest absurd V bashing: https://lobste.rs/s/nfjifq/v_update_june_2020#c_vuofat

                                                                                      1. 1

                                                                                        Why are you replying to me? I didn’t bash V anymore, you are getting me mixed up with someone else.

                                                                                        1. 0

                                                                                          Oops, yes I confused you with cadey; I am sorry and edited my comment above to refer to cadey rather than you, as intended.

                                                                                    1. 11

                                                                                      If you’re going to birth a new programming language in this era, can you please make it not be named a single letter? Pretty please. This makes searching for things about the language much harder than it needs to be.

                                                                                      1. 6

                                                                                        I told the author. They’re thinking of names but running into the “already taken” problem. Probably still thinking on it.

                                                                                        1. 4

                                                                                          Yes, name suggestions are welcome. I guess it’s best to come up with a new word that makes sense and is google’able. Like Scala.

                                                                                          1. 1

                                                                                            I was going to suggest Volt but found that exists. Another systems language trying to be better than C. These things are popping up everywhere. Might be better to consider something other than one starting with V. Not to say there isn’t something in the dictionary waiting to be discovered.

                                                                                            1. 1

                                                                                              I went through 10 names, all of them were taken by other languages :)

                                                                                              Volt was my initial idea too. Although it’s weird having the same name for the language and the product.

                                                                                              1. 1

                                                                                                Nothing wrong in having name collisions with other projects.

                                                                                                (Nothing wrong in single-letter names either, but if you would prefer not to have one you shouldn’t let the lack of unique names stop you.)

                                                                                                1. 1

                                                                                                  I got the same feeling yesterday.

                                                                                                2. 1

                                                                                                  Yeah, I thought about that. Might get you two things in top of Google, though. Probably better if they’re different.

                                                                                                  Far as taken, remember that there’s endless ideas that have been tried in the past that nobody will think about or use. New products keep showing up with some of the same names. Quite a few get big. The conflict caused no problems since the older thing didn’t matter. So, you might still be able to use an existing name if it’s a project with no attention whose owner isn’t likely to sue you. You could give that great name the reputation it deserves. :)

                                                                                        1. 6

                                                                                          I can’t form an opinion about the language, there’s too little information available. I don’t even know if it is garbage collected or requires manual allocation/deallocation. The syntax is a mashup of Go and Rust, closer to Go, and it is “safe”, so probably garbage collected?

                                                                                          Based solely on the web site information, this claim seems incorrect and/or misleading:

                                                                                          This tool supports the latest standard of notoriously complex C++ and allows full automatic conversion to human readable code.

                                                                                          It says “full automatic conversion (of C++) to human readable code”. But this language is missing a lot of features that would be needed to make this possible, such as classes with multiple inheritance, destructors, exceptions, and C++-equivalent templates. The language is “simple”, so it can’t have all the features of C++. You could translate C++ to V by inline expanding all of the C++ features with no V equivalent into lower-level C-like code. For example, inline expand destructors at each point where they would be called. But then the code is not maintainable, and I dispute that it is human readable, even if it is indented nicely, because many of the higher level abstractions have been destroyed. The translation might plausibly be done by using clang to translate C++ to LLVM IR, then converting the IR to V. The resulting V code will not be maintainable unless maybe you use a very restricted subset of C++ that corresponds to the features present in V.

                                                                                          1. 10

                                                                                            “No global state” means you can’t translate the full C++ language to V.

                                                                                            No GC, “safe”, and “fearless concurrency” (a feature of Rust) is a bold claim. How can this be done without the complexity of the Rust type system and borrow checker? Maybe that is enabled by “no global state”, which might mean a very restricted programming model compared to the competition.

                                                                                            1. 1

                                                                                              V allows globals for code translated from C/C++. Perhaps I’ll be able to remove this hack in the future. Not sure it’s possible.

                                                                                              1. 2

                                                                                                How do you handle undefined behaviour in the C++ sources when translating? Does V also suffer from undefined behaviour? For example, what would I get if I tried to translate this C++ to V:

                                                                                                unsigned int foo = -2.0;
                                                                                                
                                                                                                1. 3

                                                                                                  It would translate to

                                                                                                  foo := u32(-2.0)

                                                                                                  It will not compile.

                                                                                            2. 5

                                                                                              I think the thing that made me mentally eject was this part:

                                                                                              V can translate your C/C++ code to human readable V code. Let’s create a simple program test.cpp first:

                                                                                              #include <vector>
                                                                                              #include <string>
                                                                                              #include <iostream>
                                                                                              
                                                                                              int main() {
                                                                                                      std::vector<std::string> s;
                                                                                                      s.push_back("V is ");
                                                                                                      s.push_back("awesome");
                                                                                                      std::cout << s.size() << std::endl;
                                                                                                      return 0;
                                                                                              } 
                                                                                              

                                                                                              Run v translate test.cpp and V will generate test.v:

                                                                                              fn main {
                                                                                                      mut s := []string 
                                                                                              	s << 'V is '
                                                                                              	s << 'awesome'
                                                                                              	println(s.len) 
                                                                                              }
                                                                                              
                                                                                              1. 10

                                                                                                The combination of seemingly impossible claims with no source code, and not even an explanation of how those feats are accomplished, is concerning.

                                                                                                1. 2

                                                                                                  Why?

                                                                                                  1. 10

                                                                                                    This is just an unbelievably ambitious project. If it works the way you’re implying here, there are either lots of special cases and this won’t generalize to real codebases, or you have solved an unfathomable amount of hard dependent subproblems. I’m definitely willing to wait and see!

                                                                                                    1. 7

                                                                                                      In about two weeks I’ll post that Doom article with the resulting .v code. I’ll send you the link once it’s live ;)

                                                                                                      I spent most of December and January working on the translator.

                                                                                                      1. 7

                                                                                                        Most people doing this spent months to years to decades depending on how much they wanted to translate with or without human readability. I want C++ experts to weigh in on the translator when you post it. For me, that’s your biggest claim needing the most replication across code you thought of and didn’t wishing it never existed. Also, the biggest opportunity for improving major projects in terms of QA.

                                                                                                        1. 5

                                                                                                          You would would come across as more trustworthy if you acknowledged that the translator has limitations, and explained what those limitations are. What you are proposing to do instead is to only show a handpicked example that happens to avoid those limitations. Doom uses a restricted subset of C++, so you can translate it into V without dealing with most of the parts of C++ that make a C++ translator challenging.

                                                                                                          1. 4

                                                                                                            I will cover everything in the article.

                                                                                                            The end goal is to support the entire C++ standard.

                                                                                                            1. 2

                                                                                                              You’re likely to find that the last 10% of the standard requires 3x the effort.

                                                                                                              Nothing wrong in that, and I think getting to 100% is actually not worth the effort. There’s a lot of value in a translator that does 90% of the translation and makes the remaining 10% easy to identify. I’d market it like that until I’m sure the final 10% is done.

                                                                                                              1. 1

                                                                                                                Agreed, hopefully I’ll get some help from the community. V will be open sourced before the C++ translator is complete.

                                                                                                          2. 1

                                                                                                            You would would come across as more trustworthy if you acknowledged that the translator has limitations, and explained what those limitations are. What you are proposing to do instead is to only show a handpicked example that happens to avoid those limitations. Doom uses a restricted subset of C++, so you can translate it into V without dealing with most of the parts of C++ that make a C++ translator challenging.

                                                                                                    2. 4

                                                                                                      I don’t even know if it is garbage collected or requires manual allocation/deallocation

                                                                                                      Over here it says “No GC”, but can’t find any details other than that.

                                                                                                      1. 2

                                                                                                        The reference manual gives syntax for obtaining a pointer to a struct. But there is no mention of a pointer type, nor an explanation of what a pointer is or what you can do with pointers. Can you dynamically allocate a new object and get a pointer to it? If so, how does the object get freed?

                                                                                                      1. 3

                                                                                                        I wish every new language web site, instead of having a “hello world” example would state something like: “It’s like but with and without ”.

                                                                                                        1. 3

                                                                                                          They have a “detailed comparison”

                                                                                                          Why create V when there are already so many languages? Why not use Go, Rust, C++, Python etc?

                                                                                                          Detailed comparison of V and other languages.

                                                                                                          Clicking it though gives you “coming in March”

                                                                                                          1. 2

                                                                                                            I’ll post it today. In about 30 minutes.

                                                                                                            1. 4

                                                                                                              Did you ever post that detailed article about the C++ to V translator? If it handles legacy code, that could be your biggest achievement given how slow to compile and hard to analyze C++ is.

                                                                                                              1. 3

                                                                                                                In about 2 weeks. Not sure about all legacy. Boost for example was terrible, I gave up almost immediately for now. That’s why I’m working on Doom 3 right now, it’s written using much simpler C++.

                                                                                                                1. 3

                                                                                                                  I’d be happiest to see the sqlite to v translation.

                                                                                                                  Sqlite is probably one of the most used code bases on the planet.

                                                                                                                  1. 2

                                                                                                                    Yes, C is easy compared to C++. You’ll see it in 2 weeks.

                                                                                                              2. 2

                                                                                                                But it’s not March! :)

                                                                                                            2. 2

                                                                                                              What information do you think is missing from the landing page? I’ll add it.

                                                                                                              Right now I have 8 main features there, small FAQ, software built in V, and a link to the documentation that covers pretty much the entire language.

                                                                                                              1. 5

                                                                                                                Shapr said:

                                                                                                                “er, not available yet?

                                                                                                                I’d be more interested if I could read the source.”

                                                                                                                doug-moen said:

                                                                                                                “No GC, “safe”, and “fearless concurrency” (a feature of Rust) is a bold claim. How can this be done without the complexity of the Rust type system and borrow checker?”

                                                                                                                Descriptions on how the safety system works… esp combo of no GC, safe, and ultra-fast… along with the source to prove the description is true. Especially in a form with independent replication of claims being possible. You’re making some big claims that create excitement and skepticism. So, you should expect these reactions at a minimum. Ideally, many folks would love to test it out. If your description is true, it can already do amazing things worth an alpha release that warns of breaking changes maybe happening.

                                                                                                                1. 2

                                                                                                                  It says right in the very middle of the page that it will be open sourced this summer. It’s absolutely not ready for a release right now.

                                                                                                                  Fearless concurrency is achieved by making sure all variables used in different threads are locked. That’s not hard to implement.

                                                                                                                  Implementing easier Rust-like memory management is very hard. Right now it’s very basic, and I manage lots of memory manually when developing Volt. I still need to figure out lots of things, but I’m 100% confident I can do this.

                                                                                                                  1. 7

                                                                                                                    Fearless concurrency is achieved by making sure all variables used in different threads are locked. That’s not hard to implement.

                                                                                                                    Correctness in concurrency is not about locking single variables, but maintaining invariants between variables.

                                                                                                                    ie. If there exists a relationship between a and b that must always hold for correct execution eg. f( a, b) must always be true, then the accesses to a and b must be locked both by the reader and mutator.

                                                                                                                    Of course, as soon as you do this… you now open yourself up to deadlocks and priority inversions unless you’re careful….

                                                                                                                    Of course, you can just Stop The World…. in which case you no longer have concurrency…

                                                                                                                    1. 3

                                                                                                                      Interesting.

                                                                                                                      Could you please post a small example of this in Rust or any language you prefer?

                                                                                                                      Thanks!

                                                                                                                      1. 2

                                                                                                                        The thing to understand about schedulers is “unlock” whether it’s a mutex or whatever, means to the scheduler “reschedule now”. It may decide it doesn’t need to switch threads, but it will make the choice at that point.

                                                                                                                        Consider the classic bank account, the variable balance holds how much you have, and you’re not allowed to withdraw more than you have.

                                                                                                                        SImple.

                                                                                                                        if( balance >= withDrawalAmount) balance = balance - withDrawalAmount;

                                                                                                                        If you lock on each variable access it doesnt help you.

                                                                                                                        If you have two threads a race like this can still occur… Thread 1 Does if( balance >= withDrawalAmount) and then reschedules to Thread 2 which does if( balance >= withDrawalAmount)

                                                                                                                        The check succeeds for both Threads… Thread 2 continues and does… balance = balance - withDrawalAmount; ..taking all the money out of the account and reschedules back to thread 1 which does balance = balance - withDrawalAmount; rendering the account negative.

                                                                                                                        But every single variable access was locked!

                                                                                                                        You need to identify and lock across the whole transaction, not access to variables.

                                                                                                                        1. 1

                                                                                                                          OK I see, thanks.

                                                                                                                          In V you’d have to wrap the entire statement into lock{}:

                                                                                                                          lock { if balance >= withDrawalAmount { balance = balance - withDrawalAmount } }

                                                                                                                          But I understand your point. I don’t think Rust prevents you from making this locking error. It forces you to use locking, but you can still use it incorrectly like you described, right?

                                                                                                                          1. 2

                                                                                                                            Most “fearless concurrency” languages achieve this (more or less) by immutability.

                                                                                                                            The core problem in this example is we’re reading AND writing to balance from more than one thread.

                                                                                                                            If balance was immutable… no problem.

                                                                                                                            If balance was only accessible (for read and/or write) from one thread, also no problem.

                                                                                                                            Rust’s approach is basically that, the borrow checker forces only one thing to be holding at a time…. Which solves this simple class of race… but I bet a bad programmer could still do stupid in Rust by passing balance back and forth between threads with an exchange between the check and the update.

                                                                                                                            ie. Good language design can save you from simple threading issues. Nothing can save you when your code is insanely complexity and you have stupid humans writing it.

                                                                                                                            1. 2

                                                                                                                              Your V example has a gotcha…. what is it locking? ie. It will locking out all threads doing a lock even if they are not touching balance or withdrawal. ie. You won’t achieve good performance on highly parallelized tasks.

                                                                                                                              This is why things like pthreads have mutex’s that are associated with a particular resource.

                                                                                                                2. 1

                                                                                                                  I wish it had both. I like examples.

                                                                                                                  1. 2

                                                                                                                    Hi,

                                                                                                                    Developer here. There’s a large “Examples” link in the main menu :)

                                                                                                                    1. 2

                                                                                                                      The “hello world” ones in particular are by definition so simplistic that they hardly tell you anything about a language. A general shape of the syntax perhaps?

                                                                                                                      1. 4

                                                                                                                        They give a brief overview of the language and they provide something small enough that you can type it in and get results to confirm your toolchain is properly installed.

                                                                                                                        Plus, and most importantly, tradition. :)

                                                                                                                        1. 2

                                                                                                                          Yes, I can buy the tradition argument for sure :-)

                                                                                                                        2. 1

                                                                                                                          Yes, I like it for the syntax. I think the syntax is very relevant, especially if your language doesn’t differ a lot from other languages in other ways.

                                                                                                                    1. 2

                                                                                                                      It’s hard to track all these new languages. Zig and V both sound interesting. I’ll have to do some reading this weekend.

                                                                                                                      1. 13

                                                                                                                        I’ll tell you one difference about Zig. The source is released. All the claims on ziglang.org and in the documentation describe status quo, and all the links are valid and clickable.

                                                                                                                        1. 3

                                                                                                                          All links are clickable except for Playground and Blog. I launched the website a couple of days ago and have been filling it with content.

                                                                                                                          The source will be released this summer.

                                                                                                                        2. 5

                                                                                                                          Nim’s evolution is also very interesting. It’s a GC language, has a nice syntax, and falls into a similar “compiles to C” space as V.

                                                                                                                          https://nim-lang.org/features.html

                                                                                                                          1. 1

                                                                                                                            I’m sure I read on the website that V compiles to machine code. I was thinking of Nim otherwise.

                                                                                                                            1. 1

                                                                                                                              It claims to do both:

                                                                                                                              V emits C and uses GCC/Clang for optimized production builds. This way you get access to sophisticated optimization.

                                                                                                                              Such builds are compiled ≈150 times slower than V development builds (but are still faster than C++ builds).

                                                                                                                              1. 1

                                                                                                                                Yes, it does both.

                                                                                                                        1. 22

                                                                                                                          The marketing style of V and Volt.ws really bothers me. Both state features and achievements, but the links to those things point to nowhere! For example, V promises complete translation of C++ to V, with LevelDB, Doom, and Doom3 success stories, but those things link to # or javascript:alert(‘coming soon’). Same with the “Playground” link in the header. On the Volt.ws website, there were Windows and Linux download links that did the same “coming soon” stuff, although those now say “Coming February”.

                                                                                                                          This language remains vaporware until proven otherwise.

                                                                                                                          1. 10

                                                                                                                            Sorry, what’s vaporware? I have a working product built 100% in V: https://volt.ws

                                                                                                                            The playground will be live in about a week.

                                                                                                                            I literally released this site a couple of days ago and didn’t promote it anywhere :)

                                                                                                                            1. 8

                                                                                                                              From Google’s “define:vaporware”:

                                                                                                                              software […] that has been advertised but is not yet available […], either because it is only a concept or because it is still being written or designed.


                                                                                                                              Both V and Volt are very exciting projects, and I understand wanting to share them with the world in the way you conceptualize them and plan them. You set tight deadlines for yourself and seem to be working full-tilt, so these projects are very real to you. In your position, I’d be dying to publish about either as soon as possible.

                                                                                                                              But consider my experience as a prospective user and supporter: each time I’ve clicked through to either Volt or V, I’ve been excited by the text on the page, but unable to follow any of the links I click!

                                                                                                                              • When Volt was still called Eul, I downloaded it but it crashed at launch. No fault there, super-alpha software. I’ll try again later.
                                                                                                                              • The next time I saw Eul on HN, another user pointed out it was downloading 100MB+ of browser on first run. You promised a rewrite would fix this issue, so I held off. Again, no judgement from me on an implementation side, but the marketing seemed a tiny bit questionable.
                                                                                                                              • After the name change to Volt, I was excited to try it again. I had read the page about the new language and been impressed by the live reload demo. Then I click the download link for my platform, but nothing happens - just a link to #. Frustrating.
                                                                                                                              • Now V has its own site, Reddit, Slack, etc, and I’m still seeing the same pattern of flashy claims with little to back them up.

                                                                                                                              I’m very excited for your project’s goals, and I’ve been following for years, but I’d much prefer you to “under-promise and over-deliver” than the other way around.

                                                                                                                            2. 7

                                                                                                                              V promises complete translation of C++ to V

                                                                                                                              I submitted the ZL links to get people interested in something that might be able to convert C++ to C or other languages easier than usual. It still seemed hard if covering old and new projects. Edison Group stays in business doing that for everyone for a reason. I was wondering how I’d even start. Maybe 80/20 rule where certain features get used way more than others. Can focus on them. I’ve read C++ programmers talking about all kinds of crazy stuff people do with the language, though. Formal semantics are in infancy or just really weak, too.

                                                                                                                              So, the author said they could convert big, legacy programs in C++ to V. Such an achievement makes me go “Hell yeah!” and “WTF!?” at the same time. What I did note is Doom and SQLite were written by skilled coders who put a lot of effort into things like style and testing. They might even use less of the language for performance and maintainability. My first question was whether those projects were chosen because they’d be easier to convert than random C++ projects. Vendors of lots of tools pick stuff with low likelihood of failure to highlight how it will succeed in unrelated cases. I want to see this conversion tool applied to both average and horrid codebases in C++ to really test it.

                                                                                                                              And then Nginx since it’s (a) Net-critical, (b) something many of us want to see ported to a safe, system language, and (c) massive. I don’t know if it has good, average, or bad code. Converting something like that would be a big-time result. Especially if people picked up the new language to improve the fork at a faster rate. That’s what you really want with ports to something like D, Zig or V.

                                                                                                                              1. 6

                                                                                                                                My first question was whether those projects were chosen because they’d be easier to convert than random C++ projects

                                                                                                                                You are correct. It’s better to start with easier projects. I tried to translate a project with much worse code quality and Boost dependency (VCMI, open source HoMM 3), and it was ugly.

                                                                                                                            1. 4

                                                                                                                              I’m a Rust programmer, and I’m interested to see where V goes: it addresses some of the concerns I have about Rust (long compilation time, complexity). But I’ve also said that, though it seems that V gets the big picture right, the devil will be in the details. For instance, how will memory—and other resources—be managed in V? An early document says that V has a system similar to Rust, but simpler. I would like to see what simplifications have been made. Another question: how does V do concurrent and parallel programming? A great thing about Rust IMO is that the same system that protects you from memory errors also protects you from data races in concurrent programs. There’s something satisfying and reassuring about an abstraction that has a lot of breadth. Does V have that?

                                                                                                                              Until it’s released and we can play with it, I’ll hold off judgement on V.

                                                                                                                              1. 1

                                                                                                                                I agree, memory management is the most important topic, but I haven’t fully figured it out yet. This will be a top priority this month.

                                                                                                                                Right now V forces you to lock mutable variables accessed in different threads like in this example:

                                                                                                                                https://github.com/vlang-io/V/blob/master/examples/concurrent_news_fetcher.v

                                                                                                                                1. 2

                                                                                                                                  Since you’re using locks, Ill try to submit some papers on both automatically doing that and concurrency models. Did one today.

                                                                                                                              1. 3

                                                                                                                                I spun up Volt on my computer and it spawned more than 20 different processes that refused to go away. It seemed to be accessing the network, though I have no idea what it’s for. Not sure how legit this is, but either way, terrible first impression. I look forward to the source coming out though, as this seems like a very ambitious project; we could all learn a lot from it if it truly delivers on its promises. The challenges it’s tackling are large and complex, and any attempt to elucidate them is a step in the right direction.

                                                                                                                                1. 4

                                                                                                                                  Sorry, I can see this in my crash logs. It’s an infinite crash loop, it’s never supposed to happen, I’m really surprised it did.

                                                                                                                                  I’ll fix this asap.

                                                                                                                                  1. 2

                                                                                                                                    Good to know! It looks very promising otherwise. Not sure why it would spawn a whole bunch of processes that aren’t descendants of the one that was launched though, that doesn’t seem very safe. Is the code to manage processes still new?

                                                                                                                                    Also, are you saying that you reproduced this crash yourself, or that you were sent a crash log automatically?

                                                                                                                                    1. 1

                                                                                                                                      Crash logs are sent to the server automatically.

                                                                                                                                      It detects a crash and reopens the app. The only way to do that on macOS is with open -n.

                                                                                                                                      Then it crashes right away again. There’s code that detects that and handles it. Not in your case. You’re in 0.1% :)