7 ms·
I think if you want to compete with Rust, C or Zig you want to have a rich standard library. I still hold that Go's success is attributed to the fact that you c
by giancarlostoro 5y ago
I think if you want to compete with Rust, C or Zig you want to have a rich standard library. I still hold that Go's success is attributed to the fact that you could build a web application out of the box, minus database drivers. The templating and web server is purely built in to Go itself.
I don't have to waste time evaluating web frameworks I can just start coding a website with net/http right away. Oh its production ready!? Amazing!
I do wish Go had more things built-in like email and other protocols.
If I were maintaining or creating a systems language, I'd invest in the standard library being powerful out of the box. I really secretly wish Rust / D had a web server baked in sometimes.
All things said, this is the first I've heard of Hare, and it looks nice to me from what little I've looked at.
- capableweb 5y ago> I think if you want to compete with Rust, C or Zig you want to have a rich standard library. I still hold that Go's success is attributed to the fact that you could build a web application out of the box, minus database drivers. The templating and web server is purely built in to Go itself. Rust doesn't seem to have that rich of a standard library, bunch of the official documentation asks you to add crates for lots of things. I find myself reaching for external crates for tons of things I'd expect to be in the language as well. I also don't think Go's success can be attributed to one single thing, but probably the biggest attribute would be that they are backed by one of the biggest tech company in the world, who have adopted it wholesale and would do so, no matter what, since they built and control it.
- Ygg2 5y agoProblem with that approach is best demonstrated with Python. Standard library usually comes with strong backwards compatibility guarantees. So it becomes ossified over time. Leading to - standard lib is where libraries go to die. Without stability guarantee, you risk introducing breaking changes between versions, which is worse. And inferior to just downloading a lib with most stars.
- lifthrasiir 5y agoThere are three approaches to standard libraries: 1. Include as much as possible. This has been Python's approach and is showing its limitation: you end up with lots of historical baggages you can't maintain. It took an eon to remove some dead batteries from the Python standard library [1]. 2. Exclude as much as possible. This is the preferred approach for most newer languages, which can't readily determine at which direction the language would be heading. These languages tend to weigh more on third-party libraries with their pros and cons. 3. Pick use cases and design the standard library only for those use cases. It would mean that you have a near-total control over the language's evolution, so you can include whatever you want without thinking about its long-term consequence (because you know a new addition would be necessary for your use case). This can be often seen from some smaller languages, but Go is in my opinion the only mainstream language using this approach and that's only possible due to Google's involvement. [1] https://peps.python.org/pep-0594/ https://peps.python.org/pep-0594/
- pjmlp 5y agoWith the benefit of being available everywhere CPython exists, third party is hit and miss, and maybe require C or C++ compilers as well.
- rtpg 5y agoRecently I've been writing a good amount of rust, looking for libs to help out, and have been pleasantly surprised at the depth of the Rust standard library at this point! I started trying to use something like tokio for async stuff, but found that Rust's standard lib threading primitives were already nice and numerous enough to get a lot of work done. The rust programming language book has a nice little project of building a multithreaded HTTP web server from scratch. Of course you don't necessarily want to do this for everything, but the fact that a lot of the primitives are present and with good abstractions is commendable! Go's stdlib stuff for web servers is obviously much easier to get rolling though. https://doc.rust-lang.org/stable/book/ch20-00-final-project-a-web-server.html https://doc.rust-lang.org/stable/book/ch20-00-final-project-...
- giancarlostoro 5y agoThat's amazing! I have the Rust Book but never finished it all the way through, I'm definitely looking forward to this, I had no idea it takes full advantage of other packages.
- steveklabnik 5y agoIt does not (well, historically it does not, I haven't checked it out in a while) use other packages. You build one yourself with the standard library. It's expressly about learning via a bigger project, not something you'd use in production. That'd be a waste, just use axum, and focus on writing your application, not on building a (very minimal and incomplete) http/1.1 implementation.
- giancarlostoro 5y agoThat's fine, it's the kind of project I've been meaning to do for myself, so wherever it leaves off at... chances are high I'll continue for my own personal learning.
- ddevault 5y agoI think that Hare has a pretty rich standard library, though balanced with a constrained scope which prevents it from growing without bound. Note, though, that web programming is not really a domain that Hare is designed for, so we're not too concerned about being able to pick it up and write a website with it. You can check out the stdlib here: https://docs.harelang.org https://docs.harelang.org Let me know if you think this strikes the right balance.
- cyber_kinetist 5y agoI really appreciate that Hare already has high-quality documentation (in terms of tutorials, language reference, standard library, etc.), which you usually don't get to see in other work-in-progress languages. (BTW, https://harelang.org/documentation/ https://harelang.org/documentation/ is the link for more general documentation about the language.)
- ddevault 5y agoThanks!
- rootlocus 5y agoPersonally, I find it hard to appreciate the stdlib when every identifier is optimized to use the least amount of characters. There's a module called `shlex` (what does that mean?), there are two types called `pwent` and `grent`, a type (can't find it again) has a size field called `sz`. Various types have single letter fields. There's a `chown` function under `os` and another one under `fs`. The "interface" for streams is defined by the very generically named type `vtable`. There's also a dedicated module just for creating a temp directory? There are dedicated modules for `linux` and `unix`, but then various os level types are defined in a catch-all module called `rt`. Also, no data structures? I don't see maps, arrays, sets. No support for custom allocators (where's the `mem` module)? The roadman mentions TLS, smtp, sql and http (no json?) but you're not too concerned with people wanting to use it for web development?
- zozbot234 5y ago
- lawn 5y ago> I still hold that Go's success is attributed to the fact that you could build a web application out of the box, minus database drivers. I attribute Go's success purely by it being pushed by Google. If we use Rust as an example, it's super easy to include high quality libraries (just add s line in Cargo.toml and you're good to go). Another example is Ruby and how it was made popular thanks to Rails, or how Elixir is making a splash in web dev thanks to Phoenix.
- geodel 5y ago> If we use Rust as an example, it's super easy to include high quality libraries (just add s line in Cargo.toml and you're good to go). Is this a joke? How the hell would I know which out dozens of library is complete, safe, well documented without significant research?
- indymike 5y ago> I attribute Go's success purely by it being pushed by Google. At the beginning Google's support really made a difference, but the continued traction of Go is really the result of it being a great tool to build network servers where you want a high level of performance.
- lifthrasiir 5y ago> [...] being a great tool to build network servers where you want a high level of performance. This was the case from the Day 1. Google strongly shaped the language's direction and that has a continuing effect on Go's success. Put it differently, if somehow we end up with the future without servers Go will have a very hard time.
- 411111111111111 5y agoIf you actually needed performance you couldn't use a garbage collected language. Golang isn't really faster then any other on the same playing field (compiled and with GC).
- Cthulhu_ 5y ago
- potta_coffee 5y agoGo has other things. Fast compile times. I can ship a binary, in place of Python, which requires a Python environment with all the modules I need, or a container, what have you.
- lelanthran 5y ago> I still hold that Go's success is attributed to the fact that you could build a web application out of the box, minus database drivers. May, partly, sure... I attribute Go's success due to the simplicity of the language. All successful languages tend to have one thing in common - they are extremely easy to read.
- hbn 5y agoIt also has some really unique meta aspects to it which are the appeal for me. Forget about needing to decide on a web server library because there isn't one in the standard library. With C++ you have to decide which parts of the language itself you're going to use. Trying to learn is incredibly intimidating, because you look up how to do something simple and there's 17 unique answers with a million opinions on which is best, and which will lead you into a nightmare of unmaintainable code. Go was built on the principle of being incredibly picky regarding what features are added to it. It's best assumed that any new feature that's proposed to be added will never be added, and until it goes through a heavy pitching process and gets hard-earned approval, it won't be there because the language has worked well enough without it up to now. Having the formatting forced into the source code is genius too. Whether or not I agree with the prettiness of every formatting decision, I'm just happy it's there, because it's less decisions I have to make, and no matter whose code I'm reading, I know it'll be formatted in the same way as everyone else's.
- andrewla 5y agoI can't speak for Rust or Zig, but for C I don't think this is true. If anything it's the opposite -- the C community is constantly writing replacements and enhancements to the standard library. C lacks good support for modules, but has excellent support for libraries installed on the OS level. The ability to have all the bells and whistles out of the box may be a lot of the appeal of Go, and is certainly a lot of the appeal of languages like Python. But it's not core to the ethos of C.
- eatonphil 5y agoGo's standard library is quite far beyond C and C++ in terms of features. Neither C nor C++ as far as I know have a JSON parser, CSV parser, language parser (Go for Go, but C for C, C++ for C++), web server, crypto libraries, and so on. Though C++ and Java both probably have more container/algorithm libraries builtin than Go does.
- jcelerier 5y ago> Neither C nor C++ as far as I know have a JSON parser, CSV parser, language parser (Go for Go, but C for C, C++ for C++), web server, crypto libraries, and so on. people already complain constantly that the C and C++ standard libraries are bloated though
- tialaramex 5y agoWho has complained that the C standard library is bloated? In C++ the standard library has several entire features that are regrettable and so just take up space (e.g. regex, yes regular expressions are useful, no the standard library implementation isn't what you want), as well as places where they kept thinking of new better ideas and now there's a trail of old busted stuff you shouldn't use in new projects. So of course people are going to say that's bloated, it is.
- electroly 5y agoI think there must be more to it than that. Rather, I'm sure it's necessary but I'm not sure it's sufficient. C# has all of that built-in, and actually even more, but I don't see that it's enough by itself to become broadly popular for web development.
- metaltyphoon 5y ago
- deleted 5y ago[deleted]
- arinlen 5y ago> I think if you want to compete with Rust, C or Zig you want to have a rich standard library. C's standard library is rather spartan and includes some security issues. What C does have is a) interoperability-friendliness, b) a vast ecosystem. People should learn lessons from C++'s success and understand how important it is to be able to easily consume C libraries.
- no_wizard 5y agoThen why is C# or F# not more popular? Microsoft ships a huge array of first party supported packages that include low level protocol libraries. I have yet to work at a Silicon Valley startup that used C# or F# though, despite it being a pretty solid choice in terms of "one language to rule them all" kind of thing like Kotlin / Java and (to maybe a lesser extent?) JavaScript. I respect the tools and the language Microsoft has put out there, I'm not saying its objectively better or worse. Especially F#, which is, to interject my opinion, an incredibly productive language on the same level as Go, and you get access to the rich .NET ecosystem out of the box.
- eatonphil 5y agoI think .NET is too recently cross-platform and MS isn't yet doing enough to promote them. I think C# and F# will get significantly more popular over the next 5 years. And if this doesn't happen it will have been pure mismanagement of opportunity by MS.
- UglyToad 5y agoTo give a slight clarification (though I ask the exact same question every Who's hiring thread time of the month) I think "not more popular in the startup bubble" is more accurate. As far as I'm aware Java and C# are still first/second by job listings in both the US and UK but in significantly less sexy enterprise settings. This might have changed since python became more widespread though.
- pjmlp 5y agoTry east coast companies instead.
- importantbrian 5y agoSomeone said Go isn't really a programing language so much as a DSL for writing web services. I think they meant it as an insult to Go, but I actually think it's Go's big strength. That plus having native concurrency explains a lot of Go's success. Being backed by Google doesn't hurt either.
- wheelerof4te 5y ago"I think if you want to compete with Rust, C or Zig you want to have a rich standard library" I don't think Drew wants to compete with any of these languages. That's the point of this article. Let's give this one some time before ruling it out right at the gate.