druntime
project-ffi-unwind
druntime | project-ffi-unwind | |
---|---|---|
2 | 1 | |
658 | 37 | |
- | - | |
9.5 | 3.6 | |
over 1 year ago | 8 months ago | |
D | ||
Boost Software License 1.0 | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
druntime
-
Comparing Exceptions and Errors in D
Oof, seems I got the camelcase wrong. It's `@mustuse`
Working on updating that.
I think the reason the documentation is cryptic is because it's a library-supplied User Data Attribute that is specially recognized by the compiler. The documentation generator is having trouble with it. In code it's pretty simple:
https://github.com/dlang/druntime/blob/705fb36e5fc4d930eed85...
-
CppCast: Dart and Crafting Interpreters
D
project-ffi-unwind
-
Comparing Exceptions and Errors in D
FWIW, C++'s noexcept specifier turns exceptions into aborts rather than letting them escape [1]:
> Non-throwing functions are permitted to call potentially-throwing functions. Whenever an exception is thrown and the search for a handler encounters the outermost block of a non-throwing function, the function std::terminate or std::unexpected (until C++17) is called:
Microsoft's dialect of C++ has a nothrow attribute which is purely advisory, like D's, and is now deprecated in favour of noexcept [2]:
> We recommend that all new code use the noexcept operator rather than __declspec(nothrow).
> This attribute tells the compiler that the declared function and the functions it calls never throw an exception. However, it does not enforce the directive. In other words, it never causes std::terminate to be invoked, unlike noexcept, or in std:c++17 mode (Visual Studio 2017 version 15.5 and later), throw().
Rust has panics, which by default unwind, like exceptions, but can be compiled to abort instead [3]:
> By default, when a panic occurs, the program starts unwinding, which means Rust walks back up the stack and cleans up the data from each function it encounters. However, this walking back and cleanup is a lot of work. Rust, therefore, allows you to choose the alternative of immediately aborting, which ends the program without cleaning up.
I don't believe there is any stable or planned way to declare that normal Rust functions cannot panic (so should abort instead of letting the panic escape). But there is some work towards the idea that extern "C" functions should do so [4].
[1] https://en.cppreference.com/w/cpp/language/noexcept_spec
[2] https://docs.microsoft.com/en-us/cpp/cpp/nothrow-cpp?view=ms...
[3] https://doc.rust-lang.org/book/ch09-01-unrecoverable-errors-...
[4] https://github.com/rust-lang/project-ffi-unwind/blob/master/...
What are some alternatives?
ldc - The LLVM-based D Compiler.
tsv-utils - eBay's TSV Utilities: Command line tools for large, tabular data files. Filtering, statistics, sampling, joins and more.
JikesRVM - Jikes RVM (Research Virtual Machine)
glibc - Unofficial mirror of sourceware glibc repository. Updated daily.
go - The Go programming language
pijamas - A BDD assertion library for D
dmd - dmd D Programming Language compiler
tshare - The fastest way to share your files on the web, for free
DaNode - Small and flexible web server written using the D 2.0 language