Hacker News new | past | comments | ask | show | jobs | submit | iand675's comments login

I work on one of the largest Haskell codebases in the world that I know of (https://mercury.com/). We're in the ballpark of 1.5 million lines of proprietary code built and deployed as effectively a single executable, and of course if you included open source libraries and stuff that we have built or depend on, it would be larger.

I can't really speak to your problem domain, but I feel like we do a lot with what we have. Most of our pain comes from compile times / linking taking longer than we'd prefer, but we invest a lot of energy and money improving that in a way that benefits the whole Haskell ecosystem.

Not sure what abstractions you are wondering about, though.


What I'm wondering about is how maintainable programs of that size are over time. That you get get over a million lines says it is possible. However difficult is it though? Abstractions are just code for whatever it is needed to break your problems up between everyone without conflicts. How easy/hard is this?

For example, I like python for small programs, but I found around 10-50k LOC python no longer is workable as you will make a change not realizing that function is used elsewhere and because that code path isn't covered in tests you didn't know about the breakage until you ship.


It’s highly scalable. Part of the reason compile times are a bit long is that the compiler is doing whole program analysis.

Most of the control flow in a Haskell program is encoded in the types. A “sum type” is a type that represents choices and they introduce new branches to your logic. The compiler can be configured to squawk at you if you miss any branches in your code (as long as you’re disciplined to be wary about catch-all pattern matches). This means that even at millions of lines you can get away with refactorings that change thousands of lines across many modules and be confident you haven’t missed anything.

You can do these things in C++ code based as well but I find the analysis tooling there is building models where in Haskell the types are much more direct. You get feedback faster.


Modern C++ has something like sum types, but it's so clunky and un-ergonomic it's ridiculous :(

And the standard library is including monad-like types too. It has come a long way.

We have a pretty limited set of abstractions that are used throughout. We mostly serve web requests, talk to a PostgreSQL database, communicate with 3rd-party systems with HTTP, and we're starting to use Temporal.io for queued-job type stuff over a homegrown queueing system that we used in the past.

One of the things you'll often hear as a critique levelled against Haskell developers is that we tend to overcomplicate things, but as an organization we skew very heavily towards favoring simple Haskell, at least at the interface level that other developers need to use to interact with a system.

So yeah, basically: Web Request -> Handler -> Do some DB queries -> Fire off some async work.

We also have risk analysis, cron jobs, batch processing systems that use the same DB and so forth.

We're starting to feel a little more pain around maybe not having enough abstraction though. Right now pretty much any developer can write SQL queries against any tables in the system, so it makes it harder for other teams to evolve the schema sometimes.

For SQL, we use a library called esqueleto, which lets us write SQL in a typesafe way, and we can export fragments of SQL for other developers to join across tables in a way that's reusable:

select $ from $ \(p1 `InnerJoin` f `InnerJoin` p2) -> do on (p2 ^. PersonId ==. f ^. FollowFollowed) on (p1 ^. PersonId ==. f ^. FollowFollower) return (p1, f, p2)

which generates this SQL:

SELECT P1., Follow., P2.* FROM Person AS P1 INNER JOIN Follow ON P1.id = Follow.follower INNER JOIN Person AS P2 ON P2.id = Follow.followed

^ It's totally possible to make subqueries, join predicates, etc. reusable with esqueleto so that other teams get at data in a blessed way, but the struggle is mostly just that the other developers don't always know where to look for the utility so they end up reinventing it.

In the end, I guess I'd assert that discoverability is the trickier component for developers currently.


I lost my 3 1/2 year old daughter to sudden illness about 10 months ago. Be gentle to yourself and your family. There will be times where you aren’t actively feeling the grief, but they pull you into theirs or vice versa. There will be times where your love and grief for your lost child will make it easy to forget to cherish the loved ones in front of you.

As you figure out how to live life from here– may you find a path forward that is healthy, loving, and beneficial for you and those you care about.


I’m sorry for your loss and thank you for sharing that


The writing has been on the wall for 5+ years that government bodies would eventually legislate this, even for casual observers. If these auto manufacturers as industry insiders couldn’t plan ahead to handle this outcome, it sounds like they might deserve to be unseated.


The politicians often change or reverse laws, should they plan based on the law or the consumers. Personally, I think it quite likely that all these government deadlines for ICE will not be met and the changeover will take much longer than hoped. We don't even know if the manufactures can make enough EVs in these time frames, we still have hurdles for battery and electricity distribution. All that energy in liquid form has to now go ever wires, which are showing strains already. Imagine the entire vehicle fleet needing to feed off that same system, we need to put a ton of resources into the grid


Your comment reminds me of the Big Three's attitude towards automobile emissions and safety regulations. They thought they could force the politicians to reverse those laws. And they were very wrong about that. Even when they got their business friendly allies in power, nope.

And the stakes now are oh so much higher.


What's happening is that aspirations are meeting reality. If the table stakes were in fact "oh so much higher", the people would be demanding the politicians to do something about the infra. There is "oh so much more" to do besides just the cars. Electrical grid capacity, fire departments at many more car crashes for battery fires, at home charging (but what about all those that park on the streets), battery production and disposal, the list goes on. It's not just the car makers, we the people need to stop making them the only target. How come we don't hear about the other stuff on HN?

Point is, the politicians can set some year because that gets them votes, but as has been predicted and is playing out, things are very behind schedule and won't make the dealline


>>auto manufacturers<<

i forget the corporation, but i recall an ad depicting a CEO, telling the team "were not in the oil business were in the energy business"

likewise, --were not in the ICE automotive business, were in the private transportation business-- sounds parallel.


That's funny considering the church of climatology can't exist without government subsidy.


Neither can the current fossil fuel industry. Either through explicit subsidies, or through implicit ones by allowing them to use the environment as their free sewer.


The fossil fuel industry can exist fine without subsidies. Where else can people get cheaper fuel?


Again, the fuel is cheap only because they aren't being charged for the externalities (e.g. CO2e) that the fuel produces.


According to the article, half of the Sahara Desert based on 2019 calculations. Probably more now.


While that would work as an estimate of total sq meters, applying that scale in a localized area would have too much of an impact on wind/currents, inversion, and the downstream of those changes.

First targets would be urban heat islands and airports. Second would be industrial and manufacturing facilities. Regulations and Nimby would likely mean manufacturing and industrial would be more quick to adapt for use.

The case for urban heat islands is pretty straightforward, but the application with airports would be to mitigate the heat trapping that takes place, especially overnight. Exhaust from flights result in more heat being trapped, similar to urban heat island but due to atmospheric effects and not solely due to surface materials and lack of greenspace.


Imagine a checkerboard of huge tiles dropping the temperature across a large area of desert, for a desert reclamation project.

Seems we are going to have to geoengineer in the future, greening deserts would be a silver lining to all the climate and response chaos.


So you're saying there's a chance...


Call Sherwin Williams (their slogan is cover the world in paint)


Mercury (https://mercury.com/) uses Haskell extensively for pretty much all of its backend systems. It’s a great general purpose language.


Man, the FOMO. I had a friend who worked at Mercury and if I had met her just a few years later I'd probably be working as a Haskell dev there now. I had to chomp my way through _HPFFP_ first, though.


If anyone else is wondering, it looks like HPFFP is "Haskell Programming from First Principles" :)

https://haskellbook.com/


I lost my 3 1/2 year old daughter to sudden illness several months ago. So many dreams left our family that day. Now it is up to those of us left behind to pick up the pieces.


I am sorry for your loss and I hope you find the strength and meaning to carry on.


Lots of love and a big hug to you

I have two kids around that age. Have had some bad scares and it’s been devastating emotionally for me

Hope you get lots of support

Feel free to reach out (checkout my profile), if you ever want to talk, about anything really, doesn’t have to be the kids


So sorry for your loss... I cannot imagine your pain.


Losing one of my children would be the end of me, just thinking of what you are going through brings a tear to my eye. I really hope you can pick up the pieces and enjoy what life still has to offer you.


Good lord, I'm so sorry. My heart goes out to you and your family.


I am so sorry for your loss. I lost my 7 week old daughter to a sudden and unknown illness in November 2020. I have had 2 sons since and they are both healthy. I still think of the things I’ll never get to do with her with great sadness and heartache.


I'm extremely sorry for your loss. I do hope that you are able to pick up the pieces and somehow create a meaningful life with them.


So sorry, the only thing that helps is to love those left with all you have.


I’m so sorry for your loss.


I'm so sorry...


On the one hand, you know that it's not appropriate to post things like this... on the other hand, you post it anyways?


Can't speak for OP, but draftjs didn't work well on mobile at all for a major project I tried to use it in. Had to migrate off of it.


Can confirm, I was one of them ;)


I'm not entirely sure, but yesterday I observed some vending machines at a local university that worked with student IDs. The machines had a small antenna encased in the drink display, so presumably that model broadcast payment and/or inventory updates to some nearby receiver or via stock WiFi networks.

I'd expect that there would be a strong incentive to have the cards require network access to verify balances or else some enterprising hackers could potentially reverse engineer the process to add additional funds to the card.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: