News for hackers. Stuff that matters.
Re:Nim compiler — Pascal source code by zinclozenge on Sunday November 29, 2020 @12:37PM (#25246565)
No algebraic datatypes + pattern matching, yes I'm aware of libraries that implement it via metaprogramming, but that's not good enough for me.
Re:Nim compiler — Pascal source code by arc619 on Sunday November 29, 2020 @02:24PM (#25247316)
> No algebraic datatypes

Not sure what you mean there, there's product types with tuples and objects, and sum types as object variants.

> Pattern matching

Eh, I mean it's just sugar over a case statement.

  let
    num = 5
    str = case num
      of 1: "One!"
      of 2, 3, 5, 7, 11: "This is a prime"
      of 13..19: "A teen"
      else: "Unknown"  # Compile error if all cases arent covered.
As you say there's libraries that let you deconstruct and partially match more complex types if you need that. Being able to create things like pattern matching, async, and novel multithreading runtimes as a library in Nim shows how powerful (and useful) the metaprogramming is.

Enums in Rust are more interesting, but again nothing you can't do with an object variant.

Re:Nim compiler — Pascal source code by kevin_thibedeau on Sunday November 29, 2020 @01:19PM (#25246835)
Try using Rust without any macros.