00:06:43 | FromGitter | <bung87> anyone could help me check the speed bottleneck?https://github.com/bung87/finalseg/blob/master/src/finalseg.nim |
00:08:25 | FromGitter | <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:29 | FromGitter | <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:33 | FromGitter | <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:40 | FromGitter | <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:09 | FromGitter | <timotheecour> I’d love to see a minimal example working in user code |
00:51:22 | FromGitter | <data-man> @timotheecour: https://github.com/nim-lang/Nim/blob/devel/lib/system/gc2.nim#L42 |
00:52:22 | FromGitter | <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:28 | FromGitter | <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:39 | Tanger | Hey 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:42 | FromGitter | <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:58 | Tanger | Oooh, 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:28 | FromGitter | <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:25 | copygirl | I managed to put this together: https://gist.github.com/copygirl/e73e6b07d7aef8238c39eedc52428d9a |
07:00:46 | copygirl | Now, `static var` doesn't exist, of course. |
07:01:54 | copygirl | Is there some way to create a static value per generic implementation of `getEventStore[T]`? |
07:03:11 | copygirl | I mean.. I bet there's overly complicated ways to do it, but perhaps there's something more straightforward? |
07:08:20 | Araq | don't hide the event store. |
07:08:36 | Araq | pass it around in parameters. threadsafe, clarity. |
07:09:15 | Araq | programming is not an excercise in minimizing keystrokes. it's an excercise in minimizing problems. |
07:16:19 | copygirl | Ah. 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:46 | euantor | Also maybe take a look at https://nim-lang.org/docs/events.html |
07:58:23 | * | captainkraft quit (Ping timeout: 276 seconds) |
08:01:33 | Araq | hmm the compiler ends up importing cgi.nim |
08:01:48 | Araq | and 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:45 | PMunch | Hmm, 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:44 | PMunch | It can't even read global memory? |
08:20:45 | PMunch | Hmm |
08:21:15 | kobi7 | maybe it's for safety reasons? |
08:21:27 | PMunch | Oh yeah, I know why it does it |
08:21:44 | kobi7 | so there are ways to send the data, ala channels |
08:21:48 | PMunch | I'm just trying to figure out how to actually use it |
08:22:01 | PMunch | Well that would mean copying my data.. |
08:22:59 | leorize | or use createShared and pass pointers around |
08:23:09 | PMunch | Basically 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:03 | PMunch | Hmm, there is sharedlist in collections.. |
08:27:41 | Tanger | PMunch, check out the boehm gc option. It collects refs and ptrs, so you can have GC'd globals |
08:28:59 | Tanger | So you can use allocShared0 to allocate some space for an int and then pass around a global ptr to it |
08:38:14 | FromGitter | <gogolxdong> How come `client.getContent(url)` got Error: unhandled exception: 400 Bad Request [HttpRequestError] ⏎ but client.request(url) works well? |
08:40:20 | FromGitter | <gogolxdong> never mind. |
08:42:50 | kobi7 | PMunch: for your usecase, the best is to use async. |
08:43:32 | kobi7 | another 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:46 | kobi7 | imho, ofc |
08:44:18 | PMunch | kobi7, 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:21 | kobi7 | it 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:57 | Tanger | Hey 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:52 | kobi7 | hi tanger, I'm pretty new here too. why do you use methods instead of proc ? |
08:52:59 | leorize | it allows dynamic dispatching |
08:53:05 | Tanger | kobi7: Dynamic dispatch, so the onNotify methods will be available not just to objects that inherit from BaseObserver. |
08:53:28 | Tanger | If I don't implement onNotify for subclasses of BaseObserver, it will fall back to the {.base.} method |
08:53:59 | PMunch | Tanger, 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:57 | Tanger | Oh, haha, thanks PMunch! Looks like something's overriding my vim ft settings :S |
09:02:23 | TheLemonMan | try nimpretty if you're feeling adventurous |
09:03:22 | * | leorize quit (Ping timeout: 272 seconds) |
09:05:30 | PMunch | Hmm, that's strange: Error: cannot open file: channels |
09:05:38 | PMunch | Trying to import it |
09:06:33 | * | druonysus quit (Ping timeout: 272 seconds) |
09:06:40 | PMunch | Oh -_- |
09:06:44 | PMunch | It's part of system |
09:06:58 | * | xet7 quit (Quit: Leaving) |
09:13:47 | PMunch | Hmm, 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:18 | PMunch | I'm pretty sure that's mostly from not being as efficient with the early termination |
09:17:59 | kobi7 | Tanger: your code looks good to me |
09:18:25 | kobi7 | PMunch: so that's single vs. channels? |
09:19:01 | PMunch | kobi7, that's single threaded vs. multi-threaded |
09:19:31 | kobi7 | are you using the threadpool (spawn) ? |
09:20:26 | kobi7 | 70 seconds, that's pretty heavy. what are you computing? |
09:20:27 | PMunch | No, manual thread creation |
09:20:33 | PMunch | http://ix.io/1kVu/ |
09:21:02 | kobi7 | probably async or threadpool will be better, then. usually i just use threads for i/o related things |
09:21:11 | PMunch | The optimal list of N ingredients to get to make as many IBA certified drinks as possible |
09:21:58 | PMunch | http://ix.io/1kVv/ |
09:22:02 | PMunch | That's my threaded version |
09:22:11 | PMunch | It does copy the drinks list though |
09:24:19 | PMunch | Drinks is 61 elements long, highestIngredientId is 40 |
09:26:33 | PMunch | So 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:44 | kobi7 | did you try with async? |
09:30:12 | kobi7 | for such a long 'for loop', have the inner function run asyncly |
09:30:15 | FromGitter | <narimiran> could you somehow prune those combinations? |
09:31:57 | * | rockcavera quit (Ping timeout: 240 seconds) |
09:32:02 | kobi7 | PMunch: so you're a cocktail guy ha? ;-) |
09:32:32 | * | Zord6 joined #nim |
09:33:04 | kobi7 | PMunch: is it a one time operation, or do the parameters change? |
09:34:41 | PMunch | kobi7, 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:19 | PMunch | @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:23 | PMunch | The 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:25 | kobi7 | PMunch: what exactly does it do? checks nutrition or something? |
09:36:32 | PMunch | This is running with only the different alcohols |
09:37:28 | PMunch | kobi7, 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:15 | kobi7 | oh, so it's a constraints programming problem |
09:39:47 | PMunch | Hmm, it annoys me that I have to copy all the drinks into every thread.. |
09:39:47 | kobi7 | http://www.gecode.org/ |
09:39:52 | FromGitter | <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:53 | PMunch | The list is static once it's loaded |
09:40:52 | PMunch | Well if the combination is {sugar, salt} I could still make something with {sugar, salt, whiskey, soda, bitter} |
09:41:03 | PMunch | Namely an old fashioned |
09:41:15 | PMunch | It doesn't use the salt, but that doesn't disqualify it from the list |
09:41:47 | FromGitter | <narimiran> oh! |
09:42:29 | kobi7 | it's like those binpacking algorithms, how to maximize or minimize space/items |
09:42:44 | FromGitter | <narimiran> knapsack? |
09:43:09 | PMunch | If you want to try it out: http://ix.io/1kVz/ |
09:43:12 | kobi7 | yeah, minimize money, maximize amount of drinks - buy ingredients |
09:43:32 | * | captainkraft quit (Ping timeout: 268 seconds) |
09:43:40 | PMunch | kobi7, well I'm not taking into account cost per ingredient |
09:44:26 | FromGitter | <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:42 | kobi7 | narimiran: do view source. |
09:45:09 | FromGitter | <narimiran> nice trick, thanks kobi7! |
09:45:15 | PMunch | http://ix.io/1kVz |
09:45:25 | PMunch | Hmm, seems ix.io messed up the line count thing.. |
09:45:35 | PMunch | With the / is supposed to give you line counts |
09:46:07 | PMunch | I 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:54 | PMunch | So yeah, just access it without the final / and it looks better :) |
09:47:44 | PMunch | @narimiran ^ |
09:48:28 | kobi7 | PMunch: does nim have a way to profile? |
09:48:44 | PMunch | Well you can use the C profiler |
09:49:20 | FromGitter | <narimiran> kobi7: yeah, use `nim c --profiler:on --stacktrace:on` |
09:49:55 | FromGitter | <narimiran> and you should put `import nimprof` in your file, IIRC |
09:50:53 | kobi7 | ok, bbl guys, thanks |
09:51:28 | PMunch | http://ix.io/1kVz |
09:51:37 | PMunch | Ran it with maxIngredients = 4 |
09:52:00 | PMunch | No huge surprise there :P |
09:54:36 | * | NimBot joined #nim |
09:58:20 | * | cspar quit (Ping timeout: 265 seconds) |
09:58:57 | PMunch | Ah, found an issue. The threads seems to be really unbalanced :P |
09:59:23 | PMunch | I forgot that they grow exponentially the higher the numbers |
09:59:41 | PMunch | So the one doing 10 to 0 completes way before the one that does 40 to 31 |
09:59:51 | PMunch | http://ix.io/1kVC |
09:59:55 | PMunch | http://ix.io/1kVD |
10:00:11 | FromGitter | <tim-st> When I have the following code which prints chars ```nim |
10:00:33 | FromGitter | <tim-st> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b7d3441e5b40332abe073e3] |
10:01:07 | FromGitter | <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:14 | FromGitter | <tim-st> how can I save this to a `result.data` where result.data is of type `UncheckedArray[char]`? |
10:01:49 | FromGitter | <tim-st> I tried `[]` operator but then the data is corrupted |
10:02:05 | FromGitter | <narimiran> Pmunch: what do you use to measure sub-ms times? |
10:03:58 | FromGitter | <tim-st> basically how can I change the addr of `result.data` to `data`? |
10:04:12 | PMunch | narimiran, just cpuTime() before and after the body of the thread |
10:04:36 | PMunch | Then I just timed that with 1000 |
10:05:03 | PMunch | So that result is probably not precise, but they are so different that it doesn't matter much |
10:06:11 | copygirl | If 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:29 | FromGitter | <narimiran> indeed. please post the results when you'll have different (more efficient) division of work |
10:10:22 | TheLemonMan | hmm, multithreaded benchmarks is something that I may consider for my benchmark harness |
10:11:42 | PMunch | Hmm, creating a good division for a recursive function like this one is a pain.. |
10:18:16 | * | seni joined #nim |
10:18:56 | TheLemonMan | Araq, WRT #8720 you mean I should just use qualifiedLookUp instead of picksym? |
10:19:05 | PMunch | Did this with a manual division: http://ix.io/1kVK |
10:19:49 | PMunch | Compared with non-threaded: http://ix.io/1kVL |
10:20:29 | PMunch | So I saved about a second.. |
10:21:53 | PMunch | Single threaded without the early-termination: http://ix.io/1kVM |
10:27:11 | * | captainkraft joined #nim |
10:32:36 | FromGitter | <tim-st> anyone can help here (without copyMem)? https://gist.github.com/tim-st/d5868e99a5e7121cafbd651b36bc8018 |
10:33:02 | * | krux02 joined #nim |
10:34:53 | PMunch | Hmm, do we have atomic test and set in Nim? |
10:35:38 | FromGitter | <GULPF> I think there is an open PR for it |
10:36:17 | FromGitter | <GULPF> https://github.com/nim-lang/Nim/pull/8620/ |
10:36:22 | Araq | TheLemonMan, yeah |
10:37:51 | TheLemonMan | tim-st: you probably want data to be a ptr UncheckedArray |
10:38:15 | FromGitter | <tim-st> TheLemonMan: Yes, but nims string type definition doesnt allows it |
10:38:23 | FromGitter | <tim-st> or can I cast though? |
10:38:43 | TheLemonMan | shrug, I'm just having a look at the generated C code |
10:39:47 | FromGitter | <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:24 | FromGitter | <tim-st> TheLemonMan: wow, it worked when changing the type definiton, thank you!! |
10:41:35 | FromGitter | <tim-st> I didnt expect this though |
10:42:22 | TheLemonMan | well the loop works fine, but result is mangled :P |
10:43:08 | FromGitter | <tim-st> oh, your right... So I really need to change the data addr somehow :( |
10:50:37 | TheLemonMan | tim-st, https://gist.github.com/LemonBoy/833f2c313f0bdd2f06a293ad68f14492 |
10:51:49 | TheLemonMan | the VLA in nimStringDesc is not a pointer, the compiler is just smart enough to allocate sizeof(nimStringDesc) + initial_cap |
10:53:50 | PMunch | @GULPF, oh ten days ago even |
10:53:57 | FromGitter | <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:23 | FromGitter | <tim-st> with copy I can just use `copyMem(addr(result[0]), val.mv_data, val.mv_size)` |
10:54:28 | FromGitter | <tim-st> I wanted zero copy |
10:55:10 | PMunch | @GULPF, and there apparently is a atomics module in system as well |
10:55:57 | TheLemonMan | you're SOL since you can't append a nimStringDesc before mv_data, at least without copying it |
10:57:01 | FromGitter | <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:44 | TheLemonMan | I suspect python's strings are a data_ptr+len pair while Nim's is header+data |
10:59:07 | FromGitter | <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:27 | FromGitter | <tim-st> I'm pretty sure this has to work somehow |
10:59:30 | TheLemonMan | oh they exploit Python's buffer interface |
10:59:38 | TheLemonMan | yeah, you're SOL :P |
11:00:11 | * | cspar joined #nim |
11:00:29 | TheLemonMan | why don't you just implement some operators over a lmdbString type? |
11:00:32 | FromGitter | <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:11 | FromGitter | <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:14 | TheLemonMan | Araq, 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:27 | TheLemonMan | I'll drop the ambiguity check and perform it by hand after the symbol are filtered |
11:28:49 | * | leorize joined #nim |
11:30:45 | TheLemonMan | but by doing this we end up reimplementing what pickSym does...so let's keep it and call it a day? |
11:31:29 | Araq | but the point is: type specific lookups are not in the spec |
11:31:58 | Araq | you are not supposed to filter after qualifiedLookup |
11:32:53 | Araq | hmmm, so somebody used a proc named 'range' |
11:33:11 | TheLemonMan | I see, I hope nobody relies on the old behaviour heh |
11:33:19 | TheLemonMan | this should also be spec'd |
11:33:37 | Araq | 0.19 is about breaking stuff for humanity |
11:33:56 | Araq | and we need to improve the spec tremendously |
11:34:21 | Araq | I don't want to hear "I think this should work..." without a solid reference to the spec to back it up |
11:35:55 | TheLemonMan | ok, 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:29 | Araq | well we need a way to do --v018 on the command line for backwards compat, or something similar |
11:38:14 | Araq | and 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:09 | Araq | so if I have a proc set I can call it via set() |
11:39:25 | Araq | but var x: set[char] would be ambiguous hmm |
11:39:41 | Araq | I can already hear the complaints. |
11:39:59 | Araq | alright, better add this rule to the spec then. |
11:40:00 | * | ftsf_ quit (Ping timeout: 244 seconds) |
11:40:07 | Araq | bbl |
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:42 | FromGitter | <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:03 | FromGitter | <bung87> lib/system/profiler.nim(92, 23) Error: undeclared identifier: 'framePtr' ,what's this problem? |
13:16:28 | Araq | you need to compile with --stackTrace:on as the documentation says |
13:16:39 | FromGitter | <bung87> ~/Nim/bin/nim c -r --profiler:on --stacktrace:on tests/test2.nim |
13:17:00 | FromGitter | <bung87> Nim Compiler Version 0.18.1 [MacOSX: amd64] |
13:18:30 | FromGitter | <dom96> PMunch: the parallelism chapter of my book should help you out. |
13:19:27 | PMunch | Ah, that's true. Ilrr have to check that when I get home |
13:19:43 | FromGitter | <bung87> does nim config file matters? |
13:21:15 | FromGitter | <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:14 | TheLemonMan | Araq, so which one of the two rules is being spec'd? |
14:02:53 | Araq | both |
14:03:49 | * | rockcavera joined #nim |
14:03:59 | TheLemonMan | so ambiguous symbols are ambiguous but type names get a special treatment? |
14:05:29 | Araq | yeah. |
14:13:31 | FromGitter | <bung87> how to do profiling? |
14:14:07 | FromGitter | <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:33 | FromGitter | <bung87> valgrind: This formula either does not compile or function as expected on macOS |
14:20:38 | Araq | bing87 put your code in a 'proc main = ...' |
14:21:14 | * | kapil___ joined #nim |
14:22:13 | Araq | and you can read the full file into memory with a single readFile call. then iterate over it with the splitLines() iterator |
14:22:20 | kapil___ | hello I am totally new to nim language. how should I start client (Javascript) side developing in nim? |
14:22:25 | Araq | no need for a 'lines: seq[string]' |
14:22:34 | Araq | kapil___, YES! :-) |
14:23:37 | PMunch | kapil___, you mean writing client side code for node.js? |
14:24:03 | kapil___ | PMunch: I am a react developer. I want to generate frontend for my backend. |
14:24:13 | dom96 | PMunch: Client-side means browser-side |
14:24:27 | PMunch | Oh sorry, I'm tired :P |
14:25:31 | euantor | kapil___: Take a look at Karax for definite: https://github.com/pragmagic/karax |
14:26:12 | kapil___ | euantor: thanks. |
14:26:30 | dom96 | yeah, play around with the examples |
14:26:38 | dom96 | Ask questions here if you get stuck |
14:27:38 | PMunch | Hmm, 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:59 | kapil___ | thanks. |
14:30:02 | FromGitter | <bung87> @Araq I defined main proc and with when isMainModule: still same error |
14:30:04 | FromGitter | <bung87> Error: undeclared identifier: 'framePtr' |
14:35:20 | dom96 | So 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:27 | FromGitter | <bung87> @Araq yeah,I checked readFile and splitLines,It's useful. |
14:36:28 | FromGitter | <GULPF> @dom96 I'm pretty sure js files are not affected, they still end up in a local nimcache |
14:38:30 | dom96 | hrm, you're right |
14:38:32 | FromGitter | <bung87> I reduce my test 2 seconds since yesterday ,still 4 times slower than python version:( |
14:39:02 | dom96 | bung87: Are you compiling with -d:release? |
14:40:52 | FromGitter | <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:16 | dom96 | show us the code |
14:43:22 | TheLemonMan | dom96, 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:00 | FromGitter | <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:26 | FromGitter | <xmonader> So google passed on me i guess for not remembering kmp by heart :D |
14:45:34 | FromGitter | <bung87> the original python version,https://github.com/fxsjy/jieba/blob/master/jieba/finalseg/__init__.py |
14:46:14 | TheLemonMan | xmonader, why not BMH? I've never liked KMP |
14:46:34 | dom96 | bung87: 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:38 | FromGitter | <xmonader> i like boyr moor horsepool algorithm and that one i actually remember xD |
14:47:01 | pigmej | simple question... asyncdispatch/asyncdispatch2 or reactor.nim for |
14:47:04 | pigmej | new library in new project? |
14:47:15 | dom96 | What's the project? |
14:48:10 | dom96 | (or what's the library?) |
14:48:23 | FromGitter | <Varriount> @bung87 You seem to be creating a lot of temporary strings |
14:48:25 | FromGitter | <bung87> ? I just create start time and end time |
14:48:38 | pigmej | dom96 I want to write client for NATS |
14:48:49 | pigmej | and then I need to do some pub/sub stuff |
14:49:39 | pigmej | I 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:54 | dom96 | It's TCP so use asyncdispatch |
14:50:10 | pigmej | why not reactor? |
14:50:19 | dom96 | Please for the love of Nim, don't use asyncdispatch2 or reactor |
14:50:33 | FromGitter | <bung87> @Varriount I dont think that would has so much impact,It's use the same control flow as python version |
14:50:40 | dom96 | Because asyncdispatch is in the stdlib |
14:50:59 | dom96 | Let's not fracture our ecosystem by using three different async IO implementations for all our libraries |
14:51:15 | dom96 | If you need features that asyncdispatch2 is offering then let's get it into the stdlib |
14:51:20 | dom96 | (same for reactor) |
14:51:29 | pigmej | https://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:59 | dom96 | Do those issues actually affect you? |
14:52:12 | FromGitter | <Varriount> Can you post the Python code too? |
14:52:13 | * | ftsf quit (Read error: Connection reset by peer) |
14:52:31 | pigmej | dom96: at least partially |
14:52:37 | TheLemonMan | keep in mind that some (many) tickets have been accidentally fixed in the meanwhile |
14:52:41 | dom96 | pigmej: which issues specifically? |
14:53:07 | pigmej | https://github.com/nim-lang/Nim/issues/7758 |
14:53:20 | pigmej | https://github.com/nim-lang/Nim/issues/7886 |
14:54:19 | pigmej | not to mention "strange" behaviour when waitFor used in {.async.} (ok that's on my shoulders though) |
14:54:47 | * | PMunch joined #nim |
14:55:10 | dom96 | I've got a PR that fixes all of those issues: https://github.com/nim-lang/Nim/pull/8209 |
14:55:39 | dom96 | Don't use waitFor in an async proc |
14:55:54 | dom96 | Why are you doing that? |
14:56:01 | pigmej | accident :P |
14:56:11 | pigmej | and then "BUM" everything explodes |
14:56:45 | FromGitter | <bung87> @dom96 I checked ,I may change to old version, but it's just about 0.2 seconds than before |
14:56:50 | pigmej | anyway let me check sth |
14:57:21 | dom96 | pigmej: Guess I should detect `waitFor` in the async macro and tell you off :P |
14:57:27 | pigmej | btw dom96 your fix adds one more handle, so .... pretty much no go for me because I'll have tons of TCP requests |
14:57:36 | pigmej | dom96: that would save my ass :) |
14:59:30 | FromGitter | <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:22 | TheLemonMan | dom96, 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:49 | dom96 | TheLemonMan: No. I don't see what's brittle about it |
15:07:07 | pigmej | dom96: ok but consider that example: https://gist.github.com/pigmej/31e0cd9ba7fcdd4a089a0ee99dce4b5e |
15:07:14 | pigmej | it may be broken obviously BUT |
15:07:39 | pigmej | let me check sth because I ran invalid server ;D |
15:08:14 | * | nathanj quit (Ping timeout: 255 seconds) |
15:08:28 | pigmej | ok nvm works fine |
15:09:11 | TheLemonMan | dom96, 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:59 | dom96 | TheLemonMan: You'll always select the first avatar |
15:10:25 | dom96 | The order of the other elements shouldn't matter |
15:11:08 | dom96 | pigmej: That looks really fragile :) |
15:11:16 | TheLemonMan | oh, right, I'll change that then |
15:11:34 | pigmej | dom96: that was just an naive example |
15:11:40 | dom96 | TheLemonMan: 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:19 | TheLemonMan | Araq, if I import a type T from `modb` and then define a `type T` should T be considered as ambiguous? |
15:15:23 | TheLemonMan | dom96, sure thing |
15:18:47 | Araq | TheLemonMan, iirc the module level scope and the import scope are different |
15:19:03 | Araq | and so the module's T is preferred and that's it. |
15:19:42 | * | Taylor__ quit (Quit: Leaving) |
15:21:42 | TheLemonMan | makes sense, as long as it's wanted and not just a misfeature of pickSym :) |
15:29:32 | * | gangstacat quit (Quit: Ĝis!) |
15:31:38 | FromGitter | <Clyybber> Araq Are enums with uint32 as a representation possible? |
15:33:41 | FromGitter | <bung87> from a import b as c possible in Nim ? |
15:37:19 | Araq | Clyybber: nah, use a distinct uint32 |
15:37:40 | Araq | Nim's enums are more about speed than about C interop :-) |
15:37:55 | FromGitter | <Clyybber> Ok, thank you :-) |
15:38:33 | dom96 | testament now runs tests by default, right? |
15:39:26 | Araq | dom96, I don't think so |
15:39:41 | Araq | I 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:58 | FromGitter | <Clyybber> Araq Is cuint an alias for uint32 or are there some subtle differences between those two? |
15:43:42 | Araq | cuint is C's "unsigned int" which can have more or fewer bits than 32 |
15:43:58 | * | Notkea joined #nim |
15:44:08 | Araq | but the platforms where that's true are irrelevant for ordinary application development |
15:45:06 | FromGitter | <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:32 | T-roy | Nim 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:36 | T-roy | ch 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:42 | T-roy | FUCK NIM HAHAHAHA |
16:10:49 | pigmej | :| |
16:11:28 | euantor | Looks like the troll is back... |
16:12:02 | dom96 | wow. a registered troll |
16:12:06 | T-roy | I just say the truth |
16:12:32 | T-roy | The compiler shouldnt be written on an unstable lang |
16:12:42 | T-roy | Like nim |
16:15:06 | shashlick_ | 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:33 | Araq | and what is worse, Nim is still not Haskell/C/Rust/Clojure |
16:18:15 | * | floppydh quit (Quit: WeeChat 2.2) |
16:19:11 | FromGitter | <alehander42> ah calm down |
16:19:35 | FromGitter | <bung87> *it will be private* ....why don't you keep it as secret |
16:20:32 | FromGitter | <bung87> and there's julia lang |
16:20:58 | Araq | Julia is not Linux-only though. |
16:23:42 | FromGitter | <bung87> julia's introduction similar with nim, still lack of many features.. |
16:32:10 | FromGitter | <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:30 | FromGitter | <Varriount> Because of this, and because of how strings are structured in Nim, strings get copied on assignment. |
16:33:37 | Araq | yeah, except when they are moved. |
16:34:49 | FromGitter | <bung87> so there's so much memory management since the scrpits all abouts process text. |
16:34:52 | Araq | is 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:19 | FromGitter | <bung87> in test case loop lines already store to sequence, just process string thing. |
16:36:24 | * | destroid joined #nim |
16:37:19 | FromGitter | <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:33 | zachcarter | just switched to weechat - it's nice |
16:57:10 | TheLemonMan | I heard from the grapevine that irssi is nicer :P |
16:57:56 | * | nsf quit (Quit: WeeChat 2.2) |
16:58:12 | zachcarter | oh man |
16:58:17 | zachcarter | about to upworld my new world |
16:58:20 | zachcarter | uproot* |
16:59:05 | zachcarter | so this I think is problematic - right? - `import jsffi proc bindTo(p: proc(), self: JsObject, args: JsObject): proc() {. importcpp: "bind" .}` |
16:59:18 | zachcarter | producing - `foo.nim(3, 67) Error: attempting to call undeclared routine: 'importcpp'` |
16:59:57 | zachcarter | I 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:01 | zachcarter | quit |
17:05:04 | zachcarter | whoops |
17:05:06 | zachcarter | !quit |
17:05:11 | zachcarter | gd - 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:56 | zachcarter | test - can anyone see this? |
17:07:08 | Araq | zachcarter, welcome |
17:08:03 | zachcarter | sweet - 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:44 | TheLemonMan | nickserv messages are in the 1st buffer and please use SASL instead of /autosendcmd |
17:09:31 | zachcarter | okay - I need to figure that out - thank you |
17:10:09 | TheLemonMan | zachcarter, https://freenode.net/kb/answer/irssi |
17:10:38 | TheLemonMan | nice piece of trivia, I've implemented SASL in irssi :) |
17:10:47 | zachcarter | Araq: 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:55 | zachcarter | TheLemonMan: thank you! |
17:11:16 | zachcarter | :D I'm sure it works very well then! |
17:14:18 | Araq | zachcarter: yeah please report it |
17:15:27 | FromGitter | <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:33 | FromGitter | <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:58 | FromGitter | <metasyn> Oh very cool! |
17:19:14 | dom96 | TheLemonMan: Oooh. Nice to have such an IRC veteran amongst us :D |
17:19:18 | FromGitter | <metasyn> It seems like flat buffers integration would come before apache arrow |
17:20:45 | FromGitter | <mratsim> Apache Arrow would be more for NimData or Kadro (NimData based on Arraymancer): https://github.com/bluenote10/kadro |
17:21:43 | FromGitter | <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:59 | FromGitter | <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:48 | FromGitter | <metasyn> oh so kadro is a rewrite of nimdata but with arraymancer? that is rad |
17:24:00 | FromGitter | <mratsim> it’s still stealth mode |
17:24:39 | FromGitter | <mratsim> In September I will probably implement a Vega/Vega-lite library for Nim btw: https://vega.github.io/ |
17:25:04 | FromGitter | <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:58 | FromGitter | <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:22 | dom96 | yglukhov[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:03 | yglukhov[m] | dom96: hey whats up |
18:42:44 | FromDiscord | <Jungly> So is NIm a new language? |
18:42:48 | FromDiscord | <Jungly> So is Nim a new language? |
18:45:49 | FromGitter | <mratsim> @Jungly, by language standard it’s young since it’s about 10 years old (?) |
18:46:31 | FromDiscord | <Jungly> What is @gitterirc ? |
18:46:45 | FromGitter | <mratsim> thr bridge between Gitter and IRC |
18:47:04 | FromDiscord | <Jungly> Lol idk if that's a good or bad thing |
18:50:22 | FromDiscord | <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:40 | FromDiscord | <exelotl> everyone can talk to each other but it looks a bit ugly |
18:56:52 | * | nsf quit (Quit: WeeChat 2.2) |
18:59:54 | pigmej | still better than keeping 3 separate channels :) |
19:10:13 | FromDiscord | <exelotl> yeah it's a great solution given the current size of the community |
19:25:13 | zachk | is there an abs() or absolute value function for float in nim, or do I need to code my own? |
19:26:42 | Araq | math.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:22 | FromGitter | <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:20 | FromGitter | <tim-st> `http://127.0.0.1:5000/api/info/Straße` prints `Stra%C3%9Fe` |
20:36:26 | Araq | what's wrong with encoding things? |
20:36:32 | Araq | that's how URLs work |
20:36:42 | dom96 | Does Jester decode it for you? |
20:36:56 | FromGitter | <tim-st> nope, doesnt seems to be the case, but I expected it |
20:37:23 | dom96 | That's a bug then |
20:37:23 | dom96 | report it |
20:37:31 | FromGitter | <tim-st> ok, thanks for the quick response |
20:40:45 | * | wildlander joined #nim |
20:57:33 | FromGitter | <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:42 | dom96 | Sadly there is definitely a bug hiding in there for Nim with regards to that |
21:02:15 | FromGitter | <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:11 | FromGitter | <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:23 | FromGitter | <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:10 | AlexMax | I 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:54 | AlexMax | I guess this would also be known as mixing nim and C code? |
22:11:42 | AlexMax | damn, are most nimmers european or something, seems like things get quiet ITC as soon as I get home :P |
22:17:36 | shashlick_ | 🙂 that's my frustration too - most of the experts are in Europe, it's radio silence in the evenings and nights here |
22:18:00 | shashlick_ | @AlexMax: you can check out nimgen to see how that's done with some other C libraries |
22:18:09 | FromGitter | <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:22 | bozaloshtsh | AlexMax: you can't write a small nim wrapper for the c functions? |
22:18:46 | shashlick_ | it is super easy - basically use `{.compile.}` to add C files and `{.passC.}` and `{.passL.}` for compile and link flags |
22:19:41 | FromGitter | <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:52 | FromGitter | <ephja> nah, mostly americans who wake up at 10pm :p |
22:20:10 | shashlick_ | here's an example of wrapping libclipboard: http://nimgen.genotrance.com/nimclipboard/libclipboard.nim.html |
22:21:44 | AlexMax | shashlick_: yo that's exactly what I was looking for - I think |
22:22:10 | FromGitter | <rayman22201> @ephja sleep is just a bad habit. I've been trying to give it up for years :-P |
22:22:13 | AlexMax | shashlick_: where is that documented? |
22:22:18 | shashlick_ | which library are you wrapping |
22:22:21 | shashlick_ | in the manual |
22:23:02 | shashlick_ | https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compile-pragma |
22:23:20 | AlexMax | ...you know what |
22:23:41 | AlexMax | I feel like the manual needs to be broken up into chunks or something - or at least be available in chunks. |
22:24:19 | zachk | how do I intialize a table as just an empty table? do I need type declarations for it? |
22:24:47 | FromGitter | <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:26 | AlexMax | My 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:39 | AlexMax | I kept ending up here |
22:25:41 | AlexMax | https://nim-lang.org/docs/nimc.html |
22:25:51 | * | shashlick_ quit (Remote host closed the connection) |
22:26:12 | FromGitter | <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:20 | bozaloshtsh | what I did was just read the whole manual heh |
22:26:25 | AlexMax | I've also tried using browser find, but what do I find? |
22:26:43 | bozaloshtsh | imo it's all worth reading |
22:26:49 | FromGitter | <rayman22201> tbh, I also just ended up reading the whole manual :-P |
22:26:57 | shashlick | @AlexMax: so what are you wrapping? |
22:27:22 | AlexMax | "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:38 | AlexMax | Maybe that's what I need to do, just read the entire manual cover to cover. |
22:28:00 | shashlick | why do that when there's a bunch of people idling here waiting to answer? 😉 |
22:28:17 | shashlick | also worth searching the irc logs |
22:28:21 | FromGitter | <rayman22201> lol |
22:28:41 | FromGitter | <Vindaar> @zachk: yes, you do. And then just use `initTable`, e.g. `initTablestring, float ()` |
22:29:03 | AlexMax | To 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:20 | shashlick | well, Nim is huge and it takes time to learn it |
22:29:39 | AlexMax | ....wait a minute |
22:29:45 | FromGitter | <rayman22201> I think it's a legit concern, and you aren't the first person to have this issue. |
22:29:49 | AlexMax | wait nevermind |
22:30:06 | AlexMax | shashlick: libtess2 |
22:30:49 | shashlick | @AlexMax: looks like a fun one to add to nimgen's list of wrappers |
22:30:57 | * | fredrik92 joined #nim |
22:31:58 | AlexMax | this one was kinda funny because i used c2nim to unprefix the header and it ended up truncating variable names into nothing |
22:32:38 | FromGitter | <kaushalmodi> AlexMax: To begin with, use https://devdocs.io/nim/ |
22:33:13 | FromGitter | <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:24 | AlexMax | hrm, I need an include header from a separate directory |
22:38:25 | FromGitter | <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:38 | AlexMax | the compiler has a `cincludes` paramter |
22:38:53 | AlexMax | wonder if there's a pragma that can handle that for me... |
22:39:14 | AlexMax | passC looks promising |
22:39:40 | AlexMax | ...except that's getting into implementation-specific weeds, will need to change that for MSVC |
22:40:18 | FromGitter | <rayman22201> correct. the double edged sword that is passC |
22:40:38 | shashlick | @AlexMax, give me 5 minutes, i'll upload what I have |
22:41:02 | FromGitter | <ephja> there needs to be a way to get the positional value of a non-ordinal enumeration :p |
22:42:17 | FromGitter | <Clyybber> Even though I'm european I share the same pain as you americans... I have to stop being a nightowl |
22:42:46 | FromGitter | <ephja> @Clyybber go to bed! |
22:42:51 | AlexMax | oh shoot... |
22:42:53 | AlexMax | shoot shoot shoot |
22:43:35 | FromGitter | <ephja> I can't though, because I have some over-engineering to do again |
22:44:09 | AlexMax | Okay, this is a bummer |
22:44:26 | AlexMax | The main file of my library is called "tess" |
22:44:35 | AlexMax | one of the files in the library is also named "tess" |
22:44:49 | AlexMax | guess what happens when you try to compile... |
22:44:57 | AlexMax | one object file blows away the other |
22:45:08 | FromGitter | <rayman22201> rename your file to nimtess? :-P |
22:45:51 | shashlick | use {.compile: ("file.c", "nimfile.o").} |
22:46:44 | AlexMax | I was about to say, won't renaming to nim-tess.nim change the name of the library itself? |
22:48:17 | FromGitter | <rayman22201> listen to the smarter person. don't listen to me |
22:48:19 | AlexMax | shashlick: Wow, that _isn't_ documented :P |
22:49:05 | AlexMax | okay 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:13 | AlexMax | I think I know how to do the rest |
22:49:48 | shashlick | Am making a nimble package for libtess2 |
22:49:57 | shashlick | Would you use that? |
22:52:37 | AlexMax | shashlick: 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:41 | shashlick | I 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:07 | shashlick | so while you use it, it gets validated somewhat and others who are interested down the line can benefit as well |
23:02:23 | AlexMax | okay. Is this a thin wrapper of the C library, or can it be updated to be more idiomatic nim? |
23:04:00 | shashlick | once we have the thin wrapper, we can add an idiomatic layer on top of it |
23:04:45 | AlexMax | And is it going to do what I was going to do - just compile the c files as we go? |
23:05:57 | AlexMax | Sorry, don't mean to come across as the spanish inqusition :P |
23:06:34 | FromGitter | <ephja> ```FooWithHoles = enum {.ordinalMirror: "FooOrdinal".} = ...``` ⏎ that should work``` [https://gitter.im/nim-lang/Nim?at=5b7dec791d3a5711b684a464] |
23:08:16 | shashlick | @AlexMax: ya it will compile it in like you want |
23:08:19 | shashlick | i prefer that too |
23:08:36 | shashlick | no worries, I understand you are on a mission so questions are warranted |
23:08:43 | shashlick | let me post what I have - it compiles now |
23:10:14 | AlexMax | Well, I don't NEED it right now, so if you want to finsih it up and publish it, go ahead :P |
23:12:34 | shashlick | okay 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:53 | AlexMax | shashlick: Make sure it works at least - the main header I think has an incomplete struct definition |
23:20:02 | AlexMax | and it just deals in pointers |
23:20:31 | AlexMax | I also was unprefixing the entire thing too |
23:22:30 | * | xet7 quit (Quit: Leaving) |
23:23:13 | AlexMax | (and thank you, btw) |
23:23:43 | * | zachcart1r joined #nim |
23:25:59 | * | zachcarter quit (Ping timeout: 265 seconds) |
23:27:43 | shashlick | well, I'm trying to make a simple test case so that I can ensure it works |
23:27:50 | shashlick | not just generating random nim |
23:28:42 | AlexMax | heh |
23:30:11 | shashlick | cool, i think it's functional for starters, doesn't mean much till you try it though |
23:35:56 | shashlick | @AlexMax: https://github.com/genotrance/nimtess2 |
23:36:25 | shashlick | ``` |
23:36:26 | shashlick | > git clone https://github.com/genotrance/nimtess2 |
23:36:28 | shashlick | > cd nimtess2 |
23:36:29 | shashlick | > nimble install |
23:36:30 | shashlick | ``` |
23:38:53 | AlexMax | Thanks, it'll be a bit before I can verify though |
23:39:03 | shashlick | cool |
23:39:14 | AlexMax | Now I'm utterly confused by tasks :P |
23:39:25 | shashlick | what's up |
23:40:02 | AlexMax | I 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:12 | AlexMax | what\ |
23:40:13 | AlexMax | oaky |
23:40:18 | AlexMax | that's stupid |
23:40:26 | AlexMax | I must've mistyped it the first time |
23:40:33 | AlexMax | because NOW the task works |
23:40:45 | AlexMax | through `nim build foo` |
23:41:05 | AlexMax | nevermind |
23:41:08 | shashlick | cool |
23:43:58 | AlexMax | ...oh dear |
23:44:41 | AlexMax | shashlick: Did I screw up by using nimble? |
23:44:43 | AlexMax | https://paste.ee/p/9S2kj |
23:46:24 | shashlick | is `~/.nimble/bin` in your path? |
23:47:29 | * | krux02 quit (Remote host closed the connection) |
23:47:34 | AlexMax | Probably not. Does finish.exe add that? |
23:48:06 | shashlick | it will in the future - https://github.com/nim-lang/Nim/pull/7802 |
23:49:35 | AlexMax | thank god the start menu knows where to send you when you start typing in "environment variables" |
23:50:03 | AlexMax | okay, let's pull the switch one more time... |
23:50:21 | * | cspar joined #nim |
23:51:02 | AlexMax | shashlick: another error |
23:51:24 | AlexMax | https://paste.ee/p/3ujQB |
23:52:09 | AlexMax | the gcc that nim uses is not in my global path |
23:52:22 | AlexMax | but nim.cfg does define it and my normal nim commands work properly |
23:54:32 | * | Widdershins quit (Ping timeout: 268 seconds) |
23:55:03 | shashlick | Ya nimgen doesn't know where gcc is |
23:55:14 | shashlick | Doesn't know how to parse nim.cfg |
23:56:34 | AlexMax | That might be a problem - even if I put GCC in my path, what if I wanted to use MSVC instead... |
23:57:11 | shashlick | Give me a few |
23:57:22 | shashlick | I think you can override |
23:58:27 | * | stephen8727 joined #nim |
23:59:04 | * | stephen8727 quit (Remote host closed the connection) |