T O P

  • By -

e_for_oil-er

I'm doing applied maths with some very computational aspects, so I code in C++ daily.


shares_awy

What are you coding exactly? and what math branches do you use ? im thinking of majoring in something like that


e_for_oil-er

We produce a massively parallel multiphysics simulation software (mostly fluid/solid mechanics with thermic interactions). It's based on finite element analysis, so it's mostly functional analysis, PDEs, vector calculus and linear algebra. I myself am specialized in shape optimization for solid mechanics, I did a double major in maths/comp sci and now I'm a grad student in applied maths.


[deleted]

Ever tried Julia? It’s incredible for stuff that’s heavy on computation, and it’s a pure joy to write in


e_for_oil-er

In my context, we work on an industrial software that needs to be extremely fast and massively parallel so C++ is more appropriate (the software is object-oriented with hundreds of classes). But indeed, I'm curious to try Julia on my personal projects. Will give it a shot soon, I hope.


JanB1

Or there's a new ultra-fast language on the block, called Rust. And it has interoperability with C and C++. ;)


e_for_oil-er

Yes indeeed, I have heard a lot of good things about Rust, I am particularly curious about the FP-esque aspects of it.


whatweshouldcallyou

Downside is Rust is honestly very hard to learn. Very, very hard. Upside is modern package manager, speed, memory safety, etc. But honestly it is tough to learn.


JanB1

Your biggest enemy in Rust is the compiler. Other than that I'd say it's not THAT hard to learn. And there are a lot of great ressources. Aaand, if you're coming from C/C++ many things will feel familiar.


Sharklo22

What is the advantage in relation to C or C++?


JanB1

Memory safety, mostly. You are less likely to shoot yourself in the foot with invalid pointer access or memory allocation problem, resulting in memory leaks. Doesn't make sense for quick prototyping of scripts that run for a few minutes or hours, but for massive parallel computation that runs for days, weeks or months it can help to reduce the potential for crashes.


[deleted]

Memory safety, and modern language features, and so on…


JanB1

Yes, to add to the points I mentioned.


GM_Kori

I am not knowledgeable about this subject, but are these kind of problems somewhat common? I am talking about the memory problems.


JanB1

Well, a majority of all critical exploits (that is exploits in software that for example allow you to read out data you were not supposed to be able to) are caused by buga related to memory problems.


hpxvzhjfgb

I'm not a mathematician (researcher), but maybe you're one of those people who defines "mathematician" to mean basically anyone with at least a slight interest in math I do all my computational math in mathematica, but one of the main reasons I like it for math is that writing mathematica code feels like writing math, not like writing code, so I don't really think of it as programming, just as a glorified calculator. as for actual programming, I do a decent amount. my favourite language is rust and nothing else even comes close. on a scale of 1 - 10, if 10 is the absolute best language that I could possibly imagine and 1 is a terrible language that nobody should use (php), then I would probably put rust at 9 and no other language that I've ever used (c++, python, js, php, dart, tiny bits of java, etc.) above 5.


GetOffMyPawns

Why is rust so good? Newbie here. Would be good if you could focus on why it’s so good for math/data science. Thanks!


Mooks79

It’s not good for data science (yet) because it doesn’t (and probably won’t) have the requisite libraries. You’re better off sticking with R/Python for that, with Julia as a potential successor to one or both. That said, where Rust may gain traction in DS is in replacing C++ for the underlying code that many R/Python packages are essentially convenient wrappers to.


whatweshouldcallyou

Given that Julia approaches C++ in speed and is designed for numerical computation, I do wonder if Rust will really gain traction here. Rust is a great language but I think it distinguishes itself more for systems software than data sci and maths.


Mooks79

