174

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.

top 50 comments
sorted by: hot top controversial new old
[-] redcalcium@lemmy.institute 177 points 1 year ago

you would think there would be some kind of universal language

[-] Kerensky1101@lemmy.world 23 points 1 year ago

There is an xkcd for everything

[-] Mic_Check_One_Two@reddthat.com 21 points 1 year ago

You got to it before I did. Programming languages are like vehicles. You wouldn’t take a sports car off-roading, and you wouldn’t expect a tractor to win a drag race. There is a lot you can do with an all-purpose vehicle, but it’s not going to be as good as something that is purpose-built for a single task.

[-] Zalack@startrek.website 13 points 1 year ago

I actually don't think that's the case for languages. Most languages start out from a desire to do some specific thing better than other languages rather than do everything.

load more comments (2 replies)
[-] echo64@lemmy.world 80 points 1 year ago

Why invent the screwdriver if you have a hammer

[-] freeman@lemmy.pub 12 points 1 year ago

What kind of screwdriver though? Torx are superior.

[-] sin_free_for_00_days@sopuli.xyz 6 points 1 year ago

Robertson would like a word.

[-] freeman@lemmy.pub 6 points 1 year ago

No doubt they are probably better overall, especially when considering manufacturing. But I swear parts of my house where built with scraps (or the last guy was just a sociopath) and most of the time I encounter them it’s in some rare ass instance and it just pisses me off.

Last time was when servicing my AC I noticed the breaker was bad (ie wouldn’t reset ). So I had to swap it and by code I needed to swap the box it ran on since it was showing signs. Sure enough 1 of 4 screws holding it to the side of the house is a fuckin Robertson head. So I was neck deep in fixing shit and had to stop and go find my random cup of bit heads out in the shop.

Now I just carry a bit if I can remember it. But it’s hard to find screws sometimes so I just don’t use it to avoid exacerbating my own problems.

load more comments (2 replies)
[-] explodified@lemmy.world 53 points 1 year ago

Some languages have a obligation to support older versions, provide upgrade guides. They have old baggage in the forms of old systems or processes that they can’t just abandon.

Sometimes it’s easier to just start over from a clean slate. Experimenting and seeing how it works. If it fails well you haven’t inconvenienced millions of users.

It’s all about experimenting, trying to see what works, what it’s good with and what it’s not good with. A language like Java can’t just change to experiment things. Some people are also fixed to the style and methodology that Java provides.

Aside from that, hobby languages are just hobbyist stuff.

[-] stephenc@waveform.social 9 points 1 year ago

Quite a few languages that are major players now started as hobby languages.

load more comments (3 replies)
[-] glad_cat@lemmy.sdf.org 46 points 1 year ago* (last edited 1 year ago)

You can't easily improve a language and stay compatible with the previous versions. C++ does it but they are crazy.

you would think there would be some kind of universal language

It does not exist, but anyone is free to try and invent it. It should be low-level like assembly and high-level like BASIC, functional, object-oriented, and have weird stuff like traits, concepts, and alien features from Haskell. It must also have both the pointers/references of C++, and the borrow checker of Rust. And don't forget to make it as secure as Ada with pre and post conditions. But it must still be easy to use. Also you will have to write a compiler for every operating system ever (mainframe, server, desktop, iOS, Android, every phone, every tablet), and contain a universal GUI that pleases everyone. It's literally impossible to do right now.

Last but not least, Java was supposed to be this universal language that you can run everywhere. It failed and it cannot be run everywhere. It also had to be improved a lot, and it's missing a fuckton of features from every other language.

[-] OmnipotentEntity@beehaw.org 13 points 1 year ago

easily improve ... C++

I assure you that there is absolutely nothing easy about the C++ standardization process, lol.

[-] stephenc@waveform.social 9 points 1 year ago* (last edited 1 year ago)

I'd call it Paradox Lang, or PL for short. It even has features that are contradictory to each other, you just have to declare which mode you want at the top of every file. Can you imagine. :)

The only feature it doesn't have is "lightweight and minimal language".

load more comments (1 replies)
[-] Mandy@beehaw.org 43 points 1 year ago
load more comments (1 replies)
[-] hascat@programming.dev 29 points 1 year ago

