1
\$\begingroup\$

I got a question popping directly from reading Tanenbaum's Structured Computer Organization. Stating from Chap. 1 Sec. 1.1 :

A machine with C++ or COBOL as its machine language would be complex indeed, but could easily been built in today's technology.

And let's assume this strictly means that the language is actually the machine language. Now, I understand it would be pointless to build such a thing, but I wonder if someone ever tried. At least as a soft-core.

Does something like this actually exists? This book is from 1998 so I guest today would be even "easier".

I'm asking this for pure curiosity.

\$\endgroup\$
10
  • 1
    \$\begingroup\$ I'm sure it could be easily built, but how about the design... \$\endgroup\$
    – user20574
    Commented Mar 5, 2020 at 18:35
  • 1
    \$\begingroup\$ The end product is pretty much a conventional CPU plus a JIT software runtime, a QEMU kind of thing. \$\endgroup\$ Commented Mar 5, 2020 at 18:42
  • 5
    \$\begingroup\$ It may be possible, but why? What happens when you want to run some other language? Java? Does that have to be JIT'ed to C++? That's a lot more complex! ASM is called "low level" for a good reason, languages are (relatively) easy to reduce to that common denominator. \$\endgroup\$
    – Ron Beyer
    Commented Mar 5, 2020 at 18:50
  • 2
    \$\begingroup\$ There is no value in trying even as an academic exercise, cant imagine why someone would bother. \$\endgroup\$
    – old_timer
    Commented Mar 5, 2020 at 19:10
  • 2
    \$\begingroup\$ I'm voting to close this question as off-topic because it's not about electronic design. It is asking about a product which may, or may not, have been designed as an academic exercise but makes no sense as a commercial product. \$\endgroup\$ Commented Mar 6, 2020 at 13:53

5 Answers 5

8
\$\begingroup\$

In a way, depending on whether you consider Forth to be a high-level language. There have been chips that can execute Forth directly.

Here's one reference that mentions the Harris RTX2000, as well as a Verilog implementation for an FPGA.

Here's an extensive list of them: Forth chips, including the Novix NC4000 by Chuck Moore himself.

As anyone who has implemented Forth knows, you start by defining a set of "primitive" operations from which all other operations can be built. On an ordinary processor, those primitives are implemented in the machine code of the CPU. On a Forth chip, they are implemented directly in the hardware. All other functionality, including the text interpreter/compiler, is built using those primitives. That's about as close as any chip gets to "executing HLL directly".

There are also Java bytecode chips, which don't actually execute a high level language directly, but rather an intermediate representation.

\$\endgroup\$
6
  • \$\begingroup\$ I think forth can be considered as high-level language \$\endgroup\$
    – user201301
    Commented Mar 5, 2020 at 19:50
  • \$\begingroup\$ Forth is high-level with respect to it's incomprehensibility moments after it's written. I was looking back at some code I wrote in ASYST years ago,-- ROLL DUP ROLL ROLL SWAP + ;-) \$\endgroup\$ Commented Mar 5, 2020 at 21:01
  • 4
    \$\begingroup\$ @ScottSeidman "write-only" language \$\endgroup\$
    – Grabul
    Commented Mar 5, 2020 at 21:03
  • \$\begingroup\$ I used Forth in the early '80s on a Cambrian HDD disk analyzer, the command line execution was cool but the compiler syntax errors were frustrating. Go Forth and Prosper A high level language without For statements \$\endgroup\$
    – D.A.S.
    Commented Mar 6, 2020 at 3:42
  • \$\begingroup\$ I downvoted this because these do not have Forth as a machine language. They have a machine language which is designed to be convenient for Forth compilers, but the machine language is not Forth. If these count as "Forth as machine language" then x86 has Pascal as a machine language. \$\endgroup\$
    – user20574
    Commented Mar 6, 2020 at 14:30
2
\$\begingroup\$

Certainly have been ... not always for a low level language like C.

Forth is on the lower level end of the spectrum, with the Harris and Novix CPUs mentioned by Dave Tweed.

Lots of LISP machines (Symbolics and others), allegedly there was a Japanese project to build a Prolog machine.

Java of course targets the JVM (a virtual machine) but there were attempts to create a CPU whose physical instruction set was the JVM.

