Wrote a macro to make ccall look a little more like Julia. Need an opinion on the return type placement

The more I think about it, the less I like it. The way it is now, everything in the generated code is clearly shown in the input code. I don’t like the idea that a macro with the same name as a built-in function would have different behavior. I’ll write another macro that does what you suggest. I’m thinking @safecall, unless someone has a better name. Or maybe @callc? Not as obviously what it’s changing, but it’s shorter and has the benefit of not “lying” by using the name of a built-in but changing the behavior.

Regarding the issue you referenced, it might be interesting to see if there is a way to statically determine if code is being run in a separate thread or task and see if there is a way to alter the semantics of ccall on that basis. If it were possible, @unsafe_ccall would only be semantically different in concurrent code.

Of course, I don’t know anything about the compiler, and I expect statically analysing for concurrency is probably rather tricky (on the other hand, Julia’s current ability to statically analyse code is already bordering on the occult, so what do I know?)