dart-lang / language

Design of the Dart language
Other
2.67k stars 205 forks source link

Feature Request: implementation of crypto #178

Open ibigbug opened 5 years ago

ibigbug commented 5 years ago

Hi Dart team,

Is there any plan for packages like crypto and encoding being implemented as part of the standard libs? As Dart will be running from "Server" side, so I guess packages like that will be very useful.

I'm trying to port the Golang implementation of those packages to Dart, but it's quite a huge amount of coding. So it will be awesome to hear that Dart will have packages like that as a part of stdlibs.

zoechi commented 5 years ago

I think this should be reported in dart-lang/sdk. https://github.com/dart-lang/sdk/issues/34452 might make it easy for server-side and Flutter.

ibigbug commented 5 years ago

I'm looking into the that issue, it's talking about FFI, but not actually any implementation of crypto related stdlibs, I'll assume those functionality will be addressed by calling another lang using FFI?

btw, sorry for putting the issue in a wrong place.

zoechi commented 5 years ago

FFI allows to call out to C libraries.

kevmoo commented 5 years ago

Not sure this is a language feature – @munificent @leafpetersen ?

munificent commented 5 years ago

I'm not exactly sure where corelib issues go, actually.

But, to the original question, there is already at least one package in Dart for crypto and there is a core library for encoding. I'm not sure if they cover your use case or not.

There aren't any plans to move crypto into the core libraries, and I think that's a good thing. In general, being in the core libraries causes more problems than it solves. Core libraries are very hard to evolve over time, and users have little control over which version of the core libs they use. If a poor API design choice is made in a corelib, we're basically stuck with it forever for compatibility.

Packages are much easier to evolve over time, control the upgrade story for, and replace entirely when a new better package appears.