And there was the Linn Rekursiv, which supported object oriented languages (full OO, not C++ but much more Python-like, where even an integer is an object) directly at the instruction set level. Disclaimer : I was involved with this project.

\$\endgroup\$
2
  • \$\begingroup\$ I think LISP machines (which I was not aware of) are the closest thing! I'm a student in EE, not comfortable when talking about language semantics or compilers, but fascinated about computer history. Rekursiv sounds such a crazy project to work on, i can' imagine the effort. \$\endgroup\$
    – a_bet
    Commented Mar 6, 2020 at 18:31
  • \$\begingroup\$ It was a crazy project. In contrast to other CPUs, where accessing virtual memory could abort an instruction, call a page handler to swap the data in from disk, then restart the instruction (wiping out anything the instruction had done) ... the Rekursiv would suspend the instruction, swap data in, and return to precisely where it left off. This ability came from recursive microcode... hence its name. Garbage collection too, could be handled transparently within an instruction (increasing that instruction's execution time of course) \$\endgroup\$
    – user16324
    Commented Mar 6, 2020 at 18:40
1
\$\begingroup\$

The Burroughs B1700 came pretty close to directly interpreting the SDL language.

\$\endgroup\$
1
  • \$\begingroup\$ Did it directly interpret the SDL language? \$\endgroup\$
    – user20574
    Commented Mar 9, 2020 at 11:09
0
\$\begingroup\$

By the time this was written the Lisp machine was already a fading memory.

The other answer mentions the ARM Jazelle instruction set. Yes, this was a bytecode system, so it couldn't be run directly from the source program; but that leads to a question as to what using C++ as machine language would actually mean, since it's intended to be compiled.

\$\endgroup\$
-1
\$\begingroup\$

Have you heard of the 8052AH-BASIC. It is a chip directly programmable in BASIC.

Well, it is a standard 8052 CPU with a basic interpreter in ROM, but would it make a difference if the interpreter wasn't coded in 8052 assembly but using some microcode? Some computers had loadable microcode to support different languages such as Smalltalk or LISP.

Implementing all complex operations as "real" hardware, using separate finite state machines and registers and adders would be possible, but it would just be a waste of resources compared to microcode. And microcode is a bit like software, RISC CPUs were born out of the idea that software libraries could replace it.

It remains that C++ is far more complex than BASIC and a compiler or interpreter needs lots of memory, it is designed aroud the idea of loaded modules and separate source files. If C++ as a machine language needs a filesystem or dynamic memory management (malloc...), then a whole computer will be hidden under that machine langage, a bit like JavaScript to WebAssembly.

\$\endgroup\$
5
  • 1
    \$\begingroup\$ To 8052 stuff, yes it would make all the difference - it wasn't the question the OP asked. Downvoting until fixed, I'm afraid. \$\endgroup\$
    – TonyM
    Commented Mar 6, 2020 at 9:55
  • \$\begingroup\$ @TonyM. There is nothing to fix. \$\endgroup\$
    – Grabul
    Commented Mar 6, 2020 at 20:49
  • \$\begingroup\$ Try reading the question again. It's been clarified even further with: "And let's assume this strictly means that the language is actually the machine language." \$\endgroup\$
    – TonyM
    Commented Mar 6, 2020 at 20:54
  • \$\begingroup\$ @TonyM So what? What is actual "Machine Language"? When a MC68881 executes the FSIN instruction (sine), it is microcode. When a 68040 runs the same instruction, it does trap-and emulate to a software library. It isn't actual "machine language" anymore? Another example, some pocket calculators had BASIC as the only programming language (and no PEEK/POKE/CALL), the inaccessible ROM, is it "Microcode" or "software in ROM"? For me, all answers so far are quite bad (including mine). The issue is "semantic gap". FORTH or BASIC can be almost "machine langage", full C++ can't. \$\endgroup\$
    – Grabul
    Commented Mar 6, 2020 at 22:06
  • 1
    \$\begingroup\$ You're rambling freely here whereas the terminology and the OP's question are quite clear. But this is going nowhere so I'll leave you to it. \$\endgroup\$
    – TonyM
    Commented Mar 6, 2020 at 22:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.