Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can GHC executables share runtime code?

Say someone want to recreate standard POSIX executables (cat, dd, ls ...) in Haskell. But executables that GHC generates all include runtime code. So, is it possible

  • to share runtime code between several executables and make them smaller and faster to load?
  • to use one garbadge collector per system? (not sure if this is good optimisation)
like image 967
danbst Avatar asked Sep 29 '26 06:09

danbst


1 Answers

  • People have created typical unix utilities in Haskell, just look at Linspire.
  • You can use shared libraries with Haskell, or more specifically, with GHC. Even the RTS can be a shared library.
  • You can not have one garbage collector instance collecting for multiple processes (if that is what you ment). This also would not be a good idea seeing as the currently implemented GC schemes must stop the mutator threads during collection.
like image 125
Thomas M. DuBuisson Avatar answered Oct 02 '26 07:10

Thomas M. DuBuisson