00:02:50 | * | Vladar quit (Remote host closed the connection) |
00:36:37 | * | NimBot joined #nim |
00:42:27 | * | zachcarter quit (Ping timeout: 252 seconds) |
00:46:50 | * | vivus joined #nim |
00:58:01 | * | abm quit (Ping timeout: 260 seconds) |
01:04:54 | * | Yardanico quit (Ping timeout: 252 seconds) |
01:05:30 | * | Yardanico joined #nim |
01:06:33 | * | dada78641_ quit (Ping timeout: 252 seconds) |
01:08:31 | * | dada78641 joined #nim |
01:15:31 | * | flyx quit (Ping timeout: 260 seconds) |
01:16:50 | * | flyx joined #nim |
01:17:58 | * | ftsf joined #nim |
02:23:47 | * | leorize quit (Ping timeout: 240 seconds) |
02:25:05 | * | leorize joined #nim |
02:44:46 | * | flyx quit (Ping timeout: 260 seconds) |
02:44:46 | * | petersjt014[m] quit (Ping timeout: 260 seconds) |
02:44:57 | * | petersjt014[m] joined #nim |
02:45:01 | * | flyx joined #nim |
02:53:34 | * | dddddd quit (Remote host closed the connection) |
03:06:33 | * | gb00s quit (Ping timeout: 252 seconds) |
03:13:40 | * | gb00s joined #nim |
03:29:12 | * | opi_ quit (Ping timeout: 250 seconds) |
03:30:33 | * | opi_ joined #nim |
04:03:56 | * | vivus quit (Remote host closed the connection) |
04:12:21 | * | zachcarter joined #nim |
04:36:39 | * | endragor joined #nim |
04:58:01 | zachcarter | AlexMax: when I have time - yes, currently don't have bandwidth to work on gamedev stuff |
04:58:07 | zachcarter | https://gist.github.com/zacharycarter/95760baa895b2e0b8cff3bf1f833789a |
05:23:10 | * | rockcavera quit (Read error: Connection reset by peer) |
05:25:58 | * | nsf joined #nim |
05:31:58 | * | cspar joined #nim |
05:42:17 | * | skrylar joined #nim |
05:43:16 | * | justsomequestion joined #nim |
05:46:38 | * | leorize quit (Quit: WeeChat 2.2) |
05:59:09 | * | rockcavera joined #nim |
05:59:09 | * | rockcavera quit (Changing host) |
05:59:09 | * | rockcavera joined #nim |
06:02:48 | * | ftsf quit (Read error: Connection reset by peer) |
06:06:33 | * | leorize joined #nim |
06:09:05 | * | O-dog1 joined #nim |
06:09:46 | * | O-dog1 quit (Remote host closed the connection) |
06:15:28 | * | justsomequestion quit (Read error: No route to host) |
06:15:39 | * | justsomequestion joined #nim |
06:30:23 | FromGitter | <codem4ster> can I write a program by using only ptr, alloc, dealloc, realloc with nim which is totally manual garbage collected? |
06:30:55 | FromGitter | <codem4ster> do I need to know another things? |
06:42:09 | Tanger | codem4ster: If you do, you should turn gc off with --gc:none |
06:49:25 | leorize | codem4ster: please remember that strings, seqs are gc-allocated, thus won't work without GC (yet) |
06:51:19 | * | justsomequestion quit (Ping timeout: 246 seconds) |
06:55:51 | FromGitter | <codem4ster> ah ok I understand |
06:55:54 | FromGitter | <codem4ster> thanks |
06:58:22 | FromGitter | <codem4ster> for this code nim doesn't seem to open new threads: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ I cannot see them in htop, there is only 4 thread from the beginning. I think they are there for garbage collecting. [https://gitter.im/nim-lang/Nim?at=5b8f7e8ec2bd5d117a1fe632] |
06:59:23 | FromGitter | <codem4ster> this is the bottom of code I have proper imports up there. |
07:02:12 | leorize | IIRC we use thread-local GC, so there should be no GC-threads |
07:03:02 | * | justsomequestion joined #nim |
07:04:04 | * | crem1 quit (Ping timeout: 240 seconds) |
07:05:21 | * | justsomequestion quit (Client Quit) |
07:05:31 | * | justsomequestion joined #nim |
07:13:42 | Tanger | codem4ster: I don't think async opens new threads by default |
07:14:06 | FromGitter | <codem4ster> there is a spawn when calling processClient |
07:15:31 | * | xet7 joined #nim |
07:16:03 | FromGitter | <codem4ster> @leorize there must be 20-30 threads when program running. There is constant 4 threads (that is my core count of cpu) |
07:21:24 | * | crem1 joined #nim |
07:30:12 | * | justsomequestion quit (Ping timeout: 252 seconds) |
07:31:51 | FromGitter | <Bennyelg> async not open new threads |
07:31:56 | FromGitter | <Bennyelg> async is for IO |
07:32:57 | Tanger | codem4ster ^ |
07:35:26 | * | Vladar joined #nim |
07:35:43 | * | floppydh joined #nim |
07:37:10 | * | snowolf23 joined #nim |
07:37:41 | * | justsomequestion joined #nim |
07:41:17 | * | snowolf23 quit (Killed (Unit193 (Spam is not permitted on freenode.))) |
07:48:37 | * | u1dzer016 joined #nim |
07:51:27 | * | u1dzer016 quit (Remote host closed the connection) |
08:02:43 | * | gmpreussner_ quit (Ping timeout: 246 seconds) |
08:03:58 | * | gmpreussner joined #nim |
08:07:07 | * | skrylar quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
08:09:42 | * | krux02 joined #nim |
08:12:02 | FromGitter | <Araq> `spawn` creates new threads if the load demands it |
08:12:16 | FromGitter | <Araq> your load doesn't demand it so it keeps you on 4 threads. |
08:12:58 | * | stefanos82 joined #nim |
08:23:09 | * | justsomequestion quit (Quit: Konversation terminated!) |
08:23:15 | * | somequestions joined #nim |
08:23:32 | * | crem1 quit (Quit: WeeChat 1.9) |
08:23:49 | * | crem joined #nim |
08:41:30 | * | somequestions quit (Quit: Konversation terminated!) |
08:41:39 | * | somequestions joined #nim |
08:47:29 | * | somequestions quit (Quit: Konversation terminated!) |
08:51:07 | * | noonien joined #nim |
08:59:27 | FromGitter | <alehander42> @dom96 hey, just trying jester for the first time |
09:00:13 | FromGitter | <alehander42> why @"arg" instead of directly having it as a local variable ? i guess a route block is usually small, so a name clash isn't very probable (and one can easily learn that @arg is unique |
09:00:15 | FromGitter | <alehander42> ) |
09:01:13 | Araq | because Jester is inspired by Ruby's Sinatra, I think |
09:08:48 | * | joshbaptiste quit (Ping timeout: 272 seconds) |
09:28:17 | * | krux02 quit (Remote host closed the connection) |
09:35:09 | * | joshbaptiste joined #nim |
09:46:27 | * | abm joined #nim |
09:46:40 | * | krux02 joined #nim |
09:47:53 | * | krux02 quit (Remote host closed the connection) |
10:16:19 | FromGitter | <alehander42> ah i always forget to `when defined(js) .. cstring` my string fields |
10:19:17 | FromGitter | <alehander42> hm yeah, but sinatra has an option to `||` them as a block |
10:21:01 | FromGitter | <alehander42> maybe something like ⏎ ⏎ ```get "/@id", id: int: ⏎ # jester automatically does let id = (@"id").parseInt``` ⏎ ⏎ might do it, but I am not sure if that would be valid in a macro [https://gitter.im/nim-lang/Nim?at=5b8fae0c94f8164c17df8fdd] |
10:21:25 | * | seni joined #nim |
10:22:37 | FromGitter | <alehander42> nah ⏎ ⏎ ```get "/@id" (id: int): ⏎ 0``` ⏎ ⏎ would work [https://gitter.im/nim-lang/Nim?at=5b8fae6dd8d36815e5dc6618] |
10:30:36 | FromGitter | <codenoid> hi nimmer |
11:09:08 | * | cspar quit (Ping timeout: 272 seconds) |
11:09:08 | * | zachcarter quit (Ping timeout: 272 seconds) |
11:10:02 | * | smt_ joined #nim |
11:13:51 | * | smt` quit (Ping timeout: 252 seconds) |
11:33:34 | stefanos82 | Araq: what is the best way to run tests one by one for Nim? |
11:33:44 | stefanos82 | that is, Nim's code |
11:42:13 | * | PMunch joined #nim |
11:52:13 | * | cspar joined #nim |
11:58:40 | FromGitter | <narimiran> how to break a long string into two lines? |
11:59:16 | FromGitter | <kaushalmodi> @narimiran Break how? [I don't have an answer, just curious] At certain line lengths? |
12:00:21 | FromGitter | <narimiran> @kaushalmodi let's say i have `let a = "a very long string i'd like to break"`. i want to have `let a = "a very long string"; "i'd like to break"` |
12:00:43 | FromGitter | <kaushalmodi> hmm |
12:00:44 | stefanos82 | you have a couple of options |
12:00:46 | FromGitter | <Vindaar> @narimiran If it's just breaking long string lines in your code, you can do: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b8fc56d11b41f69dbc3b795] |
12:00:46 | FromGitter | <narimiran> i've tried with a `\`, it doesn't seem to work |
12:00:53 | FromGitter | <kaushalmodi> i would do .. |
12:00:57 | FromGitter | <kaushalmodi> what @Vindaar said :) |
12:01:00 | stefanos82 | either use """ or use & |
12:01:00 | FromGitter | <kaushalmodi> using `&` |
12:01:47 | FromGitter | <narimiran> @Vindaar ok, this works, and i'm sure i've tried it a minute ago and it didn't!! :) |
12:01:56 | FromGitter | <kaushalmodi> it wouldn't this way.. |
12:02:11 | FromGitter | <kaushalmodi> ```let a = "foo" ⏎ & "bar"``` [https://gitter.im/nim-lang/Nim?at=5b8fc5c3f5402f32aadf841d] |
12:02:29 | FromGitter | <kaushalmodi> *I wish the above worked* |
12:02:35 | FromGitter | <alehander42> well that would be hard |
12:02:42 | FromGitter | <kaushalmodi> https://scripter.co/notes/nim/#line-continuation |
12:02:57 | FromGitter | <alehander42> btw @Araq is there a way to pass directly an html string to text without being escaped |
12:03:11 | FromGitter | <alehander42> in karax |
12:03:20 | FromGitter | <kaushalmodi> @alehander42 Instead of looking of the special chars at line end, look for them at beginning of next line if present |
12:03:29 | FromGitter | <narimiran> now i see why it didn't work, i have used `&` from `strformat`! |
12:03:51 | FromGitter | <kaushalmodi> ahh.. no space? |
12:03:58 | FromGitter | <narimiran> so `let a = &"foo" & ; "bar"` doesn't work |
12:05:09 | FromGitter | <narimiran> oh, that works too |
12:05:20 | FromGitter | <alehander42> @kaushalmodi well nim operators just dont' work that way |
12:05:25 | FromGitter | <narimiran> it seems everything works on the second try :/ |
12:05:28 | stefanos82 | let a = "foo" & " " & "bar" should work |
12:05:32 | FromGitter | <kaushalmodi> @narimiran yeah this works: ⏎ ⏎ ```import strformat ⏎ let a = &"foo" & ⏎ "bar" ⏎ echo a``` [https://gitter.im/nim-lang/Nim?at=5b8fc68c4be56c5918e640dc] |
12:05:36 | FromGitter | <Vindaar> you probably just had a typo or something :) |
12:06:01 | FromGitter | <kaushalmodi> @alehander42 I know.. I just typed something loosely |
12:06:14 | FromGitter | <kaushalmodi> Basically Araq is aware of that request, and that is possible. |
12:06:16 | FromGitter | <alehander42> @stefanos82 what kind of tests run one by one? the unittest? |
12:06:24 | FromGitter | <kaushalmodi> Just that it won't fit with the already defined language style |
12:06:30 | FromGitter | <narimiran> sorry for the confusion guys :) |
12:06:33 | FromGitter | <alehander42> i agree |
12:06:55 | FromGitter | <alehander42> but I prefer putting `+` `.` on the end anyway :D in multiline |
12:07:15 | FromGitter | <kaushalmodi> @alehander42 That's what.. this problem is like putting the toilet paper the right way :P |
12:07:40 | FromGitter | <kaushalmodi> I like it so that the towel rolls up from top towards outside, but not everyone agrees :D |
12:07:46 | FromGitter | <alehander42> yeah :D |
12:11:27 | stefanos82 | @alehander42: from Nim's source under tests/ folder |
12:11:43 | FromGitter | <alehander42> ah you run |
12:11:58 | FromGitter | <alehander42> `./koch tests run tests/path/stuff` |
12:12:01 | FromGitter | <alehander42> iirc |
12:12:05 | stefanos82 | let me check |
12:12:14 | FromGitter | <alehander42> `./koch tests` should show help |
12:12:18 | FromGitter | <alehander42> `cat` is for category |
12:12:22 | FromGitter | <kaushalmodi> @alehander42 I thought `koch` was not meant for "users" |
12:12:24 | FromGitter | <alehander42> `run` for single ones |
12:12:28 | FromGitter | <kaushalmodi> i.e. only for Nim build process |
12:12:36 | FromGitter | <alehander42> aaaaaaaaa |
12:12:49 | FromGitter | <alehander42> I thought @stefanos82 is talking about Nim's compiler source |
12:12:55 | stefanos82 | I am |
12:13:00 | FromGitter | <alehander42> ok, then you do use koch |
12:13:02 | FromGitter | <kaushalmodi> ok, got it |
12:14:08 | FromGitter | <alehander42> you can run directly `tests/testament/tester` instead of `koch tests` but koch makes sure to rebuild your compiler with your last changes |
12:14:36 | stefanos82 | I will attempt to run all tests manually to isolate errors |
12:14:39 | FromGitter | <alehander42> but if you just want to run the same version several times, I think directly tester is faster (i am not sure why koch still rebuilds in those cases) |
12:14:50 | stefanos82 | the last time I attempted to do such thing, something went completely wrong |
12:14:53 | FromGitter | <alehander42> well, you shouldn't need to, are you trying to fix a particular bug |
12:15:14 | stefanos82 | I'm trying to help as much as possible with Nim's stability |
12:16:40 | FromGitter | <kaushalmodi> but I see all tests are passing on devel on Travis |
12:16:47 | FromGitter | <alehander42> yeah, but tester also does this: it runs the tests one after another: if you think there can be different results manually, then there is some kind of bug in the tester code |
12:17:55 | FromGitter | <alehander42> i wonder what went wrong in your previous test |
12:18:16 | stefanos82 | me too. it wasn't clear |
12:18:40 | stefanos82 | it would finish the tests, inform me that everything went alright as expected and at the end it would say "error" something |
12:18:47 | stefanos82 | that's why I need to isolate each test |
12:20:16 | stefanos82 | man...we really need a better -h mechanism -_- |
12:20:29 | stefanos82 | I say ./koch --help tests and does not do anything |
12:20:41 | stefanos82 | how am I supposed to know tests' sub-options? |
12:22:51 | FromGitter | <codem4ster> @Araq how `spawn` understand that I need a thread? |
12:23:13 | FromGitter | <alehander42> the problem is that koch build tester and nim first, and then you can see the options |
12:24:20 | stefanos82 | @alehander42: what do you mean? |
12:24:30 | FromGitter | <alehander42> but I am really not sure, I agree I dont remember how did i see the help |
12:30:58 | FromGitter | <Bennyelg> I just reduce with threadpool my script by half :] |
12:31:09 | FromGitter | <Bennyelg> excited :D |
12:32:05 | stefanos82 | I really that kind of motivation in my life... |
12:33:58 | * | rockcavera quit (Ping timeout: 246 seconds) |
12:38:59 | * | rockcavera joined #nim |
12:48:24 | FromGitter | <Araq> @codem4ster it asks your OS about the current CPU load |
12:48:46 | FromGitter | <Araq> stefanos: I use `tt cat <foo>` fwiw |
12:51:52 | FromGitter | <Bennyelg> @Araq anyway to limit the cpu usage of nim? |
12:52:04 | FromGitter | <Bennyelg> or limit the threads num when using threadpool ? |
12:52:27 | FromGitter | <Bennyelg> I am crushing after few iteration when using threadpool ⏎ SIGSEGV: Illegal storage access. (Attempt to read from nil?) |
12:52:50 | FromGitter | <Araq> https://nim-lang.org/docs/threadpool.html#setMaxPoolSize,range[] |
12:54:07 | stefanos82 | @Araq: is tt a shortcut for any other command? |
12:54:28 | FromGitter | <Araq> it's my bash alias for tests/testament/tester |
12:54:34 | FromGitter | <Bennyelg> How I limit const value :D MaxThreadPoolSize = 256 |
12:54:57 | FromGitter | <Bennyelg> setMin setMax |
12:55:05 | FromGitter | <Bennyelg> not works or Im doing it wrong |
12:55:18 | FromGitter | <Araq> I've already told you what to use |
12:56:02 | FromGitter | <Araq> if you can't read my first answer, I have no reason to assume you'd read my second. |
12:56:27 | FromGitter | <Bennyelg> As I said, I did setMaxPoolSize but ot's not helping. |
12:59:23 | FromGitter | <Araq> told you, don't use threadpool. |
12:59:36 | FromGitter | <Araq> too complex, will never be reliable |
12:59:55 | FromGitter | <Araq> needs to be replaced with braindead stupid code. |
13:03:29 | FromGitter | <Bennyelg> Ok, thanks |
13:03:39 | FromGitter | <Bennyelg> I'll switch to the dirty code |
13:05:20 | * | kapil___ joined #nim |
13:08:31 | FromGitter | <Bennyelg> Error: undeclared identifier: 'Thread' |
13:08:42 | FromGitter | <Bennyelg> what does it wants from me :P |
13:08:45 | leorize | have you passed `--threads:on`? |
13:09:36 | FromGitter | <Bennyelg> fixed thanks vscode recompile without --threads by default :P |
13:14:48 | PMunch | Is that supposed to happen? I remember Nim saying that --threads should be turned on |
13:16:10 | FromGitter | <Vindaar> @PMunch for `Thread` and `Channel` unfortunately it doesn't say that |
13:16:15 | PMunch | I assume there is a when defined(threads) or similar in code for Thread (and Channel which is where I encountered this), couldn't the else branch have an error pragma explaining that --threads should be turned on? |
13:18:35 | FromGitter | <Vindaar> the threads and channels module are just included into system.nim https://github.com/nim-lang/Nim/blob/devel/lib/system.nim#L3257 |
13:19:35 | stefanos82 | @Araq: I finished with tests and all I got at the end was "tests failed"; I have seen though some errors during compilation procedure and was expecting to get them at the end in the form of a list. I guess I was wrong after all -_- |
13:19:48 | FromGitter | <Vindaar> therefore the symbols simply aren't defined at all :/ |
13:20:28 | PMunch | Vindaar, but couldn't they be defined but with an error pragma? |
13:23:03 | FromGitter | <Araq> good idea but I think that still doesn't support a custom message |
13:23:03 | FromGitter | <Vindaar> In principle sure, but with the current implementation I'm not sure how to do it properly |
13:24:06 | FromGitter | <Vindaar> At least `{.fatal.}` supports custom messages |
13:24:39 | FromGitter | <Araq> Nim has 2 .error pragmas, one attached to symbols, the other a statement on its own... |
13:25:53 | FromGitter | <Vindaar> ```when defined(release): ⏎ echo "Hallo" ⏎ else: ⏎ {.error: "Not in release mode!".}``` [https://gitter.im/nim-lang/Nim?at=5b8fd96111227d711d1c68ff] |
13:25:58 | FromGitter | <Vindaar> so this works |
13:26:34 | FromGitter | <Vindaar> results in the same as using `fatal`. What's the difference, @Araq? |
13:27:37 | FromGitter | <Vindaar> Ah, now I had it backwards |
13:28:06 | FromGitter | <Vindaar> you mean to assign the pragma to the type and have that show a custom message, yes? |
13:28:45 | FromGitter | <Araq> yeah |
13:33:46 | PMunch | Basically this: http://ix.io/1m1v/ |
13:34:03 | PMunch | Just with a check for threads of course |
13:34:33 | PMunch | And it seems to support custom messages just fine :) |
13:35:04 | FromGitter | <Vindaar> but then you still have 2 problems, no? 1. this will never be shown in the current implementation, because threads is only included, if the option is already defined |
13:35:45 | FromGitter | <Vindaar> 1) if the user uses some proc from the `threads` module you'd see the same error |
13:36:04 | FromGitter | <Vindaar> weird, that was a `2.` when I typed it... gitter... |
13:36:59 | FromGitter | <Vindaar> so you'd have to wrap the whole `theads` module in these error pragmas for each type and always include it, or not? |
13:37:06 | FromGitter | <Vindaar> *and proc |
13:38:02 | PMunch | Hmm, I was more thinking of the Channels module |
13:38:11 | PMunch | For threads there are some issues.. |
13:38:25 | FromGitter | <Vindaar> what's different for the two? |
13:39:22 | FromGitter | <Vindaar> ok, it's sort of more simple, because you'll always create a channel if you want to work with them, so there's only one pragma to attach |
13:40:24 | FromGitter | <Vindaar> Although the same can probably be said for the threads module, too |
13:40:27 | PMunch | You need to import the channels module |
13:40:41 | PMunch | So one when defined(threads) around the entire module will produce the error on import |
13:40:43 | FromGitter | <Vindaar> do you? |
13:40:53 | PMunch | Don't you? |
13:40:55 | FromGitter | <Vindaar> The docs still seem to say "do not import it directly" |
13:41:05 | FromGitter | <Vindaar> (haven't checked the devel docs though) |
13:41:09 | PMunch | Oh wait, you don't.. |
13:41:18 | PMunch | My bad |
13:43:07 | FromGitter | <Vindaar> To catch most cases, one can probably just create dummy `Thread` and `Channel` types in `system.nim`, e.g. in an else after this https://github.com/nim-lang/Nim/blob/devel/lib/system.nim#L3254-L3260 with the error pragma attached |
13:45:41 | PMunch | Yeah that should work |
13:47:03 | * | nsf quit (Quit: WeeChat 2.2) |
14:20:08 | * | xet7 quit (Quit: Leaving) |
14:37:28 | * | endragor quit (Remote host closed the connection) |
14:47:48 | FromGitter | <lolgab> Hi, I read that Nim doesn't support "proper 64 bit integer arithmetic" in javascript target. The author of Scala.js Sébastien Doeraene solved this problem and you could do the same implementation in nim. ⏎ Here there are the slides of his conference: http://lampwww.epfl.ch/~doeraene/presentations/jslongs-vmm2017/ ⏎ In case you didn't know that :) |
14:50:17 | FromGitter | <Araq> thanks, but I do know how to emulate arithmetic ;-) |
14:51:17 | FromGitter | <Araq> it just wasn't a priority for anybody using the JS backend. we map Nim to "high level" JS code to get DOM access. For anything else, emscripten and the like provide a better experience. ymmv. |
14:56:29 | FromGitter | <Araq> https://www.youtube.com/watch?v=tShc0dyFtgw somebody should patch Nim's GC to use this algorithm... |
15:00:06 | * | PMunch quit (Quit: Leaving) |
15:13:38 | * | kapil___ quit (Quit: Connection closed for inactivity) |
15:16:41 | * | byte512 quit (Ping timeout: 244 seconds) |
15:22:41 | * | endragor joined #nim |
15:22:56 | FromGitter | <Bennyelg> --threads:on is set but still get `Error: undeclared identifier: 'spawn'` |
15:25:57 | FromGitter | <Araq> spawn is part of threadpool.nim |
15:26:25 | FromGitter | <Araq> maybe read some of Nim's docs, they are not as bad as you may think |
15:26:27 | FromGitter | <Bennyelg> thought i dont have fully use createTread |
15:26:32 | FromGitter | <Bennyelg> what a bump |
15:26:47 | * | endragor quit (Ping timeout: 240 seconds) |
15:29:23 | FromDiscord | <treeform> I found the design of threadpool.nim very surprising. Its limited to only 10 threads and drops threads silently after that. I though it was a bug, but people here convinced it me it was by design. |
15:31:01 | FromGitter | <mratsim> Ugh, I plan to buy a Threadripper W2950X soon with 16 cores |
15:34:42 | FromGitter | <Vindaar> @treeform: why is there this then? https://github.com/nim-lang/Nim/blob/devel/lib/pure/concurrency/threadpool.nim#L293-L295 |
15:37:56 | FromDiscord | <treeform> Through some sort of magic it gets set to 10. |
15:39:26 | FromDiscord | <treeform> it starts with min(minThreadPoolSize, numCPUs) |
15:41:08 | FromGitter | <Araq> it's not limited to 10, but it surely is ... weird |
15:41:39 | FromGitter | <Araq> probably the idea behind it is too smart :P |
15:41:43 | * | SenasOzys joined #nim |
15:41:43 | FromDiscord | <treeform> https://github.com/nim-lang/Nim/blob/ecbbefcc83c3e2b95b3f9abcad17424820c10997/lib/pure/concurrency/cpuload.nim#L31 |
15:41:51 | FromDiscord | <treeform> This part confused me, so i stopped. |
15:42:09 | * | leorize quit (Ping timeout: 252 seconds) |
15:42:25 | FromDiscord | <treeform> I think that is where max 10 comes from. |
15:42:53 | FromGitter | <Araq> that's not what happens. for your workload it never created more than 10 |
15:43:23 | FromGitter | <Araq> the code in there asks the OS about the current CPU load. if it's below 85%, thread creation is encouraged |
15:44:09 | FromGitter | <Araq> it's common that you're IO bound and then more threads are never spawned. |
15:44:21 | FromGitter | <Araq> because for IO bound things we have `async` |
15:44:37 | FromDiscord | <treeform> Yeah it seems to do some thing super smart. That is why I don't think its a "bug", but the design of it confuses me so I don't use it. |
15:45:05 | FromGitter | <Araq> I dunno if it's smart, but the idea was smart. |
15:45:25 | FromGitter | <Araq> well it's a thread pool, if you need more control, don't use a "pool" |
15:45:29 | * | leorize joined #nim |
15:45:36 | FromDiscord | <treeform> yeah that is what I did. |
15:45:49 | FromDiscord | <treeform> I just use threads directly and everything works. |
15:45:50 | FromGitter | <Araq> and you can also set the minimum size too |
15:46:34 | FromDiscord | <treeform> My stuff is io bound, but I can't use async, because osproc does not support async. I did not find asyncosproc... |
15:47:24 | FromGitter | <Araq> `osproc.execProcesses` uses the same ideas btw. Some bloody idiot came up with "fairness" in scheduling so if you directly create N processes they all run "fairly" simultanously |
15:47:49 | FromGitter | <Araq> creating way too many context switches when all you wanted to setup was a batch process |
15:48:32 | FromGitter | <Bennyelg> Why I can't do someting like this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b8ffad011227d711d1d6293] |
15:48:35 | FromDiscord | <treeform> I actually osproc.execProcesses ssh connections to servers... |
15:48:43 | FromDiscord | <treeform> so no cpu work is done |
15:49:08 | FromDiscord | <treeform> its like the worse case of threads/async/io crazyness |
15:49:47 | FromDiscord | <treeform> actually what I want is some sort of async ssh protocol |
15:50:07 | FromDiscord | <treeform> like Paramiko for python. |
15:51:00 | FromGitter | <Araq> @Bennyelg because a Thread is a very special object that cannot be copied/moved around |
16:01:07 | * | abm quit (Ping timeout: 240 seconds) |
16:16:12 | FromGitter | <Bennyelg> Apparently My thread understanding is shit |
16:20:56 | AlexMax | well this is weird |
16:20:58 | AlexMax | nimgen |
16:21:28 | AlexMax | it doesn't look like this nimgen-wrapped library is putting any library files anyplace |
16:25:12 | AlexMax | `nimble install https://github.com/genotrance/nimtess2` - yeah, under pkgs/nimtess2-0.1.0/, there's supposed to be a nimtess2 directory and a tesselator.nim file, but both are missing |
16:25:40 | shashlick | @AlexMax: what's the output when you do nimble install |
16:26:46 | shashlick | do you have nimgen and git installed |
16:27:35 | AlexMax | yes, this box has previously been able to install this library just fine. I even have a simple "hello world" thing that I ran as a sanity check that just doesn't work anymore |
16:27:46 | ldlework | This is probably already mentioned but someone posted a pirated version of Nim in Action on reddit: https://www.reddit.com/r/nim/comments/9d2f4k/nim_in_action_pdf_ebook/ |
16:28:26 | shashlick | @AlexMax: can you share the output of the install |
16:29:34 | AlexMax | https://paste.ee/p/3xzWJ#J25T86kVJbmvDIFwVETdqzty6npxbwpp |
16:29:34 | * | vegax87 quit (Changing host) |
16:29:34 | * | vegax87 joined #nim |
16:29:35 | * | vegax87 quit (Changing host) |
16:29:35 | * | vegax87 joined #nim |
16:32:02 | shashlick | that's weird |
16:32:28 | AlexMax | what the heck |
16:32:30 | AlexMax | it's there now |
16:32:38 | AlexMax | wait a minute |
16:32:39 | shashlick | is this windows or linux |
16:32:41 | AlexMax | linux |
16:33:01 | shashlick | magic |
16:33:31 | shashlick | not sure it matters but nimble had some issues installing packages in a folder of an existing package |
16:33:42 | AlexMax | well hold on |
16:33:42 | shashlick | dom96 fixed it but not sure if it impacted anything |
16:33:50 | AlexMax | let me like, start from scratch |
16:33:58 | AlexMax | I'm installing choosenim |
16:34:09 | AlexMax | I'm going to `nimble build` |
16:34:11 | AlexMax | and see what happens |
16:39:02 | AlexMax | nope, it's missing |
16:39:57 | * | Trustable joined #nim |
16:41:52 | AlexMax | shashlick: https://paste.ee/p/8Zbcj#hFGcPBCkqTSpUrILScQaL2ZItVl2d5uy |
16:42:10 | AlexMax | this is what happens when I run `nimble build` with nothing installed |
16:42:31 | AlexMax | I notice that there's no generation messages |
16:42:38 | AlexMax | like there was the other time |
16:43:45 | shashlick | nimble build doesn't do anything for nimgen wrappers |
16:43:53 | shashlick | it is nimble setup if you see the nimble file |
16:44:06 | shashlick | and it gets called as part of install |
16:44:35 | AlexMax | I thought nimble build looks at your deps and installs them |
16:46:46 | AlexMax | the tesselator is just one of my dependencies |
16:48:21 | AlexMax | `nimble build` is just the command I'm using to build my project |
16:49:49 | AlexMax | Okay, if I install it by hand using `nimble install <nimtess2-git-repo>` it works and I get the full library, but it seems wrong to me that I have to call that by hand. |
16:50:45 | AlexMax | It just seems like if I then turn around, make it a dependency of my project, and then run `nimble build` on my project, that's when it messes up. |
16:51:23 | AlexMax | Okay, this is super strange, I just installed the library with 'nimble install' but then when I run the build task, it asks me if it wants to install...again |
16:51:43 | shashlick | hmm - well, when nimble sees your dependency, it should nimble install it, I don't see why your nimble build should do a nimble build on a dependency |
16:52:05 | AlexMax | and if I answer yes, the build process blows away the working nimtess and replaces it with the bad one |
16:52:12 | AlexMax | Am I making sense? |
16:52:19 | AlexMax | I'm not doing anything fancy with my build system or anything. |
16:54:54 | shashlick | that's weird |
16:55:16 | shashlick | can you post the output of your `nimble build`? |
16:57:11 | AlexMax | actually |
16:57:12 | AlexMax | here |
16:57:21 | AlexMax | https://paste.ee/p/9KT1r |
16:57:46 | AlexMax | That is a 'minimal test' that I was able to figure out just now |
16:58:09 | AlexMax | If I run `nimble build` on that, I get the problem |
16:59:16 | shashlick | basically `nimble build` doesn't call `before install` on dependencies |
17:02:37 | AlexMax | Shouldn't it? |
17:02:47 | shashlick | @AlexMax: yep, I reproduced it - if you do `nimble build`, it won't work since nimble skips calling `before install` on dependencies |
17:02:58 | shashlick | it's a bug in my mind - wonder what dom96 thinks |
17:03:22 | AlexMax | Alright well, I need the peace out for now. Thanks for your time |
17:03:43 | shashlick | if you try `nimble install` instead, it works |
17:03:50 | shashlick | in your test project |
17:05:52 | * | stefanos82 quit (Quit: Quitting for now...) |
17:07:19 | * | Trustable quit (Remote host closed the connection) |
17:07:50 | shashlick | @AlexMax: you might want to say `requires "https://github.com/genotrance/nimtess2 >= 0.1.0"` - that way it won't keep trying to install the latest and get satisfied |
17:09:01 | * | Senketsu quit (Quit: WeeChat 2.2) |
17:17:25 | shashlick | @AlexMax: https://github.com/nim-lang/nimble/issues/533 |
17:17:32 | FromGitter | <Bennyelg> I need an help i have an sequence which contains X seqs I want to use thread and send them to a proc and reuse them on other parts of the seqeunce since I have X items and I for example will want to open max of 10 threads. |
17:23:16 | * | Senketsu joined #nim |
17:30:22 | FromGitter | <Vindaar> @Bennyelg just have the threads working on `seq[seq[...]]` and hand each thread a sub seq of length 1/10 of the whole? |
17:50:07 | FromGitter | <kayabaNerve> @mratsim I have the Threadripper with 8 cores :P |
17:55:58 | FromGitter | <mratsim> The 16 seems like the best bang for buck, and ML workflows use everything anyway |
17:56:37 | FromGitter | <mratsim> The 32 cores has cache locality tradeoff on 2 of the 4 sockets |
18:16:13 | * | nsf joined #nim |
18:28:37 | * | Jesin quit (Quit: Leaving) |
18:39:22 | * | rockcavera quit (Ping timeout: 246 seconds) |
18:41:26 | * | rockcavera joined #nim |
18:41:27 | * | rockcavera quit (Changing host) |
18:41:27 | * | rockcavera joined #nim |
18:45:52 | shashlick | https://duktape.org/ <= is a nim wrapper of interest? |
18:47:08 | * | xet7 joined #nim |
18:48:22 | FromGitter | <kayabaNerve> The JS engine? I want one. |
18:49:15 | * | Jesin joined #nim |
18:49:38 | FromGitter | <data-man> https://github.com/manguluka/duktape-nim |
18:52:55 | * | TheLemonMan joined #nim |
18:55:31 | TheLemonMan | Araq, is it wrong to assume every nkFastAsgn can be safely replaced by a nkAsgn (but not vice-versa) ? |
18:58:22 | FromGitter | <Araq> probably not, people enjoy the `.shallow` pragma |
19:00:20 | FromGitter | <Araq> btw there is a flag in seqs/strings for literals that can be used to make `nkFastAsgn` safe without much speed loss |
19:01:18 | TheLemonMan | you mean NIM_STRLIT_FLAG ? |
19:01:23 | FromGitter | <Araq> yeah |
19:02:40 | FromGitter | <xmonader> ```code paste, see link``` ⏎ ⏎ So does it affect the return value too? [https://gitter.im/nim-lang/Nim?at=5b90285058a3797aa30a35ef] |
19:02:47 | FromGitter | <Araq> we better patch the GCs then to not free stringlits... |
19:03:41 | TheLemonMan | probably the GC is the only part of Nim I didn't touch (yet) heh |
19:04:39 | TheLemonMan | wrt #8884 I also noticed that inline iterators always make a copy while closure ones use refs |
19:05:04 | FromGitter | <data-man> @TheLemonMan Try switch to stdlib ;) |
19:05:29 | FromGitter | <data-man> About touching :) |
19:10:20 | * | PMunch joined #nim |
19:14:08 | shashlick | data-man: wow someone used nimgen to wrap duktape 😄 |
19:21:48 | PMunch | Huh, a Javascript engine |
19:23:03 | PMunch | You can even native callbacks |
19:23:08 | PMunch | That's actually pretty cool |
19:23:17 | PMunch | Not sure what I'd use it for, but cool none the less |
19:23:40 | PMunch | Could probably be used for some kind of embedded scripting thingy |
19:23:55 | PMunch | Can Nimscript be used in that way? |
19:24:15 | PMunch | Set up some native callbacks and have Nim be able to run Nimscript files to interact with it |
19:24:39 | FromGitter | <rayman22201> https://github.com/Serenitor/embeddedNimScript |
19:24:50 | FromGitter | <rayman22201> though I don't know if it's been kept up to date |
19:26:07 | PMunch | Well it had a commit 3 days ago |
19:26:17 | PMunch | So it can't be that out of date |
19:26:28 | FromGitter | <rayman22201> So apparently yes lol |
19:26:37 | * | cspar quit (Ping timeout: 246 seconds) |
19:27:01 | FromGitter | <rayman22201> Also, Araq has done some work on compiler to make it easier to use a library in general, but I think that is an ongoing project. |
19:34:15 | * | Jesin quit (Quit: Leaving) |
19:50:18 | * | dddddd joined #nim |
19:51:37 | FromGitter | <mratsim> Maybe this should be wrapped: https://github.com/intel/hyperscan |
19:52:36 | * | Jesin joined #nim |
19:52:52 | FromGitter | <kayabaNerve> github.com/intel |
19:52:53 | FromGitter | <kayabaNerve> Hiss |
19:52:54 | FromGitter | <Araq> @rayman22201 actually that project is pretty complete |
19:53:46 | FromGitter | <rayman22201> awesome |
19:54:33 | FromGitter | <rayman22201> this is the best way to be wrong :-P |
20:08:55 | TheLemonMan | Araq, are you ok with nuking https://github.com/nim-lang/Nim/blob/devel/compiler/jsgen.nim#L766 ? it makes supporting global/non-global variables hard for no reason (see #7249) |
20:17:58 | * | geocar joined #nim |
20:18:59 | * | zachcarter joined #nim |
20:19:37 | zachcarter | hi all - I'm asking for tips / suggestions on how to improve the implementation of this macro I'm working on |
20:20:00 | zachcarter | I want a way to generate ES6 classes for the JS target |
20:20:12 | zachcarter | https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes |
20:21:37 | zachcarter | https://gist.github.com/zacharycarter/45bbdc24b345299014c587c0ad4a88d5 |
20:21:45 | zachcarter | is what I have so far - is there a better way to do this? |
20:22:15 | FromGitter | <Araq> @TheLemonMan: It means patching jssys.nim too |
20:22:45 | FromGitter | <Araq> but it's covered by tests so ... fine with me |
20:25:03 | FromGitter | <Araq> @zacharycarter the approach seems ok |
20:25:50 | zachcarter | thank you Araq |
20:27:28 | TheLemonMan | Araq, an escape hatch is sometimes needed for low-level manipulation of some objects, I've made `asm` perform the deference while `emit` outputs the symbols as-is |
20:30:10 | FromGitter | <Araq> meh |
20:32:18 | FromGitter | <Araq> subtle difference and `asm` should become a pragma |
20:44:35 | FromGitter | <xmonader> Is there a way to allow using await in echo? ⏎ ⏎ ``` res = await con.execCommand("SET", @["auser", "avalue"]) ⏎ echo res``` ⏎ ⏎ why can't i just do `echo $ (await con.execCommand("SET", @["auser", "avalue"])` ? [https://gitter.im/nim-lang/Nim?at=5b90403311b41f69dbc6d9e3] |
20:45:19 | FromGitter | <Araq> you can if you don't use the '$' as a binary operator |
20:47:27 | FromGitter | <xmonader> @Araq u mean without space correct? ⏎ ⏎ ``` echo $(await con.execCommand("SCAN", @["0"])) ⏎ ``` ⏎ ⏎ Gives me `nim_resp.nim(385, 18) Error: invalid control flow: 'yield' within a constructor` [https://gitter.im/nim-lang/Nim?at=5b9040df58a3797aa30ace3b] |
20:47:46 | FromGitter | <Araq> that's gone in Nim devel |
20:48:27 | FromGitter | <xmonader> I'm using 0.18 hmm |
20:49:26 | dom96 | Araq: Did you need me? |
20:52:29 | * | nsf quit (Quit: WeeChat 2.2) |
21:16:13 | zachcarter | is it posible to check if a parameter is of a certain type in a macro? |
21:16:35 | zachcarter | when I'm iterating over all of the identifiers in a procedure paramter, the kind isn't discriminate b/w parameter names and types |
21:16:39 | zachcarter | it's all just nnkIdent |
21:18:35 | zachcarter | I think I found - `getTypeInst` |
21:20:20 | * | MyMind joined #nim |
21:23:15 | * | Sembei quit (Ping timeout: 252 seconds) |
21:27:38 | * | xet7 quit (Quit: Leaving) |
21:32:30 | zachcarter | hrm |
21:32:34 | zachcarter | that is not working - nore is typeKind |
21:34:09 | * | PMunch quit (Remote host closed the connection) |
21:36:52 | AlexMax | Don't Nim macros operate on the AST? |
21:37:26 | AlexMax | If so, maybe the compiler literally doesn't know what type an identifier is at that stage of compilation yet. |
21:37:58 | AlexMax | I don't know, personally. |
21:38:38 | zachcarter | yeah - could be since the parameters are untyped |
21:39:40 | * | Vladar quit (Remote host closed the connection) |
21:44:30 | zachcarter | https://gist.github.com/zacharycarter/d97c703890f8abc0e21c6dfe6682f22d |
21:44:35 | zachcarter | is what I came up with |
22:07:09 | * | gangstacat quit (Ping timeout: 252 seconds) |
22:09:40 | * | gangstacat joined #nim |
22:11:06 | * | gangstacat quit (Client Quit) |
22:14:45 | * | gangstacat joined #nim |
22:19:25 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
22:38:20 | * | abm joined #nim |
22:41:37 | zachcarter | it's getting there - https://gist.github.com/zacharycarter/ccdd4e5d868e9a9acce6e15390afed49 |
22:42:39 | * | seni quit (Quit: Leaving) |
23:07:07 | * | Notkea quit (Ping timeout: 240 seconds) |
23:10:15 | * | SenasOzys quit (Remote host closed the connection) |
23:23:15 | * | leaf__ joined #nim |
23:27:06 | * | Notkea joined #nim |
23:45:21 | * | Jesin quit (Ping timeout: 252 seconds) |
23:51:58 | zachcarter | more progress (defining corresponding Nim types now as well - https://gist.github.com/zacharycarter/ccdd4e5d868e9a9acce6e15390afed49) |
23:52:05 | zachcarter | https://gist.github.com/zacharycarter/ccdd4e5d868e9a9acce6e15390afed49 |
23:52:29 | * | sagax joined #nim |
23:52:37 | sagax | hi all! |
23:52:45 | zachcarter | break time |
23:53:03 | sagax | in another language like as python we have % operator |
23:53:29 | sagax | how to get remainder of the division in nim? |
23:58:07 | AlexMax | sagax: mod |
23:58:25 | sagax | thanks |