free MP3s recorded of codesimian: fractalSound1.mp3 b.mp3 c.mp3 d.mp3 but its more fun to create your own...

Start CodeSimian NOW (applet)

limited by internet security,
not all parts of CodeSimian work here.
Requires Java 1.5 and 2 ghz CPU

Download CodeSimian NOW (JAR file)

or click SAVE then double-click CodeSimian.jar
Requires Java 1.5 and 2 ghz CPU

Plans for CodeSimian

things that should be added to CodeSimian,
highest priority at top (after the summary at the top)

Intro/Tutorial | SourceCode | FAQ? | ListOfCommands | ~~Sounds/Audio (generated by equations)~~ | PlayElectricGuitarWithTheMouse | FREE MP3s (play and modify them with CodeSimian) | Pictures | Javadoc/TechnicalDocuments | CompareToJava | Plans (what to build) | RootClass | 1 Type | SystemReq | Humans | DNA | Bugs/Flaws | Wiki | Def | my resumE (give me a programming job) | Contact

Java programmers, and inexperienced computer users, can both help build CodeSimian. It takes only 1 minute to modify the software and create a new JAR file containing all your changes. Writing Java code is much harder than writing codesimian code, but its sometimes necessary. Since I've already written a lot of Java code, the codesimian code you write can automatically use that Java code.


When all the parts below are created, CodeSimian will become a global internet program, called the CodeSimian Network, then it will continuously improve itself until it is smarter than 1 average Simian (example: monkey). it naturally follows that it would slowly improve its own monkey-like code. If it makes a good change, we make thousands or millions of copies. If it makes a bad change, we restore from backup. Once it reaches that critical-mass-of-intelligence, it would have to get smarter and smarter until most computers connected to the internet choose to use it because it connects them to the internet and their computer more intuitively and intelligently predicts and automates tedious things. Many programmers are working on similar things... These different softwares are becoming more and more capable of using eachother automatically. Example: JavaBeans. The internet is becoming intelligent and alive and we can all help build it, even if you dont know programming.

