<< 02-02-2018 >>

00:49:43*endragor joined #nim
00:49:59*couven92 joined #nim
00:54:23*endragor quit (Ping timeout: 276 seconds)
01:22:26*couven92 quit (Quit: Client Disconnecting)
01:26:48*jxv quit (Quit: string on the can snapped off)
01:28:17*icebattle quit (Quit: leaving)
01:54:55GitDisc<treeform> hey shashlick I have responded to your email.
01:55:04GitDisc<treeform> about the nimgen stuff
01:56:08*MJCaley joined #nim
01:57:02GitDisc<treeform> I feel like steamsdk was made for VC++ first, and only made work with GCC...
02:06:22*MJCaley quit (Quit: MJCaley)
02:11:37shashlickNeat will check in an hour
02:21:38GitDisc<treeform> thanks!
02:21:52GitDisc<treeform> I am making progress wrapping it manually method by method, but its slow going
02:22:49*S1t1Schu joined #nim
02:26:12*S1tiSchu quit (Ping timeout: 252 seconds)
02:29:17*chemist69 quit (Ping timeout: 276 seconds)
02:33:08GitDisc<treeform> man how do I make a `const char*` in nim cstring is just `char*`
02:43:15*chemist69 joined #nim
02:44:03shashlick@treeform - hold off for 30 minutes, i'll give it a try
02:44:11shashlickdo you have gcc or vc++?
02:52:37GitDisc<treeform> Its using clang on mac.
02:52:56GitDisc<treeform> I think clang is more like gcc then vc++.
02:55:11skrylarit is
02:55:17skrylarclang implements some gccisms as well
03:08:54skrylarclang gives you more helpful warnings/error messages and seems to build faster, although gcc supposedly gives marginally better performance
03:09:32skrylaralthough objective-c in clang doesn't let you rename the base classes like gcc does >:|
03:12:15*endragor joined #nim
03:12:22GitDisc<treeform> i am confused but this `const char*` stuff
03:12:28GitDisc<treeform> i tried this:
03:12:45GitDisc<treeform> `s = SteamFriends().GetFriendPersonaName(steamId)`
03:12:52GitDisc<treeform> but this worked:
03:12:55GitDisc<treeform> `{.emit: [s, "= (char *)SteamFriends()->GetFriendPersonaName(", steamId, ");"].}`
03:14:01*endragor quit (Remote host closed the connection)
03:14:29*endragor joined #nim
03:21:29skrylarNim doesn't do consts :\
03:22:00skrylaryou can probably do a custom type defined as 'ptr cchar' and use importc to make it a const char* if you need to
03:22:22skrylar(you cana lso use compiler flags to shut up that particular typecasting error, but well)
03:22:29skrylari should say 'warning'
03:48:24*radagast quit (Ping timeout: 246 seconds)
03:57:21GitDisc<treeform> how can I use importc to define cchar?
03:58:06*dddddd quit (Read error: Connection reset by peer)
04:42:17skrylartype foo = ptr cchar {.importc: "const char*".}
04:42:29skrylarthe importc may come before the = though
04:55:04FromGitter<Varriount> Why the pointer?
04:56:39skrylarey's trying to do something with an existing library that is apparently being picky about cstring types and their constness
05:16:13*mcc quit (Quit: Connection closed for inactivity)
05:30:31*tinAndi joined #nim
05:31:09*nsf joined #nim
05:35:40*tinAndi quit (Ping timeout: 240 seconds)
05:55:15skrylarwell thats.. new.
05:55:24skrylarapparently Red is reorienting themselves for the blockchain craze
06:29:10FromGitter<honewatson> Gitter is actually opensource. Maybe that should be the forum software on the Nim Lang forum sub domain
06:29:23FromGitter<honewatson> It seems to be popular
06:30:36FromGitter<honewatson> I think Red has been too late to jump on the blockchain craze.
06:37:40*solitudesf joined #nim
07:30:10*brainacid joined #nim
07:30:27brainacidAraq: U online?
07:35:49*PMunch joined #nim
07:36:43*brainacid quit (Quit: leaving)
07:45:59*endragor quit (Remote host closed the connection)
07:56:19*endragor joined #nim
08:15:41FromGitter<gogolxdong> How to make a set of string type?
08:16:57PMunchWhich kind of set?
08:17:27FromGitter<gogolxdong> set[string]
08:17:28PMunchNim has both a built in set type and a sets module
08:18:08PMunchI'm not sure if you can create sets of non-ordinal values
08:18:32PMunchhttps://nim-by-example.github.io/bitsets/
08:18:39PMunchAccording to this it's only for ordinal types
08:19:31*Arrrr joined #nim
08:21:35FromGitter<gogolxdong> Yes , I'm aware of that , I think it could be possible after Araq work out no GC string and seq.
08:21:48FromGitter<gogolxdong> Basically it says no ?
08:22:09PMunchOh yeah, that has nothing to do with it
08:22:17PMunchThese sets are implemented as bit-sets
08:22:29PMunchSo it's flipping bits to keep track of values
08:22:57PMunchSo only ordinal types with high(T) < 2¹⁶
08:24:05PMunchSo if you want to have a set of uint8 then you have 256 different values and need 256 bits to store them
08:24:42PMunchWith unbounded string you have infinite amount of possible combinations, thus they can't be stored like this
08:25:07PMunchBut you can still use the "sets" module :)
08:26:10FromGitter<gogolxdong> I see . Thank you .
08:26:22PMunchOf course if you have a subset of valid strings you could enumerate them and use a regular set
08:45:54*yglukhov joined #nim
09:03:33*gmpreussner quit (Ping timeout: 268 seconds)
09:05:33*gmpreussner joined #nim
09:32:30*floppydh joined #nim
09:43:02*Trustable joined #nim
09:51:08*xkapastel quit (Quit: Connection closed for inactivity)
10:01:13*PMunch quit (Quit: Leaving)
10:05:37*yglukhov quit (Ping timeout: 256 seconds)
10:06:30*xet7 quit (Ping timeout: 260 seconds)
10:08:17FromGitter<gogolxdong> How to retrieve the response value of an asyncHttp request?
10:08:39*endragor quit (Remote host closed the connection)
10:16:14*yglukhov joined #nim
10:19:16*xet7 joined #nim
10:31:38*dddddd joined #nim
10:37:41*clyybber joined #nim
10:54:57FromGitter<gogolxdong> Should I use `proc read*T (future: Future[T] | FutureVar[T]): T`
10:57:53*radagast joined #nim
11:05:34*tinAndi joined #nim
11:05:57Araqgogolxdong: you 'await' it
11:11:30*tinAndi quit (Ping timeout: 265 seconds)
11:12:29FromGitter<gogolxdong> great
11:15:37FromGitter<gogolxdong> I am waiting in the restaurant where we ate dinner for your last night in China.😀
11:17:00AraqI'm in a train.
11:23:14ArrrrHave you been in china? wow, nim is going to places.
11:24:25Araqyes.
11:34:38*vlad1777d joined #nim
11:40:24*Yardanico joined #nim
11:44:11*MJCaley joined #nim
11:44:14*sendell joined #nim
11:44:33*vlad1777d quit (Ping timeout: 248 seconds)
11:51:04*arecaceae quit (Remote host closed the connection)
11:51:21*arecaceae joined #nim
11:54:20*MJCaley quit (Quit: MJCaley)
12:04:01*Snircle joined #nim
12:09:07*endragor joined #nim
12:13:26*endragor quit (Ping timeout: 256 seconds)
12:17:46*xet7 quit (Quit: Leaving)
12:18:12*xet7 joined #nim
12:27:23*Vladar joined #nim
12:35:24Arrrr{.inject.} sometimes doesn't inject
12:42:04*yglukhov quit ()
12:42:28*clyybber quit (Quit: good night)
12:46:29Arrrrujj, it was another thing.
12:57:24*yglukhov joined #nim
13:03:10*yglukhov quit (Remote host closed the connection)
13:03:46*yglukhov joined #nim
13:06:23FromGitter<survivorm> @PMunch - here?
13:08:10*yglukhov quit (Ping timeout: 240 seconds)
13:18:47*yglukhov joined #nim
13:23:39FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a74665a36de78850ce0db51]
13:27:05*yglukhov quit (Remote host closed the connection)
13:27:42*yglukhov joined #nim
13:32:09*yglukhov quit (Ping timeout: 264 seconds)
13:34:38*Trustable quit (Remote host closed the connection)
13:34:42*kier quit (Read error: Connection reset by peer)
13:35:22*kier joined #nim
13:51:46FromGitter<gogolxdong> There is something wrong with this snippet.
13:55:18*arnetheduck joined #nim
14:06:04*Vladar quit (Quit: Leaving)
14:16:33*Arrrr quit (Ping timeout: 264 seconds)
14:45:10*miran_ quit (Quit: Page closed)
14:50:08*xkapastel joined #nim
14:53:59*yglukhov joined #nim
14:58:44*yglukhov quit (Ping timeout: 276 seconds)
15:01:22FromGitter<Quelklef> Yeah, there's a space before the `=`. Gross.
15:05:27FromGitter<tim-st> I hope I havent asked this before, but is there something like a rule when to use `{.inline.}` for procs?
15:05:58FromGitter<tim-st> Or are there other downsides than growing binary size
15:06:38*sendell quit (Remote host closed the connection)
15:08:50*floppydh quit (Quit: WeeChat 2.0.1)
15:09:21*endragor joined #nim
15:10:55*xet7 quit (Ping timeout: 248 seconds)
15:11:09FromGitter<tim-st> Ok, I read that `{.inline.}` isnt really necessary to write, compiler can find out often
15:13:27*endragor quit (Ping timeout: 240 seconds)
15:21:53FromGitter<Quelklef> To answer your question, I can't really imagine there are
15:24:15FromGitter<tim-st> Ok, thanks. I thought about it and I understand that inlining will give performance boost, but it must have real downsides, otherwise everything would be inlined
15:25:15FromGitter<tim-st> And if my binary size grows from 10 to 20mb is that bad?
15:25:23FromGitter<krux02> @tim-st well to know the sweet sport when to use inline or not, you need to price a function call and the extra memory that inlining costs
15:25:35FromGitter<krux02> but you can't inline dynamic function calls
15:25:51FromGitter<tim-st> ah, that make sense, thanks!
15:26:18FromGitter<krux02> with *dynamic* I mean *virtual* or with dynamic dispatch
15:26:57FromGitter<krux02> I would say, all functions that you can implement with 10 ASM instructions should be inlined
15:27:01FromGitter<andreaferretti> or recursive procs for that matter
15:27:07*xet7 joined #nim
15:27:22FromGitter<krux02> but the compiler can do that decision for you as well, so ...
15:27:28FromGitter<tim-st> But a compiler can determine both, so is it best when I ignore the pragma?
15:27:36FromGitter<krux02> yea recursion is hard to inline
15:27:49FromGitter<krux02> but not entirely impossible
15:28:12FromGitter<krux02> recursion can partially inlined. It is like loop unrolling.
15:28:36FromGitter<krux02> BTW loop unrolling is also one of these compiler optimizations.
15:29:10FromGitter<tim-st> ok, thanks, I will just ignore this pragma for now
15:29:17FromGitter<krux02> if your loops have a small but constant iteration count. The compiler can replace the loop by repeating the body of the loop
15:29:45FromGitter<tim-st> I thought about this yesterday^^
15:30:19*skelett joined #nim
15:30:20FromGitter<krux02> the prevents the conditional jumps in the code and those are not as cheap as you might expect
15:30:31FromGitter<krux02> just ignore inline
15:30:38FromGitter<tim-st> ok, thanks!
15:30:41FromGitter<krux02> but best is inline in C
15:31:02FromGitter<krux02> the C programming language had inline as a feature, but you had to declare inline manually
15:31:19FromGitter<krux02> then compilers became smarter and said, yea just omit the inline we do know better
15:31:56FromGitter<krux02> than programmers said, but we really really want this to be inline, und no don't omit this, I know what I am doing and then `__inline__` came.
15:32:07FromGitter<tim-st> I just wasnt sure, because it is often used in nim stdlib code, also if the proc is a one liner
15:32:42*yglukhov joined #nim
15:33:03FromGitter<krux02> yea most of the time when I write inline, it is just a rough guess, "hmm, ... year this could be inline, ..." not really testing anything for performance. I just assume it is faster
15:33:16FromGitter<tim-st> ok
15:33:48FromGitter<krux02> you can safely ignore inline and live a very happy and fulfilling life and nothing will burn.
15:33:54FromGitter<tim-st> I hope the compiler determines the best, I'm writing a parser for big files
15:34:10FromGitter<krux02> well the compiler is mostly just a C compiler
15:34:17*yglukhov quit (Remote host closed the connection)
15:34:33FromGitter<krux02> and that C compiler is doing the inlining since I don't know C is from 1972
15:34:35FromGitter<tim-st> yes, I meant gcc
15:34:53*yglukhov joined #nim
15:36:24FromGitter<tim-st> btw did I got it correctly that nim will use another compiler by default soon?
15:36:27FromGitter<tim-st> not gcc?
15:36:39FromGitter<krux02> well, not that I know of
15:37:05FromGitter<krux02> you can change gcc to the microsoft compiler form visual studio if you are on windows and want that
15:37:06FromGitter<tim-st> but didnt you said because of exceptions there is a change or something?
15:37:13FromGitter<krux02> and you can change it to clang afaik
15:37:21FromGitter<tim-st> I dont want to change
15:37:23FromGitter<krux02> well I didn't say that
15:37:29FromGitter<krux02> But I am not an oracle
15:37:36FromGitter<krux02> I don't develop nim
15:37:38FromGitter<krux02> I just use it
15:37:53subsetparkSo my compilation pipeline has started failing with this error message : ` # define N_NIMCALL(rettype, name) rettype name /* no modifier */`
15:38:34subsetparkwhat's up with that?
15:38:38FromGitter<krux02> that is not an error message it is just a line of code
15:38:54subsetparkwell ok
15:39:08subsetparkthe message is just ` error: command 'gcc' failed with exit status 1` which is not terribly informative
15:39:18*yglukhov quit (Ping timeout: 252 seconds)
15:39:33FromGitter<krux02> can you give a bit more context, because yes it is not very informative
15:39:56*BitPuffin joined #nim
15:39:59FromGitter<krux02> you could upload your shell on ix.io
15:40:05subsetparksure... i have a Python module that takes C source output by nim and compiles to a C extension
15:41:04FromGitter<krux02> with "C extension" you mean "Python extension written in C"?
15:42:43FromGitter<krux02> well when in your pipeline you compile something with `nim c` and you get "command 'gcc' failed" then it means nim has either generated illegal C code (a bug in Nim, not uncommon) or there is a bug in gcc not supporting the C language properly (very uncommon).
15:43:47subsetparkHere's the full output - https://ghostbin.com/paste/tu6qg
15:44:19FromGitter<krux02> so what I would do now: extract the nim code that generates the illegal C. Strip it from everything unnecessary, and then from what is left make a bug report.
15:45:44FromGitter<krux02> well there is something horribly wring. I need to know the nim file that you try to compile.
15:46:28subsetparkI would, except this is a large project that hasn't substantially changed, so I don't really have the time/means to isolate whatever piece of Nim code is now failing on #head
15:46:40*solitudesf quit (Ping timeout: 240 seconds)
15:47:37subsetparkIt still compiles on stable, luckily
15:47:42*yglukhov joined #nim
15:47:53FromGitter<krux02> I feel very sorry for you, but I can't help you when I can't reproduce it and I don't see the source that produced that error
15:48:15FromGitter<krux02> git bisect?
15:48:27FromGitter<krux02> bisect the compiler?
15:49:07subsetparkha, maybe tomorrow...
15:49:24subsetparkAraq: let me know if the generated C in that paste look like anything in particular to you
15:49:44FromGitter<krux02> you can show the generated C as well
15:52:24FromGitter<krux02> have you looked at the generated C code?
15:53:05*yglukhov quit (Remote host closed the connection)
15:53:21*natrys joined #nim
15:54:02Araqsubsetpark: install your Nim as we tell you to.
15:54:14Araqyou have an outdated nimbase.h that lacks N_LIB_PRIVATE
15:54:30Araqwhich was recently added
15:54:45subsetparkYes, you're right
15:55:09subsetparkIt's not that my nim is installed funny, it's that I am forced to vendor nimbase.h into the nim src directory :)
15:55:54*yglukhov joined #nim
15:59:25*fvs joined #nim
16:00:19*yglukhov quit (Remote host closed the connection)
16:03:44*arnetheduck quit (Ping timeout: 276 seconds)
16:25:31FromGitter<Varriount> Thou shalt install Nim using the Correct method. :P
16:34:02*miran joined #nim
16:51:40radagastWhy aren't enums {.pure.} by default?
16:53:00Araqcause full qualification is stupid
16:53:35Araqignores basic rules of linguistics.
16:53:46Araqcontext is everything.
16:55:01*Jesin joined #nim
16:57:19radagastUhm, I have a enum type in my heap library: max, min. If a user imports the library Max and Min is available. In my opinion it's not a good idea since other libraries can have this enum too.
16:58:49skrylarboop
17:00:07Araqactually I unified enums with .pure enums
17:00:33Araqbut need to finish this feature and patch the docs
17:03:10Araqbtw IMO min and max are bad names, pickMin, pickMax or byMax, byMin would probably convey the meaning better
17:03:38*tinAndi joined #nim
17:05:31radagastmin and max on themselves bad, but HeapKind.min/max are okay, I guess minHeap/ maxHeap works too.
17:07:43AraqHeapKind.min ... maybe. anyway, go ahead and use a .pure enum
17:15:31*nsf quit (Quit: WeeChat 2.0.1)
17:26:14*yardanico[m] joined #nim
17:26:47*Yardanico quit (Quit: Leaving)
17:27:37*yardanico[m] is now known as Yardanico
17:37:05*tinAndi quit (Ping timeout: 248 seconds)
17:37:42*Jesin quit (Quit: Leaving)
17:52:33shashlickbeen using c2nim last day after a while, in --cpp mode, it doesn't process any implementation, just converts vars, procs, etc.
17:52:43shashlickis this how it's always been?
17:53:56*d10n-work joined #nim
17:54:34Yardanicoshashlick: it's mainly meant for porting headers
17:54:35*trip_1 joined #nim
17:55:34shashlickthat's what I want too but it's different than in c mode where code gets converted
17:55:38*tinAndi joined #nim
17:55:42shashlickjust curious if this is working as expected
17:55:57shashlickam submitting a bunch of issues
17:56:05*trip_1 left #nim ("Leaving")
17:56:15shashlickbeen running c2nim/nimgen through the streamworks api for treeform
17:59:37*miran quit (Quit: Konversation terminated!)
18:00:48shashlick5 new c2nim issues, someone isn't going to like me
18:01:22*tinAndi quit (Ping timeout: 256 seconds)
18:12:27*S1t1Schu quit (Quit: Leaving)
18:14:58*kunev quit (Ping timeout: 256 seconds)
18:15:24*solitudesf joined #nim
18:16:02*kunev joined #nim
18:18:29*xkapastel quit (Quit: Connection closed for inactivity)
18:41:26*fvs left #nim ("ERC (IRC client for Emacs 25.3.1)")
18:42:10FromGitter<mratsim> Are there Nim people at FOSDEM beer (with internet access?)
18:43:54*radagast quit (Ping timeout: 265 seconds)
18:50:00*natrys quit (Quit: natrys)
19:09:57*endragor joined #nim
19:13:21shashlickhow do you forward declare an object without redefinition?
19:14:27*endragor quit (Ping timeout: 240 seconds)
19:20:00*Jesin joined #nim
19:20:11*Jesin quit (Remote host closed the connection)
19:22:42GitDisc<treeform> just don't add = at the end?
19:25:39*nsf joined #nim
19:40:51*couven92 joined #nim
20:26:04*icebattle joined #nim
20:29:42*icebattle quit (Client Quit)
20:30:04*icebattle joined #nim
20:30:35*BitPuffin quit (Remote host closed the connection)
20:31:16*icebattle quit (Client Quit)
20:34:20*icebattle joined #nim
20:36:08*icebattle quit (Client Quit)
20:36:30*icebattle joined #nim
20:37:49*BitPuffin joined #nim
20:54:38*rockcavera quit (Remote host closed the connection)
20:58:26skrylarmin and max aren't bad names per se but it gets in to some weird context problems
20:59:13skrylarI'm not fully decided on whether context-free or contextualized is a good idea. Mostly the benefit to no-context grammar is toolking, ex. really easy to have emacs look up the name under point to go find a wiki page, context requires special nimsuggest/omnibrowser type things
20:59:45skrylarbut sayings omething like "width: max" makes a lot more sense than "someItemWidthSetting: widthMaximum"
21:02:17*nsf quit (Quit: WeeChat 2.0.1)
21:04:41*xet7 quit (Ping timeout: 276 seconds)
21:10:40*ofelas quit (Ping timeout: 240 seconds)
21:19:41*xet7 joined #nim
21:42:12*couven92 quit (Quit: Client Disconnecting)
21:57:43*BitPuffin quit (Remote host closed the connection)
22:09:48*endragor joined #nim
22:14:44*endragor quit (Ping timeout: 268 seconds)
22:22:26*ofelas joined #nim
22:40:57FromGitter<dom96> @mratsim we were there for a while
22:41:01FromGitter<dom96> I was wearing a Nim shirt
22:44:20*solitudesf quit (Ping timeout: 268 seconds)
22:50:53*vlad1777d joined #nim
23:03:11FromGitter<mratsim> Going back to the hotel @dom96 see you tomorrow
23:29:22*peppe__ joined #nim
23:29:24*radagast joined #nim
23:38:19*peppe__ quit (Ping timeout: 260 seconds)