News for hackers. Stuff that matters.
Re:The V Programming Language by higerordermap on Tuesday September 15, 2020 @12:40PM (#24483289)
Can use any compiler. (GCC sometimes optimizes better than LLVM, GCC has more platform support, TCC can be used for faster compilation).

LLVM interface is unstable.

That said there are things you can't properly implement by compiling to C.

Re:The V Programming Language by posix_me_less on Tuesday September 15, 2020 @01:16PM (#24483809)
> there are things you can't properly implement by compiling to C

Very interesting claim, any examples?

Re:The V Programming Language by pornel on Tuesday September 15, 2020 @07:47PM (#24488011)
• You don't control your ABI. For example, you can't reserve a register for error object return like Swift does.

• You don't control your stack and stack frames. You can't implement a segmented stack, for example.

• You have very limited options for unwinding. setjmp doesn't really cut it. You could leverage C++ exceptions or platform-specific things like SEH, but you can't design anything radically different.

• You can't have debug information fancier than #line and maybe reusing C++ name mangling. You can't make debuggers see your higher-level constructs and data as anything other than their lowering.

• You have very limited options for specifying pointer aliasing.

• If you don't want to inherit UB from C, you'll have to be very clever about using alternative constructs that don't cause UB while still compile to efficient code you wanted.

• If you mean standard C, not C with compiler extensions, then look at the whole list of non-standard intrinsics and built-ins for things C can't do.

Re:The V Programming Language by aweinstock on Tuesday September 15, 2020 @03:26PM (#24485651)
If your source language has some construct that you want to express as state machines (e.g. async, CPS, pattern match compilation), and you want to compile the state machine as direct threaded code[0] (which involves fewer branches than a while-switch), then if you're compiling to C, you need computed gotos[1], which are non-standard.

[0]: https://en.wikipedia.org/wiki/Threaded_code#Direct_threading [1]: https://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html

Re:The V Programming Language by mratsim on Tuesday September 15, 2020 @05:32PM (#24486954)
GCC, Clang, ICC do support computed gotos and you can fallback to ``while true`` loop + switch dispatch for others.

This is what Nim does: https://nim-lang.org/docs/manual.html#pragmas-computedgoto-p...

Re:The V Programming Language by thysultan on Tuesday September 15, 2020 @02:54PM (#24485250)
It's not only interesting, it's blatantly false.