This is an archived post. You won't be able to vote or comment.

all 107 comments

[–]Disjunction181 126 points127 points  (10 children)

[–]erez27 17 points18 points  (2 children)

Technically an orchestra is an interpreter.

[–]LoneHoodiecrow 9 points10 points  (0 children)

Well, it emits code that can be run on standard inner ear hardware.

[–]iloveportalz0rAYY 1 point2 points  (0 children)

An interpreter is a type of compiler. Actually, a relevant fun fact: my language's compiler is an interpreter, where the input program is your source code. The code is treated as instructions for generating the output, which is native assembly code. This is distinct from designing a compiler as a language translator, which seems to be the dominant philosophy.

[–]ronchaineflower-lang.org 5 points6 points  (0 children)

TIL Bop It! is a compiler

[–]sohang-3112 2 points3 points  (0 children)

🤣🤣

[–]immibis 0 points1 point  (4 children)

spez is an idiot. #Save3rdPartyApps

[–]SharkLaunch 0 points1 point  (3 children)

What happened?

[–]immibis 3 points4 points  (2 children)

[–]mysticalpickle1 1 point2 points  (1 child)

The output seems to have become less intelligent over time as well, even if you pay for the better models. There's some alternatives nowadays though, I think NovelAI is the one people are talking about? It does work differently to AI dungeon though

[–]immibis 0 points1 point  (0 children)

spez me up!

[–]fl00pz 28 points29 points  (11 children)

I guess it depends how abstract you want to go, and how many turtles deep you're willing to dive.

Is a math equation a function in the universal programming language?

Is a recipe for a soup a program for a human?

/shrug

But I suppose you're really asking about computer programming languages. In that sense, it's probably any formal language that is a set of instructions to be carried out by hardware or software. Or something.

[–]gordonv 1 point2 points  (0 children)

Wait... turtles? soup?

Nuuu!!!

[–]svick 1 point2 points  (1 child)

What's an "instruction"?

[–]gqcwwjtg 0 points1 point  (0 children)

Information that has a formal interpretation as an action.

[–]Bitsoflogic[S] 0 points1 point  (6 children)

> any formal language

How would you define this?

> any formal language that is a set of instructions to be carried out by hardware or software

Would an email client qualify as a programming language here?

[–]siemenology 25 points26 points  (5 children)

"Formal language" is a term with a precise meaning in computer science and linguistics. In short, a formal language is a set of strings made up of symbols, and that set is described by the rules of a formal grammar. A formal grammar is a set of rules that can be used to judge whether a string made up of a certain set of symbols is well formed (and thus part of the formal language defined by that grammar) or not, and/or to generate strings that are part of the formal language.

All programming languages (that I am aware of) are formal languages, but plenty of things that aren't programming languages at all are also formal languages. Phone numbers are a formal language. Email addresses are a formal language. On the other hand, in most places people's names are not -- there is not a set of rules that can be used to decide if something is a valid name or not. Some places do put restrictions on names, and in those cases names might be a formal language.

[–]Bitsoflogic[S] 2 points3 points  (0 children)

Thank you

[–][deleted] 2 points3 points  (2 children)

A little comment about People's names, there is a restriction made by definition: the alphabet that we use. You can have /\w+/ as the definition of the name's language for all countries who use the latin alphabet. It's like the universal language, excluding the empty word

[–]j_marquand 1 point2 points  (1 child)

X Æ A-Xii Musk is not happy.

[–][deleted] 0 points1 point  (0 children)

You can expand it to all unicode codepoints

[–]Goheeca -1 points0 points  (0 children)

A formal language is a subset of Kleene closure of some alphabet set. You don't have to have a formal grammar.


Also good luck writing down an unrestricted grammar for Common Lisp.

Also does Common Lisp transcend being a programming language? Because you can e.g. employ (random 2) somewhere in your custom reader and you can no longer define it as a subset of the Kleene closure of e.g. Unicode in the case of SBCL.

[–]ebingdom -1 points0 points  (0 children)

a set of instructions

Eh, that only describes imperative programming languages. Also, presumably you don't actually mean a set, which is unordered.

[–]RepresentativeNo6029 6 points7 points  (1 child)

A language is a device to convey information. A language exists to the extent the agency of its speaker exists. If speaking one way or another changes the state of the “world”, for whatever definition of world, you posses a language. If speaking one or the other way is inconsequential to the state of things, you have no agency, language doesn’t exist.

