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

  • 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.

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

    Interesting question because I 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.

    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.

  • 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.

  • 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
    ·
    1 day ago

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