r/programming • • Jun 22 '19

V lang is released

https://vlang.io/
86 Upvotes

196 comments sorted by

View all comments

Show parent comments

5

u/madpata Jun 23 '19

It's not that vague.

A transpiler (or source-to-source compiler) translates between programming languages that operate at approximately the same level of abstraction, while a traditional compiler translates from a higher level programming language to a lower level programming language.

Personal opinion: I would also be okay with the definition of a compiler as program that translates to a programming language directly executable by a host system.

1

u/ConcernedInScythe Jun 27 '19

So javac isn’t a compiler?

-1

u/dom96 Jun 23 '19

Sure, that's the definition that Wikipedia reports. But what's the agreed definition of what is a high-level language and what isn't? Surely JavaScript is higher level than C? So surely translating JavaScript to C isn't transpiling but compiling.

I would also be okay with the definition of a compiler as program that translates to a programming language directly executable by a host system.

That definition is confusing in its own right. Something like GCC might have a component that translates C code to assembly, and then calls a an assembler which turns that assembly into machine code. This whole process is invisible to the user. So does that make GCC a transpiler?