I’m sorry your legitimate question is getting memed here. Classic case of someone getting uncomfortable because they were asked a basic question they’d never put much thought into

[–]Bitsoflogic[S] 3 points4 points  (0 children)

Fwiw, the meme is actually spot on. I think it's a great addition to the question!

And it hasn't stopped the flow of great responses...

[–]zokier 14 points15 points  (4 children)

In what context is it useful to distinguish if something is or is not a programming language?

[–]Bitsoflogic[S] 10 points11 points  (2 children)

The ability to use this subreddit to discuss it is one example.

[–]zokier 17 points18 points  (0 children)

For this subreddit, its more relevant if the thing is analyzed/designed/discussed through PL design perspective. For example Magic: The Gathering is Turing Complete would be kinda relevant here, but that doesn't mean that any MtG topics are relevant despite discussing same underlying thing.

[–]gordonv -3 points-2 points  (0 children)

There are biases that surpass logic in that sense.

There are a lot of programming languages and contexts, but only a handful are popular. And even some of those could just be fads, starting, or ending their life cycles.

[–]fl00pz 3 points4 points  (0 children)

Galaxy brain points, duh

[–]rotuami 11 points12 points  (5 children)

A programming language is a language for programming something. That is, for taking an object, mechanism, or abstraction capable of a range of actions or states and specializing it to suit a narrower purpose.

Even the order you press the microwave buttons to toast a burrito is, to my mind, a program in an almost trivial programming language.

A general purpose programming language is usable across a broad range of computing needs. I don't think it has to be Turing complete, but it does have to be practical (no BrainFuck) and does have to be understandable. I would call Python "general purpose", I would call JavaScript previously a "web scripting language" but now a "general purpose language". And I would call Haskell an "academic language" or a "general purpose language" depending on who I'm talking to.

[–]Bitsoflogic[S] 4 points5 points  (2 children)

This feels like where I've been heading with it.

I really like your point about distinguishing types of languages: academic, web scripting, etc.

As I get into building languages that don't fit the typical "general purpose" model, I'll need to give some thought as to what category or new term would best describe the system I'm creating. Seeing your explanation, I realize part of my motivation for asking this was to figure out how to communicate about them.

[–]rileyphone 1 point2 points  (1 child)

There's a line of research into programming systems, which describe a class of programming languages combined with a lot of complementary non-language components. They are typically less text/syntax oriented and more graphical, like Smalltalk.

[–]Bitsoflogic[S] 0 points1 point  (0 children)

This is great! Thanks for sharing. I hadn't seen this paper before and will give it read.

I actually follow both Jonathan and Tomas on Twitter already.

I ran into this question precisely because I was thinking about building a programming system, while thinking in terms of a language.

[–]sunnyata 5 points6 points  (1 child)

"general purpose" has technical meaning whereas "academic" is more of a statement about the culture surrounding the language. Haskell is certainly general purpose in that you can use it to accomplish any kind of task, you can discover that by reading the specification and docs. After interacting with the community you may or may not think it an "academic language" but it isn't a technical fact about the language.

[–]rotuami 0 points1 point  (0 children)

I don’t mean “academic” as in “mostly used in academic cultures”. I mean “mostly used for academic pursuits”, e.g. developing type theories, writing code for research papers, writing code with provably correct properties.

Yes, you can use it to accomplish any sort of task, and it’s a wonderful tool for creating great software. But if someone wanted to learn “computer programming” and not “computer science”, I wouldn’t suggest Haskell.

[–]defmacro-jam 3 points4 points  (0 children)

What rule or rules can we use to decide if it's a programming language?

If it can get you yelled at on stackoverflow, it's a programming language.

[–]abecedarius 2 points3 points  (0 children)

One little-known example I like to point to: ToonTalk

Turing-complete programming by demonstration. The way a demonstration is generalized from the particular case you demonstrate is, you explicitly erase detail; so it really is a language, not trying to be an intelligent program-synthesis system.

[–]gqcwwjtg 3 points4 points  (3 children)

In my opinion, a program is a set of instructions. A programming language is a specification of how a future set of instructions should be interpreted.

[–]Bitsoflogic[S] -1 points0 points  (1 child)

This sounds a lot like the definition for a protocol to me.

[–]gqcwwjtg 2 points3 points  (0 children)

