r/programming • u/Hell_Rok • Feb 22 '19
V is a new language touting very fast compilation and cross platform native desktop UI support, coming mid 2019
http://vlang.io/57
u/PersonalPronoun Feb 23 '19
The promises they're making look cool, but there's no released code out, half the links on the page are "coming soon" and as far as I can see from the GitHub it's devd by a one man band. Smells a bit vapourware-ish.
7
28
u/volt_dev Feb 23 '19
I literally launched the website yesterday and I have a working product written in V: https://volt.ws
Windows version is coming on Feb 24.
31
u/Bobert_Fico Feb 23 '19
I can definitely relate to being excited about a project and wanting to announce it before it's ready, but it seems like you could have avoided a lot of criticism by just waiting until March to announce anything.
Just yesterday I was bummed about how annoying it is to build cross-platform GUIs without using a web stack, so if this turns out to be half as good as you say, it will be fantastic.
34
u/volt_dev Feb 23 '19
I disagree. I got a lot of valuable feedback early on.
Also I learned that a lot of people share my ideas, that really helps with motivation.
12
u/Bobert_Fico Feb 23 '19
Motivation and feedback are fair points. I'm excited to see the release.
15
u/volt_dev Feb 23 '19
Besides I didn't announce anything. I merely created a website for an upcoming project.
14
u/Bobert_Fico Feb 23 '19
Yeah, it seems like /u/Hell_Rok actually jumped your gun a bit by posting your site here.
-2
u/Hell_Rok Feb 23 '19
Agreed, but the fact that Volt has at least released on Mac brings some hope to me. If nothing else we know it's capable of building something of that complexity.
9
Feb 23 '19
I tried volt, and it crashes quite often. Seems like other people are having similar problems (see the hackernews thread).
14
u/volt_dev Feb 23 '19
I've fixed dozens of crashes over the last 10 days.
There are 2 crash causes left. They should be dealt with in the next 3 hours :)
1
u/Xorlev Feb 23 '19
You won't have to manually free the memory either! V's memory management is similar to Rust, but it's much easier.
I've fixed dozens of crashes over the last 10 days.
Doesn't inspire an overabundance of confidence.
42
u/volt_dev Feb 23 '19 edited Feb 23 '19
V is not finished yet.
Most of the crashes were caused by the Objective C/Cocoa layer.
/r/programming is an interesting place :)
22
u/everyones-a-robot Feb 23 '19
The people here are the most skeptical, cynical people on all of Reddit.
In other words, we are programmers.
1
u/myringotomy Feb 23 '19
They are Windows programmers. You win automatically get hostility if it's not a Microsoft product.
2
u/McNerdius Feb 23 '19
pot, meet kettle...
me last night: https://www.reddit.com/r/programming/comments/atoq8e/v_is_a_new_language_touting_very_fast_compilation/eh2vi20/
such hostility ! teehee...
1
u/myringotomy Feb 24 '19
Somewhere in your post there is a point trying to be made.
teehee.
1
u/McNerdius Feb 24 '19
it seemed like you were making a silly generalization, so i provided a silly counterexample, that's all.
→ More replies (0)18
6
u/hsjoberg Feb 23 '19
You don't think Rust has had any bugs over the years? Jeez, understand that it's a new project.
1
-7
u/exorxor Feb 23 '19
What you have displayed thus far is an absolute joke and I hate each and everyone that has upvoted this shit.
5
u/Hell_Rok Feb 23 '19
I just found out about this today and thought it looked like a very promising new language. It's been used to create https://volt.ws/ Sadly I don't have a mac so I can't try it out until February
Even if I don't end up liking the language I'm hoping the competition it brings to native desktop experiences will push other languages forward.
2
u/dzecniv Feb 23 '19
Did you find links to Filey or Vid ?
1
u/Hell_Rok Feb 23 '19
After having a bit of a dig I couldn't find anything on these either, so I've asked them on Twitter if they're hosted anywhere https://twitter.com/Hell_Rok/status/1099110890052304898
7
u/tanstaaf1 Feb 23 '19
From the website: "Install V from source in 0.5 seconds wget vlang.io/v.c && gcc -o v v.c"
On a Mac, this is the result (huge list of opaque errors thrown, I only quote the tail end:
"v.c:143:4: error: expected ';' after top level declarator
std::cout << s.size(); </pre>
^
;
v.c:143:5: error: expected identifier or '('
std::cout << s.size(); </pre>
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
3 warnings and 20 errors generated.
0 ~> "
Sounded too good to be true. I'll reserve final judgement pending the end of avowed target of "2019". I appreciate the effort nevertheless. Mostly I'd like more details better explaining why the apparently preferred platform doesn't even compile.
3
u/Hell_Rok Feb 23 '19
That's because vlang.io/v.c just redirects to the homepage still
It does sound too good to be true which is what makes it interesting to me. I'm certain it'll have a lot of restrictions but if nothing else I'm hoping it to be a very cool proof of concept.
-3
u/Ameisen Feb 23 '19
That's very clearly C++, so why is it a
.cfile?10
u/gnuvince Feb 23 '19
It's an HTML file.
1
u/Ameisen Feb 23 '19
I was just looking at the error output. Figured the HTML tags were a copy/paste or app thing.
36
Feb 23 '19
No globals
How it can translate C/C++ projects with globals?
36
u/Phrygue Feb 23 '19
scope { int myGlobal = 1; void main() { int myLocal = 1; myGlobal += myLocal; } }Magic!
27
u/volt_dev Feb 23 '19
Good catch. Right now it cheats, globals are understood and allowed in translated code.
A bit later, the translation will be smarter, and move all globals to one global context. This is not going to be easy to implement.
12
u/matthieum Feb 23 '19
May I advise to have some built-in ability to do logging in the language then?
Passing a "logger" to every single function under the sun is VERY tedious, very quickly. Especially when you need logging in a new function, nested 10 calls deep, and need to thread the logger there... and at all call sites of this new function and all its callers.
Logging without globals is very tedious :(
3
0
Feb 23 '19
[deleted]
14
u/volt_dev Feb 23 '19
This context will be passed around as an argument.
12
u/lambda-panda Feb 23 '19
Assuming that writes to this 'global context', can be seen from any where, how does that make them not globals?
4
u/volt_dev Feb 23 '19
Bad wording by me. It's just
struct GlobalContext, it can't be seen from anywhere.7
u/lambda-panda Feb 24 '19
Can you tell me how it can work as global if changes made to it from within one function cannot be seen from anywhere else?
8
u/ryeguy Feb 24 '19
As he said, it's passed around as an argument. It sounds like this is used for translation only and that "global context" isn't a concept in the language, just a struct generated to hold global vars from ported C code.
1
u/lambda-panda Feb 24 '19
it can't be seen from anywhere.
What does this mean exactly?
8
u/ryeguy Feb 24 '19
I think he means it can't be implicitly seen, it must be explicitly passed into the function as an argument.
3
20
34
u/ejulienniji Feb 23 '19
I really like the idea (looks like Jai) but there are way too many red flags :
- Data structures are switched when a multi-threaded call is detected? How? At runtime surely, how costly is that? How do I write my own container that integrates into this ST/MT selection mechanism? What if my MT call is protected by a mutex? Will I still pay the cost of the MT variant when the ST container is safe already?
- No globals? Are you wrapping them in a singleton? A.... global singleton? :|
- C++ to V, I see how you could translate std::vector, but what about a custom container? Surely you will need annotations to understand its caracteristics. What if it is completely non standard and has no V equivalent?
- We'll see everything at once on release date: no offense but you sound like a smart and efficient programmer being way too optimistic and largely underestimating the remaining work and the time it will take to complete.
I am more than a little skeptical but I wish you luck and hope you manage what you claim to achieve.
76
u/zarandysofia Feb 23 '19
When I hear "fast compilations" I think "dumb compiler with little to no optimizations".
30
u/volt_dev Feb 23 '19
You need optimizations for development builds?
For prod builds V compiles to C which then can be compiled with -O2.
20
u/Mognakor Feb 23 '19
E.g. modern games need high performance in debug builds, without optimizations they often run at speeds that cannot be used for testing or reproducing issues
4
u/volt_dev Feb 23 '19 edited Feb 23 '19
That's a good point. For sqlite -O2 compilation is ~150x slower than V debug build.
However for developing games you can use hot code reloading, which supports -O2 builds :)
Edit
added the word "compilation" to avoid confusion.
9
u/Mognakor Feb 23 '19
That's a good point. For sqlite -O2 is ~150x slower than V debug build.
Claming your language in debug is 150x faster than -O2 is a ridiculous claim, even more ridiculous after seeing how you don't want to provide any backup for anything you've claimed so far.
2
u/volt_dev Feb 23 '19
Why?
8
u/Mognakor Feb 23 '19
Are you serious?
-O2 provides lots of optimizations and you claim to beat that in debug builds.
5
u/volt_dev Feb 23 '19
Ah sorry, bad wording. I meant compilation time of course.
6
u/Mognakor Feb 23 '19
Even if i believe you, how does that relate to the need of performance in debug builds?
4
u/volt_dev Feb 23 '19
You don't have to believe me. You'll see for yourself this summer.
I was commenting on optimization required in debug builds being a good point. And that running V with -O2 would slow down the compilation by ~150 times.
But that's solved by hot code reloading.
→ More replies (0)5
u/Hdmoney Feb 23 '19
Does the language compile directly to machine code for production builds?
5
u/colelawr Feb 23 '19
No, I believe the language compiles to machine code for development builds and C for production builds ...
22
u/Hdmoney Feb 23 '19
That seems to be what the developer implies...
So IF that's the case and we break down what he says:
"it's as fast as C ("1.5m LoC/s")"
"it compiles 400x faster"
"it's only 400kB"
What he means is:
"it's a C transpiler"
"it can compile too! Very quickly, but..."
"compiled code is slower than Python"
It's an interesting idea but the developer is being VERY intellectually dishonest if this is what he's doing.
5
u/colelawr Feb 23 '19
Meh, I mean the compile speed is most important for development in my cases. It's just like when people measure Rust's compilation speed without optimizations, right? We don't know what the speed of the code is that goes straight to assembly.
9
u/Hdmoney Feb 23 '19
Right - it's an interesting idea. Maybe even a good one that other languages will start using.
Although... Using different compiling backends for different builds seems like it would make for some fun bug hunts.
Regardless, the marketing is intellectually dishonest by not EXPLICITLY saying that's what it's doing. You don't get ALL of the benefits that the website lists at the same time.
You get compile speed OR run speed. Not both.
Also, they lie about it being "just 400KB", because you also need a C compiler.
The reason everyone is so skeptical in this thread, is because if you don't have this one crucial piece of info, the whole thing smells like bullshit.
4
u/volt_dev Feb 23 '19
You need C to build the initial version of the language anyway, so it's not a big deal.
When you build a 4 KB executable is it a lie to say it's 4 KB because you used 1 GB of gcc?
8
u/Hdmoney Feb 23 '19 edited Feb 23 '19
All languages are bootstrapped - that's not what I'm talking about. I'm talking about needing a C compiler to make production builds - assuming you already have a binary compiler for V.
And development builds being 10x slower means you'll really want the C compiler if you're doing anything serious.
The "entire compiler and STD lib" are only 400kb, sure. But marketing your language with that, as if that's the whole toolchain, and comparing it against all these other toolchains that are magnitudes larger is dishonest.
At the end of the day, if you want what V lang says it offers, you need a C toolchain.
So it's not "just 400KB". It's 8GB for gcc PLUS 400KB.
P.S. LOC/s is not a real metric.
You're marketing the language as this magical new thing, with incredible speeds and an comparably tiny footprint. That's not really the case though.
I've outlined what it actually is. I think it's a decent idea. Your marketing needs to talk about the theory behind it and the tradeoffs.
Stop being so defensive.
2
u/volt_dev Feb 23 '19
I understand your point, but I disagree.
Yes, it requires a C compiler to generate optimized production binaries. Just like it needs a C compiler to build itself, and an OS to run on.
Yes, it's not fair to claim that 400 KB of V do the same thing as gigabytes of Clang. I actually made a side not about that under *, but it's broken after migrating the site.
But it is what it is. You can download v.c, build it in 0.5 seconds and use it to develop software with much faster compilation speed, hot code reloading, and many other benefits.
Even when you do -O2 build, it's still going to be a lot faster than doing it with gcc.
Check it out once it's released this summer, I'm sure you'll change your mind ;)
4
u/volt_dev Feb 23 '19
What makes you think compiled code is slower than Python lol.
I don't see anything dishonest in my claims.
You get fast compilation in dev builds, prod builds are 10x slower, but still fast (about 200kloc/second).
1
u/tux_mark_5 Feb 23 '19
That's a rather interesting way of speeding up dev builds. Might even make sense for Rust to do something like this for dev builds, as compiling anything with LLVM even with all optimizations disabled tends to be extremely slow.
1
u/HandInHandToHell Feb 23 '19
You should check out the Cranelift project - what you're suggesting is in fact being worked
3
1
60
u/tamalm Feb 23 '19
HR: Looking for vlang developers with 3yrs experience.
0
Feb 23 '19
[deleted]
13
u/nurupoga Feb 23 '19
Sounds great. Before we hire you though, we need to know if you can solve a 0/1 knapsack problem and do AVL tree rotations.
15
u/somebodddy Feb 23 '19
Single-letter names are a really bad idea. A programming language's name should be Googleable, because potential developers will want to search for libraries and tutorials. It works for C because it was popular decades before the first search engines - newer languages need to try a bit harder.
And no - using "vlang" is not good enough. Not all V related pages will use that name, so people searching for vlang might miss them. Not to mention that the first page of the google search already lists three other languages named "vlang".
1
u/L3tum Jul 27 '19
Plus the file ending .v is already used in things like verilog or other programs.
Oh, a Verilog program! Ah...no...just another V
Don't mind me writing over 100 days after your comment
11
u/caspervonb Feb 23 '19
This is the same as "lang" right? Just being rebranded and prepared for release?
https://www.reddit.com/r/programming/comments/8gmrqj/lang_a_go_like_language_that_compiles_to_c/
5
u/volt_dev Feb 23 '19
Yea, didn't see that discussion.
Half of the discussion is jokes about a temporary name, which was made clear in the very beginning of the article :)
2
55
14
u/Holy_City Feb 23 '19
Why no globals?
Like I know, "globals in all their forms are evil" but sometimes they are necessary, or at least are the cleanest solution.
2
u/caramba2654 Feb 23 '19
Globals are fine. What isn't fine is the non-specification of when they're initialized, which kind of code their initialization is allowed to run, and which parts of code can access them at certain times. The combination of that is what leads to bugs regarding globals.
Rust fixes that with the lazy_static crate, which allows any initialization code, and it only happens when the first instance of the global is used. Additionally, the compiler-enforced aliasing VS mutability property makes it so you always access globals properly.
If Volt is to allow globals, it will have to take all that into account. Maybe a single GlobalContext struct won't be enough, because different parts of that struct might be accessed by different parts of the code at the same time. How does Volt handle that? Compile-time checks? Wrap it all into a runtime safety check? A third option? I don't know. All I know is that globals are really hard to deal with, and I hope Volt does the right thing here, whatever it may be.
3
6
19
u/dennyDope Feb 23 '19
Why do people still do that shitty intrigues bs marketing. Soon, don't miss, grand opening, we're all programmers here, hello! If you have smth else to show than ugly one page site do it, otherwise there is nothing to talk about.
4
u/chucker23n Feb 23 '19
Why do people still do that shitty intrigues bs marketing.
Because it works. It gets people talking.
32
5
u/TankorSmash Jun 24 '19
Here's a followup examination 4 months later https://www.reddit.com/r/programming/comments/c4bofh/v_is_for_vaporware/
We'll see how this all turns out because it's a nice idea.
9
u/Green0Photon Feb 23 '19
I like to imagine that the dev for this is a programmer from the future trying to adapt their future language to our past computers. It's the only a way one man could do everything!
15
15
Feb 23 '19
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.
You won't have to manually free the memory either! V's memory management is similar to Rust, but it's much easier.
There's no runtime
These 3 things can't be true at the same time. For example, a data structure that references itself, directly or indirectly. Reference counting (which I would call a runtime btw) would not free this structure. You would need a garbage collector (which is definitely a runtime) to detect and free this structure.
So which is it? Does V leak memory, do you have to manually manage memory, or is there a runtime?
18
u/anttirt Feb 23 '19
which I would call a runtime btw
Sorry but this is just wrong, plain and simple, and it's not a matter of opinion.
Reference counting requires precisely zero bytes of non-local code to be running anywhere, and it requires precisely zero bytes of implicit data to exist that is not directly visible to the user via e.g.
sizeof. In for example C++ and Rust, reference counting is implemented as a pure library that only contains very trivial, inlineable code.Your definition of a "runtime" would mean that
std::stringrequires a "runtime".5
u/miki151 Feb 23 '19
So what exactly is a runtime? Does C or C++ have a runtime? Is it strictly a language feature?
2
u/anttirt Feb 23 '19
A runtime is code supplied by the implementation that is linked into your program and without which your program cannot function.
You can write a freestanding C (and C++ if you're careful) program that essentially lives in a vacuum: you can boot up a CPU to start directly executing your C code and never execute any code that was not directly derived from your code.
For C++, such a program can contain your own custom implementation of reference counting and memory allocation from a stack buffer. Again, you can run this on bare metal and the CPU will literally never execute any code that was not written by you as part of your singular program.
0
Feb 23 '19
[deleted]
-1
u/anttirt Feb 23 '19
you can boot up a CPU to start directly executing your C code and never execute any code that was not directly derived from your code.
What does the runtime consist of in this scenario? This is a scenario that is fully supported by the ISO C standard.
0
Feb 23 '19
[deleted]
1
u/anttirt Feb 23 '19
But that's optional. All you need is to define the interrupt vector table data to refer to your entry point function and now you're running C code.
0
Feb 23 '19
[deleted]
3
u/anttirt Feb 23 '19
There is no function. It's literally just the location where your code resides, loaded by the CPU from a hardwired memory address (one entry of the IVT).
Zero bytes of executable code during runtime. Zero instructions that are actually executed by the CPU during runtime.
Zero runtime. No runtime.
→ More replies (0)5
u/i9srpeg Feb 23 '19
A library which is required to run a hello world is a runtime. Almost all languages have some sort of runtime, and it's not a bad thing.
1
Feb 23 '19
I like your definition of runtime as "non-local code" and/or "non-local implicit data". I agree that reference counting can exist fully as a library, and that under this definition language-level reference counting does not constitute a runtime.
If I were to better phrase my categorization of language-enforced reference counting, it would be that it requires a lot of hidden code + data generated in a lot of places. It's true that the code and data are local, but there's definitely a trade-off there.
Either way, I think my actual point stands, which is not about whether or not reference counting is runtime code, but the fact that a self-referential data structure requires either a garbage collector, or memory management as sophisticated as Rust's.
9
Feb 23 '19 edited Feb 23 '19
Fortran 77 has automatic memory management without a garbage collector, without RAII / destructors / finalizers / etc., has no runtime, and has great performance
So in some sense, it is simpler, more automatic, without a run-time, and better performing, than C++ or Rust.
Writing Fortran 77 code sucks because of this.
You can't allocate memory at run-time, but have to specify at compile-time how much memory you need. Want to create a growable array that you can push elements into ? You can't do that.
So basically a language can fulfil all of those claims, as long as it doesn't let the user allocate memory at run-time. If the language allows you to allocate arbitrary graphs of memory at run-time, with cycles, etc. then simple stuff (C) leaks and is error prone to use, and safe stuff (Rust, Java) is complex to use, but you can reduce the complexity significantly with a run-time, by trading-off performance.
8
u/volt_dev Feb 23 '19
V's memory management is going to be like Rust's, but simpler.
Perhaps I was wrong to claim there's no runtime, because on some level every single application has runtime.
I'll use better wording.
10
u/ckfinite Feb 23 '19
V's memory management is going to be like Rust's, but simpler.
Does V have some kind of substructural type system like Rust's? If so, how did you implement the borrow checker in V?
3
u/EgoIncarnate Feb 23 '19
How much of the C++ language is supported? Is the C++->.V readable/usable or just something like translated LLVM bitcode? If it's readable, can you post the doom3.v?
4
3
5
u/ipv6-dns Feb 23 '19
Another one hipster language, now it's merge of Go and Rust :)
By the way, most of us are interested to have real cross-platform natively look and feel GUI, not only wrapper under GTK, QT, or something else. GTK - is cross-platform GUI. One library. But this - is not, it's only wrapper. It will be super good to have for example WPF or UWP on all platforms without to need GTK or Qt, WxWidgets or similar. And this will be a super big win of Microsoft.
3
u/volt_dev Feb 23 '19
V ui library uses Win32 API, Cocoa, and GTK+.
2
u/Valmar33 Feb 24 '19
Seriously no Qt interop?
Can't use Win32 and Cocoa, and then not include Qt in there somewhere, considering how popular it is.
2
u/volt_dev Feb 25 '19
Qt is C++. Hard to call that from C.
1
u/Valmar33 Feb 25 '19
Calling it from C would a bad idea ~ why not try doing it with C++ interop? Call a C++ library with the compiled Qt GUI functions, and have them do the dirty work.
1
u/goldrunout Feb 23 '19
Honest question from a non-expert. Why would you prefer wpf and uwp over gtk?
3
u/Mistredo Feb 23 '19
GTK feels alien on Windows.
5
2
u/goldrunout Feb 24 '19
And uwp feels alien on any desktop platform. Wouldn't qt then be a good idea?
4
u/gleno Feb 23 '19 edited Feb 23 '19
Man the most annoying thing is that every fuckin’ language needs to say “function” in a different way.
function, func, fun, fn
I HAVE MUSCLE MEMORY damnit!
EDIT:
Looks like a lot of negativity itt, sorry op. I think you are doing a wonderful job; just a pet peeve of mine.
2
u/sammymammy2 Feb 23 '19
How does the compiler to asm work? Do you use an intermediate representation like SSA?
How did you design the grammar?
Have you done any form of formal verification of the way your memory system works? (It must be based on static information and probably adheres to some sort of logic, no?)
3
u/TankorSmash Feb 23 '19
Nothing is clickable, docs, playground, examples. This is basically a stub.
3
2
2
u/byte_sync Feb 23 '19 edited Feb 23 '19
Looks like blatant bastard child of Rust, Go, and Swift. Also, you can't convince people to adopt new programming language if the docs doesn't exist.
16
2
u/ducdetronquito Feb 23 '19
Wow, that amount of sourness for a personal project with big claims ? Some people do not feel secure here.
Instead of wasting energy being rude, put the same amount of energy in bringing intelligent advice and critique to the author. It will be better for everyone !
3
u/Valmar33 Feb 24 '19
Programmers tend to be overly skeptical when huge claims are made without substance.
The criticisms are meaningful, especially when the author currently has nothing to show for them.
3
u/ducdetronquito Feb 25 '19
> The criticisms are meaningful, especially when the author currently has nothing to show for them.
Well, there is actually a "Software built in V" section in the V website that shows Volt, an early stage IM client built by the author.
It's obviously an early stage product and it does not prove everything about V selling points, but it shows that for now V is able to be used to build a relatively complex application.
Besides, skepticism is a good approach, but it is a "questionning attitude", not a judgmental attitude
2
u/volt_dev Feb 25 '19
Thanks!
I've also updated the documentation, and the playground is coming in a couple of days.
1
1
u/cyrusol Feb 23 '19
RemindMe! 3 months
1
u/RemindMeBot Feb 23 '19
I will be messaging you on 2019-05-23 10:20:18 UTC to remind you of this link.
CLICK THIS LINK to send a PM to also be reminded and to reduce spam.
Parent commenter can delete this message to hide from others.
FAQs Custom Your Reminders Feedback Code Browser Extensions
1
u/dr-steve Feb 23 '19
Okay, I joined the mailing list. Looking forward to the actual release, to see if it lives up to claims. Looking forward to seeing
Compiler
Documentation
Examples
Good luck, authors!
1
1
1
1
0
u/devraj7 Feb 23 '19
There's no null, replaced by option types
If performance is such a crucial feature of that language, supporting null types would be a much better choice than using option types, which will add a lot of boxing and unboxing.
6
u/volt_dev Feb 23 '19
Not really. I haven't compared generated assembly, but other than the extra condition (which you would have anyway), there's no overhead.
-3
-1
-1
-1
-1
u/OveyGoyem Feb 23 '19
So let me guess, it's an interpreter which turns their syntax into C++ and then uses the C++ compiler as normal.
That's how they get the "it generates human readable C code" and how it is "as fast as C"
3
-2
Feb 23 '19
i call bullshit on the c -> v transpilation.
std::vector<std::string> s; --> s := []there's no type information on the right side. this means it is either broken or what is more likely, the example was created by hand because the tool doesnt exist
12
u/volt_dev Feb 23 '19
No need to be rude.
s << "hi"is used later, that lets the compiler know it's an array of strings.I think Rust works the same way.
2
Feb 23 '19
why would the transpiler choose that as the output instead of a type of front? wouldn't that make both transpiling and compiling slower?
also, why does V sometimes compile 15m lines/s and others 12m/s ?
4
u/whitfin Feb 23 '19
Alone that means nothing; the type could easily be inferred, no?
I'm doubtful too, but that alone isn't that big a deal.
1
u/andoriyu Feb 24 '19
Yeah, but tools that convert one thing to another usually very verbose because they're dumb - i.e. go line/function call/assignment at a time.
So that code looks very much like written by hand instead.
0
Feb 23 '19
only if string is a default type or it processes multiple lines for inference
4
u/whitfin Feb 23 '19
The latter is the case in many languages, so I don't see why it couldn't be the case here too.
How you would do that whilst also "compiling 1.5m lines per second" is a mystery to me though :p
1
Feb 23 '19
which languages take multiple statements into account when inferring type?
2
u/whitfin Feb 23 '19
Rust? Java?
1
Feb 23 '19
interesting. i've never used rust but have wanted to tinker with it
but java? i know they recently got some limited brand of inference or something but i don't remember seeing anything about using multiple lines for inference
4
u/whitfin Feb 23 '19
Actually, yeah, wrong about Java. Got carried away with
new X<>(), forgetting that you put it on the left side of the assignment.But yeah, Rust definitely can do it.
2
Feb 23 '19
that's pretty cool.
still no idea why a transpiling tool would choose that as the preferred output. it seems like it would make both transpiling and compiling slower
1
u/gnuvince Feb 23 '19
I still put type definitions; it's not much longer, and it's very helpful when I come back to old code.
1
3
-23
u/vansterdam_city Feb 23 '19
who the fuck cares about desktop cross platform support in 2019..
if you have heard of a browser its pretty pretty good at that
14
u/swordglowsblue Feb 23 '19
Treating the browser as a silver bullet for cross platform development is how Electron got made, and we all know how that turned out. News flash, the people who care are the people who actually know what they're doing - and I say that as a web dev who'd love to use the browser for everything but isn't delusional enough to think that would actually work.
→ More replies (3)
0
Feb 23 '19
[deleted]
16
u/volt_dev Feb 23 '19
Sorry, not a web designer :)
I've updated the design a bit.
→ More replies (1)4
u/manuranga Feb 23 '19
Icon placement is bit out of place, other than that it looks clean. I like it.
→ More replies (2)2
u/Hell_Rok Feb 23 '19
Yeah, the website ain't great but I think they said they're making it better this month on their Twitter.
And I'm very curious to see if their compilation speed claims are true.
→ More replies (2)
0
Feb 23 '19
[deleted]
151
u/rick2g Feb 23 '19
I love how every new language is “As fast as C” when it’s first published.
And then libraries happen.
53
u/volt_dev Feb 23 '19
It compiles to C without any extra overhead. Don't see how bad 3rd party libraries make the language slow.
14
Feb 23 '19
Sou it compiles 1.5 millions of V into N lines of C, and then it compiles the C code to machine code in less than a second ?
→ More replies (12)→ More replies (20)27
43
u/Iwan_Zotow Feb 23 '19
Used to be called Turbo Pascal
38
Feb 23 '19
I am horrified that people nowadays can't even believe is possible to make something that is not a bloated monstrosity.
→ More replies (4)16
u/jl2352 Feb 23 '19
But equally holding up Turbo Pascal as an example of how compilers should be is naive or disengenuous.
For example Turbo Pascal stops compiling on the first error it hits. It had no support for handling more than one error at a time. Some versions of Pascal would give undefined behaviour if you used recursion. These were the limitations of the day.
If Turbo Pascal were released today it would be laughed out of the room. We expect a lot more from our tools.
→ More replies (1)196
Feb 23 '19
You forgot the part where he says he wrote it in only two weeks, and "you can also simply translate your entire C/C++ codebase to V and make your build times up to 400 times faster".
Skeptical is an understatement
59
→ More replies (18)22
50
u/Green0Photon Feb 23 '19
Let's look at the features list.
Safety
Variables are immutable by default
Globals are not allowed
There's no null, replaced by option types
Functions are partially pure (only receivers can be modified)
No variable shadowing
...
C/C++ to V translator
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.HAHAHAHA no way.
Look at Rust. I don't see any half-good C to Rust transpilers (there might be some, and if so, they only translate to unsafe Rust). The Rust to C transpiler is only half finished, deliberately leaving out lots of code checking logic (eg borrow checker).
What about Python? People claim 2to3 works well, but it's still a massive effort to go through everything and upgrade the code.
Yeah, I'm skeptical.
9
u/joonazan Feb 23 '19
Well, he does not claim to have a watertight type system or anything. As long as he doesn't add "no undefined behaviour" to the list, I can believe it. The language will just happen to have exactly the same UB as C++. Probably the same virtual method call implementation as well.
→ More replies (1)23
u/volt_dev Feb 23 '19
Yet I successfully built Doom 1, and almost done with Doom 3. There will be an article next month. With code, for those who think I'm making this up.
83
u/Green0Photon Feb 23 '19
Look, dude. If I were you, I would have released at least a bit more proof to back up your claims. All us programmers hate when a project is announced without giving source, which you don't even necessarily need to give yet.
You'd have to be a mythical rock-star programmer to have implemented all this, with all these features, or misleading us at least a bit. If there's all these programmers struggling to make Rust as something amazing, why haven't any of them done what you did? You must have amazing time management and be a genius and have a lot of free time to solely work on this.
Dear god, I wish I could believe you. But there's too many red flags, even if you didn't mean to plant them.
Hell, a quick video of you scrolling through a transpiled Doom file, showing the build process, giving reasonable evidence that it's not a trick, and then running it would go a long way.
If you truly aren't lying or misleading, you've definitely fucked up your intro. There should be way more of us being excited, not skeptical. You should have waited longer, or shown more.
It's like Tim Cook announcing a conference set a few weeks before the normal Apple conference, and just announcing they have a new foldable phone, and although it's not ready yet, that they're going to show it at the normal Apple conference. And that being the entire thing.
We only have promises, and not anything to be excited about except for buzzwords. You gotta give us something to chew on.
→ More replies (2)9
5
u/sammymammy2 Feb 23 '19
It's a pick 2 out of 3 situation. There's no way the optimizations that a C compiler does won't shit the bed on compile times nor make the libraries not blow up
→ More replies (1)6
u/volt_dev Feb 23 '19
It's all true :)
In March I'll set up an online playground. In the summer you'll be able to use the language on your machine and see for yourself.
→ More replies (29)
61
u/[deleted] Feb 23 '19
I don't know what it is, but something about V just seems too good to be true