[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
So help me sort this out Why are we still sticking to the 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: 41
Thread images: 3
File: 1466163810609.jpg (15 KB, 245x346) Image search: [Google]
1466163810609.jpg
15 KB, 245x346
So help me sort this out
Why are we still sticking to the science meme?
Who cares about the arbitrary and tedious scientific method?
Why are we wasting time with observations and guesswork when we should instead only focus on what we can rigorously derive using pure logic and pure mathematics?

Maybe it's just my math background talking, but who cares about experimentation? It doesn't prove anything. The next experiment can have results that completely invalidate all the previous ones. Why waste time and money on that instead of proving things for real?
It's not like we can honestly say that experimentation can make predictions that are actually solid enough to depend on completely.
>>
>>8148044
Shitty bait.
>>
>>8148044
Math guy too here but you are just retarded. Good luck proving a new medicine works with just mathematics.
>>
>>8148044
>literally providing a picture of a language that has undefined behaviour
>>
>>8148050
No necessarily mathematics. Most chemistry is understood through math (either directly or through physics). Being able to explain every mechanism with 100% accuracy proves the medicine works. Chances are, the medicine you've created isn't the exception to any physical "laws", and uses well established chemistry, most of which has been mathematically modelled and understood
>>
>>8148048
Not bait
>>8148052
>Not understanding c++
Not gonna make it brah
>>
>>8148059
I do understand c++, and it's my language of choice as an engineer. But if you have to pick a language for scientific computation, it's not it
>>
>>8148055
But the process of making a new drug involves a whole bunch of experimentation. Literally decades of experimentation.

Labs will have like 50 versions of the same molecule, all with minimal differences like extra hydrogens and shit.

How do you think they determine which can actually cure a diseases? They experiment, a whole fuck ton.

Then when they have the ones that cure the disease how do you think they choose the one that does not also kill the person and has the least side effects? They do a bunch of experiments again.

The role mathematics plays in this process if mathematical modelling at the beginning and then statistics at the end to keep track of which test subject has what side effect from which molecule.

Maybe you are right and we understand all of chemistry (we don't, there are o-chem mechanisms that are not understood yet and if we had a mathematical model of reactions then we would know every mechanism) but even then we need experiments.

>>8148052
>undefined behaviour

Don't dare to attack my main man over there, C++. What undefined behaviour?
>>
>>8148063
I wouldn't use it for scientific computation, yet people have for decades, so...
>>
>>8148065
https://en.m.wikipedia.org/wiki/Undefined_behavior
>>
>>8148066
People have used pen and paper to calculate planets orbits, would you still do that?
>>
>>8148068
Fair enough but they all seem so stupid.
Division by zero? When would you even do that?

I am currently working on something that tends to want to divide by zero very often but I just bury the entire algorithm in a chest of if statements that check that no relevant variable is equal to zero.

The more sensible ones like the one with the pointer are still pretty retarded. Like:

int arr[4] = {0, 1, 2, 3};
int *p = arr + 5;

Who would declare an array of size 4 and then go past the domain of that array?
>>
>>8148069
I meant to imply that they still do. It's not hard to find modern scientific computation software written in C++, unfortunately the example I had in mind turns out to be written in C and Fortran: https://arxiv.org/abs/1604.06071

And I did say that I personally wouldn't do so. I wouldn't use C++ for engineering nowadays either. I'm quite fond of Rust and looking forward to seeing it grow.
>>
>>8148072
Undefined behavior is actually a feature, because it allows to do all sort of shenanigans when writing the os of a machine. C and c++ do not try to fix your errors, they just assume you are expert enough that you know what you are doing. But that does not provide some matemagical features, it's just necessarily when you want to have total control over your ram. That is way there are better alternatives than c++ if your issue is not speed or communicating with hardware directly.

Anyway, undefined behavior is actually everywhere all over the language, the standard library is full of then, and if you have to document your product you have to be sure that every function you use does not cause undefined behavior under some inputs.

One of the worst one (if you don't know ) is that the keyword this does not exist inside constructors, but using it is undefined behavior instead of compile error
>>
>>8148072
>int arr[4] = {0, 1, 2, 3};
>int *p = arr + 5;

Replying to myself here. This shit isn't undefined. I ran this code several times:

int arr[] = {0, 1, 2, 3};
int *p = arr + 5;
std::cout << *p;

The output is always 1958376541

This is not undefined. This is working as intented. I am dereferencing a pointer to see what is in there and it always finds the same thing. This implies that another program in the past had this pointer and stored that number in there and now that program was closed and had all of its memory freed.

This is exactly what the books will tell you when they talk about what will happen if you abuse pointers. You just get random data from past programs.
>>
>>8148079
Yes, but because who wrote the compiler decide so, it's not in the standard. there is no guarantee that will do the same in every environment and in every compiler
>>
>>8148083
>there is no guarantee that will do the same in every environment and in every compiler

But what else would it do? It would always look at what is stored in that pointer. Sometimes it would find different things and maybe something that it finds will cause your program to crash but it is still doing what is intended to do.

This is not undefined behaviour for the compiler. The compiler knows exactly what to do. This will only be 'undefined' after execution because you cannot guarantee that what you will find will be safe for your program.

That said, I think that the compiler here should just crash the program immediately, like every other language does.

My memory is blurry but I think this was what caused the heartbleed bug. Bad programmers are to blame though.
>>
>>8148084
As I said in
>>8148076
If you know what you are doing it's a feature, else it's clearly not. If that feature was removed there would just be another language that has it that would become the low level standard programming language.

Clearly your particular example will do that in every environment, but other undefined behaviors are not so obvious
>>
>>8148065
I'm not debating how it's done right now, I know there's a ton of experimentation, but that's due to the nature of the tools we've developed. If our mathematical models aren't up to spec yet, why not work to improve them instead of taking the easy way out and looking for experimental evidence? Wouldn't working on the actual proofs and studying the mechanisms themselves with a little more enthusiasm improve this for the future?
>>
>>8148059
>understanding c++ is possible

I bet you faggot don't even know the order of overload resolution
>>
File: 1461372616810.jpg (24 KB, 407x405) Image search: [Google]
1461372616810.jpg
24 KB, 407x405
>>8148044
>>
>>8148100
>>8148105

stupid cs posters

imagine this: there are people out there with actual brains who can grasp more than css and python

i spit in your general direction, faglord
>>
>>8148076
>Undefined behavior is actually a feature, because it allows to do all sort of shenanigans when writing the os of a machine.
see rust for how to allow low-level hacks without being absolutely incapable of checking for edge-cases when you want to. safe-by-default and unsafe-by-choice is how it should be. it's not perfect, but it makes c++ look pretty fucking shitty by comparison.
>>
>>8148154
C++ is shitty compared to rust, eh?

lol
>>
>>8148044
>Maybe it's just my math background talking
Because it IS your math background talking. You like maths? Good, so do i. But i also love to work with my hands and turn fantasy into reality, and i'm not the only one. Plus math alone can't fix problems, it needs to be applied.
>>
>>8148196
not him but
can you refute>>8148091
>>
>>8148205
>>8148091

Experimental evidence is what builds mathematics models. Look at Einstein and Newton, they observed, and observed, and observed the universe around them and built from what was already known to what they could foresee. They didn't need experiments as such because they could make the observations without them. But we've observed the universe and nature as much as possible with mathematics and the naked eye.

Eg. The LHC discovering untheorized particles.

Mathematics is a powerful tool but it is only one of many tools at our disposal.
>>
>>8148156
thanks for contributing a meaningful response as to why you think otherwise from your experience with the two. i love learning from others.
>>
>>8148225
My father worked in a company that tried to create one of the first pc in Europe (it failed and the company got bought out)

They worked pascal and cobol, c was around but it was considered the language fedoras used, (the equivalent of using arc linux today).

Preferring rust over c++ is the same thing. Maybe is true, but what are the chances?
>>
>>8148233
i wasn't aware i was speaking to a child, please don't comment on languages you haven't even fucking used, it wastes time for both of us. i was a c++ elitist once too, i grew out of it.
>>
>>8148243
Are you 50 years old? That was the period when people loughted at C.

I think you misunderstood, I'm >>8148233
But not >>8148156 I have no particular interest in defending c++ over rust, I was just saying that is to be expected that people will not believe you when you present yourself as the revolutionary language that will fix every problem on earth. People loughted at java and loughed at python and will lough at rust no matter how good it is.
>>
>>8148258
it's an unecessary change because millenials don't want to bother learning a language that has "just werked" forever, and still continues to be updated, and get faster and more efficient.

it's not 1876 anymore, we don't have to reinvent the wheel every time we want to do something new. C++ already has compilers so advanced that it's more optimized than assembly, and it has decades of improvements and updates under its belt.
It works everywhere, for every situation.
What is the problem with it? Why do these nu-male shitheads want to increase fragmentation for no fucking reason?

All these memelanguages just waste people's time.

but there's another interesting fact: rust does nothing new.
>>
File: 1462847634956.jpg (221 KB, 1024x768) Image search: [Google]
1462847634956.jpg
221 KB, 1024x768
>>8148258
>People loughted at java
Well, some of us still do
>>
>>8148258
in that case, i wasn't surprised to see someone laugh at a modern language, simply disappointed by his lack of effort. i do understand that, i have heard that it goes back to the point where assembly programmers would mock the first compiled languages as "perhaps an educational tool, but useless for real programming".

as for "revolutionary language that will fix every problem on earth" i hardly suggested that ;) i think it's taking "low-level" in the right direction.
>>
>>8148268
and by the time rust gets as good and optimized as C++ is, it'll be phased out for whatever's memeing again.
>>
>>8148268
>it's an unecessary change
so was C++

>and still continues to be updated,
tell me when concepts and modules are released

>we don't have to reinvent the wheel every time we want to do something new.
we don't have to, but there are still improvements to be made from starting fresh

>C++ already has compilers so advanced that it's more optimized than assembly,
rust uses llvm, this is 80% irrelevant today and will be 100% irrelevant in 2 years

>and it has decades of improvements and updates under its belt.
c++'s biggest problem is that it never gets smaller

>Why do these nu-male shitheads want to increase fragmentation for no fucking reason?
only using one language is your problem, not mine -- every language worth using teaches you something that you can take to all languages, and a programmer that only knows one language sounds like a pretty damn inexperienced programmer to me.

>but there's another interesting fact: rust does nothing new.
as a usable systems programming language, it combines into one package a rich feature set not available elsewhere. i am also unaware of another language with ownership, borrowing, and lifetimes as implemented in rust. additionally, it is a low-level language with high-level cross-platform non-proprietary tooling.
>>
>>8148290
C++ is much larger than C. It brought new features that people required.

I agree with you on learning multiple languages. But rust's selling points are just lazy programmers who need things to be implemented FOR them instead of BY them, and just a serious lack of creativity.
>>
>>8148297
>It brought new features that people required.
tell that to kernel devs, you can always find an opinion that older is better.

>But rust's selling points are just lazy programmers who need things to be implemented FOR them instead of BY them
have you considered the benefits of higher level features and tools being a standard part of the open source language rather than having ten competing and incompatible ugly implementations of basic concepts like dependency management? i don't have to write cmake/insert_replacement_here wrappers for every library i use anymore. also i would presume a large number of early adopters are contributors to the language and/or tools themselves.

>and just a serious lack of creativity.
in what way? because it takes good features from other languages? because the features that are somewhat unique to it you personally don't see a use for? it's hard to fairly judge a language you haven't invested time into.
>>
>>8148321
you're right, I haven't invested time into it. But that's because I really don't see the need. There's no time in my regular programming that I've felt "oh well shit this language is terrible isn't it, I really wish it had X". At least for my needs.

The kernel devs didn't need those features, and Torvalds prefers C's simplicity. His prerogative.

Personally, I'm an embedded programmer and I write mathematical utilities for the researchers at my uni as well.

If someone is starting a project that _NEEDS_ a certain particular feature that rust or go or whatever other fad is in, go ahead and use it. But I'm a strong believer that there should be a "standard language" that most things are written in. I really think that language should be C++. There's no point causing fragmentation and isolation by the plebs writing some insignificant program that's 100 lines long in a meme language just to pimp their github when C++ could have done just fine.

tl;dr: use rust/go if you NEED it. If it is possible to do it in C++, use C++.
>>
>>8148352
you keep backpedaling to laziness and memes, so i guess i've said all there is to say. i thought c++ should be the "standard language" when i was a c++ elitist, i now think that was incredibly immature of me. i hope for your sake you get over your preconceived notions of all modern languages and widen your perspective.

on the other hand, if you want a better language to laugh at, check out jonathan blow's jai, aka let's make a c++ replacement by holding our dick and seeing where it leads us.
>>
>>8148268
No compilers aren't "more optimized than assembly". It never could be. Most compilers - even large and commercial struggle to even be able to use the newest CPU instructions several years after their introduction.

What is true is that many applications and softwares today don't need to crunch numbers so fast as assembly optimizations would make possible. But on embedded systems or signal processing for example the difference of coding close to the hardware could be a difference between something being possible to do or not possible to do.
Thread replies: 41
Thread images: 3

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.