HNHacker News
TopNewBestAskShowJobs

hurril

523 karma · joined December 11, 2020

# Functional toy language https://github.com/pandemonium/lukas-rs
submissionscomments
hurril··on Why are European countries moving their gold out of North America?
No it is not solved. Grid-scale batteries are absolutely not being mass-produced today. Let's stick to the truth here.

I would LOVE for this to be the case, however. Adding this again so that I am not lumped together with the coal thumpers.

What exists, TO BE BUILT that is, is battery farms, sure, but they are nowhere nere big enough. They are nowhere nere close enough to compensate the factor applied to wind farm energy generation. But let's hope good progress can be made in the accumulation aspect of intermittent energy production.

hurril··on Why are European countries moving their gold out of North America?
What? Absolutely not, I love capitalism. The problem is that it is suspended when it comes to the wind farms, they are pretty much always heavily subsidized and on a socialized loss scheme at that.

And no, I have no problem with renewables either.

If your conclusion from reading what you said is this, then you did not read because I said the exact opposite.

hurril··on Why are European countries moving their gold out of North America?
I am a non-hater of renewables. I add this because in plenty of _your_ circles, you are either all in on renewables or you are a coal thumper, basically. I am neither. We need to add nuance by complicating this conversation.

The main problem of renewables is that it is intermittent and that fact remains to be solved. I want this solved or at least improved because it is the bottleneck. In fact, it is such a bottleneck that its energy generation factor is noted as 1:10, i.e.: a power plant rated at 100MW, registers as 10MW in comparison to nuclear and hydro (and obviously coal and gas.) So this means that to add a 1MW worth of energy generation to the grid, 10MW must be built.

Another problem that hits wind farms is that when there's wind blowing somewhere, it tends to blow everywhere, or some large area. So suddenly there is too much energy want to flow in to the grid which hits the core of the problem with grids at this point because energy that is inserted into it, must be extracted to the exact same magnitude at the same time. So a 100GW demand must be met by 100.0GW production. Now if 110GW is produced, something _MUST_ consume it, so there are two choices:

1. make someone consume it, i.e., sell it to them. They have to buy it so the price will drop until there are enough buyers and this does not stop at 0, prices will go in to the negative. So the market will pay you to use electricity. The market. Or:

2. shut off the power plants until we are back at 100GW (or whatever can be met by consumption.)

3. there is also a catastrophic third option. If you have a situation where too much energy (read power if you want to) is inserted into the grid, then its frequency will rise, this damages the infrastructure and connected consumers, so they will get disconnected. Read large and broad power outages. These situations are also non-trivial to recover from. I.e.: to "restart the grid" afterwards. See what happened in Spain last(?) year.

How do you run a power plant in a market that demands payment to accept the energy you want to sell? You cannot. So this is the windfarm paradox, feel free to compare to Russel's paradox. It goes something like this:

A windfarm makes money whenever the wind blows because only then does it have energy to sell.

A windfarm cannot make money whenefer the wind blows because then the market price goes to zero.

So a windfarm makes money when the wind blows and does not blow at the same time.

To solve this problem, energy consumption must be made capable of also being intermittent. Either run "factories" intermittently, which might very well be part of the solution. And/ or, have huge accumulation capacity in the grid that can swallow the over generation.

TLDR: renewables is the easy answer but very hard thing to do. The hard answer is the one I have given, together with getting more nuclear going which is difficult and expensive. But.. what can we do?

hurril··on Why are European countries moving their gold out of North America?
Easiest. If that is the easiest way you see I am afraid to ask what the harder alternatives would be.
hurril··on Why OOP Exists
That is just not the case. I have worked, full time, as a functional programmer coming up to 15 years, in different langauges. Actual functional programming and not merely doing web programming with React.

"[...] pure functional programming whilst still functioning."

I mean, what is this?

When I read what you are saying here, you are saying that an "advanced codebase", whatever that means, using functional programming leads to centralized state and distributed components. And you know this because the codebase you are thinking about has this software architecture.

I have been in such codebases too, they tend to be frontend and maybe that is just the way you have to do it, maybe not. But this is not a property inherent to functional programming. Solving problems with a component or object concept as a central abstraction for "a thing" is the OOP way. I know this because this is how I spent the first half of my career. You think you need a _substantive_ onto which you perform verbs. Nothing wrong with this though, I am not picking a fight with OOP.

I can offer what I refer to when I talk about FP so that we can at least have a real thing to disagree over :)

1. model the domain and interactions with it with strong types such that neither interactions nor state can represent values outside of the domain.

2. parse, don't validate

3. Use modules, stateless collections of declarations, to organize stateless functions. No this. No self.

