Comments (3)
One possible solution is to merely document the differences in platform behavior and leave it to the API user to handle the differences appropriately. For example, some of the file system API mentions that atomicity is platform-dependent.
I think the most important concern is 1. making it practical to write optimal software that does the best combination of syscalls on any given OS, closely followed by 2. making it maintainable to do this for all the supported operating systems being abstracted over.
In other words, I would rather solve the problem by pushing the OS differences onto the API user, than do a bunch of work behind the scenes to make one system emulate a different one.
from zig.
Agreed, I think that's the most viable path forward for something like this where trying to hammer one platform's behavior to match the shape of another would likely incur a significant 'optimality' penalty in one direction or another. Plus, matching the platform convention for each platform doesn't seem like the worst thing in this case.
Can always revisit this decision later if there's more context that's missing.
from zig.
An additional note: the Linux behavior here matches the behavior of mkdir -p
on Linux:
$ ls
$ mkdir -p first/../second/../third
$ ls
first second third
So this seems to basically be the same dilemma as #7751 and #4658 (comment)
from zig.
Related Issues (20)
- for loop error HOT 1
- undefined symbols when cross-compiling Windows from Linux and linking LLVM (user project) HOT 2
- Recursive infinite comptime fn loop segfaults/stack overflows the compiler HOT 2
- building zig on nixos regressed HOT 3
- Compiler error printing struct containing slice of `format`table elements HOT 1
- Improve the error message note when an Error Union Type is found but the compiler expected a normal type
- zig fail to build on OpenBSD -current (upcoming 7.5) - msync reached unreachable code HOT 1
- `zig cc`: unsupported linker arg: -stats HOT 1
- Erroneous `local variable is never mutated` error when assiging to dereference HOT 2
- do not analyze functions with pointer if they're not called from comptime or used at runtime HOT 2
- compiler crash taking address of function body as comptime arg HOT 4
- `std.os.windows.GetFinalPathNameByHandle` has a reachable `unreachable` HOT 3
- occasional error:FileNotFound with empty zig cache on MacOS HOT 21
- `zig init` does not work as the documentation says it should HOT 4
- Incorrect error message HOT 6
- compiler crashes (`@intFromEnum`?) HOT 20
- std.EnumMap has no const iterator HOT 2
- zig c++ errors with boost HOT 4
- A hello-world C program just segfaults on Debian Jessie, which is produced by `zig cc` and target `arm-linux-gnueabihf.2.19`
- `GeneralPurposeAllocator` reports `error.OutOfMemory` despite having more than enough free memory.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zig.