Possible workarounds for subclassing a c++ class and overriding a virtual method

2022-04-20 Thread sls1005
> Isn't including actually creating another copy of the emitted code ? Yes, copy to the translation unit.

static binaries

2022-04-20 Thread kaushalmodi
As @archnim said, std/db_postgres is an impure lib. So Nim tries to link to it dynamically by default. If you want to build a static binary with that library, you need to first build static version of that library. As a example, see

static binaries

2022-04-20 Thread archnim
Bro, what I understand is that you want to imoprt std/db_postgres in your code and compile it as a unique and independent binary. But std/db_postgres is an impure library. That means that your binary will always import dynamically postgres sql.

static binaries

2022-04-20 Thread archnim
When you say "static binary" do you mean an independent executable, or a static lib ? Can you share with us the command that you use to compile ?

Installing choosenim (on Windows) on a custom folder does not seem to work

2022-04-20 Thread didlybom
@archnim, I appreciate the offer but this is a work issued laptop. Unfortunately I _cannot_ uninstall Windows and install another OS, even if I wanted to. The most I can do is install (and use) WSL, which I already do as much as possible. That however does not solve the issue I’ve got. @PMunch,

static binaries

2022-04-20 Thread daef
Is it possible to create static binaries with nim? I found a [tutorial](https://scripter.co/nim-deploying-static-binaries/) using musl-gcc, but my example doesn't work when I try it like that: I `import std/db_postgres`. When trying to execute the static build I get $ ./test co

Seeking advices for a C programming book

2022-04-20 Thread Sixte
> The version of Modula 3 that I looked at had no generics Modula-3 has _abstract_ types like Modula-2 has. They allow for modular (separate) compilation. > Nim follows C++'s take on generics C++'s templates allow for abstract types too. It is a hidden feature though. I demonstrated it within:

Seeking advices for a C programming book

2022-04-20 Thread Araq
I don't think so. The version of Modula 3 that I looked at had no generics and in general Nim follows C++'s take on generics. IMO if your design requires explicit instantiation for `Queue[T]` but not for `array[T]`, it's broken.

Installing choosenim (on Windows) on a custom folder does not seem to work

2022-04-20 Thread archnim
To compile, for windows, you can use Nim cross compiling feature. More generally, you can run most of windows programs on Linux, through [bottles](https://usebottles.com). That can simplify your transition a lot.

Installing choosenim (on Windows) on a custom folder does not seem to work

2022-04-20 Thread archnim
I can help you to switch to Linux. Just write to me on Twitter or telegram. Everywhere, my username is @archnim (ArchLinux + Nimlang 🙂)

Installing choosenim (on Windows) on a custom folder does not seem to work

2022-04-20 Thread PMunch
I don't know how the alias capabilities are on Windows, but you could certainly create a small script called `choosenim` in your path which calls the real `choosenim` from your install directory with `--choosenimDir` and any extra arguments?

server-client webframework

2022-04-20 Thread PMunch
It focuses on a tighter binding between front- and back-end. Essentially it only targets browsers with JavaScript capabilities where e.g. Prologue and Jester can be used to create simple REST APIs (this might be able to as well, but the focus seems to be on the client/server interaction). Using