Questions tagged [virtual-machine]

A virtual machine is an emulation layer between a program and the OS that presents to the application a specialized environment to run in, than the raw environment that the OS provides.

Filter by
Sorted by
Tagged with
0
votes
0answers
70 views

What does it mean for an OS to compile down to a function?

I was reading the Urbit docs and stopped at this paragraph (emphasis mine): The main thing to understand about our ‘overlay OS’, as we call it, is that the foundation is a single, simple function. ...
3
votes
2answers
68 views

How do language implementations implement native-extension class instantiation?

I'm writing a language interpreter in C. I'm currently implementing a system that allows writing extension modules in C for the interpreter. These modules are loaded into a code file like a normal ...
1
vote
2answers
97 views

How do VMs and GCs treat objects which wrap yet active resources, but that are unreachable from user code?

I am building an interpreter in C for a simple programming language. The interpreter is fitted with a built in garbage collector. The GC simply marks all objects which are linked from some root (the ...
7
votes
1answer
317 views

Why is it difficult to create a truly portable garbage collector for C?

When reading the Python docs for writing C extensions, one can find the following text in the part about CPython's garbage collection strategy (emphasis mine): ... The disadvantage [of automatic ...
-4
votes
1answer
69 views

If my development machine is slow and has low end specifications, why can't I just rent a VM on Azure? [closed]

I need 16GB RAM on my development machine to do some Android programming but I can't really afford to buy a new one. So, what's there to stop me from just creating a VM on Azure, use it for just a few ...
3
votes
1answer
131 views

How can one bake a GUI framework inside an interpreter without freezing the interpreter?

I am writing a bytecode interpreter in C for a simple programming language. I want to add GUI capabilities to the language. As a first step, I decided to bake into the interpreter a wrapper for the ...
0
votes
1answer
46 views

VNC security: SSH tunnel from local machine to VM necessary?

SETUP: Local Windows 10 machine. It runs a VM (Ubuntu Server, NAT, Virtualbox) QUESTION: I want to make a VNC connection from my Local machine to the VM. Since VNC is not a secure protocol, it is ...
8
votes
1answer
212 views

To show the difference between system VMs and JVMs

I am trying to draw diagrams that show the difference between system virtual machines and Java virtual machines. The first two images looks correct to me. But I don't know how to draw the third. ...
1
vote
1answer
120 views

How is an async stack implemented?

I am working on creating a simple VM sort of thing in JS: let sp = 0 // stack pointer let m = [] // memory initialize: sp = 0 invoke: m[sp] = m[sp - 1] // position in stack m[sp + 1] = input[m[...
4
votes
4answers
1k views

Is a call stack required for robust computer architecture?

I am not too familiar with the computer architecture terminology yet so please bear with me. I seem to understand that von Neumann architectures are more robust ("universal Turing machines") as ...
1
vote
4answers
198 views

Why do some VMs manage their own memory instead of relying fully on the system allocator?

As far as I know, most "serious" VM implementations, such as CPython and the Oracle JVM, do not request new memory from the operating system ("malloc()") each time they create a new object. As far as ...
2
votes
1answer
242 views

How can I sync a git repository with directories from another machine?

My team and I use a git repository to keep track of our projects. This repository is cloned in our Windows PCs that we use to develop most of our software. However, we also use another machine ( a ...
1
vote
2answers
867 views

How are “registers” implemented in VMs?

Process VMs (such as the Oracle JVM, CPython, .NET CLR etc.) are usually stack-based or register-based. Are the "registers" in a register-based VM actually the registers of the underlying physical ...
-1
votes
1answer
131 views

OS tax in dockerized production environment

I am reading Docker deep dive since I am interested in this shiny technology. I can read: The VM model then carves low-level hardware resources into VMs. Each VM is a software construct ...
-2
votes
2answers
301 views

What is the best way to run untrusted hooks/plugins?

I'm building a data processing system where users can submit hooks to execute on incoming data. The hooks are untrusted and should execute in a sandbox with access only to a limited API that I expose ...
2
votes
3answers
876 views

GCC or Clang to output bytecode for a VM?

Long story short, I wanted to use C as a scripting language and in a portable manner so I created a register-based, JITless VM to accomplish this. I've formalized the VM's ISA, script file format, ...
1
vote
1answer
172 views

Why do we need nginx server on top of linux server?

Recently, I tried to deploy a web project to a virtual machine. I used the Ubuntu server as my OS, but while following along some tutorials I came to the fact which was very confusing for the beginner ...
5
votes
2answers
423 views

Why are most language virtual machines designed with a load/store architecture? Is there a speed advantage vs. a register-memory architecture?

I am developing a virtual machine for personal use (open source of course!) In researching and looking at the source code of other virtual machines, especially those of scripting languages; I noted ...
-2
votes
1answer
148 views

What is the minimum set of operations a language implementation must provide for it to be usable for all applications?

As a fun hobby project, I'm writing a simple bytecode VM and a compiler from a basic high-level language to the said bytecode. (Offtopic: the compiler is inspired by Jack Crenshaw's awesome tutorial -...
1
vote
2answers
314 views

Is comparing “dollar-hours” for running a specific piece of code practical as an estimate of rented system performance?

Background: there'a a gazillion types of virtual machines in Microsoft Azure each having different performance and price. Such virtual machines are paid per hour. The goal is to decide how to get "the ...
-3
votes
1answer
72 views

Sharing virtual box / environment?

I am wondering how do big development teams do it, when they all work on one project. Options are: 1 virtual machine in cloud that they ssh into and push updates via ftp ? each developer have ...
2
votes
1answer
126 views

Easy way to debug platform-specific issues of non-GUI software on Windows?

I'm maintaining a couple of software repositories (C, C++ essentially) which I want to also run - or let's start with at least build - seamlessly on Windows. Now, my desktop machine does not have ...
0
votes
1answer
43 views

How can I access attached data section in custom script language?

Sorry if title is not clear, suggestions on better title are welcome. For the purpose of [self-]education I am writing a toy scripting language that would compile to bytecode and be executed on a toy ...
-1
votes
1answer
202 views

Help With Memory Mapped I/O and Hardware Interrupts for Virtual Machine

I've been working on a 24-bit virtual machine to help me learn more about computers and programming in general and was hoping to find a bit more information on memory mapped input/output and hardware ...
0
votes
2answers
137 views

How do interpreters and VM print?

While direct Language-Assembly compilers generate the code required to perform specific task for the given platform, how do interpreters do it? Abstract example The following pseudo-code... printf(&...
1
vote
2answers
2k views

Are repeatable performance tests possible on a VM?

My application does a lot of database inserts, so disk I/O is a big part of the workload. QA does almost all testing on VM's. I'm concerned that tests intended to detect performance regressions won't ...
2
votes
1answer
261 views

Garbage collection virtual machine

Say you have a virtual machine with the following instruction set. 0 ACC <= [S] Copy address S from memory to ACC 1 ACC => [S] Copy the value of the ACC to the memory address S. 2 ...
1
vote
1answer
510 views

First time writing a scripting engine

So I decided to created a stack-based virtual machine and the result came out pretty good (in my opinion!). The first iteration was a basic toy VM. I did a rewrite to make the VM work more ...
0
votes
1answer
450 views

safely executing arbitrary code

I have a program that can get code from a user as input (This question is language-agnostic, though I am primarily interested in answers for Java and Python). Usually, this code is going to be useful, ...
1
vote
1answer
110 views

Service dependencies during local development

I'm working on a system split into multiple services. Some services (and especially the front end web server) depend on other services to function. When developing these locally, do you point to the ...
4
votes
2answers
301 views

Criteria for a language (Terra as a tricky example) to be usable for operating system development, and how to meet missing criteria

For example, a language that I was looking at recently- Terra. You can address the question in the context of any language, I'm just most comfortable with Lua so I'm starting from there. The Terra ...
3
votes
3answers
2k views

How exactly is bytecode “parsed”?

How is Bytecode "parsed"? It is my understand that Bytecode is a binary, intermediate representation of the syntax of a given programming language. Certain programming languages convert their source ...
1
vote
0answers
77 views

How is memory modeled in projects like Apache Spark or Druid?

In the past couple of months I've worked with both Apache Spark and Druid for some projects. As I've gone through the process of learning how to use these tools, I've spent some time reading through ...
51
votes
3answers
9k views

What is a type system?

Background I am designing a language, as a side project. I have a working assembler, static analyser, and virtual machine for it. Since I can already compile and run non-trivial programs using the ...
2
votes
1answer
845 views

Do bytecode compilers compile syntax directly or intermediate assembly language?

I am going to write a very simple VM and bytecode compiler. Is it typical for a bytecode compiler to read the syntax and attempt to create the bytecode directly or is there an intermediate stage to ...
0
votes
1answer
510 views

Using DB migration tools within a Virtual Machine with Vagrant

I am setting up Vagrant with multiple developers using ScotchBox (v2.5) in our workplace, I have got the initial vagrantfile working ok however I'm unsure of how best to handle Database migrations. ...
1
vote
2answers
1k views

How do Virtual Machines allocate memory?

If I want to allocate a struct in C, #include<stdio.h> typedef struct container { int i; } Container; int main() { Container *ptr_to_container; ptr_to_container = (Container *) ...
1
vote
1answer
851 views

Testing a bootloader written from scratch?

I'm planning to write a simple bootloader. Nothing too complicated. Just really basic output and maybe keyboard input. But it seems a bit crazy to restart my computer every time I want to run the ...
3
votes
0answers
81 views

One vagrant file (/var/www/VagrantFile) for multiple apps

I manage multiple apps in my dev: /var/www/ qa jt auth We have a QA vagrant which runs QA app in its own vagrant. My understanding was that each app would run its own VM but this would ...
9
votes
1answer
306 views

Computer Architectures NOT based on arrays [closed]

Wadler's original paper on Monads for Functional Programming ( Haskell ) ,he says Another question with a long history is whether it is desirable to base programs on array update. Since so much ...
3
votes
2answers
812 views

What is the point of the Common Language Runtime (CLR)?

My understanding is that part of the point of the JVM was that the code could "run anywhere", but CLR code was designed to run only on Windows: so why have a virtual machine? I know that the CLR ...
0
votes
1answer
311 views

New Kind of VM Type

I have designed my own kind of vm, a sort of stack-register. It works by having a stack but instead of pushing and popping values, you simply store the values on the stack, and add together different ...
0
votes
1answer
783 views

Implement Stack for Toy VM C++

Recently for fun I have decided to build a toy programming, compiler and a low-level register based interpreted vm. While starting to implement the virtual machine I got stuck. The stack which holds ...
2
votes
1answer
401 views

Questions about compiler/interpreter design [closed]

I am implementing a programming language, for fun, in C. I have most of the parsing code done and also the AST ready. I once did write a runtime for this language some time ago, but I had some trouble ...
0
votes
1answer
78 views

Protection against XSS using a tiny virtual-machine in browser

I'm working on a web framework that makes surveys. It has an expression manager which lets admin users run code on the client as Javascript. There could be a potential XSS problem when there's more ...
15
votes
4answers
11k views

Why is .NET VM based? [duplicate]

Java has been designed to run on a virtual machine to allow portability for programs. However .NET has been designed from the start specifically for Windows. Than what is the reason for .NET ...
35
votes
8answers
21k views

Is overriding Object.finalize() really bad?

The main two arguments against overriding Object.finalize() is that: You don't get to decide when it's called. It may not get called at all. If I understand this correctly, I don't think those are ...
1
vote
2answers
560 views

Virtualization vs Container

Most of cloud computing technologies are based on virtualization. The advertisement of cloud computing technologies often refers reliability and reduction of costs. But when compared with container ...
4
votes
2answers
4k views

Difference between PyPy and JVM

From my understanding the default Python interpreter(CPython) compiles source code into bytecode and then interprets the bytecode into machine code. PyPy on the other hand makes use of JIT to optimize ...
4
votes
2answers
771 views

Is ART an installation process? Or an OS? Or a virtual Machine?

When attempting to understand Android Runtime, I came across the wikipedia page. The graphic shown there adds to my confusion. If .dex is getting converted entirely to ELF, why is ART needed anymore? ...