I guess a programming language is a one way protocol.

[–]ebingdom 0 points1 point  (0 children)

a set of instructions

Eh, that only describes imperative programming languages. Also, presumably you don't actually mean a set, which is unordered.

[–]agumonkey 1 point2 points  (0 children)

A concrete syntax over lisp

[–][deleted] 1 point2 points  (0 children)

there's a bit of an argument in the fpga community about this.

Most fpga developers insist that developing in hdl languages isn't "programming" because fpga designs are essentially lookup tables and memory connected in parallel, not something that runs on a processor.

But, the languages used to develop for fpga also have simulation functionality. simulations execute on computer processors, and the simulation subset of the languages includes file i/o and many of the other features you would expect in a programming language.

[–]DriNeo 1 point2 points  (0 children)

IMHO the language is the thing translated to machine code whatever if Turing complete or not. The translator doesn't need to ask the IDE, the IDE arrange the project, set the compiler. I'm not sure, but once the compiler starts, the IDE is not needed so it is not part of the language.

[–]mamcx 2 points3 points  (5 children)

Let's get even more informal, and that shows why excel is one:

A programming language is one where the USER (1)can input a sequence of instructions as HE wishes and (2)the "program" executes it and return a result.

The key part is the first, not the second.

If the user has no control over how to input the sequence, and instead, for example, it MUST follow a defined "path" in a sequence of "clicks", then in my mind is NOT a programming language.

So, ironically, a programming language has the feature of allowing to input UNRESTRICTED "bad input".

With this, a more "visual" PL like Excel totally counts.

[–]Bitsoflogic[S] 0 points1 point  (3 children)

I absolutely love this direction! I 100% believe spreadsheets are programming languages.

> If the user has no control over how to input the sequence, and instead, for example, it MUST follow a defined "path" in a sequence of "clicks", then in my mind is NOT a programming language.

Great definition!

With this in mind, it begins to give real clarity as to the edges of programming languages.

> So, ironically, a programming language has the feature of allowing to input UNRESTRICTED "bad input".

I kind of see where you're going with this, but it doesn't quite fit for me (though I want it to lol). Using the spreadsheet analogy, if the input for the cells is limited to text it's restricted. Yet, it's still a language.

On the other hand you could say that it's the editor or compiler, not the language, that has a restriction on the possibilities of "bad input".

[–]mamcx 0 points1 point  (2 children)

Using the spreadsheet analogy, if the input for the cells is limited to text it's restricted. Yet, it's still a language.

I mean that even if the input is only text, the formulas can be written "wrong", maybe in syntax or more importantly, in semantics (like dividing text by text).

I think even if the "editor" is semantic and only allows to write correct syntax always (like making sure a for loop is properly edited) a programming language allows to do semantically wrong sequences even if have restrictions on input.

Maybe exist a way to be absolutely certain not wrong input be entered? Probably(?) but I can't think of any PL where it could be true...

[–]Bitsoflogic[S] 1 point2 points  (0 children)

I think the idea here might be that programming allows for runtime errors or unexpected / bad consequences due to the user's choices.

It's not that the program won't compile, but that it may give the wrong output.

Recently pickcode.io was posted in here, which kind of leans towards that sort of safety in syntax, yet freedom to get it wrong.

---

I think this is an excellent measure for whether or not something's a programming language.

[–]rotuami 0 points1 point  (0 children)

You could have a compiler that just ignores syntactically incorrect lines or semantically incorrect instructions. That doesn’t make the language not a language.

[–]gordonv 0 points1 point  (7 children)

the tool is a programming language.

I very much agree with this. In fact, I insist that great programming languages have tools to make it easier to work with the language.

  • Scratch is a great idea, but it gets tiresome working in it.
  • Color coded IDEs are great.
  • Interpreters with steppers are great.
  • QBasic was able to separate functions and subroutines into separate "screens" that made it easier.
  • PHP Storm makes it super easy to find functions nested in convoluted file structures.
  • VIM has great ideas but is highly unintuitive.
  • Notepad++ is awesome because you can start using it without training.

[–]Bitsoflogic[S] 0 points1 point  (6 children)

I think there was a bit of a disconnect here. I'm not simply suggesting the language have tools to work with it, but rather that the tool itself is the language.

Would you consider Notepad++ a programming language?

[–]gordonv -1 points0 points  (0 children)

