"Energy is the hardware of the universe. Software is the information" (Ervin Laszlo).
The Union of Hardware and Software
It is logical to wonder about the possibility of the unification of hardware and software and about the nature of that union.
To say hardware, as the name implies, is to say rigidity. And to say software is to say flexibility. In fact software was invented to make a hardware design more flexible. In the early days of computers, changing a program meant changing the machine's circuitry connections. The great evolutionary leap was the idea of storing the program code in memory, along with the data. This had several advantages:
The possibility of performing different processes with the same hardware, without the need to change circuit connections.
The possibility to modify the program code during execution.
The possibility of creating meta-programs, i.e. programs that generate programs.
Hardware has evolved to support certain aspects of programming, such as modularization, structured programming, multiprocessing, virtual memory, etc.
It is obvious that software dependence on hardware should be as low as possible, because the less dependence on hardware, the greater the flexibility. In addition, there has always been the issue of the design of the ideal processor and the ideal language, as well as the form of interaction between the two.
To make a processor flexible, programmable microcode, a code based on very low-level instructions (microinstructions), has been used. This technology has now completely disappeared because advanced tools are available to design complex control units that have significantly higher performance than any microprogrammed unit.
The source code - machine code duality
In conventional systems, the computer hardware cannot directly execute the user's source program. A compiler or interpreter is needed to transform the source program into object code, the binary code or machine code executable by the hardware. The problems with this process are: 1) its computational cost (processing time and machine resources); 2) inefficiency, because the object code is usually not optimal or is poorly suited; 3) the generation of compilation errors, because compilers are difficult to develop; 4) error messages during execution are usually cryptic because they are expressed in the low-level language of the machine, and not in the high-level language of the user.
Binary compatibility has been a problem since the beginning of programming languages, because binary code binds software to particular hardware. To reduce or eliminate this problem, basically two solutions have been proposed:
The development of "virtual machines", intermediary machines between the real hardware and the program to be executed.
The development of processors oriented to a given language, in order to optimize performance by having a homogeneous interface between software and hardware.
Virtual machines
Virtual machines use an abstract instruction set, not belonging to any specific machine. A compiler generates abstract code in that abstract language and the virtual machine interprets and executes that abstract code. The advantage of abstract code is its portability: the same code can be executed by different platforms. Abstract code is very compact, so performance is higher. To make such object code possible, it is necessary to develop a virtual machine on each hardware platform. The virtual machine can be used as a complete operating system or run under another operating system.
There are two abstract code formats for virtual machine: bytecode and code.
The bytecode is a binary file containing an executable program, similar to an object module. Its name comes from the fact that each operation code occupies one byte. The bytecode files are interpreted by a virtual machine. A virtual machine is an interpreter of bytecode. The "Just in Time" compilers translate bytecode into machine code by executing one instruction at a time.
The p-code (portable code or psedo-code) is similar to bytecode, but the operation codes can consist of more than one byte.
Java and Smalltalk use bytecode. UCSD Pascal uses p-code.
A Java virtual machine is a virtual machine capable of interpreting and executing instructions expressed in the bytecode Java, the binary code generated by the Java language compiler. The Java virtual machine acts as an intermediary between the hardware and the bytecode. There are different Java virtual machines for different hardware architectures.
The Smalltalk virtual machine −the first object-oriented language− is a virtual machine that allows a Smalltalk image (file bytecode) to run under a platform. The name "image" refers to the fact that an image of the machine's internal memory is written to external memory (disk). Smalltalk objects "survive" after the execution is finished.
UCSD Pascal is a programming language that runs on top of the UCSD p-System, a machine-independent operating system, which was once described as a "universal operating system". UCSD Pascal had a major influence on the Smalltalk virtual machine and the design of the Java virtual machine.
UCSD's p-System virtual machine is called "p-machine" (or psedo-machine), with its own instruction set called p-code (or pseudo-code). Each hardware platform only needs one p-code interpreter to port the entire p-System and all its tools.
Programming language oriented processors
The advantages of the unification between hardware and software by means of a programming language-oriented processor are:
Elimination of interpreter, compiler or virtual machine. An intermediary system would no longer be necessary. There would be direct, homogeneous and coherent communication between hardware and software. The virtual machine would be the same as the real one.
Elimination of the semantic gap between both technologies by operating with a single paradigm.
Elimination of the distinction between source language and object language. They would be the same.
Improved machine performance.
Seamless portability of applications from one system to another.
The Evolution of Processors
Processors have evolved throughout the history of computing. From complex, rigid and restrictive processors, to simplified processors, to minimalist processors, always in the direction of greater simplicity, flexibility and efficiency. The evolution has been as follows:
CISC (Complex Instruction Set Computer)
They were the first processors. Their name was given by the supporters of smaller and simpler processors (RISC). CISC processors implement a very large set of complex instructions, with operands located in memory or in internal registers of the machine.
In the early days of computers, compiler technology did not exist. Programming had to be done in assembly language. To facilitate the programmer's task, complex instructions were created, which were like the functions of high-level programming languages. This led to increasingly complex and sophisticated processors. When compilers appeared, in which a high-level instruction could be implemented in several elementary instructions, it was no longer necessary to do this, so hardware could be simplified.
RISC (Reduced Instruction Set Computer)
RISC processors were created to improve the performance of CISC processors. To this end, the design was simplified:
Fewer and simpler instructions.
Fixed-size instructions and reduced number of formats.
No microcode required.
The operations are simple enough to be executed in a single cycle, so they are more efficient.
Memory accesses are reduced by using many general-purpose registers (because operations with them are faster), with two specialized instructions for register-to-memory transfer (load and store), and with large cache memory.
Addressing is homogeneous and simple in all instructions, both to registers and memory.
Parallelism is enabled, both in instruction and program execution.
No data types are supported. Therefore, specialized instructions are not needed for each data type.
Today, the vast majority of processors are RISC.
MISC (Minimal Instruction Set Computer)
It is a processor with a very small number of instructions. It is stack-based, rather than register-based to reduce the size of the operands, as all instructions take operands from the top of the stack. Typically, a MISC consists of 32 instructions at most.
The advantages are that the decoding unit (code interpretation) is simpler and faster, and the instructions are more efficient.
OISC (One Instruction Set Computer)
A theoretical (or abstract) machine that has only one instruction but a larger number of operands. The instruction chosen is usually of the type "Subtract and branch if condition". The condition is usually "less than or equal to zero", "negative" or "non-zero". If the condition is not met, execution proceeds to the next instruction. Examples:
Subleca, b, c (subtract the contents of address a from the contents of address b and branch to address c if b is less than or equal to zero; c is optional)
Sbnza, b, c, d (subtract the contents of address a from the contents of address < i>b and stores the result in c, and if the result in c is not zero transfers control to address d).
Features:
It is oriented to arithmetic calculations.
Assumes that an integer is stored in each memory location.
It is a universal (Turing complete) computer, that is, it can perform the same processes as a Turing machine, such as a CISC, RISC or MISC processor.
The instructions themselves are stored in memory as a sequence of integers, since no operation code is needed, as there is only one.
All other instructions are derived (synthesized) from the one existing instruction.
Examples of instructions derived from Sbnz:
Branching unconditionally to d.
Jumpd ⇒ Sbnzz, z, z, d (z is a position containing zero).
Add a and b and store the result in c.
Adda, b ⇒ Sbnzz, a, < i>d, zSbnzd, b, c, z
Move (copy) a to b.
Mova, b ⇒ Sbnzz, a, b
Branch to d if c is nonzero.
Beqd, c ⇒ Sbnzz, a, c, d
VLIW (Very Long Instruction Word)
It is a processor architecture designed to take advantage of instruction-level parallelism. It is the compiler's job to control instruction scheduling and data protection.
NISC (No Instruction Set Computer)
NISC processors are the successor to the VLIW. It is a highly efficient processor architecture that allows a compiler to have low-level control of hardware resources. It has horizontal control (the sequence of instructions) and vertical control (the parallelism of instructions). The architecture is much simpler (no need to decode instructions), more flexible and efficient.
ZISC (Zero Instruction Set Computer)
It is a processor without instructions. It incorporates instead a pattern recognition oriented technology (pattern matching), so it has no instructions in the classical sense. It is based on the ideas of artificial neural networks and massively parallel processing.
The first generation of a ZISC chip contained 36 independent cells, where each cell can be thought of as an artificial neuron or parallel processor. Each cell can compare an input vector of up to 64 bytes with another vector in memory. If the input vector matches the vector in memory, the cells emit an output signal containing the number of the cell that has recognized the vector or a non-recognition signal.
The power of a ZISC lies in scalability. A ZISC network can be expanded by adding more ZISC processors without decreasing its recognition speed. And there is no theoretical limitation on the number of cells that can be in a network.
ZISC chips can also be used for fuzzy recognition. Instead of exact recognition, the closest recognition can be obtained. Cells above a certain threshold are triggered simultaneously and the ZISC controller locates the cell that returns the closest value.
Programming Language Oriented Processors
There is a history of hardware implementation of a programming language. The most prominent are the following:
Rekursiv
Rekursiv was an object-oriented microprocessor developed by David M. Harland (of Glasgow University) in the mid 1980's for Linn Smart (Glasgow) to control their Hi-Fi manufacturing system. The main motivation was to improve the performance of Lingo, an object-oriented language (derived from Smalltalk and Algol), also developed by the same company, which was not satisfactory with the hardware of its time (Digital Vax). At that time, the object paradigm was not yet well known, so it had quite a lot of merit to embark on that adventure.
The processor instruction set supported recursion (hence the name).
The processor instruction set was microcode programmable to further improve application performance.
The processor was not a single microprocessor, but a motherboard with 4 chips running in parallel: Numerik (arithmetic-logic unit), Logik (instruction sequencer), Objekt (object manager) and Klock (clock). The CPU consisted of Numerik and Logik.
It used virtual memory as a persistent object store.
Each object was assigned an identifier when it was created. Data and instructions were stored in the object's memory. The data could be identifiers of other objects. Within the object identifier was included the identification of the processor that had created the object. There were also compact objects (such as numbers, character strings, etc.) that included their own identifier.
The processor automatically performed "garbage collection" (removal of unused objects from memory).
It did not implement security.
It did not include all the object-oriented features. For example, it did not support inheritance.
It ran Lingo fast enough, with a perfect match between language and CPU. It could also run mainstream languages such as Smalltalk and C.
The processor was truly innovative and was surprisingly easy to implement. The project was eventually abandoned because Linn did not have sufficient resources to pursue this promising architecture. But it demonstrated the feasibility of building high-level hardware abstraction processors to bring them closer to object-oriented languages.
Forth processors
Forth is a simple and efficient language, developed by Chuck Moore and Elisabeth Rather between 1965 and 1970, for real-time astronomical applications, but which evolved into a general programming language and programming environment. It is now used primarily for programming embedded systems (small computerized devices) and boot loaders.
It is procedural, imperative, structured and recursive. It has no data types.
It manipulates data through a stack, which are LIFO lists (Last In First Out), instead of traditional registers. Expressions in reverse Polish notation (postfix notation) are stored on the stack. For example, (a+b)×c is stored on the stack as ab+c×.
Allows interactive execution of commands and procedures.
Is modular and extensible. It uses a dictionary of words, which can be extended. The interpreter is part of the word dictionary.
The programs run in a simple virtual machine that makes the programs independent of the CPU (only this virtual machine needs to be developed on each type of machine). There are Forth systems that run under known operating systems (Windows, Linux, etc.) using a virtual machine that is easy to develop.
No operating system or file system required. It is multitasking.
It has no explicit differentiated grammar. Everything has the same structure.
Forth processors use Forth as a machine language. Stack processors (stack computers) are inspired by the Forth language. The advantages of these processors are:
They are less complex than CISC and RISC processors.
More compact programs.
The performance is higher.
The stack stores the return addresses in the call to subroutines and the passing of parameters to subroutines.
There is dynamic memory allocation.
Uniformity of interface between hardware and software levels.
Support different languages.
Compilers are easier to develop.
Allows a wide variety of applications, especially embedded real-time control systems.
Forth and stack processors have been less widely used than traditional register machines.
Lisp processors
A Lisp processor (or Lisp machine) is a general-purpose, high-abstraction-level processor designed to efficiently execute Lisp code. Lisp is a functional-type artificial intelligence language and one of the most widely used because of its extraordinary flexibility. The Lisp machine was oriented to the development and execution of artificial intelligence applications.
The operating system was written in Lisp. Being single-user, it was relatively simple.
It used virtual memory and a garbage collector: removing memory from unreachable Lisp objects.
In Lisp, code and data have the same structure (the list) and both are stored in memory. Variables are typed at runtime (dynamic types).
Lisp machines were the first single-user-oriented workstations. Many common technologies today, such as graphical user interfaces and the use of the mouse, were originally developed on Lisp machines.
With the advent of personal computers, Lisp machines virtually disappeared. Only two have survived: Symbolics and Macrosyma.
Java processors
Sun introduced Java Virtual Machine (JVM), a software layer on top of a hardware platform for developing and running Java programs.
There have been several attempts to build a processor that would directly interpret bytecode Java as its machine language, but all attempts in this direction were unsuccessful. Perhaps the failure was due to the complexity of Java. A processor should be as simple as possible.
The Hardware-Software Union in MENTAL
With MENTAL all dualities are united at the conceptual level. The last duality to overcome is the implementer issue: to unite hardware and software. Let hardware and software speak the same language: let the set of universal semantic primitives also be the hardware instruction set.
Just as with universal semantic primitives we have reached the conceptual roots of programming, we must reflect that same essence in hardware to achieve maximum homogeneity, consistency and efficiency.
It would be the "ideal" hardware, as MENTAL is the ideal language. The "instruction set" of a universal (or general purpose) computer (or abstract machine), a machine more general than the Turing machine, since it is operational and descriptive.
If this were possible we would have many advantages:
Abstract code.
Neither bytecode nor p-code would be needed. The abstract code would be that of MENTAL. Source code and object code would be the same.
Direct execution.
No language interpreter, compiler or virtual machine would be needed. If the processor were not of MENTAL type, then to execute MENTAL code on another platform an interpreter, compiler or virtual machine would have to be developed.
Artificial mind.
It would suppose the maximum possible artificial intelligence. It would unify machine and mind by means of the 12 degrees of freedom that represent the universal semantic primitives or primary archetypes. We would approach the ideal of the artificial mind, although only in simulation mode. We use here the term "artificial mind", rather than the usual term (artificial intelligence), since intelligence is only one aspect of the mind, although it is the most important one.
Semantic type processor.
The processor would be of semantic type. Semantic processing" or "semantic analysis" (semantic parser) refers to the extraction, representation and use of semantics (knowledge or meaning) from a text written in natural language or in an artificial language (usually the source code of a computer language).
The processor would not really be semantic because the machine "doesn't know" what it is doing (at the semantic level), but it would be able to operate at the syntactic-operational level.
The processor would have a triple dimension: computational (processor of the maximum possible abstraction), archetypal (because the primitives are archetypes of consciousness) and philosophical (philosophical computer, because the primitives are also philosophical categories).
Universality.
All programming languages that do not have implementer references could be executed, since they all derive from MENTAL, which is the mother language. It would also be the foundation of every operating system.
Energy and information.
If we associate hardware with the fixed and software with the flexible, we can consider that the fixed is constituted by the universal semantic primitives and that we can associate with energy. And the flexible are the manifestations of the primitives, which we can associate with information.
Addenda
MENTAL vs. Forth
There are numerous overlaps between Forth and MENTAL in the following respects:
They are simple languages and the developments are simplified.
The code is compact.
They do not have data types.
They are extensible.
Allows interactive execution of commands and procedures.
They do not require a file system.
They are multitasking.
They do not have an explicit grammar.
Bibliography
Álvarez Gutiérrez, Darío. Sistemas integrales orientados a objetos. Disponible en Internet.
Buttazo, G. Can a Machine Ever Become Self-Aware? Artificial Humans. Goethe Institute, Los Angeles, 2000, pp. 45-49.
Dettmer, R. The Rekursiv computer. IEEE Review, vol. 34, issue 1, Jan. 1988, pp. 17-19.
Pountain, Dick. Rekursiv: An Object-Oriented CPU. Byte, Nov. 1988.
Gilreath, William F.; Laplante, Philip A. Computer Architecture. A Minimalist Perspective. Springer, 2003.
Harland, David M.; Gunn, Hammish I.; Pringle, Ian A.; Beloff, Bruno. The Rekursiv. An Arghitecture for Artificial Intelligence. Proceedings of AI / Europa Conference, Wiesbaden, Alemania, September 1986.
Harland, David M.; Beloff, Bruno. Microcoding an Object-Oriented Instruction Set. ACM SIGARCH Computer Architecture News (Association for Computing Machinery) 14 (5): 3, December 1986.
Harland, David M.; Beloff, Bruno. Objekt: A Persistent Object Store with an Integrated Garbage Collector. ACM SIGPLAN Notices (Association for Computing Machinery) 22 (4): 70, April 1987.
Harland, David M. Rekursiv: Object-Oriented Computer Architecture (Ellis Horwood Series in Computers and Their Applications). Ellis Horwood Ltd, August 1986.
Koopman, Philip J. (Jr.). Stack Computers. The New Wave. 1989. Disponible en Internet. (Menciona Rekursiv en el Apéndice A).
Liebman, Sheldon. From CISC to RISC to ZISC. Advanced Imaging, Sept. 1998. Disponible en Internet.
The CPU Shack: Weird and Innovative Chips. Internet.
Williams, Al. The One Instruction Wander. Dr. Dobb´s, Nov. 16, 2009. Disponible en Internet.