16

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

top 7 comments
sorted by: hot top controversial new old
[-] Ephera@lemmy.ml 13 points 1 day 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 5 points 1 day ago* (last edited 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.

[-] bluGill@fedia.io 2 points 1 day ago

@bricked@feddit.org javascript wasn't written to be like java. Java was the big thing so some marketer found a way to attach java to the name

@ryujin470@fedia.io

[-] phughes@lemmy.ca 10 points 1 day ago

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

[-] GammaGames@beehaw.org 4 points 1 day 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

[-] mox@lemmy.sdf.org 2 points 1 day ago* (last edited 1 day ago)

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

[-] FrostyPolicy@suppo.fi 2 points 1 day ago

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

this post was submitted on 07 Jan 2025
16 points (100.0% liked)

Programming

13416 readers
7 users here now

All things programming and coding related. Subcommunity of Technology.


This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.

founded 2 years ago
MODERATORS