Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
mrkeen
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
38 ms
·
721.
▲
by
mrkeen
2y ago
Because it's the explanation that doesn't require the rich and powerful to change their behaviour.
722.
▲
by
mrkeen
2y ago
You're not adding any new information. I already understand you completely. > 1. You get single-writer multiple reader for free from the type system, without any runtime overhead. Take the example from the article which is accepted
723.
▲
by
mrkeen
2y ago
>> or some comment like: Rust guarantees that you aren't mutating shared state. > The core type system guarantees that there is no [sharing] while mutating, and no mutation while [sharing]
724.
▲
by
mrkeen
2y ago
Think about mutability in Java land this way: // Using mutability. // `increment` is void, and makes 2 bigger for everyone. increment(2); // Typical Java "safety". // It's
725.
▲
by
mrkeen
2y ago
Coloured functions are a feature - not a bug, Haskell is full of them, and they are exactly what make STM safe in Haskell, but abandonware in other languages which have tried. 2. The way you call a function depends on its color. `<
726.
▲
by
mrkeen
2y ago
This why I haven't fully embraced Rust yet. Whenever I ask about safely mutating shared state (see sibling comment), I'm met with silence, or some comment like: Rust guarantees that you aren't mutating shared state.
727.
▲
by
mrkeen
2y ago
Mutexes lock code , TVars lock data . If you lock a section of code (to protect data), there's no guarantee against mutations of that data from other sections of code. If you lock the data itself, you can freely pass it around and an
728.
▲
by
mrkeen
2y ago
> Implication of Using STM Running I/O Inside STM— There is a strict boundary between the STM world and the ZIO world. This boundary propagates even deeper because we are not allowed to execute arbitrary effects in the STM universe.
729.
▲
by
mrkeen
2y ago
STM is Haskell's feature for safe shared&mutable state. What is Rust's feature for safe shared&mutable state?
730.
▲
by
mrkeen
2y ago
According to the article, channels are slow because they use mutexes under the hood. So it doesn't follow that channels are better than mutexes for large N. Or is the article wrong? Or my reasoning?
731.
▲
by
mrkeen
2y ago
> external world has tendencies to fail, needs to be retried, coordinated with other things. This is exactly why I'm so aggressive in splitting IO from non-IO. A pure function generally has no need to raise an exception, so if you s
732.
▲
by
mrkeen
2y ago
It's entirely up to you. You can just write Haskell with IO everywhere, and you'll basically be working in a typical modern language but with a better type system. Main is IO, after all. > if the program were running and the
733.
▲
by
mrkeen
2y ago
Functions which use IO are tagged as such in the type system. IO can call non-IO, but not vice-versa.
734.
▲
by
mrkeen
2y ago
But that's the irony of it, they did abandon the for-loops! Maps and folds and filters are everywhere now. Why? Because 'functional is good!' ... but why is functional good?
735.
▲
by
mrkeen
2y ago
> The hard part is managing effects You can say that again! Right now I'm working in C#, so I wished my C# managed effects, but it doesn't. It's all left to the programmer.
736.
▲
by
mrkeen
2y ago
> Who is "we", what was the price, and what was the imagined reward? Slow down and re-read. >> You get: the knowledge that your function's output will only depend on its input. >> You pay: you gotta stop using
737.
▲
by
mrkeen
2y ago
> Somehow haskell and friends shifted the discussion around functional programming to pure vs non-pure In direct response every other language in the mid 2010s saying, "Look, we're functional too, we can pass functions to other
738.
▲
by
mrkeen
2y ago
I don't want functional-flavoured programming, I want functional programming. Back when I was more into pushing Haskell on my team (10+ years ago), I pitched the idea something like: You get: the knowledge that your function's
739.
▲
by
mrkeen
2y ago
> I fail to see why it is a functional programming concept. Excellent! You will encounter 0 friction in using an FP then. To the extent that programmers find friction using Haskell, it's usually because their computations unintenti
740.
▲
by
mrkeen
2y ago
Think of it like other features: * Encapsulation? What's the point of having it if's perfectly sealed off from the world? Just dead-code eliminate it. * Private? It's not really private if I can Get() to it. I want access t
741.
▲
by
mrkeen
2y ago
> I've been afraid to use parser combinators > With regular (finite-state) languages I know their time usage Are you talking about parsers or grammars?
742.
▲
by
mrkeen
2y ago
Can I see the (implied) counter-example? A regex which turns a language's source code into an AST?
743.
▲
by
mrkeen
2y ago
> You could almost build an entire parser combinator library from scratch from memory, because none of the individual components are complicated. I do this every now and then. Usually in the days leading up to advent of code. "A pa
744.
▲
by
mrkeen
2y ago
> Parser combinators are both less efficient and less featureful than bespoke solutions, which is a problem when you're writing a parser for your custom language, and you want to add extra features, like resilience, or rich error re
745.
▲
by
mrkeen
2y ago
I grew up with "easy" languages. Pascal, VB, C, C++, Java, C#. And frankly I'm getting real sick of them. I'm porting Dijkstra's algorithm over to C# at the moment, and in the last several hours here's the tw
746.
▲
by
mrkeen
2y ago
Successful language designers select for what's popular, not what's good. C++ intersected the mass of C programmers with the new OO fad, and kept all of C's warts. Had Stroustrup made C++ better , he wouldn't have an a
747.
▲
by
mrkeen
2y ago
There's no need to be functional 100% of the time, and it's not pedantry. You mark your functions and non-functions as such, so the compiler can get your back.
748.
▲
by
mrkeen
2y ago
The author doesn't have a problem with students getting the notes. He only has a problem providing the notes. > It is unimaginable to me that I would have ever asked one of my professors for their own lecture notes. No, you can’t h
749.
▲
by
mrkeen
2y ago
That's my point though. Perhaps $100 per course per semester is better spent elsewhere, and maybe walking out of a lecture on Dostoevsky is the correct thing for a human to do. Are students walking out of brain surgery classes because
750.
▲
by
mrkeen
2y ago
I had to retrain myself to read fiction for pleasure. This is what worked for me: Read a paragraph. If you feel like the info isn't going in, restart the paragraph, but this time slow down enough so you can sound out the words in you
More ›