Bringing Scripting back to VB

| by Jonathan Allen Follow 578 Followers on Feb 21, 2008. Estimated reading time: 1 minute |

Historically Visual Basic has its roots in scripting and dynamic programming, but never fully embraced it. This is seen in mismatched language features such as the ability to consume objects via late binding, a.k.a. duck typing, but no ability to define them. In a presentation at Lang.NET, Paul Vick talks about bringing scripting back to VB.

His first demo shows an Excel prototype that offers a REPL interface with the full Visual Basic engine. REPL, or Read-Evaluate-Print-Loop, is a standard feature for dynamic languages such as Ruby, Python, and Lisp. The scripting window is based on the Dynamic Language Runtime, so it also supports IronPython and JScript.

Paul first discusses the three layers of the VB compiler. On top of the Core services, the traditional compiler features such as parsing and code generation, is the project services. This handle project level details like references and resources. It also has a decompiler which is used in conjunction with the background compiler to make incremental changes when working in the Visual Studio IDE. The outer-most layer is the Tool/IDE services, which includes all the features needed Visual Studio like code completion and error correction.

The full version of core services for VB compiler is written in unmanaged C++ code. A partial version of core services written in Visual Basic also exists for runtime compilation and late binding.

The future version of VB may contain the full version of core services suitable for runtime use. Perhaps this would even include Tool/IDE services layer allowing developers to create a VBA-like experience.

Another demo discusses the VisualBasic.Editor and VisualBasic.Compiler namespaces. This demo shows how to host a VB Editor in a WinForms application. The editor is still fairly rough, but it does already support things like syntax coloring. In the demo, Paul demonstrated overriding the editor's behavior to immediately execute highlighted by right-clicking.

There is no timeline or definite plans for these features. When more information is available it will be posted on Paul Vic's blog.

Rate this Article

Adoption Stage

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread


Login to InfoQ to interact with what matters most to you.

Recover your password...


Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.


More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.


Stay up-to-date

Set up your notifications and don't miss out on content that matters to you