<< 28-03-2015 >>

00:16:40*polkm quit (Ping timeout: 246 seconds)
00:18:21BlaXpiritgee, negative indices are totally gone instantly
00:24:54*reem quit (Remote host closed the connection)
00:24:59*jholland quit (Quit: Connection closed for inactivity)
00:26:49*Trustable quit (Read error: Connection reset by peer)
00:27:52*polkm joined #nim
00:28:03EXetoCyay
00:28:39BlaXpirittrying to fight "method has lock level <unknown>, but another method has 0" here
00:28:56BlaXpiriti assume it's because one of overloaded methods uses regex and one doesn't
00:29:02BlaXpiritnot sure what to do
00:29:08BlaXpiritput a dud regex? -_-
00:29:41polkmis nil zero?
00:29:51BlaXpiritno
00:29:53def-BlaXpirit: there should be a nicer way
00:30:47BlaXpirithow to do {.locks: unknown.}
00:31:50BlaXpiritimpossible, i assume
00:33:16BlaXpiritAraq, this is lame
00:33:42polkmhow do I make an int* offset = 0; but in nim?
00:34:07def-var offset: ptr int
00:34:16def-if you want a raw pointer
00:35:04*qwr . o O ( that asyncdispatch thing looks pretty cool... )
00:35:08polkmcool, yeah I'm just trying to do opengl stuff
00:39:16*fizzbooze quit (Quit: WeeChat 1.1.1)
00:43:32*reem joined #nim
00:44:48*reem quit (Remote host closed the connection)
00:52:22*reem joined #nim
00:57:24*Purrkode joined #nim
00:58:15*reem quit (Remote host closed the connection)
00:58:24*BlaXpirit quit (Quit: Quit Konversation)
01:02:00*girvo joined #nim
01:02:08*reem joined #nim
01:02:21*irrequietus quit ()
01:02:32*saml_ joined #nim
01:06:29*girvo quit (Ping timeout: 245 seconds)
01:13:03*reem quit (Remote host closed the connection)
01:14:16*dashed quit (Quit: Connection closed for inactivity)
01:16:30*reem joined #nim
01:24:22*reem quit (Remote host closed the connection)
01:27:13*reem joined #nim
01:29:29*reem quit (Remote host closed the connection)
01:30:57*Purrkode left #nim ("Textual IRC Client: www.textualapp.com")
01:34:18*reem joined #nim
01:36:53*reem quit (Remote host closed the connection)
01:37:34*reem joined #nim
01:47:01*darkf joined #nim
01:49:28*goob joined #nim
01:58:05*a5i joined #nim
02:19:23*reem quit (Remote host closed the connection)
02:19:55*reem joined #nim
02:24:26*wink-s joined #nim
02:39:25*johnsoft quit (Ping timeout: 264 seconds)
02:49:54*wink-s quit (Remote host closed the connection)
02:50:45*girvo joined #nim
02:55:39*girvo quit (Ping timeout: 264 seconds)
03:11:55*reem quit (Remote host closed the connection)
03:17:18*reem joined #nim
03:21:28*johnsoft joined #nim
03:27:14*reem quit (Remote host closed the connection)
03:27:55*banister joined #nim
03:28:43*reem joined #nim
03:40:43*sampwing joined #nim
03:46:37*reem quit (Remote host closed the connection)
03:47:40*reem joined #nim
03:53:47*sampwing quit (Ping timeout: 252 seconds)
04:06:31*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
04:06:33*girvo joined #nim
04:11:09*girvo quit (Ping timeout: 250 seconds)
04:14:20*jefus_ quit (Read error: Connection reset by peer)
04:15:41*reem quit (Remote host closed the connection)
04:17:12*reem joined #nim
04:19:22*reem quit (Remote host closed the connection)
04:22:28*jefus joined #nim
04:28:39*saml_ quit (Quit: Leaving)
04:33:11*a5i quit (Quit: Connection closed for inactivity)
04:33:18*reem joined #nim
04:48:21*gsingh93 quit (Quit: WeeChat 1.1.1)
04:48:47*gsingh93 joined #nim
05:00:03*goob quit (Quit: Page closed)
05:02:05*Sembei quit (Read error: Connection reset by peer)
05:02:59*Sembei joined #nim
05:06:01*vbtt joined #nim
05:09:09vbttAraq: `f -1` parsing as `f(-1)` isn't that great, but that's how coffeescript (and moonscript) do it. See http://coffeescript.org/#try:f%20-1%0Af-1%0Af%20-%201
05:09:35vbttboth of them do `f -1` -> `f(-1)` and also `f - 1` -> `f - 1`
05:09:48vbttand they have extensive usage
05:09:50*Demon_Fox joined #nim
05:10:00vbttso it's not that terrible I suppose.
05:10:17vbttHowever, please make this an error: `1 -1` and require `1 - 1`
05:10:39*johnsoft quit (Ping timeout: 264 seconds)
05:10:53vbttbecause consider `1 -1` vs. `a = 1; a -1`
05:11:39*johnsoft joined #nim
05:12:42vbtt(the substitution principle applies)
05:17:29*reem quit (Remote host closed the connection)
05:22:03*dashed joined #nim
05:22:57*reem joined #nim
05:24:21*reem quit (Remote host closed the connection)
05:30:20*reem joined #nim
05:31:23*reem quit (Remote host closed the connection)
05:32:15*sampwing joined #nim
05:34:26*reem joined #nim
05:41:16*sampwing quit (Remote host closed the connection)
05:51:37*vbtt quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
05:51:59*nande quit (Remote host closed the connection)
05:52:25*girvo joined #nim
05:57:24*girvo quit (Ping timeout: 265 seconds)
06:12:27*reem quit (Remote host closed the connection)
06:15:24*reem joined #nim
06:28:08*gsingh93 quit (Ping timeout: 246 seconds)
06:33:41*reem quit (Remote host closed the connection)
06:36:07*reem joined #nim
06:56:53*reem quit (Remote host closed the connection)
06:58:33*Senketsu quit (Quit: Leaving)
06:59:54*askatasuna joined #nim
07:23:46*johnsoft quit (Ping timeout: 272 seconds)
07:24:06*johnsoft joined #nim
07:31:29*darkf_ joined #nim
07:34:33*cazov quit (Ping timeout: 265 seconds)
07:34:39*cazov joined #nim
07:35:02*darkf quit (Ping timeout: 265 seconds)
07:39:50*askatasuna quit (Quit: WeeChat 1.1.1)
07:41:04*girvo joined #nim
07:41:49*johnsoft quit (Ping timeout: 255 seconds)
07:42:49*johnsoft joined #nim
07:46:01*girvo quit (Ping timeout: 264 seconds)
07:57:22*reem joined #nim
08:01:45*replace-bot joined #nim
08:02:11*replace-bot quit (Remote host closed the connection)
08:04:16*dashed quit (Quit: Connection closed for inactivity)
08:07:39*replace-bot joined #nim
08:09:21*replace-bot quit (Remote host closed the connection)
08:09:38*replace-bot joined #nim
08:22:35*replace-bot quit (Remote host closed the connection)
08:23:08*replace-bot joined #nim
08:34:50*reem quit (Remote host closed the connection)
08:42:29*reem joined #nim
08:42:32*reem quit (Remote host closed the connection)
09:07:31*replace-bot quit (Remote host closed the connection)
09:08:14*replace-bot joined #nim
09:29:52*girvo joined #nim
09:34:13*girvo quit (Ping timeout: 248 seconds)
09:51:24*BlaXpirit joined #nim
09:55:03*Gonzih joined #nim
09:58:56*Gonzih is now known as gnzh
09:59:01*gnzh is now known as gonzih
09:59:17*gonzih quit (Client Quit)
10:06:56*darkf_ is now known as darkf
10:08:21*cir0x joined #nim
10:19:56*singul42 joined #nim
10:20:02singul42hi
10:21:26singul42does anyone know how to use signal and wait (locks lib) with threads (TThread)? is this maybe not possible with the default gc?
10:23:16singul42I am a little bit confused because of the local thread heaps and I was wondering whether calling signal on a global lock and condition var will work.
10:27:25*polkm quit (Ping timeout: 246 seconds)
10:37:09*jasondotstar quit (Read error: Connection reset by peer)
10:38:15*jasondotstar joined #nim
10:42:40*MyMind joined #nim
10:58:23*DemonOne quit (Ping timeout: 246 seconds)
11:17:44*Strikecarl joined #nim
11:17:51StrikecarlHey everyone!
11:18:43*girvo joined #nim
11:19:36*Strikecarl left #nim (#nim)
11:20:06*Strikecarl joined #nim
11:21:24StrikecarlIf i want my calculator to be able to parse so i can do 1 + 1 on the same line
11:21:28Strikecarlwhat parser should i use?
11:23:09*girvo quit (Ping timeout: 245 seconds)
11:26:37BlaXpiritStrikecarl, first of all you can use regex
11:26:52BlaXpiritbut if you're looking for something more serious, then state your question clearly
11:27:06Strikecarlwell
11:27:12Strikecarli am not the best to nim
11:27:24Strikecarlbut in c++ you could do cin >> number1 >> action >> number2
11:27:30BlaXpiritok
11:27:30Strikecarlso every space there was a new int/string
11:27:37Strikecarlhow would i do that in nim?
11:27:55BlaXpiritreadline().split() and u have an array
11:29:10Strikecarlvar a = parseInt(readline().split())
11:29:18Strikecarlwhat do i need to fill in
11:29:30Strikecarlthe ()'s
11:33:17BlaXpirithold up, Strikecarl
11:33:54BlaXpiritStrikecarl, https://bpaste.net/show/10b4c13e0316
11:36:28BlaXpiritoh and yeah, you'll probably need parseInt for those numbers
11:40:24StrikecarlYeah.
11:42:15dom96singul42: you should use a global threadvar
11:42:26dom96singul42: I suggest using Channels instead though.
11:42:54dom96BlaXpirit: Strikecarl: For a calculator I would suggest doing the parsing manually instead of using regex.
11:43:07BlaXpiritmeh
11:43:09*reem joined #nim
11:43:13BlaXpiritregex is great for tokenization
11:43:25BlaXpiritthis guy, however, seems to be looking for something much simpler
11:43:32dom96not when you get a dependency on pcre when you use it
11:48:18*reem quit (Ping timeout: 265 seconds)
11:49:56StrikecarlHow am i supposed to parseInt for this
11:49:59StrikecarlBlaXpirit
11:50:00Strikecarlhttp://pastebin.com/dBsA9b9V
11:50:27BlaXpiritok yeah... just forget about that long line
11:50:37BlaXpiritlet number1 = parseInt(arr[0])
11:50:38BlaXpiritetf
11:50:40BlaXpiritetc
11:50:59Strikecarlthis one? let arr = readLineFromStdin("").split()
11:51:08BlaXpirit#9
11:51:15Strikecarlkk
11:51:16BlaXpiritreplace it with 3 lines
11:51:19StrikecarlAh!
11:52:16BlaXpirityou can write let sum = case action
11:52:49BlaXpiritthen don't need all those "sum = "
11:54:24StrikecarlWhat did i do wrong?
11:54:24Strikecarlhttp://pastebin.com/aJMuF4XN
11:54:28Strikecarl" Error: undeclared identifier: 'number'"
11:54:56BlaXpirityou used undeclared identifier: 'number'
11:54:57BlaXpiritduh
11:55:06BlaXpiritline 20
11:56:00Strikecarloh lol
11:56:01Strikecarlwow
11:56:04Strikecarlmaybe i should read it
11:56:20Strikecarl14, 16) Error: value of type 'int' has to be discarded
11:57:27*gokr joined #nim
11:58:40Strikecarlgotta use the discard function i guess
11:58:42Strikecarlbrb
11:59:41BlaXpirit"else: nope" wut
12:00:54Strikecarlyea
12:00:56Strikecarlfixed it
12:00:57Strikecarlelse:
12:01:01Strikecarleco("nope)
12:01:04Strikecarl")*
12:03:40Strikecarlhttp://pastebin.com/Fmg3dCGc
12:03:41Strikecarlline 14
12:03:45Strikecarli need to discard.
12:03:53Strikecarlsomething.
12:03:57Strikecarl"value of type 'int' has to be discarded "
12:04:29BlaXpirittrying to figure it out
12:04:52Araqdon't use a 'case' expression if you cannot handle the logic :P
12:05:02Araqstick to the 'case' statement
12:05:07BlaXpiritit's impossible to use it
12:05:29BlaXpiritstatement not allowed after 'continue' is the final bummer
12:05:59Araqyeah, stupid compiler, using logic
12:06:32BlaXpiritfunny thing is "0" is not a statement
12:08:12BlaXpiritsorry, Strikecarl, had to go simpler. https://bpaste.net/show/e80fafdd7314
12:10:08Strikecarlthats what i did in the beginning.
12:10:10Strikecarlthanks tho!
12:11:34StrikecarlIt works!
12:34:59*Trustable joined #nim
12:41:18*akiradeveloper joined #nim
12:43:29*banister joined #nim
13:00:30*singul42 quit (Quit: Page closed)
13:05:27*milosn quit (Ping timeout: 250 seconds)
13:06:29*akiradeveloper quit (Remote host closed the connection)
13:07:26*girvo joined #nim
13:07:35*milosn joined #nim
13:08:02*filwit joined #nim
13:08:42filwitdom96: just uploaded a few more fixes to the Aporia PR.. it's ready to be pulled whenever you get a chance to review it.
13:08:55dom96sure, thanks
13:09:51def-Araq: the cpp compilation issues should finally be fixed
13:09:56filwitdom96: btw, have you taken a look at my nimforums PR at all yet? Just a reminder since I haven't gotten any feedback yet.
13:11:02*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:11:22dom96filwit: not yet. Keep reminding me :P
13:11:33dom96on github preferably
13:11:53filwitdom96: actually, scratch that.. i forgot I started majorly changing the CSS (sharing styles between website and removing my docs styles)... so don't pull the nimforum PR
13:12:24*girvo quit (Ping timeout: 265 seconds)
13:16:08Araqdom96: turns out {.push gcsafe.} already works ... :-)
13:16:17Araqgeneric programming ftw
13:16:55filwitAraq: noticed (t:type Foo) works now, thanks.
13:18:46pigmejhmm, whats recommended emacs setup for nim ?
13:18:54def-Araq: or not entirely, still have a strange one
13:18:56pigmejthe nim-mode seems to be quite 'limited', isn't it?
13:22:32filwitAraq, dom96: btw, has there been any updates to Aporia/nimsuggest recently? I tried running it the other day, but Aporia didn't even seem to kick-off nimsuggest at all (no completion displayed, yes i built nimsuggest and enabled suggest features in prefs).
13:23:10dom96filwit: you need to press ctrl+space now to invoke it
13:23:23filwitah, okay
13:24:20filwitwell i'll try later actually, i'm leaving for a bit.. just dropping by to tell you about the Aporia PR
13:24:24filwitlater
13:24:29*filwit quit (Quit: Leaving)
13:26:56*cir0x1 joined #nim
13:29:36*cir0x quit (Ping timeout: 246 seconds)
13:39:12*Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
13:39:24*TEttinger quit (Ping timeout: 245 seconds)
13:40:17*rational joined #nim
13:52:57*singul42 joined #nim
14:03:23def-Araq: I don't get how to fix the C++ array results
14:03:32singul42hi
14:04:18Araqdef-: that's a pretty pervasive codegen change
14:05:30*darkf quit (Quit: Leaving)
14:06:35Araqdef-: and maybe we should generate c++11's std::array
14:06:58*akiradeveloper joined #nim
14:07:13def-Araq: but the C array results also look weird
14:09:44Araqwell the whole code generator needs to be rewritten
14:10:04Araqit should have been built as an AST to AST transformation
14:10:12*Strikecarl joined #nim
14:10:36StrikecarlWhat should i do without this group
14:10:39StrikecarlIRC*
14:11:36*akiradeveloper quit (Ping timeout: 272 seconds)
14:16:24dtscodeAraq, you should definitly be using std::array over regular arrays
14:26:58*akiradeveloper joined #nim
14:29:26*replace-bot quit (Remote host closed the connection)
14:30:31StrikecarlI am a bit of a noob to this nim thing
14:30:38Strikecarlbut i tried to make an precentage calculator
14:30:46Strikecarlusing an proc
14:30:46Strikecarlhttp://pastebin.com/ct20NiJa
14:30:59Strikecarlon line 5 i get an error: type expected
14:32:19*replace-bot joined #nim
14:35:04flaviuStrikecarl: Please read your code before asking questions about it.
14:35:22StrikecarlI did read my code through.
14:35:25StrikecarlAs i said.
14:35:29Strikecarli started nim yesterday.
14:36:17StrikecarlI'm sorry if its a damn stupid question.
14:36:23Strikecarlbut i cant find the error
14:36:42AraqStrikecarl: proc foo() = # equals instead of :
14:36:52def-proc calculate(a, c: int): float = a * 100 / c
14:36:55Araqthen your return is not indented properly
14:37:12Araqand you assign to a global and yet return the value too
14:37:21Araqwhich is universally bad style
14:37:36Araqeven in C++ ;-)
14:37:45StrikecarlI sucked at C++ ;-)
14:41:00StrikecarlSo basicly, this? http://pastebin.com/F6TVnfAu
14:42:05Strikecarlthen when i want to calculate i do
14:42:16Strikecarlcalculate(a, c)
14:42:18Strikecarl?
14:42:26*Ven joined #nim
14:43:03*untitaker quit (Ping timeout: 264 seconds)
14:43:05flaviuStrikecarl: That indentation is ... unorthodox.
14:43:31StrikecarlMeh.
14:43:55Strikecarldidnt get any errors tho :-/
14:45:47AraqStrikecarl: well it's valid
14:46:48flaviure. calculate(a, c). That should work. Why don't you try it and see?
14:46:55Strikecarlcause it doesnt.
14:46:58StrikecarlI get discard errors.
14:47:02Strikecarllike i always do <.<
14:47:23Strikecarleither discard errors or i get the undeclared identifier: 'a'
14:47:36*untitaker joined #nim
14:47:41flaviuhttp://nim-lang.org/tut1.html
14:47:45Strikecarldepends on the indentation.
14:49:05flaviuBecause instead of having { and }, indentation is scope in nim.
14:50:27Strikecarlhmm, knew that.
14:53:34Strikecarlayee i made it work
14:54:25StrikecarlThanks, Araq, flaviu and def-
14:56:13*girvo joined #nim
15:01:01*girvo quit (Ping timeout: 264 seconds)
15:01:11singul42I am getting a compile error I don't know how to solve when compiling the following code: https://bpaste.net/show/385b95398660
15:01:52Araqsingul42: don't use 'var T' in a tuple type
15:02:13Araq'var T' is not a first class citizen in the type system
15:02:24Araquse 'ptr' instead
15:02:29singul42oh, thanks for the hint
15:02:55Araqand don't use TThread of TChannel
15:03:12Araqthough I guess TThread of ptr TChannel works fine ...
15:05:07singul42if ptr TChannel doesn't work, how am I supposed to pass a TChannel to a thread? using it as a global var?
15:05:38Araqthat's what I prefer yes. much easier to reason about
15:05:53Araqsince there is no aliasing going on then
15:06:08EXetoC{.global.} too?
15:06:17singul42cool, will try that too
15:06:53singul42thanks for the help :-) much appreciated.
15:07:10AraqEXetoC: meh. I don't think .global can work here
15:07:42AraqEXetoC: .global is when you want global lifetime but local scope. but in this case the global scope is required
15:08:08EXetoCok
15:09:27*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:12:24*akiradeveloper quit ()
15:18:16*Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
15:26:10fowlpass the index to channel, save yourself some headache
15:42:13ggVGcwhat is the initialization time for a Nim executable relative a C one?
15:42:51ggVGcI guess I mean, how long does the nim runtime take to initialize? Is it basically negligible?
15:43:52dtscodebasically yes
15:44:05dtscodetechnically, its the same runtime
15:44:11dtscodein normal compilations
15:45:38ggVGccool thanks
15:46:05ggVGcdtscode: I was thinking about the GC mostly I guess
15:46:33dtscodeits still all compiling to c though
15:46:45dtscodebut i never had an issue with Mimbus having a slow startup
15:46:53dtscode/s/Mimbus/Nimbus/
15:46:53replace-botdtscode meant: but i never had an issue with Nimbus having a slow startup
15:47:19singul42Araq: works like a charm
15:49:46flaviuggVGc: Benchmarks are the best source of information! 10k hello world invocations take 0.36s user time for nim, 0.38s for C.
15:50:01flaviuOverall CPU time is 12.6s for nim, 11.3s for c.
15:50:14flaviuprobably because nim executables are larger.
15:52:50*banister joined #nim
15:52:54*banister quit (Max SendQ exceeded)
16:03:58*banister joined #nim
16:10:24ggVGcflaviu: thanks
16:17:33def-flaviu: and printing nothing?
16:20:13*banister quit (Ping timeout: 264 seconds)
16:21:18*gsingh93 joined #nim
16:24:18def-flaviu: ok, seems not to make a difference
16:32:42*banister joined #nim
16:36:48*a5i joined #nim
16:44:59*girvo joined #nim
16:49:54*girvo quit (Ping timeout: 265 seconds)
16:58:48*banister_ joined #nim
16:59:07*banister quit (Read error: Connection reset by peer)
17:16:13*irrequietus joined #nim
17:16:15*banister_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:18:33*pafmaf_ joined #nim
17:55:19*BlaXpirit is making yet another regex implementation
17:56:59EXetoCanother wrapper?
17:57:08BlaXpiritnope
17:57:19BlaXpiritthat's the point
18:02:04BlaXpiritmmmm compiletime regex
18:02:18BlaXpiritbut i dont think it's gonna be any advanced
18:02:32BlaXpiritdefinitely not gonna mess with unicode :/
18:02:47def-no chance of getting C libraries at compile time?
18:03:01BlaXpiritthat would be easiest for everyone
18:03:07BlaXpirit(except the one implementing it)
18:03:59def-I also wrote the bigints module so we have bigints at compile time
18:04:11BlaXpiritoh that's great
18:04:12def-but it's never going to be as performant as GMP
18:04:13BlaXpiriti didnt see it
18:04:45*HakanD joined #nim
18:06:31*pafmaf_ quit (Quit: Verlassend)
18:07:48EXetoCBlaXpirit: will you be using thompson's algorithm?
18:08:03BlaXpiritno, just writing some random shtuff that comes to mind
18:08:28BlaXpiritjust a straightforward match algo is all there is to it
18:13:15HakanDNim is still named as nimrod at github: https://github.com/github/linguist/blob/078aff6ee317cb93168b1a79222edfacfa410ce4/lib/linguist/languages.yml#L2011 - should we send a pull request to change it to Nim?
18:13:34def-HakanD: there is one already
18:13:51def-https://github.com/github/linguist/pull/1936
18:14:07HakanDOh ok, couldn't find it on my search, my bad
18:16:49*HakanD quit (Quit: Be back later ...)
18:19:05flaviuhttps://sourceware.org/libffi/ ?
18:21:12BlaXpirit?
18:21:23BlaXpiritflaviu, https://github.com/flaviut/nre/blob/master/src/private/util.nim do u really need fget when there is http://nim-lang.org/tables.html#mget,Table%5BA,B%5D,A
18:22:31flaviuBlaXpirit: They do totally different things, look over that function.
18:22:58flaviuah, I see.
18:23:05flaviuWell, I don't need a var returned.
18:23:19BlaXpiritbut you don't necessarily require non-var
18:23:25BlaXpiritit can't hurt, unless it can
18:25:09flaviuWell, the table in this case is var, but I guess my excuse here is that I can't be bothered to change it.
18:25:43flaviuI don't like that `[]` silently fails when the key isn't found.
18:26:01def-flaviu: Araq said that should be changed
18:26:16def-and mget should become an overloaded `[]`
18:26:19flaviudef-: Let me know when that happens, I'll update my code.
18:26:33BlaXpiriti'd just do everything exactly the same as python
18:26:36def-well, i can't do it because there's a bug preventing a nice deprecation message
18:26:58BlaXpirit[] should do exactly what mget does
18:27:59flaviudef-: I'm not trying to pressure you or anything, I'm in absolutely no rush.
18:33:45*girvo joined #nim
18:38:18*girvo quit (Ping timeout: 246 seconds)
18:47:38*banister joined #nim
19:08:53*Senketsu joined #nim
19:16:08*fizzbooze joined #nim
19:31:34pigmejhmm, guys what the state of unittest module?
19:32:16BlaXpiritpigmej, works pretty well
19:32:41BlaXpiritcan u be more specific?
19:34:06pigmejI have read the discussion about 'going to 1.0 and maybe removing unittest'
19:34:13pigmejalso it's damn hard to find documentation for it
19:34:14BlaXpiritwuuuut
19:34:23pigmejit's not even mentioned in lib.html
19:34:27pigmej(http://nim-lang.org/lib.html)
19:34:32pigmejso I wonder what the heck :)
19:34:43BlaXpiritok now that is strange
19:34:53BlaXpiriti dunno, people seem to use almost exclusively unittest
19:35:10pigmejI've just hit the unittest module by accident in fact
19:35:12pigmej;d
19:36:32Araqpigmej: it still has bugs and IF it doesn't work, you never know if that's because of the unittest module failing or your test failing
19:37:01Araqand at the end of the day it's just a more verbose version of 'when isModule: doAssert ... '
19:37:19AraqI would happily remove it, but lots of code uses it already
19:37:26BlaXpiritAraq pls
19:37:31BlaXpiritit gives introspection
19:37:32flaviuYep, unittest does some interesting stuff with macros to give you more descriptive failure messages, this can cause problems.
19:37:43pigmejah, so that's the case
19:37:53pigmejanyway, I'm new to this world, nim seems pretty cool
19:38:12BlaXpiritpigmej, https://github.com/flaviut/nre/tree/master/test
19:38:34pigmejbut I have to say this, documentation is hmm... requires a lot patience
19:38:55pigmejBlaXpirit: yeah, when I found 'unitest' module, then I searched github for it:)
19:39:25flaviuhttp://nim-lang.org/unittest.html
19:39:28pigmejflaviu: yup
19:39:38flaviuI really use nothing more than what is in that example.
19:40:03pigmejyeah, seems cool
19:40:14BlaXpiritso wait... is require just check without introspection?
19:40:17AraqBlaXpirit: hrm? it does introspection now?
19:40:19EXetoCBlaXpirit: the output is more helpful, yes. I don't care much for the other stuff
19:40:24pigmejby documentation I mean "general docs"
19:40:35EXetoCbut I'll make check standalone soon
19:41:17BlaXpiritCheck failed: a == 6 a was 5
19:41:23flaviuAraq: Introspection is the reason for the bugs.
19:41:24BlaXpiritstuff like that, it's great
19:41:45Araqaha
19:42:05BlaXpiritdon't bash unittest, Araq
19:42:14AraqI never got any useful error messages from it :P
19:42:48Araqbut *shrug* I guess I only saw when it didn't work
19:43:26BlaXpiritand yes, of course you do know when it's unittest failing or your module failing
19:43:41BlaXpiritunittest can only fail at compiletime
19:44:09Araqfixing bugs all day can make you biased :P
19:44:42EXetoCno, it can mess up things at run time too. it does generate code via metaprogramming after all
19:44:51BlaXpirit`check` did cause me trouble a few times, but all it takes to fix it is to simplify the expression
19:45:15BlaXpiritEXetoC, well even if it does that, it still executes the original code unmodified, doesn't it
19:45:23EXetoCthe biggest issue I had was the lack of information in the stack trace at times, which left me clueless
19:46:02BlaXpiriti also don't get the "suite" statement
19:46:08BlaXpiritit seems to do absolutely nothing
19:46:22BlaXpiritit could at least print the name
19:47:29EXetoCbut doesn't it set some things up so that the results can be collected? which are then printed at the end
19:47:33flaviuBlaXpirit: I assume there were future plans.
19:48:24EXetoCzah has been very busy the last year or so
19:48:42flaviuThe suite statements would probably also benefit https://github.com/Araq/Nim/issues/2088 if I ever get around to it.
19:48:43*irrequietus quit ()
19:49:56pigmejit seems that I accidentially started quite interesting discussion ;D
19:52:55Araqpigmej: can you elaborate on why our docs suck?
19:53:05EXetoCI think it should be in system because it's a great replacement for assert. I'll look at it later today
19:53:29Araq(apart from lack of cross referencing and search by type, of course!)
19:53:37BlaXpiritAraq, mainly unittest docs suck, because they are completely absent
19:53:42pigmejAraq: those two for example
19:54:08pigmejwhen you click something, then you can't get back, when you open docs in new tabs => troubles etc
19:54:20BlaXpiritEXetoC, yeah, assert should do check, that would be awesome
19:54:26BlaXpiritpigmej, click back in browser :|
19:54:36pigmejBlaXpirit: open in new tab ;-)
19:54:44Araqso close the tab then?
19:54:44BlaXpiritclose tab then..?
19:54:48Araqlol
19:54:49pigmejAraq: yeah sure
19:55:05pigmejjust saying that something like 'where am I currently' would be fine
19:55:28flaviuThe name of the module is in the page title
19:55:40pigmejlet's say http://nim-lang.org/logging.html, a link back to lib or somethign
19:55:55pigmejflaviu: I mostly meant "go up"
19:55:57pigmejor something
19:56:13BlaXpiritthat's like the least important detail
19:56:16pigmejbut that's my point of view as new one in this world
19:56:20pigmejBlaXpirit: sure
19:56:42pigmejbut it influences the experience
19:57:33flaviuyeah, I'd find a link to /lib.html useful too.
19:57:56EXetoCyeah in case you didn't start there already
19:58:07pigmejwhat I also miss, no search at all (or at lest not one that I'm aware of)
19:58:22BlaXpiritwe have brought up the fact that documentation html sucks
19:58:25flaviuSome search at http://nim-lang.org/theindex.html, but it's a pretty terrible experience.
19:59:03pigmejBlaXpirit: http://www.erlang.org/erldoc this one is ok
19:59:33BlaXpiritshould just use sphinx
19:59:41BlaXpiritnih too strong
20:00:15BlaXpiritalthough maybe it wouldn't work, i don't know what i'm talking about
20:00:36flaviuIt'd work fine, just a few minor compiler changes necessary.
20:01:09flaviuThere needs to be a way to tell jsondoc to output the raw, non-processed doccomments.
20:01:17BlaXpiriti'm talking about representing nim's intricacies
20:01:37BlaXpiritof course, doc is horribly monolithic and not configurable at all
20:02:56Araqno, you can actually configure the shit out of it
20:03:06Araqit's just that nobody does
20:03:14BlaXpiritby editing code?
20:03:22Araqno, by editing the config
20:03:28BlaXpiritwhich is basically code
20:03:36Araqwell it's in a config file
20:03:41Araqand "interpreted"
20:03:47flaviuAraq: But it's impossible to do custom processing on the doc comments.
20:03:52Araqno need to recompile the compiler
20:04:20Araqit's the nature of complex configurations to look like code
20:04:48Araqflaviu: but that's not what BlaXpirit is talking about.
20:05:25BlaXpiritoh sure, earlier i came to the conclusion that code is the best config
20:05:31Araqflaviu: also you can patch everything with JS anyway
20:06:22flaviuAraq: Not really. I want access to the raw comments, which I do not have with javascript.
20:06:38Araqwhat is a "raw comment"?
20:06:59flaviuThe doc comment before it's been processed by the RST parser.
20:07:25BlaXpiritincluding google spy in all docs is such a great idea -_-
20:07:40BlaXpiritoh, flaviu, that sucks :|
20:07:55flaviuBlaXpirit: Google analytics isn't not by default.
20:08:01flavius/not//
20:08:43BlaXpiritno frickin clue what it has to do with anything
20:09:20BlaXpiritnim shouldn't have built-in google spy functionality, it should just be an ability to add custom html
20:10:10flaviuBlaXpirit: Nim's docgen has two uses: for the nim project to generate the website, and for users to generate personal doc pages.
20:10:46BlaXpiritbut i understand that users can use "$analytics"
20:11:33singul42has anybody written a windows service in nim yet?
20:14:11*brson joined #nim
20:18:01BlaXpiriti, for one, don't know what you mean
20:19:44singul42a service that can be started and stopped via the service's control panel
20:20:12BlaXpiritok
20:20:23BlaXpiritis it really specific to nim?
20:20:49BlaXpirithttp://stackoverflow.com/questions/3582108/create-windows-service-from-executable
20:22:32*girvo joined #nim
20:23:01singul42no, just a use case for nim I am trying out and I am having trouble registering the service's main entry point by using StartServiceCtrlDispatcherW .... my service crashes when calling that win32 api function and I can't see the error right now. that's why I asked :-)
20:23:13singul42thanks for the URL blaxpirit
20:24:04singul42currently I am using this as a template: https://msdn.microsoft.com/en-us/library/windows/desktop/bb540475%28v=vs.85%29.aspx
20:24:20BlaXpiritscary
20:25:33singul42indeed :-)
20:27:01*girvo quit (Ping timeout: 248 seconds)
20:28:12singul42this is my proc to register the service's main entry point (serviceMain): https://bpaste.net/show/5e925154886d
20:30:49*fizzbooze quit (Ping timeout: 244 seconds)
20:32:07BlaXpiritis there any reason you can't create-windows-service-from-executable??
20:36:46singul42no reason except that I want tto learn how to write a windows service using win32 api in nim :-)
20:45:44*irrequietus joined #nim
20:58:56*fizzbooze joined #nim
21:03:18*fizzbooze quit (Client Quit)
21:03:47*fizzbooze joined #nim
21:17:32*HakanD joined #nim
21:22:39*HakanD quit (Ping timeout: 264 seconds)
21:30:22*gokr quit (*.net *.split)
21:30:22*MyMind quit (*.net *.split)
21:30:22*xet7 quit (*.net *.split)
21:30:22*flaviu quit (*.net *.split)
21:30:23*reactormonk quit (*.net *.split)
21:30:41*reactormonk joined #nim
21:31:00*xet7 joined #nim
21:31:30*MyMind joined #nim
21:32:40*gokr joined #nim
21:32:43*flaviu joined #nim
21:38:19*girvo joined #nim
21:42:40*girvo quit (Ping timeout: 250 seconds)
22:06:21*filwit joined #nim
22:13:20*singul42 quit (Quit: Page closed)
22:15:34*reem joined #nim
22:17:05k1idom96: you wrote asyncdispatch, yea?
22:52:08*flaviu quit (Read error: Connection reset by peer)
22:58:19*tghume joined #nim
22:59:01tghumeHi, I’m a Nim newbie with an interesting challenge: how do I load a large file full of binary 32 bit ints into a seq[int32] without copying?
22:59:53Araqrely on the Nim compiler to do the move for you?
23:00:15Araquse shallowCopy?
23:00:18tghumeCurrently I use createU() to create an uninitialized buffer, then readBuffer to read into the buffer and then copy it element-by element into a seq with toSeq
23:00:21Araquse shallow on the seq?
23:00:59tghumeThe thing is other than readBuffer there is no way I can tell the nim compiler to read a file as int32s, which leaves me with a pointer.
23:01:28tghumeAre you saying that I can shallowCopy a “ptr int32” to a “seq[int32]” and no copying will go on behind the scenes?
23:01:47Araqohh "challenge" ahead: readBuffer( cast[ptr int32](addr(theSeq[0])) )
23:02:13tghumeMy current problem is that near the end of the copy I have my massive binary file in memory twice, which out of memory errors my tiny VPS. I could add more swap but there must be a better way.
23:02:32AraqtheSeq needs to have the proper capacity for my snippet to work
23:02:33*fizzbooze quit (Ping timeout: 265 seconds)
23:02:36tghumeAh excellent, that’s exactly what i was looking for
23:02:49Araqactually
23:02:57Araqthe 'cast' is not necessary
23:03:05Araqaddr returns the proper type
23:03:05tghumeI knew that if I had full control I would get a pointer to the inner contents of the seq and pass that, but I didn’t know how to get the pointer.
23:03:17tghumeThanks!
23:03:55tghumeI’ll have to endure the overhead of initializing the seq with a bunch of zeroes, but that’s better than what I have now and not a big deal.
23:04:14Araqyou might still call shallow(theSeq) though
23:04:32Araqto ensure it's not copied around behind your back
23:05:16Araqoh yeah, getting rid of the zero-ing will be possible soonish
23:05:25def-Araq: Great, more performance!
23:06:32tghumeWait I’m a Nim noob, what does shallow(theSeq) do and where exactly would I put that?
23:06:52Araqdo it after newSeq()
23:07:19Araqnormally var x = s would copy 's', but not if 's' is shallow
23:07:35tghumeOk thanks!
23:07:59Araqfor some reason nobody has yet complained about this rather dubious semantic glitch ...
23:08:09reactormonkAraq, would var s = @[] {.shallow.} work too?
23:08:22Araqreactormonk: no.
23:15:48*fizzbooze joined #nim
23:17:20*BlaXpirit quit (Quit: Quit Konversation)
23:17:21def-Araq: What would the alternative be? Switching to ref seqs?
23:18:11Araqcall shallowCopy directly instead of '='?
23:18:46AraqI've yet to see a case where 'ref seq' is necessary
23:19:03Araqthough in theory it *can* come up
23:19:34Araqnote that a seq is a single indirection, so when you need to resize all the pointers to the old seq cannot be updated
23:20:12pigmejhm, sorry for nobbish question, how can i write tuple to a file, and then read it back (I suppose to read is just createU + readBuffer, but what then..?)
23:20:29Araqdo not use createU.
23:20:42Araqit's hardly ever necessary
23:20:54pigmejok, so then how ?
23:21:07pigmejsorry, I'm quite lost for now... ;/
23:22:19EXetoCthe speedup should be minimal
23:22:57pigmejI currently wonder how, not even in speedup phase
23:23:45*Trustable quit (Quit: Leaving)
23:26:05Araquse addr
23:26:28pigmejhmm
23:27:06*girvo joined #nim
23:27:45*reem quit (Remote host closed the connection)
23:28:55*reem joined #nim
23:30:05pigmejAraq: what about reading it back?
23:30:38Araqpigmej: well depending on what you want to do
23:30:43Araqyou can use
23:30:49Araq* the marshal module
23:30:56Araq* the streams module
23:31:01Araq* some Nimble package
23:31:10pigmejwell, I don't need serializer
23:31:18pigmejso if it would be possible to read raw data, it would be cool
23:31:22Araq* low level hacking with 'addr' (beware of endianness issues)
23:31:55Araqvar someTup = (1, 2, 4.0)
23:31:57pigmejAraq: I need to store some computation details (fixed size / types)
23:31:59reactormonkpigmej, writing a tuple sounds like a serializer to me
23:32:06*girvo quit (Ping timeout: 272 seconds)
23:32:14AraqwriteBuffer(f, addr someTup, sizeof someTup)
23:32:16pigmejand read them back
23:32:19pigmejreactormonk: yeah, but limited ;-)
23:32:31pigmejAraq: yeah, write works fine for me :)
23:32:35pigmej(after your tips)
23:32:37reactormonkpigmej, still go for a serializer, probably the easiest way
23:33:29AraqI'd use a Python module that uses string literals to describe low level bytepacking details and then use Nimborg to access that Python module
23:33:47Araq(just kidding)
23:33:51pigmejAraq: ;D
23:34:05pigmejpython has struct module in fact...
23:34:17Araqno.
23:34:24Araqpython *needs* a struct module.
23:34:29Araqwe don't.
23:34:31pigmejhah :)
23:35:02pigmejyeah that's quite obvious (even for me)
23:36:58Araqbut seriously people seem to love Nimborg. has that found a new maintainer yet?
23:37:33Araqalso we need to announce really cool Nimble packages somehow
23:37:54filwittghume said "I’ll have to endure the overhead of initializing the seq with a bunch of zeroes": You don't actually, just mark the variable as {.noinit.}
23:38:30filwittghume: delay that, sorry... misunderstood that
23:38:52tghumefilwit: yah that probably doesn’t work with sequences that require other structural things to be set up and space to be allocated.
23:41:18pigmejhmm, is there any reason why fmReadWrite makes file position end ?
23:41:58pigmejand fmReadWriteExisting does not?
23:42:18*no_name quit (Ping timeout: 252 seconds)
23:42:19*devzerp quit (Ping timeout: 252 seconds)
23:46:46*devzerp joined #nim
23:46:54*no_name joined #nim
23:47:33pigmejok my tuple read / write works like a charm, just had to switch from 'non C langs' ;)
23:47:40pigmej(swich the brain)
23:51:55*gokr quit (Quit: Leaving.)
23:52:26*reem quit (Remote host closed the connection)
23:53:19*reem joined #nim
23:55:52*reem quit (Remote host closed the connection)
23:58:35*cir0x1 quit (Quit: Leaving.)