카테고리 없음

Compiled languages v.s. Interpreted languages

bona.0 2022. 9. 27. 00:45

 

https://www.google.com/url?sa=i&url=https%3A%2F%2Fmedium.com%2F%40astermanuelg%2Fblurred-lines-is-ruby-an-interpreted-language-2d3d6bca3d37&psig=AOvVaw1-_fjgVFGa64FhcVNLwFBF&ust=1664292768504000&source=images&cd=vfe&ved=0CA0QjhxqFwoTCPibg-zjsvoCFQAAAAAdAAAAABAD

 

1. Compiled languages

  • Compiled languages are directly converted into machine code that the processor can execute.
  • The target machine directly translates the program.
  • If a person writes the code, the compiler separates the file and the end result is an executable file. So basically, the owner keeps the source code.
  • Compilation errors prevent the code from compiling.

 

  • Advantage: tend to RUN faster than interpreted code. This is because the translation happens before the run time. 
  • Disadvantage: Additional time is needed to finish the entire compilation step before testing, 

 

e.x)  C, C++, Java, Erlang, Haskell, Rust, and Go.

 

2. Interpreted language

  • The source code is not directly translated by the target machine. Instead, a copy is given to another machine, such as the interpreter, and that machine reads and executes the code. 
  • Interpreters read a program line by line and execute each command.
  • So while in this language, interpreted programs can be modified while the program is running.
  • All the debugging occurs at the run-time.

 

  • Advantage: more flexible, allowing dynamic typing and smaller program size.
  • Disadvantage: slow execution time

e.x) PHP, Ruby, Python, and JavaScript.

 

https://www.google.com/url?sa=i&url=https%3A%2F%2Frentindiancoders.com%2Finterpreted-vs-compiled-languages-whats-the-difference%2F&psig=AOvVaw1-_fjgVFGa64FhcVNLwFBF&ust=1664292768504000&source=images&cd=vfe&ved=0CA0QjhxqFwoTCPibg-zjsvoCFQAAAAAdAAAAABAO

 

ref: https://www.geeksforgeeks.org/difference-between-compiled-and-interpreted-language/

https://www.freecodecamp.org/news/compiled-versus-interpreted-languages/#:~:text=Compilers%20and%20interpreters%20take%20human,translated%20by%20the%20target%20machine.