3 ms·
> Simple tasks like fiddling with an API json response with rust, haskell or ocaml are always going to take longer than with python. This isn't true, you are g
by ghostwriter 4y ago
> Simple tasks like fiddling with an API json response with rust, haskell or ocaml are always going to take longer than with python.
This isn't true, you are generalising your own perception of the tools you're not as familiar with as python. For instance, here's how simple json api fiddling looks in Haskell, if written quick-and-dirty prototyping way:
-- requires packages: aeson, wreq, lens
{-# LANGUAGE OverloadedStrings #-}
import Network.Wreq (get, responseBody)
import Data.Aeson.Lens (key)
import Control.Lens
main = do
result <- get "http://httpbin.org/get"
print (result ^. responseBody)
print "---"
print (result ^? responseBody . key "url")
Now, how exactly is it taking longer than with Python?