Hacker Newsnew | past | comments | ask | show | jobs | submit | mono442's commentslogin

It works better with other European languages' orthography too.

I've looked at Gleam before but it didn't seem to have any mechanism for dynamic dispatch like interfaces or type classes. Did it change in the meantime?

The answer I’ve seen is “just pass structs of functions around”, which is just one step more explicit than the implicit version we’re all use to, but honestly I kinda like it to free ourselves of all the ceremony around generics.

It’s discouraged to pass around structs of functions to replicate type classes in Gleam. Instead the preference is to not type class style patterns in your projects, favouring a concrete style instead.

Does that mean pass every needed function as a parameter? Or just don’t write generic functionality?

Yes, one would use higher order functions, as is common in Erlang, Elixir, OCaml, Elm, etc.

At least half of those languages (Elixir and OCaml) have some sort of mechanism for ad hoc polymorphism (elixir has behaviors and protocols, OCaml has higher order modules) so I feel like the comparison doesn't work that well personally

OCaml's modules are not implicitly instantiated, so they provide the same DX and APIs as you would get in Gleam.

Elixir does have protocols, but they are extremely limited compared to type classes, traits, etc, and they're uncommonly used compared to writing concrete code.


Gleam has first class functions, so it has dynamic dispatch.

Both of type classes and interfaces desugar to high order functions, so anything you write with them can be written with first class functions, though with a less concise API.


What you are saying is: no, it doesn't.

Of course dynamic dispatch can be implemented in almost every language. The Linux kernel uses dynamic dispatch with C!

But that's a hack, not a language feature.


I think you might mean “ad hoc polymorphism” rather than “dynamic dispatch”. Gleam, C, Erlang, etc have the latter, not so much the former.

It's not a "hack" because many language DO NOT let you store functions with state. Gleam does, I write PHP, and that does as well.

PHP has interfaces and whatnot, but a lot of the time I do polymorphism by just having a class that has Closure members. When you can arbitrarily pass around functions like that, it's basically equivalent to an interface or abstract class, with a bit more flexibility.


LLMs have mostly replaced Stack Overflow for me. I wonder if this is true for other people too.

Absolutely, I much rather push docs into LLM when really needed, it works miles better than googling and/or SO, especially for smaller tasks

It all depends on a software one is supposed to be responsible for. For some, it'll at most a few pages a year, for others it'll be constant pain having to deal with problems.


My experience is that I have to basically always overestimate if I can get away with it because otherwise if something goes wrong, I will pushed to do free overtime to complete all the work assigned in a given sprint.


These directives are mostly useless bureaucracy. I don't think anything of value has been lost.

My experience with European Union is that the EU politicians mostly live in a ivory tower and spend their days producing garbage laws and aren't actually addressing anything important.


> My experience with European Union is that the EU politicians mostly live in a ivory tower and spend their days producing garbage laws and aren't actually addressing anything important

Regulations are the unsexy laws that don't make the news because the specifically PREVENT things like water pollution, food and drug safety, employment rights.

Lets see how the US companies will act in the best interests of the public without regulation. Then come back and say its useless bureaucracy to ban lead in water, or allow chcemical dumping into rivers and lakes.

It's like saying "Well we don't need all this regulation around flying because the number of accidents is minor" such nonsense.