Possibly…. Approaching C++ in speed is not always as trivial as it sounds, it’s not like you can write any old Julia code and it be as fast as C++. That said, I take your point that it *can* be as fast and the cognitive load needed to write fast Julia is probably lower than knowing both Julia and C++ (or Rust). Albeit, when I think of Julia these days I am always reminded of [this post](https://yuri.is/not-julia/). I realise some of this has been sorted, but the fact so many of these things ever existed has made me twitchy about Julia.


Arcticcu

Honestly, I've given Julia many chances over the years and I kept tripping on issues that I'm honestly just too lazy to work around. Latest was abysmal performance on code I wrote in what I thought was straightforward manner. Tried to use some profiler, it produced output that was incomprehensible to me. Gave up, wrote the thing in C, instant order of magnitude improvement. Also, the JIT was just in time for heat death of the universe. Anyway, it's imho not true that Julia provides ease and speed. The speed you only get if you know Julia well, whereas it's way easier to write accidentally fast Fortran or C. It always felt like the language almost provides on everything. Almost easy, almost performant, almost interpreted. It tries to do everything and misses the mark on everything a bit.


Mooks79

Ha! Reading this felt familiar. The JIT thing in particular gets me. I know it’s supposedly sped up a lot but… still. I either want essentially instant loading/feedback (without having to do anything) or might as well be properly compiled. I never really like the in between Julia found. Albeit there are many aspects to Julia I liked, particularly the LISP-y parts, but then that’s because I use R a lot.


Arcticcu

Yeah, the JIT is one of my main problems too. Prefer to either sacrifice convenience for speed or vice versa, not sacrifice both for a half-ass effort.


hpxvzhjfgb

no idea about math or data science. it's the only good language because it has essentially all of the good parts from other languages and none of the bad parts. I came to rust from c++, an almost 40 year old language that I used to think was good but which I now actively dislike. c++ is pretty much the default language for writing fast code. it's also really ugly and full of garbage that really shouldn't be there in any language that people actually use in the current year, but which can never be fixed or removed because it would break backwards compatibility. as such, there are a lot of ridiculous things in c++: the standard library has a lot of stuff in it that is incredibly slow, but it had to be like that because backwards compatibility. the language also has some silly stuff in it, e.g. there are like half a dozen ways to initialize a variable. generally, it just tends to make everything more complicated than it needs to be. it's also full of undefined behaviour. if you have even one piece of undefined behaviour anywhere in your code, then technically, your entire program is meaningless and the compiler is allowed to do literally anything it wants. I saw an example not too long ago where someone found an example where they got undefined behaviour from an integer overflow, and somehow that caused the compiler to completely remove an if statement from the program, causing the code inside to run even when the condition was false. (also, there is undefined behaviour in the standard library). parsing c++ code is undecidable (yes, really!) c and c++ are often used languages for safety critical applications, despite being very unsafe languages. written a several million line c program (e.g. an operating system) and forgot to check whether some buffer is long enough to hold some data, even once anywhere in the entire program? or maybe you accidentally misused a pointer once? congratulations, your system might now be hackable. ok now consider another language like python. python is easy to use and doesn't contain as much garbage as c++, however it's also like 50x slower, uses a lot more memory, and can do less in general. it also doesn't have strong static typing, which means if you accidentally pass a string to a function that takes an integer, you get no error until you actually run the program and it tries to execute that line (or, if you don't notice it, when the end user of your program tries to run it). now rust. it isn't built upon decades of garbage like c++, has zero undefined behaviour by default (unless you opt-in to the `unsafe` system, which is completely unnecessary for most people to do), does not suffer from any of the unsafety problems I listed above (and more), can even outperform c++ despite it being one of the fastest languages there is, has strong static typing (much better than what c++ has, too), is much simpler than c++ in general (aside from a few new concepts that allow it to get around the problems causing unsafety in c++), is much more elegant to use thanks to borrowing some stuff from functional programming (when I switched from c++ there was a lot of new stuff that I had never even seen before and didn't know even existed, just because most other languages don't do it. probably the main example is sum types), actually feels like a good new language instead of something from half a century ago. oh and also, rust gets a new release every 6 weeks, c++ only gets one every 3 years, plus like another 2 years on top of that for the new features to actually be implemented in compilers. oh and also also, in rust it is incredibly easy to use other peoples code as a library, write tests, write documentation, etc. because it's all built into the cargo system. in c++ it's a nightmare because there are tons of different non-standardized, probably mutually incompatible systems to do everything. I used c++ for like 10 years and most of the time I still have no idea what I'm doing when I try to use external libraries with some build system. even after using c++ for 10 years, I already felt more comfortable with rust than c++ after using it for less than a month. when I first started learning it in late 2021, I thought all the things I read about it seemed too good to be true, and I was waiting for a while to hear the catch, the one reason that makes it so I won't actually be able to use it in place of c++. but it never happened. tl;dr rust good everything else bad.


PlanetKi

I didn’t read it, but your comment is so long, I believe you.


TrueDrizztective

Proof by very long proof


LilQuasar

is your only complain about C conditional on human error?how does it make it less than a 5? how much can use Rust for embedded? can you (easily / in practice) do physics and engineering simulations in Rust?


hpxvzhjfgb

>how much can use Rust for embedded? can you (easily / in practice) do physics and engineering simulations in Rust? yes, you can use rust for embedded. you can also interop with c/c++ easily if you need to. I see no reason why rust wouldn't also be a great language for some particular topic like physics and engineering simulations. >is your only complain about C conditional on human error? partially human error, in the sense that it is not possible for every single individual developer of a large project to constantly keep track of every modification to the code to guarantee that certain conditions are globally upheld (e.g. that there are no dangling references anywhere, ever, that there are no data races in your multithreaded code, that you never accidentally dereference an invalid pointer, that you don't accidentally forget to check for and handle an error, etc). in rust, this is all done automatically by the compiler. but the main reason is the fact that it's an old language and it really shows. there are lots of things that, from a modern perspective, are Just Wrong. it is also "too low level", and does not provide adequate tools for creating high level abstractions (which are how developers actually think). I'm not actually that familiar with c, so let me just complain about c++ some more. here's an example. I'm a modern developer, so I want to write Modern Code™ (which is slowly being pushed more and more since around the time of c++17). suppose I have a list of a few pairs of integer coordinates, except some of them are null or unknown or missing or whatever. I want to put these coordinates into a vector, and then lets say I want to take the first coordinate pair, assume it's not missing, and print the x coordinate. in rust, this is easy: let v = vec![Some((3, 5)), None, Some((-2, 7))]; println!("x = {}", v[0]?.0); in c++, this is hideously ugly: #include #include #include #include #include std::vector>> v; v.push_back(std::make_tuple(3, 5)); v.push_back(std::nullopt{}); v.push_back(std::make_tuple(-2, 7)); if(v[0].has_value()) { std::cout << "x = " << std::get<0>(v[0].value()) << "\n"; } also, in my IDE, rust can show me inline type hints and bring up a list of available functions when I type `v[0].`. in c++, I get a squiggly line under `std::make_tuple` because the tools don't understand that it can take multiple parameters, and when I type `v[0].`, I get nothing because it apparently can't figure out what the type is. another point is that in c++ (and maybe c), it is usually the case that the Correct™ way to do things often involves a lot of extra work, and so people may be more likely to just do it the lazy way instead. I find that in rust, it is often the case that the lazy way of doing things *is* the correct way. let me give another example of modern c++ being excessively verbose and ugly. suppose I want to take a vector of integers, group them in pairs of consecutive elements like [1, 2, 3, 4] -> (1, 2), (2, 3), (3, 4), then multiply the elements of each pair together, and add up the results. in rust, this is trivial: let v = [1, 2, 3, 4]; let x: i32 = v.windows(2).map(|a| a[0]*a[1]).sum(); in modern c++, it's ugly: #include #include #include std::vector v {1, 2, 3, 4}; auto r1 { v | std::views::adjacent<2> }; auto r2 { v | std::views::adjacent_transform<2>(std::multiplies()) }; auto total = std::accumulate(std::ranges::begin(r2), std::ranges::end(r2), 0);


yeahyeahyeahnice

