Re: The portable way to find nimbase.h or system.nim location

2019-02-11 Thread slangmgh
[https://scripter.co/notes/nim](https://scripter.co/notes/nim)/ It's great, is it possible add link to the official tutorial?

Jester memory usage strangeness

2019-02-11 Thread rifabio
Hi all! I'm building a simple CRUD web application with Jester and Sqlite. Today I looked at `top` on the server (a _very_ cheap VPS) and saw that memory usage was about 80MB. That sound very strange to me, as this is not my first Jester app. I measured the app on my laptop and it start at

Re: Newbie question about reading asynchronous text file line by line

2019-02-11 Thread tim_st
I didn't run your code but had a very quick look at the implmentation of asyncfile.readLine to find out what can raise an IndexError. This line if c[0] == 'L' or c == "": should be checked before the other and it should be implemented like this: if c.len == 0 or c[0] == 'L': I assume this fixes

Re: Newbie question about reading asynchronous text file line by line

2019-02-11 Thread mrhdias
Sorry the second the redefinition of file in invocation of openAsync it's my mistake. This compile but I get the same error: import asyncdispatch, asyncfile, os proc main() {.async.} = var filename = "test.txt" var file = openAsync(filename, fmRead) while

Re: Newbie question about reading asynchronous text file line by line

2019-02-11 Thread nepeckman
The code doesn't compile as presented because of the redefinition of `file`. If you change the second invocation of `openAsync` to `file = openAsync(filename, fmRead)` the code will compile. The index error you get from running the code is another matter though. I think its a potential bug in

Newbie question about reading asynchronous text file line by line

2019-02-11 Thread mrhdias
I'm trying to read a text file asynchronous line by line but the following code fails to compile import asyncdispatch, asyncfile, os proc main() {.async.} = var filename = getTempDir() / "test.txt" var file = openAsync(filename, fmWrite) await

Re: What are the files in .nimble/bin

2019-02-11 Thread Stefan_Salewski
Nimble has docs: [https://github.com/nim-lang/nimble#binary-packages](https://github.com/nim-lang/nimble#binary-packages) In this case when nimble install is invoked, Nimble will build the main.nim file, copy it into $nimbleDir/pkgs/pkgname-ver/ and subsequently create a symlink

Re: What are the files in .nimble/bin

2019-02-11 Thread calebwin
Just to add more details- When I change pipelines.cmd to pipelines.exe, trying to run pipelines.exe gives me a dialog box saying "This version of C:UsersCaleb Winston.nimblebinpipelines.exe is not compatible with the version of Windows you're running. Check your computer's system information

What are the files in .nimble/bin

2019-02-11 Thread calebwin
So when I go to .nimble/bin I see 2 things pipelines pipelines.cmd Run I'm on Windows and I was expecting a .exe file here... Would someone with more systems programming experience mind enlightening me?

Re: Screencast Series Ideas

2019-02-11 Thread ryukoposting
> people don't watch the videos in full screen mode, make sure you use large > font size so the content is easily viewable Yup- that's one nice thing about Kate I didn't really mention. I can very easily have one tab zoomed in so that it shows up nicely on video, and then another tab

Re: The portable way to find nimbase.h or system.nim location

2019-02-11 Thread kaushalmodi
I have extracted this **findNimStdLib** proc from `compiler/nimeval.nim`: [https://scripter.co/notes/nim/#nim-stdlib-path](https://scripter.co/notes/nim/#nim-stdlib-path); works great!

The portable way to find nimbase.h or system.nim location

2019-02-11 Thread cdome
I would like to include a copy of nimbase.h file in a built package. What is the easiest way to ask Nim compiler or nimscript for the location of the system.nim or nimbase.h files? These two files are in the same folder.

Re: len [0, 1, 2] fails

2019-02-11 Thread moerm
cblake, tim_st et al Yes. I never liked Nims easy going in some points like the one that shows its ugly head here. Simple reason: ambiguity - as in "not _evidently and strikingly_ clear" \- is known to be one of the major infectors in software, comparable to rats in a city. My personal rule,

Update all installed nimble packages

2019-02-11 Thread zarican
Hi, Sorry, if there is already a command to update all locally installed nimble packages but I wrote a small nimscript. import strutils let (outp, errC) = gorgeEx("nimble list --installed") if errC != 0: echo outp quit(1) echo "Installed packages:"

Re: how to pass a C array to C function?

2019-02-11 Thread moerm
I'm a bit careful and general in my reply because I don't know the library you use. First, in Nim an array has a known and fixed size. If you need a dynamic array have a lot of seq. Basically you should differentiate between two cases: * 1) The C func has a size parameter directly following

Re: len [0, 1, 2] fails

2019-02-11 Thread cblake
Or `[1,2,3].len` which is curiously not among the various listed choices for whatever reason, and which is even more visually distinct from array indexing, IMO.

Re: "nim cpp -d:release --noCppExceptions" fails

2019-02-11 Thread Araq
Please create a github issue for this problem so that it is tracked.

Re: Screencast Series Ideas

2019-02-11 Thread miran
> I will be using Kate for the videos Here's one (ok, two) small technical advice: * people don't watch the videos in full screen mode — make sure you use large font size so the content is easily viewable at the usual online-video size * please make sure that your keyboard is not louder