News for hackers. Stuff that matters.
Re:Rust Is Surprisingly Good as a Server Language by johnfn on Monday July 13, 2020 @03:49AM (#23818202)
You mean a REPL, or an interpreted language?

I'd love a REPL that could somehow load the state of my entire app so I could test stuff out, but I've never found a language that could do that and also had reasonable type safety guarantees.

Re:Rust Is Surprisingly Good as a Server Language by brabel on Monday July 13, 2020 @04:53AM (#23818639)
With Jetbrains IDEs (IntelliJ, Webstorm, CLion) you can run a "sketch" that can "see" any module in your project. I use that a lot in Java/Groovy/Kotlin/Rust and it feels much superior to a REPL because I can write not just one-liners, but larger amounts of code, with all the features of the IDE like auto-completion, inline docs, syntax checking etc.
Re:Rust Is Surprisingly Good as a Server Language by zozbot234 on Monday July 13, 2020 @05:28AM (#23818839)
A test suite facility can also be used like this. And Rust adds any "examples" you write in the code (with proper doc formatting) to the test suite, as mentioned elsewhere.
Re:Rust Is Surprisingly Good as a Server Language by brabel on Monday July 13, 2020 @06:11AM (#23819096)
A test suite has a different use case... REPLs/Sketches are useful for exploration... both of your own design and of libraries you're using. Tests can be used for this as well, but it's not as convenient when you're very "early" in your exploration or have no code yet to test at all.
Re:Rust Is Surprisingly Good as a Server Language by estsauver on Monday July 13, 2020 @04:26AM (#23818459)
Some of the best solutions to that world right now seem to be things like lisps with dynamic typing added. You get a great set of repl support, but you can also build components and systems into easy wrapper scripts to load them as needed.
Re:Rust Is Surprisingly Good as a Server Language by hellofunk on Monday July 13, 2020 @05:30AM (#23818858)
I assume you mean static typing enabled. Because lisps are already dynamically typed to begin with.
Re:Rust Is Surprisingly Good as a Server Language by estsauver on Monday July 13, 2020 @06:31AM (#23819211)
Thanks, I actually meant gradually typed systems, like rust typed or closure with heavy spec usage.
Re:Rust Is Surprisingly Good as a Server Language by setzer22 on Monday July 13, 2020 @10:16AM (#23821011)
As a spec user in production, I must say it's very nice usability-wise and can help alleviate most of the issues coming from a lack of a type system.

But god it's slow... Some static analysis support would also be hugely appreciated. Not being able to check everything doesn't meen you shouldn't attempt to check something! Many specs are type predicates anyway.

Re:Rust Is Surprisingly Good as a Server Language by slifin on Monday July 13, 2020 @07:48AM (#23819715)
Clojure has a java type system which can be partially enforced statically with clj-kondo

Clojure spec is great at system boundaries but it's hard to describe it is a type system, it's a predicate system it can define very arbitrary constraints mostly at runtime

Re:Rust Is Surprisingly Good as a Server Language by hellofunk on Monday July 13, 2020 @06:57AM (#23819383)
I think you mean Clojure. Closure is something different.
Re:Rust Is Surprisingly Good as a Server Language by estsauver on Monday July 13, 2020 @07:00AM (#23819396)
What a terrible day for autocorrect, thank you.
Re:Rust Is Surprisingly Good as a Server Language by arethuza on Monday July 13, 2020 @04:35AM (#23818521)
Visual Studio can give you a REPL experience for a number of languages (notably C#, of course) using its Immediate and Interactive windows.
Re:Rust Is Surprisingly Good as a Server Language by ardfard on Monday July 13, 2020 @06:17AM (#23819134)
Have you try Haskell? The most used compiler, GHC, shipped with it's own REPL and it's quite good. Something I missed when coding in Rust.