TweetFollow Us on Twitter

The SSCLI: Managed Languages, Samples and (more) Programming Utilities

Volume Number: 20 (2004)
Issue Number: 2
Column Tag: Programming

Casting Your .NET

by Andrew Troelsen

The SSCLI: Managed Languages, Samples and (more) Programming Utilities

Exploring .NET development on Mac OS X

Patching the SSCLI on Panther

Before we dig into the meat of this month's installment, allow me to address an issue regarding the process of building the SSCLI. Like myself, you may have purchased and installed Mac OS 10.3 (Panther) on your development machines. As you are aware, Panther upgrades numerous core Unix tools, including gcc (the GNU Compiler Collection). Given these changes, the Shared Source CLI will fail to build on new Panther machines, while upgrading an existing installation of Mac OS 10.2 to 10.3 may cause certain SSCLI command tools to become 'funky' (e.g., fail to execute).

Lucky for us, various independent patches do exist (as of today, no official patch from Microsoft exists, but check the SSCLI web site every now and again). The patch that I used to rebuild the SSCLI after installing Panther was developed by Dr Nigel Perry at the University of Canterbury. Now, given that your machine may have specific customizations, I cannot guarantee that the path I took to patch the SSCLI will be identical to your own. However here are the steps that worked for me:

  • Download the patch (rotor_mark2_diffs.txt.gz) from http://www.mondrian-script.org/rotor/

  • Run the gunzip utility to extract the patch file (panther_mark2_diffs.txt) and copy it to /sscli directory

  • Apply the patch by changing to your /sscli directory and run the following Terminal command (Listing 1)

Listing 1. Patching the SSCLI on Panther

patch -p1 <panther_mark2_diffs.txt

At this point, you can rebuild the SSCLI as described in the November issue. It is worth noting that I needed to issue the './buildall' command more than once to fully rebuild the entire code base (while selectively ignoring non-critical build-errors). In any case, hopefully these instructions will do the trick. With this out of the way, let's dig deeper into the SSCLI.

Select Samples of the SSCLI

As mentioned in a previous article, the SSCLI ships with various sample applications that illustrate numerous aspects of the CLI (Common Language Infrastructure) and Base Class Libraries (BCL), the full list of which can be viewed by opening /sscli/samples/samples_index.html. In this installment, I'll introduce you to some (but by no means all) intriguing sample applications, specifically:

  • The JScript.NET, cLisp and myC compilers

  • Codetohtml, corcls and typefinder

  • Pigpad

Understand that the goal of this issue is not to dive into all the gory details of the underlying technologies surrounding these samples. Rather, here we will learn about a number of samples that either (a) explore the language and platform agnostic aspects of .NET or (b) showcase useful developer tools. Rest assured that the technologies used in these sample applications (such as reflection and dynamic code generation) will be explored at a later time.

Before we begin, recall that the /sscli/samples directory contains a majority of the SSCLI sample code. You may directly view, modify and compile these files at the command line using csc (detailed in the December issue). Also recall the SSCLI sample applications are compiled when you build the SSCLI and are placed under the /sscli/build/v1.ppcfstchk.rotor/samples directory. These applications are ready to run at the Terminal (or xterm) using the clix application launcher. Pick your poison, enable an SSCLI Terminal session, and read on.

Exploring the Alternative 'Managed Languages' of the SSCLI

In the .NET universe, the term managed language refers to a programming language which is .NET aware; meaning, the corresponding compiler (a.k.a. a managed compiler) has been updated to understand the .NET platform. Out of the box, the SSCLI ships with a total of five managed compilers (two of which are research-oriented in nature):

  • The C# compiler (csc)

  • The raw CIL compiler (ilasm)

  • The JScript.NET compiler (jsc)

  • An experimental LISP-based .NET compiler (cLisp)

  • An experimental C-based .NET compiler (myC)

Given that the previous issue examined the basic details of working with csc and ilasm, let's take some time to examine the three remaining managed compilers of the SSCLI.

The JScript.NET Compiler