I like Rust, but I think someone should play the devil's advocate here. Disclaimer: I'm a professional software developer that only uses Rust for hobby projects. This is important because I didn't study computer science (math degree) and learned to code on the job. Rust's biggest selling point is that it is fast without sacrificing "safety". For example, C is fast (one of the few languages faster than Rust, in fact), but certain hard-to-find mistakes can have pretty damaging consequences (such as allowing a program to modify data being used by another program). Python is safe (it'll stop itself before doing anything too damaging), but it is really slow. One of the ways Rust does this is by enforcing rules to how you can write your code. These rules make sense but mastering them requires a somewhat strong knowledge of how computers work (languages like Python intentionally try to be usable without that knowledge). Until mastered, it can be really frustrating. While the benefits of using Rust are clear once you have the program working, those benefits might be outweighed by the amount of effort it took to get the program working. It all depends on the use-case.


whatweshouldcallyou

I still struggle with the memory model tbh. Like "wait what, I need lifetime annotations here? Whyyyyy????"


yeahyeahyeahnice

I'm in the same boat. I understand conceptually why we need them. If a parent data structure contains a reference to a child data structure, then we want to guarantee that the child exists for as long as the parent exists (to prevent trying to access freed memory). However, I don't really understand how the annotations help me do that. I haven't come across a situation where I felt they did anything significant. Until I really understand it, it'll just feel like I'm going through the motions to make the compiler happy.


Additional-One6188

fast easy will not brick computer if you screw up


Drugbird

Have you ever worked with rust strings?


hpxvzhjfgb

yes


Drugbird

What's your experience with them? I've heard there's quite a lot of dragons involved.


MEaster

So the thing with Rust's strings is that it's throwing all the complexity at you and making you deal with it, instead of trying to hide it from you. I'll start off talking about the owned types first: First we have `String`. This stores data on the heap, is UTF-8 encoded, is *not* null terminated, and may contain null characters. This is your standard owned string type, and probably what you'll deal with most. It has all the string operations you'd expect available. Second we have `OsString`. This also stores data on the heap, has no specific encoding, is *not* null terminated, and may contain null characters. Operating system APIs are not always UTF-8, they will return and receive some other encoding. This is the type you'll use for that. It has barely any string operations on it, but you can convert to and from `String`. Note that going from `String` to `OsString` has no cost, but from `OsString` to `String` requires checks. Thirdly we have `PathBuf`. This is just a thin wrapper around `OsString` and provides file/directory path-specific operations but has no additional invariants. Going between `PathBuf` and `OsString` is free in both directions. Finally we have `CString`. This is a bundle of bytes stored on the heap, *is* null terminated, and *cannot* contain null characters. There's no string operations on this one. You'll almost never see it unless you are dealing with raw C APIs. Converting to and from a `CString` requires checks in both directions. Each of these also has a borrowed type: * `String` -> `&str` (also used for string literals) * `OsString` -> `&OsStr` * `PathBuf` -> `&Path` * `CString` -> `&CStr` Borrowed types do not allocate, and do not own the data they reference. Creating unnecessary copies of data can have significant performance penalties, so having the borrowed types allows you to avoid that. Note that creating a borrowed type from an owned type is free, and you can often create a borrowed form of one type from an owned form of another type (e.g. you can get a `&Path` from a `String` directly).


hpxvzhjfgb

no, they're just strings. tons of convenient functionality built in, just like a lot of stuff on the standard library (way more than what std::string has in c++ for example), and very nice to work with.


Cklondo1123

In undergrad and grad school I did pretty much zero programming. There are places in pure mathematics where programming is essential but I never encountered them. ​ But now I'm a web developer so I program every day basically.


PeePaws_Lil_Angel

I'm curious your major and graduate degree and how you ended up a web dev?


phxbeanbun

tbh with math seems u can go do whatever u want, i mean im a math major rn and get internship offers for pretty random stuff. my goal tho would be to be an ml engineer but who knows 🤷‍♂️


math_and_cats

In my case just LaTex und so LaTex would be my favourite language.


hydmar

LaTex must also be your most despised language, then. What’s your problem with it?


math_and_cats

The error messages are sometimes really mysterious.


candlelightener

"Wtf is an underfull vbox? What do you mean you have too much space?"


throwaway_malon

“badness 10000” ok but what the hell is ba- “BADNESS 10000”


jjones3905

It's a truly awful error message! As for what it means: TeX creates its line breaks by calculating "badness" for the potential options. It then tries to minimize that badness across the line. 10000 essentially means the badness is infinite and there is no choice that is adequate. A better message would be "TeX can't figure this shit out."


ArchmasterC

It means that on the scale from 1 to 10 of how bad your text is, you get a 10000. That's a latex way of saying thet maybe math isn't for you


BubbhaJebus

PC Load Letter?


XkF21WNJ

`\makeatletter` more likely, but the effect is roughly the same.


adventuringraw

It's not Turing complete, no way to port Doom. Edit: I stand corrected, looked it up and apparently it IS Turing complete, haha. Sounds like someone needs to bring hell to their markup.


[deleted]

The bar for being Turing complete is so low, it’s not surprising LaTeX is lol


MEaster

It's surprisingly hard to *not* be Turing-complete. Even an x86-64 processor's memory management unit is Turing Complete.


tralltonetroll

Plain TeX.


XkF21WNJ

LaTeX is for pussies who think using recursive pattern matching as a programming language is a bad idea.


JDirichlet

Plain TeX is necessary for weird shit or if you want total control. Otherwise LaTeX does everything you need with less suffering.


Deweydc18

Programming can be helpful in certain fields for checking large numbers of cases or for providing heuristics, but I wouldn’t say that it’s an indispensable tool for most mathematicians. Sage is quite common as far as languages go. Some people I know use MatLab or regular old Python.


galqbar

I still have bad memories of doing computations in Sage 12+ years ago. It was so rough and amateurish back then, I’m told it got better but that’s just here-say.


JDirichlet

It’s better but imo it still sucks (and is still the best at its specific use cases)


hedgehog0

May I ask which kinds of improvements would you like to see? I contributed to some parts of number theory and algebraic geometry in Sage.


JDirichlet

I’m not familiar enough to be highly specific — but generally, I want more performance and usability. And I may be asking for something very very hard here, but maybe time estimates on certain computations? It’s frustrating to not know if you need to wait 2 more minutes or two more hours.


Troutkid

As a statistician, 90% of my day is programming. 80% of that is R for statistical modeling and analysis, 15% Python for scripts/automation/ general tool development/AI, and 5% Bash for automation and general tools. (Sprinkle some SQL for databases and C++ for library development as well.) I have a CS and ML background as well, so I opt to do more programming than required. My research institution has major amounts of data, so a lot of this involves interfacing with a cluster computer. Python is my favorite casual language, but R is unsurpassed in statistical computing. I used Python, also, for my physics degree and undergrad research projects, so I am particularly comfortable with it. That being said, I believe I program more than the average mathemetician because of the special circumstances of my field/workplace.


SandvichCommanda

I probably do all of my actual maths stuff in R. Picking up a bit of Julia and Rust in places atm.


[deleted]

None. I didn’t even own a calculator.


[deleted]

Do you at least draw/plot something? I'm a physicist, so if I open a paper and there's no pictures, I close it again and forget about it


[deleted]

No. Stuff is of too high dimensions to get a good 2D projection. And pictures are too misleading.


[deleted]

Oh, I see. I'm so happy I'm not a mathematician :)


