<< 11-08-2017 >>

00:00:04*endragor quit (Ping timeout: 240 seconds)
00:06:55*gangstacat quit (Quit: Leaving)
00:18:37skrylaranyone toyed with peaches.io
00:18:48*yglukhov joined #nim
00:18:57skrylarits supposed to be a documentation server although i'm not yet convinced that its better than just running hugo or some other markdown processor
00:22:57*yglukhov quit (Ping timeout: 240 seconds)
00:31:57*Sentreen joined #nim
00:40:21*Jesin joined #nim
00:46:31*rauss joined #nim
01:15:05*rational joined #nim
01:15:39subsetparkskrylar: considering they currently have django debug toolbar enabled in production, i'd say they're not quite ready for primetime
01:15:58skrylarbleh. thats the wrong peaches
01:16:27skrylarhttps://peachdocs.org/
01:16:52*mahmudov joined #nim
01:18:00subsetparkbetter :)
01:19:02*rational quit (Client Quit)
01:28:48*chemist69 quit (Ping timeout: 240 seconds)
01:32:19subsetparkdom96 (or anybody) - can I use either nimble or choosenim to install nimble@#head ?
01:33:13mahmudovhow can we convert a array to string ?
01:33:34skrylar`join`?
01:37:45mahmudovclient.sendLine(pack(join("[0,1,";$name;",";$param;"]")))
01:38:18mahmudovi tried this way but occurs Error: ')' expected
01:38:33mahmudovname=sum param=[1,2]
01:38:39mahmudovname="sum" param=[1,2]
01:39:49subsetparkmahmudov: https://www.irccloud.com/pastebin/vZ3GDDDa/
01:42:40*chemist69 joined #nim
01:43:34*skrylar quit (Ping timeout: 240 seconds)
01:46:08mahmudovi want to do this:
01:46:19mahmudov[0, 1, b'sum', [1, 2]]
01:46:50subsetparki'm afraid i don't follow
01:47:07subsetparkyou want that whole thing as a string?
01:48:04mahmudovyes
01:48:12mahmudovname="sum" param=[1,2]
01:48:27mahmudovalso at start will be 0,1
01:48:47mahmudov[0, 1, b'sum', [1, 2]]
01:51:07mahmudovor array
01:51:21mahmudovi want to convert this form.
01:52:20*cspar quit (Ping timeout: 260 seconds)
01:58:12subsetparkok, so i think you're saying you have some string "[0, 1, b\'$1\', $2]" - and you want to interpolate "sum" and "[1,2]" into placeholders 1 and 2
01:58:46mahmudovyes like this
01:58:49subsetparkbut in this case the first argument is the literal string "sum" but the second argument is an array containing the literal 1 and the literal 2
01:58:57mahmudovyeb
01:59:15mahmudovall of them will be concat
01:59:19mahmudovjoin*
02:00:04subsetparkso in that case you could say myPlaceHolderString % [name, repr(param)]
02:01:01*def-pri-1ub joined #nim
02:01:07*def-pri-1ub quit (Client Quit)
02:01:33*def-pri-pub quit (Quit: leaving)
02:06:10*def-pri-pub joined #nim
02:06:31subsetparkrepr(param) would give you "[1, 2]" - i suppose you could then do .replace(" ", "") if you wanted that exact form
02:08:16mahmudovcant we use more eeasy way: " [0, 1,"+ $name+"," +$param+"]"
02:08:21mahmudovlike this :) ?
02:10:52*smt__ joined #nim
02:14:11*MonsterAbyss_ joined #nim
02:16:34*endragor joined #nim
02:17:15*pilne quit (Quit: Quitting!)
02:18:54*MonsterAbyss quit (Ping timeout: 260 seconds)
02:18:55*smt quit (Ping timeout: 260 seconds)
02:18:57*Xe quit (Ping timeout: 260 seconds)
02:18:57*kunev quit (Ping timeout: 260 seconds)
02:18:57*onionhammer quit (Ping timeout: 260 seconds)
02:19:34*onionhammer joined #nim
02:20:47*Xe joined #nim
02:21:16*yglukhov joined #nim
02:22:04*dom96 quit (Ping timeout: 240 seconds)
02:24:05*dom96 joined #nim
02:25:34*yglukhov quit (Ping timeout: 240 seconds)
02:25:51mahmudovi found for string convert:
02:25:53mahmudov"[0,1," & name & ",[" & param & "]]"
02:25:57*kunev joined #nim
02:26:53mahmudovif i have string like this how can i convert to array ?
02:27:47*pwntus_ joined #nim
02:28:16*Pwntus quit (Ping timeout: 260 seconds)
02:30:57*dom96 quit (Ping timeout: 260 seconds)
02:31:04*ldlework quit (Ping timeout: 240 seconds)
02:33:22*ldlework joined #nim
02:33:22*ldlework quit (Changing host)
02:33:22*ldlework joined #nim
02:35:36*dom96 joined #nim
03:03:44*chriswakare joined #nim
03:03:48*chriswakare left #nim ("Leaving...")
03:07:07*rauss quit (Read error: Connection reset by peer)
03:08:54*rauss joined #nim
03:25:53mahmudovcan we define like this array?
03:26:25mahmudovThreedifferentType = array[3, int,int,string] ?
03:26:38mahmudov[1,2,"funcA"]
03:26:40mahmudov?
03:56:45def-pri-pubDon't think so
03:57:05def-pri-pubAre you trying to make an array that store variant datatypes?
03:57:57def-pri-pubYou could make a variant like this for the array: https://nim-lang.org/docs/manual.html#types-object-variants
04:01:21mahmudovvar child: tuple[ax: int, bx: int , cx: string , dx: array]
04:01:40mahmudovbut i cant success at last element type
04:02:13mahmudovdx: array should be any array cuz it can be [1,2] or ["a","b","c"]
04:02:35mahmudovmy tuple type works but last type fails
04:03:29mahmudovi think no need types-object-variants to me .
04:05:11def-pri-pubI think that's because you haven't given that array a type
04:05:51def-pri-pubFirst line: https://nim-lang.org/docs/manual.html#types-array-and-sequence-types
04:06:21def-pri-pub"Arrays are a homogeneous type, meaning that each element in the array has the sampe type."
04:07:09def-pri-pubYou also might want to try using a `seq` instead. They're a bit more flexable. Unless you're `dx` is going to be of a fixed lenght
04:07:24mahmudovcant we define at runtime
04:07:29mahmudovof a array type
04:07:58def-pri-pubNope.
04:08:10mahmudovbut i dont know the last parameter
04:08:11def-pri-pubarrays/seqs need to be of a fixed type
04:08:22mahmudovso what should i use?
04:08:31def-pri-pubBut you can set that array's type to be of that varaint I linked
04:08:42mahmudovtypes-object-variants ?
04:08:57def-pri-pubyeah
04:09:00def-pri-pubtake a look at that
04:09:09def-pri-pubDo you know what a variant is in general?
04:09:23mahmudovno
04:09:27def-pri-pubAh, okay
04:09:48def-pri-pubSay I've got some data that i want to put somewhere
04:09:56def-pri-pubthat data could be either of type `int` or type `string`
04:10:06mahmudovyeb,
04:10:17def-pri-pubThe Variant is a way of putting those two differnt types into the same place
04:10:29def-pri-pubHave you done python before? How about C or C++?
04:10:45mahmudovi am python coding
04:10:49def-pri-pubokay
04:10:57def-pri-pubPython is a very loosly typed language
04:11:02def-pri-pubso that means you can do something like:
04:11:06mahmudovnim limits typing
04:11:12def-pri-publ = [1, 2, "kevin bacon"\
04:11:15mahmudovlike dynamically?
04:11:16def-pri-publ = [1, 2, "kevin bacon"] *
04:11:24def-pri-pubYeah, nim isn't a dynamic language
04:11:27def-pri-pubNim is static
04:11:49def-pri-pubbut if we wanted to shove both integers and strings into the same list/array/sequence, in Nim, we can't do that
04:11:52def-pri-pubBut there is a trick
04:12:00def-pri-pubWe can have that list store a Variant type!
04:12:10mahmudovmore clear,
04:12:18def-pri-pubAnd the Variant can be either a string or an integer
04:12:47def-pri-pubUsing a Qt/C++ example, there is the QVaraint class:
04:12:48def-pri-pubhttp://doc.qt.io/qt-5/qvariant.html
04:13:15def-pri-pubIt allows you to shove many differnt datatypes into one space, then pass it around
04:13:32mahmudovat runtime?
04:13:32def-pri-pubSo IIRC, Nim doesn't have a built in Variant type
04:13:39def-pri-pubYeah, that works at runtime
04:13:47def-pri-pubBut we can make our own Variant type
04:14:02mahmudovhm cool.namely it based on condition
04:14:06def-pri-pubSo if you take a look at this again:
04:14:08def-pri-pubhttps://nim-lang.org/docs/manual.html#types-object-variants
04:14:24mahmudovok, am looking.it is more understandable at now :)
04:14:36def-pri-pubFollow that snippet of code there, and have a list/array/seq of `Node`, then you should be good
04:14:57def-pri-pubHave you ever done a statically typed language before?
04:15:00mahmudovlemme
04:15:18mahmudovten years ago :)
04:15:29def-pri-pubokay
04:15:51def-pri-pubI need to go nighty-night now because I'm tired. I'm sure if you run into any other problem someone else might be able to help out
04:16:04mahmudovok thnks much,me too :9
04:16:22def-pri-pubI do want to note that the snippet provided isn't the most flexible Variant type out there. Since right now it only lets you set the value when creating the `Node`, not later
04:16:38*joeyparsons quit (Quit: Connection closed for inactivity)
04:16:44def-pri-pubwait, hold on for a moment.
04:17:02mahmudov,
04:17:11def-pri-pubwhat we got right here is a nice little Variant implemented for us already:
04:17:12def-pri-pubhttps://github.com/yglukhov/variant
04:18:13def-pri-pubokay, have fun. Night.
04:18:18mahmudovcool
04:18:22mahmudovrethnk
04:18:59*def-pri-pub quit (Quit: leaving)
04:23:15*yglukhov joined #nim
04:27:53*yglukhov quit (Ping timeout: 255 seconds)
04:53:02*mahmudov quit (Remote host closed the connection)
05:00:48*haha_ joined #nim
05:02:52*sz0 quit (Quit: Connection closed for inactivity)
05:05:23*haha_ quit (Client Quit)
05:40:38*haha_ joined #nim
05:53:44*nhywyll joined #nim
05:56:00*Pisuke joined #nim
06:03:34*dankrad quit (Ping timeout: 240 seconds)
06:04:58*dankrad joined #nim
06:07:23*rauss quit (Quit: WeeChat 1.9)
06:11:03*haha_ quit (Quit: bye)
06:25:09*yglukhov joined #nim
06:29:34*yglukhov quit (Ping timeout: 240 seconds)
06:30:01*dddddd joined #nim
06:33:03*ShalokShalom joined #nim
06:35:59*nsf joined #nim
06:40:57*dankrad quit (Ping timeout: 240 seconds)
06:42:48*dankrad joined #nim
06:56:05*Parashurama joined #nim
07:12:22*Vladar joined #nim
07:30:33*endragor quit (Remote host closed the connection)
07:42:44*fredrik92 quit (Read error: Connection reset by peer)
07:43:05*smt__ quit (Ping timeout: 240 seconds)
07:43:37*smt_ quit (Ping timeout: 260 seconds)
07:46:54*couven92 joined #nim
07:48:57*gokr joined #nim
07:56:39*Parashurama quit (Quit: ChatZilla 0.9.93 [Firefox 54.0.1/20170630112252])
07:57:13*endragor joined #nim
08:11:07*yglukhov joined #nim
08:14:00chemist69Hi, I have just compile a small console app on Linux and cross-compiled the same app for Windows (with theese flags: --os:windows --cpu:amd64 --gcc.exe:x86_64-w64-mingw32-gcc --gcc.linkerexe:x86_64-w64-mingw32-gcc), both in release mode.
08:14:06chemist69I noticed that the two executables are very different in size: 95k for Linux vs. 465k for the Windows version.
08:14:16chemist69I do not remember this to be the case for earlier versions of Nim, is anybody aware of the possible reason?
08:22:49def-chemist69: You could use https://github.com/google/bloaty to check what's that big
08:23:07def-Ah, that probably has no Windows binary support
08:24:34chemist69Ah, ok, interesting project nonetheless, thanks.
08:25:45def-Did you try writing -d:release as the last command line argument?
08:25:53def-sometimes options overwrite each other
08:26:06chemist69let me try that...
08:27:55chemist69no, that didn't change the size
08:28:36def-x86_64-w64-mingw32-size -A
08:28:46def-versus size -A for linux binary
08:28:57chemist69if s.o. else wants to try, this is the app: https://github.com/apahl/nim_labtools/blob/master/labtools/split_csv.nim
08:28:58def-from what I can tell the windows build has debug info in it
08:29:08def-I have it reproduced with just 'echo "Hello World"'
08:29:21chemist69Ok.
08:29:22def-not sure why -d:release doesn't remove debug info for mingw
08:29:46def-as a workaround you can x86_64-w64-mingw32-strip -s
08:30:38chemist69def-: nice one, thanks, it's now down to 85k.
08:31:48*Matthias247 joined #nim
08:34:31def-What happened to the nim compile time btw?
08:34:57def-Seems really long now, especially with -d:release
08:35:11def-8 seconds for "hello world"
08:36:01chemist69def-: do you think I should file an issue for cross compilation not honoring release flag?
08:36:33def-I'm not sure yet what's going on exactly
08:36:43chemist69btw, have you updated to the latest devel? I think compile times improved again.
08:37:11euantordef-: The compile time issue should be fixed in head I believe. SOmething about empty loops
08:37:33euantorhttps://github.com/nim-lang/Nim/commit/153441db1da722c0fb5c210a09d9a83a5d1b9656
08:38:37couven92def-, update the repo? There was an issue with the nim compiler that Araq fixed recently
08:38:47couven92to speed up compile time
08:38:58def-yes, updated. still slow
08:39:03couven92hmm...
08:39:18def-maybe it's my gcc version doing more optimizations now
08:40:16def-clang is a bit faster, but 3 seconds for hello world seems long to me
08:43:45def-system module seems to be taking much longer. doesn't matter much for bigger programs, on small ones you notice
08:45:14def-chemist69: not a bug in Nim, MinGW includes debugging information in its libraries, so you have to strip them after the build: http://www.mingw.org/wiki/large_executables
08:45:42def-We could pass -s when linking using mingw
08:46:13def---gcc.options.linker=-s
08:49:34chemist69great, thanks for investigating this.
08:53:06def-system module C compile times: -O0: 2.3 s, -O1: 2.9 s, -O2: 3.5 s, -O3: 6.2 s
08:59:49def-nothing specific seems to be the cause, it's just big. maybe dead code elimination isn't trimming it down anymore
09:17:19*dom96|w joined #nim
09:18:31FromGitter<timmyjose> Hey folks, working through Dominik Picheta's excellent book, "Nim in Action". Just curious - if I want to interface Nim with Java, say write a module in Nim and then load that using Java, I would have to simply bundle the compiled c code into a lib and load with JNI/JNA into Java. Is this the idiomatic way?
09:20:07FromGitter<zetashift> @timmyjose not sure if it's the idiomatic way, but maybe this can help you: https://github.com/vegansk/jnim
09:20:37FromGitter<timmyjose> @zetashift Thanks for that! Looks very interesting
09:28:49*adeohluwa joined #nim
09:31:49dom96|wyglukhov maybe you'd be able to help timmyjose out?
09:32:32dom96|wtimmyjose: btw thanks for buying my book (and calling it excellent) :)
09:35:07FromGitter<TiberiumN> @timmyjose I think jnim wouldn't help you if you want to use Nim from Java. It helps if you want to use Java from nim :)
09:36:10*dddddd quit (Remote host closed the connection)
09:37:07FromGitter<TiberiumN> https://github.com/nim-lang/Nim/blob/devel/examples/cross_calculator/android/src/com/github/nimrod/crosscalculator/CrossCalculator.java ⏎ ⏎ this can help you with simple java integration
09:37:16FromGitter<TiberiumN> it's an example for android, but it should work for PC too
09:39:11FromGitter<timmyjose> @TiberiumN Thank you for the link! I am just a noob in Nim right now, but calling Nim from Java would be a very viable use case for me, and would help showcase it to my teammates. I will check it out. Thank you!
09:39:38FromGitter<timmyjose> @dom96 I love the book so far. Thank you for putting in the effort! :-)
09:41:51*Pisuke quit (Max SendQ exceeded)
09:43:01*Pisuke joined #nim
09:43:34FromGitter<TiberiumN> @dom96 I don't know where nim is 0.12.0 - https://github.com/nim-lang/Nim/issues/6221#issuecomment-321693802
09:44:01FromGitter<TiberiumN> well it seems that ubuntu Xenial has only 0.12.0
09:44:08FromGitter<TiberiumN> but it's the maintainer problem sadly
09:55:28*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
09:56:57*Tiberium joined #nim
09:59:22*dom96|w joined #nim
10:02:16yglukhovtimmyjose, you just define functions like you would in C, and call them from java, just make sure nim GC is properly initialized. Also jnim contains an experimental module that allows "subclassing" java insterfaces from within nim.
10:03:11yglukhovso feedback is welcome =)
10:05:37dom96|wUbuntu's packages are always far behind. This works well for established software but not for bleeding edge stuff like Nim.
10:09:07Tiberiumstrange that Debian has more recent versions of Nim than Ubuntu xD
10:24:21Tiberiumhmm
10:24:40Tiberiumshould I report a C compiler error with clang++ and CPP backend (issue with OpenSSL wrapper)?
10:28:04Tiberiumhttps://github.com/nim-lang/Nim/issues/6233
10:30:23TiberiumI discovered this issue by accident (just wanted to test cpp backend for my small library)
10:32:32couven92I have `--passC:"compiiler option"` in my nim.cfg. Why does `get("passC")` return an empty string in nimscript?
10:33:34couven92when running `nim e myNims.nims` nim even states that it used the config file with the `--passC` line
10:40:04Jipok[m]Are there people who are versed in nimx? How to output a bitmap on the form?
10:40:16Jipok[m]I used SelfContainedImage.new().initWithBitmap(addr(bitmap[0]), imgW, imgH, 3)
10:40:30Jipok[m]But initWithBitmap does not work when compiled in js
10:41:07TiberiumJipok[m], you can ask yglukhov
10:41:16Tiberiummaybe :)
10:42:30*nhywyll quit (Quit: nhywyll)
10:43:34*sz0 joined #nim
10:48:28*xet7 quit (Read error: Connection timed out)
10:49:02*xet7 joined #nim
10:49:54couven92no ideas? I really can't see why this is not working?
10:50:45dom96|wbug?
10:51:23couven92okay so it should work? I'm not doing something totally stupid here? :O
10:51:33couven92That's good to know! :D
11:07:00couven92how do I get the platform specific newline string in Nim?
11:07:52euantorI believe that's just `"\n"`
11:08:20euantor`\n` is a platform specific newline sequence - on windows it's `\C\L`
11:08:36couven92okay
11:10:15couven92why can't I call `open` in NimScript?
11:10:32couven92and how do I read the contents of a file in NimScript?
11:11:00couven92and finally how do I write to a file in NimScript?
11:12:59euantorTo read it's `slurp`/ `staticRead`: https://nim-lang.org/docs/system.html#slurp,string
11:13:15euantorI don't think you can write a file, but could be wrong
11:13:56couven92that would be very anoying... :(
11:16:07*xet7 quit (Read error: Connection timed out)
11:16:14*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
11:16:36*xet7 joined #nim
11:17:28couven92okay, so I'd have to do a nim compile instead... How can I capture Nim compiler options at compile time?
11:17:55*ShalokShalom quit (Quit: No Ping reply in 180 seconds.)
11:19:42couven92I need to capture the value of the passC switch at compile time? How do I do that?
11:20:46*dom96|w joined #nim
11:22:03*ShalokShalom joined #nim
11:24:56*yglukhov quit (*.net *.split)
11:24:57*endragor quit (*.net *.split)
11:27:24*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
11:34:11*mahtov2 joined #nim
11:34:35couven92is there no way to get the compiler options as a string or something?
11:36:24*mahtov quit (Ping timeout: 255 seconds)
11:39:42euantorI'm not sure I'm afraid
11:40:49FromGitter<zacharycarter> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compile-time-define-pragmas
11:41:18FromGitter<zacharycarter> besides checking just for their existence
11:41:26FromGitter<zacharycarter> that's the only way I know of to retrieve user defined values from compilation
11:41:30FromGitter<zacharycarter> couven92 ^
11:41:30couven92zacharycarter: that's only for defines though
11:41:41couven92I need --passC
11:41:57FromGitter<zacharycarter> I don't think it's possible
11:42:01FromGitter<zacharycarter> what is your use case anyway? just ooc
11:42:01couven92which I don't pass via command-line, but via config
11:42:52couven92I am using vccexe and I need to creata a custom step where `vccexe --command:midl` i sused instead of `cl`
11:43:12couven92in order to compile and transform a COM interface defintion to a C header
11:43:16FromGitter<zacharycarter> interesting
11:44:11FromGitter<zacharycarter> I'd check with Araq
11:44:16FromGitter<zacharycarter> but I think the answer is no
11:44:38couven92yeah, I'll do that later... I need to grab some food first though... :P
11:44:52FromGitter<zacharycarter> enjoy!
11:45:06couven92well I could always include compiler/nimconf and do exactly as the nim compiler does :P
11:51:27*endragor joined #nim
11:51:31*yglukhov joined #nim
11:52:48*PMunch joined #nim
11:55:38*dom96|w joined #nim
11:57:48*adeohluwa quit (Quit: Connection closed for inactivity)
12:05:00*mahmudov joined #nim
12:05:15*dddddd joined #nim
12:09:08*ftsf quit (Ping timeout: 255 seconds)
12:17:27*GaveUp quit (Ping timeout: 240 seconds)
12:19:09*surma quit (*.net *.split)
12:19:09*joshbaptiste quit (*.net *.split)
12:19:30*joshbaptiste joined #nim
12:19:44*surma joined #nim
12:22:56*GaveUp joined #nim
12:23:02*mahtov2 quit (Ping timeout: 260 seconds)
12:24:07*mahtov joined #nim
12:36:16*BitPuffin|osx joined #nim
12:38:05*gokr quit (Quit: Leaving.)
12:42:31*yeeve quit (Remote host closed the connection)
12:46:03*yeeve joined #nim
13:19:29*endragor quit (Remote host closed the connection)
13:23:08*endragor joined #nim
13:26:04*GaveUp quit (Ping timeout: 276 seconds)
13:27:47*endragor quit (Ping timeout: 260 seconds)
13:31:15*rauss joined #nim
13:39:25*GaveUp joined #nim
13:41:50*yglukhov quit (Ping timeout: 240 seconds)
13:42:22*smt joined #nim
13:42:23*smt` joined #nim
13:43:31*yglukhov joined #nim
13:58:14*couven92 quit (Quit: Client disconnecting)
14:01:05*yglukhov quit (Ping timeout: 240 seconds)
14:03:14*yglukhov joined #nim
14:06:01Jipok[m]Has anyone tried to make a wrapper for a Oryol?
14:06:12Jipok[m]https://github.com/floooh/oryol
14:06:24Jipok[m]Looks interesting
14:07:37Jipok[m]runs on OSX, Linux (incl RaspberryPi), Windows, iOS, Android, emscripten, from the same C++ source
14:08:08Jipok[m]support Nuklear UI, Dear Imgui
14:09:52*xet7 quit (Quit: Leaving)
14:11:45*yglukhov quit (Ping timeout: 248 seconds)
14:14:40*yglukhov joined #nim
14:15:16*yglukhov_ joined #nim
14:18:35*yglukhov quit (Ping timeout: 240 seconds)
14:19:04*yglukhov joined #nim
14:19:55*PMunch quit (Quit: Leaving)
14:22:02*yglukhov_ quit (Ping timeout: 260 seconds)
14:43:56*couven92 joined #nim
14:49:57*dankrad quit (Ping timeout: 240 seconds)
14:55:20*nsf quit (Quit: WeeChat 1.9)
15:08:45FromGitter<timmyjose> @yglukhov Thank you! I will definitely check it out and give any feedback that I might have! :-)
15:11:10raussThe docs say the fsmonitor module will disappear or be packaged separately soon. Is there a recommended alternative yet?
15:12:14*Jesin quit (Quit: Leaving)
15:14:35*Jesin joined #nim
15:16:55*BitPuffin|osx quit (Ping timeout: 255 seconds)
15:19:18*Trustable joined #nim
15:32:12dom96|wrauss: not AFAIK. Search Nimble. Otherwise: a good project for you :)
15:41:32*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
15:49:51subsetparkdom96: it seems that (at least when running under choosenim) there's no way to run nimble@#head. if you choosenim #head, it uses nimble .8.6, and if you then nimble install nimble@#head, the binary is broken; it looks for system.nim in the wrong place
16:16:44yglukhovJipok[m]: just noticed your nimx question. are you here?
16:29:23subsetparkBTW yglukhov: https://ghostbin.com/paste/w8h9g
16:29:36subsetparkThat's my jester implementation using your threadpool
16:31:01yglukhovsubsetpark: nice! so what do you think about it?
16:31:29*couven92 quit (Ping timeout: 255 seconds)
16:31:53yglukhovsubsetpark: how about going a bit further and make nim's asynchttpserver multithreaded? =)
16:32:23subsetparkYeah, that's definitely the next step :)
16:32:30subsetparkI mean... For somebody. Not necessarily for me.
16:32:42subsetparkEspecially since it still uses the while(true) approach, which I know you don't like
16:36:34Tiberiumwell ideally having multithreaded async in general would be very nice (if it would be optional)
16:39:15*couven92 joined #nim
16:42:44*dankrad joined #nim
16:48:26*BitPuffin|osx joined #nim
16:52:32*dddddd quit (Ping timeout: 260 seconds)
16:53:22*dddddd joined #nim
16:54:34federico3as well as as non-async multithreaded httpserver
17:03:39yglukhovfederico3: huh? whats the point?
17:05:38*brentp joined #nim
17:13:09federico3yglukhov: handling concurrent requests leveraging all cores
17:15:13Jipok[m]yglukhov: How to output a bitmap on the form?
17:15:20yglukhovfederico3: yeah, why not multithreaded + async?
17:15:22Jipok[m]I used SelfContainedImage.new().initWithBitmap(addr(bitmap[0]), imgW, imgH, 3)
17:15:23Jipok[m]But initWithBitmap does not work when compiled in js
17:16:15federico3yglukhov: I mean both - some users are not writing async code
17:16:32yglukhovJipok[m]: yeah. don't use that.
17:17:08yglukhovJipok[m]: https://github.com/yglukhov/nimx/blob/master/test/sample03_image.nim
17:17:22yglukhovspecifically: sharedAssetManager().getAssetAtPath("cat.jpg") do(i: Image, err: string):
17:17:49Jipok[m]saw this
17:18:08yglukhovand? did not like? =)
17:18:27Jipok[m]I generate the image dynamically
17:18:40yglukhovrenderToImage?
17:18:53yglukhovor generate to som file and want to open that?
17:19:20yglukhovif some file, then haw is that supposed to work on js?
17:19:25yglukhov*how
17:20:01yglukhovor do you want to load it from url?
17:20:07yglukhovloadImageFromURL("http://gravatar.com/avatar/71b7b08fbc2f989a8246913ac608cca9") do(i: Image):
17:20:18*Jipok[m] sent a long message: Jipok[m]_2017-08-11_17:20:12.txt <https://matrix.org/_matrix/media/v1/download/matrix.org/IHoFdGtfXhxXrLxeNmHaPYrG>
17:20:22Jipok[m]runtime generation
17:20:41yglukhovyeah, but how? in the client code?
17:20:46yglukhovwith renderToImage?
17:20:53yglukhovor with canvas?
17:21:14yglukhovor with raw uint8array or smth?
17:21:40Jipok[m]raw uint8array
17:21:46yglukhovah ok
17:21:54yglukhovlet me think =)
17:22:00Jipok[m]But in general any variant of work with pixels
17:22:46Jipok[m]I want to play around with cellular automata
17:24:07yglukhovJipok[n]: as a quick solution... nimx image may be initialized with js Image object... can you do that?
17:24:29yglukhovbut i admit i haven't thought of your use-case =)
17:25:06yglukhovJipok[m]: see initWithJSImage in image.nim
17:25:44Jipok[m]Ideally, I would like a cross-platform solution
17:26:53yglukhovJipok[m]: i know, unfortunately there is none for this use-case, but should be easy to make. contribution is welcome ;)
17:27:17yglukhovi can answer your questions should you have any regarding the implementation
17:28:07*Vladar quit (Quit: Leaving)
17:29:58Jipok[m]How difficult is it to implement access to editing pixels?
17:30:10Jipok[m]For all platforms
17:33:28*nsf joined #nim
17:36:13*pilne joined #nim
17:39:47*couven92 quit (Ping timeout: 260 seconds)
17:40:34*couven92 joined #nim
17:47:28yglukhovJipok[m]: access to pixels from nimx Image is counter productive, since nimx.Image internally uses gl textures. but it is easy to create a texture from pixels. so if you're not doing it at 60fps, you should be fine
17:50:46dom96subsetpark: Indeed. Although you should be able to install nimble@#head yourself.
17:51:13subsetparkI wasn't able to do so without encountering the system.nim error
17:51:18dom96Try installing `compiler@#head`
17:51:23dom96before attempting to install Nimble
17:51:35subsetparkI don't think that's it - nimble@#head requires compiler@#head
17:51:40dom96I know
17:51:44dom96But you may have a stale version
17:51:47subsetparkok
17:51:50dom96Nimble won't upgrade it implicitly
17:52:12dom96(Which is a bug :))
17:55:01*willprice joined #nim
17:55:20*endragor joined #nim
17:55:49*Sentreen quit (Ping timeout: 276 seconds)
18:05:37*dankrad quit (Ping timeout: 255 seconds)
18:06:30couven92dom96, can you get nimble to run a task in a before block? i.e. create tasks that have dependencies?
18:07:02dom96not right now
18:07:06couven92for example, i'd like my nimble to run my docall task on install
18:07:15dom96this is planned
18:07:19*dankrad joined #nim
18:07:20couven92cool :)
18:07:21dom96feel free to create an issue to track it
18:08:13*Sentreen joined #nim
18:23:09*mal`` quit (Quit: Leaving)
18:23:42*Jipok[m] quit (Remote host closed the connection)
18:23:42*dyce[m] quit (Read error: Connection reset by peer)
18:23:43*Demos[m] quit (Read error: Connection reset by peer)
18:23:43*ehmry quit (Read error: Connection reset by peer)
18:23:44*jivank[m] quit (Read error: Connection reset by peer)
18:23:45*mindB quit (Remote host closed the connection)
18:23:45*MrAxilus[m] quit (Remote host closed the connection)
18:23:46*TheManiac quit (Read error: Connection reset by peer)
18:23:46*hohlerde quit (Read error: Connection reset by peer)
18:30:01*Jipok[m] joined #nim
18:32:11*mal`` joined #nim
18:36:24*ehmry joined #nim
18:36:24*Demos[m] joined #nim
18:36:24*MrAxilus[m] joined #nim
18:36:24*mindB joined #nim
18:36:24*dyce[m] joined #nim
18:36:31*TheManiac joined #nim
18:36:31*jivank[m] joined #nim
18:36:31*hohlerde joined #nim
18:50:03*Jesin quit (Quit: Leaving)
18:54:38*nsf quit (Quit: WeeChat 1.9)
18:57:47*haha_ joined #nim
19:00:36FromGitter<jacob88888> ```code paste, see link``` ⏎ ⏎ This gives a 'mousePosition' cannot be assigned to error, anyone know why? Thanks [https://gitter.im/nim-lang/Nim?at=598dfed41c8697534aac645f]
19:01:36FromGitter<Smaehtin> @jacob88888 `method setMousePosition*(this: var Input) { .base.} = ...`
19:01:53FromGitter<Smaehtin> *var* being the important part here
19:02:21FromGitter<jacob88888> Oh great that works thanks, sort of like Rust &self and &mut self
19:03:36FromGitter<Smaehtin> Exactly! Unless you declare `Input`as a `ref object`, then you don't need `var` since `ref`s are always(?) mutable
19:06:14dom96yep
19:06:48FromGitter<jacob88888> Thanks, pointers and ref syntax are next on the list, nim is not too hard to learn :)
19:08:59*endragor quit (Remote host closed the connection)
19:09:41*endragor joined #nim
19:14:09*endragor quit (Ping timeout: 248 seconds)
19:18:46FromGitter<cyberlis> a have a question
19:19:08FromGitter<cyberlis> in python i can do this `file_obj.read(1024)`
19:19:17FromGitter<cyberlis> i need the same in nim
19:19:44FromGitter<cyberlis> how can i read custom amount of bites
19:24:17*xet7 joined #nim
19:25:06AraqreadBuffer?
19:25:35FromGitter<cyberlis> but i need to create some kind of buffer?
19:25:52FromGitter<cyberlis> i cant find any example
19:26:45FromGitter<cyberlis> i think it is important to have examples wich discribe how to use files
19:26:46dom96better use readBytes
19:26:48dom96https://nim-lang.org/docs/system.html#readBytes,File,openArray%5B%5D,Natural,Natural
19:27:01FromGitter<cyberlis> i found this function
19:27:13FromGitter<cyberlis> how i create buffer?
19:27:25FromGitter<cyberlis> what is start?
19:27:38FromGitter<cyberlis> is it position in the file?
19:28:06dom96var x = newString(1000)
19:28:13dom96file.readChars(x, 0, 1000)
19:28:22dom96(you probably want readChars actually)
19:28:30FromGitter<cyberlis> ok, thank you
19:29:56FromGitter<cyberlis> but are you agree, that it is important to know, how use files in the language
19:30:09FromGitter<cyberlis> may be this need to be in the manual?
19:30:40dom96yes, but the manual is too large for this IMO
19:31:03dom96I think a guide titled "Reading and writing files in Nim" would be great
19:31:28dom96You can write it and submit it as an article to the website repo
19:31:42dom96then we can link it from the docs page
19:32:39FromGitter<cyberlis> ok, i will investigate and try to write it
19:33:11*mo joined #nim
19:33:32*mo is now known as Guest5798
19:34:21*Guest5798 quit (Client Quit)
19:36:39dom96cyberlis: or you could simply add an example in readChar's docs
19:36:48dom96You've found it yourself so an example in there would have helped you a lot
19:38:30FromGitter<cyberlis> yes. it is good idea
19:38:55dom96search for 'code-block' in the Nim source code to see how to add code samples into docs
19:39:13Tiberiumhe knows that already :)
19:40:35FromGitter<zacharycarter> ugh testing JS is so asinine
19:40:55FromGitter<zacharycarter> test your redux action creators! make sure javascript does what it's supposed to do!
19:41:12*salewski joined #nim
19:42:33Tiberiumwell I don't understand why JS has too many frameworks
19:42:37Tiberiumtesting? 100 libraries
19:42:43Tiberiumpython is better at this
19:43:12*sz0 quit (Quit: Connection closed for inactivity)
19:43:38FromGitter<zacharycarter> http://redux.js.org/docs/recipes/WritingTests.html#action-creators
19:44:05FromGitter<zacharycarter> the absolute only reason I am writing tests for these is A) to appease someone else and B) so I can see that 100% green status when I run npm run test
19:44:07FromGitter<zacharycarter> :P
19:44:52Tiberiumhmm, I think nim should have some wasm-specific features :)
19:44:56*yglukhov quit (Remote host closed the connection)
19:45:01Tiberiumfor example accessing DOM from wasm
19:45:02FromGitter<zacharycarter> like?
19:45:09FromGitter<zacharycarter> that'd be neat
19:45:22TiberiumI heard that WASM has no big performance penalty like asm.js
19:45:28*yglukhov joined #nim
19:45:32*Parashurama joined #nim
19:45:51salewskiAraq, I have a macro which gets a ref to an object as parameter (widget):
19:45:55salewskimacro drawConnect(widget: gobject.Object; signal: string; p: untyped; arg: typed): typed =
19:46:05salewski let wt = getType(widget)
19:46:22salewski""" % [$procNameCdecl, all, $p, ($(wt[1].toStrLit)).replace(":ObjectType", ""), $(at.toStrLit)]
19:46:57salewskiSo to get the real string representation, I have to do the replace(":ObjectType", "")
19:47:39salewskiIs that desired, or can I simplify that? I want to get plain string type, like "Button".
19:49:02*yglukhov_ joined #nim
19:49:30*yglukhov quit (Ping timeout: 240 seconds)
19:49:53*rauss quit (Quit: WeeChat 1.9)
19:50:53salewskiWhat I was doing is, that I have replaced the "quote do" notation in the macro with string interpolation
19:51:58salewskifollowed by parseStmt(). Because that gives me more freedom for really complicated multible parameter
19:52:09salewskiconnect() macros.
19:53:03salewskiBut getType() seems to give a string with the ":ObjectType" tail.
19:53:46*Parashurama quit (Quit: Leaving)
19:53:57*yglukhov_ quit (Ping timeout: 260 seconds)
19:54:51salewskiOf course the ($(wt[1].toStrLit)).replace(":ObjectType", "") works fine. But looks strange.
19:56:01*yglukhov joined #nim
19:57:06*haha_ quit (Quit: haha_)
19:57:55Tiberiumdom96, look that I've found! https://github.com/cjxgm/jsonob
19:58:02Tiberiumthere's Option[type] support
19:58:05Tiberiumbut no object variants
19:58:45dom96oh cool
19:59:45Araqsalewski: that's an artifact of your type definitions I think if you use 'Foo = object' instead of 'Foo = ref object' the compiler actually has a name for the object type
20:00:18Araqand does not have to construct one for you (the :ObjectType suffix)
20:00:22*yglukhov quit (Ping timeout: 255 seconds)
20:00:40salewskiAraq thanks, I will try that.
20:01:49*MrAxilus[m] quit (Read error: Connection reset by peer)
20:01:49*hohlerde quit (Remote host closed the connection)
20:01:51*Jipok[m] quit (Remote host closed the connection)
20:01:51*TheManiac quit (Remote host closed the connection)
20:01:51*ehmry quit (Read error: Connection reset by peer)
20:01:52*dyce[m] quit (Read error: Connection reset by peer)
20:01:53*mindB quit (Read error: Connection reset by peer)
20:01:53*jivank[m] quit (Remote host closed the connection)
20:02:34*Demos[m] quit (Ping timeout: 276 seconds)
20:04:06dom96I had to deal with this :ObjectType stuff for my JSON deserialiser actually.
20:04:15dom96Take a look at it to see how I've handled it
20:04:49*Jipok[m] joined #nim
20:05:30salewskidom96, thanks.
20:06:29salewskiCurrently my code looks indeed like "Button* = ref object of Bin"
20:10:01dom96IIRC you need to call getType on the node again or something like that.
20:10:11dom96It's honestly a bit too messy for my taste
20:11:40*MrAxilus[m] joined #nim
20:11:40*Demos[m] joined #nim
20:11:40*dyce[m] joined #nim
20:11:40*ehmry joined #nim
20:11:40*mindB joined #nim
20:11:47*TheManiac joined #nim
20:11:47*hohlerde joined #nim
20:11:47*jivank[m] joined #nim
20:13:27*aziz joined #nim
20:13:36*aziz quit (Client Quit)
20:13:41*salewski quit (Quit: WeeChat 1.4)
20:19:10dom96Oooh, my mum says print copies of my book arrived. So you guys should start getting them soon too :D
20:19:46FromGitter<shalabhc> congrats @dom96
20:20:08dom96Thanks :)
20:22:15TiberiumTIL nim has genDepend compiler command :D
20:23:10dom96Tiberium: Thank you for going through the issues and testing them :)
20:23:21Tiberiumdom96, well it's not a hard task
20:23:54dom96Yeah, doesn't require much effort. *hint hint for other people that want to contribute* :)
20:24:14FromGitter<cyberlis> contribute to what?
20:24:50Tiberiumnim :)
20:32:04*yglukhov joined #nim
20:32:56*rauss joined #nim
20:36:08*yglukhov quit (Ping timeout: 240 seconds)
20:37:05dom96btw guys, last chance to do the Nim community survey https://goo.gl/forms/0dxgbGFSnPpYlnCY2
20:37:11dom96I'll be closing it by the end of this weekend
20:37:50ehmryI try to remain ignorant of the JS but are sockets available when compiling for the browser?
20:38:06Tiberiumehmry, no, but there's websockets library for nim, which supports JS
20:38:26ehmryTiberium: ok, thanks
20:44:16Tiberiumoh, my issue is a duplicate!
20:44:34Tiberiummy issue -https://github.com/nim-lang/Nim/issues/6233, original one - https://github.com/nim-lang/Nim/issues/5684
20:51:17*Tiberium quit (Remote host closed the connection)
20:53:38*Jesin joined #nim
20:59:22FromGitter<cyberlis> i've done the survey
20:59:47FromGitter<TiberiumN> dom96: interesting to see results actually (because I didn't participate in 2016 community survey)
21:05:32euantorYeah, will be interesting to see the results compared to last year
21:09:46dom96Yeah. I'll probably focus the analysis on interesting things this time instead of analysing everything
21:09:52dom96The last blog post was far too long
21:21:19FromGitter<TiberiumN> what about 0.17.2 on this weekend? some big issues still here?
21:22:05*sz0 joined #nim
21:22:55dom96not sure, up to Araq
21:23:08dom96still the plan to release
21:33:32*def-pri-pub joined #nim
21:34:03*Trustable quit (Remote host closed the connection)
21:41:42FromGitter<TiberiumN> It's it better to include all handler modules in one file (modules are just like different handlers)? because i import modules in each handler module ⏎ because this looks like hell - http://i.imgur.com/LkJN6tN.jpg (maybe it looks like this for every Nim app with s lot of imports)
21:46:33FromGitter<TiberiumN> i'll see how this graph looks for nimble
21:48:03FromGitter<TiberiumN> ooh, nimble.png is 18mb
21:49:02dom96awesome
21:49:05dom96upload it :P
21:49:51FromGitter<TiberiumN> yeah im doing it right now, I'm from the phone :)
21:50:13FromGitter<TiberiumN> termux has graphviz package too
21:51:00FromGitter<TiberiumN> https://transfer.sh/slBJl/nimble.png
21:51:31FromGitter<TiberiumN> 32244x2843 oh my
21:52:24*Matthias247 quit (Read error: Connection reset by peer)
21:52:51FromGitter<TiberiumN> is there a main file for nim compiler?
21:54:50dom96it's so big because it basically includes the compiler
21:54:57FromGitter<TiberiumN> ah, ok
21:55:01dom96so the graph for the compiler will be smaller :)
21:55:17FromGitter<TiberiumN> my phone can't even handle this image
22:05:05subsetparkdom: installing compiler@#head then nimble@#head produces nimble errors https://www.irccloud.com/pastebin/jY43wesw/
22:15:53*yglukhov joined #nim
22:20:05*yglukhov quit (Ping timeout: 246 seconds)
22:26:41*brentp quit (Quit: Page closed)
22:30:32dom96Does `/home/zax/.nimble/pkgs/lib` exist?
22:54:37*nsf joined #nim
23:12:30*nsf quit (Quit: WeeChat 1.9)
23:32:31*willprice quit (Ping timeout: 276 seconds)
23:35:29*Sentreen quit (Ping timeout: 248 seconds)
23:39:10*rauss quit (Quit: WeeChat 1.9)
23:40:07*rauss joined #nim
23:49:43*Sentreen joined #nim
23:55:51*couven92 quit (Read error: Connection reset by peer)
23:56:36*yglukhov joined #nim