Re:Idris: A Language for Type-Driven Development
by grumpyprole on Friday January 20, 2023 @01:35PM
(#34457581)
Don't forget that "type derived code" also happens with any language that has implicit arguments, e.g. type classes in Haskell and implicits in Scala. For example, in Haskell, if I compare two lists-of-maps-of-tuples for equality, there are many nested equality functions involved, but the type class machinery generates this code, at compile time for me. In a language without this, e.g. OCaml, many generic operations like equality, to_string, serialisation, etc become very painful.
[ Parent
| on HN ]
Re:Idris: A Language for Type-Driven Development
by still_grokking on Saturday January 21, 2023 @02:56AM
(#34464737)
Even "implicits" (especially the explicit ones called `given`s in Scala) are extremely useful I don't think you need them for type-class derivation. Rust does not use "implicits" for that, I think.
Re:Idris: A Language for Type-Driven Development
by valenterry on Saturday January 21, 2023 @05:16AM
(#34465353)
How does Rust do it? Is it possible to derive using custom logic?
Re:Idris: A Language for Type-Driven Development
by still_grokking on Saturday January 21, 2023 @06:28AM
(#34465683)
If I would need to guess I would say it's done through Rust's macros.
But I would need to look this up also myself. I'm not 100% sure. (But I've never heard of any implicits implemented in Rust; they discussed this feature here and there, but it's not part of anything in the language or the compiler, afik).
OT: I've never seen you on the Heise forums ever since. But I guess there isn't much to miss anyway by now…
Re:Idris: A Language for Type-Driven Development
by valenterry on Saturday January 21, 2023 @10:43AM
(#34467151)
Hahaha, which name do you go by in Heise forums? I wonder if I remember you too.
Re:Idris: A Language for Type-Driven Development
by still_grokking on Saturday January 21, 2023 @11:28AM
(#34467548)
I prefer not to link accounts, but we've talked not only once. :-)
I've recognized your handle as I remember you as being one of the few people there who actually know what they're talking about when it comes to software engineering.
But I've also moved on. The overall level has dropped to a bottomless pit by now. It's no fun anymore.
Re:Idris: A Language for Type-Driven Development
by valenterry on Saturday January 21, 2023 @12:26PM
(#34468072)
> I prefer not to link accounts, but we've talked not only once. :-)
Fair enough and thank you for the kind words. :)
Re:Idris: A Language for Type-Driven Development
by still_grokking on Saturday January 21, 2023 @08:48AM
(#34466371)