Better HN
topnewbestaskshowjobs
Log inSign up

usrbinbash

4,687 karma · joined Dec 4, 2021 (4y ago) · 1,693 submissions

Submissions

comment 3y ago · link · parent

> The higher cost in developer time is a myth.

And yet, Go is a huge success in the industry, and one of the main reasons often given for chosing Go over a competing language, is how easy it is to get things started, how easy it makes the onboarding process, and how accessible and maintainable the code is.

> the type checking seriously helps you out when you are changing existing code

If you have Algebraic Datatypes in your codebase, which is not a given. Having a simple, easy to read language helps me out ALL THE TIME.

> But nothing is forcing you to use every feature of it.

And nothing forces C developers to use so many macros that their libraries resemble a completely different language where everything I thought I learned about C flies out the window. Nothing forces Python devs to use nested dictionary-comprehensions, that are, ironically, completely incomprehensible. Nothing forces C++ developers to use generics everywhere, regardless of whether they are actually needed or not.

And yet, that is, unfortunately, what is often happening in the wild.

The point here is; If a language offers X, then X will be used. And it will be used in smart ways, it will be used in unnecessary ways, and it will be used in not-so-smart ways. It will be used when it makes sense, and when it absolutely doesn't.

The thing the developers of Go figured out, and which, in hindsight, is surprisingly obvious, is that there is exactly one, and only one, foolproof way to prevent that from happening: By not having X in the language.

comment 3y ago · link · parent

> Go's compiler can't do that because the type system can't handle it

Correct. And that isn't a disdvantage.

The fact that Go's type system "cannot handle that" directly in it's type system (functionally, the language itself can handle that easily enough, as shown by the article I linked above) is a choice, which results in a simpler language.

And I still haven't seen any specific problems that would be prevented if Go included this feature directly in the type system. I have, however, seen a lot of extra syntax that Go doesn't need to support in its compiler, Go students don't have to learn, and Go devs don't have to worry about.

comment 3y ago · link · parent

> That link shows the Go type system's lack of expressiveness.

And I ask again what that is supposed to mean in technical terms, and what specific problems would be prevented if Go's type system was "more expressive".

> They're preferred

I am fully aware that for every given language feature, there are people who prefer that feature. And many languages reacted to that by including everything and the kitchen sink. That made many languages very "expressive", but that expressiveness comes at a cost: It also made the languages themselves become bigger and more complex.

Go isn't about having as many features as possible though. Quite the opposite, it's about having as many features as necessary, and as few as possible. Why? Because it keeps the language small and easy to learn and the code easy to read and maintain.

And to me (and judging by the sucess of Go I am not alone in this), that is a lot more important than a bit more "expressiveness" in things that one may come across every now and then.

comment 3y ago · link · parent

> At runtime. i.e. production.

At runtime, i.e. initial testing, pre-commit-checks, integration-testing, QA and then production, yes.

So there are a lot of checkpoints where the system can crash before it ever goes live.

> You think that is just as good as solving the problem at compile time?

No, I don't, and I never wrote that I do.

I do think that it's a lot better than not crashing and running inti undefined behavior when dereferencing a null pointer, which is a problem in older languages, and a source of hard to track bugs.

The problem is: solving it at compile time isn't zero-cost.

Languages that pretend that void pointers don't exist are usually more complex than languages that accept their existence as a fact of the underlying hardware. That extra complexity comes at a tangible cost in development time and maintainability. A language that fails early, and with a clear signal, will sometimes crash in testing, and maybe maybe maybe in production here and there, and such crashes may incur a cost. A more complex language will always incur a higher cost in developer time.

comment 3y ago · link · parent

> You're getting into the Turing tar-pit.

I am fully aware of that. My question is, what specific technical problems are caused by Go not having {feature_goes_here}.

> The big thing, though, is ADTs

Except it isn't a big thing, because for the few use cases where an ADT is actually, really, really, REALLY required, they can be expressed in Go using existing language features.

https://go.dev/doc/faq#variant_types

https://eli.thegreenplace.net/2018/go-and-algebraic-data-typ...

Quote: "It seems that Go can do just fine without adding variant types, due to the challenges mentioned in the beginning of the post and the ease with which the major use-cases can be implemented using existing language features." End Quote

