InfoQ

News

Bringing Scripting back to VB

Posted by Jonathan Allen on Feb 21, 2008 06:54 PM

Community
.NET
Topics
Programming ,
Scripting
Tags
Visual Basic.NET ,
DLR

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.

No comments

Reply

Exclusive Content

Clojure

Rich Hickey discusses Clojure features and syntax, example code, functional programming, concurrency semantics, transactions, software transactional memory, agents, implementation and pain points.

Composite Oriented Programming with Qi4j

We introduce the concept of Composite Oriented Programming, and show how it avoids the issues with OOP and reignites the hope of being able to compose domain models with reusable pieces.

Dan Farino About MySpace’s Architecture

Dan Farino talks about the system architecture and the challenges faced when building a very large online community. Dan explains how a .NET product scales on hundreds of servers.

Principles and Practices of Lean-Agile Software Development

Alan Shalloway, CEO and founder of Net Objectives, presents the Lean software development principles and practices and how they can benefit to Agile practitioners.

The Maxine VM

Bernd Mathiske discusses Maxine VM, Java compatibility, swapping major VM components, research areas, Object handling, code examples, optimizing compiler, snippets, bytecode generation, JNI and JIT.

Joe Armstrong About Erlang

Joe Armstrong speaks on various aspects of the Erlang language, presenting its roots, how it compares with other languages and why it has become popular these days.

The Limits of Code Optimization: a new Singleton Pattern Implementation

The java double-check singleton pattern is not thread safe and can’t be fixed. In this article, Dr. Alexey Yakubovich provides an implementation of the Singleton pattern that he claims is thread-safe.

Pressure and Performance – The CTO's Dilemma

Diana and Jim talk about patterns observed in CTOs' activity. CTOs emerge as real people caring for other people in their organization, and are put under a lot of pressure and constraints.