<< 24-05-2018 >>

00:00:25shashlickGuest599: Nim has yield and iterators
00:00:29shashlickhttps://nim-by-example.github.io/for_iterators/
00:09:28*foobarrel joined #nim
00:24:51*leaf__ joined #nim
00:25:13*leaf__ is now known as Guest85157
00:28:53FromGitter<kayabaNerve> Yo. How can I pow two uint64s? Fine with casting them but the only procs I see, even in the math lib, are for floats
00:29:09FromGitter<kayabaNerve> And I did verify they're both uint64s ;p
00:31:05FromGitter<kayabaNerve> NVM. TIL to used ^
00:31:11FromGitter<kayabaNerve> Like sane people do.
00:31:30*Guest85157 quit (Ping timeout: 260 seconds)
00:34:20FromGitter<kayabaNerve> Question. Since float is platform... whatever, that means the epochTime function will break in 15 years, right?
00:34:51FromGitter<kayabaNerve> *20
00:49:40*Sargun quit (Read error: Connection reset by peer)
00:51:20*Sargun joined #nim
01:05:10*smt quit (Ping timeout: 252 seconds)
01:06:30FromGitter<Quelklef> switching to a 64-bit int should circumvent that, right?
01:06:56FromGitter<Quelklef> I suppose existing code would break, but offering epochTime64 would solve it for future code
01:54:53FromGitter<Varriount> @Quelklef What are you discussing?
01:56:36FromGitter<Quelklef> I'm repling to @kayabaNerve
01:56:45FromGitter<Quelklef> and I've realized that it returns float, like he said, and I'm dumb (I'm tired)
02:03:50*CodeVance1 joined #nim
02:03:52*CodeVance1 quit (Client Quit)
02:05:46*CodeVance quit (Ping timeout: 264 seconds)
02:08:44FromGitter<kayabaNerve> @Quelklef It offers float32 on 32 bit platforms
02:09:11FromGitter<kayabaNerve> Decimal precision. I honestly think that's overkill but better to have it than not? (unless it takes away from whole number max length)
02:09:24FromGitter<kayabaNerve> @Varriount How in twenty years the epoch code will return 1970
02:09:27FromGitter<kayabaNerve> 32 bit int overflow
02:10:05*jsn- quit (Ping timeout: 240 seconds)
02:10:12*jsn- joined #nim
02:22:46*max3 quit (Quit: Connection closed for inactivity)
02:28:21*cavariux joined #nim
02:32:42*cavariux quit (Ping timeout: 245 seconds)
02:51:21FromGitter<Varriount> We aren't using 64 bit values?
03:07:38*endragor joined #nim
03:10:42*dddddd quit (Remote host closed the connection)
03:18:11*xkapastel quit (Quit: Connection closed for inactivity)
03:47:45*SenasOzys quit (Ping timeout: 248 seconds)
03:57:32*endragor quit (Remote host closed the connection)
03:59:53*endragor joined #nim
04:04:15*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
04:07:06*gangstacat quit (Quit: Ĝis!)
04:09:45*leorize quit (Ping timeout: 260 seconds)
04:15:10*gangstacat joined #nim
04:45:42*xkapastel joined #nim
05:05:15*endragor quit (Remote host closed the connection)
05:12:52shashlicklooks like streams.readStr is broken on devel
05:27:48*nsf joined #nim
05:30:46*endragor joined #nim
05:32:49*Tanger quit (Ping timeout: 248 seconds)
05:33:27FromGitter<Varriount> @dom96 Great work on the forum! It's amazing!
05:35:33*endragor quit (Ping timeout: 256 seconds)
05:36:43*Tanger joined #nim
05:55:15*endragor joined #nim
06:09:43*endragor quit (Remote host closed the connection)
06:11:46*leorize joined #nim
06:28:26*endragor joined #nim
06:35:18*endragor quit (Remote host closed the connection)
06:48:55FromGitter<kayabaNerve> @Varriount Not on 32 bit systms
06:48:58FromGitter<kayabaNerve> You use float32
06:50:12*gokr joined #nim
06:57:22FromGitter<Varriount> Who uses 32 bit systems these days though?
06:58:11*xkapastel quit (Quit: Connection closed for inactivity)
07:00:43*SenasOzys joined #nim
07:11:05yglukhovdom96: Forum navigation menu is missing. Will that be back?
07:17:13FromGitter<kayabaNerve> @Varriount I have seen stores using DOS still
07:17:25FromGitter<kayabaNerve> I know multiple family computers on XP
07:24:25*SenasOzys quit (Ping timeout: 245 seconds)
07:24:38livcddom96: you got reddit gold for your new forum :D
07:26:24*PMunch joined #nim
07:52:09*cavariux joined #nim
07:55:14FromGitter<alehander42> the forum is really nice now indeed @dom96 thank you
07:56:30*cavariux quit (Ping timeout: 245 seconds)
07:56:44FromGitter<gogolxdong> @Varriount what's your fix for cmp algorithm?
08:04:17*gmpreussner quit (Ping timeout: 252 seconds)
08:04:37PMunchI still think the search box is a bit too eye catching..
08:04:48PMunchBut other than that the new forum looks great
08:05:18*gmpreussner joined #nim
08:06:19FromGitter<Varriount> @gogolxdong I changed it to use the algorithm found in memfiles
08:11:20*couven92 joined #nim
08:16:56FromGitter<gogolxdong> where is it , we haven't updated cmp
08:26:23*Vladar joined #nim
08:28:33*sendell joined #nim
08:29:00*dddddd joined #nim
08:32:23*floppydh joined #nim
08:59:37*SenasOzys joined #nim
09:00:17FromGitter<mratsim> @kayabaNerve At one point technical debt need to be paid
09:00:32*CodeVance joined #nim
09:08:04*arecaceae quit (Ping timeout: 252 seconds)
09:08:31*gb00s quit (Ping timeout: 265 seconds)
09:08:41*Elronnd quit (Ping timeout: 276 seconds)
09:08:41*literal quit (Ping timeout: 276 seconds)
09:13:24*gb00s joined #nim
09:19:01*arecaceae joined #nim
09:19:10*Elronnd joined #nim
09:29:50*SenasOzys quit (Ping timeout: 245 seconds)
09:35:58*literal joined #nim
09:51:59*leorize quit (Quit: WeeChat 2.1)
10:05:15*CodeVance quit (Ping timeout: 245 seconds)
10:20:11*SenasOzys joined #nim
10:38:10*pwntus quit (Remote host closed the connection)
10:42:53*Shivelight joined #nim
10:45:46PMunch@dom96, is this supposed to look like this: https://i.imgur.com/uqHIvbw.png
10:47:44PMunchWould it also be possible to store how many pages I have loaded? It's super annoying having loaded lot's of pages, then click a topic, go back, and have to load all the pages again..
10:48:16PMunchAuto-loading when JS is enabled is of course also something that should be considered
10:48:31PMunchIt looks web 2.0, but feels a bit 1.1
10:48:50dom96PMunch: Yeah, that shouldn't happen
10:51:02dom96yeah, I can store that.
10:51:55PMunchTo be fair though, pagination might be a better choice
10:52:11PMunchFor example, with nojs do you ever unload topics?
10:52:30PMunchOr with it for that matter :P
10:53:05PMunchI remember some site, can't remember which one, which had infinite scrolling but never unloaded content. So it would get slower and slower the further you scrolled :P
10:53:19dom96I do
10:53:35PMunchEven with nojs?
10:54:45PMunchI still think the search box should at least be a bit darker though.. The way it is now is just distracting..
10:57:52dom96Everyone else seems happy with it though :(
10:58:32PMunchThe search box?
10:58:37dom96yeah
10:59:05PMunchOkay, let me create a topic on the new Nim forums and we can see :)
10:59:33PMunchOr is that a bit too off-topic..
11:01:04dom96Just reply to the thread I created
11:01:19PMunchHmm, it should say when composing a new topic what markdown is supported
11:01:35PMunchIt has message and preview, but no mention of what you can actually do :P
11:02:06dom96Yes, somebody else already mentioned this.
11:02:16*SenasOzys quit (Remote host closed the connection)
11:02:47*SenasOzys joined #nim
11:05:48PMunchHow do I do links?
11:06:05dom96`foo <link>`_
11:06:06dom96it's rst
11:06:42PMunchAh right
11:10:35*SenasOzys quit (Ping timeout: 240 seconds)
11:18:55*elrood joined #nim
11:20:43FromGitter<tim-st> anyone has an idea why my cmp proc is slower inside algorithm.sort than when using normal compares in a loop of nearly same amount? Both times in sort and loop comparison I used both my own and the system.cmp and for sort it's always 3.5 times slower and on loop it's always 1.1 times slower
11:24:42Araqindirect proc calls hurting the optimizer?
11:25:56FromGitter<tim-st> I called s.sort(cmp=cmp) and s.sort(cmp=myProc)
11:27:48AraqPMunch, seriously, what the heck is wrong with the search bar? it's hardly noticable to me
11:30:44PMunchIt's too contrasting
11:31:14PMunchIt was literally the first thing I noticed when I opened the forum (and no, I'm not using literally to mean figuratively here)
11:33:43PMunchAnd just imagine a dark theme with that bright-white search bar there, yuck!
11:34:48PMunchSpeaking of which, I updated my post here with a dark theme proposal: https://forum.nim-lang.org/t/3834#23936
11:41:06*SenasOzys joined #nim
11:41:26AraqPMunch, just create a PR then please
11:44:45PMunchHmm, then I have to set everything up so I can test it. That'll have to wait until I'm off from work at least..
11:45:36Araqand that is why depdendencies are so annoying, but yep, please help out
12:01:40*CodeVance joined #nim
12:08:08*pwntus joined #nim
12:11:01*sz0 quit (Quit: Connection closed for inactivity)
12:11:13*CodeVance quit (Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org)
12:13:57FromGitter<mratsim> @tim-st use a template and inject the comparison … procvar cannot be inlined.
12:14:32FromGitter<mratsim> similar to what `mapIt` does in `sequtils`
12:15:14FromGitter<tim-st> @mratsim very good to know, thank you 👍
12:19:02*noonien joined #nim
12:19:47FromGitter<tim-st> that makes me ask if the compiler couldnt do this automatically, or is it needed to write {.inline.}?
12:21:21*floppydh quit (Quit: WeeChat 2.1)
12:21:36FromGitter<tim-st> at least the slowdown factor is not too bad, just was interested
12:24:03FromGitter<mratsim> it won’t work, you can’t have higher order proc
12:24:37FromGitter<mratsim> basically to pass a proc as a param, you need to pass a pointer to the memory location of the proc.
12:25:00FromGitter<mratsim> and then when it’s called insie another proc, the code will jump at that location.
12:25:03FromGitter<tim-st> oh, ok, I thought calling s.sort(cmp=myProc) can be rewritten to s.sort() and then be edited on the source
12:25:17FromGitter<mratsim> you can’t have inline higher order proc*
12:26:39FromGitter<mratsim> there might be a way for the Nim compiler to inline automatically higher-order proc but since templates do that quite well I think that can wait.
12:26:59FromGitter<tim-st> ok, thanks
12:29:09*leorize joined #nim
12:31:05*Snircle joined #nim
12:33:22*Guest_ joined #nim
12:34:05Guest_Hello, is there a way to pause/yield from a function to resume it next call?
12:34:46FromGitter<mratsim> @Guest_ use a closure iterator
12:35:24FromGitter<tim-st> there is an additional way shown in `unicode.fastRuneAt`
12:35:59FromGitter<tim-st> (that's semantically the same as an iterator)
12:36:37FromGitter<mratsim> https://nim-by-example.github.io/for_iterators/ see here search for closure iterator
12:38:01FromGitter<tim-st> but this is one of the things I miss most in nim, because most people only ship an iterator and not an addtional template to achieving "pausing"
12:38:27*MonsterAbyss_ quit (Ping timeout: 240 seconds)
12:38:31Guest_Thanks, I didn't think I can use an iterator as a normal function, I was using a state machine to do this
12:38:39*floppydh joined #nim
12:39:06FromGitter<tim-st> I think that's always possible (but maybe I'm wrong)
12:39:20FromGitter<matrixbot> `ehmry` what is the `{.benign.}`macro for?
12:43:32FromGitter<mratsim> this reminds me of this comment in Nim JSON state machine, saying that it would be nice to have better coroutines: https://github.com/nim-lang/Nim/blob/master/lib/pure/json.nim#L475-L480
12:44:50FromGitter<mratsim> I suppose internally the closure iterators are implemented as a state machine but I could be wrong.
12:58:51Araqthey are.
12:59:30*athenot joined #nim
13:04:32*athenot quit (Ping timeout: 276 seconds)
13:05:47*athenot joined #nim
13:07:59Guest_I tried Closure Iterators and they seem to fit the bill but for some reason finished() detects finishing one call too late and it prints a 0 (or the value of the unassigned variable) before bailing out, is that intentional?
13:09:34Guest_wait let me confirm that
13:14:30Guest_nvm, it works fine, I need to use finished() after the call not before, it is an interesting way to do it and is a lot cleaner than adding states manually
13:17:52*couven92 quit (Quit: Client disconnecting)
13:30:50*Guest_ quit (Ping timeout: 260 seconds)
13:35:15*floppydh quit (Remote host closed the connection)
13:36:07*floppydh joined #nim
13:49:10*pwntus quit (Changing host)
13:49:10*pwntus joined #nim
13:50:14*smt joined #nim
13:59:30*CodeVance joined #nim
14:04:12FromGitter<7sDream> Any idea about this PR? https://github.com/nim-lang/Nim/pull/7869 ⏎ How can I make a template parameter don't be expanded temporarily?
14:06:25FromGitter<mratsim> If you find how, tell me =), I want that also for this: https://github.com/numforge/number-theory/blob/master/src/modular_arithmetic.nim#L128-L142 (I could use system.`+` on my case though so not as blocking as you)
14:13:34*gokr quit (Ping timeout: 264 seconds)
14:14:30*xkapastel joined #nim
14:17:15*yglukhov[i] joined #nim
14:20:09*CodeVance quit (Read error: Connection reset by peer)
14:20:42*CodeVance joined #nim
14:36:06PMunchdom96, any idea why c2nim complains about a missing ; on line 36, position 25 of this file: http://ix.io/1bhe/ ?
14:36:30dom96_XFUNCPROTOBEGIN
14:37:01PMunchUhm, what?
14:37:28dom96#def it
14:37:31dom96or #define it
14:37:57*floppydh quit (Quit: WeeChat 2.1)
14:41:22PMunchIt's been way too long since I've written header files..
14:42:49dom96So I'm thinking of submitting a Show HN: for NimForum
14:43:00dom96Any thoughts on what else I should write in the readme? https://github.com/nim-lang/nimforum#readme
14:44:57PMunchMaybe something about what is actually supported?
14:46:05dom96Okay, I'll add a "Features" section
14:46:56livcdbut you already missed the golden time!
14:47:19dom96heh
14:47:20dom96oh well
14:47:29dom96I'll give it a try anyway
14:48:44livcdi would upvote but i got banned recently
14:48:44*onionhammer quit (Read error: Connection reset by peer)
14:50:56*onionhammer joined #nim
14:51:23*yglukhov_ joined #nim
14:52:46*alpha1220 joined #nim
14:53:26dom96livcd: uhh ohh, why?
14:53:45*yglukhov[i] quit (Ping timeout: 260 seconds)
14:54:13alpha1220Araq: I see on github that the newruntime is marked for v1. Does that mean that it is going to be the default for v1? Yay if yes! :D
14:56:35*alpha1220 quit (Client Quit)
15:07:55dom96I added some features https://github.com/nim-lang/nimforum#features
15:15:15PMunchDoes anyone here know of a xtst binding in Nim?
15:17:13*endragor joined #nim
15:31:58dom96Okay, I submitted to HN
15:32:21PMunchLink?
15:32:50dom96Check /newest
15:33:29*gokr joined #nim
15:39:50dom96ooh 4 points
15:40:17*MyMind quit (Ping timeout: 248 seconds)
15:41:05*gokr quit (Ping timeout: 245 seconds)
15:41:32dom96PMunch: Btw you shouldn't need to click "load more" as much anymore
15:41:50dom96I fixed it so that it discards threads by banned users
15:41:55dom96We've already had some nice spam :D
15:42:40Yardanicodom96 I have an account on HN only for upvoting Nim posts (if someone posts a HN post related to Nim here), I don't read articles posted on HN at all :D
15:42:51YardanicoI mean I just don't use HN
15:42:58dom96You should probably use it a little
15:43:07dom96I bet there is an algorithm that checks for this
15:43:24dom96so upvote some other things too :)
15:44:46federico3lobste.rs sounds like an alternative
15:45:19Yardanicolobsters looks a bit nicer :)
15:45:30dom96sure, it's nice but it doesn't get anywhere as much traffic
15:46:50Yardanicowow https://forum.nim-lang.org/t/3849
15:47:10Yardanicothis man has a lot of dedication (he made 2 videos about his two nim libraries)
15:47:16FromDiscord<r00ster> the version after 0.19: will it be 1.0 or 0.20?
15:47:42dom96We don't know yet
15:47:55*athenot quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:48:11dom96Yardanico: Yeah, but he also says that Nim transpiles to C
15:48:32dom96But awesome videos anyway :)
15:48:46PMunchdom96, it doesn't auto-load for me :(
15:48:57dom96PMunch: What doesn't?
15:49:08PMunchThe forum posts
15:49:14PMunchOr was that only comments?
15:49:18dom96huh
15:49:32dom96I didn't change the load logic
15:49:39dom96I just ensured that more threads are loaded by default
15:50:30PMunchOh
15:52:43Yardanicodom96 another small bug - https://github.com/nim-lang/nimforum/issues/135 (small because you can just log out and reset your password)
15:52:56*dzho joined #nim
15:55:22dom96ahh, thanks for reporting
15:55:54*some-user joined #nim
15:56:04YardanicoIt should probably check - if user is logged in, don't check for captcha (but this may not be the right way)
15:57:06*endragor quit (Remote host closed the connection)
15:57:09*some-user left #nim (#nim)
15:57:12dom96Yes, there is code for this, but I didn't test it recently
15:57:24*mostly-harmless quit (Ping timeout: 260 seconds)
16:01:37*gokr joined #nim
16:02:07FromGitter<tim-st> @dom96 in `auth` there is `rand` call without calling `randomize` before, not had a deeper look at it, but could be a problem
16:02:33Yardanico@tim-st https://github.com/nim-lang/nimforum/search?q=randomize&unscoped_q=randomize
16:02:36*some-use` joined #nim
16:02:49Yardanicorandomize() doesn't need to be called by each module
16:02:55dom96yeah, the forum likely uses /dev/random anyway
16:02:59Yardanico(if you use default random state)
16:03:17Yardanicoit only needs to be called once anywhere in the program
16:03:19dom96I need to move this code into a separate package
16:04:27FromGitter<tim-st> Not sure, if it's good to call it only one time in the lifetime; I would think all other calls are linear based on the first randomization (but maybe I'm wrong)
16:05:14Yardanicoit uses xoroshiro128+ algo
16:05:43Yardanico(just fyi)
16:07:16FromGitter<tim-st> I dont think it's important which algo follows (unless it's real random which doesnt exist)
16:08:39*PMunch quit (Quit: Leaving)
16:09:31*jxy quit (Quit: leaving)
16:10:28FromGitter<mratsim> @dom96 I can’t find the nim post on HN
16:10:54Yardanicohttps://news.ycombinator.com/item?id=17144974
16:10:56dom96it's already gone off the first page of /newest
16:11:13dom96https://news.ycombinator.com/shownew
16:11:17FromGitter<mratsim> it’s not even in the first 180 items ...
16:11:43dom96I see it here https://news.ycombinator.com/newest?next=17145014&n=61
16:11:54dom96Is it invisible to you?
16:11:54FromGitter<tim-st> another problem: a hash which consists out of (salt, password) can and will generate duplicates for users having same password
16:12:12FromGitter<mratsim> salt is supposed to be random
16:12:17dom96no it won't, each user has a different salt
16:13:00FromGitter<tim-st> at least it's md5 :D
16:13:07dom96it's not...
16:13:09dom96it's bcrypt
16:14:13FromGitter<tim-st> `result = hash(getMD5(salt & getMD5(password)), bcryptSalt)`
16:16:14dom96hash == bcrypt.hash
16:16:24dom96the md5 is for backwards compatibility
16:16:43FromGitter<mratsim> md5 is incredibad ...
16:16:48*Trustable joined #nim
16:17:08FromGitter<mratsim> Google rainbow tables —> crack any md5 based password in a few seconds, max 1 day
16:17:25Yardanicobut hash == bcrypt.hash
16:17:43dom96Is HN shadow banning my posts? :(
16:20:21FromGitter<tim-st> is name == user_name on forum?
16:21:25Yardanicoafaik yes
16:21:37Yardanicoand yeah, actually I think it should be changed
16:21:43Yardanico(but it's not a high priority)
16:22:00Yardanicoso every user will have a login and display name - he can't change his login but can easily change his display name
16:22:21Yardanicoand all his posts will be stored under his login or id
16:22:29FromGitter<tim-st> what I saw: assumption: name can be chosen as a mail address and I chose your mail address as username; than the following hacks your account:
16:22:42FromGitter<tim-st> https://github.com/nim-lang/nimforum/blob/5f198a35db2b046550a0f47178cc006a1feb7a34/src/forum.nim#L91
16:23:11*Vladar quit (Remote host closed the connection)
16:23:37Yardanicolet me actually try that :D
16:23:39*Vladar joined #nim
16:23:39FromGitter<tim-st> well not hacks; but I can reset your password^^
16:23:48FromGitter<tim-st> you will get the mail always like I want^^
16:24:36Yardanico@tim-st no, you couldn't create an account with email in name
16:24:59YardanicoI just tried that :)
16:25:03FromGitter<tim-st> ok, luck^^
16:25:20FromGitter<tim-st> it's good that evera user has an own salt
16:25:25FromGitter<tim-st> *everay
16:26:34dom96lol
16:26:38dom96Nice try
16:27:18FromGitter<tim-st> I will have a deeper look into it maybe; then I will find a vuln
16:28:09YardanicoBut if you find a real one, please PM dom96 here or on gitter and don't write it in public :)
16:28:42FromGitter<tim-st> ok, you're right
16:29:09dom96Yeah, please.
16:29:12FromGitter<tim-st> I found a high prio one at google but they ignored
16:29:22dom96Interesting. The new forum's database is smaller than the old's
16:29:31dom96Probably because I removed a redundant field
16:30:34dom96I'm gonna email HN
16:33:10*jxy joined #nim
16:33:40FromGitter<mratsim> By the way, the world is in great need of a Disqus alternative: https://demo.graphcomment.com/en/graphcomment-demo/ I like GraphComment but an OpenSource one would be even better :)
16:37:58*some-use` quit (Ping timeout: 252 seconds)
16:39:53FromGitter<mratsim> @dom96 I missed it, it was just buried
16:40:11FromGitter<mratsim> went back in history and saw the post at position 49
16:40:15dom96It's still odd that it's not on /show
16:40:24dom96I emailed them to ask them why
16:49:41*athenot joined #nim
16:53:53*sendell quit (Remote host closed the connection)
16:54:57*gokr quit (Ping timeout: 248 seconds)
16:57:20*jxy quit (Quit: leaving)
16:57:53*jxy joined #nim
17:02:49FromGitter<krux02> hmm, what does that error mean: main.nim(961, 36) Error: cannot instantiate ArrayBufferView ⏎ got: <MyVertexType, Vec4f> ⏎ but expected: <S, T> ⏎ ⏎ ``` Error: Execution failed with exit code 1``` [https://gitter.im/nim-lang/Nim?at=5b06f039d96cfd743eba65ce]
17:06:09FromGitter<krux02> I am instanciating a generic type with types that I got with getTypeInstl
17:08:25*DarkArctic quit (Read error: Connection reset by peer)
17:09:49federico3and no '); DROP TABLES; on the live forum please :)
17:10:51Yardanicodom96 has backups for forum :)_
17:11:12federico3mratsim: like https://github.com/posativ/isso ?
17:12:21FromGitter<mratsim> not bad
17:12:31federico3not very good either
17:14:14*icebattle quit (Quit: leaving)
17:26:31*yglukhov_ quit (Read error: Connection reset by peer)
17:27:07*yglukhov[i] joined #nim
17:27:52FromGitter<7sDream> https://nim-lang.org/docs/asyncfutures.htmlhttps://nim-lang.org/docs/asyncstreams.html ⏎ ⏎ Why thoose module has no document online? [https://gitter.im/nim-lang/Nim?at=5b06f6183759c406277a1269]
17:29:01FromGitter<7sDream> https://i.loli.net/2018/05/25/5b06f64440038.png ⏎ there are links for them, but broken
17:30:51*icebattle joined #nim
17:31:09FromGitter<7sDream> so people can't find document of `Future` or `asyncCheck` etc
17:31:10FromGitter<krux02> I just created an issue with the bug
17:31:22FromGitter<krux02> it's sad that therer are just too many bugs
17:31:28FromGitter<7sDream> 👌
17:31:34*athenot_ joined #nim
17:31:56*athenot quit (Read error: Connection reset by peer)
17:32:56FromGitter<7sDream> However, still love Nim :P
17:33:29Yardanico@7sDream AFAIK this one is fixed in devel
17:33:33FromGitter<krux02> Nim is great no question. But these bugs :/
17:33:54Yardanicohttps://github.com/nim-lang/Nim/issues/7438
17:34:17shashlickfor https://github.com/nim-lang/Nim/issues/7874, isn't it sufficient to check whether a .nim file date is newer than the output .c file before recompiling?
17:34:32Yardanicoand fix https://github.com/nim-lang/Nim/pull/7445
17:34:39Yardanicoshashlick no
17:37:37Yardanicohow will nim get type info and other things from this file then (if nim compiler doesn't process it)?
17:38:41FromGitter<7sDream> So the online document can only be fixed when next version release?
17:39:26Yardanicoyes, because docs are only made for official releases
17:39:38Yardanicowell, you can create docs yourself
17:39:57YardanicoI mean generate them :)
17:40:25FromGitter<7sDream> OK
17:52:48*elrood quit (Quit: Leaving)
17:53:25*Trustable quit (Remote host closed the connection)
17:55:47FromDiscord<treeform> or just use the source code as docs 😃
18:00:04FromGitter<7sDream> yes, use VSCode jump to source code as doc
18:08:07shashlickYardanico: how about some details :P
18:09:21Yardanicoshashlick well, I'm not really into compiler stuff, you may ask Araq (IIRC he answered almost the same question like 4-7 months ago, but I can't find it)
18:09:39shashlickcool
18:10:31*gokr joined #nim
18:10:55shashlickmight be cool to have a daily nim build posted online along with documentation - do you think that might be useful?
18:11:01Yardanicoyeah, of course
18:11:11Yardanicothere used to be a build farm
18:15:00*NimBot joined #nim
18:27:59FromDiscord<daw> Hey, I'm trying to use nim to make a c library for the esp32 using the esp-idf skd
18:28:40FromDiscord<daw> I'v compiled my nim source code to c using this:
18:28:40FromDiscord<daw> ```
18:28:41FromDiscord<daw> nim c -c --gc:none --os:standalone --deadCodeElim:on --noMain --stackTrace:off --lineT
18:28:41FromDiscord<daw> race:off --profiler:off --app:staticlib --symbolFiles:off --noLinking greetings.nim
18:28:41FromDiscord<daw> ```
18:29:17FromDiscord<daw> I'v compiled my nim source code to c using this:
18:29:17FromDiscord<daw> ```
18:29:17FromDiscord<daw> nim c -c
18:29:18FromDiscord<daw> --gc:none
18:29:18FromDiscord<daw> --os:standalone
18:29:18FromDiscord<daw> --deadCodeElim:on
18:29:18FromDiscord<daw> --noMain
18:29:19FromDiscord<daw> --stackTrace:off
18:29:20FromDiscord<daw> --lineTrace:off
18:29:21FromDiscord<daw> --profiler:off
18:29:22Yardanicooh wow
18:29:23FromDiscord<daw> --app:staticlib
18:29:24FromDiscord<daw> --symbolFiles:off
18:29:25FromDiscord<daw> --noLinking
18:29:26FromDiscord<daw> greetings.nim
18:29:28FromDiscord<daw> ```
18:29:41dom96daw: You're spamming our IRC channel, please use gist or some other pastebin
18:29:48dom96(Discord is linked to our IRC)
18:29:58dom96Shouldn't FromDiscord handle this case?
18:30:05Yardanicowell, how?
18:30:11*Vladar quit (Ping timeout: 252 seconds)
18:30:20dom96Just like FromGitter ?
18:30:39Yardanicothen I would have to write FromDiscord myself (for now it uses another program as you know)
18:30:52*dawww joined #nim
18:30:55oprypinhow hard is discord api?
18:30:58FromDiscord<daw> ah, sorry did not realize that
18:31:07dom96daw: no worries, you couldn't have known
18:31:24dom96Yardanico: Why doesn't the program handle this?
18:31:27oprypinalso: why do you even bother with discord :o
18:31:35dom96It seems like the most fundamental feature of a relay
18:31:36Yardanicooprypin well, it seems that people use it :P
18:31:49oprypinso you just tell them to not use it, problem solved
18:32:03oprypindom96, but can you link to a discord message as easily as you can link to gitter?
18:32:20dom96Good question
18:32:26FromDiscord<daw> I'm now trying to include the generated c code into my program and compile it
18:32:27dom96Even if not, it shouldn't spam the channel
18:33:00FromDiscord<daw> but I can't find "nimbase.h"
18:33:16dom96daw: that should be in $nim/lib somewhere
18:33:28dom96Where $nim is where your Nim is installed
18:34:17FromDiscord<daw> if I do `which nim` it points to `.nimble/bin/. I've installed nim with `curl https://nim-lang.org/choosenim/init.sh -sSf | sh`
18:35:02dom96~/.choosenim/toolchains
18:35:05FromDiscord<daw> ohh I've found it it's inside `.choosenim`
18:35:14FromDiscord<daw> thanks
18:35:39Yardanicodom96 I can set "MessageDelay"
18:35:45Yardanico#Delay in milliseconds between each message send to the IRC server
18:36:53*dawww quit (Quit: Page closed)
18:37:20dom96That won't help
18:38:04shashlickdom96: there's some issue with streams.readStr() that breaks untar as well as the choosenim tester
18:38:21Yardanicowell how should it be fixed then? the only way I'm thinking of (which will work for all services) - create own program which will automatically create a paste for multi-line (e.g. for more than 3 lines) code embeds
18:38:27shashlicki'm not able to recreate a simpler test case for an issue but it works fine on 0.18.0, fails on #head
18:38:51dom96Yardanico: I suppose that's the only way
18:39:00dom96Really surprised that this relay bot doesn't have this
18:39:33dom96shashlick: Probably the breaking change that means accessing ""[0] now causes an exception
18:39:46FromDiscord<daw> Ok, now I'm getting `size of array 'Nim_and_C_compiler_disagree_on_target_architecture' is negative` which is the main question I wanted to ask. Which architectures does nim support and is it possible/is it hard to add one?
18:39:51shashlickdom96: https://pastebin.com/d2uUt8GA
18:40:27shashlickdaw: which version of nim did you download - 32 or 64-bit
18:41:33dom96daw: It's pretty simple https://github.com/nim-lang/Nim/blob/devel/compiler/platform.nim#L189
18:41:44dom96Check out the history of this file
18:41:53dom96You'll see how platforms were added
18:42:33dom96shashlick: Yes. That's it
18:42:40FromDiscord<daw> 64 bit but I'm trying to compile the generated c code with `xtensa-esp32-elf-gcc` which is for the xtensa architecture
18:43:19Yardanicodom96 well, I can't really find any discord-irc bridges supporting this. and also - it seems that you can actually use a webhook on discord side and "spoof" irc users (so they will be displayed as normal users in discord)
18:43:22dom96daw: the error you're getting suggests that Nim isn't calling `xtensa-esp32-elf-gcc`
18:43:29shashlickdom96: okay i'll push some PRs
18:43:53dom96daw: or that it's using your system's CPU
18:43:59FromDiscord<daw> Should nim call xtensa-esp32-elf-gcc when compiling its source code to c?
18:44:07dom96You need to specify one via --cpu
18:44:28dom96Nim calls a C compiler automatically
18:44:37dom96unless you're asking it only to translate to C
18:44:50Yardanicowell, I was a bit lying
18:45:15FromDiscord<daw> I'm only translating it to c, I believe, with `nim c -c`
18:45:39Yardanicothere's https://github.com/Headline/Discord-IRC-Relay but it's in C# and only uses 'hastebin' for code (or other) blocks
18:45:49dom96daw: then I guess you're missing a --cpu fla
18:45:51dom96*flag
18:46:25dom96daw: you can pick the closest in that list I linked you to
18:46:56dom96Yardanico: Time to write an awesome bridge in Nim :D
18:47:20Yardanicoand it will be async and all that :)
18:47:37Yardanico(well, I mean async is very good for this use-case)
18:48:31FromDiscord<daw> thanks @dom96, will try to find one
18:55:32shashlickhow do you do the inline if in nim
18:56:55Yardanicoshashlick inline if?
18:57:43shashlicka = if cond: "b" else "c"
18:59:40Yardanicoa = if cond: b else: c
19:00:51Yardanico!eval (let a = if someCond: "1" else: "2"); echo a
19:00:52NimBotCompile failed: in.nim(1, 13) Error: undeclared identifier: 'someCond'
19:00:58Yardanico!eval (let a = if true: "1" else: "2"); echo a
19:01:00NimBot1
19:01:21*rauss quit (Ping timeout: 252 seconds)
19:02:25*rauss joined #nim
19:11:06shashlickdom96: the ""[0] bug is here: https://github.com/nim-lang/Nim/blob/85b7d8fcc4032a0d95af3f25faf1cc850f7d59f5/lib/pure/streams.nim#L254
19:11:24shashlickbut it is to get to the address of the string, how do you fix this?
19:12:35dom96There was a recent thread about this https://forum.nim-lang.org/t/3806
19:14:33Yardanicodom96 probably related to https://github.com/nim-lang/Nim/issues/7860
19:15:05dom96So highlight shashlick instead of me :P
19:18:08*noonien quit (Quit: Connection closed for inactivity)
19:23:45*nsf quit (Quit: WeeChat 2.1)
19:28:41*Notkea quit (Remote host closed the connection)
19:28:56*Notkea joined #nim
19:33:43shashlickthose don't really help as far as a solution :(
19:33:58*oprypin is now known as Guest11714
19:33:58*Calinou is now known as Guest62898
19:33:58*SunDwarf is now known as Guest52326
19:34:05*Amun_Ra is now known as Guest42791
19:34:05*acidx is now known as Guest42814
19:34:07*pigmej is now known as Guest40451
19:34:07*awal is now known as Guest46886
19:34:08*mwbrown is now known as Guest79630
19:41:57*some-user joined #nim
19:42:16FromGitter<kayabaNerve> @mratsim You trying to say they stuck with the old tech, they deserve the errors?
19:42:57FromGitter<kayabaNerve> And I use 32 char salts with multiround bcrypt.
19:43:20FromGitter<kayabaNerve> MD5 is weak. Should solely be used for file integrity or checking for reposts, if anything.
19:43:36*Vladar joined #nim
19:44:01FromGitter<mratsim> It’s not a question of deserving or not. It’s about architecture and decisions.
19:44:47FromGitter<mratsim> Examples: banks have choosen to stay with COBOL and AS400. Instead of jumping to new tech. Great!
19:45:34FromGitter<mratsim> Now AS400 specialist are nowhere to be found and they charge a lot
19:45:47FromGitter<mratsim> specialists*
19:46:06FromGitter<mratsim> updating anything takes 2 years (if it’s ever approved)
19:46:18FromGitter<mratsim> workforce turnover is very high
19:47:33FromGitter<mratsim> You choose new tech, say Nim. Well you have to deal with the bugs, the documentation, the fact that talent is also very rare.
19:47:45FromGitter<mratsim> or you choose Go :P
19:47:56FromGitter<mratsim> (or Javascript, Java, PHP …)
19:48:15FromGitter<mratsim> Facebook is still paying the PHP debt for example
19:49:29*CodeVance quit (Read error: Connection reset by peer)
19:49:44FromGitter<mratsim> It probably made sense back when they started instead of riding the jquery bandwagon. I really like this article about innovation and choosing what you might want shiny and what you might want boring - http://mcfunley.com/choose-boring-technology
19:50:03*copygirl quit (Quit: copygirl)
19:50:04*Vladar quit (Quit: Leaving)
19:50:09*koppeh joined #nim
19:51:14FromGitter<kayabaNerve> I vote we switch the epoch time to 33 bits
19:51:14FromGitter<kayabaNerve> ez
19:51:28FromGitter<kayabaNerve> def not requiring a new language type and heavy bitwise ops
19:51:33*CodeVance joined #nim
19:55:33Yardanicolol https://github.com/nim-lang/Nim/wiki/Feature-suggestions/_compare/7e9e01f%5E...7e9e01f :)
19:57:56FromGitter<mratsim> When to release 1.0 is a great example of technical debt that Nim will have to pay btw @kayabaNerve.
19:58:35YardanicoI'll always be on the "devel" side :)
19:59:09FromGitter<kayabaNerve> Do I have debt to pay for all the questions I ask? :thinking:
19:59:19FromGitter<kayabaNerve> IRC and Gitter don't support that. Dammit.
19:59:32FromGitter<mratsim> :thinking_face:
19:59:34FromGitter<kayabaNerve> I was hoping Gitter would.
19:59:44FromGitter<kayabaNerve> Nada
20:00:00FromGitter<mratsim> some textmoji are converted though :/
20:00:47Yardanico🤔
20:10:12FromGitter<mratsim> hah! The force is strong with this one
20:14:24*Guest42814 is now known as acidx
20:18:24*nsf joined #nim
20:20:41*gokr quit (Ping timeout: 256 seconds)
20:25:22*athenot_ quit (Read error: Connection reset by peer)
20:26:10*athenot joined #nim
20:27:23*Guest62898 quit (Quit: http://quassel-irc.org - Discuter simplement. Partout.)
20:29:00*CodeVance2 joined #nim
20:29:17*CodeVance quit (Read error: Connection reset by peer)
20:29:30*sz0 joined #nim
20:29:47*Calinou joined #nim
20:29:55*CodeVance2 quit (Read error: Connection reset by peer)
20:29:56*CodeVance joined #nim
20:32:24*CodeVance quit (Read error: Connection reset by peer)
20:33:07*CodeVance joined #nim
20:35:16*yglukhov[i] quit (Read error: Connection reset by peer)
20:35:50*yglukhov[i] joined #nim
20:36:55*CodeVance quit (Read error: Connection reset by peer)
20:37:23*CodeVance joined #nim
20:38:37*CodeVance2 joined #nim
20:39:37*CodeVance3 joined #nim
20:40:36*CodeVance4 joined #nim
20:40:41*CodeVance quit (Read error: Connection reset by peer)
20:41:55*CodeVance joined #nim
20:42:05*Guest42791 is now known as Amun_Ra
20:42:23*CodeVance3 quit (Read error: Connection reset by peer)
20:42:47*CodeVance3 joined #nim
20:42:49*CodeVance4 quit (Read error: Connection reset by peer)
20:42:57*CodeVance2 quit (Ping timeout: 264 seconds)
20:46:25*CodeVance quit (Ping timeout: 248 seconds)
20:47:55*CodeVance3 quit (Read error: Connection reset by peer)
20:48:38*CodeVance joined #nim
20:51:48*CodeVance2 joined #nim
20:52:03*CodeVance quit (Read error: Connection reset by peer)
20:53:21*CodeVance3 joined #nim
20:54:54*CodeVance2 quit (Read error: Connection reset by peer)
21:05:49*endragor joined #nim
21:09:25FromDiscord<daw> dom96: I did it, thanks again for the help. Will maybe write a blog post about it 😃
21:10:00FromDiscord<daw> In the end I've chosen i386 as the arch since it's the closest one to xtensa-esp32-edf
21:10:30*nsf quit (Quit: WeeChat 2.1)
21:10:40*endragor quit (Ping timeout: 260 seconds)
21:12:56*daw_ joined #nim
21:13:01Araqhow does Nim's .travis file work?
21:13:09*daw_ quit (Client Quit)
21:13:19Araqwhy does it use clang on Linux?
21:16:47*CodeVance joined #nim
21:17:35*CodeVance3 quit (Ping timeout: 240 seconds)
21:26:27*Notkea quit (Remote host closed the connection)
21:26:49*Notkea joined #nim
21:29:58YardanicoAraq wait what?
21:30:30Araqsed -i -e 's,cc = gcc,cc = clang,' config/nim.cfg
21:30:39AraqI probably misread this line :P
21:36:53federico3a macro to set a field by name on an arbitrary object?
21:47:34FromGitter<Vindaar> @federico3: something like this https://gist.github.com/Vindaar/dba0158d0b1b52caa0704b0de1e43eb9 ?
21:48:00shashlickdom96: https://github.com/dom96/untar/pull/3
21:48:00federico3Vindaar: looks like - thanks
21:54:23federico3Vindaar: yet, can the field name be a variable?
21:54:43federico3probably not - it has to be known at compile time
21:55:10FromGitter<Vindaar> yep, exactly
21:56:48FromGitter<data-man> @shashlick: Thanks! I'm surprised that a file size is octal based. :)
22:00:11shashlick:D
22:03:35*koppeh is now known as copygirl
22:03:42FromGitter<kayabaNerve> Binary = 1 bit ⏎ Octal = 1 bytes ⏎ Hexadecimal = 2 bytes ⏎ Base58 = human usable compression ⏎ Base64 = barely human usable compression ... [https://gitter.im/nim-lang/Nim?at=5b0736be2942532e42dd04a7]
22:04:49FromGitter<kayabaNerve> Sumerians and Babylonians? They were smart. Base 60
22:09:14FromGitter<data-man> @kayabaNerve: The tar format was invented by octopuses, long ago.
22:14:22FromGitter<kayabaNerve> What about Turoctocrabs though
22:14:28FromGitter<kayabaNerve> https://i.imgur.com/v5Rs5Ma.jpg
22:15:17shashlickdom96: https://github.com/dom96/choosenim/pull/62
22:20:37FromGitter<data-man> @dom96: I think that to have only 'likes' on the forum is not entirely correct. We also need 'dislikes', as on GitHub.
22:26:39FromGitter<Varriount> Pmunch: Tumblr does that
22:29:38FromGitter<Varriount> @dom96 Is the new forum running behind nginx ?
22:31:56shashlickneed help fixing streams.nim - how do you change the addr(result[r]) call without having to resort to concatenation? https://github.com/nim-lang/Nim/blob/4ed24aa3eb78ba4ff55aac3008ec3c2427776e50/lib/pure/streams.nim#L110
22:35:06*anon667 joined #nim
22:35:36*smt` joined #nim
22:37:00anon667Hi, was wondering if anybody has a step by step guide on installing Nim + VS Code + MingW on a Win10 machine that works from the get go?
22:37:45*smt quit (Ping timeout: 245 seconds)
22:38:53*anon667 quit (Client Quit)
22:39:22shashlickanon667: do you want 32-bit or 64-bit
22:39:30*smt joined #nim
22:40:36*smt` quit (Ping timeout: 252 seconds)
22:47:20FromGitter<Varriount> shashlick: Why do you want to change the implementation? Safety?
22:47:49shashlickvarriount: doesn't work anymore with latest devel
22:48:03shashlickyou cannot do addr(string[0]) if string = ""
22:48:49FromGitter<Varriount> shashlick: But that procedure calls `result = newString(bufferSize)`
22:49:11*smt quit (Read error: Connection reset by peer)
22:49:22FromGitter<Varriount> Since bufferSize is 1000, the string doesn't equal `""`
22:49:32*smt joined #nim
22:50:39FromGitter<Varriount> Though, it could theoretically be made more safe (and just as efficient) by creating a set of procedures that leverage toOpenArray
22:51:47*xet7 quit (Quit: Leaving)
22:56:27*CodeVance quit (Read error: Connection reset by peer)
22:56:36shashlickokay, maybe i don't need any fixes in streams, just choosenim tester
23:01:33FromGitter<data-man> @shashlick: Check with this, please: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b07444c60209a1187e03c59]
23:03:34shashlickthanks data-man
23:03:39shashlicki'm struggling to repro though
23:03:50*xkapastel quit (Quit: Connection closed for inactivity)
23:03:56shashlickwhen i try to untar without readStr() fixes, it crashes for me on #head
23:04:58shashlickhttps://pastebin.com/cRwjCAu8
23:05:10shashlickbut if I just try reading a file stream with readStr, it works just fine
23:05:41shashlickI just change `addr(string(result)[0])` => `cstring(result)`
23:05:52shashlickto get it to work with untar
23:06:11shashlicki don't have a consistent way of crashing streams besides untar at this point
23:06:29shashlickso not sure if readAll() needs a fix, but it seems like it might
23:08:04FromGitter<data-man> It seems that readAll is not tested in the tests to read a files.
23:09:46shashlickline 99 fails in untar: https://github.com/dom96/untar/blob/a5a16aac6cb40249deaf2d5cb43d4b3ac18f81f2/src/untar.nim#L99
23:10:34shashlickrather it is the caller for readStr() which fails as in the paste
23:10:47FromGitter<kayabaNerve> VS Code + Mingw?
23:10:48FromGitter<kayabaNerve> What
23:13:58shashlickdata-man: I could change readAll() with just `addr(result[r])` => `cast[pointer](cast[int](result.cstring)+r)`
23:14:09shashlickugly as hell but hmm
23:19:13FromGitter<kayabaNerve> shashclick: why do you hate society
23:25:22FromGitter<data-man> @shashlick: So, don't use readStr. Use readData.
23:27:17FromGitter<data-man> And add TTarHeader type.
23:27:35shashlickI want to understand why it is crashing in the first place
23:31:12FromGitter<data-man> Just place ```echo``` in the right places. :)
23:35:41*some-user quit (Ping timeout: 276 seconds)
23:46:21*gokr joined #nim