On the one hand, yes, this is more verbose. On the other hand, these use cases are simply not frequent enough to justify making the languages syntax and type system more complex.

Again: Yes, Go lacks many features of other languages. That is on purpose. The language is made to be simple, as in "easy to learn, easy to read, easy to refactor, easy to generate, easy to maintain large bodies of code".

comment 3y ago · link · parent

The fact that Go doesn't have C's macros alone already makes it a lot simpler.

And please don't get me started on writing concurrent code in C.

comment 3y ago · link · parent

> Go's type system is much less expressive

Please, do explain: what does "much less expressive" mean, in technical terms? What specific data modeling can I not do in Go, and what specific bugs can be caused by that?

> and it has null pointers

Yes, so? De-Referencing a null pointer in Go crashes the program, making the bug very obvious. Go made the choice to have null pointers (which do exist in silica), and avoid the complexity of languages who pretend that null pointers don't exist.

It's a tradeoff, and a very good one at that.

comment 3y ago · link · parent

> When you search "golang" on google for a long time, the question "Why people hate Go?" comes up at the top.

I just did. Here are my top10 results:

https://go.dev/

https://en.wikipedia.org/wiki/Go_(programming_language)

https://github.com/golang/go

https://de.wikipedia.org/wiki/Go_(Programmiersprache)

https://gobyexample.com/

https://twitter.com/golang

https://github.com/golang

https://www.geeksforgeeks.org/go-programming-language-introd...

https://www.geeksforgeeks.org/go-programming-language-introd...

https://www.freecodecamp.org/news/what-is-go-programming-lan...

This continues down for dozens of results. Articles, Frameworks, Tutorials, Projects.

comment 3y ago · link · parent

> A strong type system helps quite a lot with logic bugs actually.

A static type system does, and all the languages that Rust has to compete with in its space, have one.

comment 3y ago · link · parent

> Rust kind-of owns that space

True. But it's a pretty small space to be in. And there are good reasons for that:

a) The only correctness Rust can, mostly, guarantee, is that there won't be unexpected data races or memory bugs. While this is proudly announced often and loudly, it also isn't the most common problem in code...logic bugs...against which the rust compiler can do as little as any other language.

b) Rust can only give these guarantees because it is ALOT more complex than C. That means harder to read, harder to write, harder to learn. And developer time matters. Alot. If I can already ship features, while my competition is still stuck in onboarding, it won't matter if my code has the odd memory bugs...those can be fixed...I will already have the market to myself.

comment 3y ago · link · parent

> so not really suited for performance critical stuff.

What "stuff" is that exactly? Because Go is designed primarily for backend services and microservices. Considering how much backend software is powered by Python, Java, or *retching sounds* PHP, I highly doubt that is a major consideration in that area.

And even when performance actually does matter to an extend where it becomes a more pressing issue than network latency, Go code performs incredibly well and is more than a match for most requirements.

> No OO

How do you figure? I can write in a completely object oriented style in Go. Also, OO is not a prerequisite for large complex systems, and quite often strict adherence to it can make code much harder to maintain than it needs to be. Maintaining large complex systems requires, first and foremost, code that is easy to grok and maintain. And regarding that particular area, Go runs circles around any major contemporary language, including Python.

> It seems that its popularity exceeds its scope

Considering how widespread it is by now, I highly doubt that.

comment 3y ago · link · parent

> The real entities we need to be afraid of in regards to privacy are governments & politicians, not companies & entrepreneurs.

Why not both?

> The worst thing a company can do is try to sell you more soap

No, the worst thing a company can do is to propagate the recorded data, willingly or otherwise (companies get hacked, forced by governments, etc.), to entities that won't be content with just using that data to sell more soap.

Oh, btw. Do you know who's in general VERY interested in all that sweet data such companies collect? That's right: Governments.

And politicians and governments, at least in all countries that I intend to live in, answer to the voter. Who do companies answer to?

comment 3y ago · link · parent

> Which is why all the LeetCode interviews always struck me as odd. They focus on algorithms, not data structures, which is exactly what you don't want to do out of the gate, most of the time.

Which is one of the reasons why I will never use that style of problems as an interview question.

And the other reason is: that style of problems also don't teach anything about architecture.

