Class dc.test Extends %RegisteredObject
{

ClassMethod Run(
  a,
  b)
{
  w $$$FormatText("a=%1, b=%2",$g(a,"<null>"),$g(b,"<null>")),!
}

ClassMethod Test()
{
  cName="dc.test",
    mName="Run",

    args=2,
    args(1)="2019-01-01",
    args(2)="1,2,3,4"
    
  d $classmethod(cName,mName,args...)
  
  args
  args=1,
    args(1)=77
  d $classmethod(cName,mName,args...)

  args
  args=2,
    args(2)=33
  d $classmethod(cName,mName,args...)

  args
  args=""
  d $classmethod(cName,mName,args...)
}

}

Result:

USER>##class(dc.test).Test()
a=2019-01-01, b=1,2,3,4
a=77, b=<null>
a=<null>, b=33
a=<null>, b=<null>

I checked for versions 2009.1/2010.1: unfortunately, the $zu(114,0) returns nothing, therefore, remains variant with the command line.

Example for Windows, provided that the system has a single network card:

#include %syConfig
 result
 w $zu(144,1,$$$DEFETHADDR),!,"------",!
 
 d $system.OBJ.DisplayError(##class(%Net.Remote.Utility).RunCommandViaCPIPE("getmac /NH /fo table",,.result))
 w $p(result," ",1)

PS: for other OS command line may be different.

Intel i5-2400

10000 digits ~ 58 sec.

calcPI(n) public { 
  s $lb(len,nines,predigit,r)=$lb(10*n\3,0,0,"")
  
  i=1:1:len a(i)=2
  
  j=1:1:{
    q=0
    i=len:-1:1 x=10*a(i)+(q*i), a(i)=x#(2*i-1), q=x\(2*i-1)
    a(1)=q#10, q=q\10
    q=9 {
      nines=nines+1
    }elseif q=10 {
      r=r_(predigit+1)_$$repeat^%qarfunc(0,nines), predigit=0, nines=0
    }else{
      r=r_predigitpredigit=q
      s:nines r=r_$$repeat^%qarfunc(9,nines), nines=0
    }
  }
  r_predigit
}

Translation of: LUA

calcPILua(n=1000) public { 
  len = 10*n\3,
    nines = 0,
    predigit = 0
  
  j=1:1:len a(j)=2
  
  j=1:1:{
    q=0
    i=len:-1:1 {
      = 10*a(i) + (q*i),
        a(i)=x#(2*i-1),
        q=x\(2*i-1)
    }
    a(1)=q#10,
      q=q\10
    q=9 {
      nines nines + 1
    }elseif q=10 {
      predigit+1
      = 1:1:nines 0
      predigit = 0, nines = 0
    }else{
      predigit
      predigit q
      nines {
        = 1:1:nines 9
        nines = 0
      }
    }
  }
  predigit
}

The result of this example is exactly the same as the result of the program C# (tested at n=10000).

Translation of: BASIC256

calcPI(n=1000) public { 
  len = 10*n\4,
    needdecimal $$$YES,
    nines = 0,
    predigit = 0  ;# {First predigit is a 0}
   
  j=1:1:len a(j-1)=2 ;# {Start with 2s}
  
  j=1:1:{
    q=0
    i=len:-1:1 {
      ;#  {Work backwards}
      = 10*a(i-1) + (q*i),
        a(i-1)=x#(2*i-1),
        q=x\(2*i-1)
    }
    a(0)=q#10,
      q=q\10
    q=9 {
      nines nines + 1
    }elseif q=10 {
      predigit+1 outputd
      nines>0 = 1:1:nines =  0 outputd
      predigit = 0, nines = 0
    }else{
      predigit,predigit outputd
      nines {
        = 1:1:nines = 9 outputd
        nines = 0
      }
    }
  }
  predigit
  q
   
outputd()
  if needdecimal {
     q:d=0
     d_"."
     needdecimal $$$NO
  else {
     d
  }
}

The greater "n", the higher the accuracy.

If there is a lack of RAM, you can easily replace the local array "a" with globals ^||a or ^a.