18

Apparently COMAL created around 1975 had 'em. Anything earlier?

(This Q&A over at the langdev stack doesn't answer this question.)

Laurel
  • 1,720
  • 13
  • 27
davidbak
  • 6,269
  • 1
  • 28
  • 34
  • Didn't // random stuff originate with just making a joke at the expense of OS/360 JCL? – dave Oct 13 '23 at 20:16

2 Answers2

24

The BCPL Reference Manual, Memorandum-M-352, Massachusetts Institute of Technology, July 21, 1967 specified in section 2.1.2:

(b) User’s comment may be included in a program between a double slash '//' and the end of the line.

njuffa
  • 1,466
  • 12
  • 11
17

BCPL was the first language, as the earlier CPL used vertical bars.

Wikipedia states CPL first appeared in 1963. The history articles on the C language refer back to CPL 1963.

According to Section 27 Comments on page 33 of the Combined Programming Language (CPL), Elementary Programming Manual, Edition II (Cambridge) January 1966, comments are two vertical bars and continue to the end of the line.

PDP11
  • 718
  • 2
  • 12
  • 1
    OP asked for slashes (//) not vertical bars (||) – Bergi Oct 14 '23 at 16:39
  • 7
    @Bergi Given the timing of this and njuffa's answer, it looks like this was intended as some kind of counter-argument to their quote from the BCPL Reference Manual, Memorandum-M-352 and another-dave's comment on it. (i.e. "BCPL used them. Maybe CPL did." "No it didn't.") – ssokolow Oct 14 '23 at 19:17
  • 5
    "No it didn't" - that's how I read it. Maybe the first line of this answer could use a little punctuation: "BCPL, as the earlier...". And while it's almost not-an-answer, it's a useful contribution to establishing the claim of BCPL. – dave Oct 14 '23 at 19:49
  • While it would have been a useful response to the comment, this is indeed not-an-answer, as well as making a claim about BCPL using pipes, which conflicts with the cited statement in njuffa's answer. – Dewi Morgan Oct 14 '23 at 21:49
  • 2
    The first word is an answer and likely the correct answer (albeit a duplicate), which is why I said 'almost'. – dave Oct 14 '23 at 21:52
  • 5
    @another-dave Oh, thank you! Yes, I was misreading as "BCPL, like CPL, used vertical bars", as opposed to "BCPL, since CPL used vertical bars". I agree this is a worthwhile answer then. It unfortunately won't let me revert my downvote unless it's edited, so I've proposed a clarifying edit :) – Dewi Morgan Oct 14 '23 at 21:58
  • I'm thinking about the green checkmark. It's very possible there's a clear direction from paired vertical bars to paired slashes. CPL used an interesting character set which included overstrikes, and underscored letters, and overstrikes with underscores - see https://i.stack.imgur.com/a2LJh.png from the CPL manual linked in this answer - though CPL had slashes too which they didn't use for comments - at any rate, vertical bars can be see to be close to slashes - BCPL the follow-on went in that direction - hard choice! VOTE IN THE COMMENTS HERE! – davidbak Oct 14 '23 at 22:17
  • P.S. Why don't we see modern language allow underscored letters, or proper mathematical operators from Unicode? E.g., why doesn't C++ let me use for != or for <=? Why can't I have a variable named F̲oo or ? And why not the APL set too? – davidbak Oct 14 '23 at 22:23
  • @davidbak Some newer languages do allow Unicode character variable names, e.g. Swift. C++ first came into existence in 1985, well before Unicode existed. – ReinstateMonica3167040 Oct 14 '23 at 23:22
  • 1
    @davidbak - a Flexowriter, I believe. Algol 60 on KDF9 used underlining (for the basic symbols, as in the reference language) and overstriking. Underlining is easy when you have a non-escaping underscore. – dave Oct 15 '23 at 02:10
  • @ReinstateMonica3167040 - I know C++ predated Unicode - but it has unicode support now (to some extent) and they're working on C++26. I'm not asking for much. Don't get rid of !=. Just add as an alias. And increase the set of characters allowed in identifiers. That would go a long way! – davidbak Oct 15 '23 at 02:13
  • @another-dave - APL used a backspace-overstrike for it's special characters even with an APL typeball in the terminal (forget which printing terminal that was that was "selectric-like") – davidbak Oct 15 '23 at 02:15
  • 1
    @davidbak - My favourite was 'lamp' for illumination, aka comment. A circle overstruck with set-intersection, ⍝ (now U+235D). The devices I saw had a circle wider than the other part, so it looked like an actual filament lightbulb. – dave Oct 15 '23 at 13:11
  • @davidbak Raku (formerly known as Perl 6) does exactly that - see https://docs.raku.org/language/unicode_ascii and https://docs.raku.org/language/operators – IMSoP Oct 15 '23 at 14:03
  • 1
    Edited my answer to clarify the status of BCPL. This was meant to clarify the comment from @another-dave regarding inheritance from CPL. Problem was the number of characters allowed in a comment. – PDP11 Oct 15 '23 at 15:59
  • 1
    @davidbak "why don't programming languages usually use unicode for operators" might make a good question for programming language design. (But maybe first check it wasn't already asked.) – Paŭlo Ebermann Oct 15 '23 at 23:30
  • 1
    @davidbak https://en.wikipedia.org/wiki/IBM_2741 – philipxy Oct 16 '23 at 09:28
  • @davidbak: Or let the people who want to see fancy operator symbols use a font with ligatures without actually having weird Unicode characters in the source code. – Ben Voigt Oct 16 '23 at 19:12
  • Well, @BenVoigt, I do in fact do that (use a ligature font). But Unicode exists, it's real, it's the coin of the day. I don't understand your remark about weird Unicode characters in the source code, especially the (apparently pejorative) word "weird"!?!?! "Weird" to who? I might well ask. – davidbak Oct 20 '23 at 20:43
  • 1
    @davidbak: I can't maintain code that I can't type (or if I have to think about the typing rather than the logic). The good thing about the ligatures is that you can type them on an ordinary keyboard with no Alt+ combinations or dead keys. The bad thing about the ligatures is they obscure how to type them. Fancy symbols for operators are a solution in search of a problem; they solve precisely nothing, and they create new problems. – Ben Voigt Oct 20 '23 at 21:48
  • @BenVoigt: Not only that, but ASCII has 95 glyphs which can all be represented in visually distinct fashion. While some fonts annoyingly make "I" and "l" similar if not identical, and while "O" and "0" can also cause confusion sometimes, adding more characters creates more confusion. – supercat Oct 23 '23 at 14:49