Digital Twin applied to Software

AK
Aik-Siong Koh
Fri, Oct 28, 2022 1:53 PM

Hi:

I have a novel idea "Digital Twin applied to Software". See attached slides.
It points to the future of improved programming productivity and
reliability.
Let me know what you think.

Thanks,
Aik-Siong Koh
http://ar-cad.com

Abstract

Digital Twin applied to Software
Aik-Siong Koh
askoh.com

There has been a major dichotomy in computing right from the beginning:
Statically Typed vs Dynamically Typed programming languages. The former
languages produce fast executables but are inflexible to program. The
latter are just the converse. This dichotomy has been frustrating to
programmers who always feel they have to make sacrifices when making a
choice. It also often leads to futile language wars. The Digital Twin
concept was introduced in engineering where a physical system is modeled
digitally in geometry, simulation and other information. The concept has
proven so successful that it is being applied to almost everything in
engineering from simple mouse traps to complex whole cities. It occurred
to the author that this concept can be extended to software too. For
example, execution in C++ is famously fast. But development in C++ is
notoriously difficulty because of language complexity and long build
times. A flexible digital twin can be a program written in Smalltalk
which is famous for live programming. "Development at the speed of
thought" is the motto and is real. What is gained by this duplication?
Firstly, the flexible twin can be use to explore new algorithms,
features, solutions and fix bugs quickly. Only desired codes are
translated to C++ manually or automatically. Secondly, the two programs
can check each other so that bugs are reduced significantly. These two
gains will define future programming productivity and quality. The
Digital Twin concept will also drive the automatic translation of the
flexible language to the fast language.

Bio

Dr Aik-Siong Koh has a PhD from The University of Texas at Austin where
he programed in FORTRAN to simulation mechanical systems. While teaching
at Texas Tech University and Nanyang Technological University, he
developed interest in Multibody Dynamics. To develop his own Multibody
Dynamics simulator, he researched for the most productive programming
language and discovered Smalltalk. The live programming capabilities of
Smalltalk permitted him to build a successful simulator which he then
proceeded to commercialize. His later experience with C++ at Mechanical
Dynamics and MathWorks gave him the idea of Digital Twin for Software.

Hi: I have a novel idea "Digital Twin applied to Software". See attached slides. It points to the future of improved programming productivity and reliability. Let me know what you think. Thanks, Aik-Siong Koh http://ar-cad.com Abstract Digital Twin applied to Software Aik-Siong Koh askoh.com There has been a major dichotomy in computing right from the beginning: Statically Typed vs Dynamically Typed programming languages. The former languages produce fast executables but are inflexible to program. The latter are just the converse. This dichotomy has been frustrating to programmers who always feel they have to make sacrifices when making a choice. It also often leads to futile language wars. The Digital Twin concept was introduced in engineering where a physical system is modeled digitally in geometry, simulation and other information. The concept has proven so successful that it is being applied to almost everything in engineering from simple mouse traps to complex whole cities. It occurred to the author that this concept can be extended to software too. For example, execution in C++ is famously fast. But development in C++ is notoriously difficulty because of language complexity and long build times. A flexible digital twin can be a program written in Smalltalk which is famous for live programming. "Development at the speed of thought" is the motto and is real. What is gained by this duplication? Firstly, the flexible twin can be use to explore new algorithms, features, solutions and fix bugs quickly. Only desired codes are translated to C++ manually or automatically. Secondly, the two programs can check each other so that bugs are reduced significantly. These two gains will define future programming productivity and quality. The Digital Twin concept will also drive the automatic translation of the flexible language to the fast language. Bio Dr Aik-Siong Koh has a PhD from The University of Texas at Austin where he programed in FORTRAN to simulation mechanical systems. While teaching at Texas Tech University and Nanyang Technological University, he developed interest in Multibody Dynamics. To develop his own Multibody Dynamics simulator, he researched for the most productive programming language and discovered Smalltalk. The live programming capabilities of Smalltalk permitted him to build a successful simulator which he then proceeded to commercialize. His later experience with C++ at Mechanical Dynamics and MathWorks gave him the idea of Digital Twin for Software.
AK
Aik-Siong Koh
Wed, Nov 30, 2022 7:09 AM

I have updated my slides based on the many feedback.
Digital Twin is better defined and how that helps productivity is
elaborated.
Thanks.
http://askoh.com/twin/DigitalTwinsCppSt20221129.pdf

Aik-Siong Koh wrote:

Hi:

I have a novel idea "Digital Twin applied to Software". See attached
slides.
It points to the future of improved programming productivity and
reliability.
Let me know what you think.

