What are some programming languages that reuse most of the syntax of another (rather than just a few elements of it?)

  • Breve@pawb.social
    link
    fedilink
    arrow-up
    1
    ·
    4 hours ago

    I just wanted to mention the esoteric programming language INTERCAL, which was created with the idea to be unlike every other programming language as much as possible.

    For example: The creators wanted to include GOTO because of how maligned it is with programmers, but since GOTO exists in many languages already they instead created the COME FROM statement which also makes the arbitrary jumps in execution even more confounding when trying to read the code.

  • Ephera@lemmy.ml
    link
    fedilink
    English
    arrow-up
    13
    ·
    2 days ago

    I’m not sure, I understand the question, because there’s tons of languages that are basically just a superset of another, such as C++ for C, TypeScript for JavaScript, Crystal for Ruby. Heck, the whole family of LISP languages kind of matches your question, because they all use most of the syntax of LISP.

  • phughes@lemmy.ca
    link
    fedilink
    English
    arrow-up
    10
    ·
    2 days ago

    Objective–C is a strict superset of C. Anything that’s valid C can be used in an Objective–C file.

  • bricked@feddit.org
    link
    fedilink
    Deutsch
    arrow-up
    5
    ·
    edit-2
    6 hours ago

    Interesting question because I think there are entire families of programming languages that share mostly the same syntax. Often, a popular language of its time like C, Java, Python or Lua inspires a range of languages with a similar syntax, but different semantics. Like how JavaScript was supposed to look like Java, but to be adopted to a browser environment. Edit: C# may be a more accurate example, or how Godot Script and Bend look like Python.

    I’d say the language family that has the most uniform syntax is shell scripting languages. They have mostly been standardized by POSIX and features are often being copied to make the shell more familiar and interoperable.

  • mox@lemmy.sdf.org
    link
    fedilink
    arrow-up
    3
    ·
    edit-2
    2 days ago

    Maybe D? It’s not a superset of C, but there is substantial shared syntax.

  • Gamma@beehaw.org
    link
    fedilink
    English
    arrow-up
    4
    ·
    2 days ago

    Python and GDScript are pretty similar syntactically, but the latter is more game focused and doesn’t have things like decorators, list comprehensions, or context managers

  • FrostyPolicy@suppo.fi
    link
    fedilink
    arrow-up
    2
    ·
    2 days ago

    Groovy and Kotlin borrowing heavily from Java. Groovy and Kotlin are also very similar to each other.