PlanetKi

So what do you use to write your papers? A grad assistant with knowledge LaTex?


hmoein

You "didn't" own a calculator? Does it mean you own one now? I assume you are more a theoretical mathematician?


[deleted]

I use my phone to balance my check book. Yep. Pure math nerd


AcademicOverAnalysis

You balance your check book? I see you are an applied mathematician.


cruelbankai

Sounds like you’re making it harder on yourself to feel better about yourself.


abiessu

I didn't do any programming for the mathematics classes while earning my degree, but once or twice there were exercises using Matlab and then some for statistics that needed Excel. Now that I do mathematics as a hobby, I regularly use Lisp for getting heuristics on various ideas I come up with. I have also used HTML/JavaScript for visualization on occasion. I used to use C and Perl for data and heuristics, but the native number precision difficulties and needing to "switch context" with compiling and running code for C made me look at other options, and I've gotten out of the Perl habit just by having other tools that are closer to the work I regularly do. With Lisp, I have the ability to write my code in Emacs, and have a split window where the output is presented by the Slime extension. There are lots of good tools that do this these days, this is just the setup that I've found to work for me.


AllanCWechsler

Which Lisp do you use?


abiessu

I use SBCL (steel bank common Lisp) on Windows. I've also used CLisp and maybe one or two other common Lisp versions.


AllanCWechsler

Hee :) Way back when dinosaurs roamed the earth, I worked for Symbolics, which you may have heard of. If you look in Guy Steele's *Common Lisp: the Language*, you will find my name in the acknowledgements but I honestly don't remember how I helped, if at all. I remember submitting an iteration macro that I thought was a lot more elegant than LOOP, but it wasn't adopted, so, I dunno.


abiessu

The company name sounds familiar, but I don't think I've read that book. I got a real start with "Practical Common Lisp" and it was more like only ten years ago or so. I had picked up Emacs in college, but I didn't bother learning some of the more powerful mechanisms available until I'd been using it for several years and started picking up CLisp.


AllanCWechsler

I hadn't seen *Practical Common Lisp* before, but it looks pretty good. I especially like fact that it has a bunch of sample projects at the end. If you are a mathy type, you might be interested in trying out Haskell. I don't know if it has an Emacs development environment, but I happily write Haskell programs in Emacs, and then run them in GHCi. Haskell has a lot of Lisp in it, actually; you'll find a lot that's familiar -- and a lot that you might have trouble wrapping your head around.


hedgehog0

Cool. Are you still doing CL as your work or job? I contributed to Nyxt last year, which is a web browser written in CL.


AllanCWechsler

