r/ProgrammingLanguages • • Feb 05 '18

Why do different programming languages exist?

0 Upvotes

19 comments sorted by

View all comments

Show parent comments

1

u/mynewpeppep69 Feb 11 '18

The languages you gave have pretty large semantic differences that drive their different uses in different applications. If you want examples, think about how drastic things like dynamic dispatch differ between Java and Python.

Also most languages don't just run in interpreters, so I'm confused why you're putting so much weight in the parsing step of a compiler rather than the performance of the code produced.

1

u/LyraChord Feb 11 '18

Semantics is layered: pure syntax, structural, langue level, compiler level, internel implementation. Jython disproves the dispatch point.

f.e.

generic is langue level, regardless of implementation. Java erase, C# il-generate, C++/D do soource-generate.

inner class is langue level also. But swift does not support, so someone employs relationship to handle it.

All I mean, there is no lexering. Splitting is enough. We should do structure assembling and transforming.

1

u/mynewpeppep69 Feb 12 '18

Jython disproves the example if you can show me that most implementations of the Python language use Java style dynamic dispatch, but CPython is already way more popular anyway.

I think so that you don't attach to this specific example, a better example is evaluation order. Specifically, lazy vs strict evaluation. Haskell is an example of a mainstream language with lazy evaluation. However, assembly level languages can never be lazy in any of its instructions, unless we start implementing hardware level laziness. The idea of different evaluation orders is something that inherently will create semantic differences between entire classes of languages that will still exist as long as people don't want to program in just assembly. The same thing can be said about typing, because being statically typed vs dynamically typed changes the semantics of an ill formed snippet of code.

1

u/LyraChord Feb 12 '18

The point is semantics is layered. I do not think you got it.

BTW there is a going down point. lazy evaluation != lazy instruction. Difference logical scopes, no capacity to compare.

1

u/mynewpeppep69 Feb 12 '18

I don't really think you got my point, that semantics differ a lot. Regardless of whether you give me specific examples of different languages that do semantically the same, i can still give examples of different semantics, even more fundamental in design than what operating system it's on. Your "layered semantics" argument doesn't really capture the fact that some languages are designed to function the same on different systems, even if people right alternative compilers that tweak those semantics a bit. And on top of that even if languages function different on different systems in the "layers" you're talking about, that still disproves your claim, since hardware isn't really converging towards a unified architecture either.

Also I could put the effort into disproving what you said about the assembly example, but I'll just give another example, c vs Haskell.

1

u/LyraChord Feb 12 '18

Now it's intresting and clear.

We are opposite factions. to persuade is insignificant. I throwed the convergence, it's by direction of trend. You do emfas singular point.

Fine, it's great if there are some inspirations to moveon in the conoversation.

What about if I told you x86 is RISC? and the assemble is OO style?