Much appreciated rant. Maybe you can clarify a bit some of the wording. In particular the last sentence is a bit terse and I'm not at all sure what it meant to say. — sehe2 mins ago
I have noticed Hans being considerably more negative than usual lately.
Someone is offering to pay me in a sort of sugar daddy/sugar baby arrangement. They want to make online deposits to me, and they're asking me for my online banking username and password. Is that information alone enough for them to be able to take my money out of my account, or am I safe?
Such assumptions typically originate from people who start learning in languages with implicit mutability.
Just because expressing counters in immutable contexts is different to what you've learned in the past, doesn't make it "brainfuckery"
I'd say it's a very funny definition of brainfuckery if you consider e.g. understanding the runtime behaviour of your program with regards to data mutation that.
Well, my simple mind understands mutability from every day life. It makes code easy because it mirrors reality. Once I lose that simple model everything becomes much more difficult.
Those assumptions originate from people who never got out of the zone they learned in.
So they start learning, they see a way to model reality, take it in (which is never "intuitive" or painless as some people seem to think) and then settle with it
I'd even say that for people who only know one paradigm, that paradigm might well be "intuitive" because intuitively that's the only one they'll go for, because that's the only one they know.
Really the only way to know is to learn, understand and practice both.
As a personal disclaimer, I am totally open to mutability as a concept at systems' scale. OOP makes a lot of sense when designing large systems. But in lower layers, it quickly loses its benefits and loses to FP overall.
I should pick up haskell again. It was no fun when I played with it some months ago, but I think that was just because the tutorial felt like it just kept repeating "See how great immutability is?" when my answer was always "no, it's terribly limiting".
@nwp maybe you should try writing some "real world" haskell
2
You: Haskell is too academic
Me, at my day job: writes the shittiest, hackiest haskell to do random "real world" shit, taking advantage of nice libraries and type safety
I need more basics for that. If you can barely concatenate 2 lists and didn't even get to the almighty fold expression, writing actual programs is not feasible.
you won't understand everything as deeply as someone with good basics and it might involve some more copy&paste
but some people seem to learn better that way
and also it's refreshing to sometimes just whip out IORef and write totally imperative code with mutable state in a language we all know makes it impossible to do so :)
also
fold is a function, not a special syntax thing like in C++
so once you understand the concept, it's just about looking at its interface
I watched this talk which was kinda fun. But ultimately I did not understand why you cannot concatenate an iomonad thing with a regular string and get an iomonad back.
Somehow that being a syntax error was super important and I don't know why.
@Ven It's here + 20 seconds. "abc" ++ readfile "/etc/passwd" must for some reason explode and not simply return typeof(readfile "") with the correct runtime-determined value.
I'm not seeing the property to categorize values by then. Values now vs values at some point in the future I suppose, but I don't see why you want them strictly separated.
For me it seems obvious that combining a "pure" with an "IO" produces an "IO", but I guess you eventually learn that that is bad and it must be made explicit.
@nwp since presumably you also want "abc" ++ "def" to work, that means that at the end of the day you are advocating for some sort of overloading-style polymorphism/subtyping/what have you feature---one thing about these, independently of opinion or taste, is that they tend interfere very poorly with Hindley–Milner inference
And yes, I want operators to be overloaded properly. I would not want to use a language where for example + is not overloaded for all kinds of types. ++ should concatenate anything that has obvious concatenation semantics and I would argue that concatenating the readfile monad and a string is very obvious.
Telling me that no, the concatenate operator in this case is fmap is very disappointing and annoying. That's like std::is_same_v-level of badness that I thought we wanted to get away from.
@nwp I don't think you understand the consequences well enough yet
Observing fmap within this narrow context isn't the full picture
After you see how Functor instances for other types look like, and compare them to Applicative and Monad instances for IO and others as well, it starts to click together
IOW, you get waaaay more than you're ready to ask for at this point
@BartekBanachewicz That I have multiple syntaxes to concatenate stuff when there should be a simple concatenate function / operator that works on everything concatenatable.
@nwp what I was getting at is the larger picture. it’s not too reductive to say that Haskell was conceived as an ML-like language (i.e. steeped into HM inference), except non-strict---and this vision still lives on and informs the language design today
so in the other direction you might want to think of a language with the "very obvious" (as you put it) properties you want: but the result would not look like Haskell
and for general cases like Maybe your operators might not have obvious implementations
for IO String it seems kinda obvious what should happen
but for Maybe I can see at least two possible implementations
and then it completely breaks for lists
so in the end you end up with functions for specific monads, which yes, do exist, but again, typically haskell programs should make use of the more generic concepts when possible
you need to write Haskell when you're writing in Haskell if you want to stay sane. Trying to write your favorite language in Haskell will never be as good as writing your favorite language in your favorite language :P
@nwp the takeaway that I want to present to you is that it's fine to ask 'why doesn't language X have Y'; but in considering possible answers I urge you to readily jump to an attitude of 'the designers of language X must be ignorant/incompetent'
whereas I think that approaching the question under the angle of "what were the choices and trade-offs that led to the situation" leaves anyone open to learn new things
I don't mean to say Haskell is bad. I just need to learn what the categories mean and why they are kept separate. When not seeing the issues when mixing them, unifying all the things looks reasonable.
BTW, you might want to take a look at alternative preludes @nwp. Since stuff like concat operator, numeric operators etc. are just functions, if you don't import prelude, you can change their meaning to your liking
of course you risk confusion when someone used to the default prelude reads your code, but I know that at least some alternatives are kinda widely used
there’s a couple of interesting lay explanations out there, but imo they still look at it from the angle of type theory [Quora, CS.SE] that may not appeal to all programmers
@nwp my best stab at it: you may be able to conceive of a ++ with gives a ++ b the meaning you want, but by doing so you invite the question of how to make e.g. myOwnFold (++) xs work
is it safe to assume that if you find dynamic libraries named "libicui18n", "libicuuc", "libicudata" in one /bin folder, you may copy them together and they should work? more specifically, is library naming (i.e. boost) always accounts for this usage?
loop:
count = 0;
total = 0;
value = 0;
while(count != 10) //while loop to fix for only 10 values to be input
{
try
{
std::cin >> value; //cin to input value
//Statement to check if input value is not a character
if(std::cin.fail())
...
@Mikhail Supposedly they're supposed to be a drop-in-replacement with normal DIMMs. IOW, the OS probably isn't going to know. And it'll need to be handled by the DIMM itself.
Since 3DXP is non-volatile, there is an non-optional encryption step added to the controller. So we're talking long latencies here.
@Mysticial about persistent RAM? the Os is going to need to know that it's there to make use of it though. otherwise it's just gonna assume it's all empty on power-on
@milleniumbug The conclusion I've been coming to about this "welcoming vs. "not welcoming" debate is that you must treat the new user OP like Trump. You must shower the OP with praise and only praise. Only say good things that make the OP feel good. Do not make any attempt to criticize or do anything productive because you will upset the OP thereby making yourself "not welcoming".