<< 05-09-2018 >>

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:01zachcarterAlexMax: when I have time - yes, currently don't have bandwidth to work on gamedev stuff
04:58:07zachcarterhttps://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:23FromGitter<codem4ster> can I write a program by using only ptr, alloc, dealloc, realloc with nim which is totally manual garbage collected?
06:30:55FromGitter<codem4ster> do I need to know another things?
06:42:09Tangercodem4ster: If you do, you should turn gc off with --gc:none
06:49:25leorizecodem4ster: 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:51FromGitter<codem4ster> ah ok I understand
06:55:54FromGitter<codem4ster> thanks
06:58:22FromGitter<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:23FromGitter<codem4ster> this is the bottom of code I have proper imports up there.
07:02:12leorizeIIRC 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:42Tangercodem4ster: I don't think async opens new threads by default
07:14:06FromGitter<codem4ster> there is a spawn when calling processClient
07:15:31*xet7 joined #nim
07:16:03FromGitter<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:51FromGitter<Bennyelg> async not open new threads
07:31:56FromGitter<Bennyelg> async is for IO
07:32:57Tangercodem4ster ^
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:02FromGitter<Araq> `spawn` creates new threads if the load demands it
08:12:16FromGitter<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:27FromGitter<alehander42> @dom96 hey, just trying jester for the first time
09:00:13FromGitter<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:15FromGitter<alehander42> )
09:01:13Araqbecause 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:19FromGitter<alehander42> ah i always forget to `when defined(js) .. cstring` my string fields
10:19:17FromGitter<alehander42> hm yeah, but sinatra has an option to `||` them as a block
10:21:01FromGitter<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:37FromGitter<alehander42> nah ⏎ ⏎ ```get "/@id" (id: int): ⏎ 0``` ⏎ ⏎ would work [https://gitter.im/nim-lang/Nim?at=5b8fae6dd8d36815e5dc6618]
10:30:36FromGitter<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:34stefanos82Araq: what is the best way to run tests one by one for Nim?
11:33:44stefanos82that is, Nim's code
11:42:13*PMunch joined #nim
11:52:13*cspar joined #nim
11:58:40FromGitter<narimiran> how to break a long string into two lines?
11:59:16FromGitter<kaushalmodi> @narimiran Break how? [I don't have an answer, just curious] At certain line lengths?
12:00:21FromGitter<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:43FromGitter<kaushalmodi> hmm
12:00:44stefanos82you have a couple of options
12:00:46FromGitter<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:46FromGitter<narimiran> i've tried with a `\`, it doesn't seem to work
12:00:53FromGitter<kaushalmodi> i would do ..
12:00:57FromGitter<kaushalmodi> what @Vindaar said :)
12:01:00stefanos82either use """ or use &
12:01:00FromGitter<kaushalmodi> using `&`
12:01:47FromGitter<narimiran> @Vindaar ok, this works, and i'm sure i've tried it a minute ago and it didn't!! :)
12:01:56FromGitter<kaushalmodi> it wouldn't this way..
12:02:11FromGitter<kaushalmodi> ```let a = "foo" ⏎ & "bar"``` [https://gitter.im/nim-lang/Nim?at=5b8fc5c3f5402f32aadf841d]
12:02:29FromGitter<kaushalmodi> *I wish the above worked*
12:02:35FromGitter<alehander42> well that would be hard
12:02:42FromGitter<kaushalmodi> https://scripter.co/notes/nim/#line-continuation
12:02:57FromGitter<alehander42> btw @Araq is there a way to pass directly an html string to text without being escaped
12:03:11FromGitter<alehander42> in karax
12:03:20FromGitter<kaushalmodi> @alehander42 Instead of looking of the special chars at line end, look for them at beginning of next line if present
12:03:29FromGitter<narimiran> now i see why it didn't work, i have used `&` from `strformat`!
12:03:51FromGitter<kaushalmodi> ahh.. no space?
12:03:58FromGitter<narimiran> so `let a = &"foo" & ; "bar"` doesn't work
12:05:09FromGitter<narimiran> oh, that works too
12:05:20FromGitter<alehander42> @kaushalmodi well nim operators just dont' work that way
12:05:25FromGitter<narimiran> it seems everything works on the second try :/
12:05:28stefanos82let a = "foo" & " " & "bar" should work
12:05:32FromGitter<kaushalmodi> @narimiran yeah this works: ⏎ ⏎ ```import strformat ⏎ let a = &"foo" & ⏎ "bar" ⏎ echo a``` [https://gitter.im/nim-lang/Nim?at=5b8fc68c4be56c5918e640dc]
12:05:36FromGitter<Vindaar> you probably just had a typo or something :)
12:06:01FromGitter<kaushalmodi> @alehander42 I know.. I just typed something loosely
12:06:14FromGitter<kaushalmodi> Basically Araq is aware of that request, and that is possible.
12:06:16FromGitter<alehander42> @stefanos82 what kind of tests run one by one? the unittest?
12:06:24FromGitter<kaushalmodi> Just that it won't fit with the already defined language style
12:06:30FromGitter<narimiran> sorry for the confusion guys :)
12:06:33FromGitter<alehander42> i agree
12:06:55FromGitter<alehander42> but I prefer putting `+` `.` on the end anyway :D in multiline
12:07:15FromGitter<kaushalmodi> @alehander42 That's what.. this problem is like putting the toilet paper the right way :P
12:07:40FromGitter<kaushalmodi> I like it so that the towel rolls up from top towards outside, but not everyone agrees :D
12:07:46FromGitter<alehander42> yeah :D
12:11:27stefanos82@alehander42: from Nim's source under tests/ folder
12:11:43FromGitter<alehander42> ah you run
12:11:58FromGitter<alehander42> `./koch tests run tests/path/stuff`
12:12:01FromGitter<alehander42> iirc
12:12:05stefanos82let me check
12:12:14FromGitter<alehander42> `./koch tests` should show help
12:12:18FromGitter<alehander42> `cat` is for category
12:12:22FromGitter<kaushalmodi> @alehander42 I thought `koch` was not meant for "users"
12:12:24FromGitter<alehander42> `run` for single ones
12:12:28FromGitter<kaushalmodi> i.e. only for Nim build process
12:12:36FromGitter<alehander42> aaaaaaaaa
12:12:49FromGitter<alehander42> I thought @stefanos82 is talking about Nim's compiler source
12:12:55stefanos82I am
12:13:00FromGitter<alehander42> ok, then you do use koch
12:13:02FromGitter<kaushalmodi> ok, got it
12:14:08FromGitter<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:36stefanos82I will attempt to run all tests manually to isolate errors
12:14:39FromGitter<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:50stefanos82the last time I attempted to do such thing, something went completely wrong
12:14:53FromGitter<alehander42> well, you shouldn't need to, are you trying to fix a particular bug
12:15:14stefanos82I'm trying to help as much as possible with Nim's stability
12:16:40FromGitter<kaushalmodi> but I see all tests are passing on devel on Travis
12:16:47FromGitter<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:55FromGitter<alehander42> i wonder what went wrong in your previous test
12:18:16stefanos82me too. it wasn't clear
12:18:40stefanos82it would finish the tests, inform me that everything went alright as expected and at the end it would say "error" something
12:18:47stefanos82that's why I need to isolate each test
12:20:16stefanos82man...we really need a better -h mechanism -_-
12:20:29stefanos82I say ./koch --help tests and does not do anything
12:20:41stefanos82how am I supposed to know tests' sub-options?
12:22:51FromGitter<codem4ster> @Araq how `spawn` understand that I need a thread?
12:23:13FromGitter<alehander42> the problem is that koch build tester and nim first, and then you can see the options
12:24:20stefanos82@alehander42: what do you mean?
12:24:30FromGitter<alehander42> but I am really not sure, I agree I dont remember how did i see the help
12:30:58FromGitter<Bennyelg> I just reduce with threadpool my script by half :]
12:31:09FromGitter<Bennyelg> excited :D
12:32:05stefanos82I 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:24FromGitter<Araq> @codem4ster it asks your OS about the current CPU load
12:48:46FromGitter<Araq> stefanos: I use `tt cat <foo>` fwiw
12:51:52FromGitter<Bennyelg> @Araq anyway to limit the cpu usage of nim?
12:52:04FromGitter<Bennyelg> or limit the threads num when using threadpool ?
12:52:27FromGitter<Bennyelg> I am crushing after few iteration when using threadpool ⏎ SIGSEGV: Illegal storage access. (Attempt to read from nil?)
12:52:50FromGitter<Araq> https://nim-lang.org/docs/threadpool.html#setMaxPoolSize,range[]
12:54:07stefanos82@Araq: is tt a shortcut for any other command?
12:54:28FromGitter<Araq> it's my bash alias for tests/testament/tester
12:54:34FromGitter<Bennyelg> How I limit const value :D MaxThreadPoolSize = 256
12:54:57FromGitter<Bennyelg> setMin setMax
12:55:05FromGitter<Bennyelg> not works or Im doing it wrong
12:55:18FromGitter<Araq> I've already told you what to use
12:56:02FromGitter<Araq> if you can't read my first answer, I have no reason to assume you'd read my second.
12:56:27FromGitter<Bennyelg> As I said, I did setMaxPoolSize but ot's not helping.
12:59:23FromGitter<Araq> told you, don't use threadpool.
12:59:36FromGitter<Araq> too complex, will never be reliable
12:59:55FromGitter<Araq> needs to be replaced with braindead stupid code.
13:03:29FromGitter<Bennyelg> Ok, thanks
13:03:39FromGitter<Bennyelg> I'll switch to the dirty code
13:05:20*kapil___ joined #nim
13:08:31FromGitter<Bennyelg> Error: undeclared identifier: 'Thread'
13:08:42FromGitter<Bennyelg> what does it wants from me :P
13:08:45leorizehave you passed `--threads:on`?
13:09:36FromGitter<Bennyelg> fixed thanks vscode recompile without --threads by default :P
13:14:48PMunchIs that supposed to happen? I remember Nim saying that --threads should be turned on
13:16:10FromGitter<Vindaar> @PMunch for `Thread` and `Channel` unfortunately it doesn't say that
13:16:15PMunchI 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:35FromGitter<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:35stefanos82@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:48FromGitter<Vindaar> therefore the symbols simply aren't defined at all :/
13:20:28PMunchVindaar, but couldn't they be defined but with an error pragma?
13:23:03FromGitter<Araq> good idea but I think that still doesn't support a custom message
13:23:03FromGitter<Vindaar> In principle sure, but with the current implementation I'm not sure how to do it properly
13:24:06FromGitter<Vindaar> At least `{.fatal.}` supports custom messages
13:24:39FromGitter<Araq> Nim has 2 .error pragmas, one attached to symbols, the other a statement on its own...
13:25:53FromGitter<Vindaar> ```when defined(release): ⏎ echo "Hallo" ⏎ else: ⏎ {.error: "Not in release mode!".}``` [https://gitter.im/nim-lang/Nim?at=5b8fd96111227d711d1c68ff]
13:25:58FromGitter<Vindaar> so this works
13:26:34FromGitter<Vindaar> results in the same as using `fatal`. What's the difference, @Araq?
13:27:37FromGitter<Vindaar> Ah, now I had it backwards
13:28:06FromGitter<Vindaar> you mean to assign the pragma to the type and have that show a custom message, yes?
13:28:45FromGitter<Araq> yeah
13:33:46PMunchBasically this: http://ix.io/1m1v/
13:34:03PMunchJust with a check for threads of course
13:34:33PMunchAnd it seems to support custom messages just fine :)
13:35:04FromGitter<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:45FromGitter<Vindaar> 1) if the user uses some proc from the `threads` module you'd see the same error
13:36:04FromGitter<Vindaar> weird, that was a `2.` when I typed it... gitter...
13:36:59FromGitter<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:06FromGitter<Vindaar> *and proc
13:38:02PMunchHmm, I was more thinking of the Channels module
13:38:11PMunchFor threads there are some issues..
13:38:25FromGitter<Vindaar> what's different for the two?
13:39:22FromGitter<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:24FromGitter<Vindaar> Although the same can probably be said for the threads module, too
13:40:27PMunchYou need to import the channels module
13:40:41PMunchSo one when defined(threads) around the entire module will produce the error on import
13:40:43FromGitter<Vindaar> do you?
13:40:53PMunchDon't you?
13:40:55FromGitter<Vindaar> The docs still seem to say "do not import it directly"
13:41:05FromGitter<Vindaar> (haven't checked the devel docs though)
13:41:09PMunchOh wait, you don't..
13:41:18PMunchMy bad
13:43:07FromGitter<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:41PMunchYeah 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:48FromGitter<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:17FromGitter<Araq> thanks, but I do know how to emulate arithmetic ;-)
14:51:17FromGitter<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:29FromGitter<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:56FromGitter<Bennyelg> --threads:on is set but still get `Error: undeclared identifier: 'spawn'`
15:25:57FromGitter<Araq> spawn is part of threadpool.nim
15:26:25FromGitter<Araq> maybe read some of Nim's docs, they are not as bad as you may think
15:26:27FromGitter<Bennyelg> thought i dont have fully use createTread
15:26:32FromGitter<Bennyelg> what a bump
15:26:47*endragor quit (Ping timeout: 240 seconds)
15:29:23FromDiscord<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:01FromGitter<mratsim> Ugh, I plan to buy a Threadripper W2950X soon with 16 cores
15:34:42FromGitter<Vindaar> @treeform: why is there this then? https://github.com/nim-lang/Nim/blob/devel/lib/pure/concurrency/threadpool.nim#L293-L295
15:37:56FromDiscord<treeform> Through some sort of magic it gets set to 10.
15:39:26FromDiscord<treeform> it starts with min(minThreadPoolSize, numCPUs)
15:41:08FromGitter<Araq> it's not limited to 10, but it surely is ... weird
15:41:39FromGitter<Araq> probably the idea behind it is too smart :P
15:41:43*SenasOzys joined #nim
15:41:43FromDiscord<treeform> https://github.com/nim-lang/Nim/blob/ecbbefcc83c3e2b95b3f9abcad17424820c10997/lib/pure/concurrency/cpuload.nim#L31
15:41:51FromDiscord<treeform> This part confused me, so i stopped.
15:42:09*leorize quit (Ping timeout: 252 seconds)
15:42:25FromDiscord<treeform> I think that is where max 10 comes from.
15:42:53FromGitter<Araq> that's not what happens. for your workload it never created more than 10
15:43:23FromGitter<Araq> the code in there asks the OS about the current CPU load. if it's below 85%, thread creation is encouraged
15:44:09FromGitter<Araq> it's common that you're IO bound and then more threads are never spawned.
15:44:21FromGitter<Araq> because for IO bound things we have `async`
15:44:37FromDiscord<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:05FromGitter<Araq> I dunno if it's smart, but the idea was smart.
15:45:25FromGitter<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:36FromDiscord<treeform> yeah that is what I did.
15:45:49FromDiscord<treeform> I just use threads directly and everything works.
15:45:50FromGitter<Araq> and you can also set the minimum size too
15:46:34FromDiscord<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:24FromGitter<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:49FromGitter<Araq> creating way too many context switches when all you wanted to setup was a batch process
15:48:32FromGitter<Bennyelg> Why I can't do someting like this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b8ffad011227d711d1d6293]
15:48:35FromDiscord<treeform> I actually osproc.execProcesses ssh connections to servers...
15:48:43FromDiscord<treeform> so no cpu work is done
15:49:08FromDiscord<treeform> its like the worse case of threads/async/io crazyness
15:49:47FromDiscord<treeform> actually what I want is some sort of async ssh protocol
15:50:07FromDiscord<treeform> like Paramiko for python.
15:51:00FromGitter<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:12FromGitter<Bennyelg> Apparently My thread understanding is shit
16:20:56AlexMaxwell this is weird
16:20:58AlexMaxnimgen
16:21:28AlexMaxit doesn't look like this nimgen-wrapped library is putting any library files anyplace
16:25:12AlexMax`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:40shashlick@AlexMax: what's the output when you do nimble install
16:26:46shashlickdo you have nimgen and git installed
16:27:35AlexMaxyes, 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:46ldleworkThis 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:26shashlick@AlexMax: can you share the output of the install
16:29:34AlexMaxhttps://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:02shashlickthat's weird
16:32:28AlexMaxwhat the heck
16:32:30AlexMaxit's there now
16:32:38AlexMaxwait a minute
16:32:39shashlickis this windows or linux
16:32:41AlexMaxlinux
16:33:01shashlickmagic
16:33:31shashlicknot sure it matters but nimble had some issues installing packages in a folder of an existing package
16:33:42AlexMaxwell hold on
16:33:42shashlickdom96 fixed it but not sure if it impacted anything
16:33:50AlexMaxlet me like, start from scratch
16:33:58AlexMaxI'm installing choosenim
16:34:09AlexMaxI'm going to `nimble build`
16:34:11AlexMaxand see what happens
16:39:02AlexMaxnope, it's missing
16:39:57*Trustable joined #nim
16:41:52AlexMaxshashlick: https://paste.ee/p/8Zbcj#hFGcPBCkqTSpUrILScQaL2ZItVl2d5uy
16:42:10AlexMaxthis is what happens when I run `nimble build` with nothing installed
16:42:31AlexMaxI notice that there's no generation messages
16:42:38AlexMaxlike there was the other time
16:43:45shashlicknimble build doesn't do anything for nimgen wrappers
16:43:53shashlickit is nimble setup if you see the nimble file
16:44:06shashlickand it gets called as part of install
16:44:35AlexMaxI thought nimble build looks at your deps and installs them
16:46:46AlexMaxthe tesselator is just one of my dependencies
16:48:21AlexMax`nimble build` is just the command I'm using to build my project
16:49:49AlexMaxOkay, 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:45AlexMaxIt 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:23AlexMaxOkay, 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:43shashlickhmm - 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:05AlexMaxand if I answer yes, the build process blows away the working nimtess and replaces it with the bad one
16:52:12AlexMaxAm I making sense?
16:52:19AlexMaxI'm not doing anything fancy with my build system or anything.
16:54:54shashlickthat's weird
16:55:16shashlickcan you post the output of your `nimble build`?
16:57:11AlexMaxactually
16:57:12AlexMaxhere
16:57:21AlexMaxhttps://paste.ee/p/9KT1r
16:57:46AlexMaxThat is a 'minimal test' that I was able to figure out just now
16:58:09AlexMaxIf I run `nimble build` on that, I get the problem
16:59:16shashlickbasically `nimble build` doesn't call `before install` on dependencies
17:02:37AlexMaxShouldn't it?
17:02:47shashlick@AlexMax: yep, I reproduced it - if you do `nimble build`, it won't work since nimble skips calling `before install` on dependencies
17:02:58shashlickit's a bug in my mind - wonder what dom96 thinks
17:03:22AlexMaxAlright well, I need the peace out for now. Thanks for your time
17:03:43shashlickif you try `nimble install` instead, it works
17:03:50shashlickin your test project
17:05:52*stefanos82 quit (Quit: Quitting for now...)
17:07:19*Trustable quit (Remote host closed the connection)
17:07:50shashlick@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:25shashlick@AlexMax: https://github.com/nim-lang/nimble/issues/533
17:17:32FromGitter<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:22FromGitter<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:07FromGitter<kayabaNerve> @mratsim I have the Threadripper with 8 cores :P
17:55:58FromGitter<mratsim> The 16 seems like the best bang for buck, and ML workflows use everything anyway
17:56:37FromGitter<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:52shashlickhttps://duktape.org/ <= is a nim wrapper of interest?
18:47:08*xet7 joined #nim
18:48:22FromGitter<kayabaNerve> The JS engine? I want one.
18:49:15*Jesin joined #nim
18:49:38FromGitter<data-man> https://github.com/manguluka/duktape-nim
18:52:55*TheLemonMan joined #nim
18:55:31TheLemonManAraq, is it wrong to assume every nkFastAsgn can be safely replaced by a nkAsgn (but not vice-versa) ?
18:58:22FromGitter<Araq> probably not, people enjoy the `.shallow` pragma
19:00:20FromGitter<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:18TheLemonManyou mean NIM_STRLIT_FLAG ?
19:01:23FromGitter<Araq> yeah
19:02:40FromGitter<xmonader> ```code paste, see link``` ⏎ ⏎ So does it affect the return value too? [https://gitter.im/nim-lang/Nim?at=5b90285058a3797aa30a35ef]
19:02:47FromGitter<Araq> we better patch the GCs then to not free stringlits...
19:03:41TheLemonManprobably the GC is the only part of Nim I didn't touch (yet) heh
19:04:39TheLemonManwrt #8884 I also noticed that inline iterators always make a copy while closure ones use refs
19:05:04FromGitter<data-man> @TheLemonMan Try switch to stdlib ;)
19:05:29FromGitter<data-man> About touching :)
19:10:20*PMunch joined #nim
19:14:08shashlickdata-man: wow someone used nimgen to wrap duktape 😄
19:21:48PMunchHuh, a Javascript engine
19:23:03PMunchYou can even native callbacks
19:23:08PMunchThat's actually pretty cool
19:23:17PMunchNot sure what I'd use it for, but cool none the less
19:23:40PMunchCould probably be used for some kind of embedded scripting thingy
19:23:55PMunchCan Nimscript be used in that way?
19:24:15PMunchSet up some native callbacks and have Nim be able to run Nimscript files to interact with it
19:24:39FromGitter<rayman22201> https://github.com/Serenitor/embeddedNimScript
19:24:50FromGitter<rayman22201> though I don't know if it's been kept up to date
19:26:07PMunchWell it had a commit 3 days ago
19:26:17PMunchSo it can't be that out of date
19:26:28FromGitter<rayman22201> So apparently yes lol
19:26:37*cspar quit (Ping timeout: 246 seconds)
19:27:01FromGitter<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:37FromGitter<mratsim> Maybe this should be wrapped: https://github.com/intel/hyperscan
19:52:36*Jesin joined #nim
19:52:52FromGitter<kayabaNerve> github.com/intel
19:52:53FromGitter<kayabaNerve> Hiss
19:52:54FromGitter<Araq> @rayman22201 actually that project is pretty complete
19:53:46FromGitter<rayman22201> awesome
19:54:33FromGitter<rayman22201> this is the best way to be wrong :-P
20:08:55TheLemonManAraq, 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:37zachcarterhi all - I'm asking for tips / suggestions on how to improve the implementation of this macro I'm working on
20:20:00zachcarterI want a way to generate ES6 classes for the JS target
20:20:12zachcarterhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes
20:21:37zachcarterhttps://gist.github.com/zacharycarter/45bbdc24b345299014c587c0ad4a88d5
20:21:45zachcarteris what I have so far - is there a better way to do this?
20:22:15FromGitter<Araq> @TheLemonMan: It means patching jssys.nim too
20:22:45FromGitter<Araq> but it's covered by tests so ... fine with me
20:25:03FromGitter<Araq> @zacharycarter the approach seems ok
20:25:50zachcarterthank you Araq
20:27:28TheLemonManAraq, 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:10FromGitter<Araq> meh
20:32:18FromGitter<Araq> subtle difference and `asm` should become a pragma
20:44:35FromGitter<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:19FromGitter<Araq> you can if you don't use the '$' as a binary operator
20:47:27FromGitter<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:46FromGitter<Araq> that's gone in Nim devel
20:48:27FromGitter<xmonader> I'm using 0.18 hmm
20:49:26dom96Araq: Did you need me?
20:52:29*nsf quit (Quit: WeeChat 2.2)
21:16:13zachcarteris it posible to check if a parameter is of a certain type in a macro?
21:16:35zachcarterwhen 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:39zachcarterit's all just nnkIdent
21:18:35zachcarterI 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:30zachcarterhrm
21:32:34zachcarterthat is not working - nore is typeKind
21:34:09*PMunch quit (Remote host closed the connection)
21:36:52AlexMaxDon't Nim macros operate on the AST?
21:37:26AlexMaxIf so, maybe the compiler literally doesn't know what type an identifier is at that stage of compilation yet.
21:37:58AlexMaxI don't know, personally.
21:38:38zachcarteryeah - could be since the parameters are untyped
21:39:40*Vladar quit (Remote host closed the connection)
21:44:30zachcarterhttps://gist.github.com/zacharycarter/d97c703890f8abc0e21c6dfe6682f22d
21:44:35zachcarteris 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:37zachcarterit'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:58zachcartermore progress (defining corresponding Nim types now as well - https://gist.github.com/zacharycarter/ccdd4e5d868e9a9acce6e15390afed49)
23:52:05zachcarterhttps://gist.github.com/zacharycarter/ccdd4e5d868e9a9acce6e15390afed49
23:52:29*sagax joined #nim
23:52:37sagaxhi all!
23:52:45zachcarterbreak time
23:53:03sagaxin another language like as python we have % operator
23:53:29sagaxhow to get remainder of the division in nim?
23:58:07AlexMaxsagax: mod
23:58:25sagaxthanks