# Monkeypatching the AI Mind

**URL:** <https://www.ruby-forum.com/t/monkeypatching-the-ai-mind/186740>\
**Category:** Ruby\
**Created:** [February 25, 2008, 5:10pm UTC](https://www.ruby-forum.com/t/monkeypatching-the-ai-mind/186740 "2008-02-25T17:10:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 25, 2008, 5:10pm UTC](https://www.ruby-forum.com/t/monkeypatching-the-ai-mind/186740/1 "2008-02-25T17:10:40Z")

</div>

The recent discussion of “monkeypatching” in Ruby  
brings up the general idea of changing an AI Mind  
program “on the fly.”

Does the “Java hotspot compiler” do the same thing  
for Java – “optimizing the airplane while you’re in  
flight”?

[MindForth AI Engine for Robots Equipped with Artificial Intelligence](http://mind.sourceforge.net/mind4th.html) (MindForth)  
AI has recently become a True, thinking AI and  
needs to be ported into Ruby or Java or any  
other language (Dylan?) in which the software  
of a living AI mind can be changed _while_  
the\_program\_is\_running – so that the AI Mind  
can live forever – barring misadventure.

[http://mentifex.virtualentity.com/m4thuser.html#3.4.1](http://mentifex.virtualentity.com/m4thuser.html#3.4.1)  
describes the issue of immortalising the AI Mind.

## Arthur

> **[Artificial Intelligence Wikipedia-based Free Textbook](https://mind.sourceforge.net/aisteps.html)**
>
> Using Wikipedia articles and free on-line AI4U textbook chapters to teach AI.

> **[Ruby AI Blog for the Artificial Intelligence Wikipedia-based Free Textbook](https://mind.sourceforge.net/ruby.html)**
>
> Use the concept-fiber theory of cognitivity to create AI minds in Ruby.

> **[Java AI blog for the Artificial Intelligence Wikipedia-based Free Textbook](https://mind.sourceforge.net/java.html)**
>
> Using the AI4U textbook to create artificial Minds in Java for robots.

[http://mind.sourceforge.net/theory5.html](http://mind.sourceforge.net/theory5.html)

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 25, 2008, 5:39pm UTC](https://www.ruby-forum.com/t/monkeypatching-the-ai-mind/186740/2 "2008-02-25T17:39:40Z")

</div>

Wouldn’t the patching of existing objects (rather than monkey patching  
existing classes) be a better analogy to the MindForth thing you’re  
linking to?

Best regards,

Jari W.

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 25, 2008, 7:35pm UTC](https://www.ruby-forum.com/t/monkeypatching-the-ai-mind/186740/3 "2008-02-25T19:35:58Z")

</div>

removed\_email\_address@domain.invalid wrote:

> The recent discussion of “monkeypatching” in Ruby  
> brings up the general idea of changing an AI Mind  
> program “on the fly.”
> 
> Does the “Java hotspot compiler” do the same thing  
> for Java – “optimizing the airplane while you’re in  
> flight”?

There are two different questions here - does the HotSpot compiler  
optimize  
Java programs while they’re running? Yes, it does - modern JVM  
incarnations  
dynamically compile and decompile bytecode to native code and back  
depending  
on runtime factors. Does this allow for reconfiguration of the “AI  
Mind”  
dynamically? No, because that happens at the Java language level, not  
the  
HotSpot compiler level.

Now you have a followon question - does Java allow for dynamic  
reconfiguration  
of the “AI Mind” software? Yes - but it doesn’t depend on HotSpot  
compilation  
to do so.

> [MindForth AI Engine for Robots Equipped with Artificial Intelligence](http://mind.sourceforge.net/mind4th.html) (MindForth)  
> AI has recently become a True, thinking AI and  
> needs to be ported into Ruby or Java or any  
> other language (Dylan?) in which the software  
> of a living AI mind can be changed _while_  
> the\_program\_is\_running – so that the AI Mind  
> can live forever – barring misadventure.

Java is inherently a dynamic language and has several useful features  
that  
allow it to modify a running program in flight. They live at the  
language  
level, so all JVMs and Java compilers must support them, whether HotSpot  
or not.
