<< 23-02-2015 >>

00:07:37*wb_ quit (Ping timeout: 264 seconds)
00:07:49*sampwing joined #nim
00:10:03*vendethiel quit (Ping timeout: 264 seconds)
00:11:43*vendethiel joined #nim
00:16:21*sampwing quit (Ping timeout: 252 seconds)
00:20:28Var|Mobileonionhammer: view.window() doesn't always work
00:21:35*TEttinger joined #nim
00:32:31*nande quit (Ping timeout: 255 seconds)
00:33:07*nande joined #nim
01:01:58*deXtoRious quit (Ping timeout: 246 seconds)
01:11:57*fizzbooze quit (Quit: WeeChat 1.1.1)
01:18:02*darkf joined #nim
01:18:09*infinity0 quit (Ping timeout: 245 seconds)
01:18:14*infinity0_ joined #nim
01:18:30*infinity0_ quit (Changing host)
01:18:30*infinity0_ joined #nim
01:18:30*infinity0_ is now known as infinity0
01:19:47*miko_ quit (Ping timeout: 250 seconds)
01:20:06VarriountUm, are int's supposed to be non-implicitly-convertible to floats?
01:20:18*vendethiel quit (Ping timeout: 252 seconds)
01:20:20def-float(x)?
01:20:35def-I would say so
01:21:07Varriountdef-: I mean, passing an integer type, even an integer literal, to a proc expecting a float requires manual conversion
01:21:51def-ok, would be nicer if that was implicit, yes. but could be a problem with overloaded procs
01:22:01*vendethiel joined #nim
01:22:19Varriount.eval import math;echo(log10(20))
01:22:22MimbusVarriount: 1.301029995663981
01:22:33VarriountOk, now I'm flummoxed.
01:23:50*reem quit (Remote host closed the connection)
01:24:48Varriount.eval import math;let x=3;echo(pow(2, x))
01:24:51MimbusVarriount: eval.nim(5, 8) Error: type mismatch: got (int literal(2), int)
01:24:59Varriountdef-: ^
01:25:37def-i think i remember that, it's strange
01:26:25VarriountAh well, I'll just stick a converter into my code.
01:26:28*reem joined #nim
01:39:37fowlliterals are more flexible than var/let
01:43:05*vendethiel quit (Ping timeout: 246 seconds)
01:45:45*vendethiel joined #nim
01:46:44*Schala joined #nim
01:47:41SchalaHow does one enforce enum scope? I remember some syntax or pragma for it but it's not documented apparently.
01:54:24*BitPuffin quit (Ping timeout: 252 seconds)
01:55:01*Demon_Fox joined #nim
01:57:45*Trustable quit (Remote host closed the connection)
01:58:55*Trustable joined #nim
02:02:02flaviu{.pure.}
02:02:13flaviuSchala: ^
02:06:35Schalaooh ok thanks
02:06:54*vendethiel quit (Ping timeout: 245 seconds)
02:08:37Schalaand also, I wanted to use a binary buffer of some sort. I thought of using sttring or seq[int8] but I wouldn't know how to insert/extract
02:09:05Schalausing addr would probably point to GC metadata I'd fear
02:09:08*chemist69_ joined #nim
02:09:11*vendethiel joined #nim
02:09:21def-Schala: addr mySeq[0]
02:10:09Schalaand setLen(mySeq, mySeq.len+4) would work too?
02:10:18def-yes
02:10:24Schalaawesome thanks
02:12:13*chemist69 quit (Ping timeout: 250 seconds)
02:27:33flaviuI don't think there's any guarantee that the pointer will still be valid after a resize
02:31:43def-right
02:34:20*brson joined #nim
02:34:20*brson quit (Client Quit)
02:35:55*reem quit (Remote host closed the connection)
02:42:37*reem joined #nim
02:43:30*nande quit (Remote host closed the connection)
02:52:34*Schala quit (Ping timeout: 246 seconds)
03:05:22*reem quit (Remote host closed the connection)
03:12:00*reem joined #nim
03:12:31*nimnoob123 quit (Quit: Page closed)
03:13:08*saml_ joined #nim
03:13:51*reem quit (Remote host closed the connection)
03:16:12*reem joined #nim
03:17:22fowlnice seeing schala again
03:17:49*vendethiel quit (Ping timeout: 264 seconds)
03:20:43*vendethiel joined #nim
03:21:49*Trustable quit (Remote host closed the connection)
03:42:22*kapil___ joined #nim
03:44:59*vendethiel quit (Ping timeout: 252 seconds)
03:53:59*johnsoft quit (Ping timeout: 246 seconds)
03:54:19*johnsoft joined #nim
03:57:46*vendethiel joined #nim
04:05:06*reem quit (Remote host closed the connection)
04:07:33*reem joined #nim
04:07:44*reem quit (Remote host closed the connection)
04:09:44*randomwalk joined #nim
04:10:42*reem joined #nim
04:12:01randomwalkHi, compiling from Aporia works for --app:console but not --app:gui ...ld.exe says can't find -lgdi32 and -lcomdlg32 ... has anyone else resolved this problem?
04:15:01fowlrandomwalk, aporia uses gtk so it doesnt need those libraries, you should compile with no arguments `nim c aporia`
04:15:32*reem quit (Ping timeout: 265 seconds)
04:16:00randomwalkfowl: oh. so is the gui option still used?
04:16:23randomwalkby anyone?
04:17:03fowlthat is the application
04:18:59randomwalkhrmm.....I thought on Win32 you couldn't create a window from a console app...
04:20:13*gsingh93 quit (Ping timeout: 255 seconds)
04:25:27*reem joined #nim
04:27:06*jholland quit (Quit: Connection closed for inactivity)
04:36:04*ruzu joined #nim
04:36:48fowlrandomwalk, well it doesnt use windows forms, you said it compiled, did you try to run it
04:37:07fowlif it doesnt run then you are probably missing dependencies
04:47:54randomwalkit's just echo("hello Nim").........I'm just setting up the IDE
04:50:15*vendethiel quit (Ping timeout: 252 seconds)
04:55:53Varriountrandomwalk: You can create a window from a console application on Windows. Java and Python do it if you try to use their GUI libraries without invoking the proper executable (javaw and pythonw)
04:58:45*dts|pokeball joined #nim
04:59:46*dts|pokeball quit (Remote host closed the connection)
05:07:06*vendethiel joined #nim
05:11:33*randomwalk quit (Quit: Page closed)
05:18:25*reem quit (Remote host closed the connection)
05:22:07*reem joined #nim
05:24:16*wb_ joined #nim
05:24:41*brson joined #nim
05:32:01*vendethiel quit (Ping timeout: 256 seconds)
05:34:39*randomwalk joined #nim
05:35:07*vendethiel joined #nim
05:35:19randomwalkSetProcessDPIAware() isn't in the windows module...how do I call it?
05:35:20randomwalkhttps://msdn.microsoft.com/en-us/library/windows/desktop/ms633543%28v=vs.85%29.aspx
05:37:40reactormonkrandomwalk, add it yourself via importc
05:39:49randomwalkoh, I see the FFI now. Thx reactormonk :)
05:40:18reactormonkrandomwalk, it's not so much FFI as just code generation.
05:40:58randomwalkyes, I understand. thx
05:59:55*shalabh joined #nim
06:00:38shalabhhello
06:00:47shalabhdef- around?
06:06:21*vendethiel quit (Ping timeout: 244 seconds)
06:08:02randomwalkWhen I try this code, I get a bunch of typedef errors:
06:08:04randomwalkproc SetProcessDPIAware() {.header: "<Winuser.h>", importc: "SetProcessDPIAware".} SetProcessDPIAware()
06:11:40*RayoGundead joined #nim
06:14:16*vendethiel joined #nim
06:14:20*shalabh quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
06:18:23reactormonkrandomwalk, which ones?
06:19:58*bjz joined #nim
06:23:18*reem quit (Remote host closed the connection)
06:24:37randomwalkreactormonk: hmmm...if I change winuser.h to windows.h those errors go away, but now I have a linking error
06:25:18reactormonkrandomwalk, I'm not too sure how to read the header files there
06:25:33reactormonkor rather the documentation on the header files
06:26:15randomwalkCC: hello [Linking] Error: execution of an external program failed > Process terminated with exit code 1
06:26:38reactormonkhuh.
06:26:53reactormonkYou might need to add some passL arguments
06:27:59*bjz quit (Ping timeout: 246 seconds)
06:30:19randomwalkI'll increase the compiler verbosity and see if I get more info...
06:31:08reactormonkthat should help
06:32:10*reem joined #nim
06:36:35*ruzu quit (Read error: Connection reset by peer)
06:39:48randomwalkPassL didn't seem to help...verbosity level 2 wasn't interesting...running level 3 now... (very slow compiling windows.nim !!!)
06:43:41*vendethiel quit (Ping timeout: 246 seconds)
06:46:36randomwalkc:\nim\lib\windows\windows.nim(23925, c:\users\me\desktop\nimcache\hello.o:hello.c:(.text+0xed): undefined reference to `SetProcessDPIAware' 0)
06:46:48*saml_ quit (Quit: Leaving)
06:48:26*ruzu joined #nim
06:48:38*ruzu quit (Changing host)
06:48:38*ruzu joined #nim
06:48:57*vendethiel joined #nim
06:48:59*brson quit (Quit: leaving)
06:49:00ruzutest!
06:52:19*ntjnsz joined #nim
06:54:00*bjz joined #nim
06:55:18*fizzbooze joined #nim
06:55:36TEttingerhey ruzu
06:55:43fizzboozeanyone here?
06:55:47TEttingeryep
06:55:50TEttingerquite a lot
06:56:13fizzboozei hear that Nim's GC isn't threadsafe. is that true?
06:56:55TEttingerI'm still starting out with Nim, there are much more competent people than myself in here
06:57:01*ChrisMAN quit (Ping timeout: 256 seconds)
06:58:18TEttingerruzu: making a 7DRL in Nim?
06:59:23*Demon_Fox quit (Quit: Leaving)
07:00:27randomwalkDoes my syntax look correct? proc SetProcessDPIAware() {.header: "<Windows.h>", importc: "SetProcessDPIAware".}
07:04:45*johnsoft quit (Read error: Connection reset by peer)
07:05:10*johnsoft joined #nim
07:06:24*nimnoob123 joined #nim
07:11:22*infinity0 quit (Ping timeout: 240 seconds)
07:12:05nimnoob123feels good when things just work http://i.imgur.com/1Av2vqM.png, making progress w/ nim and sdl2 ;D - also learned that the ttf library requires all functions that return cint need to be discarded - might do a pull request later to make those discardable
07:12:26nimnoob123procs* sorry :)
07:15:22*infinity0 joined #nim
07:20:00ruzuTEttinger: anything is possible
07:25:21nimnoob123quick question: Is there a simpler way to write this var myfont_color : sdl2.Color = (uint8(0), uint8(0), uint8(0), uint8(0)) - (the uint8 part, sdl2.Color is a tuple of uint8's)
07:26:21nimnoob123because it throws an error if I type it any other way w/out the typecasting of uint8's
07:26:26*fizzbooze quit (Ping timeout: 244 seconds)
07:27:43TEttingernimnoob123: make a helper method that returns a Color, is passed 4 integers, and casts them all to uint8 internally before constructing a Color?
07:28:38nimnoob123yeah i guess that works, is that the only solution when it comes to nim syntax?
07:36:47*Outlander quit (Ping timeout: 250 seconds)
07:37:42*heinrich5991 quit (Excess Flood)
07:38:05*heinrich5991 joined #nim
07:48:03*randomwalk quit (Quit: Page closed)
07:50:19nimnoob123any plans on adding a parent keyword for the import dot syntax ex.: import parent.moduleInParentFolder, or is there something like that already? because the string syntax looks pretty ugly ".../moduleInParentFolder"
07:50:41*MyMind joined #nim
07:50:59nimnoob123my class question of the night :)
07:51:23nimnoob123last*
07:51:54*Sembei quit (Ping timeout: 245 seconds)
07:53:49*vendethiel quit (Ping timeout: 264 seconds)
07:54:30*vendethiel joined #nim
08:01:59fowlnimnoob123, the proper thing to do would be to check those calls for error
08:02:33nimnoob123hmm?
08:02:47fowlthe functions in sdl2/ttf
08:02:51fowlwont be discardable
08:04:00nimnoob123oh you're talking about that
08:04:42fowland use this for creating a color
08:04:44fowlproc color*(r, g, b, a: range[0..255]): Color
08:05:09nimnoob123yeah
08:05:17nimnoob123what about the import question
08:06:19fowlnimnoob123, well if parent module is on the search path then its just "parentmodule" for example the libs in sdl2/ could just import 'sdl2'
08:07:53nimnoob123hmm, didn't really notice that
08:10:45nimnoob123hmm yeah - compiler says it can't open the file - there's root, root/subfolder and root/subfolder/subsubfolder, my module in root/subfolder/subsubfolder can't import the module in that parent folder like you said - how would I know if the module is on the search path?
08:11:30nimnoob123tbh i'd rather just do parent.moduleinparentfolder - easier to understand what's going on when viewing source
08:13:11fowlnimnoob123, so you want to use subfolder.module but you want to just call it module?
08:16:28nimnoob123http://pastie.org/9974045
08:16:59*BlaXpirit joined #nim
08:17:06fowlyou want to use "parent." instead of "../", no, you cant do that
08:17:18nimnoob123yeah
08:17:56nimnoob123so: any plans on adding a parent keyword for the import dot syntax
08:18:11fowli hope not
08:18:24nimnoob123why not, looks much cleaner
08:18:25fowltoo many keywords already
08:18:33fowlin your opinion
08:18:39nimnoob123sure in my opinion
08:18:43fowli would look at that and say 'there must be a parent directory'
08:18:53nimnoob123that's the whole poitn
08:18:55nimnoob123point*
08:19:12fowlthen i wouldn't find a directory called 'parent'
08:19:21nimnoob123oh my god lol
08:23:06nimnoob123I'm going to bed, night
08:23:09*nimnoob123 quit (Quit: Page closed)
08:23:10fowlgood night
08:24:27*TEttinger quit (Ping timeout: 245 seconds)
08:27:45*aidanh joined #nim
08:31:02*johnsoft quit (Read error: Connection reset by peer)
08:35:12*reem quit (Remote host closed the connection)
08:42:26*Trustable joined #nim
08:47:22*Trustable quit (Remote host closed the connection)
08:48:08*Trustable joined #nim
09:03:34*gokr joined #nim
09:05:49*gokr_ quit (Ping timeout: 264 seconds)
09:12:20*teapottime joined #nim
09:27:08*sillesta joined #nim
09:27:40*chemist69_ quit (Quit: WeeChat 1.1.1)
09:27:50*chemist69 joined #nim
09:36:59BlaXpiritHow to check if compiler is Visual Studio?
09:37:22dtscodedo you mean visual c++?
09:37:24BlaXpiritwhen defined(gcc): seems to work but
09:37:26BlaXpiritwell yeah
09:40:22*kuzy000_ joined #nim
09:43:39*akiradeveloper joined #nim
09:49:35*dumdum joined #nim
10:15:35akiradeveloperWhen the c source code that is generated by nim compiler is huge. The compile time is like forever. Can I make it fast? I generate thousands of test cases for msgpack-nim by QuickCheck and the nim source code becomes huge.
10:16:24akiradeveloperI think more tests should be run but it's not practical at the moment.
10:18:16*czr quit (Remote host closed the connection)
10:20:22*antrix joined #nim
10:25:44*keyle joined #nim
10:34:45Araqakiradeveloper: -d:release produces less C code
10:35:06Araqbut it doesn't take "forever" for most of us
10:36:01def-akiradeveloper: you mean with the unittest module?
10:36:36akiradeveloperlook at this and assume what I am doing? https://github.com/akiradeveloper/msgpack-nim
10:37:38akiradeveloperproduce a list of test cases (GenTests.hs) and generate a single test file (gentest.rb), compile and run
10:38:04akiradeveloperthe number of test case is 1000 but it will take forever if I set it to 10000
10:38:57def-akiradeveloper: ok, i just wondered because i had that problem with unittest
10:38:59akiradevelopercc1 process (I guess it is gcc) never end
10:39:11def-akiradeveloper: so it's the C compiler that takes forever, not nim?
10:39:54Araqah so you are complaining that the unittest module that is still not in the official documentation and we like to die causes problems for you ...
10:40:02akiradeveloperI think so. I look at the top. nim ends soon but the cc1 phase never end
10:40:51akiradeveloperoh... it ends in 1 minutes with release flag. no one can call this forever
10:41:45akiradeveloperSorry to confuse you
10:41:54def-akiradeveloper: i guess it's not a good idea to create such huge source files
10:42:40def-akiradeveloper: i don't understand fully what you're doing, but creating a shorter source and some external files (that don't need to be compiled) would be the proper solution I guess?
10:42:53def-If you just want a quick fix, I bet tinycc compiles this quickly anyway
10:44:06akiradeveloperNim can generate nim object from string? (like eval in Ruby)
10:44:50*pafmaf joined #nim
10:45:00akiradeveloperfor example. If I can generate MyType(10) from a string "MyType(10)". Your solution can reduce compile time
10:45:14fowlakiradeveloper, there is marshaling
10:45:26def-http://nim-lang.org/marshal.html and http://nim-lang.org/typeinfo.html
10:47:17akiradeveloperSorry, "MyType(10)" is function call. also possible with the libraries?
10:47:50Araqyou can build a compile-time eval with macros
10:47:59Araqbut no runtime eval
10:48:02*JinShil joined #nim
10:48:38akiradeveloperthe string is read from external file.
10:49:08fowlto play with it use $$ and to()
10:49:46akiradeveloperok
10:49:51fowlAraq, will nim target RCC++?
10:50:46fowlakiradeveloper, you can use load/store with stringstreams too
10:52:05Araqfowl: possibly, but I still think we only need to produce different code for accessing globals to solve the REPL problem
10:52:37fowlwhats the repl problem
11:01:03*darkf_ joined #nim
11:02:11*Outlander joined #nim
11:02:49Araqto keep state between recompilations
11:03:25*darkf quit (Ping timeout: 264 seconds)
11:09:23*pafmaf quit (Quit: Verlassend)
11:11:46*JinShil quit (Quit: Konversation terminated!)
11:14:36*gokr nods in agreement and drinks more beer...
11:15:08*gokr quit (Quit: IRC for Sailfish 0.9)
11:16:53*antrix quit (Quit: Leaving)
11:19:07*gokr joined #nim
11:20:47ruzutime to make a compile-to-nim language :>
11:22:53*johnsoft joined #nim
11:32:36keyle:)
11:32:50keyleI wish I'd understood better the html dsl to make my own dsl.
11:34:53*darkf_ is now known as darkf
11:35:48*reem joined #nim
11:40:05*yymoto2 joined #nim
11:40:11*reem quit (Ping timeout: 252 seconds)
11:55:15*yymoto2 quit (Quit: leaving)
11:56:45*RayoGundead quit (Quit: Page closed)
12:00:15*akiradeveloper quit (Remote host closed the connection)
12:01:11*akiradeveloper joined #nim
12:09:15*dumdum quit (Ping timeout: 256 seconds)
12:17:49*federico3 quit (Ping timeout: 264 seconds)
12:18:59*federico3 joined #nim
12:31:31*federico3 quit (Quit: WeeChat 0.3.8)
12:31:42*federico3 joined #nim
12:32:44*akiradeveloper quit (Remote host closed the connection)
12:37:28*novist quit (Quit: ZNC - http://znc.in)
13:08:14*gokr1 joined #nim
13:15:51*keyle quit (Quit: <Morbo> Chitchat achieved!)
13:22:15*Etheco quit (Read error: Connection reset by peer)
13:33:16*akiradeveloper joined #nim
13:38:13*akiradeveloper quit (Ping timeout: 264 seconds)
13:43:52*akiradeveloper joined #nim
13:44:27*gokr1 quit (Quit: Leaving.)
13:45:22*panzone joined #nim
13:54:50*mpthrapp joined #nim
14:13:41*grumbly joined #nim
14:15:00*akiradeveloper quit ()
14:21:33*darkf quit (Quit: Leaving)
14:27:31*grumbly quit (Quit: Page closed)
14:28:27*gokr1 joined #nim
14:31:25*aidanh quit (Ping timeout: 252 seconds)
14:33:55*panzone quit (Remote host closed the connection)
14:35:51*aidanh joined #nim
14:38:01*Var|Mobile quit (Ping timeout: 252 seconds)
14:38:14*panzone joined #nim
14:39:29*Var|Mobile joined #nim
14:43:49*dumdum joined #nim
14:45:05*infinity0 quit (Ping timeout: 256 seconds)
14:48:08*johnsoft quit (Ping timeout: 246 seconds)
14:48:34*infinity0 joined #nim
14:48:43*johnsoft joined #nim
14:50:01*BlaXpirit_ joined #nim
14:52:43*BlaXpirit quit (Ping timeout: 250 seconds)
14:57:30*BitPuffin joined #nim
15:01:25*MajorWork joined #nim
15:01:48*gokr1 quit (Quit: Leaving.)
15:15:46*Var|Mobile quit (Quit: AndroIRC - Android IRC Client ( http://www.androirc.com ))
15:19:46*Gonzih quit (Quit: WeeChat 1.0.1)
15:21:02*Gonzih joined #nim
15:21:19*elbow quit (Remote host closed the connection)
15:23:15*pregressive joined #nim
15:24:16*saml joined #nim
15:48:33*dumdum quit (Ping timeout: 256 seconds)
15:52:35*novist joined #nim
16:01:58*gokr quit (Quit: IRC for Sailfish 0.9)
16:06:36*dumdum joined #nim
16:08:23*ChrisMAN joined #nim
16:10:32*sampwing joined #nim
16:23:37*sampwing quit (Ping timeout: 252 seconds)
16:38:50*jholland joined #nim
16:49:36*BlaXpirit_ quit (Quit: Quit Konversation)
16:49:52*BlaXpirit joined #nim
16:50:57*pregressive quit (Read error: Connection reset by peer)
17:02:10*Etheco joined #nim
17:09:28*kniteli quit (Quit: Leaving)
17:11:07*teapottime quit (Ping timeout: 246 seconds)
17:13:31*nande joined #nim
17:14:10*yibter joined #nim
17:19:27ekarlsodtscode: you around ?
17:22:55*superfunc|lab joined #nim
17:29:25*pregressive joined #nim
17:30:29*johnsoft quit (Ping timeout: 246 seconds)
17:31:09*johnsoft joined #nim
17:51:36*jfchevrette joined #nim
17:54:00*shalabh joined #nim
17:54:50shalabhhello
17:54:55*dumdum quit (Ping timeout: 256 seconds)
17:55:59emilsphey, there aren't any neural network libraries for nim are there ?
18:02:16*xcombelle joined #nim
18:03:29*gsingh93 joined #nim
18:04:55fowlemilsp, i have one in fowltek
18:06:19fowlmine is here https://github.com/fowlmouth/nimlibs/blob/master/fowltek/neural.nim
18:06:54fowlalso theres a wrapper for libfann in there, the 'fast artificial neural network library'
18:08:01emilspoh, that's great, thank you very much
18:09:51fowlsure
18:19:12*shalabh quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
18:28:17*superfunc|lab quit (Ping timeout: 244 seconds)
18:31:41*kniteli joined #nim
18:33:24emilspfowl, out of interest, what have you used the library for ?
18:39:03*dumdum joined #nim
18:44:14*emilsp quit (Read error: Connection reset by peer)
18:48:43*johnsoft quit (Ping timeout: 255 seconds)
18:49:10*johnsoft joined #nim
18:52:23*TEttinger joined #nim
18:54:02*randomwalk joined #nim
18:54:52randomwalkHow do I insert a #define statement into code generated by importc?
18:55:51randomwalk#define WINVER 0x0601 will tell MinGW to give me the function calls I need.
19:01:45Araqrandomwalk: just wrap it via .dynlib instead please
19:02:31Araq"[sdl2] Added discardable pragma to ttfInit (#29)" er guys, please stop doing that
19:02:50Araqyou really shouldn't ignore every single return value
19:02:57Araqfor "convenience"
19:03:13*Matthias247 joined #nim
19:04:03*johnsoft quit (Ping timeout: 250 seconds)
19:04:22*johnsoft joined #nim
19:05:48*Mat4 joined #nim
19:05:52Mat4hello
19:07:25Araqservus
19:16:27Mat4hi Araq
19:16:59randomwalkAraq: Thx. Nim is so easy. This code now turns off the damn DPI Scaling:
19:17:01randomwalkproc SetProcessDPIAware(): bool {.cdecl, dynlib: "User32.DLL", importc.} discard SetProcessDPIAware()
19:17:40TEttingernice randomwalk
19:17:59TEttingerbut it returns bool and discards?
19:18:33randomwalkI meant a newline there, but webchat makes it a space...
19:18:57randomwalkSo I discarded it in my call
19:21:50randomwalkThe only reason the Win32 API would return false to the call is if I create a window before calling that function. So yes, I should check the return value in production code, but I'm just learning nim....I don't know how to do that yet. :)
19:24:18randomwalk...actually, I'll just log a warning if it's false.... too much chat...not enough code. :)
19:28:27samlhttps://github.com/saml/helloweb#example-run nim is the last place how can i make it faster?
19:29:47*shalabh joined #nim
19:31:55*shalabh quit (Client Quit)
19:34:24def-saml: i actually want to look into this. we're aware that the performance of asynchttpserver is not so good
19:34:44def-saml: you compile the nim code with "nim -d:release c", right?
19:36:13def-37k requests/second isn't that bad, should be good enough for most workloads
19:37:17Mat4take a lool at the go results as comparison
19:37:37Mat4^look
19:38:09Araqiirc --gc:markAndSweep produces a faster httpserver
19:38:15samldef-, yup
19:38:31samlyah go, js, java all beats nim
19:38:40samlnim is the only thing that uses only single core
19:38:48samlit's silly hello world test anyways :P
19:39:45*dumdum quit (Ping timeout: 256 seconds)
19:41:40*fizzbooze joined #nim
19:46:28*randomwalk quit (Quit: Page closed)
19:51:14*janprill joined #nim
19:51:30BlaXpiritverbosity: 0 in nim.cfg doesn't work
19:54:10Araqwhy wouldn't it?
19:54:26Araqthe default value is set in nim.cfg ...
19:55:08Araqhrm no it's not
19:57:23*shalabh joined #nim
19:57:36BlaXpirit``verbosity: 0`` Error: identifier expected, but found '0' ``verbosity: "0"`` no effect
19:57:39Mat4hello shalabh
20:00:05shalabhHi Mat4
20:00:10BlaXpirit136 :o
20:00:30Mat4ah ok
20:02:09shalabhdoes anyone know when our gsoc application will be reviewed?
20:03:28*gsingh93 quit (Ping timeout: 264 seconds)
20:04:51Araqshalabh: we'll get results on 2nd of march
20:12:15*irrequietus joined #nim
20:13:42*shalabh quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
20:17:04*shalabh joined #nim
20:18:08*gsingh93 joined #nim
20:19:08*shalabh quit (Client Quit)
20:26:25*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
20:30:52*janprill quit (Ping timeout: 255 seconds)
20:31:08*janprill joined #nim
20:31:57*pregressive quit ()
20:34:52*BitPuffin quit (Ping timeout: 240 seconds)
20:35:31*Jesin quit (Quit: Leaving)
20:35:55*gsingh93 quit (Ping timeout: 250 seconds)
20:39:02*dts_ joined #nim
20:39:02*Jesin joined #nim
20:41:34flaviusaml: Doesn't your tester launch multiple threads (10) ?
20:41:59*clone1018_ quit (Ping timeout: 246 seconds)
20:42:02samloh yah
20:42:23samli'm probably wrong. for other languages, all cores max out. for nim, only one core maxes out
20:42:28samlfrom top
20:44:54*nande quit (Remote host closed the connection)
20:45:02*kjo joined #nim
20:47:11*shalabh joined #nim
20:47:29shalabhAraq:thanks
20:48:37*nande joined #nim
20:58:19*dts_ quit (Quit: Leaving)
21:00:15*jfchevrette quit (Quit: Textual IRC Client: www.textualapp.com)
21:00:25*xcombelle quit (Remote host closed the connection)
21:05:44*panzone quit (Quit: Leaving...)
21:07:11*Outlander quit (Ping timeout: 246 seconds)
21:07:31Araqsaml: can you find out why that is?
21:07:50samli thought asynchttpserver is single core?
21:11:29mpthrappDo compiled nim programs require the nim RT to be on the machine that's executing them?
21:12:37Araqmpthrapp: no unless your nim installation has a weird setup
21:13:21mpthrappAraq: Okay. So, if I compile the program on my machine, I can give it to a friend and they can run it without installing nim?
21:13:35mpthrappNot the source, but the fully compiled .exe
21:13:55*clone1018_ joined #nim
21:14:04*fizzbooze quit (Ping timeout: 255 seconds)
21:14:14Araqyes
21:14:30mpthrappAwesome, thanks. I'm just starting to learn nim, but I really like it.
21:14:41mpthrappIt's like compiled Python, but safer.
21:18:13*dtscode quit (Quit: ZNC - http://znc.in)
21:18:16*bjz joined #nim
21:18:47*dtscode joined #nim
21:22:08*pregressive joined #nim
21:23:34*dts|pokeball joined #nim
21:24:04*nande quit (Remote host closed the connection)
21:25:34*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:26:59shalabhnim doesn't have 'goto' statement, right?
21:28:05BlaXpiritshalabh, no, but block can do the useful things that might be done with goto
21:28:33shalabhBlaXpirit:do you mean breaking out of deeply nested loops? or something else?
21:28:41BlaXpiritmainly that
21:28:48BlaXpiritthat's like the 1 use case of goto
21:28:54shalabhI noticied while has the 'computedGoto' pragma which is nice.
21:29:24*dts|pokeball quit (Quit: Leaving)
21:33:09*gsingh93 joined #nim
21:33:35Mat4BlaXpirit: There are some other uses however quite special
21:39:13*reem joined #nim
21:40:45BlaXpiritI really can't find any other compilers except for `defined(gcc)`
21:41:09*janprill quit (Remote host closed the connection)
21:41:17BlaXpiritdoes not seem documented and is definitely not searchable
21:41:55*kjo2 joined #nim
21:41:55*kjo quit (Read error: Connection reset by peer)
21:46:34AraqBlaXpirit: read the very last question from here http://nim-lang.org/question.html
21:46:46Araqand now try to guess the conditional defines
21:47:00AraqI agree it's not optimal
21:47:46*janprill joined #nim
21:48:12shalabhwhat if i want a jump table without a while loop?
21:48:21shalabhof course i can just break at the end of each case..
21:48:45shalabhbut shouldn't the 'computedGoto' pragma be associated with the case statement and not the while?
21:48:50shalabhi feel i'm missing something..
21:49:07Araqshalabh: than you can just use the 'case' statement and trust the Nim/C compiler to do the right thing
21:49:18Araqit only makes a difference in loops
21:49:31shalabhi see, ok
21:51:01*janprill quit (Remote host closed the connection)
21:51:24Mat4shalabh: How do you build a jump-table without label pointers ?
21:52:24shalabhMat4:see the 'computedGoto' pragma
21:52:38shalabhit builds the jump table for you, from your 'case' statement
21:54:08Araqwell from the combination of 'while+case' actually
21:56:08*BitPuffin joined #nim
21:56:28Mat4shalabh: ok, I've readed your statement as if you want to build up a branch table though the label-as-address extension the Gnu Compiler introduced
21:56:58BlaXpiritok thanks
21:59:43*mpthrapp quit (Remote host closed the connection)
22:00:22*BitPuffin quit (Ping timeout: 240 seconds)
22:05:02shalabhMat4: right
22:05:38*brson joined #nim
22:07:37*nande joined #nim
22:09:19Mat4then its obvious you want to minimize the dispatch overhead by replacing the indirect call assembled though inlining direct branches, right ?
22:10:57shalabhyes i want to minimize the dispatch overhead
22:11:07*Demon_Fox joined #nim
22:11:15shalabhactually i was just wondering why 'computedgoto' needs to be inside a while
22:12:45*elbow joined #nim
22:13:17*Outlander joined #nim
22:13:33Mat4for this, you will need the pointer address for generated labels
22:14:02shalabhright, nim already does that for me.
22:15:16shalabhall i do is write a 'while+case' statement and nim will generate C code that uses the computed gotos table.
22:15:36*elbow is now known as elbow_jason
22:16:27Mat4right, you only can't access this table for inlining into a branch buffer
22:17:10AraqMat4: I think apart from you, nobody has this problem ;-)
22:17:29*Outlander quit (Ping timeout: 246 seconds)
22:17:55shalabhMat4:not sure what you mean
22:18:12shalabhwhy do i want access to the jump table?
22:18:19Mat4take a look here: https://github.com/Mat2/Vanar/blob/master/Berana%20-%20Interpreter/interpreter-dtt-64.c
22:18:33Mat4at the DECODE label
22:19:57Mat4modern CPU's are superscalar with large pipelines which relate on efficient branch predicition because pipline stalls can result in somehat 20- over 100 clock cycles
22:20:10*fizzbooze joined #nim
22:20:55Mat4this interpreter translate basic blocks of VM code to a list of direct branches (beside opcode fusion and software pipelining)
22:21:41Mat4for bypassing the poor prediction rate of modern BTB buffers for indirect branches
22:21:56shalabhhmm, so it's kind of a jit?
22:22:08Mat4a very simple one, yes
22:22:12fizzboozeI heard the Nim's GC isn't thread-safe. What exactly is meant by that?
22:22:16shalabhbut just compiles to a sequnce of jmp instructions?
22:23:11Mat4not directly, the jump translation is done by joining instructions reducing the dispatch overhead as addition
22:24:24shalabhnot sure I understand.
22:24:35shalabhyou want to avoid indexing the jump table?
22:25:38Araqfizzbooze: it means the GC is thread local and we use the type and effect system to ensure you don't screw it up. but it does limit expressitivity somewhat
22:25:48Mat4I want to avoid the poor prediction rate for indirect branches which lead to BTB stalls (somewhat 20-42 cycles) by replacing them though direct variants
22:26:13Mat4at runtime of course
22:26:36Mat4at moment there exist no way to port this code to Nim
22:26:45shalabhso a direct branch is where the address is the instruction operand itself, right?
22:27:09Mat4yes
22:28:09elbow_jasonAraq: why are double underscore not allowed in identifiers? just curious.
22:28:44Araqelbow_jason: cause they are ugly and serve no purpose
22:28:55elbow_jasonAraq: fair enough
22:29:04shalabhMat4:do you have benchmarks from using this technique?
22:30:20Mat4yes
22:30:39shalabhlink?
22:31:36Mat4uno momento
22:33:11Mat4https://www.assembla.com/spaces/navm/wiki/Benchmarks
22:33:30Mat4that's an older version as base for a forth environment
22:35:35Mat4my current design execute single instructions down to 0.5 cycles (against mean ~0,33 for native code) dependent on the code sequence [Intel iCore I3]
22:37:53ekarlsodtscode: you about ?
22:37:59Mat4please note gForth compiles directly to native code at basic-block level, a feature which the authors call 'dynamic super-instruction'
22:40:46*brson quit (Quit: leaving)
22:43:28fizzbooze0
22:43:57fizzboozeAraq how does the type and effect system prevent the user from screwing up?
22:46:24Araqfizzbooze: the compiler doesn't allow code is run in a different thread that is not gc-safe
22:46:50AraqI mean the proc you pass to a thread has to be gc-safe
22:47:07Araqand gc-safe means "doesn't access globals that contain GC'ed" memory
22:47:10Mat4ciao
22:47:19shalabhbye
22:47:24*Mat4 quit (Quit: Verlassend)
22:48:49Araqand so a .gcsafe proc cannot do dangerous things and the GC can stay thread local
22:49:18Araqnote that .gcsafe is a somewhat recent addition, so old versions of the language were simply unsafe
22:49:37Araqthis is usually what people refer to when they say "Nim's GC is not thread safe"
22:51:35shalabhso the globals are GCed in the main thread only, and any other thread has an isolated heap?
22:51:43Araqyes
22:51:48shalabhnice
22:51:52shalabhgood design if you ask me.
22:52:15shalabhshared mutable state is a bad pattern anyway. the complexity of multithreaded gc is not worth it.
22:52:22Araqthe really sweet thing about this is that Nim's .noSideEffect was in the language since forever
22:52:33Araqand .noSideEffect implies .gcsafe :-)
22:52:47shalabhah ok
22:56:26shalabh"Nim's GC is not thread-safe' sounds like a shortcoming
22:56:51shalabhIt should be 'Nim has multiple concurrent GCs'
22:56:58shalabh*tread-local GCs
22:57:03shalabhis that accurate?
22:57:07Araqyes
22:57:33shalabhit's not a shortcoming. it's a big benefit, the GC in one thread will not affect another thread at all.
22:57:52shalabhbut some kind of readonly shared memory would be nice.
22:58:04Araqhah
22:58:07Araqthing is
22:58:10shalabhcause you do want to share some things between threads
22:58:13shalabhor even an STM
22:58:41Araqgood GCs require read or write barriers
22:59:03Araqso what seems to be "readonly" can easily end up "read and write" under the hood
22:59:21Araqso yes, I agree it would be nice to have
22:59:27Araqbut it's not trivial to do
22:59:37shalabhah i see.
22:59:48Araqand besides, you can always cast the 'ref' to 'ptr' and do your dirty reads
23:00:00shalabhI see
23:00:26shalabhwell, in practice, you dont need to share all types of objects. you only need certain kind of data structures.
23:00:40shalabhe.g. binary blobs (caching), counters (stats) etc.
23:01:21shalabhif you have safe concurrent shared implemention for a few such data structures, i think it'll solve 99% of the use cases
23:01:37Araqyeah, but we currently don't have these ;-)
23:01:54Araqwe'll get there though
23:02:07shalabhwhat's the system for inter-thread communication though, apart from what's passed in spawn?
23:02:30Araqwe have some ugly old TChannel[T] type
23:02:39Araqwhich however, works quite well
23:02:43shalabhwhy ugly?
23:02:46shalabhchannels are fine
23:02:59shalabhso it deep copies the objects sent?
23:03:06Araqyes
23:03:29Araqand it's better used via a global variable ;-)
23:03:40elbow_jasonthe channel?
23:03:44Araqyeah
23:03:48elbow_jasonmakes sense
23:04:18Araqyeah, but globals are seen as ugly ;-)
23:04:29Araq(I don't agree, but that's a different topic)
23:05:22shalabhnonsense, of course channels have to global, that's the point of sharing
23:05:32elbow_jasontechnically, (my goodness I'm out of my element here) as long as two errr thread-thingies are at least in the same scope the channel can be defined in the largest/most outter shared scope, right?
23:05:37shalabhmaybe just call them 'shared' rather than 'global'
23:06:55Araqelbow_jason: not in Nim. thread procs cannot access any outer environments except global data (that doesn't use GC'ed data)
23:07:18elbow_jasonAraq: ahh I see prevents races and such
23:07:40*johnsoft quit (Ping timeout: 264 seconds)
23:07:44Araqyup
23:07:45shalabhwell, you should only be allowed to access data that's under your GC
23:08:14Araqshalabh: yes but by definition a "thread proc" runs in a different thread
23:08:36Araqbut there are also thread local variables
23:09:03Araqand these work with the thread local GC
23:09:14shalabhcan i create two disjoint, isolated heaps in a single thread if i want?
23:09:27Araqno the heap is attached to the thread
23:10:02AraqJehan wants that what you describe, but he doesn't want it badly enough to implement it
23:10:24shalabhok. another question - channels can be shared by any number of threads, right? i can use it like a work queue?
23:10:34shalabhyeah i dont want it badly either :)
23:10:41Araqand I don't have the time and would get the design wrong anyway since I don't really see the point
23:10:58elbow_jasonCommunicating sequential processes
23:11:03shalabhright the api/syntax would be tricky
23:11:24shalabhthe point would be to just pass one of these heap things from one thread to another
23:11:43Araqshalabh: yes you can do your work queue with a channel
23:14:05shalabhexcellent
23:16:12Araqso ladies and gentlemen, the famous "types API" landed in devel.
23:16:36Araqthat means finally you can access a nodes *type* within a macro properly
23:16:42Araqwithout resorting to hacks
23:17:33Araqfowl: take it for a test drive
23:19:57*Outlander joined #nim
23:21:22*vendethiel quit (Ping timeout: 240 seconds)
23:23:29ekarlsoAraq: what does that mean ?
23:23:34*vendethiel joined #nim
23:25:10*nande quit (Remote host closed the connection)
23:26:23Araqekarlso: what does what mean?
23:29:33elbow_jasonPhilosophically: what does 'what' mean?
23:29:36*nande joined #nim
23:35:43fowlinteresting :)
23:38:37fowlAraq, do i need -d:useNodeIds
23:38:52Araqno
23:39:24Araqand of course somebody needs to improve the docs for this thing
23:44:41*koz_ quit (Ping timeout: 250 seconds)
23:46:04fowlAraq, i get "node has no type" trying identifiers for types and variables
23:46:06*vendethiel quit (Ping timeout: 256 seconds)
23:46:21BlaXpirit:)
23:46:28fowlam i doing it wrong https://gist.github.com/fowlmouth/dc5dba4c17a56c5636f2
23:47:00Araqfowl: yes. 'expr' implies lazy semantic checking
23:48:05fowlah
23:49:03elbow_jason"It compiles to javascript"
23:49:07elbow_jasonwuuuut
23:49:44elbow_jasonis that still supported? and if so, how does one use that functionality?
23:50:24Araqit's supported but not many use it, so it's not well tested
23:50:40Araqbut we do use it for the website itself
23:50:50Araqthe Nimble package listing to be precise
23:51:10shalabhdoes it produce source maps to aid debugging?
23:51:16shalabh(when compiling to js)
23:51:25Araqno, it generates line tracing code instead
23:51:35Araqsource maps didn't exist when I wrote it
23:52:12shalabhok
23:52:17Araqfowl: but macro foo[T](t: T): stmt doesn't work either :-/
23:52:26Araqbut it should ...
23:52:41*vendethiel joined #nim
23:53:50Araqbut hrm ... 't' remains an nkIdent
23:54:56*irrequietus quit ()
23:55:07Araqmacro foo(t: stmt): stmt works though (why does this type check?)
23:56:33*Matthias247 quit (Read error: Connection reset by peer)