* Self-Aware, able to copy modify and understand itself.
** Example: the selfReplicatingWindow is partially self-aware.
** display its own code in a window, and let a Human modify the code through that window.
** convert its code between object form and text form, at any time,
and the code should continue to work the same way after many conversions.
** automaticly created new Java code to replace some Java parts of CodeSimian.
Some CodeSimian code will be convertible to Java code.
Its not necessary to ever convert Java code to CodeSimian code (the reverse).
I dont have to be aware of the physics that control my brain to be self-aware of my own thoughts.
* Internet
** many people work on the same program simultaneously through the internet.
As soon as a sub-program of CodeSimian starts being built (even if it doesnt work yet),
anyone on the CodeSimian network can get/use/modify it immediately.
** file-sharing through the internet
*** search by sound instead of filename of that sound (only on the CodeSimian network). Hum into your microphone to bring up a list of mp3 downloads that sound similar.
*** search existing file-sharing networks at the same time (search by text filenames only).
* each copy of the program is a little different
** Create new Java bytecode at runtime (Javassist claims it can modify existing classes at runtime) and add it to a new CodeSimian.jar (not the CodeSimian.jar executing now).
** Each CodeSimian.jar knows how to combine itself with some parts of other modified CodeSimian.jar's, so they can breed autonomously.
** When you type code into CodeSimian or build something or find something interesting, those things can be included in a new CodeSimian.jar, which you can save using a normal file-dialog.
** Online competitions between CodeSimian.jar's. Search for CodeSimian.jar's to breed.
* combine many types of artificial-intelligence so they can use eachother. The whole will be smarter than the sum of its parts. Intelligence is emergent.
** bayesian networks (each bayes node is a CS)
** neural networks (each neuron is a CS)
** random guessing (it works sometimes)
** genetic algorithms (combine CS objects by following instructions in the CS used as DNA)
** evolution algorithms (evolve combinations of CSs)
*** Evolution of code toward any measure of the code (code measures code)
Example: the following measurer only measures true if the code its measuring
contains exactly 5 things: func( 0#measureMe ==I(countP(measureMe) 5) )

** agents (each is a CS with certain goals. The CS.PType(int) function tells what those goals are.)
** particle swarm and ant colony behavior (each particle or ant is a CS)
** input its own code into itself to build a copy of itself, and try to improve it each time
** text interpretation and generation, like the OpenCYC project. (each letter or word is a CS)
** artificial-life (CSs breeding and building more CSs)
** any new type of artificial-intelligence that CodeSimian creates from scratch or as a combination of these.
** any type of artificial-intelligence I forgot
** since all of these artificial-intelligences are made of CSs, they are INTERCHANGABLE. You dont even need to know which one you're using.
* Games
** evolving shapes and behaviors of 3d objects in the game.
Build your own parts of the game as you play it. The start of this is in but 3d objects can be any Java class type.
Until then, there is a 2d game in file puyo.cs
** convert my Asteroids game to Java and use its 3d objects in an evolving game.
* Audio
** synthesize new sound from scratch,
as equations of time vs wave-amplitude, 20000 times per second.
** MP3s: modify and play them in ways never done before (by wave equation). Use JLayer to load MP3s.
** synthesize new combinations of existing equations and existing MP3s to build new MP3s.
** audio in games is created on-the-fly from equations and is different every time
* Make computer-programming easier than its ever been
** programming is easy enough that programs can build programs can build programs...
** people with no computer training can build complex programs
** more-creative interaction between Humans and Computers than ever in history,
resulting in the emergent creation of the first autonomous living software.
This requires approximately 10000 Humans using 10000 computers simultaneously on the internet.
* Humans: will be an important part of the CodeSimian Network. Humans have immediate intuition and knowledge that would take computers many hours to calculate. Think of a voluntary Borg Collective but with mouse and keyboard instead of brain implants...
** Get Humans to use CodeSimian by including games, file-sharing,
new kinds of audio manipulation, general artificial intelligence, and many other things, all combined interchangably to evolve something fun inside CodeSimian.
All parts of CodeSimian can run automaticly, but Humans can also use any of them manually.
** Humans and animals are the largest and smartest source of raw intelligence,
much faster than all the computers on earth combined.
CodeSimian eats intelligence and becomes smarter. Be a cog in CodeSimian's machine.
CodeSimian has a use for all types of cogs.
Dont change what you do normally. Have fun! CodeSimian will eventually adapt to your cogging style.

** For example, if you often use CodeSimian to search for information about quantum physics, when other people search for quantum physics, CodeSimian might start asking you questions about quantum physics to help in their search, and to them to help in your search. Your answers will also help direct your own search. CodeSimian will use all sources of INTELLIGENCE until they complain about being asked too many questions.
** CodeSimian is RECURSIVELY FREE (obey GPL licence) therefore the quantity
of Humans that CodeSimian will interact with will be higher and CodeSimian will learn more.
** evolve a new grammar and syntax for CodeSimian thats more advanced than the current one: +(3 4 5 *(2 3) 7 8)
It might look more like Java: 3+4+5 + 2*3 + 7+8

The rest of this page is the things that need to be added to CodeSimian, highest priority closer to the top of the page

Assuming that it is intelligent, use it to build more intelligence. Start with randomness and let the intelligence build itself.

Create a subclass of CS that is an int[] array in memory, and paints ints onto the screen as pixels. Rows first, then columns. 1 dimensional array for 2d image. Repaint the image when the CS is executed. For efficiency, make it a subclass of PrimitiveArray.IntArray.

Make a subclass of that image CS, which uses a 2d array instead of 1d. Each index in this CS is 1 row, which may be a PrimitiveArray.IntArray or any other CS. Using the drawimage functions in java.awt.Graphics, not all lines have to be drawn at once, so if a row is made of slow CSs, they would be drawn slowly a few lines at a time instead of VERY slowly all at once. Before painting the window, find the largest row size. Interpret all rows that size, and paint black on the ends of rows not long enough. Only the first 24 bits of each int are used for color.

CodeSimian plays MP3s (can be combined with other sound equations), but it could be improved in many ways:

JLayer (uses LGPL licence) to connect CodeSimian to MP3s. Modifies MP3s as they play. Mixes MP3s in fuzzy ways defined by turing-complete equations.

8/2006 it plays mp3s if you give it a filename or URL to find the mp3,
like this: sound(mp3("" *(count 5.67)))
The *(count 5.67) is optional. It specifies an exact position in the mp3 to play, and that position changes 22050 times per second.

DOWNLOAD HACK: At first the mp3() would not play on the sound() because the mp3 took too long to download and decompress, but, but I tricked the sound() into not turning off by making the mp3() give it random data until the real data is loaded. The result is you hear quiet buzzing random data and 5-30 seconds later the mp3 plays. I want some way to make the sound() not turn off, and wait until its loaded to start playing. Also, I want some kind of on-screen progress-bar that tells what is downloading and how long it will take. This progress-bar should be made of codesimian code. The following objects should be useful: window(x), slidebar(x), timer(x x), 0 "fileNameOrURL")

