If you had to choose one programming language that you had to use for the rest of your life, what would it be?
If you had to choose one programming language that you had to use for the rest of your life, what would it be?
If you had to choose one programming language that you had to use for the rest of your life, what would it be?
Rust, it is a pleasure to work with and far more flexible in where/what it can run then a lot of languages. Good oneverything from embedded systems to running on the web. Only really C and C++ can beat it on that, but those are farlesss pleasant to work with. Even if it is not as mature in some area quite yet, it just gets more support for things as time goes on.
I have been wanting to get into Rust, but as an Electronics Engineer I essentially only have experience coding on embedded devices along with python scripting for test automation and data processing (fuck MATLAB lol)
I am not a good at coding by any stretch. Everything I find on rust focuses on rust user-level or OS-level applications. Most of those concepts I don't follow well enough in any case.
Do you know of where I can follow tutorials, find more information, and dive into HALs for embedded applications?
Rust actually has a shockingly good embedded story for some parts. ST-micro is very well covered. Espressif has first party support. Nordic parts are supported by Ferrous Systems who certify rust for ISO 26262 use. Msp430 is workable, but requires a fair bit of knowledge. The story is less good for anything else that’s not a Cortex part. RiscV is definitely getting there though.
https://doc.rust-lang.org/stable/embedded-book/
Ferrous systems knurling is actually a pretty incredible set of tools. I’d argue that they’re a better experience than most command-line c environments.
https://github.com/knurling-rs
They also have some pretty good walkthroughs for the Nordic and Espressif parts.
I would start by learning rust at a user level via the rust book to get you familiar with the language without the extra layers that embedded systems tend to add on top of things. Keep in mind that the embedded space in rust is still maturing, though it is maturing quite quickly. However one of the biggest limitations ATM is the amount of architectures available - if you need to target one not supported then you cannot use rust ATM (though there is quite a few different projects bringing in support for more architectures).
If you only need to use architectures that rust supports than once you have the basics of rust down take a look at the embedded book, the Discovery book and the Embedonomicon. Then there are various crates for different boards such as ruduino for the arduino uno, or the rp-pico for the raspberry pi pico, or various other crates for specific boards. There are also higher and lower level crates for things - like ones specific to a dev board and ones that are specific to a chipset.
Lastly, there are embedded frameworks like Embassy that are helpful for more complex applications.
If you have an avr you could just use avr-hal.
The documentation is ok and if you used to work with arduino it should be straight forward.
DotNet Core as a whole (C# + F# + other languages that are being ported to compile down to a DotNet binary).
Because it has all the things Java promised us - frictionless, painless, cross-platform programs - but is implementing it far better than Java ever could.
Honestly, DotNet Core is now at least a half-decade or more ahead of Java in terms of the base platform and C# language functionality/ease-of-use. The only advantage Java has at this point is it’s community ecosystem of third-party features and programs.
I remember my first job working with C# - this was the common sentiment: it's a Java that is better than Java at being Java. I mostly agree with that.
Try using Kotlin some day, though. I consider that language to be even better than C#, and it additionally gets to leverage the JVM ecosystem.
Kotlin > C# > Java, in my book
And you can even run it in the browser with Blazor! Love C#
You may explained it unprecisley or simply wrong. You can not run it in browser. It is done on web Server side like PHP. In browser you run JavaScript.
I've been meaning to give F# a go but I never seem to get around to it. Seems like an interesting language
Get around to it, F# is fantastic! 😄
And those are enormous advantages. It will also get you a lot more jobs. I see Java jobs everywhere. I barely see C job postings at all.
Good thing they weren't talking about c.
Lisp, the language that has them all.
If I can choose a single language that'd be lisp. Very beautiful to write.
C, because it can run everywhere and I won't be limited on the things I can make
Me waiting for all the C websites written in AngularC /s
Lol cgi page generators written in C were the OG web framework. Maybe perl too.
Python. Not even a competition. My love of programming quadrupled the day I switched to python and it's getting stronger and stronger. I have now 10 years of professional python experience and around the same of C++ with occasional C#. A few projects in Go and Java. They all have ups and downs, but... Not even comparable how much everything is more elegant and simple in python
I don't get it. I love python for small quick projects. But anytime things get more complicated, I find myself constantly tripping over myself without the strong typing and errors letting me know I when I've changed a property in a class that in falling elsewhere.
Python was always strongly typed. For years there has been optional static typing and - you know - unit tests.
If you're having significant issues due to not knowing what types you're using, the type system may not be your greatest problem...
If you pick Python, do you still get libraries written in C or Rust?
Yeah, C libraries can be used in basically any mature language. It's just too useful to not have.
And Rust, since it doesn't need a runtime, can emulate the format of C libraries.
Rust libraries can also specifically target Python via https://pyo3.rs, but as I understand, this just does the C library format, plus a basic Python wrapper to make it nicer to use.
Python. I'm in data science. Sure I could write all that code in C or C++, but my time spent coding all that extra boilerplate is better spent on analysis.
I've already made this choice. Switched from C++ to Go, and now I never want to touch another language at all. Since I'm not writing kernels or embedded, Go is pretty fast for everything else. Not very popular in gamedev, but that's just a lack of 3rd party libs, specifically native graphics support.
As for other languages, I can't justify unnecessary complexity that is generally welcome by those language communities. Go is straight simple yet powerful, and I admire that.
I think I'm with you on this one. As another polyglot, I'm hesitant to pick anything, but the language I like working with most, today, is 'go'.
I think I would risk it and hope that 'go' gains libraries (or I just discovery existing ones) for other things I want to do later.
I like go for pretty much everything. Except working with arbitrary JSON. So painful.
That boils down to maps. With a few helper functions it's not a big deal. I can't remember when I needed to unmarshal JSON into map last time, tho.
This would be my pick as well for all the same reasons.
I'd probably pick something esoteric and then just stop programming, tbh. I enjoy being a polyglot programmer, and learning many languages and learning from many ecosystems is incredibly interesting to me, far more than hyper-specializing in a single language would be.
I'd probably pick something esoteric and then just stop programming, tbh
I'll just leave this here for your consideration... "Friendship is Magic ++
I thought Brainfuck was esoteric but this, this! My god what have you done
Dear God
Malbolge
INTERCAL
C, can build any other language from that :D
And if i am gonna be miserable, may as well inflict as many vulnerabities on everyone else while I am at it.
It would be C++. Its versatile enough to do everything with it.
Right? C++ feels like cheating. It has every conceivable feature, and you maintain sanity by not using most of them.
Likely either C or C++, both languages have been around for a long time and both are still used in huge projects
For me it would be C++.
Rust:
COBOL because I am a fossil
Can’t have COBOL without COOL!
Yeah, but a rich fossil.
Scala. Expressive, concise, can scale from simple to sophisticated. Sufficiently powerful - has metaprogramming, advanced types. Runs on a world-class runtime and takes advantage of a huge, mature package ecosystem that isn’t going anywhere.
Seconded. The metaprogramming aspect of Scala is getting better and better.
"Sufficiently powerful" is a bit of an understatement when it comes to Scala. Honestly may have a bit too many features for my taste, it's not a small language
Actually the language is quite small. The features, it has, are just quite powerful and have huge synergies so that it seems that you have a lot of complex features. It has a lot of weird corner case stuff, but most of that is because of the jvm and other languages have that too unfortunately.
For me it would be C/C++.
That's cheating; you only get to pick one.
Ok, then C++.
Assembly, so I can shorten my lifetime quite a lot
Unison. If it were to gain mainstream adoption, it would change the world. It’s a crazy futuristic idea and no one else seems to even remotely be approaching the same thing.
I took a look at Unison a short while ago when I saw it mentioned elsewhere on Lemmy and I'll say what I said before: Their Hello World example, and by extension the rest of the language, looks very weird and unwieldy to me. With the repeating identifiers and relatively alien syntax I'm having a hard time seeing this catch on.
Functional languages aren’t for everyone.
I dabbled in Haskell, and my time with it was very enjoyable. I grew comfortable with the syntax over time, so I’d say try the language for a few days/weeks (really depends how fast you learn) and see how it makes you feel.
I definitely suggest trying out Haskell. I followed the Wikibooks guide, and ever since using Haskell, I haven’t been coding the same. Functional programming can be amazing.
I’ve never heard of Unision. A quick look at it and it seems interesting, but very foreign. I’ll try it out and give it my thoughts.
Just scanning through the docs and YouTube, it doesn't seem to do anything that I can't easily do with Go. What am I missing?
I know this is a harmless "what if" but let's be encouraging people to explore more languages not to choose a single one to be everything for all time.
Absolutely! I'm just wondering if everyone has that one language in their hearts :)
Rust.
I see that user name
I'm already resigned to using C for the rest of my life 🤷🏻♂️
What bucket of that are you in? There are a lot of different reasons people take your position.
Personally, I just do modding for games as far as using my programming knowledge. C is used damn near everywhere, does pretty much anything I can think of and it's easy to work with.
Ideally I'd choose Rust because I enjoy working with it, but don't have enough time to commit to it at the moment. But being Practical I'd probably say Java, its easy to get stuff going and has been around forever so it's easy to find solutions etc.
C, because I can find a compiler or interpreter for other language written in C (I may need to run a few steps to get there), and thus work around your silly and nonsense question. Seriously, I use multiple languages because there is no one true language to rule them all. I use C++ for problems where bash would be wrong, and bash where C++ would be wrong. And some python, cmake, lua mixed in for good measure. I'm looking at Rust to add (rust doesn't like the way our system designed so it is hard to figure out how to implement it)
Java. It's familiar, it's the one I use most at my job, and I'm not in love with any other language enough to choose something less pragmatic.
I'd love to take Haskell, but there's neither enough support nor enough jobs. Same with most functional languages really. But nothing else compares.
Truly! One day I decided to take the plunge and learn functional programming with Haskell—I haven’t been the same since.
I don't really want to do everything in one language but if I did have to pick it would probably be Julia. It's slightly simpler than Python, and significantly faster without relying on APIs written in C. And has some really great features like broadcasting, multiple dispatch, and a good type system. The only place I feel like Python has it beat is quantity of libraries and support network, which both basically come from the same origin of just having more users. I'm hoping more data science types switch over in the next few years, since Julia is already great for most things mathematical. And I hope that momentum allows Julia to perhaps reach out to other domains.
Probably Ruby. For some reason .. no, that's a lie .. playing with Exherbo, Gentoo and Funtoo, but mostly Exherbo, made me loathe Python. However, everyone in the data processing arena seems to use it, so I'm bound to have to change my ways eventually! For "Ruby": read "Python".
My days of needing high-speed low level languages are long gone. I learned C on Borland C++ back in 1990 to price derivatives on 386s. Loved it.
If I mess around with any language it's for fun. I intend to commit suicide, when my time is done, by the percussive head trauma that learning Haskell will cause me.
See, I love Haskell, and the reason I'd choose Rust for my one language is the feeling that in principle anything I can do in Haskell I can do in Rust, with a little extra percussive head trauma; but I can never have the control in Haskell to do the beautiful efficiency I can do with Rust if I ever actually did any programming.
That's rather beautifully put and extra marks for p-h-t! 😁😜
I learned low level stuff to give prices to traders before the trading interval ended. I'm serious. Our four man hedge fund was under the wing of huge French bank. Pricing in the era was painful.
Asked for a price in the era used to take minutes for derivatives; I was told much faster wasn't possible; that's a red rag to me. I had no choice but to get dirty and go low level again.
The traders were old style barrow-boys, their like disappeared maybe a year or so after. Derivatives have a load of parameters that go with the actual price, "the Greeks", and market traders easily remember sets of shopping lists and prices and quantities at the same time. They were a shoe-in before computers were actually useful on a trading floor.
I learned to program on a 6502 RISC chip in Acorn Assembler. I liked it because BASIC was shit in the era (GOTO Fcuk My Life), like it got much better .. 🤣😂 Knowing how programs work allows me to try to make it faster. These days I think know compilers are smarter than me.
Rust appeals too for the time-travel aspect. I'd like to learn to write a threaded program. I would have loved to do that when back in the day, I always regretted the way it worked, but it was way beyond me 😭 .
I wouldn't mind looking at my old original killer pricing program, I knew it could be optimised then, but I just didn't have the time or the skills to go that extra mile. I regret that bitterly. 😡
If you get time, let me know of your (t)rust travels. Bon voyage.
Lua.
Don't call the ambulance, it's too late for me
I agree, I really enjoy programming in Lua.
Kotlin without a doubt.
Gives you more flexibility and freedom that most scripting languages. The syntax is clean and concise, the tooling is amazing and can compile to JVM, JS, Native and WASM.
I have used Kotlin a bit for a hobby project and it felt like they were 95% done with a 1.0 version. I love the promise of a single code base that can run on the JVM and browser, but it is not all there. Until recently, the API was not guaranteed to be stable. Every one in a while, I hit a feature that is JVM only or does work right in JavaScript. The JS compiler will "helpfully" remove uncalled public functions unless you explicitly mark them with JsExport.
Also, from what I can tell, only InteliJ is the only supported IDE (which makes sense, since they are the language developers). There is an official Eclipse Plugin, but the last time I tried it, it did not work and tried to take the entire IDE down with it.
Having said that, it was very close to complete and I have not worked on that project for a few months, so it could all be perfect now.
Kotlin jvm is extremely stable, not sure what issues you could be encountering there. The API has been guaranteed to be stable for years and years now. And sure, the other stuff has experimental functions, but they’re clearly marked.
PHP or C++, I love both of them for different reasons. Tough one deciding between the two.
What are you?
A satanist?
Don't lump them in with us! I'm a proud member of the Satanic Temple, and I wouldn't touch PHP on my most hedonistic night.
There's the Devil, and there's the Devil.
Heh, no, why?
Who downvoted this person's preference?
Like "you preferenced wrong"? "You have the wrong likes"? "You like something different from me?"
The did not follow the hivemind of "Rust good, JS slow, C complex, PHP bad" which clearly means they are in the wrong /s
Java
Typescript. I greatly prefer C-Style curly brace languages over Pythonese langs. Also the typesystem is incredible, as it allows you to be as precise or not as you want which is a huge boon.
Clojure, can't stop using it, so fun to use!
For personal preference, assuming I didn't have to worry about getting a job, Lisp no question.
Otherwise, I'd have to go with C++.
Rust, hands down.
Ruby. It’s designed for developer happiness, and it’s beautiful. Not as beautiful as it once was, but still lovely to code in.
Crystal is very similar to Ruby, but is compiled to native code instead. Would you consider that? Why or why not?
Yeah, I’ve tried out Crystal. I like it, I think it’s got a lot of potential. I like the improved performance, and the concurrency model. The community and ecosystem isn’t as strong, though. If I had to pick one right more, it would still be Ruby!
I love Elixir too, for different reasons. It’s a completely different language, but with a similar style.
I had a look at Mirah back in the day. It’s like Ruby, with stronger, more static typing, that is designed-in better than Ruby’s bolted on typing additions.
I just can't comprehend how anyone can think ruby is enjoyable to work in or beautiful. To me it's a dumpster fire. I would almost rather write php.
I can’t imagine thinking the opposite either. People are different. Matz’s attempts at backwards compatibility in Ruby 3, particularly wrt typing haven’t been kind to its more elegant origins, but ‘dumpster fire’ is baffling to me. Some people do like php , though, so 🤷🏻♂️
Ruby's ===
operator actually serves a useful purpose at least.
Ruby seems like a clusterfuck for anyone who doesn't work on a project alone, change my mind.
Ruby gives you all kinds of tools to make clusterfucks, but it's not hard to keep your hands out of the metaprogramming cookie jar.
But with careful application even fucky features can be put to good use. Like monkey-patching a problematic method to only throw an exception rather than allow accidental misuse. With a nice verbose error message and good testing practices there's almost no risk.
JavaScript. I can't think of anything else that can be used for everything. It's a back-end language, a front-end language, it can be used for styling and animation, it can be an OOP language or a scripting language, and can make database queries & submissions. Is there another language that is as versatile for website development? I can't think of one.
So while this is probably a good answer to the hypothetical question, that's actually not a good thing, you realize that, right?
Special tools exist because different problems require different solutions. And sure, then can be a huge overlap of those tools, but you can't literally do everything with a single tool; chances are it'd be a shitty tool. Either you can't actually do everything with it, or it's so complex that you don't want to use it in the first place.
Javascript is somewhere in between, in the sense that it's both kinda terrible for most of the jobs you mentioned, while also not actually usable for "everything" - i.e. it'd be a terrible language for anything that needs to be performant or reliable. Hell, we have JS in crap like Gnome now and it's a nightmare.
Yeah Rust can do all of those things as well, JavaScript is obviously much more common.
a front-end language
I love rust but this requires killing the web app and using basic html. which i'm also pro.
I would be torn between Python and Rust.
The case for Python is that I'm already very experienced in it (nearly 20 years), there's a good job market out there for it, and the ecosystem is one of the best in existence. It's like a comfortable well made jacket, maybe a tad worn in some areas but very functional. And it's not standing still, with a community that's committed to constant improvement.
Rust is more fun. I like the way it's been put together. It can also be used in more areas. There are some niches (wasm, low level, kernel) where Python just doesn't work. It has been able to benefit from the years of mistakes from Python and other languages on things like how it handles Unicode strings. I don't know it as well as Python, but I barely get a chance to work with it so that could change quickly in time.
Behold, Rust is blazingly fast in approaching the most popular language :)
Also, in comparison to Python you can do pretty much everything throughout the stack, which would be the reason I would go for Rust (not mentioning all the other niceties it has to offer).
Also learning Rust nowadays is much more approachable compared to say 7+ years back (ecosystem got way better)
All of this is very true! But it's has to stack up against the large amount of experience with Python, both personally and in the industry. I have had to make decisions on project languages with an eye towards the abilities not just of myself, but of other people on my team. Fortunately, someone who knows Rust recently transferred onto my team, so we may do a project in Rust soon.
Go. Nothing strikes a balance of ease and performance like go
Overall, I think I prefer elixir, but is probably choose go as well.
Not just ease and performance but popularity. I could be happy in only go for the rest of my life. Currently a Rust dev and I don't know if I can spend the rest of my life with lifetimes. They are an emotional challenge..
I've wanted to have an excuse to learn Elixir for a couple years now. It seems fascinating to me, but I just can't get started.
Definitely lolcode.. HAI Can Has stdio KTHXBYE :)
Go or Rust
Zig
Choosing a high-level language would limit your world so all of those are out. I could make my own high-level language if absolutely necessary from Zig but the reverse is not possible.
Zig > C as it's easier to write safer more secure code while being as fast or even faster than C, and usable in embedded and other places only C is normally used. In fact, I can create C binaries with my Zig compiler.
Zig > Rust because actually writing safe Rust code would use all my time and sanity so would end up writing unsafe Rust, but then what's the point.
Zig > Go because Go is slower, higher level, and backed by one of the most evil entities to ever exist.
If you cannot write safe Rust code, it places your ability to ever write safe code in doubt.
You could write a compiler for a low-level language in anything. Honestly makes little sense that most people do it in C++ when they're only going to replace it anyway.
Zig > Rust because actually writing safe Rust code
Start thinking more functional, I rarely have issues with the borrow-checker, or even have to write unsafe
. But it obviously depends on the context, when the issue at hand really requires a lot of interior mutability or unsafe
can be pain.
I'm also super fast nowadays with Rust, probably faster than with any other language (thanks to great tooling?).
Start thinking more functional
Sounds like good advice, thx.
DNA
Clojure. Simple language for complex things. It also has java interop and Javascript interop and c# interop. So I will be fine.
JavaScript because you can do everything with it and long term all other languages will, most likely, gradually fade away (except for C/C++).
Yeah, if I really took this question seriously, I would say JavaScript. It runs everywhere, it does everything, and it's honestly pretty fun to work with, when it's not being awful.
In 20 years we'll be able to run Javascript on microcontrollers, that will be an interesting day.
20 years? Ahahah
https://github.com/espruino/Espruino
Espruino is a JavaScript interpreter for microcontrollers. It is designed for devices with as little as 128kB Flash and 8kB RAM.
Before anyone says that an ESP32 isn't actually a microcontroller let me just point out that it doesn't really matter. A few years ago a board with an ATmega 2560, lets say an Arduino, would cost around 30€, today you can get ESP32 boards with WiFi and way better performance for 3€ making the Arduino 2560 mostly useless / not cost effective.
In just 5 years with all those new RISC and ARM chips will most like triple their performance and take over what is now done by high end AVR and PIC microcontrollers. Costs will go even further into cents and microcontrollers as we know them will become irrelevant. With the extra performance JS will become the most popular language simply because developer time is more expensive than hardware.
15 years ago I was running multi-tasking BASIC programs on a controller that had 2MB of storage. We should have been there by now.
Holy shit, they're still kicking around:
I used a few for high speed logging of a quadrature rotary encoder to measure the speed of a hydraulic sampling arm. Battery powered , had a 4 line LCD and keypad with a simple menu interface to take samples, as well as a serial export function to get .CSV files via hyperterminal.
JavaScript
Is everything alright at home mate?
👌
I'm surprised no one has picked either macro assembly on their favorite ISA or, perhaps just to screw with people, Forth.
C. I've been programming for over 30 years and it's the only language to survive. Imagine if I was asked this question 30 years ago and picked perl or Pascal, I'd be screwed today.
Big Kotlin fan.
Similar reasons to the commenter that talked about using a world class runtime, but the JVM is tested and works.
And now I can use Kotlin to make cross platform applications, while still utilizing the Java knowledge that I unfortunately possess? Perfect!
GW Basic
C