Hacker News new | ask | show | jobs
by kevingadd 4798 days ago
What I'm saying is, try writing some valid, compilable C#2-era code in a REPL and see what a good experience it is.

Saying 'haskell and ocaml are static and they have REPLs' is totally missing the point; the way you write code and express types in those languages is different. C# is one of those 'fully formed type with methods' languages, where you have to define an entire type and its members up front. Not particularly REPL-friendly, especially in 2.0.

Now, with the newer features added in C#4 and later versions of the language, it's possible to actually use it in a REPL because you can create instances of anonymous types and write lambdas with result/argument type inference and variables with inferred types, and you can define classes in multiple stages ('partial' classes).

A Java REPL would have all these same problems, even now. (Or did lambdas ship?)

1 comments

Have you tried writing Haskell in the repl? I would argue that just omitting the types (essentially var:ing everything) would still make a repl very valuable for trying stuff out while you write your code. When I worked at citrix I would debug constantly in ironpython and I would find and fix bugs 5 times faster than my coworkers that would write clunky command line programs.. A repl is a very powerful tool that any nimble dev should take seriously.