Re: Could Nim use Cmake to invoke the C compiler?

2020-04-17 Thread Araq
It could be useful for integrating Nim code into an existing C/C++ codebase that uses Cmake. However, Cmake can also simply run the Nim compiler before adding the produced C++ code to the makefile it produces.

Re: Nimble package, multiple backends

2020-04-17 Thread Hlaaftana
`when` blocks allow for different code based on backends, Nim versions, command line options and so on. The [fatal pragma section of the Nim manual](https://nim-lang.org/docs/manual.html#pragmas-fatal-pragma) gives an example that shows how to error when the user doesn't use the `objc` command t

Does Nim have a binary serializer similar to Gos "encoding/gob"?

2020-04-17 Thread Keithcat1
Hi, I'm looking for a binary serializer that will hopefully allow newer versions of my program that for example add new fields to a type to still load data created by older versions of that same program. Is there anything like that? Thanks!

Could Nim use Cmake to invoke the C compiler?

2020-04-17 Thread Keithcat1
I'm curious, would it be hard or beneficial to change the nim compiler so that every time you build a project, it generates a cmake_lists.txt file and uses Cmake to run the C or C++ compiler to compile the project. This seems to be at least one of the things that Cmake was made for. You might al

Re: Nim version of Flask Web Framework

2020-04-17 Thread federico3
If you want to add auth to existing frameworks: [https://github.com/FedericoCeratto/nim-httpauth](https://github.com/FedericoCeratto/nim-httpauth)

Re: generate c++ code from .nim file

2020-04-17 Thread minimisthupper
ok, thanks!

Nimble package, multiple backends

2020-04-17 Thread rufusroflpunch
What is the best way to distribute a Nimble package that would use Objective-C on Mac OS X and C/C++ on Linux/Windows? Is there anything special that needs to be done? Also, if a Nimble package uses a particular backend like Objective-C, do users of the that project need to compile their code w

Re: Nim Forum build error

2020-04-17 Thread dom96
Yep, it's trying to install karax and that fails for some reason (I think there might be a Nimble bug here). Try to install it manually by running nimble install karax@#f6bda9a.

Re: AsyncHTTPClient crashes saying invalid http version

2020-04-17 Thread dom96
Stop mixing callbacks and async procs. Your `download` async proc finishes before your download operation finishes because you are not awaiting the `download` proc. Just do this: await downloader.downloadFile(node.mediaLink(board, thread), downFileName) Run

Re: AsyncHTTPClient crashes saying invalid http version

2020-04-17 Thread adnan
> Is this a wrong link? because that doesn't look synchronous. Ops sorry I had changed the link. > One important thing to know is that you should never use waitFor in an async > procedure, use await. If I use await, the main thread doesn't stop until all the coroutines I create inside the loop

Re: Nim Forum build error

2020-04-17 Thread jjude
` Verifying dependencies for nimforum@2.0.2 Reading official package list Checking for jester@#d8a03aa Info: Dependency on jester@#d8a03aa already satisfied Verifying dependencies for jester@#d8a03aa Reading official package list Checking for httpbeast@>= 0.2.2 Info: Dependency on httpbeast@>= 0

Re: generate c++ code from .nim file

2020-04-17 Thread dom96
You'll need to copy this file beside your .cpp file. This is supposed to be copied automatically when using `--genScript` (if you're using 1.0.6 it should work), with latest versions of Nim it doesn't get copied (see [https://github.com/nim-lang/Nim/issues/13826)](https://github.com/nim-lang/Nim

Re: Nim Forum build error

2020-04-17 Thread dom96
Are you sure you're not getting this error because of a dependency that's being installed? Can you paste the full output of `nimble c -r src/buildcss --debug`?

Re: how to get some (partial) type resolution within a macro ?

2020-04-17 Thread Sixte
> Can parseEnum help you with what you want to do? Thank you for your assistance. At the very end, `{.experimental: "dynamicBindSym".}` did the trick for me. I got three different solutions: via typedesc, via template (forwarding) and with `bindSym` at compile-time. The least mentioned was I wa

Re: AsyncHTTPClient crashes saying invalid http version

2020-04-17 Thread adnan
> To keep multiple connections open at a time you will need a separate > HttpClient for each. Ah that fixes it. Thanks a bunch.

Re: Iterate over fields

2020-04-17 Thread Vindaar
First of all see of course the docs here: [https://nim-lang.github.io/Nim/macros.html#quote%2Ctyped%2Cstring](https://nim-lang.github.io/Nim/macros.html#quote%2Ctyped%2Cstring) and the macro tutorial, specifically: [https://nim-lang.github.io/Nim/tut3.html#introduction-generating-code](https://n

Re: AsyncHTTPClient crashes saying invalid http version

2020-04-17 Thread dom96
> Writing a synchronous downloader script was a breeze: > [https://gitlab.com/snippets/1967018](https://gitlab.com/snippets/1967018) Is this a wrong link? because that doesn't look synchronous. You're doing a number of things incorrectly here. One important thing to know is that you should neve

Re: AsyncHTTPClient crashes saying invalid http version

2020-04-17 Thread geotre
To keep multiple connections open at a time you will need a separate HttpClient for each. Try moving webClient = newAsyncHttpClient() into the for loop so each call to webClient.downloadFile has it's own client

Re: generate c++ code from .nim file

2020-04-17 Thread minimisthupper
i get this error every time, when i compile my main file : @msecond.nim.cpp:9:10: fatal error: 'nimbase.h' file not found #include "nimbase.h" ^~~ 1 error generated. Run

Re: Nim Forum build error

2020-04-17 Thread Yardanico
Check [https://github.com/nim-lang/nimforum/blob/master/nimforum.nimble](https://github.com/nim-lang/nimforum/blob/master/nimforum.nimble) and you'll find: task backend, "Compiles and runs the forum backend": exec "nimble c src/forum.nim" exec "./src/forum"

Re: Nim Forum build error

2020-04-17 Thread jjude
Tried both (verbose & individual command). Same error: No binaries built, did you specify a valid binary name?

Re: Nim Forum build error

2020-04-17 Thread b3liever
Try to run the commands inside nimforum.nimble to find the error messages, alternatively look for a nimble verbose option that doesn't hide the build commands output

Nim Forum build error

2020-04-17 Thread jjude
I used the latest code from github. Issued git submodule update --init --recursive nimble frontend Run I get this error: Error: No binaries built, did you specify a valid binary name?. Nim version: Nim Compiler Version 1.0.6 [MacOSX: amd64] How to go further?

Re: I think we can really do better...

2020-04-17 Thread miran
@other_mods: Guys, didn't you notice that @brianwil2727 has put one link to some Bitcoin stuff to his post? It is a well-masked spam.

Re: Iterate over fields

2020-04-17 Thread b3liever
There is also [json.to](https://github.com/nim-lang/Nim/blob/devel/lib/pure/json.nim#L1201) as an example.

Re: Compile-time string obfuscation

2020-04-17 Thread Yardanico
https://github.com/Yardanico/nim-strenc

Re: I think we can really do better...

2020-04-17 Thread Pixeye
It's not about claiming to be something revolutionary. It's about the message. The fact that I don't know about Modula and Ada says nothing. We live in the world of internet. I can read the wiki page of those lang. It doesn't make me "knowing Ada/Modula" Of course, all languages built on each o

Re: Iterate over fields

2020-04-17 Thread Clonk
I didn't about the quote do tricks, that's useful ! Why do you have to use backtick "`" inside quote do ? Is it to interpret macro inside a block of code ?

Re: I think we can really do better...

2020-04-17 Thread Stefan_Salewski
Note, my initial suggestion was "Nim combines successful concepts from mature language like Python, Ada and Modula with a few sounding features of latest research." Unfortunately they discarded the last part, I think to fit it all to one page. But I have copied all my advertisings to my book:

Re: I think we can really do better...

2020-04-17 Thread Pixeye
just my 5 cents about the theme itself. I think it would be great to understand the audience of Nim. I think the topic is not about languages. It's about people who stand behind. People are valued. Fresh blood and young programmers who are trying to make new stuff. Why? Because It's hard to con