Whiley / WhileyCompiler

The Whiley Compiler (WyC)
http://whiley.org
Apache License 2.0
217 stars 36 forks source link

Std Native Method Implementations #1156

Open DavePearce opened 2 years ago

DavePearce commented 2 years ago

Need to figure this out in conjunction with the standard library.

DavePearce commented 2 years ago

One problem here is how to represent File. Some points:

Not sure how to reconcile this. One possibility is perhaps to allow for a native type fd which is hidden from the user. Then, on C/Rust platforms this is just a uint whilst on Java it is something else altogether.

Yet another approach on the JVM is to add a second level of indirection. Basically, an array of FileDescriptor objects which can be indexed into. I suppose that would work at least.