finkel-lang / finkel

Haskell in S-expression
https://finkel.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
171 stars 2 forks source link

[suggestion] Standalone release #6

Open 0atman opened 4 years ago

0atman commented 4 years ago

Does it make sense to build a standalone finkel binary, statically-linked and ready for distribution?

Sure we'd not have stack available to us, but I have a few machines that stack is way overkill for, but I'd still love to play with finkel.

Thanks!

8c6794b6 commented 4 years ago

It shall be easier to run the finkel executable by distributing statically-linked one, but to compile Finkel source codes, various resources other than the executable itself are required. Without those, what the executable can do is not more than showing help messages.

Roughly speaking, the resources required by ghc to compile Haskell source codes are required by the finkel executable to compile Finkel source codes. For instance, compiling a simple Finkel program:

(defn main (putStrLn "hello"))

will require interface file and object code of the module containing the putStrLn function, which is System.IO module from the base package.

Bundling all the required resources (interface files, object codes, runtime system ... etc) for compilation as a standalone staticlly-linked binary is not yet done in ghc. Perhaps that is too much work for the finkel project to do.

In summary, if statically-linked ghc executable makes sense, I think making statically linked finkel executable will make sense. At the moment, I cannot find much usecases for such option. Please feel free to let me know if ther are any.

By the way, if stack is too heavy, installing ghc and cabal-installwith ghcup or with your favorite package manager might help the situation. Then the finkel executable could be built and invoked with:

$ git clone https://github.com/finkel-lang/finkel
$ cd finkel && cabal v2-build finkel
$ cabal v2-exec -- finkel help
0atman commented 4 years ago

ah, I see! Thank you for the explanation. I'll try the cabal method! :-)