The JScript.NET compiler allows you to build .NET solutions using the syntax of the JScript (a.k.a. ECMA-script) language. Unlike traditional JScript however, the JScript.NET compiler (jsc) transforms the input *.js files into a true-blue .NET assembly rather than a simple blurb of code to be processed by a scripting engine. In addition to this compelling change, JScript.NET also supports the following enhancements to the original ECMA 262 specification:

  • Support for strongly typed data

  • Full-blown object-orientation

  • Support for type partitioning via 'packages'

  • Complete access to the .NET base class libraries

The JScript.NET compiler that ships with the SSCLI is very interesting in that the jsc code base (located under /sscli/jscript) is authored entirely in C#! Thus, given that jsc is in fact a .NET assembly, it must be executed via clix.

To view each of the options provided by the JScript.NET compiler, change to the directory containing jsc (/sscli/build/v1.ppcfstchk.rotor) and issue the following command from an SSCLI-enabled Terminal (Listing 2):

Listing 2. Launching the JScript.NET Compiler via clix

clix jsc

As you can see from the resulting output, many of the options provided by jsc are identical to those of csc. For example, jsc supports /output, /target and /reference flags as well as support for response files. One feature of jsc is unique however, and is described in Table 1.

The interesting option of jsc Meaning in Life

autoref This option (which is enabled by default) informs the compiler to automatically reference external assemblies based on the list of import statements in your *.js code files. Using this feature, you are not required to explicitly specify assemblies using the /r flag (as you would need to do in C#).

Table 1. The interesting flag of the JScript.NET compiler

While this is not the place to examine each and every aspect of the JScript.NET programming language, Listing 3 provides some sample code to use throughout this article:

Listing 3. SimpleJScript.js

// 'import' is a JScript.NET specific 
// keyword use to reference .NET namespaces. 
import System;  

// A simple class type.
class Person
{
       // State data of the type. 
   private var mName : String;
   private var mAge : int;

       // Type constructor.
   function Person(name : String, age : int)
   {
      this.mName = name;
      this.mAge = age;
   }
       // A read-only 'property'
   function get Name() : String
   {
      return this.mName;
   }
       // Read-write property. 
   function get Age() : int
   {
      return this.mAge;
   }
   function set Age(newAge : int)
   {
      if ((newAge >= 0) && (newAge <= 130))
         this.mAge = newAge;
      else
      {
         Console.WriteLine("Ug...bad value...");
      }
   }
}

// Prompt user for information about this person. 
Console.WriteLine("**The Amazing JScript.NET App**");
Console.Write("Enter person's name: ");
var name : String = Console.ReadLine();
Console.Write("Enter initial age of person: ");
var age : int = int.Parse(Console.ReadLine());

// Now create a person using input. 
var myPerson : Person = new Person(name, age);

// print name using intrinsic JScript f(x). 
print(myPerson.Name);

// Base class library call. 
Console.WriteLine(myPerson.Age);

// Change age with Age property and reprint. 
chucky.Age = 26;
Console.WriteLine("{0} is now {1} years old.", 
  myPerson.Name, myPerson.Age);
Console.WriteLine("All done. See ya");

The first point of interest is the JScript.NET 'import' keyword, which is similar in function to the C# 'using' keyword in that it allows you to specify the name of the .NET namespaces this file is manipulating.

Next is the 'class' keyword of JScript.NET used to define a .NET class type named 'Person'. Note that type member variables are defined using the 'var' keyword and the following syntax (Listing 4).

Listing 4. Defining Type Member Variables ala JScript.NET

class Person
{
   // AssessModifier var NameOfVariable : DataTypeOfVariable;
   private var mName : String;
   private var mAge : int;
...
}

Given that these data points have been defined as private, we need to provide a manner in which the object user can safely manipulate these values. Under the .NET platform, encapsulation services are provided (in part) by the use of type properties. Simply put, properties are get (accessor) and set (mutator) methods in disguise. Here, our Person class defines a read-only property termed Name and a read/write property named Age.

In JScript.NET, properties are declared using the 'function get' and 'function set' keywords. Like a traditional accessor/mutator pair, properties are used to control access to state data. In the case of our read-only Name property, we are returning a copy of the private mName member variable (Listing 5).

Listing 5. A Read-Only Property ala JScript.NET

class Person
{
       // AssessModifier var NameOfVariable : DataTypeOfVariable;
   private var mName : String;
   private var mAge : int;
...
}

The Age property is a bit more interesting in that the function set method performs simple data validation on the incoming parameter (Listing 6).

Listing 6. A Read/Write Property ala JScript.NET

// Note that properties must be defined
// with regard to the type of data they
// encapsulate.
function get Name() : String
{
   return this.mName;
}

The major benefit of using .NET properties, over accessor/mutator methods such as GetAge() and SetAge(), is the fact that it simplifies the syntax for the object user. Thus, rather than authoring the following Java-like code (Listing 7):

Listing 7. Traditional Get/Set methods

// Encapsulation using accessor/mutator methods. 
myPerson.SetAge(30);
var theAge : int = myPerson.GetAge();

We can simply write the following (Listing 8):

Listing 8. Properties in action

// Encapsulation using .NET properties.
myPerson.Age = 30; // Triggers set functionality.
var theAge : int = myPerson.Age; // Triggers get functionality.

Notice how properties provide the illusion that you are accessing a point of public data (which would be bad insofar the that would break encapsulation) while still honoring your data validation logic.

The final point is the block of 'freestanding' code at the end of the SimpleJScript.js file. Notice that we are blending the use of the .NET System.Console type as well as the JScript 'print' function to print our the values of the person to the Terminal window (Listing 9).

Listing 9. Blending BCL types with intrinsic JScript function calls

// Now create a person using input. 
var myPerson : Person = new Person(name, age);

// print name using intrinsic JScript f(x). 
print(myPerson.Name);

// Base class library call. 
Console.WriteLine(myPerson.Age);

Compiling and Running our JScript.NET Application

Assuming you have saved the previous code to a file named SimpleJScript.js, you can compile this file into a .NET code library with the command shown in Listing 10 (assure the input file is in the same location as jsc. If not, supply the full path):

Listing 10. Compiling our *.js file

clix jsc SimpleJScript.js

You can now run your assembly as you would expect (Listing 11).

Listing 11. Launching the JScript.NET compiler via clix

clix SimpleJScript 

Figure 1 illustrates one possible session.


Figure 1. SimpleJScript.exe at work.

Dissassembling Our JScript.NET-Based Assembly

If you have been playing around with the C# programming language, it may surprise you that JScript.NET allows programmers to define programming logic not contained within a type definition. C# (as well as most other .NET-aware languages) demand that all programming logic be contained within a type or type member definition. In reality, the same constraint is found with JScript.NET, however the compiler will take care of the details on your behalf. To illustrate, load your SimpleJScript.exe assembly into ildasm (Listing 12).

Listing 12. Dissecting SimpleJScript via ildasm

ildasm SimpleJScript 

As you look over the output, you will find that all of the global code has been automatically placed in a method named (surprise, surprise) 'Global Code', which is defined within a type named 'JScript 0'. This class type extends Microsoft.JScript.GlobalScope, which is defined within a helper assembly named Microsoft.JScript.dll (located under the /sscli/build/v1.ppcfstchk.rotor directory). Listing 13 shows the CIL of the type in question (edited for clarity).

Listing 13. The auto-generated 'JScript 0' Class Type

.class public auto ansi 'JScript 0'
  extends [Microsoft.JScript]
Microsoft.JScript.GlobalScope
{
  .method public instance object 
    'Global Code'() cil managed
  {

    // All of your global code is placed here...
  }
}

In addition to the 'JScript 0' type, jsc also generates a class named 'JScript Main' that defines the application's entry point: Main(). The Main() method leverages several types within the Microsoft.JScript.dll assembly to execute the program. Listing 14 hits the highlights.

Listing 14. The auto-generated Main() method

.class public auto ansi 'JScript Main'
  extends [mscorlib]System.Object
{
  .method public static void Main(string[] A_0) 
    cil managed
  {
    .entrypoint

    // Define a variable of type GlobalScope.
    .locals init (class [Microsoft.JScript]
      Microsoft.JScript.GlobalScope V_0)
...
    // Create the 'JScript 0' object.
    IL_001e: newobj instance void 
     'JScript 0'::.ctor(class[Microsoft.JScript]
     Microsoft.JScript.GlobalScope)
...
    // Now call the 'Global Code()' method.
    IL_0023:  call instance object 
      'JScript 0'::'Global Code'()
    IL_0028:  pop
    IL_0029:  ret
  }
}

This wraps up our exploration of the JScript sample application. If you are interested in exploring JScript.NET in greater detail, hundreds of articles and sample applications can be found online (just be sure to have a space between JScript and .NET when searching [JScript .NET not JScript.NET]).

The cLisp Compiler

The next sample application (cLisp) is a partial LISP compiler that targets the .NET platform. As mentioned, cLisp is more research-orientated in nature, in that it does not implement every aspect of the LISP programming language. However, the code base does provide an excellent foundation for those of you who are interested in extending cLisp with new functionality. As well, if you wish to build your own managed compiler that can function within the SSCLI, cLisp is a solid example to build upon.

Like the JScript.NET compiler, the cLisp compiler is authored in C#. If you navigate to the cLisp directory (/sscli/samples/compilers/clisp), you will find all of the necessary source code. As well, the cLisp directory contains a few *.lisp code files which can be used as input to the cLisp application. For example the fibo.lisp file computes a Fibonacci sequence (Listing 15).

Listing 15. fibo.lisp

(defun Fib (N)
  (if (<= N 0) 
      0 
    (if (= N 1) 
	1 
      (+ (Fib (- N 1)) (Fib (- N 2))
	 )
      )
    )
  )
(defun Fibo (N) (do ((count 0 (+ count 1))
		 (Fibo (car (Fib 0)) (cons Fibo (car (Fib count)))))
		((> count N)
		 Fibo)))
(Fibo 25)

Now, if you can't make heads or tails of the previous LISP code, don't sweat it. The point here is not to examine the syntactic details of LISP, but rather understand how LISP source code can be used to build a valid .NET image. To illustrate, navigate to the /sscli/build/v1.ppcfstchk.rotor/samples directory and compile fibo.lisp into an executable assembly using the following command (Listing 16).

Listing 16. Compiling *.lisp files via cLisp

clix clisp fibo.lisp

The resulting .NET assembly (fibo.exe) may now be launched using clix. Figure 2 shows the program's output.


Figure 2. Fibo.exe at Work.

Much like jsc, cLisp will auto-generate a class type and program entry point behind the scenes (this can be verified by loading Fibo.exe into ildasm). While this example is enticing, understand that given the fact that cLisp is an illustrative compiler, you do not have access to the BCL types.

A Brief Word Regarding the myC Compiler

Last but not least, it is worth pointing out that the SSCLI also ships with another research-oriented managed compiler named myC. This sample exposes a (very) limited subset of the C programming language to the .NET universe. Like cLisp, the sample code further illustrates the process of building a managed compiler. Sscli/samples/compilers/myc/myc.html describes the C# source code files used to build this managed compiler and I'll leave it to you to dig into the details if you so choose.

A Gamut of .NET Programming languages

The .NET platform may be manipulated using numerous programming languages, far beyond those that ship with the SSCLI. In the initial issue of this series (October, 2003) I listed a subset of .NET-aware compilers. If you wish to see a more all-encompassing list, navigate to http://www12.brinkster.com/brianr/languages.aspx. Here you will find links to compilers as diverse as Ada, Forth, Fortran, Java, LOGO (yes, I am not kidding), Mixal and Ruby as well as fully functionally C and LISP compilers.

Keep in mind however that many of these offerings target production level .NET distributions such as Mono, Portable .NET and Microsoft's CLR, and therefore may require a bit of tweaking to execute under the SSCLI. In just a few short issues, we will move from the research-oriented world of the SSCLI to a production-level distribution of the CLI named Portable .NET. At that time I will revisit the use of 'alternative' .NET programming languages.

Code Documentation and Type Analysis Samples

Now that you have had a chance to check out the compiler-centric examples of the SSCLI, we'll examine samples of the code-formatting / assembly-investigation ilk. Each of the examples we will examine here are found under the /samples/utilities subdirectory. First up, codetohtml.exe

The CodeToHtml Sample Application

The codetohtml sample application (which is written in JScript.NET) generates HTML files representing C# or JScript.NET source code. To illustrate codetohtml in action, supply the SimpleJScript.js file created earlier as a command line argument (Listing 17).

Listing 17. Processing SimpleJScript.js

clix codetohtml SimpleJScript.js

Figure 3 shows the default HTML format.


Figure 3. An HTML view of SimpleJScript.js

The runtime behavior of codetohtml is controlled by a set of initialization files, whose exact names are based on the language of the input file (for example, js_codetohtml.ini for JScript.NET and cs_codetohtml.ini for C#). Table 2 describes the role of each *.ini file.

CodeToHtml Initialization File          Meaning in Life
<lang>_codetohtml.ini                   This is the core file which specifies the names 
                                        of the other three related *.ini files as well 
                                        as the associated style sheet to use when generating 
                                        the HTML file.

<lang>_keywords.ini                     Contains a list of all active keywords for the 
                                        given language.

<lang>_futurereserved.ini               Contains a list of reserved keywords for the 
                                        given language.

<lang>_userdefined.ini                  Contains a list of user-defined types (such as 
                                        class names) to be recognized during the 
                                        formatting process.

Table 2. The initialization files of codetohtml

Of course, each of these files may be modified to control the format of the resulting HTML. To begin, open up js_codetohtml.ini using your text editor of choice (Listing 18):

Listing 18. Contents of js_codetohtml.ini

defstylesheet=codeblue.css
keywords=js_keywords.ini
userdefined=js_userdefined.ini
futurereserved=js_futurereserved.ini
replace=js_replace.ini
language=JScript

Note that the default style sheet is named codeblue.css. This may be changed to the other sample style sheet, codewhite.ccs, by updating the defstylesheet value. If you examine either file, you will find a set of styles used to format each token category (keywords, code comments, user defined types and so on). Listing 19 shows a partial listing.

Listing 19. Partial listing of codeblue.css

div.code
{
	background-color: rgb(0,0,128);
	font-family: "Lucida Console", "courier new", courier;
	color: rgb(255,255,0);
	font-size: x-small;
	padding: 1em;
	margin: 1em;
}
...
div.code span.userdefined
{
	color: rgb(51, 51, 0);
	font-weight: bold
}
...

To spice things up a bit, edit js_codetohtml.ini file to point to the codewhite.css style sheet. Next, modify js_userdefined.ini to recognize the System.Console type of the base class libraries by adding Console to the end of the list. At this point, run codetohtml once again specifying SimpleJScript.js as the input file. Notice in Figure 4 that each occurrence of the Console type is rendered using the 'userdefined' style.


Figure 4. Custom code to HTML formatting

Beyond creating custom style sheets for use by codetohtml, you will also want to check out the JScript.NET source code for this example (codetohtml.js) as it illustrates a number of interesting .NET base class library types. As you already know how to interact with the JScript.NET compiler, feel free to hack away to your heart's content.

The corcls and typefinder Sample Applications

Corcls and typefinder are essentially object browsing utilities (written in C#) that provide a lightweight alternative to ildasm. The corcls utility can be helpful when you simply wish to view the C# definition of a given type, rather than the underlying CIL code. If you run corcls at the command line (via clix), you will see a list of all available options. Table 3 documents a partial listing.

Interesting Options of Corcls 	Meaning in Life

-w                               Generates output in HTML format.

-m nameOfAssemblyToSearch        By default, corcls only searches a core .NET BCL 
                                 assembly named mscorlib.dll.  If you wish to browse 
                                 other assemblies (including your custom assemblies), 
                                 use the -m flag.

-noinherit                       Prevents the display of inherited methods and fields.

-v                               Displays only output visible (public and protected) 
                                 classes, methods, or fields.

-p                               Displays only output public classes, methods, or fields.

Table 3. Various flags of corcls

Again, by default, corcls only searches the core .NET assembly, mscorlib.dll. If you wish to view definitions for types defined in other assemblies, you will need to specify the '-m' option. By way of a few examples, Listing 20 will display type information for System.String, Listing 21 displays the same type as HTML (via the '-w' option) and Listing 22 dumps information about the Person type defined within SimpleJScript.exe (originally defined in JScript.NET). Be aware that when you run load external modules with the '-m' option, you will need to ensure a copy of the binary file is in the same directory as corcls itself.

Listing 20. Viewing System.String

clix corcls System.String

Listing 21. System.String as HTML

clix corcls -w System.String

Listing 22. Viewing Person

clix corcls -m SimpleJScript.exe Person

Figure 5 shows the result of executing Listing 22.


Figure 5. Viewing Person in the syntax of C#

The functionality of typefinder is similar to that of corcls, however this tool allows you to get much more specific. Using a set of display options, you can view various aspects of a type such as the set of interfaces it supports, the methods it contains and so forth. I'll allow you to explore the full set of options via the findtype.html file located under /sscli/samples/utilities/typefinder, however to prime the pump, Table 4 lists some possibilities.

Typefinder Option        Meaning in Life

-d: NameOfDirectory      Used to specify a directory which contains the assembly 
                         you wish to investigate.

-x                       Used to specify the fully qualified name of the type 
                         in a given assembly.

-a                       Shows all information for a given type, including inherited 
                         members (very helpful).

-e, -f, -i, -m, -p       Shows the events, fields, interfaces, methods or properties 
                         of a given type.  These flags may be combined into a 
                         single commend.

-r                       Include base class information.

Table 4. Select options of typefinder

As an example, the command shown in Listing 23 yields the output seen in Listing 24.

Listing 23. Working with typefinder

clix typefinder -xip System.String

Listing 24. Viewing the properties and interfaces of the System.String type

class      System.String
# Interfaces: 4
  interface System.IComparable
  interface System.ICloneable
  interface System.IConvertible
  interface System.Collections.IEnumerable
Properties
  Char Chars [Int32] 'get' 
  Int32 Length 'get'

When working with typefinder, be sure to check out the role of the '-d' option (as it will prove helpful when you wish to view types in external assemblies, such as SimpleJScript.exe).

This Little GUI is Platform Independent

To wrap up this installment, we will examine what could be the most inciting set of sample applications, the Platform Independent GUI (PIGUI). As mentioned earlier in this series, the SSCLI does not ship with an implementation of System.Windows.Forms (.NET's native GUI toolkit). However, to illustrate what can be done with the CLI, we are provided with a set of samples that leverage the tcl/tk libraries, represented on the Macintosh by two *.dylib files (libtcl8.4.dylib and libtk8.4.dylib). As a friendly reminder, recall that the process of installing tcl/tk was described in the November installment.

The SSCLI offers a handful of samples that leverage the tcl/tk libraries:

  • Hello: A simple application illustrating GUI event handling

  • PigPad: A text editor application

  • Tk: This sample builds the required assembly (sharedsourcecli.tk.dll) that wraps a subset of the tcl/tk libraries

The Tk sample code is very illumining for a few reasons. First, the code base illustrates how the .NET platform can communicate with the API of the underlying operating system (as well as native libraries) using a specific attribute named DllImportAttribute (attributes enable aspect-oriented programming [AOP] techniques under .NET, the full details of which will be described at a later time).

On a more practical level, the assembly generated by the Tk sample (sharedsourcecli.tk.dll) is required by all other PIGUI examples. Given this, you must ensure that a copy of sharedsourcecli.tk.dll is placed within the same directory as the executing assembly. Furthermore, you will most likely want to copy the tcl/tk libraries are in the same directory of the pigui sample application you wish to run. If you installed tcl/tk using Fink Commander, they should be under /sw/lib.

Enabling an X11 Session

To execute the PIGUI sample applications, you must initialize X11 (full screen or rootless), and run these SSCLI samples from an xterm session (as the Macintosh Terminal applet does not initialize the necessary X11 variables). Now, when you install Panther, you have the option to install X11, which it may be launched using the X11 applet located under the Applications/Utilities directory.

If you are not running Panther, you must obtain X11 from cyberspace. While there are numerous distributions of X11 for the Mac, I'd suggest you download and install Apple's office X11 implementation (consult http://www.apple.com for further details). For the remainder of this article, I will assume you are at least somewhat comfortable manipulating X11.

Playing with the PIGUIs

By default, Apple's X11 distribution makes use of the Quartz windows manager (quartz-wm), which can be verified by investigating your machine's .xinitrc file. Assuming you have activated X11, enable the SSCLI from an xterm window (via DoSscli) and navigate to the pigpad sample application located under the /sscli/build/v1.ppcfstchk.rotor/samples/pigui/pigpad directory. Finally, execute pigpad via clix. Figure 6 shows PIGUI running under the default Quartz windows manager.


Figure 6. PigPad under the Quartz Window Manager

If you edit your .xinitrc file to load an alternative window manager (which may be obtained via Fink Commander) you would find that pigpad takes on an entirely different look and feel. To prove the point, update .xinitrc to load your window manager of choice (Listing 24 illustrates the loading of Window Maker).

Listing 24. Loading Window Maker as the X11 Windows Manager

# The Apple WM.
# quartz-wm 

# Window Maker
exec /sw/bin/wmaker

Once you have updated and saved .xinitrc, close down and then restart X11. Now follow the previous steps to execute the pigpad sample application. Figure 7 shows the new look and feel.


Figure 7. PigPad under Window Maker

Very cool! If you are interested in digging into the "who, what, where and why" of how pigui does it's magic, your first step is to examine the documentation of the Tk wrapper (/sscli/samples/pigui/tk/tk_wrapper.html). Once you have a general sense of the exposed functionality, you should be able to alter the code base of pigpad (or pighello) to your liking.

Wrap Up

This installment rounded out your understanding of the SSCLI by showcasing a number of sample applications and managed languages. We began by exploring the JScript.NET programming language and learned how jsc can be used to build .NET assemblies using a scripting like syntax. We also took a very brief look at the cLisp and myC compilers, and examined a set of sample applications that allow you to explore the format of a given assembly in a more lightweight manner than ildasm. Finally, you had a chance to see how tcl/tk was used to build a platform independent GUI under the SSCLI.

The next issue marks a conceptual shift in this series. While these first issues concentrated on the overall nature of the .NET platform and the role of the SSCLI, the next several articles will pound of the syntax and semantics of C#, and see how this programming language expresses the type system (classes, interfaces, structures, enumerations and delegates) of .NET.


Andrew Troelsen is a seasoned .NET developer who has authored numerous books on the topic, including the award winning C# and the .NET Platform. He is employed as a full-time .NET trainer and consultant for Intertech Training (www.intertechtraining.com) who apologies for failing to submit his January article in time. You can contact (or scold) Andrew at atroelsen@mac.com.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Tokkun Studio unveils alpha trailer for...
We are back on the MMORPG news train, and this time it comes from the sort of international developers Tokkun Studio. They are based in France and Japan, so it counts. Anyway, semantics aside, they have released an alpha trailer for the upcoming... | Read more »
Win a host of exclusive in-game Honor of...
To celebrate its latest Jujutsu Kaisen crossover event, Honor of Kings is offering a bounty of login and achievement rewards kicking off the holiday season early. [Read more] | Read more »
Miraibo GO comes out swinging hard as it...
Having just launched what feels like yesterday, Dreamcube Studio is wasting no time adding events to their open-world survival Miraibo GO. Abyssal Souls arrives relatively in time for the spooky season and brings with it horrifying new partners to... | Read more »
Ditch the heavy binders and high price t...
As fun as the real-world equivalent and the very old Game Boy version are, the Pokemon Trading Card games have historically been received poorly on mobile. It is a very strange and confusing trend, but one that The Pokemon Company is determined to... | Read more »
Peace amongst mobile gamers is now shatt...
Some of the crazy folk tales from gaming have undoubtedly come from the EVE universe. Stories of spying, betrayal, and epic battles have entered history, and now the franchise expands as CCP Games launches EVE Galaxy Conquest, a free-to-play 4x... | Read more »
Lord of Nazarick, the turn-based RPG bas...
Crunchyroll and A PLUS JAPAN have just confirmed that Lord of Nazarick, their turn-based RPG based on the popular OVERLORD anime, is now available for iOS and Android. Starting today at 2PM CET, fans can download the game from Google Play and the... | Read more »
Digital Extremes' recent Devstream...
If you are anything like me you are impatiently waiting for Warframe: 1999 whilst simultaneously cursing the fact Excalibur Prime is permanently Vault locked. To keep us fed during our wait, Digital Extremes hosted a Double Devstream to dish out a... | Read more »
The Frozen Canvas adds a splash of colou...
It is time to grab your gloves and layer up, as Torchlight: Infinite is diving into the frozen tundra in its sixth season. The Frozen Canvas is a colourful new update that brings a stylish flair to the Netherrealm and puts creativity in the... | Read more »
Back When AOL WAS the Internet – The Tou...
In Episode 606 of The TouchArcade Show we kick things off talking about my plans for this weekend, which has resulted in this week’s show being a bit shorter than normal. We also go over some more updates on our Patreon situation, which has been... | Read more »
Creative Assembly's latest mobile p...
The Total War series has been slowly trickling onto mobile, which is a fantastic thing because most, if not all, of them are incredibly great fun. Creative Assembly's latest to get the Feral Interactive treatment into portable form is Total War:... | Read more »

Price Scanner via MacPrices.net

Early Black Friday Deal: Apple’s newly upgrad...
Amazon has Apple 13″ MacBook Airs with M2 CPUs and 16GB of RAM on early Black Friday sale for $200 off MSRP, only $799. Their prices are the lowest currently available for these newly upgraded 13″ M2... Read more
13-inch 8GB M2 MacBook Airs for $749, $250 of...
Best Buy has Apple 13″ MacBook Airs with M2 CPUs and 8GB of RAM in stock and on sale on their online store for $250 off MSRP. Prices start at $749. Their prices are the lowest currently available for... Read more
Amazon is offering an early Black Friday $100...
Amazon is offering early Black Friday discounts on Apple’s new 2024 WiFi iPad minis ranging up to $100 off MSRP, each with free shipping. These are the lowest prices available for new minis anywhere... Read more
Price Drop! Clearance 14-inch M3 MacBook Pros...
Best Buy is offering a $500 discount on clearance 14″ M3 MacBook Pros on their online store this week with prices available starting at only $1099. Prices valid for online orders only, in-store... Read more
Apple AirPods Pro with USB-C on early Black F...
A couple of Apple retailers are offering $70 (28%) discounts on Apple’s AirPods Pro with USB-C (and hearing aid capabilities) this weekend. These are early AirPods Black Friday discounts if you’re... Read more
Price drop! 13-inch M3 MacBook Airs now avail...
With yesterday’s across-the-board MacBook Air upgrade to 16GB of RAM standard, Apple has dropped prices on clearance 13″ 8GB M3 MacBook Airs, Certified Refurbished, to a new low starting at only $829... Read more
Price drop! Apple 15-inch M3 MacBook Airs now...
With yesterday’s release of 15-inch M3 MacBook Airs with 16GB of RAM standard, Apple has dropped prices on clearance Certified Refurbished 15″ 8GB M3 MacBook Airs to a new low starting at only $999.... Read more
Apple has clearance 15-inch M2 MacBook Airs a...
Apple has clearance, Certified Refurbished, 15″ M2 MacBook Airs now available starting at $929 and ranging up to $410 off original MSRP. These are the cheapest 15″ MacBook Airs for sale today at... Read more
Apple drops prices on 13-inch M2 MacBook Airs...
Apple has dropped prices on 13″ M2 MacBook Airs to a new low of only $749 in their Certified Refurbished store. These are the cheapest M2-powered MacBooks for sale at Apple. Apple’s one-year warranty... Read more
Clearance 13-inch M1 MacBook Airs available a...
Apple has clearance 13″ M1 MacBook Airs, Certified Refurbished, now available for $679 for 8-Core CPU/7-Core GPU/256GB models. Apple’s one-year warranty is included, shipping is free, and each... Read more

Jobs Board

Seasonal Cashier - *Apple* Blossom Mall - J...
Seasonal Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Seasonal Fine Jewelry Commission Associate -...
…Fine Jewelry Commission Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) Read more
Seasonal Operations Associate - *Apple* Blo...
Seasonal Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Read more
Hair Stylist - *Apple* Blossom Mall - JCPen...
Hair Stylist - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.