push/pop hints on/off not working?

2020-10-18 Thread ElAfalw
I've been trying to silence one million different hints coming from system (std) libraries, but I still cannot manage to see how... Here's an example of what I mean (the list is practically endless, this is just a sample - and the problem is that amidst all these, I cannot spot the warnings and

Version 1.4.0 released

2020-10-18 Thread leorize
I started a thread some time ago to keep track of ideas to improve the front page: Unfortunately I've not found the time to spend on actually making a PR to [nim-lang/website](https://github.com/nim-lang/website) to update the wording.

We should make it simpler for authors to have their blog featured on the Nim front page.

2020-10-18 Thread xflywind
If Nim blog could accept more articles, it will be benefit for marketing! @leorize Document a baseline standard for articles to be considered for publication. This will let authors know beforehand whether their blog meet the scope of the Nim blog before submission. I agree

Can I use async/await to work with JS Promises?

2020-10-18 Thread akavel
Thanks! I also found out that `async` by itself basically [makes a function wrap its returned result in a Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function#Description) \- so I can just [pass an async function into .then()](https://github.com/a

Ubuntu, snap install, "Error: cannot open file: strutils"

2020-10-18 Thread Izzno
I am having trouble using the standard library. I installed nim through the snap "store" (1.4). First of there's a prefix on all of the nim cmds like "nim-lang.nim, nim-lang.nimble" etc. I solved that by symlinks but it does not matter if I use the symlink or directly acces the binary, a simple

Problems installing nim 1.4.0 with choosenim

2020-10-18 Thread Wull
I suffered similar confusion yesterday when ‘choosenim update self’ failed Today the update to 0.7.2 worked, however for me the new version of choosenim is failing: choosenim v0.7.2 (2020-10-17 15:01:25) [windows/amd64] choosenim.exe --debug show Gave the following: `` Debug: Reporting to ana

1.4.0 failed with old-ish gcc because of NIM_STATIC_ASSERT bug

2020-10-18 Thread timothee
thanks for reporting this, and please report on nim's github issue tracker as mentioned. > works for me after a dirty but trivial fix with my current gcc writing a PR would also be appreciated

Impressive results with --gc:orc

2020-10-18 Thread leorize
I don't think it makes too much of a difference if you're using `--exceptions:goto`, but might provides considerable boost if `--exceptions:setjmp` is used. `--panics:on` allows the compiler to stop assuming that all procs can throw, as all `Defect` will then be compiled down into `quit()`. Thi

Impressive results with --gc:orc

2020-10-18 Thread b3liever
How about `--panics:on`? Does it make a significant difference?

Impressive results with --gc:orc

2020-10-18 Thread Yardanico
\--panics:on is mostly for code size, not performance, there wouldn't be much difference if you already do -d:danger|

Impressive results with --gc:orc

2020-10-18 Thread Yardanico
For that matter you can also try `--passC:"-flto"` if your C compiler supports LTO - it should give some more perf boost

Impressive results with --gc:orc

2020-10-18 Thread didlybom
No, I didn’t. I’m using -d:release. I’ll have to give it a try.

1.4.0 failed with old-ish gcc because of NIM_STATIC_ASSERT bug

2020-10-18 Thread jrfondren
I ran into this and other issues on CentOS 6: where at least SCL's devtools is an easy escape hatch to a newer compiler.

1.4.0 failed with old-ish gcc because of NIM_STATIC_ASSERT bug

2020-10-18 Thread leorize
Please report bugs on Nim's [issue tracker](https://github.com/nim-lang/Nim/issues) so we can track and let you know if the bug is fixed. AFAICT support for older gcc is also a priority in Nim as we aim for embedded support (where there are odd versions of gcc everywhere).

1.4.0 failed with old-ish gcc because of NIM_STATIC_ASSERT bug

2020-10-18 Thread slobin
In new 1.4.0 release, **nimbase.h** defies the macro `NIM_STATIC_ASSERT`, trying some possible implementations depending on C compiler version used. The last fallback option uses a `NIM_STATIC_ASSERT_AUX` trick ( **nimbase.h** line **275** ), which does not work. This macro is used twice in the

sets : what are they

2020-10-18 Thread Stefan_Salewski
Thanks for the remarks, will try to fix that soon.

sets : what are they

2020-10-18 Thread jseb
Sorry Stefan, i didn't saw your post before today. I was talking about sets in nim to a friend, so i read again this thread and saw you post. I have read the new section in your book, and it's clear for me. It was welcome to strengthen my comprehension of set, that i haven't used since this ques

Is Nim good for creating video games?

2020-10-18 Thread sekao
Nim is ideal for games. It hits the right tradeoff between speed / safety / ergonomics. The last one is particularly important to me...a language can be as fast / safe as can be, but if i'm spending large chunks of my day waiting for my code to compile or fighting compile errors, there is a wide

Is Nim good for creating video games?

2020-10-18 Thread jseb
The next question is : what options are available ? If you want 2D you have a lot of option: Nico, NimGame2 (seems stalled) and Norx (1:1 port from Orx C lib). For learning, i would use Nico, which has been written entirely with Nim, and which is used by its author:

How to pass arguments with NIM?

2020-10-18 Thread brunomerod
Thank you all!! Best regards, Bruno Rodrigues

Aliases with templates for tables not working in v1.4

2020-10-18 Thread jasonfi
Thanks, I'll try that.

Impressive results with --gc:orc

2020-10-18 Thread slonik_az
@didlybom: I am curious whether you are passing `-d:danger` instead of `-d:release` to the Nim compiler? It may further boost performance by disabling runtime checks.

Fun with (Levenshtein) Edit distances

2020-10-18 Thread Stefan_Salewski
> Turns out, the reason is that the o of the cairo in the moduleNamespace can > be matched with the .so Ah yes, I missed the so string part! Thanks.

Problems installing nim 1.4.0 with choosenim

2020-10-18 Thread slonik_az
Right now `choosenim`'s release page contains only a version tag and a set of assets It would help to add a link to (version specific) installation instructions section of the readme file like

Aliases with templates for tables not working in v1.4

2020-10-18 Thread shirleyquirk
you can declare the template outside the for loop, or: for my_id in my_id_seq: template my_alias: untyped {.dirty.} = my_table[my_id] echo my_alias Run

Impressive results with --gc:orc

2020-10-18 Thread Yardanico
Nice :) Also a response from Nim's telegram chat:

Impressive results with --gc:orc

2020-10-18 Thread didlybom
I just recompiled a small tool that reads a binary file and converts it into a different (text-based) format using nim 1.4 and the new ORC GC. This tool did not compile with the ARC GC in 1.2.6 (due to some problem with the docopt library) but it complies just fine (both with ARC and ORC) in nim

Problems installing nim 1.4.0 with choosenim

2020-10-18 Thread didlybom
> How did you use it? Was it from a previous installation? What did you run > exactly? Please outline explicitly, otherwise I have to guess which is not > ideal. I simply tried to do `choosenim install self`. That throwed that "could not load: (libcrypto-1_1-x64|libeay64).dll" error. That is wh

Aliases with templates for tables not working in v1.4

2020-10-18 Thread jasonfi
The problem seems to occur when the template declaration is in a for loop:

Problems installing nim 1.4.0 with choosenim

2020-10-18 Thread dom96
> The first thing I tried is simply using choosenim as recommended on the > announcement page. That resulted in the following error message: How did you use it? Was it from a previous installation? What did you run exactly? Please outline explicitly, otherwise I have to guess which is not ideal

Fun with (Levenshtein) Edit distances

2020-10-18 Thread shirleyquirk
libpango-1.0.so.0 x is delete, r replace xxxpangoxxoxx 7 deletions, 4 replacements libpangocairo-1.0.so.0 xxxpangocairox 12 deletions

Fun with (Levenshtein) Edit distances

2020-10-18 Thread Vindaar
Check for instance with this funny online calculator, which shows the corresponding table: / Turns out, the reason is that the `o` of the `cairo` in the `moduleNamespace` can be matched with the `.so` of `libpango-1.0.so.0`. For the longer `libpango

Problems installing nim 1.4.0 with choosenim

2020-10-18 Thread didlybom
I'm having quite a few problems installing nim 1.4. The first thing I tried is simply using choosenim as recommended on the announcement page. That resulted in the following error message: could not load: (libcrypto-1_1-x64|libeay64).dll Run I thought that maybe I cou

Aliases with templates for tables not working in v1.4

2020-10-18 Thread shirleyquirk
Seems to work, what code are you using

Fun with (Levenshtein) Edit distances

2020-10-18 Thread Stefan_Salewski
import std/editdistance var moduleNamespace = "pangocairo" var h1 = ["libpango-1.0.so.0", "libpangocairo-1.0.so.0", "libpangoft2-1.0.so.0"] for el in h1: echo editDistanceAscii(el, moduleNamespace), " ", el, " ", moduleNamespace Run $ ni

Forcing a memory leak in Nim

2020-10-18 Thread shirleyquirk
according to the docs, useMalloc >only works with gc:none and with --newruntime. which is a bit out of date, perhaps, but doublechecking the source we have, in mmdisp.nim: elif (defined(nogc) or defined(gcDestructors)) and defined(useMalloc): include system / mm / malloc

Version 1.4.0 released

2020-10-18 Thread hugogranstrom
That was a really good summary! :D

Is Nim good for creating video games?

2020-10-18 Thread ty505
I've just discovered Nim as a game developer and am curious to know how well does nim hold up in the standards to game development? Have any of you guys personally created any games?

Aliases with templates for tables not working in v1.4

2020-10-18 Thread jasonfi
Here is an example of code that worked in v1.2.6: template my_alias: untyped = my_table[my_id] Run I now get an error: key not found: 4387866928 This key value is not the value of my_id. Is there a new syntax for creating aliases with templates in v1.4?

How to pass arguments with NIM?

2020-10-18 Thread moigagoo
If you're making a CLI, I highly recommend [cligen](https://nimble.directory/pkg/cligen).