Re: Is this a bug or just unallowed naming?

2020-02-25 Thread miran
> I know I can change the file name to resolve the problem Or, more pragmatically, you change the name of the type to `Foo` (uppercase `F`), as that is the idiomatic Nim.

Re: Is this a bug or just unallowed naming?

2020-02-25 Thread Hlaaftana
This is a bug, I haven't tested it but if you use `foo.foo` for the type it should work.

NGA Card Search Appears To Be Missing Taramir: The Dark Tide

2020-02-25 Thread johnken
Click on Card Search on the top right corner of this page to get to a place where you can see all sorts of player made cards. On that page, in the Set field, click on Taramir: The Dark Tide and then click the Search button and the results will come up empty. I do not know if the link is somehow

Is this a bug or just unallowed naming?

2020-02-25 Thread Ward
Should I report this as a bug? I know I can change the file name to resolve the problem, but it works well before I use table. foo.nim type foo* = ref object of RootObj data: int Run bug.nim import tables import foo type

Re: How to get Nim running on iOS and Android using GLFM.

2020-02-25 Thread treeform
It looks like your wiish project is exactly what I want! I am working on my own UI thing called fidget ( [https://github.com/treeform/fidget](https://github.com/treeform/fidget)/ ) - my long term goal is to make fidget just work on Android and iOS, just like it does on Win/Mac/Linux and Web

Re: I have a super doubt

2020-02-25 Thread adilh
Hello, if you learn by example you could take a look at exercism: [https://exercism.io](https://exercism.io)/ there's a nim track there. I found that the mentors didn't seem to be around (my guess is they were very busy with their day jobs), but you can choose practice mode and then you can see

Re: How does nim infer that a cpu on windows is 64-bit

2020-02-25 Thread shashlick
I just tried your test on my Windows setup and it worked fine for me. Following are the md5sum of the DLLs that got installed by choosenim. > md5sum sqlite3_32.dll => 943d354608f9b87ad5e6c5c632e7272c > > md5sum sqlite3_64.dll => d25af52d213f114aefa16370ec699f88 Not sure what else to tell you.

Uploading large files via httpclient request

2020-02-25 Thread adilh
Hello, I would like to upload a large file to a NextCloud instance using Nim. I have figured out how to authenticate. What I was wondering is how can I upload a large file. Clearly, I can't open the file and read the whole file into memory (it's 10GB). I was wondering if I have to do something

Re: How to get Nim running on iOS and Android using GLFM.

2020-02-25 Thread iffy1
@treeform I think compiling of the app and the bundling should be separate tools/steps. I've been working on wiish as I try to get my own mobile app out: [https://github.com/iffy/wiish](https://github.com/iffy/wiish) It works somewhat well (SDL and webview apps). I'm going to be focusing more

Re: How does nim infer that a cpu on windows is 64-bit

2020-02-25 Thread pietroppeter
today to try and solve this issue I did remove all previous nim folders and I installed it again using the most recent choosenim I could find: the release choosenim-0.5.1_windows_amd64 from github. I would assume that to install the 64bit version of Nim but maybe I am wrong (or maybe choosenim

Re: How does nim infer that a cpu on windows is 64-bit

2020-02-25 Thread shashlick
You need to install the 64bit version of Nim to match your new gcc. If you didn't have gcc when you started, choosenim would install 32bit by default. This was recently improved but you probably have an older choosenim. Regardless of arch, the problem is the dll so please try copying it to the

Re: How does nim infer that a cpu on windows is 64-bit

2020-02-25 Thread pietroppeter
thank you, I did download mingw64 (I actually used the one which would have been downloaded from choosenim at url [https://nim-lang.org/download/mingw64.7z](https://nim-lang.org/download/mingw64.7z)) and now I have a different error message when compiling a simple `echo "hello"` program which

Re: How does nim infer that a cpu on windows is 64-bit

2020-02-25 Thread pietroppeter
thank you, I see now that mingw is the 32 bit version (I did learn that i686-w64-mingw32 is 32 bits while x86_64-w64-mingw32 would be the 64 bit version). I think I will try first to download and install mingw64. Yes, I checked and the dlls are in my path.

Re: How does nim infer that a cpu on windows is 64-bit

2020-02-25 Thread Hlaaftana
You have to download [mingw64](http://mingw-w64.org/doku.php), your GCC is mingw32, then you can either add it to your Path or set Nim's GCC compiler path to mingw64 like `nim c --gcc.path=C:\mingw64\bin` (I think). Here is a Nim compiler user guide:

Re: How does nim infer that a cpu on windows is 64-bit

2020-02-25 Thread shashlick
As you can see, your compilers are 32bit so you need the 32bit version of the dll. Is it really in your path?

Re: How does nim infer that a cpu on windows is 64-bit

2020-02-25 Thread pietroppeter
yes, sure. -v Nim Compiler Version 1.0.6 [Windows: i386] Compiled at 2020-01-23 Copyright (c) 2006-2019 by Andreas Rumpf git hash: 89b39ee8fe271d0e1b75c15a4c6cf82eb9c13aea active boot switches: -d:release Run -v

Re: Nim's float issue?

2020-02-25 Thread ffred60
another option when in need for accuracy and to avoid rounding problem (like in financial activities) is to use a Decimal library.. [http://net-informations.com/q/faq/float.html](http://net-informations.com/q/faq/float.html)

How does nim infer that a cpu on windows is 64-bit

2020-02-25 Thread pietroppeter
Hi, I am trying to understand why Nim compiler thinks that my windows CPU is 32 bits. I ran into this while trying to sue sqlite where the smallest reproducible error would be: import db_sqlite var db = open(connection="test.db", user="test", password="",

Re: How does nim infer that a cpu on windows is 64-bit

2020-02-25 Thread shashlick
Can you share the output of nim -v and gcc -v?

Re: Nim talk at FOSDEM

2020-02-25 Thread enthus1ast
I'm still waiting too :) [https://forum.nim-lang.org/t/5866](https://forum.nim-lang.org/t/5866)

Re: Nim's float issue?

2020-02-25 Thread kaushalmodi
Wow! I didn't know of [https://float.exposed/](https://float.exposed/). Cool website!

Re: Nim's float issue?

2020-02-25 Thread jva
Maybe I'm wrong but I think the answer is fine, did not notice any arrogance IMHO. He just points out the docs first. It is really important to get used to docs although no one likes them. So called "CS degrees" are also very useful, you learn a ton of interesting things there.

Re: Weird Behaviour

2020-02-25 Thread sigmapie8
Okay. Thanks!

Re: Weird Behaviour

2020-02-25 Thread demotomohiro
According to Nim manual: [https://nim-lang.org/docs/manual.html#syntax-precedence](https://nim-lang.org/docs/manual.html#syntax-precedence) > Whether an operator is used a prefix operator is also affected by preceding > whitespace (this parsing change was introduced with version 0.13.0): > >

Re: Nim's float issue?

2020-02-25 Thread demotomohiro
You can learn how float works in following web sites: [https://float.exposed](https://float.exposed)/ [https://en.wikipedia.org/wiki/IEEE_754](https://en.wikipedia.org/wiki/IEEE_754)

Re: Nim's float issue?

2020-02-25 Thread Divy
The answer is really good but please respect that everyone here is learning and some might not be from a CS background! I'm 15 and certainly not yet graduated yet I code and love Nim. I guess it would be really nice if we leave arrogance and so called "CS degrees" aside and talk Nim :)

Re: Interlanguage communication

2020-02-25 Thread Divy
It basically executes the command node script.js It isn't complete yet. I just wanted to know the basic idea behind communication between languages

Re: Interlanguage communication

2020-02-25 Thread r3c
Like in any other language node script.js -param1 -param2 etc. But if you want to pass data from client to server, you do that with Ajax or RESTful service.

Re: Nim's float issue?

2020-02-25 Thread juancarlospaco
`round` is Deprecated.

Re: Nim's float issue?

2020-02-25 Thread r3c
I think @adnan is right, in the round function output like 88.91 is expected, but fmt should trim it to 2 decimals.

Re: Nim's float issue?

2020-02-25 Thread kaushalmodi
Your answer was nice but I think you it was equally helpful without: > It's a bit hard to believe that this is a serious question because of.. and > But maybe you missed that and have no CS experience. I think most people would have stumbled across this in one programming language or another.

Re: Nim's float issue?

2020-02-25 Thread adnan
[https://0.30004.com](https://0.30004.com)/

Re: Nim's float issue?

2020-02-25 Thread Stefan_Salewski
It`s a bit hard to believe that this is a serious question because of [https://nim-lang.org/docs/math.html#round%2CT%2Cint](https://nim-lang.org/docs/math.html#round%2CT%2Cint) But maybe you missed that and have no CS experience. The basic fact is that we can not present each decimal number

Re: A 'made with Nim' website?!

2020-02-25 Thread hyl
@JohnAD do you go looking for games to add or wait for people to add their games to your site? It's a nice site but there are only three games on it, and just a little bit of searching for games and game engine examples on github can get you some nice ones (eg: nico

Re: Code cleanup suggestions: ctors

2020-02-25 Thread sky_khan
> So I realized ptr of Husband can be a key to a Table, ref can't. Yes, it can [https://nim-lang.org/docs/tables.html#basic-usage-hashing](https://nim-lang.org/docs/tables.html#basic-usage-hashing)

Re: Code cleanup suggestions: ctors

2020-02-25 Thread andrea
I think it would be better to give your objects ids and use those as keys to the table. Pointers, by design, can be moved

Nim talk at FOSDEM

2020-02-25 Thread Clonk
Hello, Is there any audio / script for this talk : [https://fosdem.org/2020/schedule/event/nimultralowoverheadruntime](https://fosdem.org/2020/schedule/event/nimultralowoverheadruntime)/ ? I was able to listen the other 3 but I didn't find anything beside the slides on this one.

Re: Code cleanup suggestions: ctors

2020-02-25 Thread adnan
> Why are you using ptrs instead of refs? So I realized ptr of Husband can be a key to a Table, ref can't. [https://play.nim-lang.org/#ix=2cCN](https://play.nim-lang.org/#ix=2cCN)

Re: What prevents you from using Nim as your main programming language?

2020-02-25 Thread kidandcat
Man, I work with large Go codebases, Go is the equal or more strict than Rust, and anyway you may find unmaintainable code in extremes that your head explode. >From my extense experience, bad developers can use the most strict language >ever created and the codebase will still be an enormus

Nim's float issue?

2020-02-25 Thread Nam
I'm following "Nim basics" tutorial and stumbled to this case when I was trying to convert in to cm: import math,strformat echo " in | cm" echo "-" for i in 1 .. 40: echo fmt"{i:3}", " | ", round(float(i) * 2.54, 1) Run

Re: Weird Behaviour

2020-02-25 Thread cumulonimbus
> var a = number.len -2 #throws invalid Indentation error That's because it is equivalent to `number.len(-2)` and/or `len(number, -2)` ; followed by something that looks like a negative number is a negative number (and not a "subtract" operation).

Re: Weird Behaviour

2020-02-25 Thread Divy
Make sure you are not having any extra whitespace at the end of lines. If not, then check for indentations and replace them with spaces. If done correctly, your program should work fine.

Interlanguage communication

2020-02-25 Thread Divy
I have a Node.js program and a nim program. When a nim procedure is called, it triggers the js script with input as argument. How do I get back the output to nim?

Re: Using async Nim procedures in Python

2020-02-25 Thread yglukhov
Second to what dom96 said. Making nimpy async compatible is something I thought about and definitely it should be possible and not that hard. Doesn't mean I'm doing it right now, but prs are welcome, and feel free to ask details should you need any.

Weird Behaviour

2020-02-25 Thread sigmapie8
`proc check_number(number: string): bool = var x = number.len-2 #works var y = number.len - 2 #works var z = number.len- 2 #works var a = number.len -2 #throws invalid Indentation error echo x, y, z, a return true echo check_number("1234") ` Run

Re: What prevents you from using Nim as your main programming language?

2020-02-25 Thread SolitudeSF
oh, its another blogpost from person who just read the tutorial and never wrote more than 100 lines of nim, and never seen another nim codebase, who just needs an excuse to use rust/go/whatever. its like you dont use vscode or vim with ide features already for knowing "where the stuff comes

Re: Weird Behaviour

2020-02-25 Thread enthus1ast
Please format your question properly.