Thanks,
Aik-Siong Koh
http://ar-cad.com

Abstract

Digital Twin applied to Software
Aik-Siong Koh
askoh.com

There has been a major dichotomy in computing right from the
beginning: Statically Typed vs Dynamically Typed programming
languages. The former languages produce fast executables but are
inflexible to program. The latter are just the converse. This
dichotomy has been frustrating to programmers who always feel they
have to make sacrifices when making a choice. It also often leads to
futile language wars. The Digital Twin concept was introduced in
engineering where a physical system is modeled digitally in geometry,
simulation and other information. The concept has proven so successful
that it is being applied to almost everything in engineering from
simple mouse traps to complex whole cities. It occurred to the author
that this concept can be extended to software too. For example,
execution in C++ is famously fast. But development in C++ is
notoriously difficulty because of language complexity and long build
times. A flexible digital twin can be a program written in Smalltalk
which is famous for live programming. "Development at the speed of
thought" is the motto and is real. What is gained by this duplication?
Firstly, the flexible twin can be use to explore new algorithms,
features, solutions and fix bugs quickly. Only desired codes are
translated to C++ manually or automatically. Secondly, the two
programs can check each other so that bugs are reduced significantly.
These two gains will define future programming productivity and
quality. The Digital Twin concept will also drive the automatic
translation of the flexible language to the fast language.

Bio

Dr Aik-Siong Koh has a PhD from The University of Texas at Austin
where he programed in FORTRAN to simulation mechanical systems. While
teaching at Texas Tech University and Nanyang Technological
University, he developed interest in Multibody Dynamics. To develop
his own Multibody Dynamics simulator, he researched for the most
productive programming language and discovered Smalltalk. The live
programming capabilities of Smalltalk permitted him to build a
successful simulator which he then proceeded to commercialize. His
later experience with C++ at Mechanical Dynamics and MathWorks gave
him the idea of Digital Twin for Software.

I have updated my slides based on the many feedback. Digital Twin is better defined and how that helps productivity is elaborated. Thanks. http://askoh.com/twin/DigitalTwinsCppSt20221129.pdf Aik-Siong Koh wrote: > Hi: > > I have a novel idea "Digital Twin applied to Software". See attached > slides. > It points to the future of improved programming productivity and > reliability. > Let me know what you think. > > Thanks, > Aik-Siong Koh > http://ar-cad.com > > > Abstract > > Digital Twin applied to Software > Aik-Siong Koh > askoh.com > > There has been a major dichotomy in computing right from the > beginning: Statically Typed vs Dynamically Typed programming > languages. The former languages produce fast executables but are > inflexible to program. The latter are just the converse. This > dichotomy has been frustrating to programmers who always feel they > have to make sacrifices when making a choice. It also often leads to > futile language wars. The Digital Twin concept was introduced in > engineering where a physical system is modeled digitally in geometry, > simulation and other information. The concept has proven so successful > that it is being applied to almost everything in engineering from > simple mouse traps to complex whole cities. It occurred to the author > that this concept can be extended to software too. For example, > execution in C++ is famously fast. But development in C++ is > notoriously difficulty because of language complexity and long build > times. A flexible digital twin can be a program written in Smalltalk > which is famous for live programming. "Development at the speed of > thought" is the motto and is real. What is gained by this duplication? > Firstly, the flexible twin can be use to explore new algorithms, > features, solutions and fix bugs quickly. Only desired codes are > translated to C++ manually or automatically. Secondly, the two > programs can check each other so that bugs are reduced significantly. > These two gains will define future programming productivity and > quality. The Digital Twin concept will also drive the automatic > translation of the flexible language to the fast language. > > > Bio > > Dr Aik-Siong Koh has a PhD from The University of Texas at Austin > where he programed in FORTRAN to simulation mechanical systems. While > teaching at Texas Tech University and Nanyang Technological > University, he developed interest in Multibody Dynamics. To develop > his own Multibody Dynamics simulator, he researched for the most > productive programming language and discovered Smalltalk. The live > programming capabilities of Smalltalk permitted him to build a > successful simulator which he then proceeded to commercialize. His > later experience with C++ at Mechanical Dynamics and MathWorks gave > him the idea of Digital Twin for Software.
PM
Pierre Misse-Chanabier
Wed, Nov 30, 2022 8:33 AM

Hello,

Slides are indeed better.
There is one mistake though, Slide 26: PharoJS does define a smalltalk VM.
They reuse the target environment JS VM, and send generate the runtime
that they use (very basically).

