Multi-threaded features needed for Server

2021-04-09 Thread alexeypetrushin
About being able to send and receive messages with id with `channels` \- actually seems like it's possible [full snippet](https://gist.github.com/al6x/aea6d6a854904c39a4e1830f79372f2e) # Answering Service let answering_service_id = 1 proc answering_service(): void =

Multi-threaded features needed for Server

2021-04-09 Thread boia01
> I ended up implementing a my own version of C++'s shared_ptr, with a few > differences. It supports custom destructor (for cleaning up resources), acts > as a read-write mutex, and can be safely moved and copied across threads. If > anyone is interested in seeing the code, I will be more than

Release candidates for 1.4.6 and 1.2.12

2021-04-09 Thread exelotl
`choosenim #598d9f8` (exact commit hash) worked for me ^^

Search engine for free assets

2021-04-09 Thread Annati
It's a great idea for sure. I will see what I can get out of your search engine.

Headless Nim Executable App Option?

2021-04-09 Thread ElegantBeef
For Windows compiling with `--app:gui` should stop the console from popping up.

Headless Nim Executable App Option?

2021-04-09 Thread thewilliamc15
Hello everyone, this is a question because I was wondering if there was such a way to run a nim executable without the console appearing. I just feel like this can have many use cases. I looked through the documentation and the nim source files and I was disappointed that there wasn't a method i

Twitter in 100 lines of Nim, no JS

2021-04-09 Thread alexeypetrushin
> -Poor performance in regions far away from the server (+- 10 second lag for a > response to a button click) e.g server in US/Canada and client device in > Asia/Africa etc. Each tool has limitations, as far as I know this approach doesn't work well in high-latency networks. One easy technic t

Testing/Feedback for Neel 0.4.0 development

2021-04-09 Thread NecroticOoze
If you look at the "devel" and "master" branch, you'll see that we use the spread operator. We removed it in the "devel2" branch because the spread operator and object methods (Object.values(x) etc.) isn't supported on an older JS rendering engine. Thanks for the suggestion though! Please let m

Release candidates for 1.4.6 and 1.2.12

2021-04-09 Thread treeform
How would I choosenim install the 1.4.6 RC?

Issue with Nim Manual on Windows Chrome

2021-04-09 Thread Araq
I have this issue with Chrome during ordinary browsing and it's unrelated to Nim's manual as I don't have it open. I hope the next Chrome update will fix it...

Issue with Nim Manual on Windows Chrome

2021-04-09 Thread treeform
I use Chrome on Windows I don't see this issue.

Issue with Nim Manual on Windows Chrome

2021-04-09 Thread Taufeeqmowzer01
Thanks!

Multi-threaded features needed for Server

2021-04-09 Thread b3liever
If you're looking for synchronization primitives this [module](https://github.com/planetis-m/nim-100days/blob/master/multithread/thrsync.nim) I writing might be useful. It depends on an unreleased stdlib [patch](https://gist.github.com/xflywind/bf90bb478b4f5c7f062717d64cf557bd) by @xflywind. Ev

string concat I don't understand

2021-04-09 Thread shirleyquirk
The crucial thing to realize about the carriage return is that it affected the way your terminal _displayed_ the text, not its internal representation. Its behaviour doesn't even have anything to do with what shell you use, but which terminal emulator! For me, in a shell, if I ech

Issue with Nim Manual on Windows Chrome

2021-04-09 Thread Taufeeqmowzer01
you think so? I've used it before whilst having outlook and a muted* microsoft Teams lecture open in the same browser and it worked fine (rotated through infertility clinic on my gynecology rotation so I knew the lecture already lol, its a depressing topic too)...first time experiencing this wi

Issue with Nim Manual on Windows Chrome

2021-04-09 Thread Yardanico
I honestly think it's not an issue with Nim Manual, but rather an issue with the browser not being able to keep up with the size of the manual :)

Issue with Nim Manual on Windows Chrome

2021-04-09 Thread Taufeeqmowzer01
I only have 4 tabs open on chrome, one of them being The Nim Manual...when I try to scroll down the page chrome says 'not responding' for a moment and then completes the scroll, the same thing occurs when I try to continue scrolling and when switching tabs. I just gave up and decided to check if

Twitter in 100 lines of Nim, no JS

2021-04-09 Thread Taufeeqmowzer01
Good idea, however since this is a new framework I'd like you to keep this in mind by looking at the problems elixir/liveview and laravel/livewire are facing and how you could possibly solve it in your implementation. The issue with liveview (and the like) are: -Poor performance in regions far

chronos problem, my client-server test randomly fails on windows and macOS

