haunter 2 days ago

What’s the difference between an emulator and a simulator in this context?

  • bityard 2 days ago

    There is LOADS of gray area, overlap, and room for one's own philosophical interpretation... But typically simulators attempt to reproduce the details of how a particular machine worked for academic or engineering purposes, while emulators are concerned mainly with only getting the desired output. (Everything else being an implementation detail.)

    E.g. since the MAME project considers itself living documentation of arcade hardware, it would be more properly classified as a simulator. While the goal of most other video game emulators is just to play the games.

    • Imustaskforhelp 2 days ago

      I don't want to offend you , but this has made me even wonder more what the difference is.

      It just feels that one is emulator if its philosophy is "it just works" and simulator if "well sit down kids I am going to give you proper documentation and how it was built back in my days"

      but I wonder what that means for programs themselves...

      I wonder if simulator==emulator is more truer than what javascript true conditions allow.

    • [removed] 2 days ago
      [deleted]
    • anthk 2 days ago

      Not the case at all. Tons of emulators are near 100% accurate.

      • Brian_K_White 2 days ago

        Irrelevant to the concept being expressed, and does not invalidate.

        The goals merely overlap, which is obvious. Equally obviously, if two goals are similar, then the implimentations of some way to attain those goals may equally have some overlap, maybe even a lot of overlap. And yet the goals are different, and it is useful to have words that express aspects of things that aren't apparent from merely the final object.

        A decorative brick and a structural brick may both be the same physical brick, yet if the goals are different then any similarity in the implimentation is just a coincidense. It would not be true to say that the definition of a decorative brick includes the materials and manufacturing steps and final physical properties of a structural brick. The definition of a decorative brick is to create a certain appearance, by any means you want, and it just so happens that maybe the simplest way to make a wall that looks like a brick wall, is to build an actual brick wall.

        If only they had tried to make it clear that there is overlap and the definitions are grey and fuzzy and open to personal philosophic interpretation and the one thing can often look and smell and taste almost the same as the other thing, if only they had said anything at all about that, it might have headed off such a pointless confusion...

      • bityard 2 days ago

        Huh? I didn't mention anything about accuracy. And "accuracy" (an overloaded and ill-defined term on its own) doesn't have anything to do with the differences between simulators and emulators.

      • Imustaskforhelp 2 days ago

        exactly. makes you wonder , is it all just philosophical.

        Calling the same thing a different name.

  • o11c 2 days ago

    In theory, an emulator is oriented around producing a result (this may mean making acceptable compromises), whereas a simulator is oriented around inspection of state (this usually means being exact).

    In practice the terms are often conflated.

    • codr7 2 days ago

      The difference is about as crystal clear as compiler/interpreter.

      • Imustaskforhelp 2 days ago

        compiler creates a binary in elf format or other format which can be run given a shared object exists.

        Intepreter either writes it in bytecode and then executes the bytecode line by line ?

        Atleast that is what I believe the difference is , care to elaborate , is there some hidden joke of compiler vs intepreter that I don't know about ?

    • ijustlovemath 2 days ago

      Adding some anecdata, I feel like emulator is mainly used in the context of gaming, in which case they actually care a great deal about accurate reproduction (see: assembly bugs in N64 emulators that had to be reproduced in order to build TAS). I haven't seen it used much for old architectures; instead I'd call those virtual machines.

      definitely agree on simulator though!

  • amszmidt a day ago

    I think it is more about design, emulation mimics what something does. A simulator replicates what something does.

    It is a tiny distinction, but generally I'd say that a simulator tries to accurately replicate what happens on an electrical level as good one can do.

    While an emulator just does things as a black box ... input produces the expected output using whatever.

    You could compare it to that an accurate simulator of a 74181 tries to do it by using AND/OR/NOT/... logic, but an emulator does it using "normal code".

    In HDL you have a similar situation between structural, behavioral design ... structural is generally based on much more lower level logic (eg., AND/NOR/.. gates ...), and behavioral on higher logic (addition, subtraction ...).

    "100%" accuracy can be achieved with both methods.