5 ms·
Curious claim, considering OCaml fares pretty well in many language comparison benchmarks.
by LeonidasXIV 7y ago
Curious claim, considering OCaml fares pretty well in many language comparison benchmarks.
- jfkebwjsbx 7y agoLanguage comparison benchmarks are a tiny part of actual performance in the real world.
- LeonidasXIV 7y agoThey do translate into real-life performance though and unlike many other languages, for the most part without "writing C in language X".
- jfkebwjsbx 7y agoExtraordinary claims require extraordinary evidence. Claiming a functional language is as performant as a systems language is a very big claim.
- patrec 7y agoWhat's a "systems language"? Someone recently posted "awk as a major systems programming language". Ocaml is used in many performance and latency sensitive domains as a minimal amount of research would show you. Here's an example: https://www.janestreet.com/tech-talks/building-an-exchange/ https://www.janestreet.com/tech-talks/building-an-exchange/ It's also got a reputation for pretty predictable performance characteristics, fast compilation and ease of writing correct and concise code, properties C++, for example, does not necessarily share. Part of this is because the compiler is comparatively straightforward in what it does (and same for standard library), with the flip side that you leave some performance on the table. But that might not be a bad trade-off given that ocaml generally seems to be within a factor of ~3x of C++ (which can probably easily baloon up for specific problems, given that ocaml has e.g. poor SIMD and machine size int support). So you probably wouldn't want to write AAA game engines, crypto libs or numerical kernels in it. But my guess is that a language with those characteristics (and much faster iteration times) translates to better real world performance for many other types of tasks.
- jfkebwjsbx 7y agoThe same way you ask me to do a "minimal amount of research", you should do the same to answer the question about what is a systems programming language. Claiming "within ~3x of C++" answers your question. For the problems I work in (some of which you mention) even a 5% is a major deal. 300%? That’s just crazy talk and a non-starter. That’s what performance means and why most language benchmarks are usually useless: people writing them have no clue of what are the requirements of many fields.
- patrec 7y agoI tend to do my homework – system programming language is not some narrowly defined concept with an universally agreed on definition. People frequently put Go and Swift in that category (see the wikipedia). Are you suggesting Swift is systems programming when Ocaml isn't? If you run docker on Windows or macOS you are running a tcp/ip stack in ocaml (unless something has recently changed). I assume you mean 105% and 300%? And what are the 105% that are a major deal – the runtime relative to what the hardware could theoretically do? Or 105% relative to what you can get out of C++?
- pjmlp 7y agoParts of the Xen Hypervisor, Docker TPC/IP stack integration with the host OS, and the MirageOS are written in OCaml, it looks pretty much systems programming to me. Likewise, there is an endless amount of compilers in research written in OCaml. Last time I checked, anything related to compiler toolchains used to be considered systems programming.
- deleted 7y ago[deleted]