2021-04-09 Thread bung
I echo inside `runLoop` the transport stay on `writePause` state, then on the client side it read nothing, so response get empty string . I have no idea why this occurs, anyone could give me some clues?

Testing/Feedback for Neel 0.4.0 development

2021-04-09 Thread rockcavera
Tested on Windows 10 64 bits, Nim devel 1.5.1 64 bits, backend c gcc 10.2.0. I proceeded to the following steps: 1. `git clone https://github.com/Niminem/Neel.git` 2. `cd neel` 3. `git checkout devel2` 4. nimble install 5. `nim c -d:danger --threads:on -d:webview examplesfilePicker.nim`

Release candidates for 1.4.6 and 1.2.12

2021-04-09 Thread miran
We have release candidates for the two latest Nim versions: 1.4.6 RC: 1.2.12 RC:

string concat I don't understand

2021-04-09 Thread FabienPRI
OK ok for splitting lines, but I though my issue was more about string concatenation. Does it mean there was a remaining c at the end of the string that made the concatenation behave that strange, replacing the string from the beginning???

string concat I don't understand

2021-04-09 Thread Hlaaftana
> I've worked a lot with text files under windows and did massive use of > split("n") That's either because old versions of Nim transformed `\n` to `\c\L` on Windows (`\p` now has this behavior), or because you previously weren't using anything that would point out the problem. I'm guessing you

string concat I don't understand

2021-04-09 Thread shirleyquirk
as others have said `splitLines` will handle windows files better than `split` as the docs say: "Every character literal newline combination (CR, LF, CR-LF) is supported. " `split` and `splitLines` have not changed since well before v1.0, i guess you just got lucky before :) to illustrate:

Multi-threaded features needed for Server

2021-04-09 Thread alexeypetrushin
> After reading this point, I couldn't help but point out that communicating > across threads over channels is a thing. Maybe I miss something, but Channels doesn't have a way to receive the message with specific `id`. Say one Thread holds amount of money. And other thread wants to know that, s

Multi-threaded features needed for Server

2021-04-09 Thread federico3
People are asking "how-to" questions around threading and sharing memory relatively often. I think it's a sign that the manual need some more extensive examples/how-tos/tutorials (or links to external resources).

Testing/Feedback for Neel 0.4.0 development

2021-04-09 Thread Jaap
works ok macOS Big Sur nim 1.5.1

string concat I don't understand

2021-04-09 Thread FabienPRI
OK I will try this, but I've worked a lot with text files under windows and did massive use of split("\n") Run with Windows text files that was #13 #10 ended without any issue, but that was prior to nim 1.4

string concat I don't understand

2021-04-09 Thread FabienPRI
Yes I saw strutils.splitLines recently reading the doc, did not remember to see it before, should I have to update old code to use it, is there a reason to prefer strutils.splitLines over split, which is not clear in the doc?

string concat I don't understand

2021-04-09 Thread Araq
There is `strutils.splitLines`, especially designed for this case.

Tables and hashes

2021-04-09 Thread Araq
Yeah, I agree. It's a strange omission that `ref` doesn't have a default `hash` implementation. While we have users coming from Python who use too much `ref object`, Python's class construct also has reference semantics when put into a dictionary, so I assume this wouldn't be error-prone for any

3rd Nim online meetup

2021-04-09 Thread miran
The meetup will start when this comment is two hours old :)

string concat I don't understand

2021-04-09 Thread PMunch
That `c` is a carriage return. You're splitting on `n` which is newline, but Windows uses `cn` for newlines in files. If you use `let contentO = readFile(my_file).split(Newlines)` it might work better (although that might split it in two.

string concat I don't understand

2021-04-09 Thread FabienPRI
Hello, I've got a text file containing 2 lines, forced to use code mode to show the exact content: \\ciosrv034\status\ 3 Run I've got the following code: let argv = commandLineParams() let contentO = readFile(my_file).split("\n") var pa

parsecsv strangeness

2021-04-09 Thread Yardanico
That won't show the contents from p 4 times

parsecsv strangeness

2021-04-09 Thread Hlaaftana
Or just `while p.readRow() and q.readRow():`

parsecsv strangeness

2021-04-09 Thread ynfle
Just make sure you close it

parsecsv strangeness

2021-04-09 Thread jhgalino
Thanks for the reply! A potential solution I found is opening the csv file again after the readRow() loop.

parsecsv strangeness

2021-04-09 Thread jhgalino
Thanks. I also just realized this after my program crashed by opening the same csv file 4 times.

parsecsv strangeness

2021-04-09 Thread Yardanico
Why not just read the rows into the sequence and then iterate over it? Assuming that your CSV file doesn't have millions of rows of course.

