6 ms·
Define "better". Probably it wouldn't be more secure because both would be scrutinized and production-tested about the same. It would protect us against some co
by dtech 13y ago
Define "better". Probably it wouldn't be more secure because both would be scrutinized and production-tested about the same. It would protect us against some common C errors but might make us vulnerable to "common" Haskell vulnerabilities. You really can't say.
It probably would be slower though, which is kind of a big deal for webservers and the like.
- mercurial 13y ago> It probably would be slower though, which is kind of a big deal for webservers and the like. More critically, it would only be useful to Haskell code. Haskell, unless C, cannot be embedded. Having a version in Rust - which does not rely on the runtime - ought to be safe from this kind of issue (baring any problem in Rust itself) while being still embeddable from external code. It would still be somewhat slower than C, and of course Rust is far from mature.
- tormeh 13y agoDoesn't Haskell compile first to C and then to native?
- h3st 13y agoNot since GHC 7.0: http://www.haskell.org/ghc/docs/7.4.2/html/users_guide/code-generators.html http://www.haskell.org/ghc/docs/7.4.2/html/users_guide/code-...
- stefantalpalaru 13y agohttp://www.haskell.org/haskellwiki/Calling_Haskell_from_C http://www.haskell.org/haskellwiki/Calling_Haskell_from_C
- mercurial 13y agoI was unaware of that. Looking a bit deeper into it, it looks pretty involved as soon as you want to do something non-trivial with it.
- drdaeman 13y agoNot in only could be embedded, but also compiled into dynamically linked library. (Shameless plug) I've collected examples of this here: https://github.com/drdaeman/haskell-library-ffi-example https://github.com/drdaeman/haskell-library-ffi-example
- platz 13y agoThe nice thing about this example is that you only need GHC to create the shared library, and then GCC can do the rest with just the .so file produced.
- nardi 13y agoHaskell is actually a very fast compiled language. Especially for webservers, where its concurrency shines.