Live data from Hacker News

The Rust Platform

aturon.github.io

241–250 of 256 posts

Re: The Rust Platform

#241
post #239

Couldn't much of the function of such a "platform" be automated? One of the main constraints that would guide selection of crates for this platform metapackage is that they must have compatible dependencies. So package A depending on Bv1 and package C depending on Bv2 wouldn't work because they Bv1 and Bv2 would both have to be included, leading to a conflict. But this information is (in theory) encoded in semantic v…

  > So package A depending on Bv1 and package C depending on Bv2 wouldn't
  > work because they Bv1 and Bv2 would both have to be included,
  > leading to a conflict.
As mentioned in this thread, this already works just fine. Rust can handle both versions.

Furthermore, it's more than just a constraint problem; there's also integration issues, testing the whole thing together, etc.

Re: The Rust Platform

#242
post #74

Earlier quoted context omitted.

I don't think most of these are applicable to Rust. > - Conversions between our 5(!) string types are very common. > - Standard library I/O modules cannot use new, de-facto standard string types (i.e. `Text` and `ByteString`) defined outside it because of dependency cycle. We have one string type defined in std, and nobody is defining new ones (modulo special cases for legacy encodings which would not be worth pollut…

But if you have a large standard library and want to break the API, you can. If you have 100 different libs that are basically "standard" (who doesn't have `mtl` in their applications at this point), now you have to coordinate 100 different library updates roughly at the same time. If you forget even one of them, then you've broken everything. I think the argument for a large Prelude/standard lib is similar to Google…

Standard libraries - types, in particular - are the lingua franca between unrelated libraries. The more that's in your standard library, the easier it is to integrate different libraries.

The higher level the library (e.g. containing content specific to an application domain), the more magical-seeming libraries can be added to the ecosystem. The counter-risk is the standard library growing in undesirable directions that you can never change because you can't remove stuff.

The interstitial glue that lets third party libraries integrate with one another and be usable by your app: that's the single biggest reason for having a bigger standard library than a smaller one. It has very little to do with including the batteries in the box.

If you think it has something to do with including the batteries in the box, you'll be lured into the trap of making it easy to fetch the batteries from across the internet (that's almost the same, right?). The trouble is, the internet has 100 different batteries to choose from, and not only have you offloaded the choice onto the user, but the batteries use mutually incompatible terminals and you have to jerry-rig interfaces between them. Let a thousand flowers bloom, say some people: trouble is, waiting for the biggest flower can take years, and people pick different ones in the early days. A bad choice is better than indecision.

Low effort updates are even less what large standard libraries are about. Large standard libraries are much harder to update, not easier: there's much more surface area, so it's far easier to break an application - and since every application uses the standard library, you could potentially break them all. Easier versioning and updates are a strong argument for extracting out things into third-party libraries.

Re: The Rust Platform

#243
post #39

I wouldn't recommend following the Haskell approach. It hasn't worked well for us. (I took part in creating the Haskell Platform and the process used to add packages to it. I also used to maintain a few of our core libraries, like our containers packages and networking). Small vs large standard library: A small standard library with most functionality in independent, community-maintained packages has given us API fri…

I don't think most of these are applicable to Rust. > - Conversions between our 5(!) string types are very common. > - Standard library I/O modules cannot use new, de-facto standard string types (i.e. `Text` and `ByteString`) defined outside it because of dependency cycle. We have one string type defined in std, and nobody is defining new ones (modulo special cases for legacy encodings which would not be worth pollut…

Hash maps and trees: fine. What about database interfaces (e.g. a JDBC/ODBC/whatever equivalent)? What about HTTP servers - even the minimal declaration for what a synchronous request handler might look like? How about threadpooling - if you have multiple libraries that have parallelizable work, you certainly don't want multiple threadpools each thinking they have X many cores to work with, and you don't want the user to have to partition these things either - that's not a happy problem.

All things you can delegate to third parties, but not without lots of cross-talk and confusion until things settle down to winners and losers, which may be a long time in the future. Indecision can be costly.

Consider standard library profiles, with progressively higher levels of abstraction supported. It's the right decision for creating a good ecosystem. C and C++ took decades to build consensus on the more complicated libraries, and C++ eventually grew a pseudo-standard library in the form of boost to centralize efforts, simply because it is more efficient that way.

Re: The Rust Platform

#244

Earlier quoted context omitted.

Maybe a change in attitude? Stability can be a good thing. Go's standard library doesn't change that much, and that's a strength. How about: "std is where code goes when it's done". As is, really done. The API's won't need changing.

Sql? It does all the wrong things; singletons, no testability, cgo for implementations, side effects and you have to use every database differently based on their individual semantics. Virtually everyone I've ever spoken to either uses a high level wrapper around the sql library or a no-sql solution. That's the definition of 'stdlib is where packages go to die'. It's not that the API is unusable , it's just basically…

> "Sql? It does all the wrong things; singletons, no testability, cgo for implementations, side effects and you have to use every database differently based on their individual semantics."

SQL has its flaws, but it is testable. The testing approaches available vary depending on the implementation. For example, can write unit tests for SQL Server (using tSQLt, to give one example: http://tsqlt.org/ ).

Re: The Rust Platform

#245

Earlier quoted context omitted.

Sql? It does all the wrong things; singletons, no testability, cgo for implementations, side effects and you have to use every database differently based on their individual semantics. Virtually everyone I've ever spoken to either uses a high level wrapper around the sql library or a no-sql solution. That's the definition of 'stdlib is where packages go to die'. It's not that the API is unusable , it's just basically…

> "Sql? It does all the wrong things; singletons, no testability, cgo for implementations, side effects and you have to use every database differently based on their individual semantics." SQL has its flaws, but it is testable. The testing approaches available vary depending on the implementation. For example, can write unit tests for SQL Server (using tSQLt, to give one example: http://tsqlt.org/ ).

yeah no. If you have an interface and you need a separate test suite for each implementation of that interface, it's a terrible interface.

Re: The Rust Platform

#246

Earlier quoted context omitted.

> "Sql? It does all the wrong things; singletons, no testability, cgo for implementations, side effects and you have to use every database differently based on their individual semantics." SQL has its flaws, but it is testable. The testing approaches available vary depending on the implementation. For example, can write unit tests for SQL Server (using tSQLt, to give one example: http://tsqlt.org/ ).

yeah no. If you have an interface and you need a separate test suite for each implementation of that interface, it's a terrible interface.

The point is, there's nothing inherent in the design of SQL that stops it being testable, it just hasn't reached the SQL standards yet.

Plus, there are plenty of ways to test standard SQL, you can easily do so through stored procedures.

Re: The Rust Platform

#247

Earlier quoted context omitted.

yeah no. If you have an interface and you need a separate test suite for each implementation of that interface, it's a terrible interface.

The point is, there's nothing inherent in the design of SQL that stops it being testable, it just hasn't reached the SQL standards yet. Plus, there are plenty of ways to test standard SQL, you can easily do so through stored procedures.

I'm not talking about SQL in general, I'm talking about the golang sql module.

Read this if you think I'm wrong: https://github.com/bradfitz/go-sql-test/blob/master/src/sqlt...

Great abstraction, right? Love how you have to mangle the raw SQL right? no. It's a bad abstraction.

When you test the implementation and you have to know the details of the implementation to test it, that's like, the definition of a bad abstraction.

It is what it is.

...and ultimately, we're stuck with it because its part of the standard library.

/shrug

Re: The Rust Platform

#248
post #218

Earlier quoted context omitted.

Just because you haven't found a use for it doesn't mean it's useless. The stdlib datetime class is terrible and desperately needs to be wrapped. Arrow is a good wrapper. I don't know what you're on about with counting bytes.

I've wrapped datetime for company work (pre pandas, pre datetime64) to make sure it follows the rules of the data analysis platform we developed (adding functions for moving to next month of year based on various financial calendar rules for example). I wish I hadn't done it and had just wrapped a boost_datetime since the performance of datetime is slow when you have a large timeseries of them. The performance is esp…

Not everything is a DataFrame. You would use Arrow because you want a nice API for dates and times in use cases that have nothing to do with Pandas.

Re: The Rust Platform

#249
post #74

Earlier quoted context omitted.

But if you have a large standard library and want to break the API, you can. If you have 100 different libs that are basically "standard" (who doesn't have `mtl` in their applications at this point), now you have to coordinate 100 different library updates roughly at the same time. If you forget even one of them, then you've broken everything. I think the argument for a large Prelude/standard lib is similar to Google…

But even then, languages that have great, thriving easy to use dependency systems and package managers with small standard libraries still run into problems see: javascript

The issue with comments written this way is that there are no details to support the claim.

Writing "see: JavaScript" doesn't really help without context. Without context, one does no know if you meant "JavaScript in browser" or "JavaScript via Node.JS" or "I simply don't like npm".

I'm not claiming there aren't any problems; however, "problems" are situational and one person's "problem" is another person's meh.

I just think it's irresponsible to not provide detail when making such claims.

Re: The Rust Platform

#250
post #132
post #87

Earlier quoted context omitted.

The 'std lib is where libraries go to die' was invented by Python. The libs are shallow, don't break backwards compat and provide a substandard experience. Things that continue to improve provide an out of tree alternative package name. Python codebases that are resilient don't use much of "core", arrow for time, requests for http, simplejson, etc. Using core is an antipattern that will get you stuck on a version of…

I disagree. In the enterprise space it is quite common that we only get to use what it is in the computer and access to anything else is strictly controlled by IT. So if it isn't in the standard library or some internal library mirror, we don't get to use it, as simple as that.

I see where you're coming from, but I feel like it would be a mistake to expect the language or std lib to try to solve problems that are effectively organizational/cultural issues.
Post reply on HN