AVR Support?

2021-04-09 Thread PMunch
Did a little bit of bisecting, apparently this commit broke compilation with AVR/ARC/exceptions: and then that was rectified by bu

Tables and hashes

2021-04-09 Thread ynfle
This is explicitly mentioned in the `tables` documentation

Tables and hashes

2021-04-09 Thread Stefan_Salewski
I know that docs, read it five years ago, and again early this morning. Made it not really more obvious for me. But OK, I can live with the fact that I have to define a hash() proc for my references.

parsecsv strangeness

2021-04-09 Thread Stefan_Salewski
You can add echo statements to your source code to see what happens: import parsecsv var p,q: CsvParser p.open("test_1.csv") q.open("test_2.csv") p.readHeaderRow() q.readHeaderRow() while q.readRow(): echo "while q.readRow():" whi

parsecsv strangeness

2021-04-09 Thread jhgalino
I have two simple csv files: test_1 and test_2. test_1 contains the following: Letters A B C D Run while test_2 contains: Numbers 1 2 3 4 Run I used the following code: import parsecsv

Tables and hashes

2021-04-09 Thread Stefan_Salewski
No. In my initial post I explained that default equality operator == for references use the address of the instances, not the fields content, if we use == for two references. So it should be expected that for hashes of references, the content does not matter by default!

Tables and hashes

2021-04-09 Thread PMunch
Well most people would assume using an object (ref or otherwise) as the key for a table would use the hash of the data of the object, and not the reference of the object. So with the default you're imagining a lot of people are likely to have some strange bugs.

Tables and hashes

2021-04-09 Thread Stefan_Salewski
Not really related to my initial question, but Nim hashes works exactly like I assumed: import tables, hashes type V0 = ref object of RootRef i: int proc hash(v: V0): Hash = var h: Hash = 0 h = h !& addr(v[]).hash result = !$h

Multi-threaded features needed for Server

2021-04-09 Thread hankas
Regarding point no 2, I agree. It can be done currently by using _ptr_ or by switching gc, but some kind of mutex would be a nice addition to the standard library. Nim already has locks, but that requires passing both the lock and the object as _ptr_ , while ensuring that both the lock and the o

Tables and hashes

2021-04-09 Thread PMunch
Well a table is what is called a hash map. Essentially it has an array internally with N spots, then it hashes all the keys you want to put in and inserts the element (along with the hash or the key) into the array at position `hash mod N`. When you do a lookup the key is hashed again, you find

Tables and hashes

2021-04-09 Thread Stefan_Salewski
Sorry, I was not really asking what a hash map it. But thanks for the short summary. The core point is. A references can be seen as a managed pointer, which can be seen as an address, which is basically an integer value, with some restrictions maybe. So when hash() proc is predefined for intege

Interrupt vector table implementation trouble

2021-04-09 Thread japplegame
Great! Thanks.

Tables and hashes

2021-04-09 Thread Stefan_Salewski
Im am still busy converting my old PCB rubberband router from Ruby to PCB. While getting it to compile was already some work, getting it to really work is a task for which I can not estimate the effort still... One larger issue are the tables -- I can not remember how they work in Ruby, and I s

Interrupt vector table implementation trouble

2021-04-09 Thread ElegantBeef
You might be able to use the `push` and `pop` pragma, as such: {.push exportc, codegenDecl: "__attribute__((weak)) $# $#$#" .} proc ResetHandler() = main() proc NMIHandler() = discard proc HardFaultHandler() = discard {.pop.} Run

Twitter in 100 lines of Nim, no JS

2021-04-09 Thread Araq
> I'm going to take some time off and think about these two approaches again... > :). Yes, things to consider: * Just because the Karax version is fewer lines doesn't mean it's "simpler". * It also doesn't mean it's easier to debug, client-side DOM diffing is not much fun. * Even JS gener

Interrupt vector table implementation trouble

2021-04-09 Thread japplegame
Thanks. It works! Another issue. Is there a way to avoid repeating pragmas without writting macros? Something like: {. exportc, codegenDecl: "__attribute__((weak)) $# $#$#" .}: proc ResetHandler() = main() proc NMIHandler() = discard proc HardFaultHa

Testing/Feedback for Neel 0.4.0 development

2021-04-09 Thread moigagoo
Same: $ nimble install -y ... $ nim --threads:on -d:webview r .\examples\filePicker.nim ... C:\Users\moigagoo\nimcache\filePicker_d\@m..@s..@s..@s.nimble@spkgs@sneel-0@sneel.nim.c:12:10: fatal error: webview.h: No such file or directory 12 | #include "web