11

Some languages, like Python, Lua, and Tcl are designed with the intention that you can easily embed the interpreter into some other native program. For example, many VFX applications like Nuke, Maya, and Houdini have an embedded Python script editor that executes the Python scripts in-process so that they can manipulate the host application. Lua is popular as a language embedded in some games.

What was the first such scripting language that was specifically intended to be hosted inside of some other large host process, rather than just being invoked externally by shelling out the way you might execute a typical Bash or Perl script?


Later edit: LISP was mentioned in the comments, but not specifically as an answer. I have accepted the Forth Language as the answer because it is a really interesting language that wound up in all sorts of interesting places, was quite early, and met all the requirements of what I was looking for. That said, it seems LISP definitely at least deserves the "honorable mention" that it got in the comments, and pre-dates Forth quite a bit.


Later, later edit: Be careful answering the question! It is about a language embedded in another program, not a language for embedded systems.

15
  • 2
    Tough to answer this without adding some qualifiers, since any script interpreter can trivially be built as a library callable from some other native/compiled language. I think Python was the first to do it WELL, since it has an API that also supports native extensions WHILE embedding it.
    – Brian H
    Nov 3, 2018 at 22:57
  • 3
    An often overlooked one is Microsofts VBA (as well as VBS) developed in the early 1990s.
    – Raffzahn
    Nov 4, 2018 at 0:09
  • 1
    Excel's formulas are a kind of embedded "language", but I doubt that's the kind of answer you are looking for. If you revise your question, consider that.
    – DrSheldon
    Nov 4, 2018 at 2:39
  • 7
    An honourable mention should be made for a variety of LISPs that were used for scripting purposes in many applications, e.g. Emacs and AutoCAD. While the original language wasn't designed for embedding specifically (the concept didn't really exist when LISP was designed!), it is particularly well adapted for it because of how simple it is to implement (cf Greenspun's 10th Rule). LISPs have continued to be used successfully even after purpose-designed alternatives became available (e.g. GIMP, which is scripted using a variant of Scheme).
    – Jules
    Nov 4, 2018 at 3:00
  • 4
    Can you clarify what it is specifically that you are looking for? In the beginning, you ask about languages, but the properties you list are mostly about language implementations, which is a completely different thing. For example, the Ruby language wasn't designed with embedding in mind, but the MRuby, Rubinius, JRuby, and IronRuby implementation were specifically designed with embedding in mind. So, are you asking about languages (and what are the properties of a language that you consider important for embedding) or implementations? Nov 4, 2018 at 9:46

6 Answers 6

23

Probably Forth. Forth was initally a stack of Fortran punch cards Chuck Moore would carry around with him in the late 60s to simplify his programming jobs, which eventually evolved into it's own language (or a native implementation). However a Forth is so simple it can be implemented in practically any language, and so powerful it is worth doing. The popularity is currently at what I would assume to be an all-time low, but it's picking up again. In the 70s and 80s you could get a Forth for pretty much any system and embed one in any application.

2
  • 3
    OpenFirmware machines provide a Forth shell; as a result you could technically program Forth on a Mac without installing an OS as recently as 2006.
    – Tommy
    Mar 20, 2019 at 13:57
  • Forth on Fortran cards was an embedded scripting language, which was the nature of the question. But shortly after that, Forth became an embedded hardware language for bringing up new chips, creating an assembler, testing new hardware, and another one of the earliest uses for Forth, controlling radio-telescopes while signal processing for them. And years ago, I created my own Forth subset mini-scripting language in C#. It's faster than edit-and-continue! Jul 19, 2021 at 2:04
14

REXX is a scripting language designed in the late 70s/early 80s, and which has frequently been used in embedded applications. Its design goals are very similar to TCL and Python's -- to provide an easily extensible language that can be used to integrate functions provided by a variety of third-party software easily. That it is also easy to embed in that third-party software is essentially a by-product of that decision (as it is in Python's case too, although TCL did specifically intend that outcome in its design).

REXX's most popular incarnation was almost certainly ARexx, the standard scripting language of the Amiga OS, and which was first released the year before work began on TCL.

3
  • 1
    One reason ARexx was so beloved on the Amiga was that it perfectly augmented the pre-existing interprocess communication (IPC) provided by Amiga's Exec ("multitasking executive"). Many programs had already built in access to the IPC, and with ARexx added, different programs could easily be set to work together in ways their authors had not imagined.
    – RichF
    Nov 4, 2018 at 5:58
  • 1
    This doesn't seem technically correct. The question didn't ask about "embedded applications". Rather, embedding the scripting interpreter within an application. AFAIK, Rexx is designed as a macro language that can script compatible apps, but Rexx is not embedded in those apps. Tcl and Python are designed to be embedded in apps.
    – Brian H
    Nov 4, 2018 at 13:42
  • Yes, we should be talking about "app program on the outside". For cases where a language is designed to allow orchestration of a single program (script runs program) then I'd nominate the command language for GEORGE 3 (ICL 1900 series machines, late 1960s) where a running program could interact with the script running it (a "macro") in quite complicated ways. Nov 4, 2018 at 16:08
10

TCL was invented in the late 1980s explicitly as an embedded command language. Its author, John Ousterhout, claims embeddability as a 'unique aspect' (at the time).

http://www.tcl.tk/about/history.html

2
  • 4
    TCL was my first thought, too. Even after Python and Lua became available in the early-mid 90s, TCL was often the go-to language for applications that needed an embedded scripting language. For example, a lot of the big commercial electronic design application suites are scripted with TCL (e.g. Altera Quartus or Xilinx ISE).
    – Jules
    Nov 4, 2018 at 2:48
  • Even if TCL may (or may not) be the first, it is at least the most obvious and most directly targetted at being embedded.
    – tofro
    Jul 20, 2021 at 10:18
-1

Ada ? AS a language intended to be used for implementing embedded software in hardware systems. Not specifically in its more IT oriented functions (ie replacement for COBOL and PL/I)

1
  • Ok i missread the question, i was thinking about computer languages especially supporting usage in embedded systems. Jul 23, 2021 at 8:40
-2

I misread the question, so this is answering something different -- unless you consider that every language is embedded in machine language (aka the Instruction Set Architecture) of the particular processor.

..............

Any programming language from the 50's, 60's, or even 70's was, by today's standards, an embedded language for a tiny computer.

From my experience, although there are several other answers, I would propose Fortran.

One of my first computers was an IBM 360/30E, with a hard drive and tapes. The IBM System 360 was ubiquitous for business applications. The 360 model 30 was an 8-bit implementation of the instruction set. The E suffix indicated that it was equipped with a central memory store of 32,786 bytes. It ran IBM's DOS (Disk Operating System). I programmed it in Fortran 4.

I've seen an IBM model 1130 used for real-time control a gas chromatograph/mass spectrometer. By most standards, it was an embedded computer. Probably programmed in assembly language and Fortran.

I used a Data General Eclipse S-130 to monitor a plastics injection molding factory. There was a distributed dry-contact switch matrix that was probed and sampled by the S-130. It updated color screens throughout the factory. It was mostly programmed in Fortran, with a bit of assembly code for time-critical device drivers.

6
  • Unless I totally misunderstand either your answer or the original question (and the other answers), I think we're talking about two very different meanings of embedded. You are referring to what "embedded computers", which is what has been morphing into "the internet of things" (when networked). As I understand the original question and the other answers, they are referring to embedding one language inside another: Forth inside Fortran, Mar 20, 2019 at 19:18
  • 1
    I think you are correct. I misread the question. So it might mean Planner embedded inside Lisp?
    – cmm
    Mar 20, 2019 at 19:41
  • Yes one language inside another Mar 20, 2019 at 19:45
  • In the sense of TCL, it's not a language inside a language; it's a language inside a program. The idea is that you're writing a program to do "something", and as well as the something-specific commands, you'd like a programmable framework; and that is what TCL is for. The same sort of thing applies to mock-LISP in the emacs editor, for example. Mar 20, 2019 at 22:04
  • So, TECO is an example. A program, TECO, implementing a text processing language, TECO script in Q registers. And, before the great re-write, EMACS was a second-order example, being written in the TECO scriot language.
    – cmm
    Mar 21, 2019 at 0:12
-4

Not the earliest, but the Intel 8052AH (1985 or 1986, sources vary) was a micro-controller that embedded MCS BASIC-52 interpreter in ROM. It predated the BASIC STAMP's PBASIC by several years.

5
  • 2
    I'm not a downvoter, but the question is about one language inside another, not a language in an embedded system.
    – DrSheldon
    Jul 20, 2021 at 12:20
  • Fair enough; no skin off my nose. "embedded" has many definitions. I guess that since you could call the MCS-BASIC 52 interpreter inside 8051 code, it's slightly embedded too in the OP's sense.
    – scruss
    Jul 21, 2021 at 17:03
  • How is this any evidence that BASIC was designed to be embedded?
    – Leo B.
    Jul 23, 2021 at 8:16
  • @LeoB. — not BASIC as a whole, this particular implementation
    – scruss
    Jul 24, 2021 at 6:12
  • @scruss Jupiter Ace with Forth in ROM predates that.
    – Leo B.
    Jul 25, 2021 at 4:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .