I’m working on a universal tic-tac-toe backend that can be communicated with in any language via RPC. Should I chose Rust, or a higher level functional language like Haskell?

  • ace
    link
    fedilink
    arrow-up
    3
    ·
    4 years ago

    I think with this kind of project you could probably use any programming language you want. I don’t like the “high-level” vs “low-level” dichotomy when it comes to programming languages. While Rust has the capacity to do systems-level programming it also has a lot of sophisticated options when it comes to abstraction. Unless you have very specific requirements program in whatever you want/feel comfortable using

    • 𝐧𝐞𝐫𝐬
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      3 years ago

      A programming language is low level when its programs require attention to the irrelevant.

      –Alan Perlis

      I would say that choosing the best tool for the job is the cornerstone of all engineering. One should choose tools with the level of abstraction that best allow them to express their business logic, and best move the irrelevant out of the way. Rust’s sales pitch is that it offers tight control over memory in a way that is safer than, say, C++, without a garbage collector; but tight memory control is not really something one ought to concern themselves in a web app, a largely IO-bound problem space laden with dynamic languages such as PHP, JavaScript, Ruby, and Python. All of its other abstractions are equally present in all these other languages as well, even C++.

      Haskell does the opposite, making it a solid contender for web apps. It has high-level semantics (big-steps rather than small-steps) allowing one to almost exclusively focus on what is relevant; amazingly composable abstractions that allow one to think about data and types abstractly rather than as blocks of memory; and indeed offers more safety with far greater ergonomics than Rust can hope to achieve with its design constraints. The Haskell ecosystem is also quite mature, with high-powered tools and libraries for just about everything under the sun. It may be less-suited to close-to-metal tasks such as OS kernels and device drivers, though clever libraries exist to program microcontrollers and even FPGAs.

      Bottom line: if you’re just trying to get something off the ground, it probably doesn’t matter what you do it with. But if the journey is as important as the destination and you wish to hone the art and craft of software engineering, then consider giving Haskell a try. It is sure to bring joy.

  • pangyuehung
    link
    fedilink
    arrow-up
    1
    ·
    4 years ago

    If you’re learning, use the language that is most unlike what you’re used to.

    If you’re experimenting, try both side-by-side.

    If you’re making something more permanent, use whichever you’re more comfortable with or excited about.

  • MasseR@sopuli.xyz
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    I don’t think it’s possible to give an universal answer for that. Can you do it with Haskell? You bet. Can you do it with Rust? Sure thing.

    There are plenty of other considerations, such as are you doing it by yourself, are you hoping for a community, for work, how much effort are you willing to put etc.