Would this interpreter be considered a Virtual Machine? [closed]

(I reworded my question to make it more specific).

Consider a programming language, that it’s programs may only be run inside a specific program that serves as an interpreter.

The interpreter scans each line of the source code and executes it as it is.

Would the interpreter be considered a virtual machine?

Conceptually, a VM is a program that other programs use as a platform to run inside of. Thus this interpreter suits the definition. But this interpreter only interprets plain-text source code into executions (and not bytecode).

It depends. “executing” isn’t really the defining part of a virtual machine.

To qualify as a virtual machine, an interpreter would have to offer:

  • a memory model (ways for a program to acquire, use and release memory – is there garbage collection?)
  • APIs for IO (ways for programs to access files, networks, etc.)
  • optionally, a concurrency model (ways for programs to execute in parallel and coordinate)

And all of these would have to be well-defined and independent of the underlying OS and hardware. An interpreter that does all of this would have a good claim of being a VM.

7

I think you’re confusing a sandbox with virtual machine. A sandbox is a safe container for a single application, where as a virtual machine is a safe container for many applications. VMs often don’t restrict what those apps can be, but a sandbox can be for a specific type of app.

The difference between a sandbox and an interpreter is; An interpreter can be interrupted without killing the application, where as a sandbox can only be interrupted by killing the application.

Any interpreter could be considered a virtual machine. It entirely depends on the definition of virtual machine that you adopt.

Conceptually, a VM is a program that other programs use as a platform to run inside of. Thus this interpreter suits the definition.

Yes …

But this interpreter only interprets plain-text source code into executions (and not bytecode).

Well your definition of virtual machine does not say anything about the nature of the “platform”. So those issues are not relevant.

There is also the issue that you haven’t defined “program”. Depending on how you define it, your example may not be an example of VM because the interpreter is not a different program to the virtual machine. (On the other hand, that might just be a flaw in your definition of a “virtual machine”.)


I would point out that there is one difference between your interpreter and (say) a Java + JVM instance. In your case, the virtual machine is not exposed. It is entirely inside the interpreter. Hence, what it is and how it works is only really of academic interest.

And frankly, so is this entire topic.

1

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật