Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » Compilers & Languages   (RSS)

Codegen for On Error Resume Next

VB has a " On Error Resume Next ", which tells each line to swallow exceptions and just keep executing to the next line. It's kind of like a try-catch around every single line. It may be tempting for C++ developers to make fun of VB for this, but this
Posted by jmstall | 3 Comments

Things in Metadata that are missing in Reflection

System.Reflection is a high-level way of describing Types in .NET targetted at managed code consumers. The API is easy to use, but does not expose all the information that's actually present and affecting decisions. For example, Reflection does not expose
Posted by jmstall | 1 Comments

Return vs. Finally (2)

The Return statement and finally have competition. Both can are the "last" thing to execute when a function exits, so which of them is really last? I blogged about this before regarding C#'s semantics setting data. Now I'll compare some interesting differences
Posted by jmstall | 4 Comments

Quiz: What runs before Main()?

Quiz: What managed code runs before managed Main() in your program startup path? Answers : I note "managed code", because obviously the CLR startup code gets executed, as does other native startup code. 1) The common answer is static constructors referenced
Posted by jmstall | 5 Comments

Why debugging breaks in optimized (production) builds.

You may have noticed that debugging optimized builds (eg, what you commonly get when you attach to a end-user instance of your app that wasn't launched from your debugging environment) is usually a degraded experience. At an architectural level, there's
Posted by jmstall | 7 Comments

Techniques for Debugging IL

I mentioned in the recent dev lab that you can debug at the IL level . I demoed two ways to do this, and here I wanted to compare them more thoroughly. The big thing that's missing is that while you can do IL level stepping, you can't view the IL evaluation
Posted by jmstall | 4 Comments

TypeDef vs. TypeRef

Many of the .NET docs use the phrase "TypeDef or TypeRef". What's the difference? Both refer to metadata tokens. Each token has a scope for resolving the token, which basically corresponds to a module (a .dll or .exe). IMetaDataImport is the interface
Posted by jmstall | 2 Comments

Measuring language complexity: Do you need a debugger?

When people are asking for a debugger for language X, practically it means that the usage of language X has gotten sufficiently complicated that mere inspection is insufficient for diagnosing problems. I alluded to this when I said that XML is code .
Posted by jmstall | 2 Comments

Using Foo<T>(...) instead of Foo(System.Type, ...)

Whenever you're passing in a parameter of System.Type that is usually determined at compile-time, consider having a version with a generic parameter. This converts runtime checks into compile time checks, may let you have more efficient code, and likely
Posted by jmstall | 8 Comments

Resolving functions and func-eval syntax

I got a question about MDbg's func-eval syntax, which brings up a nice point about function resolution: Is it possible to evaluate a function by specifying an instance variable instead of the fully qualified name of the class? f ex.get_StackTrace ...

Debugabbility with Roundtripping Assemblies

I've gotten several questions about debugabbility IL round-tripping. Round-tripping is where you decompile an app (perhaps via ILDasm), potentially edit the IL, and then recompile it (perhaps via ILAsm). This is the backbone for rewriting an assembly,

Presentation on AOP + Debuggability

Today I gave a presentation on AOP + debuggability on .NET as part of Microsoft's AOP workshop ( http://research.microsoft.com/workshops/aop/ ). The presentation is available online here (it's power point). The deck has some bonus slides that I didn't
Posted by jmstall | 1 Comments

AOP and Debuggability

I'll be giving a short presentation at an upcoming Microsoft workshop on Aspect Oriented Programming on .NET. More information about the workshop is here: http://research.microsoft.com/workshops/aop/ I don't know much about AOP, but I do know a thing
Posted by jmstall | 0 Comments

Compiling a language to C#

Several people have written me to say that they're writing their own language (let's say 'X') and they compile their language to C# and then compile C# to IL. This is instead of directly compiling X to IL. This can be attractive because: 1) using C# constructs
Posted by jmstall | 12 Comments

Having debugger-friendly codegen

One of the things I like about C# anonymous delegates is that the codegen is clever enough that they're reasonably debuggable without any additional debugger support. This type of debugger-friendly codegen is a key part in making your 3rd-party language
Posted by jmstall | 0 Comments
More Posts Next page »
 
Page view tracker