<< 22-08-2018 >>

00:06:43FromGitter<bung87> anyone could help me check the speed bottleneck?https://github.com/bung87/finalseg/blob/master/src/finalseg.nim
00:08:25FromGitter<bung87> I've taken advise yesterday ,reduce 2 seconds,but still 4 times slower than python version
00:15:11*noonien quit (Quit: Connection closed for inactivity)
00:17:52*drot1 joined #nim
00:20:29FromGitter<rayman22201> @ephja, vim, emacs, and VSCode all have nimsuggest support to some degree. Unfortunately I think nimsuggest is still broken the last I checked :-(
00:20:33FromGitter<timotheecour> can anyone explain how to use `iterToProcImpl` in user code? it says "Plugin to transform an inline iterator into a data structure.” ; I’d like to use it as follows: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b7cac50a491f45917815fab]
00:21:12*drot1 quit (Remote host closed the connection)
00:43:19*fibo_mach10 joined #nim
00:43:40FromGitter<bung87> the second params must be A = ref object, ⏎ https://gist.github.com/ilovezfs/68a5546967626d4e85d0#file-gistfile1-txt-L507
00:43:50*fibo_mach10 quit (Remote host closed the connection)
00:45:09FromGitter<timotheecour> I’d love to see a minimal example working in user code
00:51:22FromGitter<data-man> @timotheecour: https://github.com/nim-lang/Nim/blob/devel/lib/system/gc2.nim#L42
00:52:22FromGitter<timotheecour> i saw that… it’s entangled and not clear clear how to isolate to do a simple iteration over a simple iterator
01:19:28FromGitter<bung87> lib/system/profiler.nim(92, 23) Error: undeclared identifier: 'framePtr' ⏎ Nim Compiler Version 0.18.0 [MacOSX: amd64] , is this a bug?
01:20:48*Odd_ joined #nim
01:23:27*ovrstorm21 joined #nim
01:25:26*Odd_ quit (Remote host closed the connection)
01:27:29*ovrstorm21 quit (Remote host closed the connection)
02:06:05*vivus quit (Remote host closed the connection)
02:14:24*SenasOzys quit (Remote host closed the connection)
02:14:50*SenasOzys joined #nim
02:46:08*dddddd quit (Ping timeout: 260 seconds)
02:59:10*dddddd joined #nim
03:02:39TangerHey folks! Does anybody know of any good resources on threading and channels?
03:03:52*endragor joined #nim
03:07:06*smt quit (Ping timeout: 264 seconds)
03:16:23*endragor quit (Remote host closed the connection)
03:17:17*endragor joined #nim
03:40:08*dddddd quit (Remote host closed the connection)
03:47:42FromGitter<rayman22201> @Tanger the Nim in Action book, https://hookrace.net/blog/writing-an-async-logger-in-nim/, https://xmonader.github.io/nimdays/#uid47
03:48:58TangerOooh, thanks @rayman22201
03:50:51*endragor quit (Remote host closed the connection)
03:52:48*mar77i_ joined #nim
03:55:47*mar77i_ quit (Remote host closed the connection)
03:56:28FromGitter<rayman22201> 👍 np
04:09:18*cspar quit (Ping timeout: 268 seconds)
04:21:21*endragor joined #nim
04:21:25*endragor quit (Remote host closed the connection)
04:22:01*cspar joined #nim
04:30:10*endragor joined #nim
04:30:11*endragor quit (Remote host closed the connection)
04:38:08*matze1 joined #nim
04:38:46*ftsf_ quit (Remote host closed the connection)
04:39:13*ftsf_ joined #nim
04:39:30*matze1 quit (Remote host closed the connection)
04:57:34*craigger_ quit (Quit: bye)
04:57:51*craigger joined #nim
05:14:36*endragor joined #nim
05:25:44*leorize quit (Ping timeout: 256 seconds)
05:31:10*nsf joined #nim
05:32:06*cspar quit (Ping timeout: 252 seconds)
05:49:41*cspar joined #nim
05:50:32*ftsf joined #nim
05:54:52*ftsf_ quit (Ping timeout: 244 seconds)
05:55:38*leorize joined #nim
06:15:11*endragor quit (Remote host closed the connection)
06:28:41*Taylor__ joined #nim
06:32:35*Taylor_ quit (Ping timeout: 276 seconds)
06:40:52*Trustable joined #nim
07:00:25copygirlI managed to put this together: https://gist.github.com/copygirl/e73e6b07d7aef8238c39eedc52428d9a
07:00:46copygirlNow, `static var` doesn't exist, of course.
07:01:54copygirlIs there some way to create a static value per generic implementation of `getEventStore[T]`?
07:03:11copygirlI mean.. I bet there's overly complicated ways to do it, but perhaps there's something more straightforward?
07:08:20Araqdon't hide the event store.
07:08:36Araqpass it around in parameters. threadsafe, clarity.
07:09:15Araqprogramming is not an excercise in minimizing keystrokes. it's an excercise in minimizing problems.
07:16:19copygirlAh. Hmmm. I guess I was missing the simple solution because I was coming at this from another angle (that had event hierarchies - which turns out I probably don't want).
07:28:47*Trustable quit (Remote host closed the connection)
07:36:07*PMunch joined #nim
07:43:51*Vladar joined #nim
07:54:46euantorAlso maybe take a look at https://nim-lang.org/docs/events.html
07:58:23*captainkraft quit (Ping timeout: 276 seconds)
08:01:33Araqhmm the compiler ends up importing cgi.nim
08:01:48Araqand cookies, xmltree, uri ...
08:03:33*kobi7 joined #nim
08:04:04*gmpreussner_ joined #nim
08:04:33*gmpreussner quit (Ping timeout: 244 seconds)
08:09:49*xet7 joined #nim
08:11:12*captainkraft joined #nim
08:15:54*dadabidet joined #nim
08:18:45PMunchHmm, trying out threads for the first time in Nim. So GC'ed memory can't be accessed from within a thread, not even with a lock?
08:20:44PMunchIt can't even read global memory?
08:20:45PMunchHmm
08:21:15kobi7maybe it's for safety reasons?
08:21:27PMunchOh yeah, I know why it does it
08:21:44kobi7so there are ways to send the data, ala channels
08:21:48PMunchI'm just trying to figure out how to actually use it
08:22:01PMunchWell that would mean copying my data..
08:22:59leorizeor use createShared and pass pointers around
08:23:09PMunchBasically the first part of the program reads in a list from a file. Then the intensive part does some math on these entries and comes up with a score. This score is continually compared to a global score and when it's better it sets the best entry to that current entry
08:26:35*TheLemonMan joined #nim
08:27:03PMunchHmm, there is sharedlist in collections..
08:27:41TangerPMunch, check out the boehm gc option. It collects refs and ptrs, so you can have GC'd globals
08:28:59TangerSo you can use allocShared0 to allocate some space for an int and then pass around a global ptr to it
08:38:14FromGitter<gogolxdong> How come `client.getContent(url)` got Error: unhandled exception: 400 Bad Request [HttpRequestError] ⏎ but client.request(url) works well?
08:40:20FromGitter<gogolxdong> never mind.
08:42:50kobi7PMunch: for your usecase, the best is to use async.
08:43:32kobi7another thread, is usually when you want a background one, or you have threads as different actors, taking "work" from a queue and pushing to another queue.
08:43:46kobi7imho, ofc
08:44:18PMunchkobi7, I'm basically partitioning off the work in the beginning, then spinning up one thread for each part of the list to check
08:46:21kobi7it could still be done with 'async' and it's easier to reason about the code. An alternative would be channels, which is also relatively straightforward. maybe try to implement and then see if it matches your performance requirements
08:47:57TangerHey folks, I've put together a basic message queue using the observer pattern as a base and implementing channels, threads and dynamic dispatch. As I'm pretty new to these concepts in Nim, I was wondering if I'm over-complicating things? Would anybody mind giving my code a once-over if they have time and let me know if the implementation is sound? https://github.com/Tangdongle/nimobserver/blob/channels/tests/nimobserver_tests.nim
08:50:52kobi7hi tanger, I'm pretty new here too. why do you use methods instead of proc ?
08:52:59leorizeit allows dynamic dispatching
08:53:05Tangerkobi7: Dynamic dispatch, so the onNotify methods will be available not just to objects that inherit from BaseObserver.
08:53:28TangerIf I don't implement onNotify for subclasses of BaseObserver, it will fall back to the {.base.} method
08:53:59PMunchTanger, just a style thing, but Nim uses 2 spaces, not 4, for indentation
08:58:58*shadowbane quit (Ping timeout: 260 seconds)
09:00:08*shadowbane joined #nim
09:00:40*ldlework quit (Quit: co'o ro do)
09:00:57TangerOh, haha, thanks PMunch! Looks like something's overriding my vim ft settings :S
09:02:23TheLemonMantry nimpretty if you're feeling adventurous
09:03:22*leorize quit (Ping timeout: 272 seconds)
09:05:30PMunchHmm, that's strange: Error: cannot open file: channels
09:05:38PMunchTrying to import it
09:06:33*druonysus quit (Ping timeout: 272 seconds)
09:06:40PMunchOh -_-
09:06:44PMunchIt's part of system
09:06:58*xet7 quit (Quit: Leaving)
09:13:47PMunchHmm, well that's a bummer. After adding in threads I went from 70 seconds to 117 seconds :P
09:16:14*xet7 joined #nim
09:17:18PMunchI'm pretty sure that's mostly from not being as efficient with the early termination
09:17:59kobi7Tanger: your code looks good to me
09:18:25kobi7PMunch: so that's single vs. channels?
09:19:01PMunchkobi7, that's single threaded vs. multi-threaded
09:19:31kobi7are you using the threadpool (spawn) ?
09:20:26kobi770 seconds, that's pretty heavy. what are you computing?
09:20:27PMunchNo, manual thread creation
09:20:33PMunchhttp://ix.io/1kVu/
09:21:02kobi7probably async or threadpool will be better, then. usually i just use threads for i/o related things
09:21:11PMunchThe optimal list of N ingredients to get to make as many IBA certified drinks as possible
09:21:58PMunchhttp://ix.io/1kVv/
09:22:02PMunchThat's my threaded version
09:22:11PMunchIt does copy the drinks list though
09:24:19PMunchDrinks is 61 elements long, highestIngredientId is 40
09:26:33PMunchSo essentially it's running through all the 3838380 combinations of ingredients, and for every run it checks every drink to see if it contains only a subset of that combination
09:29:44kobi7did you try with async?
09:30:12kobi7for such a long 'for loop', have the inner function run asyncly
09:30:15FromGitter<narimiran> could you somehow prune those combinations?
09:31:57*rockcavera quit (Ping timeout: 240 seconds)
09:32:02kobi7PMunch: so you're a cocktail guy ha? ;-)
09:32:32*Zord6 joined #nim
09:33:04kobi7PMunch: is it a one time operation, or do the parameters change?
09:34:41PMunchkobi7, yeah cocktails are fun :) Unfortunately where I live alcohol is super expensive, so people tend to just drink beer and wine to "play it safe" no one will order a $10-$15 drink to see if they like it
09:35:19PMunch@narimiran, not sure really. Currently I'm just checking all possible combination of N ingredients from my list of ingredients
09:35:31*Zord6 quit (Remote host closed the connection)
09:36:09*ldlework joined #nim
09:36:23PMunchThe list of course is pruned, so only those ingredients that actually appear in the list of drinks will be used, and I can sort out categories so things like sugar, soda, etc. can be removed
09:36:25kobi7PMunch: what exactly does it do? checks nutrition or something?
09:36:32PMunchThis is running with only the different alcohols
09:37:28PMunchkobi7, I've taken all the IBA certified cocktails and written them down. Then I tell it how many ingredients I want to buy and it spits out the optimal list of ingredients that means I can make the most drinks
09:38:06*endragor joined #nim
09:38:15kobi7oh, so it's a constraints programming problem
09:39:47PMunchHmm, it annoys me that I have to copy all the drinks into every thread..
09:39:47kobi7http://www.gecode.org/
09:39:52FromGitter<narimiran> i'm thinking about, let's say, a combination {sugar, salt}, which might not be used in any cocktail. i don't know if you still check all combinations containing those two (e.g. {sugar, lemon, salt, soda}) or do you "exit early"?
09:39:53PMunchThe list is static once it's loaded
09:40:52PMunchWell if the combination is {sugar, salt} I could still make something with {sugar, salt, whiskey, soda, bitter}
09:41:03PMunchNamely an old fashioned
09:41:15PMunchIt doesn't use the salt, but that doesn't disqualify it from the list
09:41:47FromGitter<narimiran> oh!
09:42:29kobi7it's like those binpacking algorithms, how to maximize or minimize space/items
09:42:44FromGitter<narimiran> knapsack?
09:43:09PMunchIf you want to try it out: http://ix.io/1kVz/
09:43:12kobi7yeah, minimize money, maximize amount of drinks - buy ingredients
09:43:32*captainkraft quit (Ping timeout: 268 seconds)
09:43:40PMunchkobi7, well I'm not taking into account cost per ingredient
09:44:26FromGitter<narimiran> PMunch: that link is not very readable/usable ;)
09:44:27*druonysus joined #nim
09:44:27*druonysus quit (Changing host)
09:44:27*druonysus joined #nim
09:44:42kobi7narimiran: do view source.
09:45:09FromGitter<narimiran> nice trick, thanks kobi7!
09:45:15PMunchhttp://ix.io/1kVz
09:45:25PMunchHmm, seems ix.io messed up the line count thing..
09:45:35PMunchWith the / is supposed to give you line counts
09:46:07PMunchI have a keyboard shortcut to automatically grab my clipboard and send it to ix.io, so I never really check what the result actually looks like :P
09:46:54PMunchSo yeah, just access it without the final / and it looks better :)
09:47:44PMunch@narimiran ^
09:48:28kobi7PMunch: does nim have a way to profile?
09:48:44PMunchWell you can use the C profiler
09:49:20FromGitter<narimiran> kobi7: yeah, use `nim c --profiler:on --stacktrace:on`
09:49:55FromGitter<narimiran> and you should put `import nimprof` in your file, IIRC
09:50:53kobi7ok, bbl guys, thanks
09:51:28PMunchhttp://ix.io/1kVz
09:51:37PMunchRan it with maxIngredients = 4
09:52:00PMunchNo huge surprise there :P
09:54:36*NimBot joined #nim
09:58:20*cspar quit (Ping timeout: 265 seconds)
09:58:57PMunchAh, found an issue. The threads seems to be really unbalanced :P
09:59:23PMunchI forgot that they grow exponentially the higher the numbers
09:59:41PMunchSo the one doing 10 to 0 completes way before the one that does 40 to 31
09:59:51PMunchhttp://ix.io/1kVC
09:59:55PMunchhttp://ix.io/1kVD
10:00:11FromGitter<tim-st> When I have the following code which prints chars ```nim
10:00:33FromGitter<tim-st> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b7d3441e5b40332abe073e3]
10:01:07FromGitter<narimiran> "So the one doing 10 to 0 completes way before the one that does 40 to 31" -- heh, this is quite frequent mistake :)
10:01:14FromGitter<tim-st> how can I save this to a `result.data` where result.data is of type `UncheckedArray[char]`?
10:01:49FromGitter<tim-st> I tried `[]` operator but then the data is corrupted
10:02:05FromGitter<narimiran> Pmunch: what do you use to measure sub-ms times?
10:03:58FromGitter<tim-st> basically how can I change the addr of `result.data` to `data`?
10:04:12PMunchnarimiran, just cpuTime() before and after the body of the thread
10:04:36PMunchThen I just timed that with 1000
10:05:03PMunchSo that result is probably not precise, but they are so different that it doesn't matter much
10:06:11copygirlIf I define a generic method such as `foo[int](32)`, could I do `foo[void]()`? I get a type mismatch. How do I specify a void parameter?
10:06:29FromGitter<narimiran> indeed. please post the results when you'll have different (more efficient) division of work
10:10:22TheLemonManhmm, multithreaded benchmarks is something that I may consider for my benchmark harness
10:11:42PMunchHmm, creating a good division for a recursive function like this one is a pain..
10:18:16*seni joined #nim
10:18:56TheLemonManAraq, WRT #8720 you mean I should just use qualifiedLookUp instead of picksym?
10:19:05PMunchDid this with a manual division: http://ix.io/1kVK
10:19:49PMunchCompared with non-threaded: http://ix.io/1kVL
10:20:29PMunchSo I saved about a second..
10:21:53PMunchSingle threaded without the early-termination: http://ix.io/1kVM
10:27:11*captainkraft joined #nim
10:32:36FromGitter<tim-st> anyone can help here (without copyMem)? https://gist.github.com/tim-st/d5868e99a5e7121cafbd651b36bc8018
10:33:02*krux02 joined #nim
10:34:53PMunchHmm, do we have atomic test and set in Nim?
10:35:38FromGitter<GULPF> I think there is an open PR for it
10:36:17FromGitter<GULPF> https://github.com/nim-lang/Nim/pull/8620/
10:36:22AraqTheLemonMan, yeah
10:37:51TheLemonMantim-st: you probably want data to be a ptr UncheckedArray
10:38:15FromGitter<tim-st> TheLemonMan: Yes, but nims string type definition doesnt allows it
10:38:23FromGitter<tim-st> or can I cast though?
10:38:43TheLemonManshrug, I'm just having a look at the generated C code
10:39:47FromGitter<tim-st> I even tried to copy the ptr addr using copyMem to the ptr addr from the working ptr, nothing seems to work
10:40:27*data-man joined #nim
10:41:12*data-man quit (Client Quit)
10:41:24FromGitter<tim-st> TheLemonMan: wow, it worked when changing the type definiton, thank you!!
10:41:35FromGitter<tim-st> I didnt expect this though
10:42:22TheLemonManwell the loop works fine, but result is mangled :P
10:43:08FromGitter<tim-st> oh, your right... So I really need to change the data addr somehow :(
10:50:37TheLemonMantim-st, https://gist.github.com/LemonBoy/833f2c313f0bdd2f06a293ad68f14492
10:51:49TheLemonManthe VLA in nimStringDesc is not a pointer, the compiler is just smart enough to allocate sizeof(nimStringDesc) + initial_cap
10:53:50PMunch@GULPF, oh ten days ago even
10:53:57FromGitter<tim-st> TheLemonMan: Thanks, that looks better, but from what I see it does copy, and additionally the array is limited to a size now?
10:54:23FromGitter<tim-st> with copy I can just use `copyMem(addr(result[0]), val.mv_data, val.mv_size)`
10:54:28FromGitter<tim-st> I wanted zero copy
10:55:10PMunch@GULPF, and there apparently is a atomics module in system as well
10:55:57TheLemonManyou're SOL since you can't append a nimStringDesc before mv_data, at least without copying it
10:57:01FromGitter<tim-st> TheLemonMan: I dont want to append, it's read only and cleaned by lmdb, the python wrapper has it working too with zero copy
10:57:44TheLemonManI suspect python's strings are a data_ptr+len pair while Nim's is header+data
10:59:07FromGitter<tim-st> hm, but at some point, when I read from string like `s[0..x]` it know the start addr and I just want to set this start addr to the pointer to start addr from uncheckedArray
10:59:27FromGitter<tim-st> I'm pretty sure this has to work somehow
10:59:30TheLemonManoh they exploit Python's buffer interface
10:59:38TheLemonManyeah, you're SOL :P
11:00:11*cspar joined #nim
11:00:29TheLemonManwhy don't you just implement some operators over a lmdbString type?
11:00:32FromGitter<tim-st> well, I could return a `tuple[data: UncheckedArray[char], len: int` but then the procs from strutils dont work out of the box
11:01:11FromGitter<tim-st> yes, I thought about it, but I think it's easier to cast the string, but if this cannot work, I will go the other way, thanks!
11:17:49*dddddd joined #nim
11:19:35*norok2 quit (Ping timeout: 240 seconds)
11:23:12*norok2 joined #nim
11:23:14TheLemonManAraq, apparently that change was reverted here https://github.com/nim-lang/Nim/commit/f3a895f04321853f32b571a1f314d72c73274ff6
11:23:37*ftsf_ joined #nim
11:24:52*kobi7 quit (Quit: Leaving)
11:25:27TheLemonManI'll drop the ambiguity check and perform it by hand after the symbol are filtered
11:28:49*leorize joined #nim
11:30:45TheLemonManbut by doing this we end up reimplementing what pickSym does...so let's keep it and call it a day?
11:31:29Araqbut the point is: type specific lookups are not in the spec
11:31:58Araqyou are not supposed to filter after qualifiedLookup
11:32:53Araqhmmm, so somebody used a proc named 'range'
11:33:11TheLemonManI see, I hope nobody relies on the old behaviour heh
11:33:19TheLemonManthis should also be spec'd
11:33:37Araq0.19 is about breaking stuff for humanity
11:33:56Araqand we need to improve the spec tremendously
11:34:21AraqI don't want to hear "I think this should work..." without a solid reference to the spec to back it up
11:35:55TheLemonManok, so shall we re-instate the ambiguity check for all the symbols (so a proc named 'set' and the type 'set' will clash) or just among symbols (two imported types 'T' will require a qualifier) ?
11:37:29Araqwell we need a way to do --v018 on the command line for backwards compat, or something similar
11:38:14Araqand the general idea is that procs/funcs etc are filtered in calls but otherwise we have this lovely nkSymChoice that marks an ambiguity
11:39:09Araqso if I have a proc set I can call it via set()
11:39:25Araqbut var x: set[char] would be ambiguous hmm
11:39:41AraqI can already hear the complaints.
11:39:59Araqalright, better add this rule to the spec then.
11:40:00*ftsf_ quit (Ping timeout: 244 seconds)
11:40:07Araqbbl
11:41:34*norok2 quit (Remote host closed the connection)
11:50:05*norok2 joined #nim
12:25:59*Trustable joined #nim
12:27:46*Trustable quit (Remote host closed the connection)
12:28:57*SenasOzys quit (Ping timeout: 240 seconds)
12:30:13*noonien joined #nim
12:35:42FromGitter<mratsim> @copygirl, static var doesn’t exist (anymore) but `var foo{.compileTime.}` does.
12:36:27*SenasOzys joined #nim
12:43:02*Trustable joined #nim
12:54:57*floppydh quit (Remote host closed the connection)
12:55:43*floppydh joined #nim
12:56:04*tomek18 joined #nim
12:59:27*tomek18 quit (Remote host closed the connection)
13:00:53*cspar quit (Ping timeout: 252 seconds)
13:16:03FromGitter<bung87> lib/system/profiler.nim(92, 23) Error: undeclared identifier: 'framePtr' ,what's this problem?
13:16:28Araqyou need to compile with --stackTrace:on as the documentation says
13:16:39FromGitter<bung87> ~/Nim/bin/nim c -r --profiler:on --stacktrace:on tests/test2.nim
13:17:00FromGitter<bung87> Nim Compiler Version 0.18.1 [MacOSX: amd64]
13:18:30FromGitter<dom96> PMunch: the parallelism chapter of my book should help you out.
13:19:27PMunchAh, that's true. Ilrr have to check that when I get home
13:19:43FromGitter<bung87> does nim config file matters?
13:21:15FromGitter<xmonader> @dom96 can you check your PM ?
13:27:25*matthiaskrgr18 joined #nim
13:31:10*matthiaskrgr18 quit (Remote host closed the connection)
13:43:25*gmpreussner_ quit (Ping timeout: 268 seconds)
13:48:48*gmpreussner joined #nim
14:02:14TheLemonManAraq, so which one of the two rules is being spec'd?
14:02:53Araqboth
14:03:49*rockcavera joined #nim
14:03:59TheLemonManso ambiguous symbols are ambiguous but type names get a special treatment?
14:05:29Araqyeah.
14:13:31FromGitter<bung87> how to do profiling?
14:14:07FromGitter<bung87> I checked both way in this blog https://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.html#profiling-with-nimprof
14:14:33FromGitter<bung87> valgrind: This formula either does not compile or function as expected on macOS
14:20:38Araqbing87 put your code in a 'proc main = ...'
14:21:14*kapil___ joined #nim
14:22:13Araqand you can read the full file into memory with a single readFile call. then iterate over it with the splitLines() iterator
14:22:20kapil___hello I am totally new to nim language. how should I start client (Javascript) side developing in nim?
14:22:25Araqno need for a 'lines: seq[string]'
14:22:34Araqkapil___, YES! :-)
14:23:37PMunchkapil___, you mean writing client side code for node.js?
14:24:03kapil___PMunch: I am a react developer. I want to generate frontend for my backend.
14:24:13dom96PMunch: Client-side means browser-side
14:24:27PMunchOh sorry, I'm tired :P
14:25:31euantorkapil___: Take a look at Karax for definite: https://github.com/pragmagic/karax
14:26:12kapil___euantor: thanks.
14:26:30dom96yeah, play around with the examples
14:26:38dom96Ask questions here if you get stuck
14:27:38PMunchHmm, now is the time where it would be nice if I had finished my video tutorial series on web-dev in Nim..
14:28:26*PMunch quit (Quit: Leaving)
14:29:59kapil___thanks.
14:30:02FromGitter<bung87> @Araq I defined main proc and with when isMainModule: still same error
14:30:04FromGitter<bung87> Error: undeclared identifier: 'framePtr'
14:35:20dom96So this nimcache move has a chance to break quite a lot: https://github.com/nim-lang/nimforum/blob/master/nimforum.nimble#L39 :(
14:36:08*endragor quit (Remote host closed the connection)
14:36:27FromGitter<bung87> @Araq yeah,I checked readFile and splitLines,It's useful.
14:36:28FromGitter<GULPF> @dom96 I'm pretty sure js files are not affected, they still end up in a local nimcache
14:38:30dom96hrm, you're right
14:38:32FromGitter<bung87> I reduce my test 2 seconds since yesterday ,still 4 times slower than python version:(
14:39:02dom96bung87: Are you compiling with -d:release?
14:40:52FromGitter<bung87> yes,and using re lib much slower than nre lib ,upgrade from 0.18.0 to 0.18.1 reduce half second...
14:41:16dom96show us the code
14:43:22TheLemonMandom96, I created a whole new css class because .avatar was applied to all the classes extending from it...I don't know much about scss heh
14:44:00FromGitter<bung87> https://github.com/bung87/finalseg/blob/master/tests/test2.nim the main test file,also a python version test `speed.py` which depends `jieba` under tests folder
14:45:26FromGitter<xmonader> So google passed on me i guess for not remembering kmp by heart :D
14:45:34FromGitter<bung87> the original python version,https://github.com/fxsjy/jieba/blob/master/jieba/finalseg/__init__.py
14:46:14TheLemonManxmonader, why not BMH? I've never liked KMP
14:46:34dom96bung87: In the Nim version your measurement includes the time to read the file and split each line, in the python version you're not measuring this
14:46:38FromGitter<xmonader> i like boyr moor horsepool algorithm and that one i actually remember xD
14:47:01pigmejsimple question... asyncdispatch/asyncdispatch2 or reactor.nim for
14:47:04pigmej new library in new project?
14:47:15dom96What's the project?
14:48:10dom96(or what's the library?)
14:48:23FromGitter<Varriount> @bung87 You seem to be creating a lot of temporary strings
14:48:25FromGitter<bung87> ? I just create start time and end time
14:48:38pigmejdom96 I want to write client for NATS
14:48:49pigmejand then I need to do some pub/sub stuff
14:49:39pigmejI have it semi working with asyncdispatch2 (without reconnect though) but.... I'm strating to have feeling that it's getting messy and unpredictable
14:49:54dom96It's TCP so use asyncdispatch
14:50:10pigmejwhy not reactor?
14:50:19dom96Please for the love of Nim, don't use asyncdispatch2 or reactor
14:50:33FromGitter<bung87> @Varriount I dont think that would has so much impact,It's use the same control flow as python version
14:50:40dom96Because asyncdispatch is in the stdlib
14:50:59dom96Let's not fracture our ecosystem by using three different async IO implementations for all our libraries
14:51:15dom96If you need features that asyncdispatch2 is offering then let's get it into the stdlib
14:51:20dom96(same for reactor)
14:51:29pigmejhttps://github.com/nim-lang/Nim/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3AAsync+ but that doesn't make me happy
14:51:59dom96Do those issues actually affect you?
14:52:12FromGitter<Varriount> Can you post the Python code too?
14:52:13*ftsf quit (Read error: Connection reset by peer)
14:52:31pigmejdom96: at least partially
14:52:37TheLemonMankeep in mind that some (many) tickets have been accidentally fixed in the meanwhile
14:52:41dom96pigmej: which issues specifically?
14:53:07pigmejhttps://github.com/nim-lang/Nim/issues/7758
14:53:20pigmejhttps://github.com/nim-lang/Nim/issues/7886
14:54:19pigmejnot to mention "strange" behaviour when waitFor used in {.async.} (ok that's on my shoulders though)
14:54:47*PMunch joined #nim
14:55:10dom96I've got a PR that fixes all of those issues: https://github.com/nim-lang/Nim/pull/8209
14:55:39dom96Don't use waitFor in an async proc
14:55:54dom96Why are you doing that?
14:56:01pigmejaccident :P
14:56:11pigmejand then "BUM" everything explodes
14:56:45FromGitter<bung87> @dom96 I checked ,I may change to old version, but it's just about 0.2 seconds than before
14:56:50pigmejanyway let me check sth
14:57:21dom96pigmej: Guess I should detect `waitFor` in the async macro and tell you off :P
14:57:27pigmejbtw dom96 your fix adds one more handle, so .... pretty much no go for me because I'll have tons of TCP requests
14:57:36pigmejdom96: that would save my ass :)
14:59:30FromGitter<bung87> @Varriount https://github.com/fxsjy/jieba/blob/master/jieba/finalseg/__init__.py the python version
15:01:59*dadabidet quit (Quit: Leaving)
15:06:22TheLemonMandom96, I don't like the :first-child selector, it looks too brittle to me... Is it ok if I keep the .first class and drop .thread-avatar ?
15:06:49dom96TheLemonMan: No. I don't see what's brittle about it
15:07:07pigmejdom96: ok but consider that example: https://gist.github.com/pigmej/31e0cd9ba7fcdd4a089a0ee99dce4b5e
15:07:14pigmejit may be broken obviously BUT
15:07:39pigmejlet me check sth because I ran invalid server ;D
15:08:14*nathanj quit (Ping timeout: 255 seconds)
15:08:28pigmejok nvm works fine
15:09:11TheLemonMandom96, it depends on the order of the elements in the parent div, if you ever change that you'll have to change the css too
15:09:16*nathanj joined #nim
15:09:59dom96TheLemonMan: You'll always select the first avatar
15:10:25dom96The order of the other elements shouldn't matter
15:11:08dom96pigmej: That looks really fragile :)
15:11:16TheLemonManoh, right, I'll change that then
15:11:34pigmejdom96: that was just an naive example
15:11:40dom96TheLemonMan: Like I said though, I didn't test it so please make sure it works
15:14:45*arecaceae quit (Remote host closed the connection)
15:15:07*arecaceae joined #nim
15:15:19TheLemonManAraq, if I import a type T from `modb` and then define a `type T` should T be considered as ambiguous?
15:15:23TheLemonMandom96, sure thing
15:18:47AraqTheLemonMan, iirc the module level scope and the import scope are different
15:19:03Araqand so the module's T is preferred and that's it.
15:19:42*Taylor__ quit (Quit: Leaving)
15:21:42TheLemonManmakes sense, as long as it's wanted and not just a misfeature of pickSym :)
15:29:32*gangstacat quit (Quit: Ĝis!)
15:31:38FromGitter<Clyybber> Araq Are enums with uint32 as a representation possible?
15:33:41FromGitter<bung87> from a import b as c possible in Nim ?
15:37:19AraqClyybber: nah, use a distinct uint32
15:37:40AraqNim's enums are more about speed than about C interop :-)
15:37:55FromGitter<Clyybber> Ok, thank you :-)
15:38:33dom96testament now runs tests by default, right?
15:39:26Araqdom96, I don't think so
15:39:41AraqI know I merged a PR for this, but it doesn't work for me
15:40:44*Notkea quit (Remote host closed the connection)
15:41:58FromGitter<Clyybber> Araq Is cuint an alias for uint32 or are there some subtle differences between those two?
15:43:42Araqcuint is C's "unsigned int" which can have more or fewer bits than 32
15:43:58*Notkea joined #nim
15:44:08Araqbut the platforms where that's true are irrelevant for ordinary application development
15:45:06FromGitter<Clyybber> Ok, thanks
15:50:45*Torus joined #nim
15:56:09*captainkraft quit (Ping timeout: 252 seconds)
15:56:41*captainkraft joined #nim
16:00:45*Jesin quit (Quit: Leaving)
16:08:15*Torus left #nim (#nim)
16:09:54*Jesin joined #nim
16:10:13*T-roy joined #nim
16:10:32T-royNim compiler has so many bugs because you wrote the friking compiler on nim, are you stupid? Nim is unstable, why didn't you wait until nim was stable? It is comon sense DUH, but you are so arrogant that you couldn't wait until nim was stable, because you wanted to say "nim is self hosted"... I am glad you commited this error, and much others... Hehe cuz i am creating my own language, and idc about anyone's opinion cuz it will be a priva
16:10:36T-roych better than nim, it will have automatic memory managent without GC and without rust's complexity, easy syntax, and more cool things too (like built in concurrency and parallelism support), and it will transpile to C too like nim, but it will be private and for linux only.
16:10:42T-royFUCK NIM HAHAHAHA
16:10:49pigmej:|
16:11:28euantorLooks like the troll is back...
16:12:02dom96wow. a registered troll
16:12:06T-royI just say the truth
16:12:32T-royThe compiler shouldnt be written on an unstable lang
16:12:42T-royLike nim
16:15:06shashlick_wow what do we do now? our compiler is unstable and self-hosted! let's throw out 13 years of work, yes yes - let me open an RFC
16:17:33Araqand what is worse, Nim is still not Haskell/C/Rust/Clojure
16:18:15*floppydh quit (Quit: WeeChat 2.2)
16:19:11FromGitter<alehander42> ah calm down
16:19:35FromGitter<bung87> *it will be private* ....why don't you keep it as secret
16:20:32FromGitter<bung87> and there's julia lang
16:20:58AraqJulia is not Linux-only though.
16:23:42FromGitter<bung87> julia's introduction similar with nim, still lack of many features..
16:32:10FromGitter<Varriount> @bung87 One of the big differences between Python and Nim is that in Python, strings are immutable, whereas in Nim they aren't.
16:32:30FromGitter<Varriount> Because of this, and because of how strings are structured in Nim, strings get copied on assignment.
16:33:37Araqyeah, except when they are moved.
16:34:49FromGitter<bung87> so there's so much memory management since the scrpits all abouts process text.
16:34:52Araqis that really the root cause of the different performance here? when I skimmed the code it felt like Nim has a slower IO library
16:35:29*shodan45_ quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
16:35:51*shodan45 joined #nim
16:36:19FromGitter<bung87> in test case loop lines already store to sequence, just process string thing.
16:36:24*destroid joined #nim
16:37:19FromGitter<bung87> since I can't find the proper way profiling, I can 't sure about the bottleneck is
16:40:17*destroid quit (Client Quit)
16:55:15*zachcarter joined #nim
16:55:33zachcarterjust switched to weechat - it's nice
16:57:10TheLemonManI heard from the grapevine that irssi is nicer :P
16:57:56*nsf quit (Quit: WeeChat 2.2)
16:58:12zachcarteroh man
16:58:17zachcarterabout to upworld my new world
16:58:20zachcarteruproot*
16:59:05zachcarterso this I think is problematic - right? - `import jsffi proc bindTo(p: proc(), self: JsObject, args: JsObject): proc() {. importcpp: "bind" .}`
16:59:18zachcarterproducing - `foo.nim(3, 67) Error: attempting to call undeclared routine: 'importcpp'`
16:59:57zachcarterI guess this is why bindMethod in jsffi exists - but... I don't think bindmethod will do what I need it to
17:01:52*avelardi18 joined #nim
17:03:37*Trustable quit (Remote host closed the connection)
17:03:39*kapil___ quit (Quit: Connection closed for inactivity)
17:05:01zachcarterquit
17:05:04zachcarterwhoops
17:05:06zachcarter!quit
17:05:11zachcartergd - sorry I'm a terminal irc noob
17:05:19*zachcarter quit (Quit: WeeChat 2.2)
17:05:45*avelardi18 quit (Remote host closed the connection)
17:06:47*zachcarter joined #nim
17:06:56zachcartertest - can anyone see this?
17:07:08Araqzachcarter, welcome
17:08:03zachcartersweet - thanks Araq - TheLemonMan: I switched to irssi but I have a few complaints already - NickServ didn't send any messages back when I registered and my password was in plaintext in the shell - not that I really care, but still...
17:08:44TheLemonMannickserv messages are in the 1st buffer and please use SASL instead of /autosendcmd
17:09:31zachcarterokay - I need to figure that out - thank you
17:10:09TheLemonManzachcarter, https://freenode.net/kb/answer/irssi
17:10:38TheLemonMannice piece of trivia, I've implemented SASL in irssi :)
17:10:47zachcarterAraq: when you have a moment, do you think you could acknowledge whether an issue should be made for that error message or not? I know `bind` is a reserved keyword but the error message is misleading I think?
17:10:55zachcarterTheLemonMan: thank you!
17:11:16zachcarter:D I'm sure it works very well then!
17:14:18Araqzachcarter: yeah please report it
17:15:27FromGitter<metasyn> i was searching around for nim + apache arrow and it lead me to some old irc log conversations between @mratsim & @skrylar about flatbuffers... did that ever go anywhere? ⏎ i found https://github.com/Skrylar/skflatbuffers which looks like it was updated a few months ago
17:17:33FromGitter<mratsim> yeah no more flat buffers stuff for the moment. Depending on the serialization chosen for Ethereum 2.0 https://ethresear.ch/t/discussion-p2p-message-serialization-standard/2781 and https://notes.ethereum.org/15_FcGc0Rq-GuxaBV5SP2Q?view (discussion next Thursday) we might implement production grade Flatbuffers/Protobuf/CapnProto in Nim.
17:18:58FromGitter<metasyn> Oh very cool!
17:19:14dom96TheLemonMan: Oooh. Nice to have such an IRC veteran amongst us :D
17:19:18FromGitter<metasyn> It seems like flat buffers integration would come before apache arrow
17:20:45FromGitter<mratsim> Apache Arrow would be more for NimData or Kadro (NimData based on Arraymancer): https://github.com/bluenote10/kadro
17:21:43FromGitter<metasyn> In this case, I have a splunk serialization protocol that I want to upgrade to one of the aforementioned, then will be sending over a socket or something to an external ML process
17:21:59FromGitter<metasyn> and if i upgrade to one of the aforemtioned, it would be cooler if i could also just read that format into nim, too
17:23:48FromGitter<metasyn> oh so kadro is a rewrite of nimdata but with arraymancer? that is rad
17:24:00FromGitter<mratsim> it’s still stealth mode
17:24:39FromGitter<mratsim> In September I will probably implement a Vega/Vega-lite library for Nim btw: https://vega.github.io/
17:25:04FromGitter<mratsim> Ideally it will create webview pop-ups with interactive charts
17:25:22*federico3 quit (*.net *.split)
17:25:22*rayman217 quit (*.net *.split)
17:25:22*Amun_Ra quit (*.net *.split)
17:25:22*pwntus quit (*.net *.split)
17:25:22*Tanger quit (*.net *.split)
17:25:22*riidom quit (*.net *.split)
17:25:22*Entropic quit (*.net *.split)
17:25:22*zama quit (*.net *.split)
17:25:32*Entropic joined #nim
17:25:46*pwntus joined #nim
17:25:47*Tanger joined #nim
17:25:48*zama_ joined #nim
17:25:58FromGitter<mratsim> The more I dive into the vega ecosystem, the more I like it. They have an open-source Tableau clone (and they do work with tableau)
17:26:27*Amun_Ra joined #nim
17:27:06*riidom joined #nim
17:27:27*zama_ quit (Changing host)
17:27:27*zama_ joined #nim
17:27:32*zama_ is now known as zama
17:29:59*Amun_Ra is now known as Guest27585
17:34:45*livcd_ quit (Changing host)
17:34:45*livcd_ joined #nim
17:41:22dom96yglukhov[m]: You around?
17:54:26*nsf joined #nim
18:07:57*Guest27585 is now known as Amun_Ra
18:11:05*SenasOzys quit (Ping timeout: 252 seconds)
18:13:49*zachk joined #nim
18:14:17*zachk quit (Changing host)
18:14:17*zachk joined #nim
18:27:29*jhorwitz_ joined #nim
18:28:09*jhorwitz_ quit (Client Quit)
18:40:03yglukhov[m]dom96: hey whats up
18:42:44FromDiscord<Jungly> So is NIm a new language?
18:42:48FromDiscord<Jungly> So is Nim a new language?
18:45:49FromGitter<mratsim> @Jungly, by language standard it’s young since it’s about 10 years old (?)
18:46:31FromDiscord<Jungly> What is @gitterirc ?
18:46:45FromGitter<mratsim> thr bridge between Gitter and IRC
18:47:04FromDiscord<Jungly> Lol idk if that's a good or bad thing
18:50:22FromDiscord<exelotl> <@231193587897991169> so basically it's as if you're in a Discord channel, a Gitter channel and an IRC channel all at the same time
18:50:40FromDiscord<exelotl> everyone can talk to each other but it looks a bit ugly
18:56:52*nsf quit (Quit: WeeChat 2.2)
18:59:54pigmejstill better than keeping 3 separate channels :)
19:10:13FromDiscord<exelotl> yeah it's a great solution given the current size of the community
19:25:13zachkis there an abs() or absolute value function for float in nim, or do I need to code my own?
19:26:42Araqmath.abs
19:34:06*SenasOzys joined #nim
19:34:22*SenasOzys quit (Remote host closed the connection)
19:55:12*SenasOzys joined #nim
19:55:22*SenasOzys quit (Remote host closed the connection)
20:04:33*Jesin quit (Quit: Leaving)
20:12:48*SenasOzys joined #nim
20:12:52*SenasOzys quit (Remote host closed the connection)
20:19:01*seni quit (Quit: Leaving)
20:26:44*SenasOzys joined #nim
20:27:32*Jesin joined #nim
20:27:39*rayman22201 joined #nim
20:27:57*Jesin is now known as Guest31635
20:28:02*Guest31635 quit (Remote host closed the connection)
20:28:48*Jessin joined #nim
20:30:02*Jessin quit (Remote host closed the connection)
20:30:36*Jesin joined #nim
20:30:40*PMunch quit (Remote host closed the connection)
20:35:22FromGitter<tim-st> @dom96 I tried jester the first time, I think there is a bug: when I try the example api `get "/info/@name":` using `http://127.0.0.1:5000/api/info/someWord` and insert non ascii word as `someWord`it gets encoded, is that expected? (btw I like how easy it was to set up)
20:36:20FromGitter<tim-st> `http://127.0.0.1:5000/api/info/Straße` prints `Stra%C3%9Fe`
20:36:26Araqwhat's wrong with encoding things?
20:36:32Araqthat's how URLs work
20:36:42dom96Does Jester decode it for you?
20:36:56FromGitter<tim-st> nope, doesnt seems to be the case, but I expected it
20:37:23dom96That's a bug then
20:37:23dom96report it
20:37:31FromGitter<tim-st> ok, thanks for the quick response
20:40:45*wildlander joined #nim
20:57:33FromGitter<tim-st> I see the same behaviour with `jester` like with `mofuw` that it grows ram with each request, I have to check how other webserver grow ram, maybe it's normal
21:01:42dom96Sadly there is definitely a bug hiding in there for Nim with regards to that
21:02:15FromGitter<Clyybber> > In September I will probably implement a Vega/Vega-lite library for Nim btw: https://vega.github.io/ ⏎ ⏎ Nice! Looking forward to it
21:03:11FromGitter<tim-st> dom96: yes, I think it has nothing to do with jester or mofuw, it grows like 10 kb each time pressing f5 the same like for mofuw
21:03:23FromGitter<tim-st> maybe underlying nim module
21:03:55*wildlander quit (Quit: Konversation terminated!)
21:04:09*wildlander joined #nim
21:10:52*NimBot joined #nim
21:19:34*NimBot joined #nim
21:21:28*FromDiscord quit (Ping timeout: 260 seconds)
21:28:45*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
21:35:02*Logan7 joined #nim
21:37:05*Logan7 quit (Remote host closed the connection)
21:38:05*phuzion1 joined #nim
21:52:20*dom96 quit (Ping timeout: 276 seconds)
21:54:14*FromDiscord joined #nim
21:55:07*FromDiscord_ quit (Ping timeout: 265 seconds)
21:58:07*dom96 joined #nim
21:58:08*dom96 quit (Changing host)
21:58:08*dom96 joined #nim
22:07:54*NimBot joined #nim
22:08:10AlexMaxI mean, after all, nim _does_ call a C compiler behind the scenes and links a bunch of object files. Seems like I ought to be able to add arbitrary .o files to that, no?
22:10:39*Sentreen quit (Quit: WeeChat 1.6)
22:10:54AlexMaxI guess this would also be known as mixing nim and C code?
22:11:42AlexMaxdamn, are most nimmers european or something, seems like things get quiet ITC as soon as I get home :P
22:17:36shashlick_🙂 that's my frustration too - most of the experts are in Europe, it's radio silence in the evenings and nights here
22:18:00shashlick_@AlexMax: you can check out nimgen to see how that's done with some other C libraries
22:18:09FromGitter<rayman22201> Unfortunately, yup, Nim is very European centric... There a few of us in North America :-P to answer your question though. I think the most straight forward way is to use --passC to pass the C file to the unerlying C compiler directly: https://nim-lang.org/docs/nimc.html
22:18:22bozaloshtshAlexMax: you can't write a small nim wrapper for the c functions?
22:18:46shashlick_it is super easy - basically use `{.compile.}` to add C files and `{.passC.}` and `{.passL.}` for compile and link flags
22:19:41FromGitter<rayman22201> oh yeah, @slashlick_ has a better answer. use the pragmas. Does the same thing as the compiler flags but is better because it lives with your code.
22:19:52FromGitter<ephja> nah, mostly americans who wake up at 10pm :p
22:20:10shashlick_here's an example of wrapping libclipboard: http://nimgen.genotrance.com/nimclipboard/libclipboard.nim.html
22:21:44AlexMaxshashlick_: yo that's exactly what I was looking for - I think
22:22:10FromGitter<rayman22201> @ephja sleep is just a bad habit. I've been trying to give it up for years :-P
22:22:13AlexMaxshashlick_: where is that documented?
22:22:18shashlick_which library are you wrapping
22:22:21shashlick_in the manual
22:23:02shashlick_https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compile-pragma
22:23:20AlexMax...you know what
22:23:41AlexMaxI feel like the manual needs to be broken up into chunks or something - or at least be available in chunks.
22:24:19zachkhow do I intialize a table as just an empty table? do I need type declarations for it?
22:24:47FromGitter<rayman22201> I wrote a better fuzzy match search feature for the manual. It was accepted, but won't get pushed until 0.19 unfortunately.
22:25:26AlexMaxMy first resort is usually to go to google, and when the manual is one gigantic file, it makes individual parts of it ungoogleable
22:25:39AlexMaxI kept ending up here
22:25:41AlexMaxhttps://nim-lang.org/docs/nimc.html
22:25:51*shashlick_ quit (Remote host closed the connection)
22:26:12FromGitter<rayman22201> right now your best bet is to use your browser find feature on this page: https://nim-lang.org/docs/theindex.html
22:26:16*shashlick joined #nim
22:26:20bozaloshtshwhat I did was just read the whole manual heh
22:26:25AlexMaxI've also tried using browser find, but what do I find?
22:26:43bozaloshtshimo it's all worth reading
22:26:49FromGitter<rayman22201> tbh, I also just ended up reading the whole manual :-P
22:26:57shashlick@AlexMax: so what are you wrapping?
22:27:22AlexMax"compile" brings up 72 locations, and I tried a few pemutations of a sentence I thought might be useful in narrowing things with no luck
22:27:38AlexMaxMaybe that's what I need to do, just read the entire manual cover to cover.
22:28:00shashlickwhy do that when there's a bunch of people idling here waiting to answer? 😉
22:28:17shashlickalso worth searching the irc logs
22:28:21FromGitter<rayman22201> lol
22:28:41FromGitter<Vindaar> @zachk: yes, you do. And then just use `initTable`, e.g. `initTablestring, float ()`
22:29:03AlexMaxTo be clear, this is not me being annoyed at anybody in particular. If anything, I'm more annoyed at myself than anything, as this is like the third or fourth time that I've asked a question that turned out to be somehwere in the manual, so to a degree I feel silly.
22:29:20shashlickwell, Nim is huge and it takes time to learn it
22:29:39AlexMax....wait a minute
22:29:45FromGitter<rayman22201> I think it's a legit concern, and you aren't the first person to have this issue.
22:29:49AlexMaxwait nevermind
22:30:06AlexMaxshashlick: libtess2
22:30:49shashlick@AlexMax: looks like a fun one to add to nimgen's list of wrappers
22:30:57*fredrik92 joined #nim
22:31:58AlexMaxthis one was kinda funny because i used c2nim to unprefix the header and it ended up truncating variable names into nothing
22:32:38FromGitter<kaushalmodi> AlexMax: To begin with, use https://devdocs.io/nim/
22:33:13FromGitter<kaushalmodi> Once you get used to the Nim signature style in the official documentation, https://nim-lang.org/docs/theindex.html is your savior
22:38:24AlexMaxhrm, I need an include header from a separate directory
22:38:25FromGitter<rayman22201> hopefully once 0.19 is out, you won't need theindex.html because we will have this: https://github.com/nim-lang/Nim/pull/8260
22:38:38AlexMaxthe compiler has a `cincludes` paramter
22:38:53AlexMaxwonder if there's a pragma that can handle that for me...
22:39:14AlexMaxpassC looks promising
22:39:40AlexMax...except that's getting into implementation-specific weeds, will need to change that for MSVC
22:40:18FromGitter<rayman22201> correct. the double edged sword that is passC
22:40:38shashlick@AlexMax, give me 5 minutes, i'll upload what I have
22:41:02FromGitter<ephja> there needs to be a way to get the positional value of a non-ordinal enumeration :p
22:42:17FromGitter<Clyybber> Even though I'm european I share the same pain as you americans... I have to stop being a nightowl
22:42:46FromGitter<ephja> @Clyybber go to bed!
22:42:51AlexMaxoh shoot...
22:42:53AlexMaxshoot shoot shoot
22:43:35FromGitter<ephja> I can't though, because I have some over-engineering to do again
22:44:09AlexMaxOkay, this is a bummer
22:44:26AlexMaxThe main file of my library is called "tess"
22:44:35AlexMaxone of the files in the library is also named "tess"
22:44:49AlexMaxguess what happens when you try to compile...
22:44:57AlexMaxone object file blows away the other
22:45:08FromGitter<rayman22201> rename your file to nimtess? :-P
22:45:51shashlickuse {.compile: ("file.c", "nimfile.o").}
22:46:44AlexMaxI was about to say, won't renaming to nim-tess.nim change the name of the library itself?
22:48:17FromGitter<rayman22201> listen to the smarter person. don't listen to me
22:48:19AlexMaxshashlick: Wow, that _isn't_ documented :P
22:49:05AlexMaxokay perfect, now I'm getting a ton of other missing symbols, but that just means it was able to find the first batch
22:49:13AlexMaxI think I know how to do the rest
22:49:48shashlickAm making a nimble package for libtess2
22:49:57shashlickWould you use that?
22:52:37AlexMaxshashlick: What do you mean? I mean, I suppose if it worked I would, but I was hoping to do it myself to teach myself (and plus I'll need it again on down the line)
22:58:41shashlickI mean I'm making a package you can depend on with `requires "nimtess2 >= 0.1.0` in your nimble file and then `import nimtess2/tesselator`
22:59:07shashlickso while you use it, it gets validated somewhat and others who are interested down the line can benefit as well
23:02:23AlexMaxokay. Is this a thin wrapper of the C library, or can it be updated to be more idiomatic nim?
23:04:00shashlickonce we have the thin wrapper, we can add an idiomatic layer on top of it
23:04:45AlexMaxAnd is it going to do what I was going to do - just compile the c files as we go?
23:05:57AlexMaxSorry, don't mean to come across as the spanish inqusition :P
23:06:34FromGitter<ephja> ```FooWithHoles = enum {.ordinalMirror: "FooOrdinal".} = ...``` ⏎ that should work``` [https://gitter.im/nim-lang/Nim?at=5b7dec791d3a5711b684a464]
23:08:16shashlick@AlexMax: ya it will compile it in like you want
23:08:19shashlicki prefer that too
23:08:36shashlickno worries, I understand you are on a mission so questions are warranted
23:08:43shashlicklet me post what I have - it compiles now
23:10:14AlexMaxWell, I don't NEED it right now, so if you want to finsih it up and publish it, go ahead :P
23:12:34shashlickokay cool but honestly will be useless without any real world usage, anyway, up to you
23:15:12*noonien quit (Quit: Connection closed for inactivity)
23:17:58*zachk quit (Quit: Leaving)
23:19:53AlexMaxshashlick: Make sure it works at least - the main header I think has an incomplete struct definition
23:20:02AlexMaxand it just deals in pointers
23:20:31AlexMaxI also was unprefixing the entire thing too
23:22:30*xet7 quit (Quit: Leaving)
23:23:13AlexMax(and thank you, btw)
23:23:43*zachcart1r joined #nim
23:25:59*zachcarter quit (Ping timeout: 265 seconds)
23:27:43shashlickwell, I'm trying to make a simple test case so that I can ensure it works
23:27:50shashlicknot just generating random nim
23:28:42AlexMaxheh
23:30:11shashlickcool, i think it's functional for starters, doesn't mean much till you try it though
23:35:56shashlick@AlexMax: https://github.com/genotrance/nimtess2
23:36:25shashlick```
23:36:26shashlick> git clone https://github.com/genotrance/nimtess2
23:36:28shashlick> cd nimtess2
23:36:29shashlick> nimble install
23:36:30shashlick```
23:38:53AlexMaxThanks, it'll be a bit before I can verify though
23:39:03shashlickcool
23:39:14AlexMaxNow I'm utterly confused by tasks :P
23:39:25shashlickwhat's up
23:40:02AlexMaxI have a simple task defined in my "rocked.nims" file, like I see in the documentation, but I'm not sure how to actually run the task
23:40:12AlexMaxwhat\
23:40:13AlexMaxoaky
23:40:18AlexMaxthat's stupid
23:40:26AlexMaxI must've mistyped it the first time
23:40:33AlexMaxbecause NOW the task works
23:40:45AlexMaxthrough `nim build foo`
23:41:05AlexMaxnevermind
23:41:08shashlickcool
23:43:58AlexMax...oh dear
23:44:41AlexMaxshashlick: Did I screw up by using nimble?
23:44:43AlexMaxhttps://paste.ee/p/9S2kj
23:46:24shashlickis `~/.nimble/bin` in your path?
23:47:29*krux02 quit (Remote host closed the connection)
23:47:34AlexMaxProbably not. Does finish.exe add that?
23:48:06shashlickit will in the future - https://github.com/nim-lang/Nim/pull/7802
23:49:35AlexMaxthank god the start menu knows where to send you when you start typing in "environment variables"
23:50:03AlexMaxokay, let's pull the switch one more time...
23:50:21*cspar joined #nim
23:51:02AlexMaxshashlick: another error
23:51:24AlexMaxhttps://paste.ee/p/3ujQB
23:52:09AlexMaxthe gcc that nim uses is not in my global path
23:52:22AlexMaxbut nim.cfg does define it and my normal nim commands work properly
23:54:32*Widdershins quit (Ping timeout: 268 seconds)
23:55:03shashlickYa nimgen doesn't know where gcc is
23:55:14shashlickDoesn't know how to parse nim.cfg
23:56:34AlexMaxThat might be a problem - even if I put GCC in my path, what if I wanted to use MSVC instead...
23:57:11shashlickGive me a few
23:57:22shashlickI think you can override
23:58:27*stephen8727 joined #nim
23:59:04*stephen8727 quit (Remote host closed the connection)