paperlined.org
dev > programming_languages > csharp
document updated 16 years ago, on Mar 5, 2008
Differences between the C# VM, and the VM features found in most high-level scripting languages:


    (most obviously, C# has no eval(), thus .NET processes can only execute already-generated
    bytecode, they can never start from sourcecode.  On the hand, C# seems closer to scripting
    languages than to C, since IMHO things like garbage collection/reflection/etc are MUCH more
    important to practical efficiency than eval())


- C# is statically-typed (*of* *course*), though there are several other high-level scripting languages
  that are also  (Haskell, Scala, oCaml, ...)


- Provides both lower-level peek() and poke(), as well as higher-level references.  Further, the
  proper pointers are given C-like synatic sugar for dereferencing.  This means that, if you choose
  to, you can run off the end of an array very easily.
  http://msdn2.microsoft.com/en-us/library/f3cb9cbt.aspx
  (granted, the distinction between safe and unsafe{} code means that high-level references are much
  prefered over raw pointers, but as with C, C# gives you enough rope to hang yourself (quickly), if
  you so choose)

        (note that peek(addr) and poke(addr) are NOT required for dealing with native binary data structures...  
         Perl's pack() has CPU overhead, but something like poke(obj,offset) would work as well)


- It provides several features to control what gets allocated on the stack and what gets allocated on the heap.
        http://en.wikipedia.org/wiki/Common_Type_System#Type_categories
        http://www.codersource.net/csharp_boxing_unboxing.html


- As a result of the whole stack/heap thing, as well as the apparent importance of structs being
  compatible with C code, structs/ints/floats/etc. can't be set to null with resorting to
  workarounds.
    http://msdn2.microsoft.com/en-us/library/2cf62fcy(VS.80).aspx