
Our project started on its development journey with Haskell as the chosen language, after trying C++.
However, as Rust gained popularity and recognition for its performance and type safety, it seems that also software developer that use Rust will become more and more important for us and potential customers of our products and services. Hence, we decided to explore Rust as an alternative. Also, the attraction of Rust’s ecosystem, and growing community inspired us to give it a try, hoping it might offer advantages that could enhance our project and also bring additional benefits for Rustaceans.
The companies behind Rust:
- Amazon,
- Discord,
- Dropbox,
- Google (Alphabet),
- Meta, and
- Microsoft
That is why Rust seemed like a promising candidate, and especially given its strong emphasis on abstraction, performance and memory safety. However, as we delved deeper into the details of Rust, particularly the need for handling cyclic syntax graphs, Haskell’s strengths became evident.
Algebraic data structures that are cyclic make it much easier to handle cyclic syntax graphs which is considered crucial not just for syntax graphs. Haskell’s ability to seamlessly create and manipulate of such data structures proved to be the one. This capability, coupled with Haskell’s declarative style and powerful abstractions, made it clear that Haskell was better suited to meet the needs for us and our future customers.
Please find some more details including code examples: Detail Rust vs. Haskell
Admittedly, Rust makes it possible to declare data structures that are cyclic but only with traits that make use of keyword unsafe. The use of the traits Rc and RefCell combined with cyclic data structures will even make it necessary to have extra code to free the memory securely. Rust claims “…safety guarantees without needing a garbage collector.”, here. This advantage (not needing a garbage collector) of Rust in the puzzle is void when it comes to this important piece (cyclic data structures).
Despite Rust’s appeal and popularity, Haskell’s suitability for our project’s requirements became apparent. Its expressive syntax and adeptness at handling abstract data structures provided the flexibility and elegance necessary to tackle the complexities of our task.
Therefore, our journey reaffirmed the initial decision to proceed with Haskell. By embracing Haskell’s strength in handling cyclic algebraic data structures for syntax graphs, symbol trees and code generators, we are confident in our ability to deliver a solution that not only meets the project’s requirements but also accommodates the preferences of stakeholders, including those familiar with Rust, C++, C, Python and all other programming languages we can think of.