15 ms·
V Programming Language
- gigatexal 8y agoThis sounds like the best thing since sliced bread language.
- choeger 8y agoCome on guys. I get it that everyone and their cat invent new languages nowadays. And that is a cool thing, do not get me wrong. But as a professional in that field, is it too much to ask to give just a little overview over the /interesting/ parts of the language? What is its type discipline? What data structures are supported? What is the execution/evaluation strategy? How about concurrency? Coroutines? Macros? Modules? The language design space has been mapped thoroughly in the last decades. Is it so hard to give a tiny X on that map?
- andolanra 8y agoThe Comparison page is pretty illustrative here: this language appears to be an effort to build up a lower-level-ish Go (e.g. no runtime, no GC) with some extra features (e.g. nullable types, generics) and some extra safety properties (e.g. no global state, immutable-data-by-default.) c.f. https://vlang.io/compare https://vlang.io/compare
- amedvednikov 8y agoThe docs cover most of these: https://vlang.io/docs https://vlang.io/docs Also https://vlang.io/compare https://vlang.io/compare https://vlang.io/compilation_speed https://vlang.io/compilation_speed
- fouc 8y agoHas it actually been mapped thoroughly? Is there actually a common language/terminology across Ruby, Python, Lisp, Javascript, Go, C++, etc? I've noticed that terms & definitions subtly or not-so-subtly vary from programming language to programming language, so I imagine it's pretty tricky to come to any sort of consensus.
- sfilargi 8y agos := []string s << 'V is ' s << 'awesome' The 90s called, they want their syntax back.
- deleted 8y ago[deleted]
- deleted 8y ago[deleted]
- revskill 8y agoHow to download the compiler ?
- amedvednikov 8y agoIt'll be available in June. Online playground in 2 days.
- NikkiA 8y agoYou can't. "Open source release in June 2019." At this point it's just vaporware tease.
- adamnemecek 8y agoI don’t think it is.
- sonnyblarney 8y agoWell cheers to someone making a compiled language that is like a simplified C/C++. Rust is great but it's a paradigm shift, and Go is great but it (edit here:) has a runtime which we don't have implicit control over. This is a promising C-ish language without the cruft and easy foot-shot triggers. Can't wait for the rules regarding packages/modules, how they are distributed, the clean and simple build systems, documentation constructs, and clean integration into VSCode ... and of course all of the key/default libraries we need to be productive. Good start folks, looking forward to the next rev.
- sesteel 8y agoOut of curiosity, what makes you think Go is not compiled?
- sonnyblarney 8y agoIt's my fault. Go is compiled, of course, but it has a 'not yet very well optimized' runtime which I don't immediately associate with compiled languages. I should have been more clear. My bad.
- sesteel 8y agoNo worries, I was just curious if you read that somewhere.
- Scaevolus 8y agoWhat about Go's runtime do you find not very well optimized?
- petre 8y agoHave you even used it? According to my tests Go is quite well optimized. It beats most languages at prime number crunching/array push/map set.
- coldtea 8y agoAnytime I did any text work with it it was awful (including JSON etc).
- reggieband 8y agoI know it is "yet another language" but I at least like the examples I saw. Very golang inspired obviously (even has the go keyword) but with some niceties (e.g optionals). Maybe when I get around to writing my Z language I'll use this as a basis.
- sctb 8y agoRecent discussion: https://news.ycombinator.com/item?id=19086712 https://news.ycombinator.com/item?id=19086712.
- amedvednikov 8y agoHey Last time it was posted, it was a small page with some basic information about the language. Now there's documentation, examples, comparisons, and lots of extra details. I guess that's why people started discussing it and posting on different platforms. I know about the no dups rule, just thought it would be interesting for people to discuss.
- sctb 8y agoOK! We've un-duped it.
- amedvednikov 8y agoThanks :) Moved from #7 to #74 for some reason.
- sctb 8y agoIt tripped the overheated discussion detector, which we've just turned off.
- AnimalMuppet 8y agoGood thing - V looks hot. Right, I'll show myself out...
- root670 8y ago>> C/C++ translation This is huge.
- kyberias 8y agoIt's vaporware.
- amedvednikov 8y agoIt is. I'm super excited about it. I'm wrapping up an article on translating Doom 1 to V. It will include generated .v code.
- mhh__ 8y agoC maybe, but translating from (or even to) C++ is a genuinely company-sized effort.
- UncleEntity 8y agoYeah, I'm kind of wondering if it does template instantiation or the C++ it reads is basically C with class methods?
- hestefisk 8y agoI think this looks extremely promising. Out of curiosity, is there any support for lambdas / functional programming? Can I pass a function as a reference?
- amedvednikov 8y agoI haven't figured what I want to do with this yet. Most like something like `users.filter(_.name.starts_with('A'))`
- hestefisk 8y agoClosures?
- isacikgoz 8y agoThe 400K compiler is interesting. But, does it help to solve any of my problems today? I would like to hear more about the reason of its development.
- kyberias 8y agoWhat does [dupe] mean?
- snowAbstraction 8y agoI think the intention is to mark this story as a duplicate of https://news.ycombinator.com/item?id=19086712 https://news.ycombinator.com/item?id=19086712.
- wronex 8y agoI'm curious. Why the short names such as .len instead of .length? Also, ui.WindowCfg instead of ui.WindowConfig? I think this would make we hesitate all the time. Was it .new_textbox or .new_txtbox? Short keywords are one thing (Lua's local and function are no fun) but abbreviated library functions and types are another.
- snowAbstraction 8y agoFor me I guess, it depends how many such abbreviations one must learn. 100 fine. 1000 too many for me.
- lapnitnelav 8y agoAgreed, predictability is huge. I think our systems can handle an extra few characters :)
- deleted 8y ago[deleted]
- jxy 8y agoWhy is this such a big deal? Is there really so much difference among ui.WindowCfg, ui.WindowConfig, and ui.WindowConfiguration? As long as everything is consistently named within a framework/language, I don't see any problem.
- krainboltgreene 8y agoYes. The latter are words, cfg is not a word. Words are easy to google, say, pronounce. "shortenings" are up to interpretation, have no translation.
- jxy 8y agohttps://www.merriam-webster.com/dictionary/config https://www.merriam-webster.com/dictionary/config > “config” > The word you've entered isn't in the dictionary. Click on a spelling suggestion below or try again using the search bar above.
- andr 8y agoI love looking at new languages. People invent really creative stuff. However, my exploration usually ends with "this is great, but there are no libraries for it, so I probably won't use it". If you are building a language, starting from scratch is the epitome of Not Invented Here syndrome. Build it on top of an existing ecosystem. Look at Elixir and how it builds on Erlang and interoperates with it just perfectly. Or look Groovy, Scala and Clojure to see what kind of range you can get from a single platform. With the exception of Go, every language that has become popular in the past 10 years, built on something else.
- tombert 8y agoThis compiles to C, which (I think) means it should be able to FFI to it fairly easily?
- amedvednikov 8y agoYes, calling C functions is as simple as C.puts('hello world')
- tombert 8y agoAh, cool, so effectively the standard library is huge :). Question though; I'm assuming that if you're touching C, there's no extra protection added by V, right? The C will be just as unsafe as it was before, or do you add some kind of exception handling thing around it?
- megous 8y agoWhere did you get an idea that the language has exceptions? Looks like they just have a way to return errors if you use question mark at the end of function declaration. See "Option types" here https://vlang.io/docs https://vlang.io/docs
- tombert 8y agoSorry, that's kind of what I meant, though I realize I made a mistake in how I said it.
- snowAbstraction 8y agoWhy not leverage LLVM for doing stuff with SIMD? Will the output to readable C always be available in the future?
- amedvednikov 8y ago> Will the output to readable C always be available in the future? Yes
- theredbox 8y agoI dont believe this is real. Sorry but maybe someone can decompile the volt app to see if this is any legit. I mean if you are releasing such vaporware you should at least do it anonymously not openly like you do.
- snowAbstraction 8y agoWe'll see but anyhow it seems that some people like the language's features. Pony exists so why not this? https://www.ponylang.io/ https://www.ponylang.io/
- rubiquity 8y agoCan you explain the connection you're trying to draw between Pony, a language used in production, and this one? I don't want your comment to be misinterpreted.
- snowAbstraction 8y agoSorry I wasn't clear and the connection is not clear. The connection is only that Pony is as far I know a less common language that implements a unique set of somewhat similar features so it should be feasible for V to be built. I was thinking that not only can Google create Go or Mozilla create Rust but smaller groups or maybe an individual can create an useful programming language. Writing this caused me to look at [1] to see if I was completely off. I do see some similarities but also a big difference, at this point of time, in terms of Pony's greater professionalism and claim's to rigour. [1] https://www.ponylang.io/discover/#what-is-pony https://www.ponylang.io/discover/#what-is-pony
- coldtea 8y agoThe connection being that coming from the fringes/nowhere (e.g. no Google or MS etc), without much support, and building a language with a comparable feature set is not exactly impossible...
- sdinsn 8y agoPony actually exists, while this doesn't. Not sure what you are trying to say.
- sesteel 8y agoIf it works as advertised, it looks to be a boon. I hope we can commit to a full security audit of the compiler, runtime, and std libs. My trust is lacking lately.
- coldtea 8y agoGithub of compiler (not examples) or it didn't happen.
- audunw 8y agoLooks very similar to Zig in terms of goals. I'm rooting for both, but it seems that Zig is ahead in terms of community. Would V have any benefits over Zig? I think a "better C" is the biggest hole in the programming language world today. Rust doesn't do it to me, because what makes C great is that it's so simple, and easy to write a compiler for. Rust is a different class.
- Y_Y 8y agoWalter Bright will probably show up in a minute and tell you D is a better C. He's probably right too. But being the best isn't why people pick C these days. I also object to the idea that it's easy to write a C compiler. A toy compiler might be easy, but a good one takes UINT_MAX man-hours at least.
- billforsternz 8y ago> a good one takes UINT_MAX man-hours at least. I think Walter could legitimately claim this is only true if your int size is 11 bits (so about one man-year) or thereabouts.
- vips7L 8y agoFrom what I've seen D looks like an amazing language. I've been particularly interested in the -betterC flag.
- audunw 8y agoD is not simple and by default it relies on a garbage collector. And yes, I meant it's easy to write a simple/"toy"-compiler. TCC is a good example, and I've actually used it for a real in-house project. Not every application requires perfect compatability and good optimization, and it makes it easy to get started on more elaborate compilers.
- amedvednikov 8y agoYes, the goals are similar. I will add a detailed comparison to https://vlang.io/compare https://vlang.io/compare Off the top of my head: simplicity, strings, no globals, easier allocations, automatic memory management, no LLVM dependency, hot reloading, faster compilation times: https://vlang.io/compilation_time https://vlang.io/compilation_time
- plainOldText 8y agoCreating and evolving programming languages is a difficult task. It also takes considerable time to write a decent set of libraries and iron out most of the wrinkles before it can be used in production. As more people move into programming, we're bound to see more languages on the horizon. I wonder what the most popular languages will be, say, 10 years from now? I'm personally looking forward seeing one language reach maturity – Pony – https://www.ponylang.io/ https://www.ponylang.io/ It seems that it brings some novel concepts to the table, one being the combo: statically compiled + actor model + high performance + capabilities secure.
- jb3689 8y agoPony's memory sharing model used with Actors is really interesting. When I was writing in Elixir the overhead of deep cloning any message (or almost any - I realize large binaries are an exception) between actors seemed like a big limitation. I think Pony offers an interesting solution I remember coming across some big systematic gotcha with Pony when I was learning though. It's been a year or two since I've even thought about it though and my brain is foggy. I think it'll take more adoption of both Erlang/Elixir and Rust for people to really see the benefits of what Pony offers. It's a really ambitious language for sure
- plainOldText 8y agoAlthough it comes at the expense of better performance, not having shared memory between actors in Erlang was a deliberate decision, as it offers a few advantages over the shared model: * More robust failure recovery, as actors can be restarted truly independently in case of faults * Better distribution out of the box as actors on different machines can't share memory anyway On the other hand, Pony does promise to catch certain types of errors at compile time, but this is hardly foolproof, as long running programs will still encounter hardware and runtime errors. But since these classes of errors are less common, one can choose to live with them. Ultimately, one must learn to compromise one way or another. For now, I'm happy I can extend Elixir via Rust.
- ouki 8y agoWhich license will be chosen when it will be open sourced?
- amedvednikov 8y agoNot sure yet. I'm considering GPLv3 with the linking exception.
- sansnomme 8y agoApache/MIT would be more sustainable as it will be easier to get companies to donate money and use the technology.
- AsyncAwait 8y agoIt would certainly be easier for companies to take it and not give anything back, that's for sure.
- thefounder 8y agoLooks very similar to Go(which is a good thing) but to catch up it needs a great std lib and great tools like Go has. I wish it would keep the upper-case/lower-case convention as well for private/public identifiers
- muricula 8y agoThe authors talk a lot about how fast the compiler is. It doesn't matter if the compiler is fast if the generated code is slow.
- stabbles 8y agoDebug builds in C++ can be slow AND generate slow code.
- dan-robertson 8y agoImagine the simplest “compiler” for python or perl or JavaScript that doesn’t compile anything but just interprets it. There’s a lot of advantages to not having to wait for compilation. One can write a large and useful program with reasonable speed ups just from stupid compilation as many programs don’t need to be particularly fast. One can imagine modifying the compiler to output llvm bitcode. You now can throw plenty of optimisation at it for free (but you are now slower to compile). This may be useful for prod but I claim a lot of the time it’s still useful for dev to have a simple very very fast compiler. Think less about the time to build one file and more of the time to rebuild your entire tree (or just a file which many things depend on)
- amedvednikov 8y agoLike the website says, if you need performance, you do production builds, which use GCC/Clang with -O2. In the future V will have its own optimiser.
- dboreham 8y agoFor lizard people.
- sdinsn 8y agoV for vaporware?
- orbital223 8y agoComparing the compilation speed of a non-optimizing compiler against optimizing compilers is very dishonest.
- stabbles 8y agoI repeated the experiment with 200 000 lines of code, where each line contains an assigment (just a constant) followed by a print statement (printf / std::cout). Results on my Macbook Air are similar: $ time g++ cpp.cpp real 2m28,454s $ time gcc c.c real 0m7,112s Compilers are indeed really slow.
- amedvednikov 8y agohttps://vlang.io/compilation_speed https://vlang.io/compilation_speed None of the compilers are optimizing.
- FrankDixon 8y agoI‘m not sure this will ever reach the light of day. It follows the same patterns as Eul did, another creation if the same inventor: - plenty of empty links on the website that lead to something ‚coming in march/april/june/...‘ - lots of nice ideas, but nothing to show for it I wish the creator all the best, but Eul promised a lot, long long ago, and never delivered
- mattbreeden 8y agohttps://volt-app.com/ https://volt-app.com/ it's currently released in beta for mac and windows
- bartl 8y agoI can't help but wonder why Volt on Mac is 300kB and on Windows it's 2.1MB.
- amedvednikov 8y agoIt explains it if you click it :) Temporary libcurl dependency
- Scarbutt 8y agoWho/what is Eul?
- c8g 8y agohttps://web.archive.org/web/20180403082331/https://eul.im/ https://web.archive.org/web/20180403082331/https://eul.im/ previous version of volt
- mises 8y agoI'm pretty sure this is supposed to be the continuation of eul. And having used the windows beta, it looks pretty impressive.
- openbasic 8y agoCurious about the GUI parts: Is it talking to X11 directly? What about widgets? Cairo, Skia?
- ouki 8y agoFrom "Simple GUI app" example - "import ui // Native cross platform ui toolkit (uses Cocoa, win32, GTK+)".
- amedvednikov 8y agoIndeed it uses Cocoa/Win32/GTK+, and if you need drawing, there's a small library called gg. It used OpenGL, but in the future will also support DirectX and Metal backends.
- openbasic 8y agoGTK is super slow. Do you have any intentions of using raw X11 or Wayland?
- jhawk28 8y agoIt looks like a nice little language. It looks like Go influenced the syntax (in a good way). Based on the "concurrent" example, can we assume that it does coroutines instead of green threads? Have you tried converting the C impl of the Computer Language Benchmarks Game to compare runtime performance against other languages?
- miki123211 8y agowell, I don't know why this doesn't have more upvotes. It deserves them. This is literally the first time I've fallen in love with a programming language. It does all the things I'd want it to. Has all the positives of go without most of the shortcomings, is minimal and understandable, disallows 10.days.ago style magic without being overly limiting, compiles fast and makes small apps, something I really want in the age of bundling Chromium and Node with every hello world, and has a native GUI, so huge potential for accessibility. The only thing unnerving me is that Volt, the only publicly available app written in V, doesn't seem to be accessible which might indicate the GUI is not native after all.
- amedvednikov 8y agoThanks. Glad you like it. Volt uses native UI, but the text content is drawn for performance. It will be made accessible soon.
- dagmx 8y agoHow can you fall in love with something you've only seen described to you in platitudes?
- zephyrfalcon 8y agoThere used to be a stack-based language called V as well... https://code.google.com/archive/p/v-language/ https://code.google.com/archive/p/v-language/
- bvinc 8y agoThis seems pretty amazing. I'm really curious how it manages to avoid data races. It doesn't seem to mention anything complicated like rust lifetimes. Also, what happens when unsafe C++ is converted to v, for example, code with iterator invalidation? There are so many unanswered questions.
- purplezooey 8y agoIf you are a V programmer do you have to go around at night and spray paint V on garbage cans?
- amedvednikov 8y agoNot required, but recommended :)
- squarefoot 8y agoInteresting! Any chances to see an ARM port in the future?
- amedvednikov 8y agoYes! But of course you can already compile for ARM by emitting C.
- atombender 8y agoMy friendly advice for the author of this project: Release the code on Github. Just release anything, even if it's not finished. Make the code work first, then build a slick website where you brag about its features and benchmarks. Creating the website first, before there's even anything to try out, is disingeous at best, and at worst it's leaching productivity away from time better spent programming. I remember how, as a junior developer, it was a lot more fun talking about how great my project was going to be, than doing the actual, hard work. But it does take hard work to bring something to completion. You're doing the exact same thing with your chat app, Volt. You spent years talking about how great it was going to be. You promised features and release dates, then changed the release dates once you weren't able to deliver. Your current alpha release barely works and barely has any of the features. You clearly need some helping hands to implement all the features you've been promising over the years. I'm sure there are lots of developers here who would love to hack on a new programming language or a chat app.