My main reserve is the feasability of this approach.
Unless you scope it to specific contexts.
Maintaining one application is diffficult, maintaining 2 is harder.
Plus, it requires experts in both languages.
Generating from one to the other has a number of challenges (as we
talked about already)
IMO, that is the root of the problem, and the main problem to address.
The slide are pretty convincing for the rest of the problem :)

Pierre

On 30/11/2022 08:09, Aik-Siong Koh wrote:

I have updated my slides based on the many feedback.
Digital Twin is better defined and how that helps productivity is
elaborated.
Thanks.
http://askoh.com/twin/DigitalTwinsCppSt20221129.pdf

Aik-Siong Koh wrote:

Hi:

I have a novel idea "Digital Twin applied to Software". See attached
slides.
It points to the future of improved programming productivity and
reliability.
Let me know what you think.

Thanks,
Aik-Siong Koh
http://ar-cad.com

Abstract

Digital Twin applied to Software
Aik-Siong Koh
askoh.com

There has been a major dichotomy in computing right from the
beginning: Statically Typed vs Dynamically Typed programming
languages. The former languages produce fast executables but are
inflexible to program. The latter are just the converse. This
dichotomy has been frustrating to programmers who always feel they
have to make sacrifices when making a choice. It also often leads to
futile language wars. The Digital Twin concept was introduced in
engineering where a physical system is modeled digitally in geometry,
simulation and other information. The concept has proven so
successful that it is being applied to almost everything in
engineering from simple mouse traps to complex whole cities. It
occurred to the author that this concept can be extended to software
too. For example, execution in C++ is famously fast. But development
in C++ is notoriously difficulty because of language complexity and
long build times. A flexible digital twin can be a program written in
Smalltalk which is famous for live programming. "Development at the
speed of thought" is the motto and is real. What is gained by this
duplication? Firstly, the flexible twin can be use to explore new
algorithms, features, solutions and fix bugs quickly. Only desired
codes are translated to C++ manually or automatically. Secondly, the
two programs can check each other so that bugs are reduced
significantly. These two gains will define future programming
productivity and quality. The Digital Twin concept will also drive
the automatic translation of the flexible language to the fast language.

Bio

Dr Aik-Siong Koh has a PhD from The University of Texas at Austin
where he programed in FORTRAN to simulation mechanical systems. While
teaching at Texas Tech University and Nanyang Technological
University, he developed interest in Multibody Dynamics. To develop
his own Multibody Dynamics simulator, he researched for the most
productive programming language and discovered Smalltalk. The live
programming capabilities of Smalltalk permitted him to build a
successful simulator which he then proceeded to commercialize. His
later experience with C++ at Mechanical Dynamics and MathWorks gave
him the idea of Digital Twin for Software.

Hello, Slides are indeed better. There is one mistake though, Slide 26: PharoJS does define a smalltalk VM. They reuse the target environment JS VM, and send generate the runtime that they use (*very* basically). My main reserve is the feasability of this approach. Unless you scope it to specific contexts. Maintaining one application is diffficult, maintaining 2 is harder. Plus, it requires experts in both languages. Generating from one to the other has a number of challenges (as we talked about already) IMO, that is the root of the problem, and the main problem to address. The slide are pretty convincing for the rest of the problem :) Pierre On 30/11/2022 08:09, Aik-Siong Koh wrote: > I have updated my slides based on the many feedback. > Digital Twin is better defined and how that helps productivity is > elaborated. > Thanks. > http://askoh.com/twin/DigitalTwinsCppSt20221129.pdf > > > Aik-Siong Koh wrote: >> Hi: >> >> I have a novel idea "Digital Twin applied to Software". See attached >> slides. >> It points to the future of improved programming productivity and >> reliability. >> Let me know what you think. >> >> Thanks, >> Aik-Siong Koh >> http://ar-cad.com >> >> >> Abstract >> >> Digital Twin applied to Software >> Aik-Siong Koh >> askoh.com >> >> There has been a major dichotomy in computing right from the >> beginning: Statically Typed vs Dynamically Typed programming >> languages. The former languages produce fast executables but are >> inflexible to program. The latter are just the converse. This >> dichotomy has been frustrating to programmers who always feel they >> have to make sacrifices when making a choice. It also often leads to >> futile language wars. The Digital Twin concept was introduced in >> engineering where a physical system is modeled digitally in geometry, >> simulation and other information. The concept has proven so >> successful that it is being applied to almost everything in >> engineering from simple mouse traps to complex whole cities. It >> occurred to the author that this concept can be extended to software >> too. For example, execution in C++ is famously fast. But development >> in C++ is notoriously difficulty because of language complexity and >> long build times. A flexible digital twin can be a program written in >> Smalltalk which is famous for live programming. "Development at the >> speed of thought" is the motto and is real. What is gained by this >> duplication? Firstly, the flexible twin can be use to explore new >> algorithms, features, solutions and fix bugs quickly. Only desired >> codes are translated to C++ manually or automatically. Secondly, the >> two programs can check each other so that bugs are reduced >> significantly. These two gains will define future programming >> productivity and quality. The Digital Twin concept will also drive >> the automatic translation of the flexible language to the fast language. >> >> >> Bio >> >> Dr Aik-Siong Koh has a PhD from The University of Texas at Austin >> where he programed in FORTRAN to simulation mechanical systems. While >> teaching at Texas Tech University and Nanyang Technological >> University, he developed interest in Multibody Dynamics. To develop >> his own Multibody Dynamics simulator, he researched for the most >> productive programming language and discovered Smalltalk. The live >> programming capabilities of Smalltalk permitted him to build a >> successful simulator which he then proceeded to commercialize. His >> later experience with C++ at Mechanical Dynamics and MathWorks gave >> him the idea of Digital Twin for Software. >
EM
Eliot Miranda
Wed, Nov 30, 2022 3:42 PM

Hi Aik-Siong,

the opensmalltalk-vm is such a digital twin, arguably a quadruplet :-). The vm is developed in Smalltalk, actually a subset called Slang. This is called “the simulator”. The Slang Smalltalk code is then transpiled to C, (alongside C, Objective-C & C++ platform support code managed in git), to provide the production vm. The simulator and its resultant generated vm code contain assertions. These are always evaluated when simulating. But in the production vm we have three compilation levels, “production”, level 2 optimized, assertions ifdeffed out, “assert”, level 1 optimized, assertions included, and “debug”, no optimization, assertions included.

The simulator is very powerful and a joy to use (see the two versions of “Two Decades of Live Coding and Debugging of Virtual Machines through Simulation.” on https://squeak.org/research/). The debug vm is a few times slower than the production vm (but this is a weird comparison because they produce very similar JITted code, so JITted code is almost the same speed, but support code isn’t)

Two further examples of digital twins to observe in the simulator include “lemming debugging”, and meta circular plugins.

Lemming debugging is duplicating the vm state before each GC, and performing the GC in the clone before in the original. So if the GC has a bug and corrupts the heap it does do in the clone and we still have the unscrambled original from which to clone again and repeat until we fix the bug. [and of course via fork it would be possible to write this in the production vm).

Meta circular implementations of plugins, eg the socket plug-in, are those where a plug-in (a set of primitives, typically providing an interface to external functionality) in the simulator is implemented above the current vm. A plug-in primitive in the socket plug-in is typically a piece of glue code between the Smalltalk level and the platform support code implementing a socket operation on the current platform. The glue code is implemented in slang Smalltalk and is executed directly. The simulator then implements the platform support code used in simulation in terms of the real socket plug-in included in the host vm.

Eliot
,,,^..^,,, (phone)

On Oct 28, 2022, at 12:25 PM, Aik-Siong Koh askoh@askoh.com wrote:

 Hi:

I have a novel idea "Digital Twin applied to Software". See attached slides.
It points to the future of improved programming productivity and reliability.
Let me know what you think.

Thanks,
Aik-Siong Koh
http://ar-cad.com

Abstract

Digital Twin applied to Software
Aik-Siong Koh
askoh.com

There has been a major dichotomy in computing right from the beginning: Statically Typed vs Dynamically Typed programming languages. The former languages produce fast executables but are inflexible to program. The latter are just the converse. This dichotomy has been frustrating to programmers who always feel they have to make sacrifices when making a choice. It also often leads to futile language wars. The Digital Twin concept was introduced in engineering where a physical system is modeled digitally in geometry, simulation and other information. The concept has proven so successful that it is being applied to almost everything in engineering from simple mouse traps to complex whole cities. It occurred to the author that this concept can be extended to software too. For example, execution in C++ is famously fast. But development in C++ is notoriously difficulty because of language complexity and long build times. A flexible digital twin can be a program written in Smalltalk which is famous for live programming. "Development at the speed of thought" is the motto and is real. What is gained by this duplication? Firstly, the flexible twin can be use to explore new algorithms, features, solutions and fix bugs quickly. Only desired codes are translated to C++ manually or automatically. Secondly, the two programs can check each other so that bugs are reduced significantly. These two gains will define future programming productivity and quality. The Digital Twin concept will also drive the automatic translation of the flexible language to the fast language.

Bio

Dr Aik-Siong Koh has a PhD from The University of Texas at Austin where he programed in FORTRAN to simulation mechanical systems. While teaching at Texas Tech University and Nanyang Technological University, he developed interest in Multibody Dynamics. To develop his own Multibody Dynamics simulator, he researched for the most productive programming language and discovered Smalltalk. The live programming capabilities of Smalltalk permitted him to build a successful simulator which he then proceeded to commercialize. His later experience with C++ at Mechanical Dynamics and MathWorks gave him the idea of Digital Twin for Software.

Hi Aik-Siong, the opensmalltalk-vm is such a digital twin, arguably a quadruplet :-). The vm is developed in Smalltalk, actually a subset called Slang. This is called “the simulator”. The Slang Smalltalk code is then transpiled to C, (alongside C, Objective-C & C++ platform support code managed in git), to provide the production vm. The simulator and its resultant generated vm code contain assertions. These are always evaluated when simulating. But in the production vm we have three compilation levels, “production”, level 2 optimized, assertions ifdeffed out, “assert”, level 1 optimized, assertions included, and “debug”, no optimization, assertions included. The simulator is very powerful and a joy to use (see the two versions of “Two Decades of Live Coding and Debugging of Virtual Machines through Simulation.” on https://squeak.org/research/). The debug vm is a few times slower than the production vm (but this is a weird comparison because they produce very similar JITted code, so JITted code is almost the same speed, but support code isn’t) Two further examples of digital twins to observe in the simulator include “lemming debugging”, and meta circular plugins. Lemming debugging is duplicating the vm state before each GC, and performing the GC in the clone before in the original. So if the GC has a bug and corrupts the heap it does do in the clone and we still have the unscrambled original from which to clone again and repeat until we fix the bug. [and of course via fork it would be possible to write this in the production vm). Meta circular implementations of plugins, eg the socket plug-in, are those where a plug-in (a set of primitives, typically providing an interface to external functionality) in the simulator is implemented above the current vm. A plug-in primitive in the socket plug-in is typically a piece of glue code between the Smalltalk level and the platform support code implementing a socket operation on the current platform. The glue code is implemented in slang Smalltalk and is executed directly. The simulator then implements the platform support code used in simulation in terms of the real socket plug-in included in the host vm. Eliot _,,,^..^,,,_ (phone) > On Oct 28, 2022, at 12:25 PM, Aik-Siong Koh <askoh@askoh.com> wrote: > >  Hi: > > I have a novel idea "Digital Twin applied to Software". See attached slides. > It points to the future of improved programming productivity and reliability. > Let me know what you think. > > Thanks, > Aik-Siong Koh > http://ar-cad.com > > > Abstract > > Digital Twin applied to Software > Aik-Siong Koh > askoh.com > > There has been a major dichotomy in computing right from the beginning: Statically Typed vs Dynamically Typed programming languages. The former languages produce fast executables but are inflexible to program. The latter are just the converse. This dichotomy has been frustrating to programmers who always feel they have to make sacrifices when making a choice. It also often leads to futile language wars. The Digital Twin concept was introduced in engineering where a physical system is modeled digitally in geometry, simulation and other information. The concept has proven so successful that it is being applied to almost everything in engineering from simple mouse traps to complex whole cities. It occurred to the author that this concept can be extended to software too. For example, execution in C++ is famously fast. But development in C++ is notoriously difficulty because of language complexity and long build times. A flexible digital twin can be a program written in Smalltalk which is famous for live programming. "Development at the speed of thought" is the motto and is real. What is gained by this duplication? Firstly, the flexible twin can be use to explore new algorithms, features, solutions and fix bugs quickly. Only desired codes are translated to C++ manually or automatically. Secondly, the two programs can check each other so that bugs are reduced significantly. These two gains will define future programming productivity and quality. The Digital Twin concept will also drive the automatic translation of the flexible language to the fast language. > > > Bio > > Dr Aik-Siong Koh has a PhD from The University of Texas at Austin where he programed in FORTRAN to simulation mechanical systems. While teaching at Texas Tech University and Nanyang Technological University, he developed interest in Multibody Dynamics. To develop his own Multibody Dynamics simulator, he researched for the most productive programming language and discovered Smalltalk. The live programming capabilities of Smalltalk permitted him to build a successful simulator which he then proceeded to commercialize. His later experience with C++ at Mechanical Dynamics and MathWorks gave him the idea of Digital Twin for Software.