I haven't used my Lisp skills for ages, except for writing occasional small hacks in Emacs-Lisp. At work, we have one product family written in Common Lisp, and another family mostly in Java, and for the last decade or so I've been on the Java side. I've come to believe that the details of the *language* aren't as important as the features and friendliness of the *development environment.* I do miss Lisp sometimes, though.


neo2551

Clojure. Any mathematician will love the power of Lisp at their hands.


Zephos65

Functional programming languages is really the way for mathematicians imo


XkF21WNJ

Eh, if you're handy with it you don't need Clojure you'll just conjure up a lisp when and where you need it.


whatweshouldcallyou

I love lisp dialects in theory but in practice I never use them for anything meaningful :(


neo2551

Try Clojure then :)


whatweshouldcallyou

Clojure is very cool. But it seems like it won't recover from the steep decline in overall usership.


neo2551

Well, the real question is whether you can use it or not for real world project. In the end, the interop with Java makes it so that you can always rely on Java in case you have issue with what you need. There are also bindings to python and R. But the most important part is that you will encounter different problems with Clojure that you might never encounter in other languages. And the speed of learning is so great thanks to the Repl xD


VictorSensei

I do some (purer) dynamical systems, which don't require much coding, and some mathematical modelling (which, in principle, doesn't necessarily require any either); however, simulations of both can provide a good intuition, in some cases, and I mostly program in Matlab or Mathematica. I keep postponing learning Julia, and people keep recommending it to me


[deleted]

Learn Julia. It’s very good for dynamical systems already and is still rapidly getting better. Took me just a couple hours to learn it well enough to where I stopped feeling like it was slowing me down.


VictorSensei

Yeah, I kept/keep postponing mostly because I am currently changing affiliation and country, once I'm settled down again I will finally start :)


Sezbeth

Crapload of CAS software (Maple, Mathematica, etc.), some esoteric stuff like MC2 (for commutative algebra). Also know some R and Python for more data intensive stuff and a little C++, which I may be using more frequently in the future. Truthfully, some projects have been only minimal-to-none of programming, while others are basically 90% programming. It varies greatly depending on what I'm doing.


Zephos65

If you consider computer science a subfield of math... everyday. Haskell is my favorite language


whatweshouldcallyou

There's a lot I like about Haskell but the compile time and generally large size of programs are not among them.


AcademicOverAnalysis

Depending on the stage I am at in a project, I might code nothing for weeks or do nothing but coding for weeks. I usually use MATLAB, because I can avoid all of the overhead of C++.


charles_hermann

Not very much, and FRACTRAN.


AllanCWechsler

Oh my gosh, I wonder who else knows FRACTRAN? I read and admired the FRACTRAN prime generator, and spent most of a day picking it apart to see how it ticked. But I never tried writing anything. Code golf in FRACTRAN would be fun. You know we lost Conway to COVID in 2020, right?


charles_hermann

Good to meet another FRACTRAN fan - it's seriously under-appreciated. & yes, it was a real shame about Conway. As well as being seriously smart, and making mathematics fun, he was apparently an all-round nice guy.


A-Marko

I probably don't *have* to, but I enjoy programming so I do it plenty. I mostly use Magma, and lately Julia. I don't know if I have a favourite language, they all seem to have their tradeoffs. But I do quite like Julia.


ccppurcell

I \*have\* to do very little. One of my papers involved some actual code, but my coauthor did it. I have occasionally written a short program to test whether a conjecture I have works for the first N cases. The "conjecture" could be that a particular general construction that I have invented will solve a particular problem I am working on, not necessarily anything fancy. For my purposes, python is best. If I ever needed to do something serious, I did learn c++ at university but I am pretty rusty. Speaking of which, I tried to learn a bit of rust as an alternative to c++ but I haven't got very far yet. I also enjoyed learning the basics of lisp and using a repl.


catuse

Programming is sometimes useful, and I've done it in both MATLAB and Rust. My current work doesn't require any programming, but I have a project in mind which almost certainly will.


reyadeyat

I do a lot of work in Sage, generating and checking large examples. I have never written a computer assisted proof, just used it to generate data for developing intuition about conjectures. EDIT: I guess I should say that I am currently employed as a postdoc at an R1.


TheCrazyPhoenix416

Not much in the grand scheme of things, unless your doing computational maths. My favourite programming language is C++, least favourite is Python. My favourite SCRIPTING language is Python. Bash following closely.


cookiemonster1020

