Re:Don't run 'strings' on untrusted files
by yohanatan on Saturday October 25, 2014 @03:54PM
(#8509205)
I think you are overlooking OCaml & Haskell (which can both be used skillfully to approach performance of C).
[ Parent
| on HN ]
Re:Don't run 'strings' on untrusted files
by meowface on Saturday October 25, 2014 @04:07PM
(#8509243)
Are there examples of either OCaml or Haskell being used for systems programming? I know that algorithmically they can achieve pretty close performance, but I don't think support is that great for low-level operations.
"Ivory" is a Haskell embedded domain specific language for writing safe C programs. One (very loose) way of thinking of it is that it compiles a restricted subset of Haskell to low level C.
Re:Don't run 'strings' on untrusted files
by yohanatan on Saturday October 25, 2014 @04:31PM
(#8509298)
There is also 'Atom' which is an embedded DSL in Haskell for writing real-time embedded systems:
http://en.wikipedia.org/wiki/Atom_(programming_language)
Re:Don't run 'strings' on untrusted files
by tokenrove on Saturday October 25, 2014 @04:26PM
(#8509288)
You might consider Mirage OS (http://www.openmirage.org/) to be systems programming.
Re:Don't run 'strings' on untrusted files
by thirsteh on Saturday October 25, 2014 @04:23PM
(#8509282)
It's hard to tell what you mean by "low-level operations." A lot of systems programming, particularly the GNU suite, just deals with manipulating files, sockets, and so on, and Haskell can do that just fine.
Example: http://www.haskell.org/haskellwiki/Simple_Unix_tools
Re:Don't run 'strings' on untrusted files
by more_original on Saturday October 25, 2014 @07:02PM
(#8509678)
Maybe you could have a look at "Unix system programming in OCaml"?
Re:Don't run 'strings' on untrusted files
by kryptiskt on Saturday October 25, 2014 @04:07PM
(#8509242)
Haskell is great, but GHC's runtime system is 50000 lines of C.
Re:Don't run 'strings' on untrusted files
by thirsteh on Saturday October 25, 2014 @04:17PM
(#8509261)
Which is relatively inconsequential as long as there's a clear boundary between things that can be manipulated by a user and the C code.
It'd be better if it wasn't C at all, sure, but, from a security perspective I'd take a language with a C runtime over a language where code has to be carefully written in a memory-safe manner any day.
GCC is written in C/C++. I don't think any of the compilers are dogfooding their language because its supposed to be reusing infrastructure.
I'd hope an LLVM compiler for a language would eventually be dogfooded, though.
Re:Don't run 'strings' on untrusted files
by yohanatan on Monday October 27, 2014 @02:17AM
(#8514143)
http://en.wikipedia.org/wiki/Bootstrapping_(compilers)
This is pretty much the first thing that everyone writes in their new programming language.