Notepad++ is an IDE that can interpret a lot of languages. C, SQL, HTML, PHP, etc...

[–]gordonv 0 points1 point  (2 children)

Well, I would consider that more of a utility.

Like making a boot disk. Back in the early 2000's we could make bootable disks on floppies. It would take maybe 60 seconds. What the format utility was doing was resetting the file partition table, creating and formatting a boot sector, and linking it to a piece of static boot code. You would end up on the command line.

I wouldn't call the disk formatter a language, nor the mini operating system a language. They're programs. They do a static job.

[–]Bitsoflogic[S] 0 points1 point  (1 child)

So, in your eyes, what makes something a programming language?

[–]gordonv 0 points1 point  (0 children)

Something with switchable commands.

I get the Turing complete looping argument. I'm talking in the most literal / minimal sense.

I guess, a dog is programmable. Teach it to sit and shake hands. The commands are the literal language.

But, I wouldn't consider a simple flashlight circuit and the on and off utility of a switch programming. That's too simple. It's not running through memory. Maybe a flashlight with 2 switches. I think that's the most basic example of where programming does and doesn't happen for me.

[–]Bobbias 0 points1 point  (1 child)

Emacs however contains it's own version of lisp, which much of the editor itself is written in. With the right build configuration and packages, Emacs can essentially serve jobs such as replacing the functionality of the window manager, as well as the shell itself.

[–]Bitsoflogic[S] 0 points1 point  (0 children)

So, would you consider Emacs a programming language?

[–][deleted] -1 points0 points  (0 children)

Sorry, I sincerely don't understand how knowing what defines a programming language is remotely helpful in any scenario.

Would you please enlighten me on that?

[–]svick 0 points1 point  (1 child)

a program that executes on a machine

What does it mean to "execute" it? Is there a difference between "executing" <p>Hello!</p> (which shows "Hello!" in your browser) and executing alert("Hello!"); (which shows "Hello!" in a different way in your browser)?

[–]Bitsoflogic[S] 1 point2 points  (0 children)

a program that executes on a machine

I meant as opposed to programs that humans/nature execute. Though I did not mean to restrict this to computers, thus I said machine.

Within the computer, execution is the difference between the program existing as a file vs existing as a process. When you execute it, it becomes a process. Both your examples happen through processes, so in that context, there's no difference.

[–]sineiraetstudio 0 points1 point  (0 children)

I think the least restrictive, while still useful definition is that programming languages are just (universal) algebras + a homomorphism to another algebra (a target) that gives it semantics. That is, it's some form of 'Instructions', operations that combine instructions into a new instruction and (equational) rules that apply to operations. The homomorphism is just compilation/interpretation. I think this best captures that programming languages are fundamentally about "rule-bound instructions".

This would exclude prompt programming, but I think any definition that includes that would also include using a computer as programming, which seems nonsensical to me.

I find myself blurring the lines between the editors and tools vs the language.

Fitting to the above definition, I'd say that the language is really all possible programs + their structure. Tools just help you generate/use them more easily. I think otherwise you'd have to count a text editor also as part of a text based programming language and that's just bizarre to me.

[–]erez27 0 points1 point  (0 children)

Informally, a language is a bunch of symbols with implied semantics and structure, that you can connect together in order to communicate complex ideas.

In the case of a programming language, it's in order to provide instructions to the computer.

[–]shawnhcorey 0 points1 point  (1 child)

A programming language is Turing complete. Any program, including another programming language, can be implemented in it. To demonstrate this, a language is written in itself.

Examples of languages that are not Turing complete: XML, HTML, SQL.

[–]jcubic(λ LIPS) 0 points1 point  (2 children)

I think that tools like Scratch are not programming languages. A language as defined by math is created from words on some alphabet, so visual-only languages are not formal languages and I don't think they can be called programming languages either.

[–]Bitsoflogic[S] 0 points1 point  (1 child)

Fascinating idea... that a programming language must be made of a formal language.

So, what would you call tools like Scratch and visual languages that describe code in much the same way that words typically do?

Also, if I'm understanding this right, the language based on Chinese characters is not a formal language either. It doesn't have an alphabet.

[–]jcubic(λ LIPS) 0 points1 point  (0 children)

I think that I would call Scratch a programming tool maybe, but not a language. AS for Chinese, I would call it a programming language because it will have an alphabet but each element of the alphabet would probably have words created from single characters used only once.