Alex Hoffman

Perspective on development, management and technology

Syndication

News

    Subscribe

    IASA Member

July 2003 - Posts

ASP.NET Web Hosting

Some time ago, we went through the process of finding a new hosting company as part of our move to ASP.NET.

Our criteria for selection included reliability, performance, service, capacity for growth and value for money. We were seeking a "quality" hosting company - one which knew the business and would continue to be around tomorrow.

We went with SecureWebs and have never looked back. So much so, that I wanted to thank them publicly.

If your looking for a "quality" ASP.NET host, have a chat with Scott Hirsch at SecureWebs.

Posted Friday, July 25, 2003 5:34 PM by Alex Hoffman | 1 comment(s)

A Faster Java* than Java - Code Available

The Java and C# code described in the earlier post - A Faster Java* than Java - is now available at http://www.alintex.com/scripts-exe.aspx

*Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc.  Visual J# .NET has been developed independently by Microsoft. It is neither endorsed nor approved by Sun Microsystems, Inc.

Posted Wednesday, July 23, 2003 5:02 PM by Alex Hoffman | with no comments

Using a Script to NGEN an Assembly

The message - "Creating .NET Native Executable Images..." - that appears during installation of Alintex Script .NET, has generated a lot of questions from users.  Some are hopeful, that it means that one can compile a .NET application to native code, while others just want to know how the installer does it.

The .NET native image generator (NGEN) application, which is installed either as part of the .NET runtime (redistributable) or the SDK (Framework), installs a native image to the native image cache which improves application startup time. It does so by precompiling code which would otherwise be compiled just-in-time.

In an application like Alintex Script, which spends a large proportion of it's execution time loading, and is typically run many times for short periods, it has a significant effect on performance. However, for a normal application, the inability for the compiler to compile just-in-time can impact on performance. It should be noted, however, that future .NET releases will diminish that disadvantage.

A couple of points to highlight, are that NGEN needs to be run against an assembly on the end users system (typically during installation). Doing so does not eliminate the need for the original assembly - one uses the original assembly as normal. The runtime automatically determines whether or not a native image exists in the cache and if it should be used.

How does the Alintex Script installer do it?

It's probably no surprise that it does so by running a script.

The script in question is called ngen.psf and internally consists of three script files - ngen.csx, application.cs and fileInputBox.cs. In this case they are all C# language files, but any one of them could be in any supported language. The script's Portable Script File Description can be viewed in your web browser.

The installer runs the script using the /unattended command line option so no output is reported to the user, however the script can also be run by specifying a file on the command line, or by double-clicking on the ngen.psf icon.

The script is available for download at http://www.alintex.com/scriptdetail.aspx?script=ngen.psf

Posted Saturday, July 19, 2003 2:16 AM by Alex Hoffman | with no comments

Generics with VB.NET and JScript.NET

Reading one of Sam Gentile's old weblog entries regarding late binding brought to mind a conversation I had recently with a VB.NET developer.

The developer was concerned that C# was soon to have "generics" - classes and methods that work uniformly on values of different types. He wasn't too sure why he should be concerned, but it was going to be something that VB.NET didn't have.

My response was that both JScript.NET and VB.NET already support "generics".  It's possible to achieve polymorphic behavior through late binding.  Granted, this does not have the compile time or performance advantage of static type-checking as with the C# implementation, but offers other benefits which are especially suited to a scripting type environment like that provided by Alintex Script .NET

An example of a script which provides polymorphic behavior through JScript.NET in Alintex Script is the following:-

print ( Sqr(9) );
function Sqr(x) { return x*x; }

One can pass parameters of different types to the Sqr function.  Pass a type that is inapplicable to the * operator and JScript.NET doesn't throw an exception - it returns "NaN" - not a number.  JScript.NET is especially concise - those two lines are a complete script.

What about VB.NET?

One can create a similar "Sqr" function, but to make it interesting I thought I might show how one can achieve apparent C# generic behavior via VB.NET with Alintex Script.

To do so, I would create two script files, named (for example) maths.vb and generics.csx.  The two script files would contain the following code:-

'maths.vb
public Module Maths
    function Sqr(x)
        return x * x   
    end function
End Module

// generic.csx
#region Script
    print( Maths.Sqr(99) );
#endregion

One would run the script by typing the following:-

> axscript generic.csx maths.vb

The answer 81 would be displayed.  The value 9 could then be substituted for other types. 

A benefit of this behavior is that I can write an extremely concise script in VB.NET like the following, which displays the list of IP addresses on my current machine...

imports System.Net

#region "Script"

    addressList = Dns.GetHostByName(Dns.GetHostName()).AddressList 

    for each address in addressList
        print(address)
    next address

#end region

Posted Thursday, July 10, 2003 11:25 PM by Alex Hoffman | 1 comment(s)

Alintex Script .NET 1.1 Released

Alintex Script .NET brings multi-language .NET and Java™† scripting to your desktop.

You can use it to produce lightweight, distributable programs that take advantage of the power and richness of Microsoft's .NET Framework and Java™† JDK 1.1.4 libraries.

Alintex Script .NET 1.1 has now been released (press release) and is available for download from www.alintex.com

This release introduces a large number of features which are listed below:-

  • supports VB.NET, C#, JScript.NET and Java™† (J#) languages
  • supports both the .NET Framework Class Library (FCL) and Microsoft's implementation of the Java™† JDK 1.1.4 libraries
  • allows one to write .NET and Java™† applications without the purchase of any additional products
  • provides for the sharing of frameworks, objects, metadata and code between Java and supported .NET languages
  • a single Alintex script can contain multiple script files in different languages
  • within a script, a script file can automatically access the functionality in other script files
  • script files can be reused across multiple scripts, providing an effective form of code reuse
  • automatic script caching and referencing ensures minimal compilation across languages
  • multiple script files, script settings, author and script information can be packed into a single Portable Script File for convenient reuse and distribution
  • a Portable Script File can be unpacked to a folder, modified by the user, then repacked back into a Portable Script File with a mouse click
  • the contents of a Portable Script File are self documenting and can be dynamically viewed in your web browser. Author information, script information, script settings and code are all displayed in the resulting web page
  • both Console (AxScript) and Windows (AxWscript) application versions are included
  • the Windows application (AxWscript) captures and displays console output. Doing so allows it to offer the versatility of running both command line and Windows targeted scripts
  • AxWscript supports a user interface which includes a notification icon and context menu. Scripts can be terminated manually, or automatically after a specified period of time. Errors can be optionally written to the application event log on supported operating systems
  • built in diagnostic support allows one to display the programmatic types contained in a script
  • modular architecture allows the easy inclusion of additional languages
  • example scripts are provided in all supported languages
  • a Getting Started tutorial is included
  • requires only the installation of the free .NET Framework 1.1 Redistributable Package (23Mb). Java™† (J#) support is optional and requires the installation of the free Visual J# .NET Version 1.1 Redistributable Package (7Mb)
  • runs on Windows 98, ME, NT, 2000, XP and Windows Server 2003
  • Alintex Script .NET is free for personal use. Commercial use of the product, which includes any use within a commercial environment, requires the purchase of a commercial license
  • a distributable edition is available for inclusion with your product


† Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc.
Requires installation of the free Visual J# .NET Version 1.1 Redistributable Package (7Mb)
Visual J# .NET has been developed independently by Microsoft. It is neither endorsed nor approved by Sun Microsystems, Inc. No support is provided for JNI, RMI and Applets

Posted Tuesday, July 8, 2003 10:13 PM by Alex Hoffman | with no comments

More Posts