Tag Archives: programming

Web 7.0 DIDLibOS is a Decentralized, DID-native Polyglot Host Platform

Create your own magic with Web 7.0™ DIDLibOS / TDW AgenticOS™. Imagine the possibilities.

Copyright © 2026 Michael Herman (Bindloss, Alberta, Canada) – Creative Commons Attribution-ShareAlike 4.0 International Public License
Web 7.0, TDW AgenticOS™ and Hyperonomy are trademarks of the Web 7.0 Foundation. All Rights Reserved

A polyglot host is a software environment that can execute or embed multiple programming languages within the same process or platform.

Instead of being tied to one language runtime, the host provides infrastructure so different languages can run side-by-side and interact.


Core idea

Host Environment
├─ Language Runtime A
├─ Language Runtime B
├─ Language Runtime C
└─ Shared APIs / objects

The host provides:

  • memory management
  • object sharing
  • APIs
  • execution control

Each language plugs into that environment.


Example: PowerShell

PowerShell is a practical polyglot host because it can run or embed:

  • .NET languages (C#, F#)
  • JavaScript (via engines like )
  • Python (via )
  • legacy scripting via
  • external runtimes like or Python

PowerShell itself acts as the host orchestrating those runtimes.


Example: Modern polyglot notebook hosts

A well-known example is .NET Interactive which supports:

  • C#
  • F#
  • PowerShell
  • JavaScript
  • SQL

in the same notebook.

Another example is Jupyner Notebooks which runs different languages through kernels.


What makes something a polyglot host

A system qualifies if it supports at least some of these:

CapabilityDescription
Multiple runtimesDifferent languages execute in the same environment
Shared dataLanguages exchange objects or values
Embedded interpretersEngines loaded as libraries
Runtime orchestrationHost decides what runs where

Three common architectures

1. Embedded runtimes

Languages run inside the host process.

Example:

Host
├─ Python runtime
├─ JavaScript runtime
└─ shared object model

Example platform:


2. External runtimes

Host launches interpreters as subprocesses.

Example:

Host
├─ node
├─ python
└─ Rscript

PowerShell often uses this approach.


3. Plugin scripting engines

Languages implement a host interface.

Example:

Host
├─ VBScript engine
├─ JScript engine
└─ PerlScript engine

This was the design of Windows Script Host.


Simple definition

A polyglot host is:

A runtime environment that allows multiple programming languages to run and interact within a single platform.


Why they exist

Polyglot hosts let developers:

  • use the best language for each task
  • reuse existing ecosystems
  • integrate tools without rewriting everything

Leave a comment

Filed under Uncategorized

Windows 1.0 SDK Samples: generic.c

Create your own magic with Web 7.0 AgenticOS™. Imagine the possibilities.

Copyright © 2025 Michael Herman (Bindloss, Alberta, Canada) – Creative Commons Attribution-ShareAlike 4.0 International Public License

Documentation

generic.c

/********************************************************************\

*  generic.c: Source code for generic                                *

*                                                                    *

*  Comments: Generic Application                                     *

*                                                                    *

*  Functions:                                                        *

*     WinMain      - Application entry point                         *

*     MainWndProc  - main window procedure                           *

*     AboutDlgProc - dialog procedure for About dialog               *

*                                                                    *

*                                                                    *

\********************************************************************/


/*********************  Header Files  *********************/


#include <windows.h>

#include "generic.h"

#pragma comment(lib, "user32.lib")

#pragma comment(lib, "gdi32.lib")


/*********************  Prototypes  ***********************/


LRESULT CALLBACK MainWndProc( HWND, UINT, WPARAM, LPARAM );

INT_PTR CALLBACK AboutDlgProc( HWND, UINT, WPARAM, LPARAM );


/*******************  Global Variables ********************/


HINSTANCE ghInstance;


/********************************************************************\

*  Function: int CALLBACK WinMain(HINSTANCE, HINSTANCE, LPSTR, int)  *

*                                                                    *

*   Purpose: Initializes Application                                 *

*                                                                    *

*  Comments: Register window class, create and display the main      *

*            window, and enter message loop.                         *

*                                                                    *

*                                                                    *

\********************************************************************/


int CALLBACK WinMain( HINSTANCE hInstance,

    HINSTANCE hPrevInstance,

    LPSTR lpszCmdLine,

    int nCmdShow )

{

   MSG msg;

   HWND hWnd;

   BOOL bRet;

   WNDCLASS wc;


   if( !hPrevInstance )

   {

      wc.lpszClassName = TEXT("GenericAppClass");

      wc.lpfnWndProc = MainWndProc;

      wc.style = CS_OWNDC | CS_VREDRAW | CS_HREDRAW;

      wc.hInstance = hInstance;

      wc.hIcon = LoadIcon( NULL, IDI_APPLICATION );

      wc.hCursor = LoadCursor( NULL, IDC_ARROW );

      wc.hbrBackground = (HBRUSH)( COLOR_WINDOW+1 );

      wc.lpszMenuName = TEXT("GenericAppMenu");

      wc.cbClsExtra = 0;

      wc.cbWndExtra = 0;


      RegisterClass( &wc );

   }


   ghInstance = hInstance;


   hWnd = CreateWindow( TEXT("GenericAppClass"),

      TEXT("Generic Application"),

      WS_OVERLAPPEDWINDOW|WS_HSCROLL|WS_VSCROLL,

      0,

      0,

      CW_USEDEFAULT,

      CW_USEDEFAULT,

      NULL,

      NULL,

      hInstance,

      NULL

   );


   ShowWindow( hWnd, nCmdShow );


   while( (bRet = GetMessage( &msg, NULL, 0, 0 )) != 0 ) 
   {

      if (bRet == -1)

      {

         // handle the error and possibly exit

      }

      else

      {

         TranslateMessage( &msg );

         DispatchMessage( &msg );

      }

   }


   return (int)msg.wParam;

}


/********************************************************************\

* Function: LRESULT CALLBACK MainWndProc(HWND, UINT, WPARAM, LPARAM) *

*                                                                    *

*  Purpose: Processes Application Messages                           *

*                                                                    *

* Comments: The following messages are processed                     *

*                                                                    *

*           WM_PAINT                                                 *

*           WM_COMMAND                                               *

*           WM_DESTROY                                               *

*                                                                    *

*                                                                    *

\********************************************************************/


LRESULT CALLBACK MainWndProc( 
   HWND hWnd, 
   UINT msg, 
   WPARAM wParam,

   LPARAM lParam )

{

   PAINTSTRUCT ps;

   HDC hDC;


   switch( msg ) 
   {


/**************************************************************\

*     WM_PAINT:                                                *

\**************************************************************/


      case WM_PAINT:

         hDC = BeginPaint( hWnd, &ps );


         TextOut( hDC, 10, 10, TEXT("Hello, Windows!"), 15 );


         EndPaint( hWnd, &ps );

         break;


/**************************************************************\

*     WM_COMMAND:                                              *

\**************************************************************/


      case WM_COMMAND:

        switch( wParam ) 
        {

            case IDM_ABOUT:

               DialogBox( ghInstance, TEXT("AboutDlg"), hWnd, 
                          (DLGPROC) AboutDlgProc );

            break;

         }

        break;


/**************************************************************\

*     WM_DESTROY: PostQuitMessage() is called                  *

\**************************************************************/


      case WM_DESTROY:

         PostQuitMessage( 0 );

         break;


/**************************************************************\

*     Let the default window proc handle all other messages    *

\**************************************************************/


      default:

         return( DefWindowProc( hWnd, msg, wParam, lParam ));

   }


   return 0;

}


/********************************************************************\

* Function: INT_PTR CALLBACK AboutDlgProc(HWND, UINT, WPARAM, LPARAM)*

*                                                                    *

*  Purpose: Processes "About" Dialog Box Messages                    *

*                                                                    *

* Comments: The About dialog box is displayed when the user clicks   *

*           About from the Help menu.                                *

*                                                                    *

\********************************************************************/


INT_PTR CALLBACK AboutDlgProc( 
   HWND hDlg, 
   UINT uMsg, 
   WPARAM wParam, 
   LPARAM lParam )

{

   switch( uMsg ) 
   {

      case WM_INITDIALOG:

         return TRUE;

      case WM_COMMAND:

         switch( wParam ) 
         {

            case IDOK:

               EndDialog( hDlg, TRUE );

               return TRUE;

         }

      break;

   }


   return FALSE;

} 

1 Comment

Filed under Uncategorized