comment 3y ago · link · parent

It would be, if the professors website wouldn't suffer from false negatives as well. Which it most certainly will.

comment 3y ago · link · parent

Well, as far as government pages go, I have seen worse. Only tested it on Desktop.

The information density on desktop could be ALOT better, and that giant Title-Banner is just unnecessary. Page looks the same regardless of browser-preferred color scheme. That's about it with my criticism though.

With Brave-Browser Shields disabled, total page load for the landing page is 1.2MB, with shields active that goes to to just shy of 700kB. Still alot for a mostly-text landing page, but absolutely acceptable.

Search seems to be fast and works reasonably well. I tried "register a company", and the top results were very reasonably what I would expect a good search to return.

Subpages show a navigation bar on top. There is another toplevel nav-index at the bottom of the page, and in a top-right menu (which is actually labeled "Menu", a nice touch in a world of these awful hamburger-menu-buttons).

Page seems to also work fine with scripts blocked. This also brings the landing page load down to 412kB.

Content licence is clearly linked at the bottom of the page, with link to a detailed explanation.

-----

All in all, not bad. Not bad at all.

I'd like a bit more information density on desktop, and https://developer.mozilla.org/en-US/docs/Web/CSS/@media/pref...

comment 3y ago · link · parent

> 1% of earth's resources to have a chance, of let's say super pessimistically, 15%, of actually surviving as a species

That would be a good investment, yes.

Unfortunately, a Mars colony doesn't realize that investment. There wont be a self-sustainable colony on a planet, where even the planets gravity well (which we cannot change, unless someone has SG1-Asgard-level technology lying around) prohibits long term survivability of a species that evolved in a gravity well almost three times as strong.

comment 3y ago · link · parent

> Something that forces us to focus on what's important.

Primarily, it would be something that forces us to send rocket after rocket of supplies there, wasting countless resources in the process for very little, if any, practical benefit.

Because, no, there is nothing to be gained on Mars that can't be gained much more effectively via robotic probes, and no, a Mars colony will not be self-sufficient.

Investing resources for no good reason, is to me the exact opposite of "focusing on the important".

comment 3y ago · link · parent

> and so the researchers cannot definitively say that Mars ever had a magnetic field

We know that Mars had a dynamo-effect in the past from various measurements of the magnetization in its crust, indicating that it had a magnetic field.

https://en.wikipedia.org/wiki/Magnetic_field_of_Mars

comment 3y ago · link · parent

A case study in how accessibility and compatibility are important for long term commercial success.

> Although they arguably had better audio fidelity, they were more expensive than, and incompatible with, other makers' products and ultimately failed in the marketplace.

A lot of contemporary companies would do well to learn from the mistakes of the past.

comment 3y ago · link · parent

> Cargo rockets don’t all need to be launched at once, they just need to be ready to burn in the launch window.

So what's the plan, launch all those rockets into LEO, and then have them sit there for up to 2 years before sending them on their merry way?

Whos doing maintenance? Who repairs these rockets when they get hit by space debris? Who'd even know one was damaged? What's the backup plan when almost inevitably some of them will fail come travel-day? More rockets? Whos doing maintenance on them, and who pays for them?

Where are all these rockets coming from btw.? Spaceships aint cheap, they have to earn their keep by doing things like ferrying commercial cargo into LEO. Who can afford to have a fleet of them sitting around doing nothing?

Look, I'm not saying that any of this is impossible. I'm just saying that a VERY hard task, that we have never done before, just got an order of magnitude harder. At what point in this hardship am I allowed to wave a little cost-benefit-analysis and ask what exactly we gain from sending people to Mars (aka. nothing that can't be done better with robotic probes)?

> Return journeys will likely be limited to passenger rockets.

Let's start with: return journeys will be limited to rockets that are still operational after landing in a rock-desert, with zero support structures, on a sheet of powdery regolith-dust, and after having been blasted for months with Martian dust-storms, and subjected to extreme temperature differentials.

comment 3y ago · link · parent

Yes, and my microwave oven with integrated grill can do alot of things that my cast-iron skillet cannot. Problem is, when out camping, there is no power outlet for the microwave, and I'm pretty sure if it gets hit by heavy rain, or if I wash it in a stream, it will be broken afterwards.

For much the same reason, robots are much better suited to do exploratory work on Mars, than humans.

comment 3y ago · link · parent

> Apollo 13 for example was saved by human improvisation.

Yes, by human improvisation on the ground, with teams of engineers and scientists figuring out the exact steps the Astronauts had to perform, and transmitting these instructions up for the crew to implement.

Just like they would have done, and in fact did on many occasions, with a robotic probe that found itself in a pickle.

comment 3y ago · link · parent

> I actually think we've basically reached agreement.

Yes, I do think so too, and thanks for the discussion, I enjoyed it alot!

> I want to see Mars terraformed in the next few hundred years

I think it will be a few centuries until we have the technology to do that, and then carrying out the task will probably take further centuries, but I do think it is a worthwhile goal to work towards.

However, if I were looking for a first terraforming target, I would recommend Venus instead. Reasons being, the planets gravity (which we cannot do anything about barring some serious SciFi-esque breakthroughts in physics) is much closer to Earths (~0.9g), energy may be easier to come by due to it's proximity to the sun, and while its magnetic field is weak, it is still stronger than that on Mars.

> which starts with learning how to terraform Earth

Luckily, that is surprisingly easy. The biosphere is self regulating, so if Humanity manages to pull itself together and stop actively ruining it, it can undo the damage caused so far. Nature will do so anyway, eventually, the question our species has to answer is if we still want to exist by that point or not.

comment 3y ago · link · parent

> A colony will depend on the mother country / planet for quite some time, but has a chance to become materially independent in 150+ years

Boston was founded in a breathable atmosphere and a livable climate, in a land that contains building materials, wildlife, liquid water, and arable soil, all shielded from cosmic radiation by Earths magnetic field and in a gravity well our physiology has evolved to cope with.

Yes, life for the colonists was hardship and back-breaking work, but the basic building blocks for survival existed.

Which of these blocks are present on Mars?

comment 3y ago · link · parent

You are of course correct. I should have said: The lowest energy option for a Mars transfer happens every 24 months.

Transfer outside that window is possible, but requires more energy, which increases the transfer time, limits the payload, or both.

comment 3y ago · link · parent

> That is simply not true.

Yes that is true, as shown by the link I provided. Methane/LOX is simply one of the go-to options for liquid fuel rocket engines these days, whether or not these engines are intended to go to Mars or not.

And btw. SpaceX themselves market Startship as a transport vehicle "to carry both crew and cargo to Earth orbit, the Moon, Mars and beyond." https://www.spacex.com/vehicles/starship/

> the only current realistic shot at our species being multi-planetary.

I'm curious: How does building a base on Mars, that is 100% dependent on regular support from Earth to survive, contributes neither resources nor self-sustaining living space to our species, cannot terraform the planet, and cannot serve as a backup in case Earth goes boom, make our species "multi-planetary"?

A multi-planetary species has permanent settlements on more than one planet or moon, that are either self-sustaining, or contributing (resources), or both. These settlements serve a role beyond bragging rights and exploration. A Mars base, insofar as we could currently make it happen, doesn't do that.

If a 15th century nation brought 5 guys to some bare-rock-island in the middle of the Atlantic and left them there with the promise to drop by every now and then to bring them food, that doesn't make them a colonial power.

> free of NASA's hope-ending bloat

Funny that you mention NASA, because they actually do have a plan to make humanity multi-planetary: https://www.nasa.gov/feature/artemis/

Other than Mars, the moon is near enough to actually make permanent bases feasible, which could provide a platform for further space exploration (Launching something from 1/6th of earths gravity uses a lot less energy). Luna is near enough to support a colony, including rotating crew, and it actually has a resource that could become useful in the not-so-far future, that could be worth exploiting: https://en.wikipedia.org/wiki/Helium-3#Moon

comment 3y ago · link · parent

> thats why starship uses methane

No, that's not why. Starship uses Methane/LOX because almost all modern rocket engines do: https://en.wikipedia.org/wiki/Category:Rocket_engines_using_...

> Mars has water and CO2

Yes, it does. What is doesn't have: lots of available energy, industrial facilities, storage tanks, or any of the other things required to actually make in-situ methane/LOX production feasible.

You don't have to believe me, the helpful folks at CSS have provided all the numbers and background data:

https://www.youtube.com/watch?v=Wum8_8sWdeU

https://www.youtube.com/watch?v=GHjOXvmuZWQ

https://www.youtube.com/watch?v=s-MQrp2P2GI

comment 3y ago · link · parent

> that's already had 55 seconds of controlled flight

Good. And once it makes the trip to Mars and lands successfully, with 100t of payload, then I will accept it as an argument.

> Parachutes, aerobraking, skycranes

We are not talking about a 1025 kg science vehicle here, we are talking about 100t of cargo, that has to land in the same place, preferably intact. Good luck making a parachute that carries that weight in a 610 pascal atmosphere.

And latest the colonists will have to land a ship there, or they are stuck. So no, without ships being able to land on Mars, intact, Mars Colony is not happening.

And btw. since you mentioned Spaceship: I'm pretty sure landing the thing on mars and letting it take off from there, is what it says on their own website: https://www.spacex.com/human-spaceflight/mars/ (scroll down to the "TO MARS AND BACK" diagram)

> they just need to set up enough that the arriving humans can do it relatively quickly (days).

> We send pre-emptive missions to set things up (dig holes, set up solar panels, gather basic resources)

Good, then show me that the robots can do that, under the conditions pointed out above.

> I think we're just deeply divided on what we think ten thousand focused engineers with hundreds of billions of dollars in budget can accomplish in 10 years.

No I don't think we are. I am well aware that nothing about a Mars colony is physically impossible, or outside the reach of contemporary human technology, if we really want to do it. I think it would take somewhat longer than 10 years, given the technological difficulties, but I don't think it is impossible.

The thing where I think we disagree is, given all the problems I pointed out, whether or not it is worth it jumping through all those hoops just for...yeah, for what? For science? We have robots doing that on Mars, and they don't require habitats, or food, or water. Resources? Mars doesn't have any Earth doesn't already have in abundance. Land? The entire planet is an airless, freeze dried, irradiated, toxic wasteland. As a backup plan? Even after a thermonuclear war, Earth would still be more inhabitable than Mars.

Wanna invest the time and effort of 10000 engineers and hundreds of billions of dollars working in international cooperation into space programs? Fine by me! Here are a few suggestions:

    - The DART test was a huge success, we should develop that, because defending earth from asteroids could come in handy at some point
    - A moon base sounds awesome. btw. the Moon might actually have a valuable resource we don't easily get on Earth: https://en.wikipedia.org/wiki/Helium-3#Moon
    - Please build more deep space telescopes
    - ISS is getting old
    - There is lots of garbage in LEO that we need a solution for
    - Eventually we will need much better propulsion systems
All of these activities sound way better to me, than wasting resources trying to set up shop on a worthless ball of dust for no good reason.

comment 3y ago · link · parent

> is a way to create a habitat not controlled by any Earth government.

Yeah, a few tiny problems with that assumption:

a) Earth goverments can easily shut down launches from Earth. Since any Mars Base would be dependent on resupply for probably a very long time, that effectively gives them control.

b) Establishing a Mars Base doesn't work without government support to begin with, so they have their hands in from the start. And even if they didn't, being ruled by a corporation or billionaire overlord instead of a government would be a prime example of "Out of the frying pan - into the fire".

c) In a bid for Braveheart-Style "Freeeedoooooom!", Mars colony has no leverage over Earth. Zero. There is no Unobtainium on Mars.

d) Any ungoverned, larger group of humans, left to its own devices, will eventually form some kind of government, if only out of the need for self-organisation. Proof: The entirety of history.

Regarding d); Now, our Earth governments may not be ideal solutions. And yes, maaaaybe Mars Gov. will be an ideal utopia. I kinda doubt it.

Because that group would be under constant psychological pressure from several life-threatening dangers, where one mistake by one person could kill everyone. They live in a planet-sized dead wasteland, with very limited resources. They are locked in crowded habitats for most of the time. Their lifespan is likley cut short by radiation damage and low-gravity related physiological deterioration.

Now, I am not a psychologist, nor a political scientist. But under such conditions, I imagine the outcome of any government-formation-process to be...unpleasant.

1
161718
57