MP3 MEMORY PROBLEM, NEED RANDOM ACCESS: A typical 5 megabyte mp3 decompresses to approximately 50 megabytes. By default, Java only uses less than 100 megabytes. Java's heap memory can be increased by some options that may not work on all computers, but that would not solve the problem well enough because codesimian is meant to play many mp3s simultaneously. It wouldnt play them the same as having 10 winamps playing simultaneously. It would mix them by whatever strange equation you type in. For example, you can multiply (* is multiply) 2 mp3s: sound(*(mp3("C:\\a.mp3") mp3("C:\\b.mp3"))) We should increase java's memory if possible, but also fix the problem directly... I want to be able to decompress only part of the mp3 without decompressing the entire mp3 and discarding those parts I dont want. I want random-access to the mp3. In JLayer, the Header class is somehow related to this, but I'm afraid JLayer was not designed to allow random-access to be added in the future. It may be a major modification of JLayer, but I dont understand JLayer enough. CodeSimian only includes 1 of its packages, the 1 for mp3 decoding.

CACHING PROBLEM: Even if we build random-access to mp3s, we still cant jump around the mp3 as fast as we can jump around a section thats fully loaded into memory. We can predict which sections it will jump to, but no prediction algorithm will work for equations that behave randomly, which tend to evolve often. 1 frame in an mp3 is approximately 2200 bytes. It would be most efficient to cache some integer multiple of that at a time.

Then build a simple file-sharing-network to exchange all types of files, so code files and mp3s can automaticly be created and shared between all computers running CodeSimian. CodeSimian will create and distribute updates of itself without the help of a Human programmer.

Theoretically CodeSimian could evolve combinations of existing music so you never hear the same music twice. Every time you listen, you hear a different evolution of the sound waves. 6/2006 The EvolveCode class is not yet finished, but it works a little, and its for general evolution, not specific to audio.

Build a Winamp plugin that routes audio through CodeSimian before giving it back to Winamp. Use custom on-screen controls to modify sound as it plays in Winamp.

