Bringing Scripting back to VB

by Jonathan Allen on Feb 21, 2008 |

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


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

General Feedback
Marketing and all content copyright © 2006-2016 C4Media Inc. hosted at Contegix, the best ISP we've ever worked with.
Privacy policy

We notice you're using an ad blocker

We understand why you use ad blockers. However to keep InfoQ free we need your support. InfoQ will not provide your data to third parties without individual opt-in consent. We only work with advertisers relevant to our readers. Please consider whitelisting us.