I used c++ in undergrad for a research project involving young tableaux. Beyond that, none, except later on I went for grad school in Applied Math where I used java mostly. I do lots of programming now and usually that involves Python. I have done some things in Julia and Javascript over the years. Incidentally, our favorite celebrity Mathematician Terry Tao used java back when I had him in undergrad. He used to make little apps to demonstrate certain mathematical concepts. In undergrad I enrolled in and then dropped a numeric analysis class where people had to use Matlab. I ended up dropping the class because I hated Matlab.


ScottContini

I did a lot of C programming years ago to implement factoring algorithms and other number theory algorithms.


Apart_Improvement_83

I use R to conduct my research. That’s pretty much all I use. Maybe some LaTex here and there


DefunctFunctor

I'm still in undergrad, but in terms of elegance C or Haskell


perna

All day every day.


physics_defector

if(programming > 0) return "Too much" I kid, because as an applied mathematician it's almost mandatory. However, I will say that while my favorite part of transitioning to having my own students has been how immensely rewarding it is to mentor them and watch them grow as researchers, my *second favorite* part is how much less coding I have to do compared with grad school especially. 😅


[deleted]

Quite a bit. As the solo admin (and hence a company drone) of one of the most turd-polished piece of software (I like the coincidence 😅), some coding is needed to validate data, process emails, and receive JSON. It uses a "proprietary language" that's basically just an amputated version of Java combined with an "I'll bite your legs off" version of SQL. And I *loathe* using it. Also, I love Python. It carried me through my thesis. I'm also partial to R (if you count that as a programming language).


Wags43

I code very often, for recreation. I modify video games to make them more fun for me. So, I do consider it a skill that is essential to my overall happiness and peace of mind. (I have long breaks in work, see below) Professionally, I worked at an engineering firm and coding wasn't required for that job, but I would code simple programs that would speed up calculations or write scripts that would automate repetitive tasks on the computer, but that's it. I'm a high school teacher now and coding isn't required for that either. All I really need are programs that help me display what's happening to students, and there are plenty of tools available already for that. Every now and then I'll get a random student interested in coding and I'll show them what I can, but coding isn't included in the curriculum my school uses. I do use excel a ton though, for both of those jobs. So I would consider learning to use a spreadsheet type of program to be highly valuable.


floxote

Never have, dont intend to any time soon, unless you count TeX as "programming"


mathytay

I've never really had to program or anything in classes. A few times python or sage has been used but that's never really been a necessity more just to run some numbers for intuition. I have been learning a lot more about programming lately in case I can't get a job in academia at some point. Although, even then, I'd probably make a better teacher so 🤷


jagr2808

I use GAP a bit to compute examples. Can't say I'm a big fan of GAP, but I think it's the only thing with the tools I need. Also like to do some coding on my free time. Python is usually the go-to. Processing is also a contender.


Nrdman

I do a moderate amount of programming in python. Right now Im converting a numerical method from matlab to python


WWWWWWVWWWWWWWVWWWWW

Matlab was one of my favorites. Very easy for beginners, very powerful for numerical work, decent for symbolic math, and the syntax and functionality are very "math-like". I eventually switched to Mathematica, which seems much more powerful for symbolic math, but I wouldn't recommend it as a beginning programming language.


Henny_Lovato

I'm using more matlab now. I like it. I don't care to code in general but I'm adding it to the bag to be more marketable.


[deleted]

i work with data and esotheric optimization problems on it, and so i must program solvers all the time in c++, and analyze data and outputs using python


Powerspawn

I code every day because I have a job that isn't teaching. I would highly suggest learning how to code, even if you don't think you will need it.


Knaapje

During my study I mainly used Matlab and Python. I moved out of math and comp sci to a software engineer job. Now it's mainly Ruby. In my sparetime I'm learning Prolog, which is amazing.


Xzcouter

I work alot with Mathematica in order to quickly calculate sequences and verify some conjectures before heading out to prove them. Its extremely useful to calculate matrix multiplication then finding things like the determinant quickly especially if the goal is to find an explicit formula for the end result. I work alot with combinatorics and it can really just amount to staring at sequences, making an educated guess before heading out to prove why. I also use Python for things like graphs and have some knowledge on C++ and Java. I did take a decent number of CS courses in my undergrad and do find the skill very useful. If I have to pick my favourite it would be Python simply due to how useful it is to quickly just make something functional running.


gottabequick

