Conversation

maybe a hot take, but I think this "get it right before i let you run it" approach is straight up bad UX design and it's a shame new languages like Rust haven't rejected it. tell me where I've made mistakes but still let me run my code goddammit
Quote Tweet
I like this article a lot. I can distinctly remember when I first started realizing that working through compile errors and designing the types for my program *was* programming and that fixing those errors was meaningful, important progress. twitter.com/healeycodes/st…
Show this thread
3
11
Use REPL for snips of stuff. But I can’t see the point of trying to run code that is known to be broken. But yes use REPL for the bit you think is right. Or are you saying you need to put a break point in just before the broken bit so you can work out something?
1
Yeah, the elaborator would generate something like a 'ReportedIssue' node when a problem is encountered. This crashes the program if it is run, which would allow you to still experiment with the program while it's in a partially correct state.
2
1
So for Haskell you’ve got the mechanism, if I understand correctly. For dynamic languages like JavaScript or Python you can just try it out, much like a BASH script. So which languages would you suggest should have this capability?
1
I'm suggesting for statically typed languages like Rust, OCaml, SML, Scala, Java, Idris, Lean, etc. Languages where types are required as a part of understanding the meaning of a program. Put another way, languages that are intrinsically typed (as opposed to extrinsically typed).
1
Hmm I can see why said this added complexity. It would probably trigger a chain of unresolved types/calls results. This might mean that in many circumstances it still would not be possible to execute. You might have to introduce an ‘unresolved type’ as a holder.
1
We’d then need to simulate all the other method calls you make on that non existent type. So the compiler would now need to generate stubs for the calls and provide an implementation that threw an exception (for example).
1
Show replies