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

Tor Browser 12.5.5 - Anonymize Web brows...
Using Tor Browser you can protect yourself against tracking, surveillance, and censorship. Tor was originally designed, implemented, and deployed as a third-generation onion-routing project of the U.... Read more
Malwarebytes 4.21.9.5141 - Adware remova...
Malwarebytes (was AdwareMedic) helps you get your Mac experience back. Malwarebytes scans for and removes code that degrades system performance or attacks your system. Making your Mac once again your... Read more
TinkerTool 9.5 - Expanded preference set...
TinkerTool is an application that gives you access to additional preference settings Apple has built into Mac OS X. This allows to activate hidden features in the operating system and in some of the... Read more
Paragon NTFS 15.11.839 - Provides full r...
Paragon NTFS breaks down the barriers between Windows and macOS. Paragon NTFS effectively solves the communication problems between the Mac system and NTFS. Write, edit, copy, move, delete files on... Read more
Apple Safari 17 - Apple's Web brows...
Apple Safari is Apple's web browser that comes bundled with the most recent macOS. Safari is faster and more energy efficient than other browsers, so sites are more responsive and your notebook... Read more
Firefox 118.0 - Fast, safe Web browser.
Firefox offers a fast, safe Web browsing experience. Browse quickly, securely, and effortlessly. With its industry-leading features, Firefox is the choice of Web development professionals and casual... Read more
ClamXAV 3.6.1 - Virus checker based on C...
ClamXAV is a popular virus checker for OS X. Time to take control ClamXAV keeps threats at bay and puts you firmly in charge of your Mac’s security. Scan a specific file or your entire hard drive.... Read more
SuperDuper! 3.8 - Advanced disk cloning/...
SuperDuper! is an advanced, yet easy to use disk copying program. It can, of course, make a straight copy, or "clone" - useful when you want to move all your data from one machine to another, or do a... Read more
Alfred 5.1.3 - Quick launcher for apps a...
Alfred is an award-winning productivity application for OS X. Alfred saves you time when you search for files online or on your Mac. Be more productive with hotkeys, keywords, and file actions at... Read more
Sketch 98.3 - Design app for UX/UI for i...
Sketch is an innovative and fresh look at vector drawing. Its intentionally minimalist design is based upon a drawing space of unlimited size and layers, free of palettes, panels, menus, windows, and... Read more

Latest Forum Discussions

See All

Listener Emails and the iPhone 15! – The...
In this week’s episode of The TouchArcade Show we finally get to a backlog of emails that have been hanging out in our inbox for, oh, about a month or so. We love getting emails as they always lead to interesting discussion about a variety of topics... | Read more »
TouchArcade Game of the Week: ‘Cypher 00...
This doesn’t happen too often, but occasionally there will be an Apple Arcade game that I adore so much I just have to pick it as the Game of the Week. Well, here we are, and Cypher 007 is one of those games. The big key point here is that Cypher... | Read more »
SwitchArcade Round-Up: ‘EA Sports FC 24’...
Hello gentle readers, and welcome to the SwitchArcade Round-Up for September 29th, 2023. In today’s article, we’ve got a ton of news to go over. Just a lot going on today, I suppose. After that, there are quite a few new releases to look at... | Read more »
‘Storyteller’ Mobile Review – Perfect fo...
I first played Daniel Benmergui’s Storyteller (Free) through its Nintendo Switch and Steam releases. Read my original review of it here. Since then, a lot of friends who played the game enjoyed it, but thought it was overpriced given the short... | Read more »
An Interview with the Legendary Yu Suzuk...
One of the cool things about my job is that every once in a while, I get to talk to the people behind the games. It’s always a pleasure. Well, today we have a really special one for you, dear friends. Mr. Yu Suzuki of Ys Net, the force behind such... | Read more »
New ‘Marvel Snap’ Update Has Balance Adj...
As we wait for the information on the new season to drop, we shall have to content ourselves with looking at the latest update to Marvel Snap (Free). It’s just a balance update, but it makes some very big changes that combined with the arrival of... | Read more »
‘Honkai Star Rail’ Version 1.4 Update Re...
At Sony’s recently-aired presentation, HoYoverse announced the Honkai Star Rail (Free) PS5 release date. Most people speculated that the next major update would arrive alongside the PS5 release. | Read more »
‘Omniheroes’ Major Update “Tide’s Cadenc...
What secrets do the depths of the sea hold? Omniheroes is revealing the mysteries of the deep with its latest “Tide’s Cadence" update, where you can look forward to scoring a free Valkyrie and limited skin among other login rewards like the 2nd... | Read more »
Recruit yourself some run-and-gun royalt...
It is always nice to see the return of a series that has lost a bit of its global staying power, and thanks to Lilith Games' latest collaboration, Warpath will be playing host the the run-and-gun legend that is Metal Slug 3. [Read more] | Read more »
‘The Elder Scrolls: Castles’ Is Availabl...
Back when Fallout Shelter (Free) released on mobile, and eventually hit consoles and PC, I didn’t think it would lead to something similar for The Elder Scrolls, but here we are. The Elder Scrolls: Castles is a new simulation game from Bethesda... | Read more »

Price Scanner via MacPrices.net

Clearance M1 Max Mac Studio available today a...
Apple has clearance M1 Max Mac Studios available in their Certified Refurbished store for $270 off original MSRP. Each Mac Studio comes with Apple’s one-year warranty, and shipping is free: – Mac... Read more
Apple continues to offer 24-inch iMacs for up...
Apple has a full range of 24-inch M1 iMacs available today in their Certified Refurbished store. Models are available starting at only $1099 and range up to $260 off original MSRP. Each iMac is in... Read more
Final weekend for Apple’s 2023 Back to School...
This is the final weekend for Apple’s Back to School Promotion 2023. It remains active until Monday, October 2nd. Education customers receive a free $150 Apple Gift Card with the purchase of a new... Read more
Apple drops prices on refurbished 13-inch M2...
Apple has dropped prices on standard-configuration 13″ M2 MacBook Pros, Certified Refurbished, to as low as $1099 and ranging up to $230 off MSRP. These are the cheapest 13″ M2 MacBook Pros for sale... Read more
14-inch M2 Max MacBook Pro on sale for $300 o...
B&H Photo has the Space Gray 14″ 30-Core GPU M2 Max MacBook Pro in stock and on sale today for $2799 including free 1-2 day shipping. Their price is $300 off Apple’s MSRP, and it’s the lowest... Read more
Apple is now selling Certified Refurbished M2...
Apple has added a full line of standard-configuration M2 Max and M2 Ultra Mac Studios available in their Certified Refurbished section starting at only $1699 and ranging up to $600 off MSRP. Each Mac... Read more
New sale: 13-inch M2 MacBook Airs starting at...
B&H Photo has 13″ MacBook Airs with M2 CPUs in stock today and on sale for $200 off Apple’s MSRP with prices available starting at only $899. Free 1-2 day delivery is available to most US... Read more
Apple has all 15-inch M2 MacBook Airs in stoc...
Apple has Certified Refurbished 15″ M2 MacBook Airs in stock today starting at only $1099 and ranging up to $230 off MSRP. These are the cheapest M2-powered 15″ MacBook Airs for sale today at Apple.... Read more
In stock: Clearance M1 Ultra Mac Studios for...
Apple has clearance M1 Ultra Mac Studios available in their Certified Refurbished store for $540 off original MSRP. Each Mac Studio comes with Apple’s one-year warranty, and shipping is free: – Mac... Read more
Back on sale: Apple’s M2 Mac minis for $100 o...
B&H Photo has Apple’s M2-powered Mac minis back in stock and on sale today for $100 off MSRP. Free 1-2 day shipping is available for most US addresses: – Mac mini M2/256GB SSD: $499, save $100 –... Read more

Jobs Board

Licensed Dental Hygienist - *Apple* River -...
Park Dental Apple River in Somerset, WI is seeking a compassionate, professional Dental Hygienist to join our team-oriented practice. COMPETITIVE PAY AND SIGN-ON Read more
Sublease Associate Optometrist- *Apple* Val...
Sublease Associate Optometrist- Apple Valley, CA- Target Optical Date: Sep 30, 2023 Brand: Target Optical Location: Apple Valley, CA, US, 92307 **Requisition Read more
*Apple* / Mac Administrator - JAMF - Amentum...
Amentum is seeking an ** Apple / Mac Administrator - JAMF** to provide support with the Apple Ecosystem to include hardware and software to join our team and Read more
Child Care Teacher - Glenda Drive/ *Apple* V...
Child Care Teacher - Glenda Drive/ Apple ValleyTeacher Share by Email Share on LinkedIn Share on Twitter 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.