Live data from Hacker News

Ask HN: Can someone explain to me why all languages don't try to have the same syntax?

news.ycombinator.com

11–20 of 60 posts

Re: Ask HN: Can someone explain to me why all languages don't try to have the same syntax?

#12
post #3

The problem with standardization is that you iron out all of the innovations. Certain language constructs are simply better for certain tasks. Lisp is built for recursion so it's great with lists. Object-oriented languages in theory are great for modularity and maintainability. Granted all these aspects have a lot to do with the coder in addition to the language. If all languages required you to manage memory as in C…

He asked why we need different syntaxes, not languages. Most of what you said doesn't relate to syntax at all.

Re: Ask HN: Can someone explain to me why all languages don't try to have the same syntax?

#14
Let's say (however unlikely) that all current languages agreed on standard, and the next release of all these languages used this standard. There would inevitably be a group of people who don't agree with the standard and so they go and write a new language that uses their preferred syntax. Now we are back where we started.

Re: Ask HN: Can someone explain to me why all languages don't try to have the same syntax?

#15
post #6

Because syntax is one of the features of a language.

and often times new syntax is created to support features in a language...

...and if you have the same syntax for all languages then what is the difference? All languages would just be extensions of the same basic language if the syntax is the same.

It is a good question though. Why have more than 3 or 4 programming languages at all?

Re: Ask HN: Can someone explain to me why all languages don't try to have the same syntax?

#16
post #10

Earlier quoted context omitted.

Same syntax, different semantics.. that does not sound easier to me. At all. Also, why don't we all just use one operating system for everything, have one kind of coffee, and eat one perfectly balanced meal all the time?

It seems you're disagreeing with a statement I never made. The question was "If they did have the same syntax, would they be different languages?" I replied: "Yes, they would be different because their semantics would be different" I never said it would be a good thing. And by stretching your analogy to the territory of food it only becomes weaker (with food diversity is a goal by itself). Also it can be argued that…

I don't think I disagreed with you.

I wanted to a) show how "one true syntax" would in itself be challenging and b) explain the utility that diversity has by analogy.

I agree that for most tasks, using a POSIX compliant unix-like system will suffice, but that's as much ground as I'm willing to concede on that point (for now ;)

Re: Ask HN: Can someone explain to me why all languages don't try to have the same syntax?

#18
post #9

This question can not be fully answered in prose. It can only be answered with a challenge: Learn four or five diverse languages reasonably well, then try to create the single syntax that works well for all of them. You'll understand when you're done... or perhaps rather, when you find you'll never be done. I will give one example of the tens upon tens of issues you will encounter: What's the one true syntax for a ty…

The one true syntax for type definitions is: don't have special syntax for them. Totally unnecessary. A good general syntax can handle them without a special case.

Re: Ask HN: Can someone explain to me why all languages don't try to have the same syntax?

#19
post #17

It's because some people don't like s-expressions, so they've been making up a bunch of other stuff.

My theory: people who don't like s-expressions don't get programming;

Thus, everyone who gets programming and is exposed to lisp becomes a lisp programmer,

and people who suck at programming are left out.

Post reply on HN