Sometimes it's easier to try a new idea in a new language (e.g. the borrow checker in Rust) rather than trying to shoehorn it into an existing language.

load more comments (3 replies)
[-] oessessnex@programming.dev 27 points 1 year ago* (last edited 1 year ago)

Some people consider working on programming languages fun, so they create new ones.

[-] wesker@lemmy.sdf.org 26 points 1 year ago

Long has man wanted to experiment with as many partners as he can.

[-] mo_ztt@lemmy.world 23 points 1 year ago* (last edited 1 year ago)

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?

load more comments (7 replies)
[-] CodeBlooded@programming.dev 22 points 1 year ago* (last edited 1 year ago)

Think about this: Why are there so many automobiles? And why are so many new models still being 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 automobiles sometimes, like construction equipment trucks or some treaded military tanks. But for average daily driver you would think there would be some kind of universal automobile. I drive a Corolla btw. I like automobiles. But was just wondering.

I’m not here to mock you, just providing an analogy. You can deliver just about anything in one language that you can with another. However, like the car, you might need a different type if you want more performance. Maybe you want a fast car. High performance cars often need a lot of attention, they need that premium gas, the mechanics demand higher pay! What if you only care about getting from point A to point B, and you’re more concerned with driving a car that’s cheaper to maintain, maybe there are just more car mechanics for that type of car, and the cost to pay them is cheaper.

A C application that is very well tuned to manage memory and threads in the name of perfect performance will require more time and computer science knowledge to create when compared to a Python script that does the same thing, but in the most basic possible way running on a single CPU, running hundreds of time slower.

Sometimes you need the performance, and often you don’t. Sometimes you need a treaded tank, sometimes you need a NASCAR, and most days the Corolla does just fine, it’ll even let you miss a few oil changes before things get bad.

As to why we don’t perfect what we have now instead of creating more: technology changes, easier to work with abstractions come about, some people enjoy the hobby of creating a language, or maybe a niche language comes about with very specific trade offs for a very specific purpose, no one wants to break backwards compatibility by adding new features and syntax to their language - I’m sure there’s tons more reasons to list.

[-] Hector_McG@programming.dev 22 points 1 year ago

Partly because sometimes a particular language suits a particular problem set.

Partly because people just like writing computer languages.

But mostly because people mistake the fundamental problem of programming, which is programming is really hard. So someone comes along and thinks “Programming is really hard, it must be a problem with the languages available” and sets out to write a computer language that makes programming easy.

But all that happens is they trade one set of difficulties for another set of difficulties. They might succeed in making writing the initial version easier, but make maintaining that code harder. Or they might solve some memory allocation problems, but create performance issues.

Either way, someone will write a language because they think they will help solve the issue of programming being hard, and fail. Because the really hard bit about programming is about understanding everything the program needs to do, in microscopic detail, and translating that into a structure that best fits the problem; not the actual coding itself.

[-] eluvatar@programming.dev 9 points 1 year ago

This is why we need low code solutions /s

[-] cerement@slrpnk.net 20 points 1 year ago

well … we all know the perfect programming language was created way back in 1960

[-] lemann@lemmy.one 6 points 1 year ago

Ugh, for my work we maintain a software add-in written in Lisp and it's a nightmare to work on

[-] faintwhenfree@lemmus.org 6 points 1 year ago

And that link somehow doesn't open well for me, something about a bracket I believe

[-] Spimble@lemm.ee 8 points 1 year ago

And that link somehow doesn't open well for me (something about a bracket I believe

load more comments (1 replies)
load more comments (4 replies)
[-] mspencer712@programming.dev 20 points 1 year ago

Think of a programming language as a crutch for the human brain. Processors don’t need it: they don’t have to think about the code, they just execute it. Our mushy human brains need a lot of help, however.

We need to think about things on our own terms. Different programming languages, different APIs that do the same thing, different object models, these all help people tackle new problems, or even just implement solutions in new ways.

Some new languages have a completely different model of execution you may not be familiar with. Imperative languages are what we traditionally think of, because they work most similarly to how processors execute code: the major pattern used to make progress, do work, is to create variables and assign values to them. C, COBOL, BASIC, Pascal, C# (my personal favorite), Javascript, even Rust, are all imperative languages.