You are wrong mate. 80% of EU decisions are good for average joe (health, pollution, labour laws, agriculture boost, funding of A LOT of infrastructure like roads, railroads, airports, power plants and science.

For example Poland and similar countries are amazing at the moment because of EU funding and protection.

Without the EU half of the members would be like Ukraine (rampant corruption, pollution etc etc).

In the essence the EU is net positive, despite some stupid ideas(government spying, free trade deals with south america and rushed green revolution). But still: it's very positive. Just compare Poland to Ukraine. (Ukraine was richer than Poland in 1993...)

Mass migration is real issue now and that's about it.

My 2 cents


>(Ukraine was richer than Poland in 1993...)

Lol that's an absolute false statement. Ukraine was never richer than Poland, when it became a country (1991) economy went down a lot. So in 1993 - hahaha.

https://www.nationmaster.com/country-info/compare/Poland/Ukr...


In my opinion the EU is still a better steward of privacy rights, than my actual country.


Nothing important like digital rights, environmental issues (pesticides, nitrogen levels), harmonising trading so every member-state can compete as equals through the whole EU/EEA market.

Only useless bureaucracy which you don't give any examples of.


There are many examples of this, the most recent one would be regulation regarding plastic bottle caps.


What's the issue with non-detachable bottle caps? It markedly reduced the littering of bottle caps I used to see in Sweden, no idea what's the issue with that.


There is no issue


Oh, hey, no problem, here's some examples.

EU has tried repeatedly and still tried to undermine safe communication, end to end encryption (chat control), freedom of the press and of personal speech (democracy shield).

Its environmental regulations have endlessly complicated the most basic of business operations like selling anything that comes in cardboard boxes or fixing a car with non-OEM parts.

Useless EU inventions that come to mind are the cucumber and banana size regulations, non-removable bottle caps, mandatory 15-minute screen standbys or click through a menu, sound volume warnings on phones, mandatory driver assistance systems in cars (that don't work well in cheap vehicles, but still increase the cost and can't be permanently turned of as a preference), mandatory start-stop in ICE vehicles (which lowers lifetime of bearing materials), rising consumer goods import costs because de minimis is getting axed etc.


> EU has tried repeatedly and still tried to undermine safe communication, end to end encryption (chat control), freedom of the press and of personal speech (democracy shield).

Completely agree but that's from national governments, not the EU parliament; and I'm glad we've been able to keep Chat Control tamed for now, even though it will keep being brought up. Still, it hasn't become regulation nor even a discussion in the Parliament.

> Useless EU inventions that come to mind are the cucumber and banana size regulations, non-removable bottle caps, mandatory 15-minute screen standbys or click through a menu, sound volume warnings on phones, mandatory driver assistance systems in cars (that don't work well in cheap vehicles, but still increase the cost and can't be permanently turned of as a preference), mandatory start-stop in ICE vehicles (which lowers lifetime of bearing materials), rising consumer goods import costs because de minimis is getting axed etc.

Cucumber and banana regulations are for grading, exactly to harmonise trade so those can be sold at similar levels of grades and marketed as those grades, it doesn't mean you can't sell out-of-shape bananas or cucumbers, it's a deceptive move used by all EU-sceptic movement (like Brexit) while the regulations themselves are not an issue.

Non-removable bottle caps is also a non-issue, it really reduced the littering of bottle caps I used to see everywhere in Sweden, I don't see bottle caps on the ground anymore. The cost is a non-issue as well since after changing production lines it just goes down for every new batch.

Start-stop lowering lifetime of bearings while reducing pollution by idling vehicles, good trade-off.

De minimis still exist, current regulations are set all the way to 2030 [0].

[0] https://eur-lex.europa.eu/EN/legal-content/summary/de-minimi...


You changed my mind on some points, but this still ticks me off

> Start-stop lowering lifetime of bearings while reducing pollution by idling vehicles, good trade-off.

In my opinion this is not a good trade off. It puts vehicles that would be perfectly serviceable out of circulation, which has other environmental implications for breaking them down, and also another vehicle replaces it. I see the point behind it, but I still find it wasteful considering that we could have a machine last longer.

>Non-removable bottle caps is also a non-issue, it really reduced the littering of bottle caps I used to see everywhere in Sweden, I don't see bottle caps on the ground anymore. The cost is a non-issue as well since after changing production lines it just goes down for every new batch.

Sorry, I wasn't aware of your pollution situation. For me, it makes bottles harder to reuse because you kinda have to detach them if you want to refill and reuse the bottles, which leave sharp plastic barbs at the attachment points. Also, annoying when you're trying to have a drink while driving. It's not a big issue, but where I leave, pollution from bottle caps was a non-issue from the start, so I don't really have a reason to like the change.


> In my opinion this is not a good trade off. It puts vehicles that would be perfectly serviceable out of circulation, which has other environmental implications for breaking them down, and also another vehicle replaces it. I see the point behind it, but I still find it wasteful considering that we could have a machine last longer.

Bearings suffer wear and tear, and needs replacement, you don't replace your whole car because of worn bearings unless you're talking about complete engine rebuilds (like piston rings/rod bearings/camshaft), I still would like some data to substantiate this discussion because I don't have it.

> Sorry, I wasn't aware of your pollution situation. For me, it makes bottles harder to reuse because you kinda have to detach them if you want to refill and reuse the bottles, which leave sharp plastic barbs at the attachment points. Also, annoying when you're trying to have a drink while driving. It's not a big issue, but where I leave, pollution from bottle caps was a non-issue from the start, so I don't really have a reason to like the change.

It's not a dire pollution situation, it just normally done by teenagers not caring too much and littering their soda bottle caps around. I don't see why you need to remove the bottle cap for refilling, I do it just as I used to and nothing has changed that requires me to remove bottle caps for them to be refilled/reused.

So it's not a big issue, it made it harder for people to litter while not having big drawbacks, I don't understand why it was an example of bad regulations...


Whats the problem with attached bottle caps or volume warnings? I used to find these things annoying when I was younger but I do realise things like that can be very useful, even though they are small steps.


Chat Control is being pushed by national governments, either directly or through the meeting of their leaders, the Council. EU institutions are the ones continuously keeping it at bay.


Where I live, we have and exercise the right to legislative referendum, which stops such legislation in a very clear and decisive way. If something like this passes in the EU, we have no way to fight it (international treaties are not subjects to referendum). The influence in EU parliament is delegated on so many levels that it's impossible to transparently see what your vote influences.


Again, the only ones pushing for it is the Council, which is the heads of national governments, nothing else.

The Parliament is against it. The Commission is against it. It's only the national governments that are pushing for it.

https://www.patrick-breyer.de/en/eu-chat-control-twist-commi...


Chat control is being pushed by national police forces as well as europol. It's... Lobbying. Basically. The whole story of how it started with ylva johannsson is the result of strong lobbying by Thorn and Ashton Kutcher


The sheer effort going into getting rid of the "bureaucracy" isn't proportional to its "useless"ness, is it? It's not like these companies are a coalition of mom-and-pop shops struggling to keep the light on or something. If the directives are so incredibly useless, then these companies could easily let the people get their way and be happy while they keep chugging along making the same profits. Clearly they don't see that as an option.


Yeah no, the GDPR and DMA are definitely toothless bureaucracy from out-of-touch politicians.

Get out of here.


I didn't read the article because it is behind paywall but I fear it will actually have the opposite effect.

They have basically destroyed industry by strangling it with high energy prices and now they want to manufacture in Europe again.


It look like promising idea, though I'm a bit spectical that they can actually make it work with other executors like for example stackless coroutines transparently and it probably won't work with code that uses ffi anyway.


It seems like a huge stretch. The US still has a pretty good fertility rate for a developed country, much better than most of the Europe.


This can happen it every language. I have seen the same thing happen in a project written in Java when someone has wrongly set the bean scope.


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

Search: