11 ms·
The V language now compiles itself in 0.09 seconds
- delian66 7y agoAmazing ... That would make https://www.xkcd.com/303/ https://www.xkcd.com/303/ obsolete ;-) !
- amedvednikov 7y agoYeah, as someone noted, it'll soon be possible to re-compile V in every frame of a video game :)
- sdan 7y agoIt's already obsolete for people who do ML work. I remember having to wait days or even weeks for something to train while I either sit back and relax or work on the next thing to train.
- delian66 7y agoAnd now you do not have to wait more than a few seconds, while you train them?
- deleted 7y ago[deleted]
- NiekvdMaas 7y agoV is a pretty interesting language. I've been playing with it for the last few months, it takes a lot of the good stuff from Go with saner syntax and defaults. And compilation speed is amazing. The big missing item so far is GC (memory management is manual). Another thing is that the language evolves constantly, so you keep having to change your own code every week or so to stay valid.
- amedvednikov 7y agoIndeed, the language changes very quickly. Things will stabilize by 0.2. The memory model is going to be similar to Rust. No GC or manual management. I'm actually working on it right now. Should have done it sooner, but it took me lots of time to do the research and chose the right model.
- Numberwang 7y agoYou need to stop making up deadlines for yourself when things will be ready. Similarly with your IM people lose confidence in you if you are not delivering what you say you will. Just say you are working towards something until it is ready, to avoid this. Good luck in the future. You clearly have a lot going for you.
- Yoric 7y agoI'm very curious about this. Getting the Rust compiler to handle memory correctly took years one complete refactoring of the type system, and a number of less major changes before Rust reached version 1.0. Even after that, the borrowing system has regularly been refined to become gradually more intuitive and more powerful. Do you have precise plans for this feature? If they're written somewhere, I'm quite interested :)
- delian66 7y agoPioneering is nearly always harder, and takes more time than later developments.
- banachtarski 7y ago> The big missing item so far is GC (memory management is manual). It really isn't. That's the one thing that would make me immediately lose interest in the language. Are there not enough options out there for non-realtime critical code?
- amedvednikov 7y agoThere will be no GC, see my reply above.
- a1pulley 7y agoPleased to read that hot reloading is a central feature!
- amedvednikov 7y agoYes, really excited about it. Hot reloading UI: https://cdn.discordapp.com/attachments/592118040179507207/632545652596801537/live_vig3-2019-10-12_13.46.00.gif https://cdn.discordapp.com/attachments/592118040179507207/63... Hot reloading a graphical application: https://twitter.com/i/status/1153363259715702784 https://twitter.com/i/status/1153363259715702784
- delian66 7y agoWow, on my old i3: 0[08:48:16] /v/v $ time ./v v.v real 0m0.219s user 0m0.153s sys 0m0.064s 0[08:48:25] /v/v $ I guess it is high time to upgrade my machine...
- curuinor 7y agoHow many of Dodrill's problems have they solved so far? https://christine.website/blog/v-vaporware-2019-06-23 https://christine.website/blog/v-vaporware-2019-06-23
- kstenerud 7y agoWow... talk about a mean-spirited article!
- curuinor 7y agoos.system2('curl -s -L -o "$out" "$url"') is not an acceptable thing to do.
- amedvednikov 7y agoWhich was fixed almost right away. In fact there's no libcurl dependency at all right now. OpenSSL/SChannel are used directly. Nitpicking one liners like that from a huge one man project that has just been released is ridiculous. Luckily the language continues to grow at a rapid pace despite all clickbait vaporware articles.
- dmix 7y agoPeople love tearing down other people and their things on the internet. I never understood that mentality without having some personal connection to the topic or a deep understanding of the topic. I see the [wip] progress labels all over the site now, I guess some people need it to be explicitly labeled before the give a full break down of what you've made!
- amedvednikov 7y ago> People love tearing down other people and their things on the internet. Indeed. These [wip] labels were there before this vaporware article :)
- skrebbel 7y agoV seems pretty similar to Zig in that it tries to compete directly with C. Has anyone here used both? Which do you prefer and why?
- rishav_sharan 7y agoLast time when V was presented in HN, it got completely ripped apart by most posters. This was probably due to the many empty promises by the creator which V simply wasn't able to deliver on. There were also hard criticisms posted by creators of other languages like Zig, wren etc. I want to know from V's critic, where do they feel the language is right now, now that it has had some more months behind it? Do you still feel that its a lot of snake oil or do you think it is going along a good path? Not trying to push an agenda but I am genuinely curious because I have never seen such definitive opinions against a language before in HN. I am yet to use V (waiting for the Doom demo which would be the proof of the pudding for me), but i do check its chat and github every now and then; and things seem to be going along much better now. lots of contributions, better project management and timely fixes. Here are some of the older threads on V; https://news.ycombinator.com/item?id=19403271 https://news.ycombinator.com/item?id=19403271 https://news.ycombinator.com/item?id=20250990 https://news.ycombinator.com/item?id=20250990 https://news.ycombinator.com/item?id=20229632 https://news.ycombinator.com/item?id=20229632
- amedvednikov 7y agoSoon I'll actually make a post covering all these "vaporware"/scam posts and articles. Zig's author's criticism is hard to respond to, since he claims things like "the V compiler has freetype and glfw dependencies", which is absurd: https://news.ycombinator.com/item?id=20230351 https://news.ycombinator.com/item?id=20230351 Also he claimed there was no REPL, cross compiling or hot code reloading, when all these things were there: https://twitter.com/i/status/1137537130887077890 https://twitter.com/i/status/1137537130887077890 https://twitter.com/i/status/1153363259715702784 https://twitter.com/i/status/1153363259715702784
- kdmccormick 7y agoTBH the main criticism seems not to be of the language itself, which seems like a cool and worthwhile project, but of its "marketing". Clickbaity rhetoric like "V Language Released" with no source code and many missing features, and now "compiles itself in stunning 0.09 seconds" without a rigorous dataset or accompanying list of features that said compiler supports are likely the source of the backlash. My outsider advice, as someone who has never made a language (so, props to you for that) is to lower the hype level, and instead focus on posting news like deep-dives into design decisions and implementation stories, which people in the PL community are more likely to appreciate.
- verroq 7y agoThat Go code on this page [0] isn't particularly idomatic (or even functional), consider something like this [1] perhaps. [0] https://vlang.io/compare https://vlang.io/compare [1] https://pastebin.com/raw/FsjAQvGt https://pastebin.com/raw/FsjAQvGt
- alecthomas 7y agoAgreed, that is much more idiomatic.
- Thorrez 7y agoThat return err from the goroutine looks wrong, I don't think the error is ever used. log.Fatalln(err) would keep the behavior of the V code.
- verroq 7y agoIt'd just cause a panic and stop that particular goroutine. To properly handle it, it needs to be passed back into a results channel or something. Generally we don't intentionally cause panics in go code as a matter of style. You can insert a `defer log.Println(err)` if you want to handle that particular error but I didn't bother.
- Thorrez 7y agolog.Fatalln() does an os.Exit(1), it doesn't just cause that particular goroutine to stop[1]. log.Panicln() will also cause the entire program to exit unless there's a recover[2]. log.Println(err) would be better than returning err, because returning err makes people wrongly think the error is being handled somewhere, when in reality nothing is looking at the return value. Using defer for that seems a bit strange though. [1] https://play.golang.org/p/wwiq1bYjwVH https://play.golang.org/p/wwiq1bYjwVH [2] https://play.golang.org/p/MpzafFlBSfx https://play.golang.org/p/MpzafFlBSfx
- Jahak 7y agoMany features were stolen from Golang
- erk__ 7y agoWhat features are you thinking off? At least for me golang is a pretty boring language in the sense it does not bring much new design.
- kstenerud 7y agoGolang got many things right (and many things wrong). Why wouldn't you make use of the parts that work? That makes no sense.
- raphman 7y agoIn the context of programming language design, "stealing" sounds like the wrong term. Every programming language is inspired by others, isn't it?
- rvz 7y agoYou might as well say that "C++ stole from C" or "Linux stole all ideas from *NIX" which is nonsense. I would say V was influenced by Golang.
- BubRoss 7y agoMany words in your comment were stolen from the dictionary.
- teggot 7y agoLike a contributor I can say that @amedvednikov make a big effort to make such compilation speed possible. Also I can say that language is still easy to learn while having so many features.
- amedvednikov 7y agoWell I wouldn't say the language itself has many features. Its goal is to be minimalistic, simple, readable, maintainable.
- rustemb 7y agoWow! Amazing!!!
- jokoon 7y agoHow can I use V as a scripting language? I managed to use TinyCC as a scripting language but V seems to make more sense. I'm also interesting in C++ interop... This language looks pretty great. Simple, fast, nicer and lean syntax. I'm still curious why I often see "name string" intead of "string name". I guess it's easier to parse? pythonic indent would make this language perfect.
- nedp 7y agoScripting is one of V's main features[0]. Just a couple days ago, it was incorporated into the 'master' branch[1] so you can now use it. 0 - https://vlang.io/docs#bash https://vlang.io/docs#bash 1 - https://github.com/vlang/v/commit/5cd38ec91bc1919aca9f63432e38aad27233d6f8 https://github.com/vlang/v/commit/5cd38ec91bc1919aca9f63432e...
- jokoon 7y agoI meant compiling and executing V from C++, calling V functions from C++, and C++ function from V.
- delian66 7y agoV produces .c files, which are then compiled to .o files, like C. Interfacing v code into a C++ app, is like interfacing with any other C library, with the addition, that you may have to write the C headers yourself (or you can cut/paste them from the produced C file). If you want to call a C++ function from V, you have to export it from the C++ side, like you would do for a C app: extern "C" { int your_function(int x) } ... and then call it from the V side like any other C function. (https://vlang.io/docs#calling_c https://vlang.io/docs#calling_c)
- chousuke 7y agoI think I might have to try v for scripting. I've been wanting a non-dynamic language for that purpose, and v having few dependencies and fast compile times might actually make it usable for that purpose.
- tsegratis 7y agoCongratulations! On reading the docs, I wonder if immutable variables and const globals can be merged as a concept? I realize the consts can be fun complex 'structs', and have features that maybe immutable variables can't? -- No mutable globals is good. But still, is there a deeper reason to not merge const/immutable
- chaz6 7y agoV looks like a promising language. You know you have made it when there is an "awesome v" page on github. One question, why is the original `v` much smaller than the `v` compiles using itself? $ size v text data bss dec hex filename 445817 1032 688 447537 6d431 v $ ./v -o v2 v.v && size v2 text data bss dec hex filename 651086 51000 1000 703086 aba6e v2
- 0-_-0 7y agoMaybe it's UPX compressed?
- amedvednikov 7y agoIt's built with GCC and -O2.
- isawczuk 7y agoCan I use live reload on functions that use imported c libs?
- raphman 7y agoHmm, this gif (linked elsewhere in the thread) seems to indicate that C libs can be used in `live` code. https://cdn.discordapp.com/attachments/592118040179507207/632545652596801537/live_vig3-2019-10-12_13.46.00.gif https://cdn.discordapp.com/attachments/592118040179507207/63...