4. No magic code. I.e.: no null checks, no magic number checks, no arbitrary logic in four places that together make up the fact that prices can have taxes. Abstract it and "store" these runtime decisions using typed values, use functions that accept these typed values to force use of the aforementioned types.

5. Control the side effects. This does not mean that you have to use Haskell or monads or anything like that. Just that managing it is a good thing.

6. #5 implies keeping track of state. I.e.: no, you may not just willy-nilly read it from the persistent store, cache or file.

hurril··on Why OOP Exists
Component is not a term out of the FP schoolbook. I am sorry to be making what smells like a true scottsman here, but you seem to be describing a React codebase since they call themselves functional with that Redux stuff, you think this is functional programming. A graph of "components" all talking amongst each other. Functional. Programming. Come one, man :)

What you are describing is OOP. Passing messages between identities over calling pure functions with values.

hurril··on Writing by hand is good for your brain
I also write with fountain pens these days. Do you have a favorite model?
hurril··on Show HN: Fast, native Mac file manager (filters, fuzzy find, 9 MB, no Electron)
All four of these are awesome tips, thank you!
hurril··on Show HN: Fast, native Mac file manager (filters, fuzzy find, 9 MB, no Electron)
Do you have anything in particular in mind here? Long time macOS user but I like a good pro tip :)
hurril··on Poly/ML – A Standard ML Implementation
Right and C has a special place in my heart. I have never coded C in anger, but the weird thing about coding in Java is how low level all the implementations are. I've had this debate/ conversation with people over the years and I realize that if I am the only one at a certain position, then I am wrong and not everyone else.

But I claim that Rust is actually a high level language. Higher level than Java. My argument is that in Rust (, F# and Scala) you can encode in structure, what has to be operational code in Java.

So in the stronger languages you can reason about larger swaths about domain concepts easily, whereas in Java you have to trust the test panel on faith and wade through deep sections of "magic code" (compare with magic numbers. Why is there a 427/ these 7 lines of logic here? What does it do?)

hurril··on Poly/ML – A Standard ML Implementation
I am not. I am saying that had I been a good little Java/ C# developer, then I would never have learned Rust and all of the things that come with that.

Scala is not doing great, probably because they took too long to get 3 finished and good.

Yes. Companies are going back to Java because this is what all the convervative guys and girls want to use. That fact is what I am criticizing. You want fast horses, you don't want nice things.

So now you have Maven, semi-typed code intermingled with container logic because you cannot abstract over anything, you have millions of lines of impenetrable tests. Just like we all did in 2006. You all love this because learning things is not your forte :) That other stuff is for academics and niche.

hurril··on How memory safety CVEs differ between Rust and C/C++
C is turing complete so of course. You can do anything with C but that is not the issue we are discussing here.
hurril··on Poly/ML – A Standard ML Implementation
This is just not true, the last bit you say. That is the same old trope about F#, Rust or Scala being niche, things people that don't have to earn money or feed children can do. I worked 100% in those languages from 2012 through 2023.

But sure, with AI, maybe this will matter less because people don't care about the code anymore.

hurril··on Poly/ML – A Standard ML Implementation
This rests entirely on the same same sort of conservative attitude towards new experiences that holds the other half of the development world back. The Java world. People generally do not want to learn new things, they want "faster horses", which incidentally is what C# and Java is these days.

This is why we can't have nice things.

Java with Streams and "functions" is a lot better than what I left behind 15 years ago. But it is still extremely primitive compared to what F#, Rust and Scala offers. And I know this because I have spent 10+ years EACH using all of these in anger. So 20+ years.

hurril··on How memory safety CVEs differ between Rust and C/C++
I guess that depends on what goals you have in mind. If they are producing a correct program, then having the compiler verify your assumptions, forcing you do deal with domain complexity upfront is one way to do that. Tests( driven development) is another one.

But in this context I feel that partial solutions are offered as alternatives to more complete ones. I.e.: if holes in your trousers is of no concern, then having tools to avoid that is of no value.

Not picking on C here, as already mentioned, it is a wonderful language.

hurril··on How memory safety CVEs differ between Rust and C/C++
Unless you or him define what you mean by complexity, we are not going to be able to come to an agreement there. This line of reasoning, it seems to me, is making the case that C is more complex than Assembly because the former has a number of formalizing, let's say, concepts that are not in assembly.

I would on the contrary say that adding extra static checking deducts from the _actual_ complexity of the domain and its application.

hurril··on How memory safety CVEs differ between Rust and C/C++
Still not picking on C++ here. I would claim that these concepts pretty much all exist in C++ too, but often implicitly so. You would solve them by "braining them", with good rules of thumb, patterns, tests and deep knowledge and skill. In fact, you _have_ to solve them this way.

