Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
67 views

OS tax in dockerized production environment [on hold]

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 ...
-3
votes
2answers
107 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 ...
0
votes
0answers
24 views

Creating an API for adding third-party JIT support to a VM

I have created my own VM/runtime environment engine and I would like to give my runtime environment an API so that a developer could interface any type of JIT compiler to my VM. So far I've created ...
2
votes
3answers
316 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, ...
0
votes
1answer
98 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 ...
1
vote
2answers
178 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
118 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
1answer
266 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
70 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
118 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
39 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
147 views

Supply Dev Boxes For Team

All of our developers are remote in our company, including myself. The vast majority of our work centers around Laravel on a LAMP stack. We have various devs, some that are just for coding, some are ...
-1
votes
1answer
124 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
106 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
1k 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
148 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 ...
0
votes
1answer
287 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
371 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
97 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
228 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 ...
2
votes
3answers
1k 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
74 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 ...
50
votes
3answers
6k 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
515 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
349 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
831 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
540 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 ...
0
votes
0answers
105 views

Arbitrarily sized (and signedness) integer arithmetic in C++ - How can it be done generically at runtime?

How can I efficiently handle integers of unknown size and signedness in various arithmetical operations in C++? (for a virtual machine). I am storing the program for the virtual machine in a string ...
2
votes
0answers
75 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
274 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 ...
2
votes
2answers
548 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
258 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
681 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
364 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
76 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
9k 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 ...
32
votes
8answers
19k 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 ...
0
votes
1answer
331 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 ...
3
votes
2answers
3k 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
621 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? ...
5
votes
4answers
4k views

How can I implement an 'if' statement in an interpreter?

If I were writing a compiler (say for a stack-based VM), the code for an if statement: if (<some_expression>) { <some_instructions> } Would be translated to the following psuedo-...
0
votes
2answers
772 views

Virtual machines versus containers, what use cases are suited to each? [closed]

I hear a fair amount of people using Docker these days, and I am wondering where they execl compared to virtual machines, and when a virtual machine would be a more suitable choice.
1
vote
1answer
566 views

Paravirtualization and process virtualization: with or without hardware support?

In Tanenbaum's Modern Operating Systems, fourth edition, about virtualization: Are Virtualization without HW support, Virtualization with HW support, Paravirtualization, and Process virtualization ...
-2
votes
1answer
147 views

VCS a Vagrant box [closed]

I have two computers (1 Laptop with Ubuntu that I use for development in 99% of my time but I also have a pretty much unused PC with Windows. I also have an unused server machine at home. I would like ...
3
votes
1answer
757 views

If using a VM as a development environment, should tooling live inside the VM or on the host?

There are a couple of questions already here for whether or not a VM should be used as a development environment. I don't wish to answer that question here but I'm assuming that a VM should be used as ...
2
votes
1answer
171 views

Unique_ptr to hold memory for custom VM

I work for a company that use a custom DSL and my job is to port the VM to C++. I'm trying to do this in compliance with the C++11 standard so i use auto when appropriate, the new for syntax, etc. ...
1
vote
2answers
1k views

Why does a bytecode VM use stack or registers opposed to direct operations? [duplicate]

I'm working on a simple bytecode interpreter to learn how virtual machines work. I've read about VMs and it seems that all of them are either stack based or register based. At the time it made sense, ...
2
votes
1answer
306 views

Is the JVM “heap” inside the JVM software, or inside the physical computer?

I wanted to as this question about VMs in general, but focused it to JVM implementations only so this doesn't get closed as too broad. The JVM has a concept of a "heap". If my understanding is ...
2
votes
0answers
53 views

how to combine logs coming from multiple virtual machines for processing?

Scenario: Two virtual machines produce logs. I want these logs to be sent to a central server for processing (as soon as a line of these logs is generated-->streaming ). The condition here is that I ...
1
vote
2answers
905 views

Prevent product key from being used on multiple virtual machines

I have a software product. it will probably run on VMs that have no network connection at all. I want the user to pay for each VM the user runs. I thought to ask the user for some kind of hardware ...