[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 1.93 MB, 480x270, 1413568383092.gif [View same] [iqdb] [saucenao] [google]
7144650 No.7144650 [Reply] [Original]

What programming language should I be using as a math major?

>> No.7144652

R

>> No.7144654

C++

>> No.7144656

>math major
Haskell

>> No.7144657

Fortran

>> No.7144659

>>7144657

This.

>> No.7144662

>>7144657
why? isn't this shit dead yet?

>> No.7144665

Doesn't matter, just learn to program and you'll find out which one to use.

>> No.7144678

language does not matter unless you are going to do something object oriented complex programs or someshit
every language is the same, seriously, they are all the same
you know one, you know all
(not counting bullshit languages)

>> No.7144688

>>7144662
it's making a comeback because it runs really fast on supercomputers.

>> No.7144716

>>7144650
General purpose use? You can get a of utility from a nice scripting language like Python. A lower level language like C is needed for fast code, but you often don't need fast code.
Applied math? R or SAS for statistics, or Matlab + Simulink for simulation, are in your future.
Fancy pants pure research? Familiarity with a symbolic package like Mathematica or Maple can help.

>> No.7144725

CUDA or OpenCL if you want parallel processing.
Python for an all around useful language.
Mathlab for anything matrix related, R if you're into statistics.
Haskell or Scala if you enjoy the magic of functional programming.

>> No.7144772

>>7144662
>why? isn't this shit dead yet?

Fortran will never die. It's always been and always will be the fastest and highest-performance language. It has successfully fended off any challengers (Pascal, then Ada, then C, then Ruby, currently Python) for over fifty years by picking them apart and stealing anything they do faster for itself while leaving behind all the unnecessary shit CS majors love (cough, OOP, cough) because of muh design paradigms. As a result, the libraries are significantly faster and vastly more complete than any other challengers, the language is widespread, and legacy code is everywhere.

In short, they're the America of programming languages- nobody likes them and complains all the time, everybody still uses it, and it's not going anywhere anytime soon.

>> No.7144815

>>7144716
This.

Also Python integrates very will with C, you can even directly include C in Python scripts, but modern Python interpreters will compile all functions into C anyway (so for example a for loop in a function will be compiled in C, but a for loop in the main script will not).

Also.2 Python's sympy package and Sage are nice open source alternatives to Mathematica.

>> No.7144873

Scheme

>> No.7144876

<span class="math">\lambda x.f[/spoiler]

>> No.7144881

>>7144772
what's your major/job?

>> No.7144892

>>7144772
Why is FORTRAN so fast?

Would it be worth it for me to learn FORTRAN (I only know Matlab, Python and some C) or is it meant for more hard core science when you need supercomputers to simulate your model?

>> No.7144893

>>7144662
No. Very old people still use it, and then they force their younger students to use it, and on it goes. Also, most physicists can't program for shit, so it persists for that reason.

>>7146688
> it's making a comeback because it runs really fast on supercomputers.
It was never gone, really, but here's the thing. For really simple applications, where you've just got a few small vectors that you use over and over, Fortran can be compiled to something very fast because it has limited capabilities. (The same goes for C and even C++. Anyway, those are not great either.)

But as soon as you get to any level of complication, the value of Fortran falls drastically. Partly it's because it doesn't scale well to large problems. Any language with garbage collection is going to be able to do that intelligently... so I have a set of sample problems where the optimal Java solution is faster than the optimal Fortran solution (for some value of optimal... the best anyone has found). It's because of caching and pipelines and context switching and all the real stuff that happens inside modern computers.

The other reason Fortran is weak for large problems is that development is difficult. If you can bang out a program in another language in a week, but it takes you 2 months to build and verify the Fortran equivalent, then your Fortran code has to save you > 7 weeks of computing. That's a lot of cycles.

And that's assuming the Fortran code is even correct. Remember, it's hard to verify. (This is why functional languages are amazing for scientific computation.) I won't call out names, but I have discovered fatal flaws in dozens of pieces of published code from the last 50 years of physics research. Models that are completely incorrect because the common block was overwriting some variable in 1978. Promising approaches thrown out because a numerical routine didn't properly check for convergence. Stuff like that. The literature is riddled with this.

>> No.7144906

>>7144892
If you already know Python, become good at Python. Pick up a functional language at some point. I know researchers who use Haskell and swear by it. I'm actually using Ruby at the moment. It's got a LAPACK port, even. You can profile and write time-sensitive functions in C, but I have yet to find the need for this. The savings in dev time more than offset the savings in CPU cycles.

>> No.7144927

>>7144892

Computational mathematics, formerly at a lab, now as a sellout in finance.

>> No.7144934

>>7144927

Oops, should be at >>7144881.

>> No.7144937

>>7144650
Visual basic

>> No.7145202
File: 43 KB, 550x449, 66249895271.jpg [View same] [iqdb] [saucenao] [google]
7145202

math major here, computer science and programming as a hobby (inb4 computer science is math)

haskell is very mathematical in nature, but nobody uses it. i personally love it.

C is good if you want to really get to the nitty gritty side of computers and software

C++ is basically C with a bunch of confusing syntax added in for object oriented programming. it's good at a whole lot of things.

java is purely object oriented and i personally find it a pain to work with. any advanced stuff is going to require knowledge of a bunch of third party packages and a hefty IDE. though i've been told that employers look for java programmers. take this with a grain of salt.

the lisp family is great if you want to explore computer science. lisp also has a great community and /g/ has a lisp general thread up pretty much all the time.

python is a great language. it is easy to pick up, and has great advanced features for the not-so-casual user. it also has a huge userbase and lots of libraries for things like math and science. this would be my recommendation.


another set of languages worth noting are the ones more specifically designed for math and statistics related stuff, such as R, maple, and matlab
i do not have much experience in these three and can not speak for them, but i hear they're important or something

tutorialspoint has pretty good tutorials on most things, they also have this thing that lets you try languages without installing a bunch of compilers and interpreters and stuff

http://www.tutorialspoint.com/codingground.htm

>> No.7145223

>>7144657
Upboat

I work for NASA

Everything is written in FORTRAN

>> No.7145243

Everyone is wrong.
The correct answer is APL.

>> No.7145339

>>7144650
Latex, Matlab, and Maple.
C++11 as a contingency plan if academia doesn't work out.

/thread

>> No.7145342

Fortran 95

>> No.7145347

>>7145243
>APL

Dead and oh god no. Learn J if you want array programming.