Welcome to Admin Junkies, Guest — join our community!

Register or log in to explore all our content and services for free on Admin Junkies.

Coding Languages That Use a Complier

Advertisement Placeholder
I question the premise of the question. Almost all languages use a compiler of some form these days. And if not the language itself, the surrounding toolchain almost certainly will.

The real difference we're talking about becomes AOT vs JIT compilation and how strict and far ahead that compilation is being run.

Let's take JS first: there's been sublanguages of JS for a while, whether that's CoffeeScript or TypeScript or whatever, that are all converted (compiled, arguably) to JavaScript. Then you have the folks who use the latest bleeding edge features that browsers don't support yet, so you'll have Babel or similar involved to do that conversion. Technically that's transpilation rather than compilation but the semantic difference is... a level of pedantry we don't want to get into. But it is often a manually invoked step via npm or whatever other build chain (e.g. webpack) is involved.

PHP is also somewhat compiled - when it reads a file, it reads the whole file at once and compiles it into the Zend engine's bytecode where it is actually executed. Now, that's not to say that it won't interpret differently depending on situation but it's certainly not quite as 'interpreted one line at a time' as many believe. But compilation is largely a transparent process that happens when a page is requested - and you can certainly save that compilation step's results (this is what opcache does)

This is a bit different to languages where you really do have a compilation step - where many of the rules are more strict, where there is limited or no guesswork at runtime about what things will do or what will be permitted (unlike JS/PHP where there is a lot more fluidity) and where there is much less 'dynamic behaviour' at runtime - JS and PHP have a function called eval() where you can pass in raw code and it'll be run, and really what it does is run the compile step on the given code to run it, but many compiled applications don't ship the compiler with them (which is what the interpreter is really doing here) so no eval.

Truly compiled languages do tend to be faster though because you don't have the compilation step run regularly, but you do it just the once and you're left with raw machine code. (By this token, though, something like Java is not really a compiled language because it doesn't ship a compiled executable, it ships the bytecode which is virtual machine code, for the JVM to still run)
 

Log in or register to unlock full forum benefits!

Log in or register to unlock full forum benefits!

Register

Register on Admin Junkies completely free.

Register now
Log in

If you have an account, please log in

Log in

New Threads

Would You Rather #9

  • Start a forum in a popular but highly competitive niche

    Votes: 5 20.0%
  • Initiate a forum within a limited-known niche with zero competition

    Votes: 20 80.0%
Win this space by entering the Website of The Month Contest

Theme editor

Theme customizations

Graphic Backgrounds

Granite Backgrounds