Live data from Hacker News

I Want Off Mr. Golang's Wild Ride

fasterthanli.me

451–460 of 508 posts

Re: I Want Off Mr. Golang's Wild Ride

#451
post #439

Earlier quoted context omitted.

Is that not the point? That you ought to map out that complexity in a type whose constraints must be satisfied in order to have a valid instance? If your string is invalid to start with and you need to correct it, then yes, you need to wrangle that complexity yourself. If you need some tools from another toolset - eg. String functions that can help you make a valid Path - then you will make multiple type conversion h…

The point is that should be part of the standard library, like wstring in C++.

https://doc.rust-lang.org/std/ffi/struct.OsString.html

I'm puzzled what you think is missing. What should be part of the stdlib that isn't currently?

Re: I Want Off Mr. Golang's Wild Ride

#452
post #399

Earlier quoted context omitted.

Python's scope & mutability rules are idiosyncratic, but that's a distraction from what's going on here. Let's go back to steveklabnik's ancestor comment: "That's not an identical translation, the identical Rust would be:" fn main() { let mut x = 1; x = "foo"; } He was saying the identical Rust would not be: fn main() { let x = 1; let x = "foo"; } These are being compared to the following Python: x = 1 x = "foo" So c…

I disagree that those are doing the same thing. I propose that the actual answer is c: use std::cell::RefCell; fn mystery_c() -> i32 { let x = RefCell::new(1); let capture = || x.borrow(); x.replace(2); return *x.borrow() * *capture(); } fn main() { println!("{}", mystery_c()) } Which is what I meant when I said that Box might be the analogous thing (I guess it's actually RefCell, whoops!). And note that in this case…

You lost me, boss! Why do you think mystery_c is closer to mystery_py than mystery_b?

Re: I Want Off Mr. Golang's Wild Ride

#453
I think its worth pointing out that the Rust code is more broken than the Go code in this example. Because Rust is trying to come up with a sane way to display the filename (a) it prevents users from using encodings the language designers did not anticipate and (b) it prevents the solution from integrating with other system tools. For instance, you can't run `rm "$(rust_program)"`, but you can with the Go solution.

But discussing any of this means you've missed the point of languages like Go. Instead of arguing about the best way to to represent pathnames that aren't a valid byte sequence under $PREFERRED_LOCALE, we should be talking to our customers and solving their problems.

Re: I Want Off Mr. Golang's Wild Ride

#456
post #278
post #101

Windows-focused rant. Plus a few reasonable points. Every language is complex at some level and in their own ways-Rust included. Every language hides some of the complexity of layers below it like assembly and thus hides hardware details. Computers are complex. Point granted. Fact is Go is a very reasonable set of compromises that let's real enterprise-scale work get done and run with solid performance. I've done wor…

Even if golang gets generics, it has so many other flaws that make it an non-starter for serious projects. This won't stop people who are driven by hype from using it of course.

Serious projects like major Cloud infrastructure? And what are these damning flaws? If they are damning performance flaws, then presumably no project can succeed in a language slower than Go. If they are static type safety flaws, then surely no project in a dynamic language can be successful. If they are lack of fine grained control over memory layout, then surely no major VM or interpreted language holds a candle.

Re: I Want Off Mr. Golang's Wild Ride

#457
post #86

Earlier quoted context omitted.

https://www.jwz.org/doc/worse-is-better.html

jwz is redirecting this link based on referer, you might want to not click on it (copy/paste works).

Does anyone know why he dislikes HN so much?

Tbh I kind of like the attitude and I warmly recommend just clicking the link :-)

Re: I Want Off Mr. Golang's Wild Ride

#458

Isn't basically all of this shortcomings of Go's standard library, not "Go the language"? The Go standard seems to be heavily geared towards doing work on the server-side, and "server-side" essentially means "Linux" today. If I'd need to write "client-side" cross-platform code that also needs to run on Windows, Go wouldn't be my first choice, also not my second or third. And TBH, most other languages are not that muc…

A standard library says a lot about the language. Even if someone made a much better path/file handling library for Go, another one of its strengths are the ubiquitous interfaces you can rely on across libraries. Unless the superior library gained a lot of adoption really quickly, it would remain largely irrelevant in the face of the standard that was set years ago by the Go authors.

Look at Go’s HTTP library. It’s much lauded for striking a good balance between performance and ease of use, but it’s not as performant as it could be. For that, fasthttp exists and is quite popular although not nearly as popular as the standard HTTP library.

Your comment gives the impression that this is a failure because the library for niche performance cases hasn’t become the go-to library for the general case. I disagree—it’s ideal that we have a canonical general purpose library and another for high performance cases.

Perhaps you would argue that we should have interfaces that allow for a pluggable performant implementation and an easy-to-use general purpose implementation? This is all well and good, but it’s inherently not possible, because the interface is about ease-of-use and the performance is achieved by trading off on friendliness. You might offer Rust as a counterpoint since many of its standard libraries use an interface that is suitable for the general case and the high performance cases; however, this is a lie: these interfaces (and the core language) are manifold harder to use than their Go equivalents. In other words, Rust’s “general purpose” interfaces trade ease of use for the ability to support high performance implementations. This tradeoff isn’t inherently bad, but it is bad to pretend as though it’s inherently good or that there is no tradeoff at all.

Re: I Want Off Mr. Golang's Wild Ride

#459

Earlier quoted context omitted.

What I don't understand is how they miscounted so badly. Even ignoring Han unification, Chinese by itself uses more than 65k. Or was there an intent to not encode some of these rarer characters? I haven't been able to find any info.

They didn't think they knew enough about CJKV to make that call, and so instead asked pre-eminent scholars from major Chinese, Japanese and Korean universities, and they replied that 21k was going to be enough. The reason they thought that they could fit Chinese into so few letters was that at the time, the CPC supported academics who wanted to reform Chinese towards fewer letters. Not long after, views about traditi…

The current policy seems to be to add characters to Unicode even if nobody uses them any more. Is that a complete flip from what it used to be? Because I feel like that's the only way character reform would have mattered.

Re: I Want Off Mr. Golang's Wild Ride

#460

Earlier quoted context omitted.

Elixir is a fantastic and small language. Jose Valim kept it reasonable. It just have so much depth with concurrency. The actor model is amazing and easy to think about too. I'm not entirely sure they overlap completely but the concurrency model is superb. I will probably only use Elixir for web application from now on (unless they don't have packages for certain API). Chris have made web development possible and man…

Elixir is Erlang anyway. The only difference between the two is basically syntax and a couple of bonuses in the Elixir STDLib, most of which wraps existing Erlang functions. You're praising Erlang's concurrency model, there's no such thing as Elixir concurrency model.

Yeah I understand that but not many people do Erlang from Elixir from my experiences. Also I find Elixir community is better for me as a web developer than Erlang.

But it's also inescapable to ignore Erlang when you dive deeper into the actor model. Several good actor model books are Erlang only. Unfortunately many people, including myself, ever actually do anything hardcore with Actor Model. There is a good blog post about several skill stages of erlang/elxir and OTP was at the very top in term of few people actually uses it. I can't recall it the author =/.

Actually, I like Elixir package management system and command line tool is much better. They recently have the release command line tool. Elixir have several more differences?

Post reply on HN