4 ms·
Unlike Haskell, Rust offers a unique combination of safety and runtime performance, which does provide real business value in sone domains.
by gameswithgo 6y ago
Unlike Haskell, Rust offers a unique combination of safety and runtime performance, which does provide real business value in sone domains.
- UK-Al05 6y agoAlgebraic data types, monads, and things based around those have tons of business value for writing correct business logic for non-performance critical code. You get that in haskell. Though admittedly you can get them other functional languages that are not quite as different. Like Ocaml.
- jolux 6y agoMonads are so cumbersome to implement and consume in OCaml that they are not very commonly used. Jane Street Core has monadic abstractions for things like async but it’s a pain without syntax extensions.
- lpage 6y agoThat was true until 4.08. OCaml now supports monadic let bindings, and more generally, user defined let bindings [1]. You get the benefits of ppx_let (Jane Street) but in a more general and syntactically nicer form. I still wouldn’t call it as nice as do notation in Haskell but it makes monads highly usable in OCaml without the need for an external dependency. [1]: https://github.com/ocaml/ocaml/pull/1947 https://github.com/ocaml/ocaml/pull/1947
- jolux 6y agoWow, I completely missed this! Nice.
- ghostwriter 6y agoRust's safety and runtime performance are not unique, and these properties can be improved further from the level of Rust. Have a look at ATS: - http://www.ats-lang.org http://www.ats-lang.org - https://www.youtube.com/watch?v=zt0OQb1DBko https://www.youtube.com/watch?v=zt0OQb1DBko
- wuschel 6y agoWhat kind of project would be a sweet spot to ATS? Would it be comparible with F* [1]? I would love to understand the nature of the theoretical advantage ATS has here over Rust. ATS seems to be very much a concept/language in R&D phase. Its ergononics are difficult ergonomics (have a look at the error messages), documentation and example projects sparse. [1] https://fstar-lang.org/ https://fstar-lang.org/
- ghostwriter 6y ago> What kind of project would be a sweet spot to ATS? I'd say a large mission-critical C codebase that decides to grow and expand a formally-verified kernel of its most important functionality - it can be a real-time sytem, an OS kernel, a HFT algorithm etc. Nowadays people seem excited about gradual typing in widespread dynamic languages like JavaScript and Python, because it allows them to adopt the best parts of static typing without having to rewrite the entire codebases in new langauges. Now imagine that you can introduce gradual formal verification to your battle-tested C codebase, without a loss in performance[1] and without forcing you into a new tooling ecosystem (compiler, debugger, profiler etc). Actually, you don't need to imagine it, because that's what ATS is :) > I would love to understand the nature of the theoretical advantage ATS has here over Rust. I'd say it's a synergy of two key features, that produce miracles when put together - 1) direct and safe pointer arithmetics [2], which enables the same data structures and optimisation tricks available in C, yet in a verifiable environment, and 2) refinement types [3]. > Would it be comparible with F* Unfortunately, I don't know much about F*, MS Research regularly releases a new PL prototype after the other and I lost my count on Koka[4]. > ATS seems to be very much a concept/language in R&D phase. Its ergononics are difficult ergonomics (have a look at the error messages), documentation and example projects sparse All true, but nonetheless it's a solid implementation of the mentioned theoretical parts, and if one dares to get through the objective lack of docs and ambigouos compiler messages, they are rewarded with an impressively powerful production-ready system-level compiler, complimentary to their standard C ecosystem which has decades of accumulated wisdom. That's the level of code-reuse other ecosystems can only dream of. [1] http://blog.vmchale.com/article/ats-performance http://blog.vmchale.com/article/ats-performance [2] http://blog.vmchale.com/article/ats-safe-pointers http://blog.vmchale.com/article/ats-safe-pointers [3] http://ats-lang.github.io/DOCUMENT/INT2PROGINATS/HTML/c2584.html http://ats-lang.github.io/DOCUMENT/INT2PROGINATS/HTML/c2584.... [4] https://www.microsoft.com/en-us/research/project/koka/ https://www.microsoft.com/en-us/research/project/koka/