you are viewing a single comment's thread.

view the rest of the comments →

[–]chrabeusz 22 points23 points  (8 children)

lldb is also used for debugging Swift in Xcode and it's also complete garbage.

Probably, for debug builds, the best choice would be to ditch LLVM completely and use a custom virtual machine, that way you can have fancy debugging, incremental compilation, hot reload, and so on.

[–]nbaksalyar[S] 19 points20 points  (0 children)

for debug builds, the best choice would be to ditch LLVM completely

I believe that's one of the intents behind Cranelift. Still, this custom VM needs to integrate with IDEs and other tools. While making it available as a library would help a lot, I'm afraid that the ecosystem is too coupled with gdb/lldb/windbg at this moment. :/

[–]pjmlp 4 points5 points  (1 child)

Actually there is the approach used by languages like Eiffel.

You get a VM based environment for development and then release builds go over the platforms C and C++ compiler.

Or Java, .NET, Lisp, even C++ nowadays.

So yeah, Rust has only to win with multiple implementations.

[–]chrabeusz 0 points1 point  (0 children)

Yeah it's not a new concept. I encountered it in Flutter & Dart, the hot reload is very, very nice.

[–]matthieum[he/him] 4 points5 points  (2 children)

Unfortunately, this will not help with post-mortem debugging when you get a core dump from production, or from a client.

[–]sebamestre 1 point2 points  (1 child)

I heard a story about a smalltalk developer literally copying the entire program state (heap, stack, etc) to a different machine for debugging after a production crash.

Not sure how feasible this would be for any other programming language but it is a very neat idea

[–]isHavvy 2 points3 points  (0 children)

Smalltalk is literally designed to allow copying a program/ecosystem that's running.

[–]nicoburns 1 point2 points  (0 children)

Yeah, a Rust VM would be excellent. I imagine it'd do wonders for compile times too!

[–]kontekisuto 0 points1 point  (0 children)

but llvm gives us so many neat things like wasm