finkel icon indicating copy to clipboard operation
finkel copied to clipboard

[suggestion] Standalone release

Open 0atman opened this issue 3 years ago • 2 comments

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!

0atman avatar Aug 28 '20 12:08 0atman

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

8c6794b6 avatar Sep 03 '20 18:09 8c6794b6

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

0atman avatar Sep 06 '20 08:09 0atman