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.

DrSheldon
  • 15,979
  • 5
  • 49
  • 113
wrosecrans
  • 2,264
  • 12
  • 20
  • 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 03 '18 at 22:57
  • 3
    An often overlooked one is Microsofts VBA (as well as VBS) developed in the early 1990s. – Raffzahn Nov 04 '18 at 00: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 04 '18 at 02:39
  • @Raffzahn - of course, we definitely shouldn't overlook it here ... VBA was designed by Joel Spolsky, cofounder of Stack Exchange. – Jules Nov 04 '18 at 02:53
  • 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 04 '18 at 03:00
  • Many of the single board computers I used in the early 80s had various dialects of BASIC embedded in the code. It wasn't designed as an embedded language though - just something simple that anyone could pick up.. – cup Nov 04 '18 at 07:37
  • 1
    Isn't the original sh in some way an interpreted scripting language into C? – tofro Nov 04 '18 at 09:20
  • 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? – Jörg W Mittag Nov 04 '18 at 09:46
  • Another issue here is that many mainframe systems has (shell) languages that could be used from within programs - with a rather blury border, as theri OSes didn't follow the stacked model of Unix seting todays norm. REXX not being the least of them. Without many additinal clarifications this question may be way to broad to be answered conclusive. – Raffzahn Nov 04 '18 at 10:18
  • The OP should say what he means, of course, but my own criterion for an "embeddable" language (or implementation) would be that there are specific features that allow the command-set to be extended to provide interoperation with the objects of the program in which it is embedded. – dave Nov 04 '18 at 16:02
  • 1
    @DrSheldon If Excel formulae count as an answer to this question, then so should VisiCalc ones. I seem to recall some official reference to VisiCalc spreadsheets even being "programs", but I can't seem to readily find that now. – user Nov 04 '18 at 18:11
  • @αCVn: Yep. The point of my comment was to help the OP improve the question, not to give an answer. – DrSheldon Nov 04 '18 at 18:14
  • One highly technical term for this is "little languages". –  Nov 08 '18 at 16:40
  • Forth as a language for writing prom code in devices ? – Stefan Skoglund Jul 22 '21 at 19:49
  • Another early example is the FCL scripting language built into the FreeScape 3D engine, used on early 80s games for 8-bit and 16-bit home computers. https://en.wikipedia.org/wiki/Freescape – Alan B Jul 23 '21 at 13:21

6 Answers6

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.

dch
  • 346
  • 1
  • 3
  • 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 '19 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! – MicroservicesOnDDD Jul 19 '21 at 02: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.

Jules
  • 12,898
  • 2
  • 42
  • 65
  • 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 04 '18 at 05: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 04 '18 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. – dave Nov 04 '18 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

dave
  • 35,301
  • 3
  • 80
  • 160
  • 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 04 '18 at 02: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 '21 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)

Stefan Skoglund
  • 387
  • 1
  • 6
-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.

cmm
  • 747
  • 6
  • 10
  • 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, – manassehkatz-Moving 2 Codidact Mar 20 '19 at 19:18
  • 1
    I think you are correct. I misread the question. So it might mean Planner embedded inside Lisp? – cmm Mar 20 '19 at 19:41
  • Yes one language inside another – manassehkatz-Moving 2 Codidact Mar 20 '19 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. – dave Mar 20 '19 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 '19 at 00:12
  • I don't see that. TECO is just an editor, though a highly programmable one. It was not designed (per the original question) to be embedded in other programs. Rather, it turned out to be possible to use it as a language to write other programs in; but that does not make it "embedded" IMO; the TECO part is not particularly a feature of the final program. – dave Mar 21 '19 at 01:18
-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.

scruss
  • 21,585
  • 1
  • 45
  • 113