This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

2
Language for scientific computing
Post Body

Hello,

This is a long what-language-should-I-learn post, so I'll give some structure by paragraph number: 1. Personal background 2. Post inspiration 3. Python slander 4. What I want in new language 5. Languages I'm considering (so far)

I am a graduate student/researcher in mechanical engineering. My current project is completely computational modeling, but I do experimental work as well, so I have a decent basic understanding of programming and computer science (more than the other engineers I work with who also do computational modeling), but I'm far from calling myself actually knowledgeable on computer science. I have some experience in Java, Matlab, and C , but my current research project is in Python, as is most of my experience.

A few months back, I tried switching my project over to Julia, but I ran into too many issues to keep going with it. Lots of cool stuff about that language, but interfacing the complex physics with the tooling I was interested in was difficult, and the not so descriptive error messages made it extremely cumbersome and slow for me to debug. I think if I was already very experienced in programming and numerical methods beyond my undergrad course, it would have been much easier to deal with this, so it's certainly not as much of the language's fault as it is mine, but nonetheless, I have deadlines, so I switched back to python.

That being said, I'm not really a huge fan of python. It's certainly a valuable language and has its place, but here are my reasons (kind of a mini rant, feel free to skip if you don't care): 1. Easily written code is slow, and fast code is complex and unintuitive (to me). From my (limited) experience in statically typed, compiled languages, I see how the syntax and initial development can be more complicated, but for my preference, I'd prefer a language that enforces more performant data structures, paradigms, types, correctness, etc. from the beginning. That way, I'd start off with better code from the start, even if that start is a bit later. Also, optimization of scientific computing in Python relies heavily on vectorization, which is unintuitive to me, and use of C/C /Fortran libraries, which hide a lot of code and add large external dependencies, which can make unexpected code behavior difficult to pinpoint. 2. Lack of clarity of low-level behavior. I'm not a computer scientist, but I am interested in computer science beyond just being a means to get some simulation results. As such, I enjoy coding a lot more when debugging involves understanding and correcting computer logic processes directly. However, almost all of my debugging in Python feels like just interfacing libraries together that are complete mysteries to me as to what they actually do. In order to find that out, I spend hours reading jargon filled documentation and stack overflow to try and work out the inner logic. This is largely an issue because I don't know enough about what I'm doing or computer science in general, not really Python's fault inherently, but it makes it a worse tool for learning. 3. HPC compatability. I don't need HPC for my current project, and I know HPC in Python is growing significantly, but something about using python to, in reality, just call C code but a little slower in a HPC context feels wrong to me. This is a minor point for me, but I digress.

Nonetheless, I will continue to use Python for the time being, due to time constraints. However, I'd like to start learning another language on the side. Theoretically, this language could someday replace or supplement python for me in my work, but it doesn't necessarily have to. Here's what I want: 1. Lower level than Python (at least). I want to have the opportunity (and be forced) to learn more about the computer science going on in the code I write. To be fair, maybe lower level is a bad term, what I suppose I really mean is a more exposed code base, maybe memory management, stuff like that. Clearly I don't know that much about what I'm talking about, so feel free to tell me what I mean. 2. Higher performance than Python without external dependencies. Obviously I don't want to be slower than Python, and I don't want to have to rely on external code for speed. External dependencies to cover unavailable functionality is fine, I just don't want it to be integral to the language. 3. A strong future in the coming decades. I want to spend my time on something that won't be antique in 10-20 years. I'm fact, since the earliest I would possibly be using this language professionally is 2-3 years from now, and it will likely be longer if at all, I'm quite interested in newer, less mature languages (hence why I tried Julia). Many such languages don't have many, or any, existing libraries for scientific computing, and that's completely fine with me. Maybe some will come out soon, maybe I'll write my own, it would be a great project for learning. Again, I don't need any guarantee that this language will be useful for my work in the future, even if it's a hobby language I still like using the most modern versions of technologies when I can. That being said, if an old language with a strong future fits the bill otherwise, that's ok too.

Here's the languages I have in mind from my googling: 1. Rust. Seems like a ton of big advantages. Mid level, which would be great to learn more about CS. Small amount of scientific computing packages, but there is a significantly growing community for scientific computing in rust, so there could be a future there. 2. Haskell. I don't understand much about it, but functional programming seems like a really interesting paradigm, though I see very conflicting viewpoints on its suitability for scientific computing. Also a small, but growing community for scientific computing in Haskell, though smaller than Rust it seems. Still, intriguing, and I'd love to hear some opinions about it. 3. C/C . Old, but robust, and probably sticking around for a while. Not sure which of these would be better to start with, though I have some background in C . Low-mid level, tons of scientific computing libraries. 4. Fortran. Even older, about as robust when it comes to scientific computing. I see very conflicting views on whether or not there's any future for Fortran, but hey, my advisor wrote his PhD thesis in Fortran 6 years ago, so it still sees some use at least. High level though, so maybe not the best for learning about CS. 5. Julia (again). Obviously, this is a no brainer for emerging scientific computing languages. That being said, having used it, it's really easy to pick up if nothing goes wrong and difficult to debug without a solid background in CS, so I don't think it's a great platform for learning more about low level operation. I do hope to pick it back up in the future, but it's not something I feel I need to spend the next few years learning to use, and I think the knowledge transfer from learning CS on a different language would be more valuable. 6. Something else. Maybe there's something I don't know about, or something I've overlooked that would be a better fit than any of these. Let me know!

Thanks in advance for the advice!

Author
Account Strength
90%
Account Age
5 years
Verified Email
Yes
Verified Flair
No
Total Karma
815
Link Karma
620
Comment Karma
164
Profile updated: 4 days ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
2 months ago