In Rust the compiler is going to have a problem with your code unless you are explicit about borrowing/ ownership, gcc won't care. Which is the more complex thing there?

Same goes for the polymorphism. Looking at languages without parametric polymorphism, you instead see casts and inheritance trees. Not picking on old Java here, but is this more or less complex?

Let's talk some about unsafe as well. In C or C++, for instance, there is a global unsafe surrounding all the code, so if someone has problem with unsafe, why would they pick on Rust where "unsafety" is optional?

Same goes for unwrap. Unwrap is basically a deref combined with a _safe_ crash if the deref was not successful at runtime. Do that in an unsafe language and you have an access violation best case. Or just silent corruption. Which is more complex?

hurril··on How memory safety CVEs differ between Rust and C/C++
I reject the whole Rust has a high complexity premise, but I would gladly continue our conversation around it here but I would need a little more definition for that to be possible.

What do you mean by complexity in this context and in what way does Rust carry a lot of it?

hurril··on How memory safety CVEs differ between Rust and C/C++
I would argue that what you call complexity here is better referred to as explicit or visible complexity, as compared to hidden or implicit commplexity. The complexity as such comes with the domain and its application; but with Rust you can see it and you are forced to deal. With C++ you can get away with pretending that it is in fact not there.

This is honestly not intended to pick on C++ as a Rust fanboy, however. It really isn't.

For instance, to be a little unpolished, I would shrug off the unwrap incident as doing it the C++ way and pretending that the complexity does not need to be solved right then and there because ItShouldNotHappen or IKnowWhatIAmDoing.

I prefer Rust over C++, but I do not hate C++. This isn't even about C++ anyway.

When it comes to out of control dependency trees, I agree with you. But there is a trade off here too and that is that either you implement the thing or you externalize it. I use both approaches myself and am in no way excusing anything or attempting to be Rust's defense lawyer. There definitely seems to be a leftpad-problem brewing in the Rust community.

hurril··on I'm skeptical about efforts to revolutionize schooling
I was one of these "smart students" but it really wasn't that I did not want to be there. I was a lazy, or complacent, f*ck. I've have had to learn how to learn and how to have discipline late(r) in life.
hurril··on MacBook Neo is so popular that Apple doubled production
Anything in particular that your Linux experience adds over what is available on macOS?
hurril··on Remove-AI-Watermarks – CLI and library for removing AI watermarks from images
Would the DRM exist without piracy?
hurril··on Remove-AI-Watermarks – CLI and library for removing AI watermarks from images
This is again conflating at least two things and this is so prevalent in this context. Let us not conflate how annoying DRM:s are to us users that buy the things, with pirates thinking they somehow have a right to use any software without paying fairly for it. I would even go as far as to say that you pirates are the reason I have to have a DRM in the shit I bought and paid for.
hurril··on Why senior developers fail to communicate their expertise
I don't think I can agree with you here because a lot of these things that people know but that is supposedly hard to dress in words, is very often just positions that someone holds arbitrarily, so is difficult to impossible to explain. The positions do not have explanations because they are not held for good reason.

I say this as someone with 3 decades of professional experience. That does not make me right, please do tell me that I am in fact wrong! It does mean that I might be one of these guys with positions that should be challenged, however.

You know what? I welcome this. Explain to me why I am wrong, let's do it your way, dear youngin!

hurril··on Cannabis and driving? Studies reveal big risks
I am still an idiot. But driving baked would be impossible :)
hurril··on Cannabis and driving? Studies reveal big risks
I don't see how anyone would even want to attempt to drive while baked.
hurril··on I built a Game Boy emulator in F#
OCaml is wonderful too but having written F# for different companies for years, my code is pretty much never that hybrid stuff. Sure, .NET:s weird asynch apis, sometimes the code comes out a little bit weird but that is the exception to the rule imho.
hurril··on I built a Game Boy emulator in F#
Ah F#, my greatest love. How I wish the C# guys and girls would see this instead of further bastardizing (don't hate me) C# into being everything but poorly.

Don't you see that if you would use F# instead, creating projects with C# and F#, that you would get what is being added to C# but actually working and ergonomically? Interop is great!

hurril··on Functional programming accelerates agentic feature development
It really isn't. Having worked for several decades on "both sides", this really is my experience. The functional side is better typed and has fewer side effects of this kind. It is more normal, as in more common, to have code work correctly as soon as it compiles. This is my lived experience having worked with Java, Scala, F# and Rust since 1999.
hurril··on Patterns for Defensive Programming in Rust
Well it isn't a good call. This is the kind of code that OOP makes people write.
Page 1 of 10Next →