Live data from Hacker News

Introducing Transport Layer Security in pure OCaml

openmirage.org

41–44 of 44 posts

Re: Introducing Transport Layer Security in pure OCaml

#41

On one side I see the flaws in the existing openssl and other C-based libraries and when written languages such as OCaml or Haskell those just would not happen. On the other hand those existing libraries work. Which can not be said of the new ones. At least the Haskell TLS library has logic flaws in it that I'm wondering why it works at all. And a lot of Haskell projects use the native tls package instead of the open…

The Conduit I/O library that we're building in Mirage/OCaml allows the application to select which SSL transport layer implementation that it's linking with. Both Lwt_ssl (which binds to OpenSSL) and OCaml-TLS will be supported when it's released for exactly this reason. There's a blog post due about this next week.

As to your other complaint that OpenSSL "just works", note that numerous issues have been swept under the rug over the years (see the LibreSSL CVS logs for more pointers). I'd suggest reading this paper about the most dangerous code in the world for more background: http://crypto.stanford.edu/~dabo/pubs/abstracts/ssl-client-b...

So when you're using the Haskell library and running into bugs, think of the time you're spending bugfixing and filing patches as a little social tax that contributes to fixing an important technical issue that threatens the stability of the Internet if it's not comprehensively addressed.

Re: Introducing Transport Layer Security in pure OCaml

#42

Earlier quoted context omitted.

Fun bit of trivia: Rust was originally implemented _in_ OCaml, and takes a lot of cues from it.

I saw a bit of OCaml code in Rust code-base recently, can you say what it's used for? I know that Rust is self-hosting now, but I swear I saw some .ml files there...

  ~/rust $ find -name '*.ml' | wc -l
  72
  ~/rust $ find -name '*.ml' | grep -v ./src/llvm | wc -l
  0
i.e. there are some OCaml files in a Rust checkout, but they're all part of LLVM, mostly part of the "OCaml Kaleidoscope": http://llvm.org/docs/tutorial/OCamlLangImpl1.html

Re: Introducing Transport Layer Security in pure OCaml

#43
post #21
post #13

Earlier quoted context omitted.

> OCaml could actually be a great choice for maintaining a solid TLS layer. Maybe; it uses GC and it's difficult to embed. I would much prefer something that compiles without a runtime (or with a minimal one for resource allocation).

The OCaml runtime is very easy to embed, as runtimes go. We've got it compiling in Mirage as a standalone kernel, as a FreeBSD kernel module, and others have had it running on 8-bit PIC microcontrollers: http://www.algo-prog.info/ocaml_for_pic/web/index.php?id=oca... A fun project that I discussed with the Rust devs at last year's OSCON would be to rewrite the OCaml GC in Rust. Get in touch with me if you're interest…

Consider me interested.

Re: Introducing Transport Layer Security in pure OCaml

#44
post #38
post #37

Earlier quoted context omitted.

More than price, what really hindered Ada was lack of adoption by popular OS vendors and hardware requirements for the early compilers. Back in the day everyone was paying for compilers, the prices were the normal ones for the target audience. Rational Software first product was an advanced Ada Machine, providing an early 80's InteliJ experience. Which followed the same fate as all special purpose computers. UNIX, ma…

> Home computers lacked the required hardware to implement a proprer Ada compiler. Could you elaborate? Are you thinking 80s home computers like the Amiga 1000, or more classical PCs?

Both, from the Spectrum days up to the time we could get them to run on 32 bits.

On those days I and many older than me were still writing business applications in Assembly. Compilers for higher level languages were constrained in what they could achieve in the amount of memory that was available.

And Ada did required lots of it. Funny enough I would bet modern Ada compilers are less resource intensive than C++ ones.

Post reply on HN