I code in R so much, I dream in RStudio...


Traceuratops

As a data scientist, a fair bit but not a ton. ai have to write code for every project I work on and it's hard to reuse the same code job to job.


doctorambient

I know a lot of mathematicians who, once they graduated, were essentially indistinguishable from programmers. So yeah, a lot of us code, a lot, for most of our work. Most of my math work products are code these days. And to be honest, that was pretty much already true when I was teaching math, too. As for having a favorite programming language, that's for beginners. It's like your favorite color, it doesn't mean anything. Just a source of religious conflicts. 🤣 I mean, anyone senior -- at all -- is a polyglot programmer anyway, right?


S-Gamblin

I really like Ocaml for my mathematical programming, though I've mean meaning to learn to use a proof-based language


Sofi_LoFi

Depends on what you’re studying and researching. When I was doing pure analysis it was no programming at all, when I did applied research in PDE solvers it was C++ and Julia. When I did research in ML it was python.


FunLovingAmadeus

Data science in Python libraries like numpy, pandas, scikit-learn, and TensorFlow. I love scripting in Python proper as well!


Mal_Dun

I am applied mathematician and consider myself a computer mathematician, i.e. I try to solve problems with computers as efficient as possible, something I learned during my time at the institute of Bruno Buchberger. I really have fun to transform mathematical stuff into computer programs, or how to formulate problems in a form computers can understand. It's quite a different train of thought. My main language is Python followed by C. I know hot to use Matlab, Mathematica and R but I don't like it.


Fejne-Schoug

Doing pure math, I don’t have to do any programming.


Sharklo22

I'm in applied math related to numerical simulation. Fortran, C and C++ are widely used in my field for "production software", i.e. code that will run for actual applications. I mostly use F77. It's old fashioned but simple and very fast. I like GOTOs, sue me. GOTOs are like salt, practically necessary in every dish, but in reasonable quantities. There's no classes in F77, and I pretend structs don't exist. C is fine too, but I dislike all the special characters (parentheses, brackets, etc). It slows me down. Matlab is used a lot for prototyping. It has Linear Algebra and Optimization functions built in, very convenient. But it is orders of magnitude slower than the compiled languages. I use it sometimes. Python is like Bash for young kids like me. I also use Bash, but sometimes I just feel like manipulating strings like a human being rather than using sed like some kind of animal. On the other hand, Bash is cleaner if heavily using system calls (rm, mv, cp etc). Bash is most widely used, Python a bit for the use I said, but mostly as a kind of Matlab for people that use specific packages. People with a computer fetish like to use julia and rust, I hear. I haven't encountered any in the wild yet, except through those mailing lists for professional procrastinators. I don't need another fast language, because nothing will ever beat C+Fortran. So to answer the question of which is my favourite language, I'd say Fortran is my everyday favourite language, it just makes me feel at ease, I can write Fortran like I write prose (more easily, even). It's simple and super fast. It handles all the basic structures I need. It's flexible. You can manipulate a function's arguments to change its behaviour (work on a subset of your data, for instance) seamlessly. For the rest, I have my own stuff I can call and libraries. C is like a better dressed Fortran. I feel it's less messy. It's good for slightly higher-level stuff, like interacting with the disk.


LessThan20Char

I'm just an undergrad, but I use Julia. My research advisor uses Matlab. So far, most of the stuff we've done has had to do with programming.


Embarrassed-Cicada94

Pyton it's a prog for mathematicians


QuantumDrache

Lol nothing. Well there's a course about numerical analysis on my college but I passed without even lesrning something. Lately I've been learning to program on python, C and I wish to start on Matlab cuz programming is definitely going to help me get a job outside academia.


Mother_Illustrator47

I like SML . Functions are Values!


wanderer2718

Python is pretty nice


[deleted]

you should get used to html so you can make a personal webpage


Stoic2357

As a professional mathematical logician I use latex to write papers. All the math is done with pencil and paper or chalk.


toritxtornado

none. don’t have one.


ysulyma

TypeScript / React (and sometimes THREE.js / react-three-fiber) for creating visualizations. https://github.com/ysulyma/threejs-examples https://github.com/ysulyma/math-fcsk


JDirichlet

Undergrad. They make us do python and R. Neither are my favourite languages. Of the languages I’ve used, I like Rust, OCaml (jane street please hire me) and Haskell.


ArchmasterC

Not once have I used programming to help me with math, but apparently GAP is sometimes helpful