But there are also functional languages, like ML or F#. (The latter, I keep installing with Visual Studio but never ever use) The main pattern there is function application. Functions themselves are first order data, and not in a hacky implementation-specific way like you’re passing machine code around. (I’ve only ever used this for grad school homework, never professionally, sadly.)

And declarative languages like Prolog helped give IBM’s Watson its legendary open question answering ability on national TV. When you need a system to be really, actually smart, not just create smart-sounding text convincingly like a generative AI, why not use a language that lets you declare fact tables? (Again, only grad school homework use for me here)

Programming is all about solving problems, and there are so many kinds of problems and so many ways to think about them. I know my own personal pile of gray mush needs all the help it can get.

[-] stephenc@waveform.social 16 points 1 year ago

Well I guess I am part of "they" since I have my own programming language pet project. Why did I create it? Because I wanted to, mostly. Sure, there are also some finer language design choices I wanted to choose differently for my preference, but mainly I just wanted to learn how.

[-] lysdexic@programming.dev 16 points 1 year ago

I would think you would try to perfect what you have instead of making new ones all the time.

Perfecting what you have often leads to a completely different language. See C vs C with classes which ended up being C++.

There is absolutely no problem with creating new languages. These are often designed with specific features in mind, and the success cases often offer features that are in high demand. Take for instance node.js, and how its event loop makes it a near ideal language for network-heavy applications that run on a single thread.

[-] MXX53@programming.dev 12 points 1 year ago

I know a handful of languages and I think of them as tools. For example, a flathead screwdriver will work on a phillips screw head (In most cases with some outliers), but a phillips screwdriver might just be better for the job. Same with a wrench and a socket with a ratchet, etc.

When it comes to programming or scripting I approach it in the same way. If I am at work, and I need to automate something quick and dirty, no end user will need to use it, and it is just adjusting data or spitting data back at me, I am probably going to write it in Python.

Or, if I need to make something that an end user is going to interact with, I am probably going to spin up a web server and use the MERN stack to create that.

If I am working at home on a TUI for my favorite application, I am going to use Rust or Python

And if I working on a project that requires me to work with embedded systems, I am probably going to reach for C, maybe C++ depending on the support, and I have in a couple of instances needed to use Assembly.

All this to say, I think that if I had to use Python for all of these, I would be in trouble. Same as if I had to use C++ to accomplish all of the above. Could it be done? Sure. Do I want to do that? Not at all.

[-] sarsaparilyptus@beehaw.org 11 points 1 year ago

No idea, HolyC is the only language we need.

load more comments (1 replies)
[-] originalfrozenbanana@lemm.ee 11 points 1 year ago

Why do we need Java AND JavaScript? \s

load more comments (1 replies)
[-] edinbruh@feddit.it 10 points 1 year ago

For various reasons.

Different languages take different approaches and models to do stuff. Thus making each one better or worse for different challenges.

For example, python is easy and quick to get up and running. Bug it's slow and unsuited for low level programming (like OSes, drivers, and embedded stuff). On the other hand, C is very fast and very low level, allowing you to make both high performance programs and low level stuff, but it's a nightmare to use and you will run into all sorts of problems that an easier language, like python would avoid. All of this is mostly due to python being interpreted (instead of compiled) and c having manual memory management.

But they might also take a different approach at computation, like for functional languages (opposed to imperative languages) which try to solve problems in a more "mathematical" and declarative way, instead of defining a sequence of instructions. Or, even more, logic programming languages, in which you define a series of logical statements and the language tries to find solution and draw conclusions from them.

And some languages are designed around some particular concept that they think is beneficial and worth exploring, maybe taken from various other languages and put together, like rust which is designed around the RAII design pattern and takes large inspiration from functional languages, while still being and imperative procedural language (like C, so not object oriented). Or java which was designed to be a portanle but performante object oriented language, with support for low powered embedded system, full of features but simpler than c++, etc... all stuff that now is nothing special, but remember that java us very old. Or kotlin which tries to be java (they are interoperable), but modern and better and more "pure" or "consistent". Or c++ that started as an object oriented superset of c, but then started adding every single feature of every other imperative language, and never giving up on older stuff, to the point of becoming very hard to use correctly while making it very easy to screw yourself in the most intricate ways.

And of course there are domain specific languages (opposed to general purpose languages). Which aren't even necessarily Turing complete. They are designed for one purpose only, and they do that better than general purpose languages. For example AWK for text processing, or SQL for databases, or matlab for scientific calculations, or TeX for typesetting, or GLSL for shaders. And here imagination truly is the limit.

load more comments (3 replies)
[-] TheCee@programming.dev 10 points 1 year ago

You can not perfect old languages, since there are a lot of features that you can not add on or change afterwards, OP. Not in a worthwile way. This is not a philosophical question, it wasn't for a lack of trying. And since there aren't enough skilled people in this niche, fashion driven field, expect history to repeat itself and some langs at best get 60 to 80% right.

load more comments (1 replies)
[-] AdmiralShat@programming.dev 9 points 1 year ago

Why are there so many different stores? You have grocery stores and hardware stores and computer stores and bulk stores and electronics stores and fire work stores, there's even fast food businesses and strip clubs.

You can buy most of this as Walmart, so why isn't there just a universal store?

[-] noodle@feddit.uk 9 points 1 year ago

New languages deal with challenges the old languages faced differently, with hindsight of how those languages dealt with those challenges and how they could have done things better.

We don't even have a universal language for communication. That may not be a bad thing, either. There's a theory that the language you speak changes the way you perceive the world - I believe that's true with programming as well. If we only had Java, we'd only get Java-style solutions.

load more comments (1 replies)
[-] mtchristo@lemm.ee 8 points 1 year ago

let hem keep at it. I haven't found an easy and verstile language as Python than can compile to byte code and be as fast a C ! I know it is coming anytime now despite having been waiting for over a decade.

load more comments (3 replies)
[-] darcy@sh.itjust.works 7 points 1 year ago

they should have stopped after x86 ASM 😔

[-] yogsototh@programming.dev 14 points 1 year ago
  • Real programmers code in C!
  • NO! Real programmers code in Fortran77!
  • NO! Real programmers code in ASM!
  • NO! Real programmers code in binary!
  • NO! Real programmers build their own hardware!
  • NO! Real programmer code using bacteria DNA!
[-] BeigeAgenda@lemmy.ca 7 points 1 year ago

Sounds like a XKCD.

  • NO! Real programmers move each bit on the disk surface!
[-] Sibbo@sopuli.xyz 7 points 1 year ago

Technology advances. Both theory of programming languages as well as their practical implementations are large fields of research with many people working on it.

Software is so much at the core of everything today that making its development cheaper is extremely lucrative.

[-] vhstape@beehaw.org 6 points 1 year ago

Because people are afraid of C ;)

[-] garyyo@lemmy.world 5 points 1 year ago

A given programming language often has limitations which are largely different than the limitations from others. This means that different languages are often used on different kinds of problems. Want something fast, use C. Want to write something quickly, use python. Want it to run on just about anything, use Java. And so on.

So why don't we make one ultimate one or a few that fulfill all needs? Well, partially because we haven't figured out how to do that, but also it's really easy to learn yet another language once your understand how they work. I can write in python, js, c, c++, c#, Java, kotlin, rust, perl, ruby, php, forth, lisp, and I could keep on going for quite a while. The underlying concepts are largely the same and so picking up a new language is no big deal (though being good at it is a bigger deal). We have so many because ultimately it just doesn't really matter that we have so many.

[-] esscew@programming.dev 5 points 1 year ago

There are a lot of people with a lot of opinions and preferences that are trying to do a lot of different things in a lot different ways. The same reason we have so many of anything.

[-] unquietwiki@programming.dev 5 points 1 year ago

If any of you happen to still be on Reddit, I actually maintain a "catalog" of these newer languages, as they come across my radar. One of my more recent finds is MiniScript, which the author of that has been using to port a fair amount of classic BASIC games from that GitHub archive I posted about recently. I got sucked into Nim, which seems like a good synthesis of Python, Javascript, and C++; c/nim exists for anyone interested.

[-] icesentry@lemmy.world 5 points 1 year ago

Aside from all the pragmatic reasons that were already listed, it's also just fun to write all the parts required to make a programming language.

load more comments
view more: next ›
this post was submitted on 04 Aug 2023
174 points (100.0% liked)

Programming

17503 readers
8 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