[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Whats the best language to program science?
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /sci/ - Science & Math

Thread replies: 107
Thread images: 21
File: haskell.jpg (17 KB, 800x400) Image search: [Google]
haskell.jpg
17 KB, 800x400
Whats the best language to program science?
>>
>>8013731
fortran, c++, vba
>>
>>8013731
stick with python

anything else will be too advanced for physicists
>>
>>8013731
Memes
>>
>>8013731
Brainfuck.

The following prints "Hello World":

[math] \texttt{++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.} [/math]

Obviously very efficient.
>>
>>8013731
The one that lets you complete the task at hand the most efficiently*

*Note: efficiency in this case does not necessarily mean runtime, as languages for which there might be a shorter runtime could take much longer to develop in. For a program that is only being run a handful of times, a much slower runtime is acceptable if the program was developed very quickly, and also if the program is developed in such a way that it is modular and recyclable, as this affects the development time for future programs.**

**Also to be wary of are languages which support a more sinister kind of inefficiency in the form of large amounts of time being spent by the programmer engaging in online debates over the superiority of said language over other languages instead of working on the task at hand.
>>
>>8013731
Fortran and NumPy
>>
>>8013731
Just be sure to use Sleep Sort for any of your sorting needs.

The algorithm was actually invented by 4chan.

https://rosettacode.org/wiki/Sorting_algorithms/Sleep_sort
>>
File: malmerk.jpg (203 KB, 640x960) Image search: [Google]
malmerk.jpg
203 KB, 640x960
The cultural factors outweigh the ones inherent to the language, I'm afraid.
Those languages with libraries and readable code make it. There's large libraries for Fortran and C, we'll never get rid of it, not in my lifetime I'm afraid. And there's python. I currently use python at my job, btw. I'm also the guy who made the Idris thread (>>8008449) and languages like that (e.g. Haskell) don't have large libraries and are hard to learn (impossible to learn for uninterested people)

>>8013759
The guy who's making Idris is also the author of Whitespace
(a language where the code consists completely of blanks and tabs, any symbols visible to people are treated as mere comments)
https://en.wikipedia.org/wiki/Whitespace_%28programming_language%29

There's a wiki that lists the esoteric languages btw., good is also LOLCODE (code in lol-speak), Shakespeare (the code is disguised as a play), Chef (the code is disguised as cooking recipy), and the two-dimensional languages
https://esolangs.org/wiki/Main_Page

Hello world:
>Romeo, a young man with a remarkable patience.
>Juliet, a likewise young woman of remarkable grace.
>Ophelia, a remarkable woman much in dispute with Hamlet.
>Hamlet, the flatterer of Andersen Insulting A/S.
>
> Act I: Hamlet's insults and flattery.
> Scene I: The insulting of Romeo.
>[Enter Hamlet and Romeo]
>Hamlet:
>You lying stupid fatherless big smelly half-witted coward! You are as
>stupid as the difference between a handsome rich brave hero and thyself!
>Speak your mind!
>You are as brave as the sum of your fat little stuffed misused dusty
>old rotten codpiece and a beautiful fair warm peaceful sunny summer's
>day. You are as healthy as the difference between the sum of the
>sweetest reddest rose and my father and yourself! Speak your mind!
>...
and it goes on for two more pages
>>
>>8013795
Shakespeare code takes "terrible yet Turing-complete programming languages" in a new direction. I quite like it.
>>
>>8013819
the term is
https://en.wikipedia.org/wiki/Turing_tarpit
>>
>>8013795
>Malbolge programming language, named after the 8th Circle of Hell
>Designed to be the most difficult language to write in (Brainfuck is nothing compared to this)
>"Malbolge was so difficult to understand when it arrived that it took two years for the first Malbolge program to appear. Indeed, the author himself has never written a single Malbolge program. The first program was not written by a human being: it was generated by a beam search algorithm designed by Andrew Cooke and implemented in Lisp."

https://en.wikipedia.org/wiki/Malbolge#Programming_in_Malbolge

Hello world:
[math] \texttt{ (=<`#9]~6ZY32Vx/4Rs+0No-&Jk)"Fh}|Bcy?`=*z]Kw%oG4UUS0/@-ejc(:'8dc } [/math]
>>
>>8013731
C++ and meme snek
>>
R
>>
>>8013731
Math
>>
>>8013795
BASED, BASED reply. Thank you! I love all these esoteric languages.
>>
File: 1460654445869.png (93 KB, 203x345) Image search: [Google]
1460654445869.png
93 KB, 203x345
>>8013833
>>8013795

I find these 'esoteric' languages so cringeworthy.

It's like, "I don't have any innovative talent or ideas so lets make something farcically stupid instead to earn some recognition"
>>
File: Jaden_Smith_gf_Sarah.jpg (43 KB, 945x945) Image search: [Google]
Jaden_Smith_gf_Sarah.jpg
43 KB, 945x945
>>8013959
>I don't have any innovative talent or ideas so lets make something farcically stupid instead to earn some recognition
I'd argue the exact opposite is the case, but let's not argue.
Improve the world or fuck it up, or make something funny or interesting : My perspective.

The real meme is
>I climbed up a basic career ladder and now I'm a family father in the west
>>
>>8013969
Who is this cum sponge?
>>
File: afrocentrist.jpg (52 KB, 604x402) Image search: [Google]
afrocentrist.jpg
52 KB, 604x402
>>8013969
>Improve the world or fuck it up, or make something funny or interesting : My perspective.
That's a shallow philosophy.

>>8013969
>The real meme is
>>I climbed up a basic career ladder and now I'm a family father in the west
I'd argue that it's a more praiseworthy endeavour than making an 'esoteric' language so you can get a page on wikipedia.
>>
>>8013999
>I'd argue that it's a more praiseworthy endeavour
Yeah, I get that you'd argue that..

Define "shallow". (Or don't, it's pretty off topic).
It's also not my whole philosophy, obv.

>>8013994
Smiths girlfriend, see (>>8013831)
>>
>>8014009
>white gurl dating a black guy
How can whiyte men even compete?
>>
>>8013795
Is this language turing-complete? I assume it is based on what I read in their PDF document.
>>
File: 1460877692129.jpg (158 KB, 998x746) Image search: [Google]
1460877692129.jpg
158 KB, 998x746
>>8014009
In this context I mean lacking depth.

I know it's not your full philosophy, I'm just oddly irritated by people giving praise to things that are, well, shallow endeavours and futile achievements.

Then again, I'm in a depressive episode at the moment so I can't help but come off as trivial and pedantic.

On a positive note, Smiths gf is hot af
>>
File: desu.png (422 KB, 426x435) Image search: [Google]
desu.png
422 KB, 426x435
>>8014131
>this language
Which one?

brainfuck and other goofy languages are designed to be Turing complete. Latex is also Turing complete, but some dependently typed languages like Agda are not Turing complete on purpose. Turing completeness is slightly overrated imho.
>>
File: ENTSCHEIDUNGEN.jpg (2 MB, 3264x1836) Image search: [Google]
ENTSCHEIDUNGEN.jpg
2 MB, 3264x1836
>>8014177
We can take this somewhere else if you want. Or not, this thread can't give anything to OPs original question anymore anyway.

>>8014131
Another thing, Magic the Gathering is Turing complete.

And then there's
https://en.wikipedia.org/wiki/Wang_tile
>>
>>8013759

joke languages are about as funny as reddit.
>>
>>8014181
I meant to ask if the shakesphere programming language is Turing complete?
>>
>>8014192
I don't know for sure, but the point is that, given that Müller already came up with the minimalist brainfuck (together with a compiler of kB size), to get a Turing complete language, if you're lazy, you really only need to parse into it. See e.g.

http://esolangs.org/wiki/Ook!
>>
>>8013788
while ($_ = shift and @ARGV and !fork);
sleep $_;
print "$_\n";
wait;

lol
>>
>>8014278
What requirements must a language satisfy to even be Turing complete? I'm not talking about the vague notion of being able to do everything a Turing machine can do be what specifically are the minimum aspects or characteristics a language must have? If you had to guess would you say Shakespeare is Turing complete? I think the authors on the site say it is but it isn't clear if they are joking or not.
>>
>>8013731
Not Python. Literally anything else is fine.
>>
File: search.jpg (88 KB, 680x478) Image search: [Google]
search.jpg
88 KB, 680x478
>>8014310
I would guess, yes.

And you must implement the "head wandering over the tape",
where you run through ordinals and do logical if queries

https://en.wikipedia.org/wiki/%CE%9C_operator
>>
ad.
compare with pic related (brainfuck).

Heavy typed languages that are used for theorem proving (Agda) are used in a way that you don't really code practical software but instead have the formal expressions correspond to raw math and compiling is proof-checking. "Programs are compiled but never executed". Those languages are still expressive, though, but Turing completness is sometimes purposely not achieved because it extends the language by expressions you're not interested in while at the same time giving rise to non-halting / non-provable stuff. (But don't pin me down on that)
>>
>>8014341
I'm on mobile but I just found a paper that says Shakesphere is a Turing complete programming language. They used brianfuck to demonstrate it
>>
>>8014191
The idea was to create the smallest possible compiler.
>>
>>8015743
The smallest possible compiler is reality itself.

Arrange your circuits, and reality compiles it.
>>
>>8016244
>The smallest possible compiler is reality itself.
>reality compiles it.
So what is it?
Or is "it" itself our reality as such?
>>
>>8016287
>>8016244
This almost sounds like https://en.wikipedia.org/wiki/Kolmogorov_complexity

The length of the shortest computer program (in a predetermined programming language) that produces the object as output.
>>
File: program.png (289 KB, 604x1640) Image search: [Google]
program.png
289 KB, 604x1640
>>8013731
>>
>>8013731

Fortran for numbercrunching.

Sthg functional for abstract stuff / modelbuilding.
>>
A mixture of MATLAB, C, and Python.

I wish JS would supersede Python, though. It has a lot of nifty and really useful functional programming features that Python lacks.
>>
>>8014181

https://gist.github.com/ahmadsalim/11077308
>>
>>>/g/
>>
>>8014304
Then I mixed it up with Coq
>>
>>8016334
>haskell

kill yourself
>>
Matlab and C++ work.
>>
>>8016663
/g/ knows shit all about applied computation in the field of scientific research. Go shill for a board that needs it, like /wsr/.
>>
> program science

i hate you
>>
>>8013731
javascript of course
>stop wasting your time thinking about memory allocation.
>Create code that runs in every modern browser and do cloud computing over http using JSON directly at very descent speed thanks to engines like V8 or at server side thanks to node.js
>Create beautiful and useful interfaces in HTML5 that let you fast and easy share your results.
>Port all your c code to js using emscripten C/C++ compiler
>>
>>8016656
>I wish JS would supersede
it will happen my friend, there is more smart people watching the JS Potential.
>>
>inb4
>english lolxddd
>>
C for efficiency

Matlab for libraries

Julia or swift for dat sick real time compile

python for literally no reason because julia and swift exist
>>
JAVA for simple models and input-output-graph programs
C++ for Physics/Simulations
Python for Computer Sciences
>>
>>8017675
>JAVA

Fuck off and never return
>>
>>8017681
Some colleges actually require it.
Good research institutes as well.
Salk Institute for Biological Studies is an example.
Are you actually going to insult Salk?
Really?
You can fuck off and never return, actually.
>The ignorance of 4chan never ceases to amaze
>>
Which ever one is easy and suits the application you snobbish circlejerking faggots.
>>
File: R-Programming.png (541 KB, 1450x1100) Image search: [Google]
R-Programming.png
541 KB, 1450x1100
Where my niggas at
>>
>>8017683
Maybe he won't I will. Any serious computations require c++/cuda/fortran anything else you use Python. The Salk institute is filled with people who don't know how to properly code
>>
File: 1460097220922.jpg (152 KB, 640x720) Image search: [Google]
1460097220922.jpg
152 KB, 640x720
>>8018503
isn't R too specific?
>>
>>8014358
>Heavy typed languages that are used for theorem proving (Agda) are used in a way that you don't really code practical software...

You mean dependently typed languages. There is a language called Idris that is like Agda and is meant for "practical software".
>>
File: Rootlogo.png (16 KB, 458x269) Image search: [Google]
Rootlogo.png
16 KB, 458x269
>>8018537
You want specific?
>>
File: 1459712008268.jpg (30 KB, 500x333) Image search: [Google]
1459712008268.jpg
30 KB, 500x333
>>8018691
Yeah I know. Actually I made that Idris thread a few day ago. Too bad nobody wants to ride that train with me.

Even Microsoft has one or two such languages, a few places on the right of C in the alphabet:

https://en.wikipedia.org/wiki/F*_%28programming_language%29
>>
>writing science in static-typed languages

okey, just wait a minute im just gonna create 4 different 4 classes that represents datastructures that handle the various primitive datatypes, aka cancer java.

desu, any dynamic language should do, since haskel has type-signatures it is less of a mess and actually I recommend it other.
Python is fine too.

C++? Only for more advanced programs.
>>
>>8018775
Although functional programming (haskel) is beautiful, at times you just want it to flow and thus python a dynamic language that is fully turing complete with a huge library is so much more convenient. But then again, I am a comp. engineer and I don't do science.
>>
>>8013731
MATLAB
>>
>>8018787
Kek
>>
>>8018801
why?
>>
>>8018503
R is a steaming pile of shit.

t. An experienced R porogrammer
>>
File: Emma as Circe - Youth.jpg (367 KB, 1421x1536) Image search: [Google]
Emma as Circe - Youth.jpg
367 KB, 1421x1536
>>8018775
Looks like you copypasted around in your post, because it's hard to read.

Haskell is based on System F, and was of interest because it was shown you can do full and fast type inference (from the terms) with it

https://en.wikipedia.org/wiki/Hindley%E2%80%93Milner_type_system

Also, if you implement parametricity in your language

https://en.wikipedia.org/wiki/Parametricity

like Haskell does, you get a interesting bunch of "theorems for free" (doesn't have its own wikipedia entry, strangely).
Like if you say t is a generic type, and you consider the function type

t -> t

then there is only one function which exists for all t (sadly I don't have spoiler tags here), namely the identity
f(x) := x
or as lambda term
[math] \lambda x.\, x\ :\ t\to t [/math]
(Proving that a proposition t implies the proposition t.)
(If, for example, you consider t=Nat, and the function term Nat -> Nat which has functions like + associated with it, then there are of course infinitely many functions. E.g. f(x) := x+5 or f(x) := 6+3*x+x*x.)
For general t, you can write "theorem provers" (term constructors), and quiery it with
t -> t
or rather
forall t. t->t
and the compiler/interface will give you the idenity for free. You don't need to code it yourself, so to speak, because the computer understands there's only one thing you could code.
Similarly, if (t,s) is the product type of general types t and s, then there is only one function
(t,s)->(s,t)
(Proving that the proposition s & t is the same as t & s)

Haskells interface with Hidley-Milner implemented does some elegant things when you e.g. apply a generic functors operations on arrows on a list, and he does the type checking and infers you must want the List functor to be applied.
And people also like how monads, implemented once, remove so much baggage from otherwise if-clause haunted code.

https://en.wikipedia.org/wiki/System_F
>>
File: U#.png (272 KB, 790x381) Image search: [Google]
U#.png
272 KB, 790x381
>>8018837
ad.

since I've looked into Idris
(and I compare its system with the principles of Homotopy type theory as I do so),
I've also found that in Idris you can't e.g. set up an equality as binary predicate to Boolean truth values
(in the sense that "7=2+5" would evaluate to true) on the type level, there.
They forbid you e.g. to be able to define a predicate
forall t. t -> Bool
isNatQuestion(t) := (t = Nat)
because such a construction would appearently break parametricity, which they really want to keep (because Idris is looking with one eye to proper programming, not just theory proving stuff).

But, I want to add, they have an equality
= : Type -> Type -> Type
so that when you e.g. pass String and Nat, then the result
"String = Nat"
is a type, and while this isn't a bool in itself, you may not proof that String equals Nat because you can't construct a term for that type.
Maybe it's confusing what I say, I just wanted to reflect on parametricity in that system.

PS somebody already showed 2 years ago that you can't have a homotopy theoretical notion of equality in Idris ... bummer

http://cstheory.stackexchange.com/questions/27979/formalizing-homotopy-type-theory-in-idris/28013#28013
>>
>>8013731

The Queen's English.
>>
File: girl.jpg (161 KB, 1163x1300) Image search: [Google]
girl.jpg
161 KB, 1163x1300
>>8018503
>>
>>8018875
ad 2.:

And by "you may not proof" I mean it in the theorem prover sense:

= is of type
Type -> Type -> Type
and there is a term Refl defined for it, if both values are equal, e.g.
Refl : Nat = Nat

You write down
Refl : Nat = Nat
in a file and have the compiler run over it, like you'd compile C code. The compiler accepts it, meaning the deduction system approves of your claim that Nat is the same as Nat.

You may want to claim and write down
Refl : Nat = String
but now the compiler will tell you it's wrong.
You might have a function F mapping the type Nat to String, then
Refl: String = F(Nat)
would compile, because the compiler does reduction on the type level.

If you were able to implement homotopy theory, like it's possible for Agda or Coq, you'd be able to define an equality, denoty it be
==
and don't (just) have things provable with Refl,
but also if you construct pseudo-inverses/homotopies etc. etc.
It's a more structural notion of equality and the CS people are atm. wrangling to give it a more constructive interpretation, so that you can set up nice languages with it, languages that would follow an inherently structural logic.
And implementations of algebraic topology and such would be native.
>>
What are some relevant languages developed in the last 10 years?
>>
>>8020600
Go, for one.
>>
>>8013788
>tfw the original thread is dead now that /prog/ no longer exists
>>
>>8020890
Had it been stickied?
>>
>>8020950
nevermind i found a mirror http://i.imgur.com/LdgLc.jpg
>>
>>8020953
>That greeting from Reddit at the very end
Cringed.

Anyway, I'm surprised no-one in that thread found it as hilarious as it is.
>>
>>8013757
>too advanced for physicsts

go fuck yourself cs/ce faggot
>>
>>8018503
I like it. It's a functional language, install.packages() has never once fucked up on me with 0 effort, CRAN is quality and vast, shiny and rmarkdown is looking nicer, I mostly like how vectors/lists/matrices/dataframes are implemented, can call to C, fortran, and there's Rcpp. Good support for shapefiles, projections, that sort of thing.

After bouncing around languages a lot for no particular reason other than which I prefer using, I feel very R is very comfy.
>>
>>8018822
>>R is a steaming pile of shit.
R is the latex of statistics fukboi
>>
>>8013778
we have a winner

aka why I still use matlab
>>
>>8017628
python because I don't really want to learn julia and swift while I'm studying for prelims
>>
>>8018503
right here all day erry day
>>
>>8018537
depends on what you mean by specific

its main utility is certainly heavily geared to statistics research, but it also has a large suite of built-in functions and easily available packages that make data exploration and visualization a breeze

it's excel on steroids, basically, and it's a godsend for anyone who has to work with moderate-sized datasets and knows how to make flat text files
>>
It's obviously Mathematica, guys. Just look at how efficient the code is. Here's a sample:


{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
>>
I like that R is functional.

`[`(c(5,6,7), 2) # 6
>>
>>8022512
i've never seen someone actually use R primitives before, it's like seeing someone pull out a flint and steel instead of a lighter to light a cigarette
>>
>>8022531
`<-`(urmom, "gay")
>>
>>8022531
Obfuscated R Code Contest when?
>>
>>8022156
You aren't telling me anything I don't already know as I've been using R professionally for years. My opinion stands: As a language, R is a steaming pile of shit.
>>
>>8022772
Justify your shitty opinion then. As it stands, R is the best tool for statistical bioanalysis there is.
>>
>>8022779
>R is the best tool for statistical bioanalysis there is.
Perhaps, but isn't this really because of the great libraries people have written for R and not because of the half-assed attempt at a programming language in which the libraries are written? Just because a bunch of folks have been forced into using a shitty language by academia doesn't change the fact that it is a shitty language.
>>
>>8022850
>>8022779
>>8022772
you idiots aren't going to get anything done if you don't first define the features a good language should have and that R lacks
>>
>>8013731
LUA
Nothing more matters.
>>
>>8022874
That's far away from general purpose, isn't it? How can it be the best for scientific computing?
>>
assembler
>>
>>8016334
>python
bad meme, ugly syntax, everything else is fine
>>
>>8018879
qt girl
>>
File: sad_face_chocolate_bar.jpg (27 KB, 600x551) Image search: [Google]
sad_face_chocolate_bar.jpg
27 KB, 600x551
>>8023273
>tfw we'll never have Python without forced whitespace
>>
having strong opinions about whitespaces is a stupid meme
>>
>>8013757

>python

>not FORTRAN

Wrong field of science retard, physicists have a boner for fortran.
>>
>>8023308
it's not a meme
>>
Scala
Clojure
Groovy

Any of these JVM languages but never Java
>>
Is there a listing of languages by size of community/available resources when writing in it`?

>>8024106
How do those differ?
Thread replies: 107
Thread images: 21

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.