this post was submitted on 04 Aug 2023
134 points (91.9% liked)

Programming

17402 readers
137 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS
 

Why are there so many programming languages? And why are there still being so many made? I would think you would try to perfect what you have instead of making new ones all the time. I understand you need new languages sometimes like quantumcomputing or some newer tech like that. But for pc you would think there would be some kind of universal language. I'm learning java btw. I like programming languages. But was just wondering.

(page 2) 47 comments
sorted by: hot top controversial new old
[–] toikpi@feddit.uk 3 points 1 year ago

Without new programming languages we would still be using FORTRAN, AGOL and LISP.

https://fortran-lang.org/learn/quickstart/hello_world/

https://lisp-lang.org/learn/first-steps

https://www.computer.org/publications/tech-news/insider-membership-news/timeline-of-programming-languages

One reason why new languages are developed is the creation of a "Domain-specific language" or DSL. See Wikipedia for more information.

Programming languages are tools you pick the one for the job, there are situations where Java's garbage collection could be a problem so it would not the right tool to use.

[–] beeng@discuss.tchncs.de 3 points 1 year ago* (last edited 1 year ago) (1 children)

Like human languages, you get different types of expressiveness in different ways. If you know multiple languages whether is python or Java, or English and French / Spanish / German, you'll see that there are positives and negatives to each language.

Lots of people want to design the best combination of them all, using the newest tools and newest tech to create something as useful as possible.

[–] CileTheSane@kbin.social 0 points 1 year ago (1 children)
[–] beeng@discuss.tchncs.de 1 points 1 year ago (1 children)

Sort of... But new languages make use of new tech and compilers usually.

[–] Hector_McG@programming.dev 1 points 1 year ago (1 children)

And old languages add features and adapt or rewrite the compiler for new technologies. There’s no inherent advantage to a language being new.

[–] beeng@discuss.tchncs.de 1 points 1 year ago (1 children)
[–] Hector_McG@programming.dev 0 points 1 year ago

Less experience in what programmers actually want or need from a language.

[–] SteleTrovilo@beehaw.org 2 points 1 year ago

People need and want various levels of abstraction, type system control, and even just syntaxes. In these cases, it's easier to switch languages - or make one - than to implement a solution in a language that would fight against your needs.

[–] snownyte@kbin.social 2 points 1 year ago

Especially if one of them is based off the other.

Rust is based off of C/C++
Ruby is based off of Perl, Smalltalk, Eiffel, Ada, BASIC, Java, and Lisp

Just a couple of examples. Quite frankly, it's dependent on what system, what infrastructure .etc that'll be the call for a specific programming language. Nothing wrong with just picking one or two and sticking to them.

And I think that's what a lot of beginners in wanting to study programming languages can fall into, they want to be the jack of all trades in programming. But there's this problem of a new language coming in all of the time and it can get very wiry trying to remember them all.

[–] complacent_jerboa@lemmy.world 2 points 1 year ago

What might compel someone to make their own language? Typically, it's because they've already used some languages, they have some criticisms of it, and they want to make something better. Now, for languages that are open source and accept community contributions, that is an option. However, keep in mind that each language already has its own core maintainer(s), with their own vision, as well as a whole host of other people who would have to be convinced that your idea (whatever improvements you want to make) are a good fit for that language. Some changes can be quite drastic — especially if you want to improve one language by bringing in insights you've gained from another. So sometimes (not often, but sometimes), people say "fuck it, I'm making my own language, with blackjack and hookers".

The thing about software is, it's really easy to play around with. You don't need a workshop or parts or anything — you just need your computer. As a result, you have lots of people tinkering with stuff like making their own programming language, whether just for fun or more tangible reasons.

And we've been in this cycle of innovation for decades, and it's how we've gone from punch cards to assembly to C, Python, and all the rest.

But surely we don't need any more innovation? Like, why can't we all just use one language for everything?

Well, it's true that nowadays we have a whole bunch of general-purpose, multi-paradigm languages. The analogy people like to make is "different tools in your toolbox". But, to clarify, it's not that some of them are hammers and others are screwdrivers; they're all the same kind of tool ("programming language"), so really it's more like different screwdrivers, of varying sizes, with differently shaped bits at the end.

With screwdrivers it's clear why you might need one with this shape or the other: Otherwise it won't match the screw. With languages it's a little more subtle. You see, when you design a language (or almost anything else, ever), you inevitably make a series of tradeoffs. Is the language compiled or interpreted? Does it have a garbage collector? Does it have a strict type system? How does it do async? Does it support higher-order functions? There's a million questions, and you're going to get a different combination of answers for each language you look at. And that's before you evaluate other (potentially very important) things, like "is this language fast enough for my use case?", or "I need a library for such-and-such, has someone made that in this language?", or "does the language have a solid enough community that I can reliably search the answers to my questions?".

Technically, any of the major languages — Java, Python, C, C++, C#, Javascript, Go, Rust, etc etc — can be used as a one-size-fits-all, universal programming language. There's actually a joke "law" that goes "anything that can be written in Javascript, will eventually be written in Javascript". But they each have their own unique combination of design decisions, so in practice different ones will be easier to use for this kind of project or that (one major factor is third-party libraries, like python's numpy or pandas, that may not have equivalents in other languages). There are also situations where, for a given platform, you have to use that language. For example, for Microsoft's .NET stuff, I don't think you can substitute C# for something like C++ (someone correct me if I'm wrong please). Or, if you're working on the Linux kernel, you're pretty much just using C (I think they were considering adopting Rust, but idk if that's still going on). And, of course, the dominant programming language for anything on the internet is Javascript (although WebAssembly has made huge strides in roughly the past decade, so you can actually use other languages as long as they can compile to WebAssembly).

