Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I do love a bit of FP. Here's the canonical Hello, World! program.

    {-# LANGUAGE OverloadedStrings #-}
    {-# LANGUAGE QuasiQuotes       #-}
    {-# LANGUAGE TemplateHaskell   #-}

    module Main where

    import Foreign.C.Types
    import Language.C.Inline qualified as C

    C.include "<stdio.h>"
    C.include "<stdlib.h>"

    main :: IO ()
    main = [C.block| void {
      system("python -c 'print \"Hello, World!\"'");
      } |]


Except that someone installed a different version of python on the target system that changes the semantics of the print keyword.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: