Hacker News new | ask | show | jobs
by behnamoh 2413 days ago
And not just Python, try writing a small script in Haskell or Clojure and you'll see how much burden there is to setup their environments.
3 comments

People hate on Gradle endlessly, but the fact that 99% of my JVM based applications can be successfully launched including entirely self-contained dependencies with

    ./gradlew run
is a huge boon and one of the things that keeps me sticking with the ecosystem.
You kind of mentioned this yourself already, but this boon is more of a feature of the JVM (the classpath) rather than the dependency manager.

If Python would have a similar concept rather than depending on a global module location we would be able to replicate the same developer ergonomics as we have for the JVM.

Well with Haskell and Clojure, many people just use a pretty plain text editor + a REPL and maybe. And for Haskell at least, that's super easy to install. I suppose there isn't One True Way, but each of the popular options (cabal, Nix+cabal, stack) are only a couple steps.

Haskell with new-style cabal works like a charm with `cabal init` for package setup. And then ghci from there will give you...

- expression evaluation ofc

- type-at-point via type hole annotations

- Laziness inspector via :print

- Breakpoint debugger (someone just posted a nice Reddit text post about it today)

- Package information of terms via :info (and :load $MODULE to get any top-level term in $MODULE into repl scope)

- Docs via :doc (this is pretty new)

- Module export lists via :browse

off the top of my head

In Haskell that would be (given Stack is not shipped with your OS's package manager, which is extremely rare):

  $ curl -sSL https://get.haskellstack.org/ | sh
  $ stack install turtle

  $ cat >> ./hello.hs <<EOL
  #!/usr/bin/env stack
  -- stack --resolver lts-14.14 script

  {-# LANGUAGE OverloadedStrings #-}

  import Turtle

  main = echo "Hello, world!"
  EOL

  $ chmod u+x ./hello.hs
  $ ./hello.hs
  Hello, world!

With Nix it would be even simpler.