25 ms·
About V, the language Volt is written in
- AndyKelley 8y agoFound this from the Slack thread: https://news.ycombinator.com/item?id=19081896 https://news.ycombinator.com/item?id=19081896 Is this language going to be open-source? It seems incredibly impressive, and 100% overlapping with what I'm trying to do with Zig.
- ar_lan 8y agoFrom https://volt.ws/lang https://volt.ws/lang: > V compiler is written in V. The language will be open-sourced later in 2019.
- mmcclure 8y agoI think /lang may be out of date from the home page. Here's what's on the index: > Is Volt open-source? > Not at the moment. Due to several reasons, right now the development model is similar to that of Sublime Text. The app is going to be open-sourced in 2021, so you don't have to worry about it being abandoned. Edit: Just in case people miss the responses, my apologies, this quote may be referring to Volt the app, not the language (V).
- eslaught 8y agoIt's at least plausible they could open source the language without open sourcing the app at the same time. So they're not necessarily in contradiction.
- amedvednikov 8y agoCorrect, the language will be open sourced this year.
- swalladge 8y agoThat refers to the Volt app, not the V language. According to the website, the V language will be open sourced in 2019, and Volt (the app) will be open sourced in 2021.
- mmcclure 8y agoAhh great point, totally overlooked that.
- dom96 8y agoVery interesting. What I'm curious about is how this language is compiled, the implication seems to be that it gets translated to C/C++ which seems to overlap a lot with what we are doing with Nim :)
- strmpnk 8y agoIt seems to be an option to compile to C for platform support, but the page also says: > V is compiled directly to x86_64 machine code (ARM support is coming later) with no overhead, so the performance is on par with C. Which is interesting. There is a lot more information required still but direct may also imply that it's doing the actual instruction scheduling too rather than relying on LLVM. I'm looking forward to hearing more.
- amedvednikov 8y agoLLVM is not used.
- amedvednikov 8y agoOriginally it was compiled to C, now there's also an option to generate machine code directly which improved compilation time by a factor of 10.
- calebwin 8y agoWould you mind explaining why compiling to machine code was faster than to C?
- eslaught 8y ago> 100% overlapping with what I'm trying to do with Zig. I don't see any mention of meta-programming for V, which seems to be a big emphasis for Zig? This seems like a massive feature that at least I'd care about. I haven't personally had the opportunity to try Zig, but I'm routing for you, so I hope you keep going with the project.
- SomethingOrNot 8y ago*rooting
- nickpsecurity 8y agoTo Andy: I thought it was a new name for Zig seeing your name and the description in the link. ;) It actually looks about too good to be true, especially that it can handle any C++ to V conversion. I was pushing people to check out languages like ZL exactly to rid us of C++ without throwing away legacy code. If it can do that and fast compiles, I can't wait to read the full write-up later on. Btw, I encourage you to keep at Zig for diversity in systems, language space. Plus, macros. I tell people to avoid them by default for more maintainable code. However, there's times where it's better to have them than not have them. I was happy to see D, Rust, and Julia do macros. Zig and V should have them, too, for max productivity. To amedvednikov: 1. The name. Although Kesterel had a V language, that was long time ago. You're not stepping on anything. I just encourage you to do one people can spell and pronounce easily that isn't already taken. That will make both search results and adoption a little better. 2. Macros. Like I said above. I saw you mention Go which intentionally tries to keep a standardized language for maintainability and easy compilation. I get that. You could add a warning to the main page that macros are available but discouraged for most situations for those reasons. "Use them only when the cost is worth it." Can just do two passes: one for macros, one for regular code. Your incremental compilation should knock out most of what little slowdown there is.
- DubiousPusher 8y agoMax productivity to the library implementor not to the integrator or maintainer. The number of hours I've spent inlining gross macros so I can debug them has poisoned me against all but the simplest application of them.
- nickpsecurity 8y agoI said the same thing in my comment. You get max productivity with selective use. Nine times out of 10 you don't need them. Overuse of them led to LISP code being hard to read like you said. We don't need to repeat mistakes of history. So, I said add them with a warning to minimize them for maintainability if language is trying to be like Go. On the other hand, they should be most of the code if taking a DSL- or MOP-like approach. The people using those will be very familiar with the higher-level language. There's a solid, lower-level language underneath for when the VHLL's don't work out. The macros help there.
- dna_polymerase 8y agoI'm pretty sure none of V will deliver on its promises. Wouldn't be surprised if nothing came out of the announcement at all. Author seems to have a history of big claims and vanishing shortly after. Also details on implementation specifics here in the comments don't make him sound like someone who has an idea of the internals of a compiler or programming languages.
- emmelaich 8y agoCan you give some citations / references? FTR, I found his (former?) eul\.im which now redirects to some fishy website.
- dna_polymerase 8y agoThat's what I referred to. His comment history looks like he is advertising his chat apps all the time. One comment pointed out, that eul.im was 4MB in size but loaded a browser runtime upon initial start, also he never opened the source. I'm not saying that he is a scam or anything but that product page makes some very huge claims and has little to no proof for V's existence. So I think it is too soon to celebrate the new GOAT in the programming language game.
- dkersten 8y agoThe claim that the language is guaranteed thread safe without data races is also unsubstantiated. Avoiding data races, and more importantly, dead and live-lock, are incredibly difficult problems to solve. V looks interesting, but I'll wait and see before I jump onboard.
- coldtea 8y agoSadly, that's the conclusion I came too after reading more details/responses. Lots of handwaving, things mentioned as language features on the webpage and then revealed to not be present (in responses), and lack of specifics...
- habosa 8y agoI also found Volt in that thread and have been reading about V ever since. Thanks for posting!
- outworlder 8y agoWhile I appreciate the engineering effort that goes into this, it would seem like a waste of energy. There are other languages which compile to C. There are languages with good C interop – some of these are just as small. There are languages with good safety mechanisms, some of which don't even use a garbage collector. Not sure why none of the existing languages would fit the bill.
- klodolph 8y agoI emphatically disagree about the waste of energy. You do not need to always do novel work, and not every piece of code has to be in support of some specific engineering goal with external justification. I don't consider gardening a waste of energy, even if I can get groceries at the store more efficiently. I don't consider painting a waste of time, even if my paintings are bad compared to others. Let people retread well-known paths.
- the_duke 8y agoI'm all for scratching an itch and coming up with a new language. And yes there is potential in this space. But it's definitely a wasted effort if the goal is to write a light weight chat client... Implementing something, disliking the tools we use and deciding to implement our own... I think we've all been there. But a language takes years of work by dedicated people to reach any level of maturity.
- klodolph 8y ago> But it's definitely a wasted effort if the goal is to write a light weight chat client... That’s vacuously true, because there are always more goals besides just writing a light-weight chat client. I find most of what I do is balance different goals, objectives, and concerns against each other. Even if you only have external business objectives, you at least consider both the short-term and long-term.
- eslaught 8y agoThere isn't enough detail on this page to really know what's unique about this language. However, I'd say in general that I don't think this area is "solved" at all, and there are a lot of open problems (or at least, problems in integrating different approaches together). Consider that there are multiple languages that have evolved in this space recently, all of which take slightly different approaches and make different tradeoffs. I personally know of at least: Nim, Rust, Terra, Zig. There are probably others. (Edit: This isn't quite right: these don't all compile to C. But they're all low-level and make tradeoffs which are similar to C.) You can say, "well all of these already exist so why not join up with an existing effort instead of creating a new one?" Except that languages make tradeoffs that fundamentally impact other objectives. For example, Rust has already made tradeoffs which make it seem unlikely that it will ever get Terra-style metaprogramming (at least to the full extent to which Terra supports it). And that might be fine for many of the things you'd want to do with Rust. But I at least have things I'd like to do that benefit strongly from Terra-style metaprogramming, and I might like to have something that combines the advantages of both. Right now that thing doesn't exist, and it's not obvious if you could ever get there in a reasonable way from either Rust or Terra by taking one or the other and trying to build to the other side. Thus, I don't find the approach of starting over from scratch unreasonable at all.
- cschep 8y ago100+ MB down to 5 MB is such a nice win, it's amazing that the author even bothered to continue from 5 MB down to 100 KB. Very impressive!
- MuffinFlavored 8y agoIs Volt WebKit or not? I can't tell...
- saagarjha 8y agoIt doesn't look like it.
- blattimwind 8y agoCramming WebKit into 100 kB seems technically impossible, unless those 100 kB contain "git clone ; ./configure; make -j32 /wait three hours/".
- MuffinFlavored 8y agoI totally agree. So what does "Slack support" mean? Is he... implementing the Slack API? and Skype? and Gmail? and Discord? and Facebook Messenger? Edit: I see now. It's just a chat app with a bunch of protocols and a clean interface.
- amedvednikov 8y agoNo it's 100% native. Initially it used to download CEF for authorization. The worst decision I ever made :)
- gok 8y agoV for vaporware? :)
- rafaelvasco 8y agoI'm rooting for it don't say that sheeesshh :)
- edgarvaldes 8y agoI like to know that there are still developers for whom the size of an application is an important issue.
- ilrwbwrkhv 8y agoand thats why im gonna patreon the shit out of him. we need more heroes like this.
- themodelplumber 8y agoGoing a bit more abstract, it's a good idea to do this with mental models, too--the programming languages of the mind. Many of us are heavily burdened in our problem-solving long before we fire up our text editor, because our mental model for exactly what it is we are doing is extremely sloppy and rich with unnecessary dependencies. A lot of people continually tinker with mental models that are into the Gigabyte-equivalent range in terms of all they intend and promise to do. One example here on HN might be the "startup" model. What "it" is seems pretty fluid at this point and in various discussions it gets mashed and molded to fit this concern or that one. Better models will come along that will solve problems nobody can yet put their finger on. (I'm speaking in the abstract here, but I've experienced and worked heavily on this kind of model-change and it can be very valuable.) What typically happens is, someone comes along and isolates an issue which promises high leverage or high controversy or both, brings a set of problems into really sharp relief and remains in the needed context without the burden of supporting and interlinking with every other context out there, and voila--a powerful solution emerges in a very efficient way. Pretty soon everybody who needed a [startup] mindset now needs a [successor-lens] mindset. And not just in name--it's clear that this can really help. It's good stuff. It's really just more of what we call "technology" and is observable in the same sorts of curves, but again, there's a model that's overburdened--the technology of the mind still overlaps with and rubs against what we consider "true" technology of the "useful arts" sort. As a civilization we suffer, mostly unknowingly, under the burden of yesterday's thinking about how things fit or don't fit into which categories.
- ci5er 8y agoThe SS-ci5er is here to take the call. This is "the deal"... There are many computer environments beyond the desktop and cloud servers. Arguably most computer environments. But to reduce it: imagine an O&G pipeline controller that stupidly did something bigger than QNX & C. That will be pumping oil and gas for 30 years. Online upgrades, until some young turk blows out the library size. Oil spill with a blown line, and New Jersey explodes.
- johnt15 8y agoIt's interesting that the roadmap of volt has been saying v1.0 is just around the corner for the past half year. The other roadmap items also don't change much. https://web.archive.org/web/20180615121501/https://volt.ws/ https://web.archive.org/web/20180615121501/https://volt.ws/ https://web.archive.org/web/20181023093131/https://volt.ws/ https://web.archive.org/web/20181023093131/https://volt.ws/ It would be great if the roadmap contained realistic items. Once a user is burned by an unmet expectation he won't believe anything else on the website.
- amedvednikov 8y agoYes, I've done a terrible job with estimations and for 9 months I lived in "release tomorrow" mode. I made lots of mistakes that caused the delay, I'll post a detailed blog about it. Should have sticked to "it's ready when it's ready". Ironically this time it it really is going to be released tomorrow (Feb 7).
- amedvednikov 8y agomacOS version has just been released. Windows version will be released later today.
- User23 8y agoWhen you figure out how to do a good job with estimations that can be another post, because I still haven't figured that out. It's way easier to reason about programming language semantics than to guess how long a reference implementation will take.
- adamrezich 8y agoplease don't take this the wrong way but I'm almost more excited to read blog posts about your process and what you've learned than I am for the eventual product, or language used to create the product (though I am excited for both of those!). reading experiences people had trying crazy new stuff is more interesting than results of trying crazy new stuff imo
- thecupisblue 8y ago
- SiVal 8y agoMy two biggest questions about V are 1) How is memory managed?, and 2) How is concurrency done? "V has no runtime". No GC, but you don't have to manually release memory, like Rust but much easier. Sounds great. How? And "no race conditions ever" and "everything is thread safe". You can do that with "no runtime" fairly easily if there's no goroutine-style concurrency. I didn't see any mentioned, but I could have easily missed it. Those two aspects of the language are fundamental enough that I would certainly want to read about them near the top of any overview of the language.
- kazinator 8y ago> No GC, but you don't have to manually release memory, like Rust but much easier. That description could fit Fortran 77.
- floofy222 8y agoYou don't need destructors to release resources if you never release them.
- amedvednikov 8y agoGood question. I haven't mentioned memory management because it's not done yet. I know for sure there won't be a GC or reference counting. I want to do something similar to Rust's approach, but much much simpler. It's not an easy task. Right now the language handles very simple cases. Small strings are placed on the stack, local variables that are not returned are clean up automatically. Globals are not allowed, function args can't be modified, so that helps a bit.
- ncmncm 8y agoNo GC means you can have destructors, and they can manage resources other than memory, too.
- pulse7 8y agoNo GC, no reference counting, no manual memory management... Hmmm.... Not everything can be managed by RAII/SBRM... Let say I have a function which loads a complex document (like spreadsheet), does some changes, saves the document and then exits. Who will dispose this complex, dynamic document from the memory? This is the CORE question! If there is a no GC, no RC, no manual management solution to this, then I AM REALLY INTERESTED to know about it...
- elcomet 8y agoVolt looks amazing. I've been looking for a native IM app for a while, and I couldn't find one. I hate all those electron or browser apps taking hundred of MB of ram just to display messages. I hope it succeeds and is released soon! Thank you very much for your work.
- vanderZwan 8y agoI'm not sure I get what is going on in the live reloading code.. if you update the draw function to change colors, then why does the block only change colors when it hits the edge of a screen? [0] https://volt.ws/img/lang.webm https://volt.ws/img/lang.webm
- amedvednikov 8y agoGood catch! It should be instant. But when I was making this gif, there was some kind of a bug, and I some how made it work only after it reaches the edge. I was not able to reproduce this :) I'll make a better gif once the new website is up.
- didip 8y agoWow, I like the selling points: * Strong modular system and built in testing. * Global state is not allowed. * There's no null and everything is automatically initialized to empty values. No more null reference crashes. * Variables are immutable by default and functions are partially pure: function arguments are always immutable, only method's receiver can be changed. * Thread safety and guaranteed absence of data races. You no longer have to constantly ask yourself: "Is this thread safe?" Everything is! No perfomance costs either. For example, if you are using a hash map in a concurrent function, a thread safe hash map is used automatically. Otherwise a faster single thread hash map is used. * Strict automatic code formatting. It goes further than gofmt and even has a set of rules for empty lines to ensure truly one coding style. Especially eye catching is the 2 mode of every data structure. Switch to thread-safe if there are concurrent access.
- duncan-donuts 8y agoFor no null is he saying that everything is just initialized to a default value (int=0, str=“”, etc)? I’m thrown off by, “everything is initialized to empty values” because I don’t see how empty and null are different.
- eridius 8y agoThe difference is all values are valid. In C, you can't know that a `char *` is safe to dereference.
- dkersten 8y agoGarbage but valid values are, in my opinion, much harder errors to catch because they can silently corrupt data, than a simple crash/null pointer exception. I'm not a fan of null (option types seem better -- which V does say it has), but defaulting to an "empty" value isn't the answer IMHO as it makes it much harder to debug by obscuring that there's a problem at all. You may not realise that the 0 is actually an "empty" and not a valid 0 until you realise all of your calculations are wrong, months later.
- amedvednikov 8y ago
- rafaelvasco 8y agoSounds too good to be true. If this is released it'll be serious competition to Rust, Nim, Zig, etc. Lets hope for the best. There's just so many amazing features. There's even a graphics library in it.
- mruts 8y agoHow exactly is this a serious competitor to Rust? The guarantees volt is (claiming) to make are nothing compared to Rust. I'm not saying this is bad (Rust is pretty rigorous and hard to code in), but I don't really think they are comparable. It does seem similar to Nim and Zig, I just think Rust is in a different category from almost all other languages all together.
- amedvednikov 8y agoI'm very excited about it. I've been working on this and Volt full time for a year.
- rafaelvasco 8y agoVery good to know! Keep going strong !
- pcwalton 8y ago> V is compiled directly to x86_64 machine code (ARM support is coming later) with no overhead, so the performance is on par with C. Direct compilation to x86-64 machine code does not get you performance on par with C (by which I assume the author means GCC or Clang). The optimization pipelines of GCC and Clang have had decades of work put into them by some of the best compiler engineers in the world. Since the author states that the compilation time is linear, this would seem to imply that a full suite of optimizations are not being done, since many optimizations done by GCC and Clang have nonlinear complexity. It is easy to get fast compilation if you don't perform optimizations. > - Thread safety and guaranteed absence of data races. You no longer have to constantly ask yourself: "Is this thread safe?" Everything is! No perfomance costs either. For example, if you are using a hash map in a concurrent function, a thread safe hash map is used automatically. Otherwise a faster single thread hash map is used. This description doesn't guarantee freedom from data races. (Java's memory model basically fits this description, for instance, except for the specific case of hash tables, which aren't built into the language.) Even if it did, the tricky part is determining what a "concurrent function" is. The obvious ways one might imagine doing this tend to fall down in the face of higher-order functions.
- ww520 8y agoGCC/Clang will definitely optimize better. One way to piggyback on those is for V to spit out C code and let GCC/Clang to do the hard work to produce production mode code, while V can still do fast compilation for development mode code.
- rohan1024 8y agoAuthor added the same thing to description after his comment here
- amedvednikov 8y agoYes, you are right. I had a mental note to update the description, I never expected this to be posted on HN so early :) Just updated it: > V is compiled directly to x86_64 machine code (ARM support is coming later). There's also an option to generate C code to support more platforms and achieve better performance by using sophisticated GCC/clang optimization.
- jagger27 8y agoThis is the most exciting software announcement I have seen in a while. I can't stand using Facebook Messenger in Firefox. I'd love to see how V generates its machine code. Using the Go syntax is a wonderful idea.
- DaiHafVaho 8y agoAs an (anonymous) programming language designer, a few bits of feedback. First, nice concept, but without open code, it might as well not exist, and without open specification, it might as well be yours alone, like one of Tolkien's languages. Closed languages wither and die, and yours seems well onto that path. Second, what makes V compelling to you appears to be completely uninteresting to me in terms of language design. It might as well compile from V to Go; I can't see why not! Whenever a language designer appeals to simplicity, they are usually appealing to whatever makes it possible for them to be productive, and they are usually missing that the productivity is personal because the designer is the one who builds the language. The GL demo seems to be a great example of this sort of situation. I hope that you publish your work so that we may properly critique it. Edit: Here is another language designer who is not me saying "closed languages die" (https://blog.golang.org/open-source https://blog.golang.org/open-source). I think that, until we actually have a compiler for V (or whatever it is hopefully renamed to before release) in our hands, we ought to be extremely careful about trusting that any of this exists. It is all too common in PLT/PLD for somebody to come in with bold claims, outrageous mockups, and zero toolchain. I addressed what I saw, which is yet another compiles-to-Go hobby language. To become more than that requires a committed community and a common repository of open code, and the author appears to have only the former.
- asdfasgasdgasdg 8y ago> I hope that you publish your work so that we may properly critique it. I don't know about this author, but for me, this would emphatically not be a motivating reason to publish my work. I might publish work so that someone could get some use out of it, or to show off my brilliance. But if all you're going to do is critique it (no doubt with all the familiarity born of five minutes of looking at the tutorial), then I'd just as soon you never see it. >Here is another language designer who is not me saying "closed languages die" (https://blog.golang.org/open-source https://blog.golang.org/open-source). I don't think the person you're quoting would advocate that languages must start out as open source. Go sure didn't. It was developed closed source within Google for two years before it was even announced.
- 8y ago
- avisaven 8y agoI had been looking for this exact project, but I couldn't remember its name for the longest time. But I remember that home page exactly. Doing a bit of seraching it turns out volt.ws appears to be a rebranding of a previously posted [1] Eul (eul.im), posted by alex-e (whom I assume is its author). Either way, volt.ws and the associated V language sound quite interesting, I look forward to hearing more about this in the future. [1] https://news.ycombinator.com/item?id=14778263 https://news.ycombinator.com/item?id=14778263
- snissn 8y agoHey! I just wanted to see keep it up and that this looks really cool
- amedvednikov 8y agoThanks!
- amedvednikov 8y agoHi, Developer here. I was going to post this here in a couple of weeks after launching the product and creating a separate site for the language with much better information about it. I'd also like to hear your opinion about not allowing to modify function arguments except for receivers. This is an idea I got that isn't really implemented in any language I know of. For example: mut a := [1, 2, 3] So instead of multiply_by_2(&a) we have to return a new array (and this will later be optimized by the compiler of course) a = multiply_by_2(a) I think this will make programming in this language much safer, and the code will be easier to understand, since you can always be sure that values you pass can never be modified. For some reason all new languages like Go, Rust, Nim, Swift use a lot of mutable args in their stdlibs. You can still have methods that modify fields, this is not a pure functional language, because it has to be compatible with C/C++: fn (f mut Foo) inc() { f.bar++ }
- physguy1123 8y agoI'm not sure if I'm the target audience for this (low-latency trading), but here's my thought - code which would allocate in a fast path is a strict no-go for me, and this runs fairly close to that in a few regards: > It seems easy to accidentally make allocating code allocate by changing some variable names (b = fnc(a) - oops, allocation) > I would be extremely wary of trusting a compiler to realize what sort of allocations are optimizable and not - I already have problems with inlining decisions, poor code layout, etc in fairly optimized c++/rust code compiled by gcc+llvm. Replace allocation with any other expensive work that duplicating a datastructure would result in, and you have the same story. I suspect many of the people that would be evaluating this compared to C/C++/Rust have similar performance concerns.
- amedvednikov 8y agoThanks for your input. I'll do more research on this.
- gcb0 8y agoYou need to stop pretending they are not globals. Just accept you work on one continuous memory patch and are simply passing pointers around. If you don't lie to yourself, you can't shoot your own foot when the compiler do not see your lie.
- potta_coffee 8y agoVolt looks like a cool app, I'll be trying it out this week.
- duked 8y agoI really would love an alternative to the horrible Skype client but I doubt it. AFAIK, you can't make your own unless things have changed ?
- amedvednikov 8y agoCheck it out tomorrow :)
- chubs 8y agoThis is a helpful approach for embedded platforms: Write in a nice language (V), spit out C code that the usually-old embedded toolchain can compile.
- amedvednikov 8y agoAnd you can also do C++ => V => C :)
- bogdanoff_2 8y agoDo you have anything to say about C++ => V translation? From what I know C++ is an extremely complex language. How do you deal with the complexity? (Especially considering V is meant to be simple)
- amedvednikov 8y agoIt is ridiculously complex. Right now the size of the C++ translator is 10 times bigger than C and it'll get even bigger. I'll post a detailed article about it soon.
- magicalhippo 8y agoFrom what I could see V does not have templates, so that means you instantiate the templates as part of the conversion to V? How does the resulting V code look like for non-trivial templated code, say something you'd find in one of the more complex Boost libraries?
- mathgladiator 8y agoAwesome, I love to see new programming languages in action. This is great. Some thoughts. First, ignore negativity and focus on getting constructive feedback. One of my tiny regrets is that I abandoned one of my projects due partially to negative energy. Many years ago, one of my projects was shared here ( https://news.ycombinator.com/item?id=226480 https://news.ycombinator.com/item?id=226480 ), and the feedback was kind of a buzzkill (especially since I wasn't the one sharing it). Second, think about the growth you want. While I could ignore the buzzkill and keep the faith, I used my language to put a real product out into the world. The crazy thing is that I got it working and working very well, but when it came to hire. It was a cluster fuck. I should have spent a bunch more time on documentation and examples, but I had other concerns that were higher priority. I ultimately had to abandon the whole thing, and I just rewrote everything in C# and used Mono. It was painful, but the company was able to grow faster since the tools were somewhat standard and a plethora examples for the new hires. When I look back, I was onto something. If I had kept the faith and pushed through, then I would have created something very similar to HHVM which Facebook uses. My strategy back then was to create a less awful language, improve it, then port the platform bits to a better ecosystem and preserve the "business logic". My core advice with the programming language side of the house is to find a partner for you to lead/follow with shared values. Make it open source as soon as possible, don't wait.
- sandov 8y agoIt's not garbage collected, right?
- mattbreeden 8y agoCorrect. There's some more details in this (unfinished) article: https://volt.ws/game https://volt.ws/game
- ilovecaching 8y agoTo the problem you were originally trying to solve, why not just use Rust? Go and C are really about as related as Java and C. Rust would have met all your requirements, and has a lot of features you added to V to begin with.
- amedvednikov 8y agoSlow compilation. Complexity.
- ilovecaching 8y agoThat's strange, I find Rust to be much less complex than working with C++ or C. It keeps track of all the tough bits for me, and it has all of the nice expressive stuff from Haskell. With Go I kept running into cases where the language simply had no feature to save me from multiplicative complexity in my code base. I haven't had any problems with build times thus far, how big is your project?
- amedvednikov 8y agoIt's not big. But I'm developing V so that everyone can create large applications with very fast compilation times. I'm getting x120 improvement for DOOM 3, and I think it can be up to 400 times faster for more complex C++ projects using more templates, boost, etc. Of course I didn't need a new language to make my project compile faster :) I just wanted a simpler C, and I had some experience with writing languages (I wrote 2 languages at school/uni). Now I'm actually more excited about V than the original product I created it for :)
- solarkraft 8y agoThis is the part that astonishes me the most. How can you compile so fast?
- fxfan 8y ago
- kilowatt 8y agoLooks a bit like Odin (https://odin.handmade.network/ https://odin.handmade.network/) --a language explicitly designed to be small and simple I've been enjoying learning and toying around with.
- legostormtroopr 8y agoSo Volt seems interesting, but how to I download it? All of the download links just give todays date and issues in the GitHub page the site links to mention it being flagged by virus or not being supported. https://github.com/voltapp/volt/issues https://github.com/voltapp/volt/issues
- amedvednikov 8y agoI've just released a macOS beta. Windows and Linux will be released later today.
- forhadahmed 8y agoI see Go-ish syntax in some of the examples but I also see underscore_case being used (instead of camelCase) Does V encourage one or the other? (coming from a C background, I prefer underscore_case) Does V have Go's funny "uppercase export" rule? Only identifiers that start with an uppercase letter are exported from a module?
- amedvednikov 8y agoV is very strict. There's only one style. Using anything other than the underscore case is a compilation error. It doesn't have the uppercase export rule. It's going to be either Rust's `pub` or Oberon's `*` or `+`, haven't decided yet.
- rafaelvasco 8y agoYes, snake_case is the superior naming system imo. Only problem is that each underline required two keysrokes. Maybe using keyboard macro or something would help.
- User23 8y agoI'm a big fan of what they are doing, but this is really light on details. Please show us more!
- amedvednikov 8y agoYou can follow the project here: https://github.com/vlang-io/V https://github.com/vlang-io/V https://vlang.io https://vlang.io
- dang 8y agoMaking a programming language specifically for the needs of one program, then developing that language and the program together, is an underestimated strategy. I believe the world would be more interesting if more people applied it—because then we'd get more qualitatively different new systems. The Sapir-Whorf hypothesis may not be something people currently believe about natural language but for sure it's true about programming: the language you program in conditions what you think, which conditions what program you write. When the two evolve together, evolution can go to new places. This strategy is time-honored in the Lisp world, where making a language and writing a program are more intertwined, and the cost of making a language much lower, than they usually are.
- eckza 8y agoWhat I took away from this, is “everyone should learn a Lisp dialect ASAP”.
- dang 8y agoNot necessarily. It's easier in Lisp, and a decades-long tradition, but Lisp is not even the only language of which that's true—there's also Forth. And there are many opportunities to apply this approach beyond those two. The more the better, because each qualitatively different starting point will lead to qualitatively different systems. The software ecosystem is not well served by everyone being focused on the same few familiar programming approaches. Sure there are economies of scale—better tooling, programmer fungibility—but there is less intellectual diversity. More people should realize the tradeoffs here: yes you lose a lot when you start making your own language, but you also gain a lot. The program you're trying to write becomes more writeable. If that doesn't sound significant, it's because we're so conditioned to think the other way. There's another advantage, too: it's deeply intellectually rewarding. That provides staying power to work on significant projects over the long haul and is a solid motivation to do something many people think is crazy.
- mathieuh 8y agoReally you can write a DSL in almost any language. I've worked with Java and TypeScript Selenium testing suites that were so project specific with everything abstracted out to methods so much you could barely tell what language you were writing, just that it was some C-descendent
- slaymaker1907 8y agoI think doing away with global variables is not a very good idea. While using globals is usually a bad idea, there are many instances where globals are appropriate (at least for languages supporting mutability). People who say they never use globals usually do use globals and are just trying to convince themselves they are not because they heard they were bad from somebody. The entire Spring framework is IMO an elaborate construction built so that engineers could use global variables without their managers finding out. There is little to no difference between carefully using global variables and Spring dependency injection except syntax. The best solution I have ever seen to global variables is definitely parameterize with Racket (https://docs.racket-lang.org/guide/parameterize.html https://docs.racket-lang.org/guide/parameterize.html). I don't think Racket was the first language to come up with this, but it was the first one I am aware of. The basic idea is that you define some global with a default value. However, you can call parameterize to change the value for the duration of some input function. It is made thread safe by using thread local memory. It then resets the parameter back to the default value at the end of the function. On the other end of the spectrum, I think Rust also has a very good implementation of globals. It will let you use global variables, but you have to declare it as mutable, use some form of locking, or use an UnsafeCell. Additionally, you have to mark your code as unsafe any time you try to read or change this global variable.
- omeid2 8y ago> There is little to no difference between carefully using global variables and Spring dependency injection except syntax. Until you need to write unit tests.
- darrenf 8y ago> The best solution I have ever seen to global variables is definitely parameterize with Racket (https://docs.racket-lang.org/guide/parameterize.html https://docs.racket-lang.org/guide/parameterize.html). I don't think Racket was the first language to come up with this, but it was the first one I am aware of. The basic idea is that you define some global with a default value. However, you can call parameterize to change the value for the duration of some input function. Isn't that basically Perl's `local`?
- n13 8y agoAs a someone who has never design the language or implemented a compiler, this seems to be on very very daunting task. Just wondering how much effort it requires and if someone like me - who has experience in developing software using high-level languages but not compilers - can implement it. It seems to be very interesting project and I would love to try something like this just for the sake of learning. I would really appreciate if someone can give me the pointers about where to begin with.
- mathgladiator 8y agoIt is daunting, but getting started is actually straight forward. For instance, you could start by simply writing a domain language that translates your grammar via a tool like ANTLR or simply raw abstract syntax trees to C++. It gets hard the more features you add to have a consistent experience and all the other tooling a language has (like debugging). I find these problems fun and help in making you a better programmer, but the cost to be successful is immense.
- omegabravo 8y agohttp://craftinginterpreters.com/ http://craftinginterpreters.com/ It's an excellent book and is incredibly approachable.
- slimsag 8y agoHow does this prevent data races? Does it suffer performance, or require Rust-like annotations about lifetimes?
- wishinghand 8y agoOff topic, but will there be a dark mode for Volt? I can’t abide by Slack’s lack of official one and the constant overwriting of the file that maintains the hack for the unofficial one.
- amedvednikov 8y agoYes, there will be.
- aethertron 8y agoVery very interesting. But I hope it's renamed to something other than a single-letter name, so we can use search engines to find info about the language later.
- karolusrex 8y agoUsually you can find information about a new language pretty easily by adding "Lang", e.g. "go lang" etc
- lucas_membrane 8y agoLooks like this language has something in common with single-assignment C. Can anyone offer comparison/ontrast with that?
- stabbles 8y agoI tried the app on the mac and it's very buggy. I couldn't save settings, and from then it kept on crashing after restarting the app.
- gbersac 8y agoI was considering downloading it, but I think I won't now that I read your answer. Do you know of any good competitor ?
- anderskaseorg 8y ago“No variable shadowing” might sound great when you’re thinking about that one time someone confused you for three seconds with the addition of a new inner variable with the same name as an outer variable. But once you realize that it equally means forbidding the addition of a new outer variable with the same name as an inner variable (even though those inner variables are supposed to be implementation details)—and, as a corollary, you can never add new builtins to the language without breaking backwards compatibility—you’ll realize that most languages allow shadowing for a reason.
- vanderZwan 8y ago> you can never add new builtins to the language without breaking backwards compatibility Adding any keyword is by definition breaking backwards compatibility, so I'd say this is the correct behavior.
- kupiakos 8y agoI think you're confusing "keyword" with "reserved word". A keyword has a special meaning in certain circumstances, while a reserved word cannot be used as an identifier. In some languages, those are the same thing. For example, "goto" is a reserved word in Java, while not a keyword. Inversely, in Fortran, keywords are not reserved names, so `if if then then else else` is valid. C# has "keywords" and "contextual keywords", both categories being keywords, but only the former being reserved names. Regardless, a builtin might be referring to a function that's included as part of the base language - like make() in Golang or zip() in Python.
- vanderZwan 8y agoEh, right. But correcting for that I still hold the same view that adding new builtins should be considered breaking backwards compatibility. EDIT: Since someone has gone through the trouble of downvoting this viewpoint, I would like an explanation as to why I'm wrong here. I cannot imagine a scenario in which doing so would not likely break existing code.
- hexmiles 8y agoFor me personaly the killer fature is: C/C++ to V translator Having all my library in the same language make a lot thing like debugging and testing easier. It also semplify the mental model i have of the program. Also C(lang) interop is my main struggle with go. For me it is such a pain that something i wrap a c library in a stdout/stdin server and just spawn it and use cap'n'proto for communication. When you use cgo you lose the easy cross-compiling, i would love for something similar in go and/or rust. I wonder if llvm could be used to implement a sort of universal transpiler. even if it not use the target language in a semantic language it still make a lot of thing easier.
- amedvednikov 8y ago> For me personaly the killer fature is: C/C++ to V translator Yes, I'm super excited about it!
- coldtea 8y agoIs this a real language, or am I dreaming this? Those are exactly the ideas I had for what would make a perfect language! (Assuming they're implemented properly of course). Simple features. Immutable and pure by default (but not dogmatically so). Fast compile. Hot reload. Automatic C interop. Fast-ish. Built in niceties like hashmaps, strings, and vectors (niceties compared to bare C). Receivers so you don't have to do the song and dance you do in C to tie structs and functions. No header files! Go came close, but no cigar. Rust added the whole kitchen sink and loads of accidental complexity. Anxious to see how this fares...
- steveklabnik 8y agoHave you seen Zig?
- coldtea 8y agoYes, Zig is another one I'm excited about.
- zevv 8y agoYou might want to take a peek at the Nim language as well; it has all of the above and is quite mature.
- dual_basis 8y agoHit reload though?
- fooker 8y agoHow does the live reloading work when you are compiling to C or machine code and claim to not have a runtime?
- dna_polymerase 8y agoFantastic stuff. Waiting for a release though before getting too excited. Sounds too much for a single person to do.
- p0nce 8y ago> Full source code is available here. Link refers to the same page.
- amelius 8y ago> Modern garbage collectors are very powerful and optimized. However for the best performance and latency it's better to use a language without a GC. This is quite a controversial statement. But it could indeed be true, see this article: [1] [1] https://softwareengineering.stackexchange.com/questions/203745/demonstration-of-garbage-collection-being-faster-than-manual-memory-management https://softwareengineering.stackexchange.com/questions/2037...
- slaymaker1907 8y agoI would be cautious about making a language with only reference counting since you can easily end up with stack overflows when implementing something as innocent as a linked list unless you keep some sort of list of objects to free in the runtime.
- warpech 8y agoApparently now there are two programming languages called "V", the other being: https://www.vcode.org/ https://www.vcode.org/
- rafaelvasco 8y agoYeah, i guess V is just a temporary name. Other nice names : Jolt, Quark, Ether, L, Lum etc;
- solarkraft 8y ago> You can also simply translate your entire C/C++ codebase to V and make your build times up to 400 times faster. What are traditional compiler makers missing?
- hawski 8y agoWould it be possible to compile V to Java or JVM byte code, but by not using giant array in the middle? I'm mainly wondering if one could use GTK+ in Linux and Android APIs without JNI on Android.
- mjaniczek 8y agoRe the website: are the fonts quite unreadable just for me? https://screenshotscdn.firefoxusercontent.com/images/761f2089-8374-449d-827e-1a0d2be8e079.png https://screenshotscdn.firefoxusercontent.com/images/761f208... (BTW, the language itself is exciting!)
- amedvednikov 8y agoYea, it's using Google fonts, I'd better switch to something more standard.
- leshow 8y ago> Originally Volt app was written in Go, but after a couple of weeks of development I decided to re-write it in C for two reasons: easier integration with existing C graphics and UI libraries and much smaller binaries. The app size reduced from ~5 MB to ~100 KB. I'm always curious when people complain about binary sizes. Was there some reason the binary needed to be small? Or just based on some sense of 'largeness' and 'smallness'. It seems to me like rewriting in a 'less productive language' to save a few mbs of binary size that nobody cared about anyway is a pretty big waste of time. I don't mean to come across super critical, there are cases where binary size could be really important. Say you're on an embedded platform with minimal memory. I just don't /understand why it was something worth optimising over here... especially to the point of a rewrite
- amedvednikov 8y agoIt was not just about the size. I experienced major issues with cgo.
- GenericsMotors 8y agoThis is the same attitude that has gotten us 20MB+ web page sizes.
- leshow 8y agoI'm not talking about a web page, I'm talking about a binary you're running locally. Your criticism doesn't apply.
- gnuvince 8y agoI'm interested to know how the language handles memory; automatic memory reclamation without a GC and that is simpler than Rust seems like a very attractive proposition.
- akrymski 8y agoFinally, a simple alternative to C++! I've been dreaming about creating this for years, thank you for doing it! Few ideas I had: - Simple classes (no inheritance, only mixins) like in JavaScript - Always pass objects by reference as in Java to avoid the pointer mess - Copy the core APIs from ECMAScript
- Kip9000 8y agoI'm excited about this.. Feature list seems almost too good to be true. :)
- Rusky 8y ago> You can also simply translate your entire C/C++ codebase to V and make your build times up to 400 times faster. An automatic translator supports the latest standards of these languages. Is this saying you can actually get compile time improvements compared to the original codebase? If so I can imagine a couple of ways this could work- 1) skipping the optimization the C/C++ compilers would do, with V's direct-to-machine-code generator, and/or 2) doing some heavy lifting in the translator, so the equivalent V has more redundancy and less implicit information. How close am I? Or is there something else here?
- openloop 8y agoHire this dude.
- mbrodersen 8y agoThe programming language C was invented to write Unix. So sometimes creating a language to write software works. The defence industry (in the US) is (apparently) notorious for doing this. Any other examples?
- BlackEspresso 8y agoLooks really good. Any ressources on how you wrote the x86_64 backend ? Or Thema Compiler per se?
- amedvednikov 8y agohttp://ref.x86asm.net/coder64.html http://ref.x86asm.net/coder64.html mostly
- shouyatf 8y ago> You can also simply translate your entire C/C++ codebase to V and make your build times up to 400 times faster. An automatic translator supports the latest standards of these languages. How do you plan to translate the latest C++ standard with all those template stuff?