Building Nim + Nimble on Ubuntu 22, "could not import: SSL_get_peer_certificate"

2022-05-24 Thread jwatson-CO-edu
Thank you, @thindil; the Reddit path worked. For completeness: 1. `wget http://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1l-1ubuntu1.3_amd64.deb` 2. `sudo dpkg -i libssl1.1_1.1.1l-1ubuntu1.3_amd64.deb` 3. Install normally. `choosenim` is by no means required; I just re

Nim v2: what would you change?

2022-05-24 Thread snej
* Null-safety, something like the “optional” type in Swift/Rust/etc where the dereference is tied to a test such that you can’t access the value unsafely (e.g. Swift's “if let” and “guard”, not C++'s “std::optional”.) * At the very least make “nonnull” ref/ptr annotations built-in and well-s

Mysterious error message

2022-05-24 Thread Yardanico
I think you might be misunderstanding what `distinct` is meant for. It's meant to create a new type from some existing type, yet make it so that you can't use any existing procs of that type on your new type without explicitly converting (not casting!) the distinct'd type to its base one. It's *

Mysterious error message

2022-05-24 Thread Sixte
So it turns out that a distinct returntype is pretty much useless and should be avoided.

Mysterious error message

2022-05-24 Thread huantian
The first branch of the when is never reached because the distinct string of the parameter isn’t the same as the distinct string you’re comparing too, I believe.

Mysterious error message

2022-05-24 Thread Sixte
Well, the concatenator '&' works well with two distinct strings. So, their types match. The `else` branch of the `when``should not be seen - it is statically clear that the first branch gets used. Since the ``else` branch is not used, it should not create a new distinct string. And it is a simpl

Mysterious error message

2022-05-24 Thread huantian
Each time you write distinct string it represents a different distinct string. First define a type to be distinct string once and replace all the other occurrences with it

Mysterious error message

2022-05-24 Thread Sixte
The following program does not compile: proc addoneb(a : distinct string, b : distinct string) : distinct string = when typeof(a) is distinct string : let v = a & b result = v else : result = cast[distinct string]("") proc run() =

Nim v2: what would you change?

2022-05-24 Thread ingo
decision time for "Unstable API" in libraries