Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Pity that they decided to just bother with C99 though.

Isn't this the trend nowadays? I've seen recently that simple languages are trending again, languages like C, Go, Zig, Erlang, Lua. I think we hit the ceiling with mammoths like C++ and Scala.



Not at all, proprietary graphics APIs provide modern bindings in C++, Objective-C, Swift.


C99 ensures it can be used with basically every other language and can be compiled for almost every platform. Bindings on top of that for other languages would be nice but can be provided by the community too. If it was C++, Rust, Nim, etc you'd have to write it in a way that allows exposing a C API anyway so the only advantage would be for people creating an implementation of the API getting to use a better language internally.


That can be achieved with an IDL that isn't unsafe by default and the cause of endless security bugs.

Then everyone can generate whatever bindings they feel like in an automated way.


But why C99 instead of C11?


What features does c11 provide that would be useful?


Atomic and Generics. Awkward to use and relatively unknown but c11 introduced them


How do atomics help a high-level graphics API? The implementation can use them, but threading probably shouldn't be part of the interface.

Generics are cool, but auxiliary to any core part of the api since it's not really possible to use them outside of in a macro that wraps over a real function.


Can't you (ie the programmer) still use them though? You can write C11 code which freely calls the C99 API. By using C99 the API is compatible with a wider range of compilers and callable from a broader range of languages.

(Also where would the API itself have benefited in any significant way from the use of atomics or generics? Recall that compiler support for atomics is optional in C11.)


Generic could help but that could be just a wrapper over the main api.


Because Microsoft basically won't support C11.


They do via clang, long part of Visual Studio installer (since 2015), Visual C++ as C++ compiler naturally not.

And they aren't the only ones, try to see how much of Apple or Google OS applications you manage to write with C11 alone.


They recently added it the roadmap though.


Where is this roadmap?

There is no public plan to add to Visual C++ anything more than what ISO C++ requires in terms of C source code and libraries compatibility.

Microsoft has contributed to clang on Windows for those that still want to use C.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: