Optimize parsing large file line-by-line

2022-04-27 Thread Stefan_Salewski
Thank you very much for the provided code. I did just a short test, and at least with -d:danger the results are GREAT for all GC variants (arc, orc, refc). Nearly a factor 4 more performance when run on 4 cores instead of a single one. I will study your code in more detail in the next few days.

Nim 1.6.6 release candidate

2022-04-27 Thread miran
Here is a new release candidate, which (if no regressions are found) should become the official 1.6.6 release next week. Please give it a try and report any problems and regressions:

C++ binding variadic template

2022-04-27 Thread Bernice98
can you share the file too? if you dont mind.

Optimize parsing large file line-by-line

2022-04-27 Thread Bernice98
thanks for this, i was stuck with this too

Compiler giving wrong error message?.

2022-04-27 Thread Bernice98
thanks for solving it.

Compiler giving wrong error message?.

2022-04-27 Thread foderking
Nice thanks

Optimize parsing large file line-by-line

2022-04-27 Thread cblake
@Stefan_Salewski \- Below is a program that parses data like your book `csvdata.txt`. I use a `cligen/` API to assist splitting a file into max-size chunks/parts that I did for someone [in another thread](https://forum.nim-lang.org/t/7447) and some `MSlice` utility code. import std

Compiler giving wrong error message?.

2022-04-27 Thread ElegantBeef
The issue is the `i++` it's looking for the right hand of `++` (nim doesnt have unary postfx operators) so it needs a right hand to the `++`. Changing it to either `inc i` or `i += 1` resolves the issue. Furthermore you can rewrite this more elegantly with a `set[0..7]` as follows:

Compiler giving wrong error message?.

2022-04-27 Thread foderking
I have a function lets say: proc partTwo(input: string): string {.exportpy}= var ans: newSeq[string](8) set: newSeq[bool](8) i = 0 while true: if set.all(proc (x: bool):bool= x): break ans[i] = "a" set[i] = t

C++ binding variadic template

2022-04-27 Thread jmgomez
Sure, but it's totally unrelated. A bit of context, Im doing a POC of a plugin to use Nim in Unreal Engine using Unreal's reflection system as a binding mechanism (in contrast as the prev one that relied on generating cpp, this one it's a dyn lib which has a few adv). I did a wrapper on cpp tha

Introspection over a proc type

2022-04-27 Thread krakengore
That looks awesome thanks!

C++ binding variadic template

2022-04-27 Thread krakengore
Would you mind sharing what you did? 😜

Introspection over a proc type

2022-04-27 Thread ynfle
This should work import std/[macros] func f(x: int, y: seq[string], z: cint): seq[string] = discard proc expectSymKind*(n: NimNode, k: set[NimSymKind]) = if n.symkind notin k: error("Expected one of " & $k & ", got " & $n.kind, n) macro r

Brogrammer uptick

2022-04-27 Thread dom96
To be fair, scraping the html is more resilient: the early logs were only saved as HTML (so you will get 404s when requesting the JSON). Wasn't expecting this graph to just be HTML, really nice styling!

C++ binding variadic template

2022-04-27 Thread jmgomez
Thanks for sharing the code @krakengoren . I end up using another (I think simpler) approach for my use case which doesn't implied variadic templates at all.

AI’s opinions on Nim

2022-04-27 Thread jasonfi
Sounds like a cool vision for Nim! I hope the websites are built with Nexus and DocUI! Sorry that no code has been released just yet, but I'm getting there. Still adding polish and fixing bugs first. Plus I need to write some examples.

AI’s opinions on Nim

2022-04-27 Thread aEverr
nlvm confirmed for upstreaming in the future

AI’s opinions on Nim

2022-04-27 Thread demotomohiro
Input text: "Nim is". Output: Nim is one of the most prominent and well-used programming languages in the world. In addition to its many uses as a scientific, interactive, mathematical and general purpose programming language, it is also used at the highest levels of

Brogrammer uptick

2022-04-27 Thread PMunch
Oh I just meant I hope you parsed the JSON logs for your own sanity. The JSON endpoint is literally just replacing the `.html` part of the URL with `.json` like this: . It just makes it easier to parse out only actual messages, remove the NimForum bo

AI’s opinions on Nim

2022-04-27 Thread pietroppeter
> I think the secret for the success of Nim Programming Language is that it is easy to write complex programs in Nim (more than Python, Ruby, JavaScript) but yet not too complex. It's an example that there are many ways to do things in computer language.

Brogrammer uptick

2022-04-27 Thread geotre
@dom96 Thanks! I've uploaded the scripts [to github](https://github.com/geotre/ircgraph). They're very quick and dirty, please don't judge me for the code - I wrote it over my lunch break! It's simpler than you might expect, just a [small nimja template](https://github.com/geotre/ircgraph/blob/

Brogrammer uptick

2022-04-27 Thread geotre
I'm assuming the times are UTC, but I'm not actually sure. The times I used are just the ones in the irclogs pages? My download script just searches for `` elements containing something that looks like a time (e.g. "15:31:17") and saves them each on a line in a file for that date (so I don't ha

Introspection over a proc type

2022-04-27 Thread krakengore
In your example you have to manage the return type by comparing its string representation, not manipulating the actual type. If you were to know the size in bytes of the type returned from the passed proc you need to switch over the string and create a map that will map the string representation

Brogrammer uptick

2022-04-27 Thread Yardanico
I get the raw log files themselves, the old ones are in HTML, some are in .logs (marshal'd type from the IRC module), and the newer ones are .json.

Brogrammer uptick

2022-04-27 Thread PMunch
Haha, yes! I figured I would manage to get at least one person hooked! I'm also curious to see the scripts, and to know which timezone those times are in. As an aside I really hope those of you who scrape the logs use the JSON endpoint and not the HTML one, although I'm not 100% sure if the JSON