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
2 answers
176 views

Sandboxing interpreted code

I have a little pet compiler project that generates bytecode interpreted by a virtual machine. The language is kind of low-level, as it allows the user to manually allocate memory and dereference any ...
chrysante's user avatar
  • 127
0 votes
1 answer
94 views

Bytecode format and loading in language VMs

I am thinking about how to build a language VM. I have been able to get some of the basic constructs right, including jumps to functions within the chunk of bytecode that is currently loaded. But now ...
mydoghasworms's user avatar
2 votes
1 answer
166 views

How to model opcodes effectively for a language VM?

I am learning about building a language VM with the long-term goal of writing an own language. For guidance, I am looking at this LC3 tutorial by Justin Meiners and Building a Language VM by Fletcher ...
mydoghasworms's user avatar
1 vote
2 answers
87 views

How a VPS processes an incoming packet (conceptually)

I'm interested in understanding, conceptually (e.g., similar to how many of the concepts in networking are explained in textbooks like Tanenbaum's Computer Networks, or Kurose's Computer Networking), ...
user7088941's user avatar
2 votes
1 answer
200 views

How should a bytecode VM call external C functions?

I am trying to implement a basic bytecode VM, which I plan to target with a compiler. How can I implement the ability to call external C functions using the bytecode, i.e., call arbitrary functions in ...
Greatcode's user avatar
1 vote
0 answers
64 views

VM-images: how protect time-license programs?

One big customer asked me to supply my program to run within a balanced VM-images structure; I mean, the program will be recorded into an image which will be launched in "instances" to ...
David BS's user avatar
  • 119
5 votes
4 answers
323 views

Use of globals in stack-based virtual machine implementation

I'm implementing a stack-based virtual machine in C. The following variables are used by pretty much every function: memory array various pointers to memory offsets program counter stack stack ...
retrodev's user avatar
  • 387
-3 votes
1 answer
183 views

Is there any reason I shouldn't use a LInux host for a Linux guest VM?

I'm a developer and my typical environment is to use is a Linux guest OS running inside VirtualBox on a Windows host. Most software companies don't allow developers to install Linux bare metal on ...
Johnny Alpha's user avatar
0 votes
1 answer
216 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. ...
Paul Razvan Berg's user avatar
3 votes
2 answers
108 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 ...
Aviv Cohn's user avatar
  • 21.2k
1 vote
2 answers
132 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 ...
Aviv Cohn's user avatar
  • 21.2k
7 votes
1 answer
700 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 ...
Aviv Cohn's user avatar
  • 21.2k
-4 votes
1 answer
89 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 ...
Vishal Subramanyam's user avatar
3 votes
1 answer
173 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 ...
Aviv Cohn's user avatar
  • 21.2k
0 votes
1 answer
105 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 ...
user3656099's user avatar
8 votes
1 answer
245 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. ...
john c. j.'s user avatar
1 vote
1 answer
263 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[...
Lance's user avatar
  • 2,561
4 votes
4 answers
2k 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 ...
Lance's user avatar
  • 2,561
1 vote
4 answers
283 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 ...
Aviv Cohn's user avatar
  • 21.2k
2 votes
1 answer
1k 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 ...
AirBlast's user avatar
4 votes
2 answers
3k 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 ...
Aviv Cohn's user avatar
  • 21.2k
-1 votes
1 answer
144 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 ...
bark-at-the-moon's user avatar
-2 votes
2 answers
626 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 ...
Benjamin Egelund-Müller's user avatar
3 votes
4 answers
2k 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, ...
Nergal's user avatar
  • 313
2 votes
1 answer
421 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 ...
Aziz's user avatar
  • 123
5 votes
2 answers
1k 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 ...
Nergal's user avatar
  • 313
-1 votes
1 answer
184 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 -...
Aviv Cohn's user avatar
  • 21.2k
1 vote
2 answers
336 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 ...
sharptooth's user avatar
  • 4,349
-3 votes
1 answer
83 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 ...
lovemyjob's user avatar
  • 111
2 votes
1 answer
137 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 ...
einpoklum's user avatar
  • 2,488
0 votes
1 answer
45 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 ...
Alexey Kamenskiy's user avatar
-1 votes
1 answer
368 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 ...
Grawprog's user avatar
1 vote
2 answers
187 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(&...
Sam Neezneny's user avatar
1 vote
2 answers
3k 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 ...
Dana's user avatar
  • 121
2 votes
1 answer
355 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 ...
Christophe De Troyer's user avatar
1 vote
1 answer
787 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 ...
Nergal's user avatar
  • 313
1 vote
1 answer
834 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, ...
Florian Dietz's user avatar
1 vote
1 answer
212 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 ...
Sean Clark Hess's user avatar
4 votes
2 answers
395 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 ...
Zachary Johnson's user avatar
4 votes
3 answers
3k 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 ...
Christian Dean's user avatar
1 vote
0 answers
80 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 ...
dmux's user avatar
  • 151
56 votes
3 answers
12k 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 ...
Mael's user avatar
  • 2,315
2 votes
1 answer
1k 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 ...
Synaps3's user avatar
  • 147
0 votes
1 answer
631 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. ...
Zabs's user avatar
  • 167
2 votes
2 answers
2k 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 *) ...
jado's user avatar
  • 131
2 votes
1 answer
1k 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 ...
Forivin's user avatar
  • 129
3 votes
0 answers
84 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 ...
Martyn's user avatar
  • 795
9 votes
1 answer
328 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 ...
Asterisk's user avatar
  • 353
3 votes
2 answers
1k 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 ...
Max Heiber's user avatar
0 votes
1 answer
439 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 ...
Coder3000's user avatar