OK so just a random list of common packages a web app could use that come to mind :
- HTTP server
- HTTP client
- Logging
- Database
- Distributed cache
- File storage/blob storage
- Push notifications/SMS if dealing with mobile
- Auth (eg. OAuth/OpenID Connect middleware)
- Background task management/queue
And then there's libraries that wrap access to external services, specific protocol libraries like gRPC or GraphQL.
I would say the number of pure libraries that you reference directly in a modern webapp is probably very low, that's all a layer below.
Also System.IO.Unsafe exists.
add : Int -> Int -> Int
add x y = x + y
There is no way a function like this can run a Bitcoin miner, all it can do is to return an `Int`. In order to do side effects, a function must return a special `IO` type that should then be returned from `main` (and only then these side effects would be performed).There are already some frameworks out there who use signed metadata and databases to track code and where code comes from. But on the source code level, I think the metadata could just be extracted from the existing Crate metadata and source code.
This is really interesting. Do you have a source to cite proving this claim?
What does that even mean? Rust is very far from having anything to do with FP. FP implies immutability and heavily shared structures. Rust hates shared structures with a passion, it requires ownership. You have to jump through some massive hoops to get the same benefits of shared data structures in Rust.
> FP implies immutability and heavily shared structures
FP does imply immutability, but not sure what you mean by “heavily shared structures.”
If you’re referring to a type system like Haskell’s then that’s what I meant by “FP-adjacent.”
> Rust is very far from having anything to do with FP
This thread has a pretty deep rust vs haskell discussion: https://www.reddit.com/r/rust/comments/4jh8hv/question_about... Clearly, there are some similarities.
> You have to jump through some massive hoops to get the same benefits of shared data structures in Rust.
Again, not sure what you mean by “shared data structures.” Functional styles work well in rust. You could use only immutable variables with clone/copy sprinkled throughout and the borrow checker won’t complain.