Finally, to wrap up this already way-too-long comment: a lot of these languages are very similar to one another. They're all procedural, heavily inspired by C, and for the most part they're either compiled and statically typed, or they're interpreted and dynamically typed. There are also a whole bunch of other languages, called functional languages, that are designed based on entirely different principles (the principles aren't harder to learn than what you're having to learn for Java, they're just different). But if you are looking for a universal programming language, I think the closest you're going to get is either C, C++, Python, or Javascript. In addition to Java, I would strongly recommend you learn C and Python (C has a bit more of a learning curve, but it teaches you a lot about memory management, which is a lesson you'll carry with you to any other language).

[–] mo_ztt@lemmy.world 2 points 1 year ago* (last edited 1 year ago) (1 children)

Different programming languages have different types of strengths. C is good for bare-metal performance and hardware interactions, Python is good at versatile interactions with all kinds of software and systems, Node.JS is good for asynchronous operations, and so on. Some esoteric languages aim to make things easy (or make them possible in the first place), or make things faster, or more secure, or etc. The things you can write in one language don't always translate to another, and sometimes people create a new language that makes things possible that didn't used to be possible. Machine learning wouldn't be where it is if everyone who's currently using Pytorch was still using C and doing all their own memory management. I'm currently working on a project in Node that would be much more difficult in Java, because Node's approach to asynchronous operations matches this problem way better than do the primitives that Java's runtime makes available. And so on.

Is any given language that gets created going to be the next Python? Probably not. But everyone who makes one has some kind of idea that there's something unique and wonderful within it, and you can't tell if they're right unless you let it happen and see how it plays out.

Edit: Okay lemme clarify: Node.JS is good for a particular type of (generally I/O bound) asynchronous operations. It makes simple things easy and fast, at the cost of making some complex things pretty much impossible, so there are a bunch of problems it's not good for. Better with the caveat maybe?

[–] TempestTiger@programming.dev 0 points 1 year ago (1 children)

If you have time (and the inclination!), would you mind explaining why Java's primitives aren't as good as Node visa vie Async ops?

[–] Von_Broheim@programming.dev 2 points 1 year ago

There isn't one, java is excellent for async and multithreading and it does it properly unlike node that fakes it by running on a single clever event loop or stealthily launches a bunch of node instances in the background depending on implementation.

[–] TCB13@lemmy.world 1 points 1 year ago* (last edited 1 year ago) (3 children)

Because people don't want to admit that JavaScript will be the only programming language in the future and that resistance is futile.

[–] TheCee@programming.dev 2 points 1 year ago (1 children)

people don’t want to admin

Exactly right.

[–] TCB13@lemmy.world 1 points 1 year ago

Ahaha fair point :D

[–] currychaos@kbin.social 1 points 1 year ago (1 children)

Ngl I thought you were meme-ing and was sad to see you downvoted.

[–] TCB13@lemmy.world 1 points 1 year ago* (last edited 1 year ago)

That's kind of the "problem" of JS. We can do memes like that but the truth is that it is taking over everything.

load more comments (1 replies)
[–] drzoidberg@lemmy.world 1 points 1 year ago

01001010 01110101 01110011 01110100 00100000 01100011 01101111 01100100 01100101 00100000 01101001 01101110 00100000 01100010 01101001 01101110 01100001 01110010 01111001 00100000

[–] Whirlybird@aussie.zone 0 points 1 year ago (1 children)

The same reason anyone creates a new product in an existing market - they want money.

[–] bleistift2@feddit.de 2 points 1 year ago (2 children)

For which language do you have to pay the language inventor to use it?

  • That sentence may be grammatically … questionable …, but I don’t know how to write that correctly now.
[–] 8bitguy@kbin.social 1 points 1 year ago* (last edited 1 year ago)

Coldfusion (Adobe) comes to mind. There is an open source CFML clone or two, but the real deal is a bit pricey. It's mostly used by government, higher ed., and healthcare. It's not terrible, but it was cooler when it was younger IMO.

[–] TheCee@programming.dev 1 points 1 year ago

That sentence seems correct. As for your question, you'd rather have to ask yourself: When would you pay for a programming language?

Back in the old days before internet and commodity hardware, before easy distribution, before non-trivial software, before basic compiler knowledge was common people were easily impressed, so naturally you could sell your compiler for primitive grug BASIC.

Today, that situation is different. A language by itself is meaningless, a risk, even, in some ways. A while back some developer of REM Objects was bitching about in the old aggregator on how nobody wanted to spend money on their special proprietary BASIC. Like it was just another product. They don't know ~~how to use a computer~~ how programming languages work. This extends to even finding users willing to use your stuff for free. I don't want to knock on REM Objects in particular, you know you could add way more examples like Seed7, every lisper ever etc., but let's get into why people pay for programming languages.

  • extreme vendor lock-in of platform, hardware, whatever (but you almost always have your language bundled with something else in the first place, because...)
  • the point is a feature beyond the language (think matlab, labview, SAP, Excel or Coldfusion 8bitguy mentioned)
  • dubious support contracts (think Oracle JDK)
  • enthusiasts you can milk for life support and dumbfucks that fall for your next gen graph AI DSL whatever bla
  • extremely great developer experience (but we live in an age where megacorps create languages and infrastructure for improved experience for free, so, good luck with that these days)
[–] bob742@programming.dev -1 points 1 year ago

We don't/ None of them are a significant improvement on PL/1 other that having objects (which hadn't been invented.) I blogged on this recently. https://bobbrowning.wordpress.com/2023/07/02/typescript-i-quite-like-it-plus-bonus-rant-about-languages/

[–] yaniv@lemmy.ml -1 points 1 year ago

We should make one programming language to rule them all!

https://imgs.xkcd.com/comics/standards_2x.png

load more comments
view more: ‹ prev next ›