News for hackers. Stuff that matters.
Re:Show HN: bashttp - a very (very) simple web server in Bash by yakshaving_jgt on Wednesday July 20, 2022 @05:47AM (#32163435)
A very (very) simple Hello World program in Haskell.

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

    module Main where

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

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

    main :: IO ()
    main = [C.block| void {
      system("python -c 'print \"Hello, World!\"'");
      } |]
Re:Show HN: bashttp - a very (very) simple web server in Bash by kretaceous on Wednesday July 20, 2022 @08:14AM (#32164627)
Can anyone explain how is this related to the post? I genuinely don't get it.

I see C and Python/some kind of FFI.

Re:Show HN: bashttp - a very (very) simple web server in Bash by yakkomajuri on Wednesday July 20, 2022 @08:24AM (#32164729)
The point here is that OP's "simple" Bash server just offloads everything to netcat. Just as the program above does with Python.

EDIT: Just explaining the criticism, not necessarily subscribing to it - I don't think OP's point was to write something in "pure" Bash

Re:Show HN: bashttp - a very (very) simple web server in Bash by kretaceous on Wednesday July 20, 2022 @08:38AM (#32164874)
I see, thanks!
Re:Show HN: bashttp - a very (very) simple web server in Bash by tpoacher on Wednesday July 20, 2022 @05:48AM (#32163448)
lol, oh you!
Re:Show HN: bashttp - a very (very) simple web server in Bash by M4tze on Wednesday July 20, 2022 @08:20AM (#32164695)
Better tell him/her what you are thinking instead of making fun of him/her.
Re:Show HN: bashttp - a very (very) simple web server in Bash by Brian_K_White on Thursday July 21, 2022 @03:48AM (#32176822)
They did. And in a perfectly valid way.

Better to not announce to the world "Hey everyone! Whaddya think?" If you can only tolerate approving answers. No one made them post a bad version of a one-liner that could already be googled up from 20 other examples already out there and better engineered.

This sort of send-up is actually perfectly on target, and frankly actaully light hearted.

Everyone posting critiques like this and like my own, knows full well that they have their own excrable works of art out there. We've all been figurative 7 year olds and made terrible crayon drawing programs, and even been ignorantly and adorably proud of them at the time.

Re:Show HN: bashttp - a very (very) simple web server in Bash by dqft on Wednesday July 20, 2022 @01:24PM (#32169122)
Better to just laugh at the good joke.
Re:Show HN: bashttp - a very (very) simple web server in Bash by tedmiston on Wednesday July 20, 2022 @10:09AM (#32166019)
Username checks out.