<< 25-01-2017 >>

00:05:59*xet7 joined #nim
00:24:04*gokr quit (Ping timeout: 256 seconds)
00:30:38*def-pri-pub joined #nim
00:36:49*def-pri-pub quit (Ping timeout: 240 seconds)
00:38:39*yglukhov joined #nim
00:38:56*def-pri-pub joined #nim
00:43:20*yglukhov quit (Ping timeout: 256 seconds)
00:49:41*dyson joined #nim
00:50:05*dyson is now known as Guest99171
00:50:08*Trioxin quit (Ping timeout: 256 seconds)
01:00:01*Matthias247 quit (Read error: Connection reset by peer)
01:03:55*def-pri-pub quit (Ping timeout: 255 seconds)
01:05:35*def-pri-pub joined #nim
01:05:35*def-pri-pub quit (Changing host)
01:05:35*def-pri-pub joined #nim
01:09:14*Trioxin joined #nim
01:09:40*Guest99171 quit (Ping timeout: 258 seconds)
01:33:27*def-pri-pub quit (Ping timeout: 252 seconds)
01:35:16*def-pri-pub joined #nim
01:35:16*def-pri-pub quit (Changing host)
01:35:16*def-pri-pub joined #nim
01:39:49*sz0 quit (Quit: Connection closed for inactivity)
01:41:31*Jesin quit (Read error: Connection reset by peer)
01:54:48*pregressive joined #nim
01:54:54*pregressive quit (Remote host closed the connection)
01:55:08*pregressive joined #nim
02:04:06*devted joined #nim
02:11:18*sz0 joined #nim
02:23:51*chemist69 quit (Ping timeout: 276 seconds)
02:30:00*devted quit (Quit: Sleeping.)
02:32:43*devted joined #nim
02:37:23*chemist69 joined #nim
02:38:43*synshroud quit (Quit: ZNC 1.6.4 - http://znc.in)
02:40:34*synshroud joined #nim
02:40:47*yglukhov joined #nim
02:45:10*yglukhov quit (Ping timeout: 256 seconds)
02:54:36*Trioxin quit (Ping timeout: 240 seconds)
02:57:30*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
03:11:07*Trioxin joined #nim
03:18:30*Kingsquee joined #nim
03:19:37*devted quit (Quit: Sleeping.)
03:38:42*brson quit (Quit: leaving)
03:41:36FromGitter<barcharcraz> is there a way to overload based on the value of a compile time string
03:42:01FromGitter<barcharcraz> so like proc(x : "yolo") ⏎ and proc(x: "lol")
03:45:56FromGitter<barcharcraz> ah I can do it with when
03:46:09FromGitter<barcharcraz> and {.fatal.}
03:46:10FromGitter<barcharcraz> cool
03:46:30FromGitter<barcharcraz> ah metaprogramming in nim is so simple
03:58:17*vasher_ quit (Quit: Connection closed for inactivity)
04:05:03subsetparkElementary question: the basic concept of the {.async.} pragma and `await` calls is, you enter the polling loop with runForever, and then every await call automatically yields to a giant list of futures somewhere, which resumes execution at the first future with a returned value?
04:11:06*ftsf_ quit (Ping timeout: 255 seconds)
04:11:32*ftsf_ joined #nim
04:14:26*kulelu88 quit (Quit: Leaving)
04:38:06*ftsf_ quit (Ping timeout: 255 seconds)
04:38:24*ftsf_ joined #nim
04:42:21*chemist69 quit (Ping timeout: 245 seconds)
04:44:25*yglukhov joined #nim
04:48:41*yglukhov quit (Ping timeout: 240 seconds)
05:03:18*Trioxin quit (Ping timeout: 255 seconds)
05:03:27*dyson joined #nim
05:03:50*dyson is now known as Guest8182
05:09:36*chemist69 joined #nim
05:40:17*def-pri-pub quit (Quit: leaving)
05:42:35Araqsubsetpark: I think you can put it this way
05:56:20*aedigix quit (Remote host closed the connection)
05:56:46*aedigix joined #nim
05:57:59*chemist69 quit (Ping timeout: 255 seconds)
05:58:24*chemist69 joined #nim
05:59:40*aedigix quit (Remote host closed the connection)
06:00:06*aedigix joined #nim
06:27:55*nsf joined #nim
06:38:23*fifr left #nim ("WeeChat 1.6")
06:45:44*yglukhov joined #nim
06:50:24*yglukhov quit (Ping timeout: 255 seconds)
07:00:48*ftsf_ quit (Remote host closed the connection)
07:14:26FromGitter<Varriount> Subsetpark: that's the current model in a nutshell, yes
07:20:16*Guest8182 quit (Ping timeout: 245 seconds)
07:20:27*filcuc joined #nim
07:22:17cheatfatesubsetpark, is question is elementary, why you are asking it?
07:30:06*hcorion quit (Quit: Konversation terminated!)
07:46:32*gokr joined #nim
07:56:10FromGitter<gokr> @Varriount Nope
07:57:48FromGitter<gokr> @Araq Hehe (reference to Smalltalk)
08:09:22*rokups joined #nim
08:09:28*Guest89004 joined #nim
08:11:31*Andris_zbx joined #nim
08:58:44*Kingsquee quit (Read error: Connection reset by peer)
08:59:03*Kingsquee joined #nim
09:08:05*bjz joined #nim
09:14:04*yglukhov joined #nim
09:14:19*yglukhov quit (Read error: Connection reset by peer)
09:15:23*Matthias247 joined #nim
09:15:30*yglukhov joined #nim
09:15:38*yglukhov quit (Remote host closed the connection)
09:15:53*yglukhov joined #nim
09:18:45*byte512 joined #nim
09:28:18*yglukhov quit (Remote host closed the connection)
09:31:54*couven92 joined #nim
09:35:45*pregress_ joined #nim
09:37:11*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
09:37:36*pregressive quit (Ping timeout: 260 seconds)
09:42:00*yglukhov joined #nim
09:48:14*PMunch joined #nim
09:48:46*PMunch quit (Client Quit)
09:48:55*PMunch joined #nim
09:51:45*yglukhov quit (Remote host closed the connection)
10:04:37*mjanssen_ quit (Quit: Lost terminal)
10:11:34*mjanssen joined #nim
10:21:37*bjz joined #nim
10:41:04*yglukhov joined #nim
10:43:53*yglukhov quit (Remote host closed the connection)
10:50:34*yglukhov joined #nim
10:52:07*strikr joined #nim
11:00:20rokupsAraq: if i add a simplest proc that returns nil to arch.nim (which is imported by gc.nim and friends) compilation fails with "Error: system module needs 'copyString'". Any way around that? I am trying here to get rid of that coroutine asm stuff.
11:01:05Araqwhen hacking system.nim the error messages can be unhelpful but the compiler is always right
11:01:49*yglukhov quit (Remote host closed the connection)
11:01:56Araqyou cannot use strings at the point as the codegen doesn't know yet how to translate strings
11:04:31*strikr quit (Ping timeout: 260 seconds)
11:05:00rokupsAraq: well yes, thing is this error caused by simplest proc a(): discard
11:05:45rokupsthat as you can see does not contain any strings. thats why its confusing
11:06:12Araqproc a(): discard is not even valid syntax
11:08:36rokupsAraq: yeah forgot =, but that is not the problem here. it happens with "proc a() = discard". any ideas?
11:13:31Araqwrap it in .push stackTrace:off .pop
11:26:10*yglukhov joined #nim
11:27:22*yglukhov quit (Remote host closed the connection)
11:27:32rokupsthank you
11:30:32*filcuc quit (Ping timeout: 255 seconds)
11:33:02*yglukhov joined #nim
11:36:49*Snircle joined #nim
11:37:44*yglukhov quit (Ping timeout: 255 seconds)
11:38:12*hendi joined #nim
11:44:28*hendi quit (Quit: hendi)
11:44:33*hendi joined #nim
11:58:05*yglukhov joined #nim
11:58:17*woona joined #nim
11:59:06*hendi quit (Ping timeout: 240 seconds)
12:00:29*yglukhov quit (Remote host closed the connection)
12:01:13*yglukhov joined #nim
12:06:51*woona left #nim ("Leaving")
12:07:31*yglukhov quit (Remote host closed the connection)
12:08:33*felic joined #nim
12:09:31*felic left #nim (#nim)
12:12:15*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
12:13:16*yglukhov joined #nim
12:13:45*yglukhov quit (Remote host closed the connection)
12:15:01*yglukhov joined #nim
12:16:40*yglukhov quit (Remote host closed the connection)
12:16:52*yglukhov joined #nim
12:25:13*yglukhov quit (Remote host closed the connection)
12:25:49*yglukhov joined #nim
12:26:49*byte512 quit (Ping timeout: 240 seconds)
12:29:50*yglukhov quit (Ping timeout: 240 seconds)
12:38:28subsetparkcheatfate: just making sure I understood!
12:50:05*ehmry joined #nim
12:50:06*yglukhov joined #nim
12:54:24*Vladar joined #nim
12:55:45*hendi joined #nim
13:01:33*yglukhov quit (Remote host closed the connection)
13:02:06*vlad1777d joined #nim
13:02:28*hendi quit (Quit: hendi)
13:04:28*yglukhov joined #nim
13:07:45*yglukhov quit (Remote host closed the connection)
13:08:18*yglukhov joined #nim
13:12:30*yglukhov quit (Ping timeout: 240 seconds)
13:20:50*yglukhov joined #nim
13:28:34*krux02 joined #nim
13:31:00*Guest8182 joined #nim
13:53:38*djellemah quit (Remote host closed the connection)
13:59:00*nsf quit (Quit: WeeChat 1.7)
14:05:50*yglukhov quit (Remote host closed the connection)
14:06:25*yglukhov joined #nim
14:10:49*yglukhov quit (Ping timeout: 240 seconds)
14:14:59FromGitter<endragor> @cheatfate why does one have to call unregister() on AsyncEvent given that there cannot be more than 1 callback at a time and if you `return true` from the callback, it gets unregistered; couldn't the event be unregistered, too, in such case?
14:18:30cheatfateendragor: sorry could not understand you
14:20:48*pregress_ quit (Remote host closed the connection)
14:21:16*pregressive joined #nim
14:23:09FromGitter<endragor> the flow for working with AsyncEvent, as I understand, is: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ so 1) naming-wise it's not very obvious that `unregister` matches `addEvent` 2) it's not clear why the user has to call unregister() - instead, the event could be unregistered automatically when the callback returns `true` [https://gitter.im/nim-lang/Nim?at=5888b4cbe836bf70108d81d8]
14:24:50*pregressive quit (Read error: Connection reset by peer)
14:25:18vlad1777dIs somewhere any documentation, how to use custom scanner\parser with Nim ?
14:25:20*pregressive joined #nim
14:25:40*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
14:28:59FromGitter<cheatfate> sometimes you make decision to not receive any more events not in event callback... so then you call unregister()
14:31:49*pregressive quit (Ping timeout: 256 seconds)
14:33:00rokupswell this is odd. when i try to compile on windows with --cc:vcc i get this: "Requested command not found: 'vccexe.exe /c --platform:
14:33:26FromGitter<endragor> @cheatfate ok. and if I create the event in one thread, pass it to another, then call addEvent/unregister/close from there - should it work fine?
14:33:29Araqrokups: koch tools to produce the vccexe tool
14:35:12rokupstrying, thank you
14:35:48cheatfateendragor: yep must work
14:37:21Araqvlad1777d: how could we document a "custom" parser? isn't that a contradiction in itself
14:39:37vlad1777dAraq, I mean instruction: how to connect them to Nim
14:40:31Araqwell the FFI is extensively documented, but not parser specific (why would it)
14:42:18vlad1777dAraq, I don't know what is FFI, could you give some links to manuals\readme ?
14:43:12vlad1777d(I read only Tutorial part 1 and 2, Manual, standard library reference, Nim by example)
14:44:58FromGitter<endragor> @cheatfate Could you please check why this fails? https://gist.github.com/endragor/e7a4d167264651e9ba543a1a71a1e28e It ends up throwing "Too many open files" error, even though the flow seems to be correct.
14:46:43FromGitter<endragor> (tested on macOS only)
14:48:55Araqvlad1777d: FFI is the "foreign function interface"
14:49:16AraqI don't understand your question. what's a "custom" parser for you?
14:51:51vlad1777dAraq, I mean parser, which from sources builds abstract syntax tree. I would try to learn their structure\building. They told us basics in University, but I would like to know it wider.
14:52:35FromGitter<dom96> @endragor what are you using AsyncEvents for?
14:54:23FromGitter<dom96> For example, can't you simply use channels instead?
14:54:27Araqvlad1777d: read Nim's stdlib. it's full of parsers. parsexml, json. or compiler/lexer.nim and compiler/parser.nim
14:55:10FromGitter<endragor> @dom96 no, channels are blocking. I need to use both channels and asyncdispatch's poll() loop. So the threads hang in the poll() loop and events are used to wake them up when something arrives to the channel
14:55:54vlad1777dAraq, ok, thanks
14:56:27FromGitter<dom96> @endragor they are not. Check
14:56:48FromGitter<dom96> My chat app example in book. Bbl
14:56:52FromGitter<endragor> @dom96 what I meant is that you can't do tryRecv() and poll() at the same time. poll blocks
14:58:57nivdom96: any plans/interest in making the streams module work with async?
15:03:08FromGitter<endragor> @dom96 the chat example, if I'm looking at the right one, is not multi-threaded. and I don't think there is an example that involves using threads that can do async IO and communicate with each other.
15:08:07euantorniv: It's planned as far as I know
15:08:19nivokay
15:08:25euantorIt's been talked about recently as being a task that needs doing
15:09:06nivthere's also a bug in the documentation/semantics of stream.readLine
15:09:26*devted joined #nim
15:17:32SentreenStupid question of the day: I'm looking at the hashes module, and I see that it has a hash proc for pointers (proc hash(x: pointer): Hash {..}), is there any way I can use this to hash a ref? Or do I have no choice but to hash whatever my ref points to?
15:18:17Sentreen(I'm not entirely sure about the "pointer" type and how much it differs from ptr)
15:20:07Araqcast[pointer](myref)
15:20:12Araqwatchpoint set expression --size 4096 -- 0x00000001001ec000
15:20:12Araqerror: invalid enumeration value, valid values are: "1", "2", "4", "8"
15:20:31Araqseriously ... how can anybody claim debuggers are useful with watchpoints?
15:20:37Araqthey are not.
15:21:56nivcompiler optimisation question: this gets optimised away, i think this is a bug? while "" == readLine(): discard; this works: while "" == readLine(): echo "skip"; discard
15:22:43SentreenOkay, thanks :)
15:23:15FromGitter<Varriount> Sentreen: As araq said, you can just cast the reference to a pointer. It might be a nice addition to the hashes module to add a generic ref version though, for simplicity's sake.
15:24:17FromGitter<Varriount> Though, then you might run into confusion, since it's the actual reference being hashed, not the content.
15:24:41SentreenIn this case I can be sure that there will only be one reference to that content, so it should not be a problem.
15:25:42Araqniv: optimized away? unlikely
15:25:52nivi have proof!
15:26:17Araqshow me.
15:26:20FromGitter<Varriount> Sentreen: *nudge* PR *nudge*
15:28:08Araqno PR please. 'ref object' is very common and nobody agrees with whether it has pointer or value semantics in general
15:28:18nivAraq: https://gist.github.com/niv/aee805ba5879e50e1b901aae55b46022
15:28:29nivjust flip the commented out line between the single read and the while loop
15:28:52nivyou can add something with side effects to the discard statement inside the while to make it work
15:29:05nivbut line() should already have a side effect that requires it to run, right?
15:30:47*djellemah joined #nim
15:31:24nivAraq: actually, nevermind. i made a oops. why do only ever notice these when being rubberducked?
15:31:31FromGitter<Varriount> Araq: Then a documentation note, perhaps
15:31:35FromGitter<Varriount> ?
15:32:04nivclearly i'm lacking coffee
15:34:23*rupil joined #nim
15:37:00Araqvarriount: ok
15:37:26Xeniv: get the IV coffee drip model
15:38:08*EastByte quit (Quit: WeeChat 1.6)
15:38:12nivXe: :D
15:39:28*EastByte joined #nim
15:39:37*strikr joined #nim
15:44:13FromGitter<Varriount> Araq: I was just thinking about a procedure like `proc hashT (r: ref T)`, that way it doesn't prevent more specific procedures from being created
15:45:02cheatfateendragor: your source works on freebsd
15:45:17cheatfateendragor: but for some reason fails on macos
15:46:52Araqvarriount: yes, but I don't like it. it's safer to not have a fallback for unclear semantics
15:48:13cheatfateendragor: i think main problem is that asyncdispatch do not have closeDispatcher() procedure because never suited for execution in multithreaded environment
15:48:26cheatfateso it not closing kqueue handles
15:48:48cheatfateand maybe macos has some kind of limit on kqueue handles
15:48:54cheatfatebecause freebsd dont have such limits
15:49:45*arnetheduck quit (Ping timeout: 258 seconds)
15:51:11*yeeve joined #nim
16:02:19*yglukhov joined #nim
16:02:58rokupsdid some work on coroutines: https://github.com/nim-lang/Nim/compare/devel...rokups:feature/coroutines?expand=1
16:03:35rokupsit should cover compilers better as its using inline asm for everything except vcc on x64, that one is handled by masm64. so no more external dependency on fasm
16:03:54rokupsthough i bet some other less used compilers will need some tuning to get working
16:07:41Araqrokups: wow this is cool :-)
16:08:00rokups\o/
16:08:22rokupswish gcc wasnt weird though. sometimes it seems to ignore naked attribute, other times not..
16:08:36rokupsand there is 4 year old bug requesting implementing naked on x86
16:09:55AraqI would prefer to not rely on jmp_buf for this feature but that's a minor nitpick
16:10:03cheatfaterokups, there is no ml64.exe
16:10:04*devted quit (Ping timeout: 258 seconds)
16:10:11cheatfatein my visual studio 2015
16:10:19cheatfatethere is only ml.exe
16:10:26FromGitter<endragor> @cheatfate so I think a recently added onThreadDestruction() feature could be used to fix that
16:10:37rokupshmm. there is ml64 in vs2010. this microsoft..
16:11:04cheatfateendragor: asyncdispatch needs to close(selector)
16:11:14Araqsome platforms xor the pointers in the jmp_buf for "security"
16:11:19Araqiirc
16:11:55Araqalso: what about ARM support? :-)
16:12:04rokupsyeah Araq but in this case it does not really matter as there is custom proc for getting registers for using in gc
16:12:29rokupsmaybe after compiler can bootstrap with -d:nimCoroutines we can think of arm? :p
16:12:31FromGitter<endragor> @cheatfate yeah so onThreadDestruction() would allow to set up the callback which does that when a thread exits
16:13:28rokupsAraq: is it possible that inline assembly on tcc is broken? because i get error like: stdlib_arch.c:47: error: '(' expected (got "{")
16:13:43cheatfateendragor: you don't need onThreadDestruction() because you can call `asyncdispatch.closeGlobalDispatcher()` at the end of thread
16:13:55*krux02 quit (Remote host closed the connection)
16:14:31*filcuc joined #nim
16:14:35cheatfateand i have not checked `onThreadDestruction()` yet, is it called in context of destructed thread?
16:14:38FromGitter<endragor> @cheatfate true but that's a bit more fragile because users will have to keep that in mind
16:14:46FromGitter<endragor> @cheatfate yes
16:16:58*strikr_ joined #nim
16:17:05Araqrokups: sure. also TinyC is not "officially supported" even though many claim it is
16:17:05cheatfateendragor: anyway developer needs to integrate this onThreadDestruction() by himself, so i think he can keep in mind to `closeGlobalDispatcher` at the life end of thread...
16:17:57rokupsAraq: so which compiles are officially supported? i would love to know which ones i can just ignore
16:18:01rokupsgcc/clang/vcc/icl?
16:18:05cheatfateendragor: imho, `onThreadDestruction()` is weird thing
16:18:09*strikr_ quit (Client Quit)
16:18:11cheatfateand not needed
16:19:00Araqrokups: clang on OSX, GCC on linux, mingw and vcc on Windows
16:19:31rokupsgreat. less things to worry about ^_^
16:19:39*strikr quit (Ping timeout: 258 seconds)
16:21:30FromGitter<endragor> @cheatfate the developer doesn't need to do that, it would be part of the library
16:21:57cheatfaterokups, is it possible not to use setjmp/longjmp on windows?
16:22:38rokupscheatfate: fiber api could be abused i guess, but why?
16:22:47GaveUpmust be a reason but I'm missing it ... why does something like echo case x: of 0: "0" compile fine, but wrapping the case in a template t(): typed = case ... cause a value must be discarded compile error?
16:22:55FromGitter<endragor> just at the top scope `onThreadDestruction do (): if not gDisp.isNil: gDisp.close()`
16:25:55cheatfateendragor: gDisp is not public
16:26:10FromGitter<endragor> @cheatfate yes, that code would be inside asyncdispatch
16:27:50*Guest89004 quit (Ping timeout: 240 seconds)
16:32:23*Guest8182 quit (Ping timeout: 240 seconds)
16:34:42AraqGaveUp: wrap the case in () in the template. sucks, I know
16:37:14*yglukhov quit (Remote host closed the connection)
16:37:20GaveUpcompiler quirk/bug?
16:39:29*Trustable joined #nim
16:40:45cheatfaterokups, because on windows when you use setjmp/longjmp binary will got one more dependency on msvcrt.dll
16:41:39AraqGaveUp: yes
16:42:58rokupscheatfate: so what? msvcrt.dll is present everywhere. those version-specific runtimes can be installed. and lastly nim probably statically links anyway because i do not see any other import than kernel32 ;)
16:43:44cheatfatemsvcrt.dll will not be present everywhere in the future...
16:44:11cheatfateand nim dont like statically
16:44:16cheatfatedont link statically
16:45:40*krux02 joined #nim
16:45:46*brson joined #nim
16:45:57*Jesin joined #nim
16:46:48FromGitter<andreaferretti> any nim library to deflate gz files?
16:48:15*PMunch quit (Quit: leaving)
16:49:24*yglukhov joined #nim
16:50:40GaveUphmmm parens didn't seem to have any effect
16:50:40*Andris_zbx quit (Read error: Connection reset by peer)
16:58:55rokupscheatfate: rest assured msvcrt is here for a loooooong stay... It was phased out with vc6. Its still there and windows components depend on it.
17:00:10rokupsnim itself imports bunch of c stuff and since dll aint in import table it sure must be static linking
17:02:42cheatfaterokups, we are going to remove all this c stuff from windows code
17:02:59cheatfateand we are moving in this direction slowly
17:03:15rokupshmm i see, thats cool
17:03:36rokupsno reason why setjmp/longjmp cant be bundled rly. it is already
17:04:11*yglukhov quit (Remote host closed the connection)
17:05:52cheatfaterokups, heh, if you can't do it why just not say, sorry but i can't do it
17:06:35*pregressive joined #nim
17:07:17*pregressive quit (Read error: Connection reset by peer)
17:07:38*pregressive joined #nim
17:14:14rokupswhat?
17:19:33*filcuc quit (Ping timeout: 276 seconds)
17:22:32FromGitter<zetashift> is there a reverse proc for Arrays?
17:23:42Vladarhttp://nim-lang.org/docs/algorithm.html#reverse,openArray[T],Natural,Natural
17:24:14FromGitter<zetashift> woop thanks!
17:24:25FromGitter<zetashift> looked at the wrong section in the docs area it seems
17:25:25cheatfaterokups, you wasted 1 hour of your and mine time on dispute about "is there reason on implementing setjmp/longjmp"... as i said there is a plans to remove msvcrt.dll dependency from nim, and we are implementing this plan.
17:27:20rokupsdidnt notice any dispute, thought you are just asking random questions. though you could have mentioned that plan from the start as i am not aware of whats going in development ¯\_(ツ)_/¯
17:29:14enthus1astnoob question, remove msvcrt.dll means implementing c library functions in nim?
17:29:55FromGitter<PabClsn_twitter> hi guys just a stupid question how do you do a cin like in C++ ?
17:30:04cheatfaterokups, i dont see any `random` questions from me, if you think i'm just throwing random questions, then maybe i need to stop talk with you..
17:30:16FromGitter<barcharcraz> @cheatfate msvcrt is NOT a system component. It's actually an internal dll that's not supposed to be used by non-system programs
17:30:31rokupsjesus cheatfate chill. whats wrong with you
17:30:36FromGitter<barcharcraz> you're supposed to use the versioned ones, but ofc they are all ABI incompatible and require various redists
17:31:04cheatfate@barcharcraz, its why we want to remove dependency from msvcrt.dll,
17:31:09FromGitter<barcharcraz> yeah
17:31:25FromGitter<barcharcraz> the new "universal runtime" is a system component tho
17:31:35FromGitter<barcharcraz> but still, no reason nim needs to depend on msvcrt
17:31:39FromGitter<barcharcraz> or any libc
17:33:13cheatfateenthus1ast, there not so many c library functions nim needs on windows... we need to replace FILE* functions and setjmp/longjmp
17:33:39FromGitter<barcharcraz> also note that you won't see C dll's in nim's import tables. Nim prefers to call dlopen and dlsym (LoadLibrary/whatever on windows) in NimMain
17:34:32FromGitter<PabClsn_twitter> hi guys just a stupid question how do you do a cin like in C++ with an int in user entry ??
17:34:47rokupsbarcharcraz check out setjmp/longjmp implementation in glibc. noone will be willing to maintain that in nim. windows case is easy enough betcause its just x86/64. but for linux and other platforms avoiding libc would not make much sense
17:34:51cheatfate@barcharcraz everything Nim imports via dlopen/dlsym is core windows dlls, like (kernel32.dll/advapi32.dll/user32.dll/ws2_32.dll)
17:35:34FromGitter<barcharcraz> yeah, I mean on linux libc is DEFINATELY a system component
17:36:46FromGitter<barcharcraz> @PabClsn_twitter readLine(stdin) followed by parseInt (from strutils)
17:37:21FromGitter<barcharcraz> so something like: ⏎ import strutils ⏎ var inp = readline(stdin) ⏎ var int = inp.parseInt [https://gitter.im/nim-lang/Nim?at=5888e250074f7be76318a726]
17:37:32FromGitter<PabClsn_twitter> ok men thanks :)
17:37:36FromGitter<barcharcraz> or just: ⏎ import strutils ⏎ var inp = stdin.readline.parseint()
17:37:38FromGitter<barcharcraz> or something like that
17:39:32FromGitter<PabClsn_twitter> ok i try thx
17:39:34*cheatfate_ joined #nim
17:42:34FromGitter<PabClsn_twitter> I tried all the things you just gave me plus var question = readLine(stdin) ⏎ ⏎ var nbEtages = parseint(question)
17:42:42FromGitter<PabClsn_twitter> and it’s not working ...
17:42:48*cheatfate quit (Ping timeout: 256 seconds)
17:43:28FromGitter<PabClsn_twitter> it compile but when i write 5 for example and press return northing append
17:43:41FromGitter<PabClsn_twitter> like he was waiting for an other thing
17:45:34FromGitter<barcharcraz> I just tried that and it worked
17:45:52FromGitter<PabClsn_twitter> send me your line please ;)
17:45:59FromGitter<barcharcraz> import strutils ⏎ ⏎ var str = readline(stdin) ⏎ var t = parseInt(str) ⏎ echo str ... [https://gitter.im/nim-lang/Nim?at=5888e455074f7be76318b3cf]
17:46:21FromGitter<PabClsn_twitter> ok thanks
17:47:08FromGitter<PabClsn_twitter> did you use like terminal or sublime text ?
17:47:16FromGitter<barcharcraz> I use vscode
17:47:25FromGitter<barcharcraz> I hear the sublime addon is good
17:47:42FromGitter<PabClsn_twitter> ok thats strange because i copy past your lines and nothing is happening
17:47:44FromGitter<barcharcraz> I wish code could highlight stuff like sql""" SELECT * FROM lol""" as SQL
17:48:08FromGitter<barcharcraz> are you in secret or something?
17:48:15FromGitter<PabClsn_twitter> secret what ?
17:48:19FromGitter<barcharcraz> never mind
17:48:29FromGitter<barcharcraz> (it's the nimvm rpel)
17:48:34FromGitter<barcharcraz> and it's not supported
17:48:54FromGitter<PabClsn_twitter> i’m just a noob i’m not understanding that ;)
17:49:00FromGitter<barcharcraz> don't worry about it
17:49:03*cheatfate joined #nim
17:49:04FromGitter<PabClsn_twitter> (https://files.gitter.im/nim-lang/Nim/zmTx/Capture-d__cran-2017-01-25-_-18.48.24.png)
17:49:22FromGitter<PabClsn_twitter> it’s like he was waiting something else
17:49:38enthus1ast@barcharcraz in sublime one could "Set syntax SQL" maybe vs code can do the same.
17:49:51*cheatfate_ quit (Ping timeout: 245 seconds)
17:50:18FromGitter<barcharcraz> right but I want just the sql part highlighted
17:50:26FromGitter<barcharcraz> for when I embed queries into my application
17:50:41FromGitter<barcharcraz> it's a minor gripe
17:51:10FromGitter<barcharcraz> idk looks like the problem is not in your int parsing code pablo
17:51:16*nsf joined #nim
17:51:51FromGitter<PabClsn_twitter> ok it’s sublime text
17:52:02FromGitter<PabClsn_twitter> i tried with a term and it’s working $
17:52:07FromGitter<barcharcraz> oh yeah
17:52:10FromGitter<barcharcraz> that could do it
17:53:11FromGitter<PabClsn_twitter> (https://files.gitter.im/nim-lang/Nim/HgW5/Capture-d__cran-2017-01-25-_-18.52.48.png)
17:53:15enthus1ast@barcharcraz switching back and forth sql and nim does the trick for me
17:53:39FromGitter<PabClsn_twitter> you know if there is a trick to making the user entry work in Sublime ?$
17:54:15FromGitter<barcharcraz> probably not, maybe a terminal plugin or something
17:54:17FromGitter<barcharcraz> idk
17:54:25*hcorion joined #nim
17:55:33FromGitter<PabClsn_twitter> and an other question is there a way to give the binary file parameters like in c with main(int arg, int **argv) ?
17:56:02FromGitter<barcharcraz> yes
17:56:27FromGitter<PabClsn_twitter> you know how ,
17:56:29FromGitter<PabClsn_twitter> ??
17:57:21FromGitter<Varriount> @PabClsn_twitter The sublime syntax language makes dynamic embedding of other syntaxes within another nearly impossible
17:57:54FromGitter<barcharcraz> @Varriount but I've never seen any other editors do it at all
17:58:18enthus1ast@PabClsn_twitter paramStr from os module
17:59:01FromGitter<barcharcraz> and paramCount
17:59:09FromGitter<Varriount> Do what at all?
17:59:17FromGitter<PabClsn_twitter> ok thanks :) @Varriount
17:59:27FromGitter<barcharcraz> highlight different languages in different parts of a file
18:01:43enthus1astby the way, i have strange issue with sublime plugin, it opens "thousands" of nimlime tabs, seen that before?
18:01:58FromGitter<PabClsn_twitter> nop never for me
18:02:28FromGitter<Varriount> Oh gosh, not again.
18:02:35FromGitter<barcharcraz> lol
18:02:39enthus1astmaybe its just me
18:02:42enthus1astor old version
18:03:00FromGitter<Varriount> I can never seem to reproduce that bug
18:03:04FromGitter<Varriount> Have you updated? What version are you using?
18:03:47enthus1ast 1.2.11
18:04:35enthus1astsublime tells me its the newest version
18:04:47FromGitter<Varriount> Also: http://forum.nim-lang.org/t/2733
18:05:05FromGitter<Varriount> @PabClsn_twitter What version are you using, and what operating system?
18:05:09*yglukhov joined #nim
18:05:14FromGitter<Varriount> enthus1ast: What OS are you using?
18:05:50enthus1astwin7 32bit
18:06:00FromGitter<PabClsn_twitter> how do i get the version in sublime i’m pretty new to this one
18:06:06FromGitter<PabClsn_twitter> and I’m on macOS
18:06:57Araqvarriount: how hard is it to get the plugin to work on OSX?
18:07:09FromGitter<PabClsn_twitter> when i update the Sublime package nothing is happening so i guess the last one :)
18:07:50FromGitter<Varriount> Araq: It's Python-based Sublime Text plugin, so it should be as easy as a regular plugin.
18:08:01FromGitter<Varriount> The only catch is when using Nimsuggest
18:08:03FromGitter<PabClsn_twitter> euh the plugins well i follow the tutorial but with macOS i made an alias in bash_profile or bashrc to lauch sublime with an option
18:08:08*krux02 quit (Remote host closed the connection)
18:08:25FromGitter<PabClsn_twitter> alias sub='open -a "/Applications/Sublime Text.app"
18:08:46FromGitter<Varriount> enthus1ast: Can you give me a gist of your PATH variable and the NimLime settings file?
18:08:53FromGitter<PabClsn_twitter> someone gave me this tip beacuse i had a permissions denied when run nim compiler
18:09:19FromGitter<PabClsn_twitter> whats nim suggest ?
18:09:23*yglukhov quit (Ping timeout: 240 seconds)
18:09:38FromGitter<PabClsn_twitter> just a help to code like other ide ?
18:09:44FromGitter<Varriount> Yes.
18:09:56dom96niv: planned but not in the short term.
18:10:06FromGitter<PabClsn_twitter> ah ok nice how do you install it with sublim ?
18:10:34FromGitter<Varriount> @PabClsn_twitter You won't want to. NimLime support is very experimental/unfinished.
18:10:49FromGitter<PabClsn_twitter> ah ok
18:11:08dom96endragor: https://github.com/dom96/nim-in-action-code/blob/master/Chapter3/ChatApp/src/client.nim#L42
18:11:18FromGitter<PabClsn_twitter> ah i didn’t check that you were the guy who did NimLime
18:11:30FromGitter<PabClsn_twitter> good job
18:11:58FromGitter<Varriount> @PabClsn_twitter Not a good enough job, unfortunately.
18:12:27FromGitter<Varriount> It needs another maintainer, as I won't have the time to develop for another year and a half.
18:12:43enthus1astVarriount https://gist.github.com/enthus1ast/0b29d54e7a6c6e7c50a3470ad45efde5
18:12:47FromGitter<PabClsn_twitter> no one can update your work ?
18:13:20FromGitter<barcharcraz> getting editor plugins to work well is actually really hard task
18:13:44FromGitter<Varriount> @PabClsn_twitter It's not that, no one has volunteered.
18:14:01enthus1astthe only thing i'm really useing is run/build ....
18:14:07FromGitter<PabClsn_twitter> to be honnest with you i can’t help you on this one ;)
18:16:28FromGitter<Varriount> enthus1ast: When do the tabs open? On save?
18:16:31FromGitter<PabClsn_twitter> there is nimEdit well it’s pretty ugly for now
18:16:48FromGitter<PabClsn_twitter> for now your plugin is the best i found
18:16:49FromGitter<Varriount> @PabClsn_twitter I like NimEdit, it's different.
18:17:17FromGitter<PabClsn_twitter> it’s very ugly and with macOS i have trouble running it well
18:17:25enthus1astwhen NimEdit got multiple cursor support i'll give it another try : )
18:19:11FromGitter<Varriount> (Psst, NimEdit is written by Araq)
18:19:52enthus1asthey Araq multiple cursors are cool : )
18:20:39enthus1astmhhh i've closed the thousand tabs now, but its not opening it again
18:21:12enthus1astif it does again i'll tell you what i have exactly done
18:21:15FromGitter<Varriount> enthus1ast: Does it open them all at once, or one at a time?
18:21:24enthus1astone at a time
18:21:55FromGitter<Varriount> enthus1ast: This is the most annoying thing. Plugins like this are very hard to unit test, and bug reports are mostly a guessing game.
18:22:07FromGitter<PabClsn_twitter> Thanks Araq for the good job for now :)
18:23:21GaveUpAraq: is there an issue logged for that template/case quirk?
18:24:38enthus1astVarriount, i still enoy useing it.
18:24:43enthus1astenjoy
18:25:05FromGitter<Varriount> enthus1ast: I'm glad somebody does. I just wish I had time to work on it.
18:28:11*enthus1ast is now known as enthus1ast|trave
18:40:33*couven92 quit (Quit: Client disconnecting)
18:45:27AraqGaveUp: no, report it please
18:46:14*hendi joined #nim
18:46:37Araqyes yes yes, once NimEdit compiles again (*cough* compiler API changes)
18:46:41AraqI shall open source it
18:46:55Araqit's MIT anyway, I can always sell it later :P
18:55:19*yglukhov joined #nim
18:57:10*hendi_ joined #nim
18:57:42*hendi quit (Ping timeout: 276 seconds)
18:59:30*yglukhov quit (Ping timeout: 240 seconds)
19:01:19*Kingsquee quit (Excess Flood)
19:01:40*yglukhov joined #nim
19:01:44*Kingsquee joined #nim
19:06:42*RushPL joined #nim
19:07:01*yglukhov quit (Remote host closed the connection)
19:16:16*couven92 joined #nim
19:17:10*hendi_ quit (Ping timeout: 240 seconds)
19:17:44*couven92 quit (Client Quit)
19:18:02*couven92 joined #nim
19:20:59*kulelu88 joined #nim
19:22:47*gmpreussner quit (Ping timeout: 248 seconds)
19:28:12*yglukhov joined #nim
19:28:40FromGitter<zacharycarter> @Araq I'm guessing creating the wrapper for Urho3d was not trivial? Do you think attempting to update the wrapper to the latest version of Urho3d is something that'd be worth trying to do?
19:28:48FromGitter<zacharycarter> If so I might try my hand at it
19:29:14Araqthe wrapper has been updated to support 1.6 iirc
19:29:21Araqwhat's the current version?
19:29:24FromGitter<zacharycarter> oooo okay sweet
19:29:28FromGitter<zacharycarter> I believe it is 1.6
19:30:18FromGitter<barcharcraz> the included urho folder is labeled as 1.3
19:31:28Araqhmmm, no sorry
19:31:34AraqI updated it to 1.4
19:31:36FromGitter<zacharycarter> 1) 4 right
19:31:37FromGitter<zacharycarter> yeah
19:32:10Araqnot sure about 1.5 and 1.6, but since it's C++ wrapped you get nice compile-time errors
19:32:34FromGitter<zacharycarter> okay I'll start digging
19:32:42FromGitter<zacharycarter> seems like the best option atm for cross platform 2d / 3d dev until - https://github.com/yglukhov/rod/tree/master/rod matures
19:33:07*gmpreussner joined #nim
19:34:44*bjz joined #nim
19:35:59Araqif you have the choice.
19:36:19AraqI would pick any half finished Nim project over a massive C++ project.
19:36:43FromGitter<zacharycarter> okay
19:36:52FromGitter<zetashift> especially for games!
19:37:04FromGitter<zetashift> Unreal Nim is one of my favorites
19:37:19Araq:P
19:37:23FromGitter<zacharycarter> well that's still using a massive C++ project :D
19:37:48FromGitter<zacharycarter> rod seems cool I just need to figure out how to run it :/
19:42:06*demi- joined #nim
19:42:50FromGitter<zetashift> Unreal C++ is quite nice to work with tho since it is garbage collected
19:44:57FromGitter<zacharycarter> Unfortunately for me UE4 is not an option
20:05:15cheatfateAraq, i have one `half` finished :)
20:05:22cheatfateAraq, i have 2 `half` finished :)
20:11:10Araqcongrats.
20:15:29FromGitter<khchen> hello, everybody
20:15:36FromGitter<zacharycarter> hello
20:17:58Amun_Ramoin
20:21:47FromGitter<khchen> @Varriount
20:22:14FromGitter<khchen> Is @Varriount still here?
20:22:56dom96hey Calinou, you around?
20:23:49*Guest8182 joined #nim
20:26:31FromGitter<barcharcraz> so it seems to me we should be able to do an unreal binding
20:26:38FromGitter<barcharcraz> like even without wrapping the C++
20:27:03FromGitter<barcharcraz> figure out wtf UHT is doing then do that ourselves
20:27:18FromGitter<barcharcraz> and I /think/ they define something of an ABI
20:29:43Araq"able to do"? it exists and is used for commercial game development
20:29:47*sz0 quit (Quit: Connection closed for inactivity)
20:32:03Calinouhey dom96
20:32:13Calinoutomorrow I have a seminar on "corporate social networks", which lasts all day
20:32:31FromGitter<barcharcraz> oh my gosh
20:32:33FromGitter<barcharcraz> wonderful
20:32:35Calinou:/
20:32:36FromGitter<barcharcraz> did not know about that
20:33:13*Trioxin joined #nim
20:33:23*Guest8182 quit (Ping timeout: 264 seconds)
20:33:51dom96Calinou: bah
20:33:54*hcorion quit (Quit: Konversation terminated!)
20:33:57*devted joined #nim
20:34:10dom96Calinou: Any ideas when you'll have time to finish off the website?
20:34:51Calinoua few pages are remaining, according to https://github.com/nim-lang/website/issues/4 which I created
20:34:55Calinou(if I missed some, please add them)
20:39:04*bjz_ joined #nim
20:39:59*bjz quit (Ping timeout: 255 seconds)
20:42:05*rokups quit (Quit: Connection closed for inactivity)
20:42:27*hendi_ joined #nim
20:42:48*yglukhov quit (Read error: Connection reset by peer)
20:43:14*yglukhov joined #nim
20:48:38*vlad1777d quit (Quit: Leaving)
20:52:37FromGitter<Varriount> @wiffel Yes?
20:52:46FromGitter<Varriount> @khchen Yes?
20:55:06*vlad1777d joined #nim
20:56:01FromGitter<zacharycarter> @barcharcraz https://github.com/pragmagic/nimue4
21:01:41*vlad1777d quit (Remote host closed the connection)
21:04:18*vlad1777d joined #nim
21:05:38*krux02 joined #nim
21:10:15krux02Araq: I have a nasty bug for you, I just posted it in the issue tracker
21:10:27*synshroud quit (Ping timeout: 252 seconds)
21:10:38*synshroud joined #nim
21:12:40Calinoudom96: do we know what will happen to the forum, too?
21:17:00dom96Calinou: I will likely create a new design for that based on yours.
21:17:05Araqkrux02: I don't think you know what "nasty bug" means
21:17:08Araq:D
21:18:01krux02It least is was very nasty to actually get to know what was causing the bug
21:18:21krux02so may times the bug just slipped away when I was doing modifications that I assumed to be harmless
21:18:40FromGitter<Varriount> Sounds like memory corruption
21:20:16Araqnah, it's just signature hasing
21:20:19Araq*hashing
21:25:33*lenstr joined #nim
21:32:59*hendi_ quit (Quit: hendi_)
21:38:52krux02Araq: I am not sure if it is just signature hashing
21:39:53krux02It is not that my code doesn't work generally, it is that it needs this very explicit state to be in, so that the error occurs.
21:56:19Araqtwo identifiers are mapped to the same name
21:56:27Araqthat's signature hashing.
22:04:03*synshroud quit (Ping timeout: 240 seconds)
22:06:14*synshroud joined #nim
22:06:48*rupil quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
22:08:33*Vladar quit (Quit: Leaving)
22:14:30euantorRegarding https://github.com/nim-lang/Nim/pull/5280 - this would be useful to me, but would maybe be better named `getOrElse` to prevent clashing with the tables API
22:24:47Araqit's getOrDefault because that's what was choosen
22:25:37Araqand it doesn't "clash" with the tables API, it is consistent with the tables API
22:27:56Araqand it should remain consistent because many people think that's the most important thing in the world
22:28:36krux02not as important, as "it works at all", but still pretty important
22:30:00krux02I like consistency, it removes cognitive load
22:30:16Araqonly if you notice it.
22:30:19krux02feels satisfying when it is so consistent
22:30:20euantorI meant the new version where you can pass a default value Araq
22:30:43euantorSo the existing `getOrDefault` remains, returning the default type for the value stored (e.g.: empty string)
22:30:45Araqeuantor: well the obvious solution is that every getOrDefault should actually support a default value ....
22:30:59Araqmakes sense, doesn't it?
22:31:02euantorYes, that would be the obvious approach
22:31:05dom96indeed, there is no reason to create a new proc just for that.
22:31:18dom96That said, I do think the proc should be renamed to just `get`.
22:31:31euantorI thought you were opposed to changing the signature of getOrDefault(), but obviously read your comment wrong
22:31:36dom96but meh
22:31:49dom96it's not important right now, `getOrDefault` can stay
22:31:55euantorI would personally expect `get` to error on a key not existing
22:32:03Araqdom96: .get vs [] is pretty subtle though
22:32:29Araqand tables support both.
22:32:30krux02not sure with the just get, I mean there is still people who would expecet a panic when the key is not found
22:32:56Araqpersonally I never use the version that raises, I think
22:33:12dom96This is how it works in Python though IIRC
22:33:15Araqexcept when it's the 'var' version, that one has to raise
22:33:24krux02bth I like the name geOrElse it is consistent with the programming language scala ;P
22:33:33dom96So I would say that people would have a good understanding of `[]` vs. `get` coming from Python
22:34:08dom96and yeah, `getOrDefault` is common
22:34:14dom96It doesn't make sense for it to be this long
22:34:33krux02I never wrote Python, do I need to be ashamed?
22:34:36AraqI don't want to rename it
22:34:41Araqit's lots of work.
22:34:51AraqtoUpperAscii already is so annoying
22:35:02krux02realls so annoying?
22:35:10krux02it could be done in sed
22:35:25AraqI can do it with nimgrep
22:35:28Araqnot the point.
22:35:41Araqto automate I need to find all my Nim projects first
22:35:49Araqon 3 different machines
22:35:52krux02people might hate it that they need to update their codebase
22:36:00Araqyup. I do.
22:36:17Araqpointless work, doesn't improve anything.
22:36:51krux02I imagine the programming language of the future to be able to change the names of its api functions without breaking any old code
22:37:16Araqwe don't break it, we generate "nice" deprecation warnings
22:37:25krux02yay,...
22:37:27Araqthat you even can turn off.
22:37:36krux02yay again
22:37:38Araqbut the problems remain.
22:37:43dom96Araq: okay, we can save the rename for the future
22:37:49Araqit creates work.
22:37:55krux02future us will be thankful
22:38:09dom96*we can save the rename for maybe the future
22:38:19*APT69 joined #nim
22:39:24Araqwe should have added 'def' as "common" abbrev for "default" and picked "getOrDef"
22:39:34Araqthat would be the most Nim'ish solution
22:39:40Araqbut we didn't.
22:39:43krux02def?
22:40:22Araqand then krux02 would have told us that 'Else' is only 1 char longer and no abbrev so 'getOrElse' is best
22:40:46krux02Ok to be honest, I think getOrDefault could be a bit shorter, but it is really not that important, and it is very readable, so I would just stick to it
22:41:01krux02there is no objective reason to change to anything else
22:41:11Araqgood.
22:41:30Araqcould always overload {} for this.
22:41:44Araqtab{"foo"}
22:41:55krux02and who should know that {} means that?
22:42:19Araqdid I mention that the {} accessor is one of my favorite features?
22:42:31*Trustable quit (Remote host closed the connection)
22:42:41krux02I don't think so
22:43:08krux02I remember that you once recommended me to use it for something, but I forgot what it was
22:43:20Araqlol
22:43:24euantorPlease not `{}`
22:43:54Araqcalm down, it won't make it into the stdlib
22:44:18Araqbut as a personal shortcut I might use it in my non-stdlib code
22:44:36euantorI have a hard enough job remembering what day of the week it is, trying to remember or even notice a curly bracket means something else is a surefire way to make my brain explode
22:44:50euantorI like nice readable names that I have no chance of forgetting
22:45:11euantorlike `stringIsNilOrEmpty` ;)
22:45:21krux02when there is a useless feature that I want, to just make me feel better, but without any objective reasons to support them, then it is the tokens ¬ ∨ ∧ in the parser as alias for not or and
22:45:30euantoror `stringIsNilOrWhitespace`
22:45:46krux02And I want it just because I can type those symbols
22:47:13krux02euantor: I would recomment this name "proc isUseless(arg: string)"
22:48:31euantorI already managed to force it into strutils ;) Very similar to .NET's `string.IsNullOrEmpty` - any clues where I took the naming from?
22:48:55Araqah so that was you...
22:49:02AraqI hate it :P
22:49:05euantorOr what I spend most of my time writing for work
22:49:10euantorAnd I love it ;)
22:50:21Araqeuantor: (a, b) is already different from [a, b] and that is different from {a, b} and that holds for pretty much *every* language out there
22:51:02Araqso your argument makes no sense whatsoever to me. either your font clearly distinguishes between these or you should get glasses or ...
22:51:24euantorYep, I'm used to seeing `{a,b}` with the braces marking scope.
22:51:32euantorAnd I have glasses, just maybe not good enough ones
22:51:35Araqeven worse '.' is very different from ',' too
22:51:39krux02I think the problem is, that strings can be nil. I don't like that strings can be nil
22:51:42Araqa,b a.b
22:51:48Xeeuantor: https://blog.golang.org/go-fonts these fonts help me a lot
22:52:18euantorXe: Thanks. I currently just use whatever the default font is in VS Code
22:52:21Xekrux02: it's something i miss when working without it
22:53:02krux02Xe you want strings to have a valid nil state?
22:53:03Xenil implies "no data" where as "" implies "blank data"
22:53:29Xewhen working in go with error returns, you can see where this falls apart quickly
22:53:30Araqnil will eventually die anyway. it's days are numbered.
22:53:31krux02Yes I know, but when is "no data" important?
22:53:36Araq*its
22:53:37*pregressive quit (Remote host closed the connection)
22:53:38Xereturn "", err
22:54:02Xekrux02: when API calls have failed
22:54:13*pregressive joined #nim
22:54:20Xeit prevents the result from being processed, even accidentally
22:54:28Araqit's important for regexes, no match vs match of 0 length
22:54:30krux02Xe: I think that can be much better solved with an equivalent to this type: https://doc.rust-lang.org/std/result/
22:54:46Araq^ that's true.
22:55:15Xekrux02: yeah, i was giving examples from real-world cases of writing shit in languages that don't have parameterized types (like go)
22:56:00*nsf quit (Quit: WeeChat 1.7)
22:56:02Araqyou don't need parameterized types, but using a product type for a sum type is incredibly ignorant
22:56:30Araqit's one of these things only Go can get away with.
22:56:41Xethat's the difference between a sum type and a product type again?
22:56:46krux02I wouldn't call it ignorant, but it is definitively not a good solution
22:57:02Xewhat's*
22:57:44krux02I think it is struct vs tagged enum
22:58:35krux02you either have a result, or an error, but never both
22:58:47krux02so you should not return an error and a result
22:58:48*pregressive quit (Ping timeout: 252 seconds)
22:59:15krux02In go you have no choice, the language tells you to return both
23:00:10*APT69 quit (Read error: Connection reset by peer)
23:00:26Xei'm very open to having things generically return "forall a. Either Error a"
23:02:03krux02I am not sure what you mean by that
23:03:39*manjaroi3 joined #nim
23:03:46dom96proc foo(): Either[A]
23:03:50dom96Feel free to code like this
23:04:47Xeyou can apply only one type to a generic type?
23:06:21dom96nope
23:06:25dom96Either[A, B]
23:06:48Xealso, can you limit things in nim like you can in haskell where `a => (Read a, Show a) -> String -> Either Error a`
23:07:27Xethis sets the constraint that the given argument a must instansiate the Read and Show typeclasses
23:09:51dom96proc foo[A: Constraint, B: Blah](): Either[A, B]
23:10:09dom96where Constraint is a concept
23:10:48Xecan concepts be combined?
23:11:13Xeso I could make ReadShow as a combination of Read and Show
23:14:07Xehttps://github.com/vegansk/nimfp
23:16:17dom96no idea
23:16:25*devted quit (Quit: Sleeping.)
23:16:30Araqsure why not?
23:16:46Araqconcepts can "call" other concepts
23:18:08krux02type ReadWrite = concept x: x is Read; x is Write
23:18:39FromGitter<zetashift> Is there a way to store each number from an int in an array?(Feel kinda dumb, might have made a mistake learning Nim after C#)
23:18:47FromGitter<zetashift> though I am enjoying
23:18:54Xe"store each number"?
23:19:14Xeoh i see
23:19:19krux02zetashift: that's a tough job on 64 bit
23:19:40krux02wait even on 32 bit it's impossible
23:20:07FromGitter<zetashift> like 999 and then an array of [9,9,9]
23:20:09krux02there are too many, you don't have enough virtual memory to do that
23:20:21krux02ah ok, you main the digits
23:20:26krux02yes I know how to do that
23:20:45FromGitter<zetashift> Hehe could you tell me pretty please! :D
23:21:23krux02x mod 10 ---> last digit
23:21:38krux02x div 10 ---> number without the last digit
23:21:45krux02rest is on your own
23:22:27FromGitter<zetashift> alright thanks
23:31:47*pregressive joined #nim
23:35:36*Snircle joined #nim
23:37:29*def-pri-pub joined #nim
23:39:38*arnetheduck joined #nim
23:41:05*vlad1777d quit (Quit: Leaving)
23:45:39Araqkrux02: workaround rename the i for loop variable to ii
23:46:06krux02ow, ok
23:46:22krux02I will try it
23:49:52krux02I should mention that in older versions of Nim, this did work without problems
23:49:54*pregressive quit (Remote host closed the connection)
23:50:03*Matthias247 quit (Read error: Connection reset by peer)
23:50:30*pregressive joined #nim
23:53:52Araqyes, signature hashing has its downsides
23:54:08Araqas I said, took months to get this feature right
23:54:15Araqand apparently it still isn't
23:54:18krux02but it works now
23:55:26XeAraq: signature hashing?
23:55:34krux02no the workaround
23:55:35*pregressive quit (Ping timeout: 264 seconds)
23:55:59krux02I initially removed the inline
23:56:13krux02but I didn't like that as much as renaming the i
23:56:29krux02I had no idea I could just rename it
23:56:47krux02I thought it was just a bug that for some reasons that identifier got duplicated
23:56:50Araqthe i bites with the i the for loop iterator uses
23:57:03Araqand usually conflicts are resolved
23:57:19Araqbut not for this inline wrapped in a template instantiated in 2 modules
23:57:20krux02what I think is so weird, is that even the templat that instanciates the proc itself is important
23:57:31krux02without that, there is no problem anymore
23:57:52Araqsure the "path" that produces the identifier is important
23:58:01Araqit's what is used to generate a unique name
23:59:17Araqproper fix will take some time, I don't want to fix it, I will rewrite parts of the compiler to produce shorter names
23:59:29Araqwhich is better for debugging too