Build an evolution system where combinations of window/buttons/slidebars/textareas/sounds/+/*/etc evolve by breeding and dying when a Human closes the window on the screen. Everything must have a window (graph can be traversed to find a WindowCS instance), and that window can be checked to determine if it is off-screen and if so then kill all evolved programs that use that window.

Existing CSs that may be useful: randomlyCombineCode bayesNode simpleBayesNet window button slidebar textarea...

You would see approximately 20 windows on your screen, and when you close a window, a new window appears. The new window is built as a combination of the existing windows. The behaviors of the new windows gradually become what you select by closing windows. You can steer the evolution toward something without telling the computer what that thing is.

It would evolve faster if the computer could automate the way of selecting which windows to close. Instead of closing windows, you could tell the computer a number for how well it is choosing windows you like, and you could evolve the equations that choose which windows to close instead of closing them manually. You could choose to only view 1 random window out of every 1000 evolved to see evolution faster. Then you could evolve equations that build equations... on to infinity. Equations should not be a simple random mutation of its parents. They should be CHOSEN by the parents.

CodeSimian currently 10/06 has only limited internet abilities. When more are added, many people will participate in the same system of evolving windows (and other things). Most CodeSimian programs are compatible with the Serializable interface, so they can easily be serialized into a sequence of bytes, sent through the internet, and reassembled on the other computer, theoretically. The most popular windows will have a higher chance of appearing in your random programs, and an even higher chance if you tend to think like the people who created the parent windows (of your child window).

Try to obey robots.txt of the website if it has one (example: to avoid being banned from specific sites. Create a .cs file (contains codesimian code) that loads webpages, or one $pecific page many times, like if you wanted to monitor the webpage at a specific URL for changes, on some interval you specify as a string of codesimian code in a textarea, and when it changes (change is measured by codesimian code in a textarea), it will wait some delay (defined by code in a textarea, like randomness on a bell curve), then do some action you specify in the last textarea, then continue scanning websites for other pages that match your requirements that you typed. Why would you want to do that? You might want to scan search engines with the same query to see if the rankings of pages change. Or you might want it to do different searches and tell you if it sees any words from a certain list of words in the search results. If you repeatedly have to sign into a website and check trivial things, let CodeSimian do that tedious work for you. Which webpages CodeSimian watches might change at runtime. CodeSimian would be a very-customizable web-crawler.

The TimerCS class needs to be fixed to work on all executions, not just the first. Currently, whatever values its params have when its first executed can not be changed. It times on that interval and quantity of executions then stops. If you're collaborating with others through a website where you r

CodeSimian is organized around the public functions of 1 file:, but there are too many functions without clear relationships to eachother. 2/3 of those functions can be organized into a 6-dimensional grid. The dimensions are:
RETURN - any primitive or object (including arrays)
INSTANCE - any CS object, or maybe any type of object.
For example, to convert a CS to a StringTokenizer, execute thatCS.L(StringTokenizer.class)
1 OF 4 ACTIONS: GET, SET, INSERT, OR DELETE - the 4 basic list operations
LOCATION - usually int, sometimes String or Class, possibly double (for interpolating between indexs), but any primitive/object/array is valid
QUANTITY - usually int, possibly double (for interpolating between indexs)
VALUE - any primitive/object/array

These 6 dimensions can be used in any arbitrary combination to specify (or create?) new Java functions. I created approximately 100 functions inside, but this 6-dimensional grid can prove the need for specific other functions, and organize them at runtime.

Example: new S("abcdefgh").L(3,double[].class,4)
RETURN TYPE = double[].class
RETURN VALUE = new double[]{ (double)'d', (double)'e', (double)'f', (double)'g' }
INSTANCE TYPE = codesimian.S.class
INSTANCE VALUE = new S("abcdefgh")
1 OF 4 ACTIONS TYPE = byte (only the lowest 2 bits)
1 OF 4 ACTIONS VALUE = CS.GET, which equals (byte)0
LOCATION TYPE = int.class
QUANTITY TYPE = int.class
VALUE TYPE = java.lang.Class.class
VALUE VALUE = double[].class

Example: aCompiler.insertL1(1,"sound(*(microphone 3))")
RETURN = true
INSTANCE = aCompiler
VALUE = "sound(*(microphone 3))"

Create some simple Java interfaces to be used as labels to organize these 6 dimensions. 4 interfaces,,, would include the relevant functions in, and CS would implement all 4 of these. Maybe create a class to label functions that only operate on 1 index or 1 thing, and maybe a class for functions whose quantity varies. Or maybe combine them to get 8 interfaces including etc.

It does not fit perfectly, but there should be a way to specify any function in this 6-dimensional grid by a String. Use part of java's class file format, described here:

Element Type / Encoding
boolean / Z
byte / B
char / C
class or interface / Lclassname;
double / D
float / F
int / I
long / J
short / S

For example: new S("abcdefgh").L(3,double[].class,4) would use the function described by something like this string:


and it might be used dynamicly as codesimian code this way:

Ljava.lang.Object;Lcodesimian.CS;GET;I;I;Ljava.lang.Class;( list(100 101 102 103) "abcdefgh" GET 3 4 javaType("double[]") )

Build a network of CSs that each convert at least 1 type of Java object to at least 1 other type. In class CS, the function L(Class) returns an object with a specific class type, and the function setL(Object) sets the value of this CS to the Object. Each Object has a class type. L and setL are the inputs and outputs of a CS, but they only use objects and arrays. For primitives, there is 1 function for each get of each primitive type, and 1 function for each set. Example: setD(double) sets the value of this CS as a double, and F() returns the value of this CS as a float. They input and output java objects and/or java arrays (primitive arrays or object arrays). Build some automated way to convert one type of java object to any other type of java object. Build a network of CSs that convert from type X to type Y, etc. If there is a conversion X-->Y and Y-->Z, then an X can be converted to type Z. If there is also a Z-->X conversion, X Y and Z become interchangable. This involves a lot of wrapper-classes, and wraps are usually not perfect, so usually the more steps in the conversion, the more accuracy and behaviors of the wrapped code is lost. Still there is much advantage to being able to convert more types of objects to more other types. Build an automated way to interpret CONTEXT of the wrapping. Add a CS parameter to the wrap function, like this: public Object wrap(Object from, Class to, CS context){ /*return (to) from;*/ } Put this new wrap function in class Reflect or class Static or maybe its own class. I dont know what "context" should do, but I am sure its necessary for advanced behavior. What should be put into its params before its used? to? from? some other Object?

Build this node/network system. Build many types of nodes, evolve them, execute them on eachother, and use them to give CodeSimian intelligence and free-will (derived partially from pseudorandom numbers).

In all artificial-intelligence algorithms, there are many kinds of networks and nodes, but I want to build a system that uses them all interchangably. For example, bayesian-network nodes and neural-network nodes could be in the same network. To allow this, CodeSimian will use all types of nodes and networks the same way. The STANDARD is...

A NETWORK is made of NODES, and is also a kind of node, so it can be used in other networks as a node.

A NODE is a CS whose minP() is at least 2.

anyNode.P(0) returns a list of child nodes. If the node is a network, the list contains all nodes in that network, with input nodes first, then hidden nodes, then 1 output node.

anyNode.P(1) returns a list of numbers that describe the state of the node. Nodes can change any of their own numbers or they might change none. Any number can be used as input, output, or both.

anyNode.P(2 or higher...) can be anything. This definition of NETWORKS and NODES does not specify.

It is not required, but a node should try to set its value when it is asked to (by setD(double) for example). To set its value, it should not change its nodes, but it should change its numbers, and the new numbers should cause the node to return a number closest to the requested value.

You may not change P(0).countP() or P(1).countP(). All you may do is replace whats already there. Only a node itself may change the quantity of things in its P(0) or P(1). For example, a bayesNode requires that there be exactly 2^(X+1) chances if theres X nodes. The bayesian algorithm does not work any other way.

INFINITE LOOPS: When a node sets the value of numbers in its P(1) list, if any of those numbers are also nodes, it could cause a chain-reaction of nodes and numbers changing their values that becomes an infinite-loop.
RULE TO PREVENT INFINITE LOOPS: A NETWORK MAY NOT CONTAIN A CYCLE THAT GOES THROUGH ANY NODE'S P(1), but it may have cycles that go through P(0) since that is supposed to contain nodes.


bayesNode(list(other nodes...) list(chances...)) - has X other nodes and 2^(X+1) chances.


Some nodes could be built to modify other nodes. The nodes they modify are in P(0) and the way they modify them is a function of the numbers in P(1).

A node that trains other nodes to match its numbers as closely as possible.

A neural-network node that has an equal quantity of nodes and numbers, 1 weight for each node.

A node that returns a + b*x + c*x^2 + d*x^3... where x is the only number in P(1) and abcd... are the nodes.

A node that has no function of its own, but does whatever its P(2) tells it to. Evolve P(2).

A node that is simply a number, but since its a node it must have P(0) and P(1). They're just empty. This node is efficient and guarantees if you try to set it to some number value, it will be set. Its useful as an input node.

The new syntax should be a RECURSIVE POLYMORPHIC SYNTAX. Example:
parseObjects( 0 list( parseObjects (( 0 list (( parse these objects... )) )) ) )
but there is a problem with that if theres no spaces between the parenthesis:
parseObjects(0 list(parseObjects((0 list((parse these objects))))))
How do you know if its ))) ))) or )) )) )) at the end?
Later there may be syntaxs where there is a different quantity of ( and ) and other weird symbols. I want the syntax to evolve.
There may be a logical solution, but I want to keep the core syntax as simple as possible.
It may be impossible to keep the necessary simplicity while using the necessary type of recursive polymorphic syntax.

A statement is that if P(0).Z() is true then P(1).Z() must also be true. Also create CSs for XOR and AND??? Create a network where each node contains one of these statements. Each node trusts every other node a different amount (if it has any knowledge about that node). Trust changes gradually as nodes predict correctly or incorrectly the relationship between P(0) and P(1). A network of trust forms. Nodes start working together to predict in more advanced ways. It would work best if P(0) and P(1) do not change based on time or their quantity of executions. They should only change based on things other parts of the network can view or control. Since P(0) and P(1) can be anything, this summary of an algorithm would create a general-artificial-intelligence.

continuousBayesNode(list(childs...)list(chances...)) is the most similar thing to that. It adjusts its chances gradually to predict the value of the last child based on the values of the other childs. By the difference of the prediction and the actual value of the last child at that time, the chances can be adjusted to predict better on average. Its a very limited form of intelligence PER NODE, but when you combine thousands of them, on average they behave more intelligently.

Make a network where each edge (between 2 nodes) is 2 transformations of one string to a different string, 1 for each direction. Transformations are reversible. A-->B-->A always results in the original string for any A and B. You can traverse the network in any connected order, even if it has cycles.

Define NAMESPACES in CodeSimian language. Currently, there is 1 global namespace, and there are problems with creating new functions' names. This is not the result of laziness. Its a result of the way CodeSimian code is represented. Code is defined as a graph/network shape of CodeSimian objects. In a graph shape, how can you know if you're above or below any specific namespace? CodeSimian can have many different syntaxs simultaneously. Can you make any improvement over having only 1 (global) namespace?

12/05 I made some progress on this. In the root class there now exists parent() and setParent(CS) functions. Since KEYWORD can theoretically be derived from PARENT's NAME, I removed keyword() and setKeyword(String). Used with newInstance(), these define a basic inheritance-like structure that namespaces might be built on top of.

A window that has 1 button for each command in CodeSimian language, and a textarea where code is put. Click the buttons to create code in the textarea. Code objects contain other objects, defined by ( and ). For example, in +(*(2 3) /(4 5) 6), the + object contains 3 objects: 2 times 3, 4 divided by 5, and 6. When you click a button, the code object on the button is added to the textarea. There is also a ) button, which ends the current object. If you click + then the following is added: +(

A normal compiler of codesimian code is:
compilerPipeline( 0 "code()" tokenizeCode(0 0) tokensToObjects(0 0) parseObjects(0 0) )
Create an alternative to tokensToObjects (made of codesimian code) that contains
a list of interpretations of text in order of priority.
Example: The first finds names equal to the default objects (like + or tokensToObjects), or returns false.
The second checks if it equals an existing name, and returns the same object (that has that name) if so. I dont know how it can keep a list of existing names since it gets them 1 at a time. This could be a big problem!!!
The third checks if the name is a valid Java class (like java.awt.Component) or variable, or returns false.
The fourth creates a new variable with that name, and always returns true.
Theoretical CodeSimian code:
	createDefaultObject#first(0 0)
	findObjectByName#second(0 0 theObjects)
	createJavaMethodWrapper#third(0 0)
	createNewVar#fourth(0 0)

SEMICOLON (probably need to choose a different symbol):

To become more consistent, codesimian's syntax
needs to be able to define itself as objects...

When ; precedes (, ), or #, then it means the symbol for that thing.
;;;( is the symbol for the symbol for the symbol for (.
Example:    parseObjects(0 list( +(0 0) ;( 2 ;;;;# 4 ;) ))
  parseObjects(+(2 ;;;# 4) list( +(0 0) ;( 2 ;;;;# 4 ;) ))
Notice that ;;;# has 1 less ; than before it was used by parseObjects.
TokenizeCode should recognize ;;;;# as 1 token.
TokensToObjects should convert it to 1 object.
ParseObjects should execute it to determine how many ; are in it.
; could be a token by itself: ; ; ; ; #
then all symbols of the same type could be the same object.
It would not be known until parseObjects that
 its the symbol for # instead of a real #.
But tokensToObjects is incompatible with that (currently),
because it uses # to give objects names
 before giving those objects to parseObjects.
what should I do?
I could use # as an object and put a string in
 after it and send that to parseObjects, like this...
	list( +(0 0) ; # "thePlus" ; ( 2 3 4 ; ) )
which becomes
	+#thePlus(2 3 4)
	list( +(0 0) ; # "thePlus" ; ( 2 3 4 ; ) )
so this is what needs to be done:
* delay parsing of # and the name after it
until parseObjects (instead of during tokensToObjects).
* tokenizeCode needs to return each ; as a separate token
* parseObjects needs to check for these separately... ; # and names after #
but if tokensToObjects doesnt give names to objects,
then how can it have DUPLICATE OBJECTS in the list it returns?
Duplicate objects are necessary for graph shapes of code.
If tokensToObjects keeps checking for # and assigning names to objects,
it will have to make sure its # instead of ;# or ;;;;;#,
but it can ignore ; in combination with ( or ),
 because those can be done in parseObjects.
TokensToObjects only needs to have that exception
 for NAMES because it uses names to identify equal objects.
do I need a 4th compiler step somewhere in the middle?
MAJOR PROBLEM: ;;( is the symbol for
 the symbol for (, but what is the symbol for ; ?
That would need an other symbol, and an other
 symbol for that, on to infinity...
Do I ever need a symbol for ;? I do if I'm compiling code that includes ;.
By making ;;( be 1 token, ; is not a symbol at all,
 but it causes other problems...
Should I replace ; with \
\ is already the escape character for strings.
I could use it to escape codesimian's 3 arbitrary syntax characters: # ( and )
\# \( and \)
of course \" \t \n \\ etc are still included for strings.
If it can be done, this is the best solution
because it combines 2 escape characters into 1: \ and ;.
Can I assume \ is always followed by exactly 1 character to be escaped?

Build automated test-cases of all of CodeSimian's parts in many combinations. The test cases' CS.description() functions should describe what is being tested. The tests should be CodeSimian objects so CodeSimian can test itself while it runs.


CodeSimian is not the police and is not responsible for the illegal downloads that criminals force it to do.
As a computer-programmer, I am not responsible to do the police's jobs for them, even if it is VERY EASY for me to do by making a small change to my software. I am not obligated to be a SNITCH, a PUNK, nor a PUPPET. If you know of somebody using codesimian illegally, tell the police, not me, because I am the VICTIM here.

Stop DRM Now! Screw Digital-Rights-Management (DRM)!
Screw Digital-Rights-Management (DRM)!
Screw Digital-Rights-Management (DRM)!
Screw Digital-Rights-Management (DRM)!
Screw Digital-Rights-Management (DRM)!
Screw Digital-Rights-Management (DRM)!

I want CodeSimian to connect to some file-sharing network so it can upload and download files. Intelligent code needs files to learn from, and file-sharing networks only have the files that Humans like the most, so its good learning material. Also, it would give all CodeSimian programs running simultaneously a strong communication ability. Files of code or input or output could be sent between CodeSimian programs all the time. CodeSimian could apply its intelligence to searching better (when it becomes more intelligent)...

8/2006 the best java file-sharing program I've found to add to CodeSimian is


I'm currently investigating its ability to connect CodeSimian to the Gnutella Network so it can download mp3s and combine them by strange equations.

I'm worried that LIMEWIRE has platform-specific files that would cause CodeSimian to not be able to run on ANY computer, for example .dll files. Limewire can be started by double-clicking LimeWire.jar (like CodeSimian has a CodeSimian.jar) but if I remove the other files, LimeWire.jar will not start.

It might be possible to put all LimeWire's files into CodeSimian.jar and LimeWire would use them from there. CodeSimian.jar would become platform-dependent, whichever platform runs LimeWire's files. CodeSimian would be split into 2 versions, the other platform-INdependent (pure Java). If you load LimeWire's files dynamicly, there could be just 1 version and the LimeWire part would only work on certain operating-systems. These problems are why it would be better to find a pure Java open-source file-sharing software to connect to CodeSimian, instead of LimeWire. I'll search for one later...

I want to find some open-source file-sharing software that can be included inside CodeSimian.jar, which already contains hundreds of files. Such a program would probably be contained inside a single JAR file. Its easy for JAR files to contain other JAR files. Maybe LimeWire is not the best choice...

Use some of the open-source code of LIMEWIRE (a peer-to-peer (p2p) file-sharing program) to give CodeSimian access to the Gnutella network. Make CodeSimian objects to do the most basic functions of Limewire.

After that, build a more advanced kind of searching...

I want to add the ability to
search by sound instead of filename of that sound. Hum into your microphone and CodeSimian would find music that sounds similar.

A similar search could be done for pictures and possibly video, by drawing with the mouse or showing example pictures... CodeSimian would find similar looking pictures, instead of search by filename of the pictures.

A problem with this is the Gnutella network (which Limewire uses) only uses text, but since CodeSimian code IS text, the description of audio or pictures could possibly be pushed through those text lines. But probably I would have to add new abilities to the Gnutella network, and only users of CodeSimian could search for audio and pictures that new way. CodeSimian could still connect to Limewire and other Gnutella clients when searching for only text (filenames).

Java3D. Make basic 3d objects whose shapes and behaviors are defined by external CodeSimian code, probably code that evolves to win the game.

To be compatible with NETWORKS and NODES (above), 3d objects are defined this way:
some3dObject.P(0) returns the 3d objects that this 3d object is made of.
some3dObject.P(1) returns the numbers that describe this 3d object.
For example, obj.P(1).P(0) could be x position, obj.P(1).P(2) is z position,
obj.P(1).P(3-5) are x y and z SPEEDs.
obj.P(1).P(6) is the radius of a bounding sphere
of this 3d object, centered at the obj.P(1).P(0-2) position.
Other numbers could be for mass, rotation, etc.

Example Java3d game...

I want CodeSimian to become a WIKI of CodeSimian code - one global internet program that anyone can modify at any time, for free without a username and password and no signing up for anything.

Most of its users would use it to build more software (which takes only seconds for a small code). You wouldnt search the internet. You would write a few lines of software to search for you. The simplest example would be:
searchInternet(0 "whatever you would normally type to google")
but you could give it more complex goals than simple text. You might search for a page that certain people like and certain other people dont.
Or you could SEARCH FOR CODE that tends to output an odd number of 7s, any strange search... That would be useful because if we can search for something, so can the AI. It will learn from us.

The organization of its internet connection to other CodeSimian softwares (and other things) would be evolved and/or defined by the WIKI.

From your computer, you could not tell the difference between a Human typing and the combination of Human and AI intelligence typing, because they would be merged.

Why waste time trying to create intelligence when I can simply use the intelligence that already exists (Humans) together as the first smarter-than-Simian-AI and use it to build a smarter-than-Simian-AI that doesnt need Humans?

I want to use a large group of Humans (using their computers with mouse and keyboard) as a bootstrap to create the first smarter-than-Simian-AI.

Such an advanced AI would certainly be studied by thousands of Human programmers. If 10000 Humans using 10000 computers running a future version of CodeSimian as a WIKI cooperate to build a program as smart as a Simian (example: monkey). That program, combined with many hard-coded and proven methods of artificial-intelligence, would be smart enough to build a program thats slightly smarter than itself, that builds a smarter program... Each program is 1 JAR file that you double-click to start.

I'm NOT trying to build a smarter-than-Simian-AI. I'm building something that will allow thousands of Humans working together to build it, and I'm building a way for that process to be FUN to motivate them to help build it. Currently 12/05 the most fun part is the sound() object, but (as written above) I want to connect CodeSimian to Java3d and make 3d games with it also. I coded 2 3d games already as college class projects:
Asteroids and Golf.

Heres an example of a TEXT WIKI page about Extreme-Programming. If you see anything in it that should be changed, click "edit this page" at the top. Thats the advantage of a WIKI. People work for free. If you screw up that page, eventually somebody will restore from backup.

More operators to use with sounds. CodeSimian's design requires that anything can be used with anything else (unless it refuses at runtime), but these should be specialized in sound. Example: the Delay class always has 2 parameters, the input data and the number specifying how far back to look to get the data to return. It sounds a little like an echo, but it all depends on the combination of CodeSimian objects. You can use many Delays in one equation if you want.

This one is fun...
More sound equations. Any sound thats interesting, email its equation to me. I will assemble a sound page with downloadable sounds and author info on this website. A few example sound equations are on the intro page.


CodeSimian was not built for Humans to use. It was built more for CodeSimian to use Humans. I dont mean to disrespect your species, but there are already enough languages made for Humans, including Java, which CodeSimian is made of.
All GUI objects are wrapper-classes for Humans. Example code:
"window(slidebar(.3) 300 75)" pops up a window containing a slidebar at position 30%, in a window with dimensions 300x75 pixels.

"window(slidebar(.3))" would use the default dimensions. If .3 was not in the range 0.0 to 1, it would be wrapped to that range. Any number is valid. The MoveMouse class can move the mouse, and should be extended to also click it. Create a Keyb class to type on the keyboard. Finish the ScreenPixels class to read pixels from the screen as a 2d array. Use java.util.Robot class to access the screen.
These simple GUI objects will later dynamicly rearrange themselves like symbols on the computer screens on Star Trek do.

That one abstract superclass of all of CodeSimian is Reflect all its functions as CS objects. That should be done more efficiently than general reflection described below, because everything is a CS. 11/2006 this has been done. Now need to do it for general Java objects instead of only CS objects.

3/06 the Reflect class has a function that outputs Java classes as Strings when you input a Java Method. Those classes can be used in CodeSimian code (if you know their name, Names need to be improved). A more flexible way to use these new classes needs to be coded.

Use java.lang.reflect package to make general function, class, object, and variable wrappers for all object-oriented parts of Java, to access external java code at runtime as CodeSimian code. Make an other type of CS that UNreflects those things back to their original objects, wrappers inside wrappers that create the illusion that nothing changed, but CodeSimian is inside the object now.

3/06 the JavaMethod2 class dynamicly calls any Java function. Its parameters, instance object, and return value are defined by the list functions of class CS. Each has a different index, in this order: returnValue instance firstParameter secondParameter...

3/06 the following Java function (in class: Reflect) creates a Java class (that uses the function) when you give it a Java function.
   public static String javaCodeForNewSubclassOfCS(String nameOfNewClass, Class parentClass, Method callMe)
I have only tried it on functions inside class CS, but theoretically it should work on any Java function.

Create a new syntax (there can be many syntaxs) that uses the new Java reflect parts.
Example: +( *(3 4 5) java.lang.Math.abs(+(-20 14)) 7 8.999 ).

Remove 4 deprecated functions in file

These functions have dependencies to the rest of the program. Keyword() has strongest dependencies. It is not as easy to remove them as it appears, but they must be removed...

/** rename to setPrevD. Move to DefaultCS with at most PROTECTED access (not public).
@see #prevD()
public abstract void setPrevExec(double d);

/** replace with L(Object.class)
@see #L(Object)
public Object getObject(){ return L(Object.class); }

/** Returns the main object of a CS. Example: TreeOfCodeGUI.getObject() returns a JTree.
Replace with setL(setTo)
public boolean setObject(Object setTo){ return setL(setTo); }

/** Returns the keyword of this CS or (after more code is finished) returns parent().name();

Keyword() needs to be removed.
Keyword() can only be removed from when the primary way
to instantiate the default CS types is by using newInstance() on
one of the CSs in a list of default CSs.
When you instantiate with parent().newInstance(), keyword() can be replaced by parent().name().

keyword() appears in the code approximately 400 times. Be careful when refactoring it out.

There is intentionally no setKeyword(String) in this interface. Dont add it.
@see #parent()
@see #newInstance()
@see #name()
public abstract String keyword();

Use CodeSimian's string-literals to execute commands in other languages. The first languages I want added are PERL, LISP, SMALLTALK, and of course JAVA (BeanShell does that), but feel free to add whatever you want. It should be more than a trivial language-wrap if possible. Languages like LISP could be mapped object-to-object to CodeSimian objects and used interchangably.

Normally CodeSimian would use the java.awt.Robot class to access the screen, mouse, and keyboard, but if that class is removed from Java (for security reasons?) or stops working, I want backups! Find alternative ways to access them, platform dependent if necessary, but preferably through Java3D etc.

Privacy Policy