00:01:57 | * | relax joined #nim |
00:13:28 | * | libman quit (Quit: Connection closed for inactivity) |
00:16:34 | * | def-pri-pub1 quit (Quit: Leaving.) |
00:21:21 | * | relax quit (Ping timeout: 248 seconds) |
00:34:08 | * | def-pri-pub joined #nim |
00:40:58 | * | vivus quit (Quit: Leaving) |
00:45:09 | JappleAck | if someone interested, i just implemented some algebraic data types and kinda functors https://pastebin.com/uBTeBdsz (Maybe and Either) |
00:52:18 | JappleAck | https://gist.github.com/unclechu/eb37cc81e80afbbb5e74990b62ea21f6 |
01:06:18 | * | libman joined #nim |
01:10:25 | * | def-pri-pub quit (Quit: Leaving.) |
01:10:37 | libman | icc gives Nim the edge over Rust in some benchmarks. Too bad the free version expires. |
01:16:48 | FromGitter | <zacharycarter> icc? |
01:17:36 | FromGitter | <zacharycarter> intel c compiler? |
01:20:37 | * | relax joined #nim |
01:29:46 | * | smt` quit (Ping timeout: 255 seconds) |
01:37:05 | * | relax quit (Ping timeout: 248 seconds) |
02:00:49 | * | chemist69 quit (Ping timeout: 255 seconds) |
02:14:33 | * | chemist69 joined #nim |
02:34:41 | libman | Yeah, that was in response to the backlog from a few hours before. Being able to choose C compilers is a big advantage. Some light C compilers are done before Clang laces up one boot. |
02:35:58 | libman | And some proprietary compilers still produce the best optimized machine code on some platforms. |
02:40:39 | FromGitter | <edubart> I did get 2x speed up in some math codes in nim with icc over gcc |
02:49:53 | FromGitter | <Varriount> @zacharycarter So I looked up some Star Trek Armada screenshots. It looks like selected units have a 2d semi-transparent billboard drawn behind them. |
02:57:42 | * | Snircle_ quit (Quit: Textual IRC Client: www.textualapp.com) |
03:05:19 | * | JappleAck quit (Quit: Leaving) |
03:21:58 | * | endragor joined #nim |
03:28:27 | * | dddddd quit (Remote host closed the connection) |
03:38:38 | * | relax joined #nim |
03:43:16 | FromGitter | <zacharycarter> @Varriount I think I got a good solution worked out with the stencil buffer |
03:43:44 | FromGitter | <zacharycarter> I just finished rewriting all my isometric map rendering code to get rid of all the magic numbers |
03:44:08 | * | FromGitter * Varriount has a bad habit of using magic numbers |
03:45:14 | FromGitter | <Varriount> @zacharycarter Does using the stencil buffer change at all began OpenGl 2 and latest? |
03:46:12 | * | def-pri-pub joined #nim |
03:46:58 | * | def-pri-pub quit (Client Quit) |
03:49:04 | FromGitter | <zacharycarter> nope |
03:59:43 | FromGitter | <zacharycarter> @Varriount I'm debating between making a RPG and a RTS |
03:59:53 | FromGitter | <zacharycarter> RTS seems much more complicated |
04:00:23 | FromGitter | <Varriount> I like RPGs more |
04:00:25 | FromGitter | <Varriount> Hm. |
04:01:21 | FromGitter | <Varriount> @zacharycarter If you're stumped for ideas, you could look at Megaman Battle Network and Spybot: The Nightfall Incident. |
04:02:10 | FromGitter | <Varriount> Admittedly, I'm recommending them because both are isometric-ish games I love. |
04:03:15 | FromGitter | <zacharycarter> :D |
04:03:22 | * | vlad1777d joined #nim |
04:05:26 | * | Nobabs27 joined #nim |
04:05:57 | FromGitter | <zacharycarter> I think I'm going to challenge myself and go for a rts |
04:08:21 | FromGitter | <Varriount> You could go for a real-time RPG |
04:08:47 | FromGitter | <Varriount> Like Pillars of Eternity, or Neverwinter |
04:09:40 | FromGitter | <zacharycarter> true |
04:10:42 | FromGitter | <zacharycarter> that's probably what I'd do if I was going to make a rpg |
04:10:50 | FromGitter | <zacharycarter> I don't think I'd make it turn based |
04:14:23 | * | relax quit (Ping timeout: 248 seconds) |
04:37:27 | * | Nobabs27 quit (Quit: Leaving) |
04:51:46 | * | Demos joined #nim |
04:53:28 | * | libman quit (Quit: Connection closed for inactivity) |
04:53:32 | * | miran quit (Quit: Leaving) |
04:53:53 | * | miran joined #nim |
05:19:47 | * | Demos quit (Quit: Demos) |
05:31:10 | * | vlad1777d quit (Remote host closed the connection) |
06:01:50 | * | Vladar joined #nim |
06:14:00 | * | PMunch joined #nim |
06:19:05 | * | solitudesf joined #nim |
06:33:37 | * | nsf joined #nim |
06:54:08 | * | endragor quit (Remote host closed the connection) |
06:58:25 | * | gokr joined #nim |
07:08:08 | FromGitter | <Bennyelg> Always printing the same values. ⏎ where are the random kicks IN? :shipit: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59db2058210ac26920c2c6a5] |
07:15:54 | PMunch | Hmm, when quoting things with the "quote" procedure from the macros module you can't access fields? |
07:23:58 | * | claudiuinberlin joined #nim |
07:26:23 | FromGitter | <Araq> @Bennyelg omg DO NOT use random for password generation |
07:26:36 | FromGitter | <Bennyelg> its not |
07:26:48 | FromGitter | <Bennyelg> @Araq I want it to generate Salt |
07:26:56 | FromGitter | <Bennyelg> But why this thing isnt working |
07:27:06 | FromGitter | <Araq> yes, don't use random to generate a salt either |
07:27:41 | FromGitter | <Araq> newSeqWith evaluates 'random' once? |
07:27:51 | FromGitter | <Araq> just a guess though |
07:27:53 | * | endragor joined #nim |
07:29:54 | PMunch | Araq, are there any cryptographically secure RNGs implemented in Nim? |
07:30:14 | FromGitter | <Bennyelg> @Araq So what is the best way to generate Salt password |
07:30:17 | FromGitter | <Bennyelg> I need something |
07:31:22 | ftsf | Bennyelg, read from /dev/random if you're on linux, obviously not a good cross platform solution. |
07:31:41 | Araq | forum.nim line 223 |
07:32:10 | Araq | but yeah, some pure Nim solution would be nice. there is the nim-random package but I'm not sure if it's still alive |
07:34:14 | * | Arrrr joined #nim |
07:34:19 | * | Arrrr quit (Changing host) |
07:34:19 | * | Arrrr joined #nim |
07:51:22 | * | yglukhov joined #nim |
07:54:08 | FromGitter | <Bennyelg> @Araq I'll look into that thanks |
08:11:42 | * | PMunch_ joined #nim |
08:11:56 | * | PMunch quit (Disconnected by services) |
08:12:14 | * | PMunch_ is now known as PMunch |
08:14:43 | * | gokr left #nim (#nim) |
08:18:36 | FromGitter | <Bennyelg> @Araq |
08:19:23 | FromGitter | <Bennyelg> Just to let you know ⏎ If you call random from some seq it's always generate the same number ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59db310a614889d475904c45] |
08:21:10 | FromGitter | <mratsim> @Bennyelg change the seed |
08:22:55 | FromGitter | <mratsim> But there should be a crypto package. |
08:23:16 | FromGitter | <Bennyelg> This is the worst random package I ever used in any language so far |
08:24:16 | FromGitter | <mratsim> Personally I have much more use of fast pseudo rng than a crypto secure rng. I need determinism for reproduceability of Machine Learning algo |
08:24:38 | FromGitter | <mratsim> Idem for Monte Carlo simulations |
08:26:23 | FromGitter | <mratsim> Actually if you search for "Nvidia non-deterministic" you get a lot of hits showing that being really random is a pain: https://www.twosigma.com/insights/a-workaround-for-non-determinism-in-tensorflow |
08:29:08 | Araq | import random |
08:29:08 | Araq | echo random(255), " ", random(255) |
08:29:15 | Araq | produces random numbers for me |
08:29:38 | Araq | import random |
08:29:38 | Araq | randomize() |
08:29:38 | Araq | echo random(255), " ", random(255) |
08:29:56 | Araq | produces non-reproducible random numbers for me |
08:30:30 | Araq | it works exactly as designed |
08:38:32 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
08:46:14 | * | claudiuinberlin joined #nim |
08:49:09 | FromGitter | <Bennyelg> @Araq echo random(255), " ", random(255) produce always the same numbers forme |
08:49:20 | FromGitter | <Bennyelg> 152 129 if to be exact |
08:49:46 | Araq | maybe read everything I wrote |
08:50:18 | FromGitter | <Bennyelg> Now I get it, sorry but this is not a regular desgin |
08:50:23 | FromGitter | <Bennyelg> design* |
08:50:39 | FromGitter | <Bennyelg> why not just random(anytype) to produce a real random every time ? |
08:50:52 | Araq | it's a common design. |
08:51:30 | FromGitter | <Bennyelg> do it in python for example, you need need to randomize everytime |
08:51:58 | Araq | https://www.tutorialspoint.com/c_standard_library/c_function_rand.htm |
08:52:57 | Araq | http://en.cppreference.com/w/cpp/numeric/random/rand |
08:54:31 | Araq | http://docs.oracle.com/javase/7/docs/api/java/util/Random.html#Random() |
08:55:07 | Araq | different libraries do it differently. |
08:55:20 | FromGitter | <mratsim> If I want to create a nnkBracket in a macro should I use newCall or is there a more idiomatic way? I didn't find a "newBracket" proc |
08:56:37 | * | skrylar joined #nim |
08:57:00 | FromGitter | <mratsim> @Bennyelg iirc Numpy behaves the same as Nim, np.random is pseudo rng with seed = 0 by default |
08:57:16 | Araq | newTree(nnkBracket, newLit(1), newLit(2), newLit(3)) |
08:57:33 | skrylar | zacharycarter: more gpu fun to bonk. tried lrzip (its like that thing gokr found) and tested it on some dds textures |
08:57:38 | Araq | mratsim: most constructions are best done with the rather new 'newTree' |
08:58:38 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:00:28 | skrylar | interestingly, zpaq (compression algorithm) on a DXT texture is smaller than a png of the same texture, and thats including the mipmaps. although the .dds.lrz is still larger than a jpeg, its only 4x larger. neat. |
09:07:24 | FromGitter | <mratsim> Ah cool thanks Araq |
09:13:49 | * | Yardanico joined #nim |
09:23:56 | * | couven92 joined #nim |
09:29:44 | skrylar | hm |
09:29:49 | skrylar | wonder how light allocators work |
09:30:05 | skrylar | if they have some special trick or it just dist checks the nearest N lamps |
10:03:12 | * | claudiuinberlin joined #nim |
10:05:41 | skrylar | well thats neat. i think i got distance field paintbrushes somewhat working |
10:16:42 | skrylar | Now the downside is that i'm using bresenham lines and this seems to result in some aliased jittering even though rounded circles are being painted |
10:21:05 | dom96 | mratsim: not sure if you frequent HN, but this sounds like something you might be interested in reading: https://news.ycombinator.com/item?id=15429824 |
10:31:43 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
10:32:33 | * | ShalokShalom quit (Ping timeout: 258 seconds) |
10:32:41 | * | JappleAck joined #nim |
10:40:59 | FromGitter | <Bennyelg> what is wrong here :| ⏎ ⏎ ```proc range*[T](x, y: int): seq[T] = ⏎ newSeqOfCap[T](y-x)``` [https://gitter.im/nim-lang/Nim?at=59db523be44c43700a0ec361] |
10:51:59 | * | Yardanico quit (Remote host closed the connection) |
10:53:44 | Arrrr | Nothing, is perfect |
10:53:54 | Arrrr | As the woman of my dreams |
10:54:34 | FromGitter | <ephja> yeah that works |
10:57:27 | FromGitter | <Bennyelg> for me the range proc not work. ⏎ also, this thing: ⏎ ⏎ ``` for i in 0..<10: ⏎ echo(cast[char](i))``` ⏎ ... [https://gitter.im/nim-lang/Nim?at=59db561701110b7231937d2f] |
10:58:26 | Arrrr | There is no char 10 |
10:58:35 | Arrrr | there is char 1 and char 0 |
10:58:38 | FromGitter | <Bennyelg> yea sorry |
10:58:41 | FromGitter | <Bennyelg> 1-9 |
10:58:44 | FromGitter | <Bennyelg> 0-9* |
10:58:53 | Arrrr | then you could try $i[0] |
10:59:30 | FromGitter | <Bennyelg> I did it like this: i.intToStr.mapIt(char, it)) |
10:59:32 | FromGitter | <Bennyelg> but i dont like it |
11:00:45 | FromGitter | <Bennyelg> ```proc range*[T](x, y: int): seq[T] = ⏎ newSeqOfCap[T](y-x)``` ⏎ ⏎ this yield "canot instantiate T" [https://gitter.im/nim-lang/Nim?at=59db56ddbbbf9f1a383c1566] |
11:01:58 | Arrrr | Use `range[int]()` |
11:02:09 | FromGitter | <Bennyelg> :| oh yea |
11:02:26 | * | Snircle joined #nim |
11:03:48 | Arrrr | This guy had your very issue https://forum.nim-lang.org/t/3235 |
11:08:54 | chemist69 | damn, either wrapping a C++ library is really hard or I am doing it completely wrong :P |
11:09:02 | chemist69 | I'm giving up. |
11:10:55 | * | chemist69 quit (Quit: WeeChat 1.9.1) |
11:11:10 | * | chemist69 joined #nim |
11:12:11 | FromGitter | <BigEpsilon> what's the difficulty @chemist69 ? |
11:13:08 | FromGitter | <BigEpsilon> I'll help you if i can |
11:13:21 | couven92 | chemist69, well for C++ iirc you get compiler specific name-mangling, and all kinds of other niceties to take into account... There is a reason why libraries in C++ often expose their API with C bindings :P |
11:14:37 | chemist69 | Yeah, I am trying to create wrappers for some functionality of this project: https://github.com/rdkit/rdkit |
11:15:05 | chemist69 | And it probbably doesn't help that it is using boost and that I am not a C++ programmer. |
11:15:42 | FromGitter | <BigEpsilon> did you try c2nim ? |
11:16:16 | chemist69 | Yes, was almost no help. It choked on several header files |
11:16:56 | chemist69 | For starters, I would like to wrap https://github.com/rdkit/rdkit/blob/master/Code/GraphMol/SmilesParse/SmilesParse.h |
11:17:41 | FromGitter | <BigEpsilon> yes it still does not cover all c++, and some things I thinks are not possible to translate directly |
11:18:10 | FromGitter | <BigEpsilon> But Yes if you don't know cpp you'll have a hard time |
11:19:45 | FromGitter | <BigEpsilon> I see nothing that is impossible to translate in SmilesParse |
11:20:00 | FromGitter | <BigEpsilon> you may need a little workaround for maps |
11:20:42 | FromGitter | <BigEpsilon> https://github.com/nim-lang/Nim/pull/4094/files |
11:21:03 | FromGitter | <BigEpsilon> maybe try calling python from nim ? |
11:25:42 | chemist69 | BigEpsilon: Then I would rather stay completely in Python |
11:26:17 | chemist69 | I am using this toolkit intensively from Python and would just love to use at least some functionality from Nim. |
11:30:40 | FromGitter | <BigEpsilon> If you know cpp it is not hard to port the pieces you need realy |
11:31:30 | chemist69 | This is what I have now: https://glot.io/snippets/eudq0lvk0i |
11:31:48 | chemist69 | But I get a linker error: undefined reference to `RDKit::SmilesToMol(std::string const&, RDKit::SmilesParserParams const&)' |
11:36:13 | skrylar | hmm |
11:36:57 | skrylar | wondering how well a quadtree works for upsampling |
11:38:15 | skrylar | there's a paper where they're storing distance fields in a quadtree, and i'm wondering if that would upscale better; right now just using a single channel texture map and painting on it like a normal paint prog would. works but you can get some artifacting on zoom |
11:41:22 | * | claudiuinberlin joined #nim |
11:42:37 | FromGitter | <BigEpsilon> @chemist69 , strange |
11:42:51 | FromGitter | <BigEpsilon> your code seems to be rigth |
11:43:12 | FromGitter | <BigEpsilon> right* |
11:43:34 | FromGitter | <BigEpsilon> are you sure about the link path ? |
11:43:35 | chemist69 | Thanks, it's actually nice to hear that I am principally on the right path. |
11:45:30 | chemist69 | Yes, the paths should be correct. |
11:46:24 | FromGitter | <BigEpsilon> if you remove the last line " m = smilesToMol(s, p)" |
11:46:30 | FromGitter | <BigEpsilon> does it compiles ? |
11:47:01 | chemist69 | yes, it does. |
11:47:11 | FromGitter | <Bennyelg> one line for to simulate this: |
11:47:13 | FromGitter | <Bennyelg> for i in 65..<91: ⏎ ⏎ ``` symbols.add(chr(i))``` [https://gitter.im/nim-lang/Nim?at=59db61c0bbbf9f1a383c4ed1] |
11:48:05 | chemist69 | BigEpsilon: nice, one small success. |
11:48:43 | FromGitter | <BigEpsilon> they but meybe it is just because these variables are opitmized out |
11:48:44 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
11:49:57 | FromGitter | <BigEpsilon> can you post the generated cpp code ? |
11:50:14 | FromGitter | <BigEpsilon> with the last line activated |
11:50:37 | FromGitter | <BigEpsilon> you will find it in the nimcache folder |
11:52:39 | * | claudiuinberlin joined #nim |
11:54:02 | FromGitter | <Bennyelg> My big question why I shouldn't use this as a salt ? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59db635a210ac26920c4274f] |
11:54:10 | chemist69 | Here it is: https://gist.github.com/apahl/d4d1ef240db77376c271fb54b78f9af6 |
11:56:19 | chemist69 | does my program need to have a `when is mainModule:`? |
11:56:52 | FromGitter | <Bennyelg> @chemist69 if you are going to run it directly then yes |
11:57:15 | chemist69 | but that does not change the linker error, just tried. |
11:58:27 | FromGitter | <BigEpsilon> no it does not change anything here |
11:59:24 | FromGitter | <BigEpsilon> the problem is in the linking phase |
11:59:44 | FromGitter | <BigEpsilon> the code and the generated code are correct |
12:00:23 | chemist69 | BigEpsilon: Thanks a lot for looking into this!! |
12:00:50 | FromGitter | <BigEpsilon> If I was you, I would try to compile a little example in C++ |
12:01:05 | FromGitter | <BigEpsilon> to be sure about the linker arguements |
12:01:23 | FromGitter | <BigEpsilon> on thing to check also |
12:01:58 | FromGitter | <BigEpsilon> is if both you nim application and your .so use the same version of the STL |
12:02:11 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:02:33 | chemist69 | Ok, I think there is a "getting started in C++" for this project. I will look into that, thanks a lot for your help so far! |
12:02:39 | FromGitter | <BigEpsilon> libstd++ or libc++ |
12:02:57 | FromGitter | <BigEpsilon> your welcome and best luck :) |
12:03:18 | chemist69 | I am not sure about that, I use precompiled binaries. |
12:07:08 | * | dddddd joined #nim |
12:07:27 | FromGitter | <ephja> how should I profile my code on Windows if nimprof doesn't work (chokes on threads)? |
12:08:21 | FromGitter | <BigEpsilon> if they dont use the same standard library implementation then your std::string is not the same as the lib one |
12:08:52 | FromGitter | <BigEpsilon> hence it cannot find the correct function because they dont have the same parameters |
12:11:45 | chemist69 | BigEpsilon: Yes, that may be. |
12:12:36 | FromGitter | <BigEpsilon> @chemist69 , I'm almost sure it wont change anything, but can you try to declare the first arguement of SmilesToMol to cstring instead of stdstringObj ? |
12:13:17 | FromGitter | <BigEpsilon> and call smilesToMol with a string literal directly |
12:13:47 | chemist69 | I think that is what I tried in the first place, but I will try again. |
12:16:18 | chemist69 | I get exactly the same linker error: undefined reference to `RDKit::SmilesToMol(std::string const&, RDKit::SmilesParserParams const&) |
12:17:02 | FromGitter | <zacharycarter> grr I can't figure out how to solve this mouse picking issue - https://imgur.com/a/BldDe |
12:17:19 | * | claudiuinberlin joined #nim |
12:18:01 | FromGitter | <Yardanico> it seems you're doing something like mouseCoords * someValue |
12:18:15 | FromGitter | <Yardanico> and this value is bigger when your mouse is closer to edges |
12:18:21 | FromGitter | <ephja> I'm checking out CodeXL (the successor to AMD CodeAnalyst) now |
12:19:23 | FromGitter | <BigEpsilon> chemist69, your best bet maybe to compile the lib on your system |
12:19:40 | FromGitter | <BigEpsilon> with the same options as your nim program |
12:23:25 | chemist69 | BigEpsilon: Yes, I agree. |
12:26:40 | * | manjaro-kde5_ joined #nim |
12:30:27 | skrylar | ephja: well there's always the ghetto version; put in timing checkpoints around stuff :\ |
12:30:35 | * | relax joined #nim |
12:30:49 | skrylar | or run gprof |
12:31:11 | skrylar | there are also sampling profilers but those are weird |
12:35:07 | FromGitter | <zacharycarter> yeah exactly @Yardanico but why |
12:36:24 | JappleAck | hey guys, i'm trying to write smth like this `let hproc: Process = startProcess(command: "foo", args: ["bar", "baz"])` |
12:36:43 | JappleAck | and i'm getting error on this line: "Error: type expected" |
12:36:51 | JappleAck | what could it means? |
12:37:18 | JappleAck | am i doing something wrong? |
12:37:36 | chemist69 | command= "foo", args= ["bar", "baz"] |
12:37:41 | euantor | use `=` instead of `:` |
12:37:58 | FromGitter | <mratsim> @dom96 thanks for the HN article, data scientists don't want to deal with low-level tensorflow, it's a pain .... |
12:38:03 | FromGitter | <ephja> various routines related to thread local vars have pretty high sample counts. I wonder if the overhead of channels can actually be that high |
12:38:07 | JappleAck | oh, okay, thanks |
12:41:35 | * | PMunch quit (Ping timeout: 248 seconds) |
12:42:02 | * | PMunch joined #nim |
12:44:35 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:44:53 | * | vlad1777d joined #nim |
12:46:24 | * | claudiuinberlin joined #nim |
12:47:39 | * | vlad1777d quit (Remote host closed the connection) |
12:52:52 | * | Jesin quit (Quit: Leaving) |
12:55:22 | * | skrylar quit (Remote host closed the connection) |
13:01:50 | FromGitter | <BigEpsilon> I have a question, I'm trying to make this work: ⏎ ⏎ ```var foo = constructFoo[float]()``` ⏎ ⏎ Is there a way to keep constructFoo as a template (it works if I use a function) ? [https://gitter.im/nim-lang/Nim?at=59db733d01110b7231941337] |
13:03:05 | FromGitter | <BigEpsilon> oups sry i failed my code quotes |
13:04:42 | Arrrr | constructFoo float or constructFoo[float]() ? |
13:05:16 | FromGitter | <Yardanico> second one |
13:05:25 | FromGitter | <Yardanico> gitter always messes up this code |
13:05:28 | FromGitter | <BigEpsilon> constructFoo [ float ] () |
13:06:06 | FromGitter | <krux02> ``constructFoofloat ()`` |
13:06:26 | FromGitter | <BigEpsilon> yes that's it |
13:06:33 | FromGitter | <krux02> put it around double backtick quotes ;) |
13:06:47 | FromGitter | <BigEpsilon> thx ! |
13:06:48 | FromGitter | <Yardanico> well it's always slower to type this |
13:07:11 | FromGitter | <krux02> depending on the keyboard layout backticks can be annoying to type |
13:08:12 | FromGitter | <Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59db74bbe44c43700a0f7e52] |
13:08:43 | FromGitter | <Bennyelg> How bad is it |
13:20:24 | Arrrr | i give him 1 month |
13:22:23 | FromGitter | <Yardanico> @Bennyelg why do you have such an interesting proc for creating random salt? |
13:26:09 | FromGitter | <Yardanico> and btw |
13:26:25 | FromGitter | <Yardanico> "randomize(random(72))" would always initialize random with one seed :D |
13:27:07 | FromGitter | <Bennyelg> I probably not understanding the Seed properly, what is the role of the seed |
13:27:35 | FromGitter | <Yardanico> to initialize a random number generator with some initial state |
13:27:41 | FromGitter | <Yardanico> https://en.wikipedia.org/wiki/Random_seed |
13:28:37 | euantor | And don't use MD5 for password hashing whatever you do |
13:28:47 | * | relax quit (Ping timeout: 255 seconds) |
13:28:49 | FromGitter | <Yardanico> yeah |
13:29:34 | FromGitter | <krux02> just initialize the random numebr generator with the current time, or accept that each start of the program generates exactly the same random numbers |
13:29:39 | FromGitter | <Bennyelg> why? i think its sufficient since the salt is strong and very random in size of 12 upper lower case + numbers |
13:30:00 | euantor | MD5 is easy to crack |
13:30:03 | FromGitter | <Yardanico> md5 is not strong itself |
13:30:20 | FromGitter | <Yardanico> @krux02 is there a way in pure-nim to get current time? |
13:30:23 | FromGitter | <Bennyelg> yea |
13:30:24 | FromGitter | <Yardanico> at compile-time |
13:30:25 | euantor | https://yorickpeterse.com/articles/use-bcrypt-fool/ |
13:30:44 | euantor | ^ from 2011 (6 years ago!!) explaining then why MD5 was a bad choice |
13:30:54 | FromGitter | <krux02> pure nim? maybe in the standard library |
13:30:56 | FromGitter | <krux02> could be os |
13:31:14 | FromGitter | <Yardanico> at compile-time :( |
13:31:39 | FromGitter | <Yardanico> "times" module doesn't work at compile-time too |
13:31:42 | FromGitter | <Yardanico> because no FFI |
13:32:39 | euantor | And for generating random data for a seed, it's probably better to use the system's CSPRG using somehting like my sysrandom module (asusming it supports your OS): https://github.com/euantorano/sysrandom.nim |
13:33:01 | FromGitter | <Yardanico> aand it doesn't work at compile-time :P |
13:33:30 | FromGitter | <krux02> ``times.epochTime()`` |
13:33:40 | FromGitter | <krux02> nope |
13:33:45 | FromGitter | <Yardanico> wait, does that work at compile-time? |
13:33:54 | FromGitter | <Yardanico> lol |
13:34:04 | FromGitter | <Yardanico> it works |
13:34:19 | FromGitter | <krux02> funny |
13:34:28 | FromGitter | <krux02> Nim still can surprise you |
13:34:30 | FromGitter | <Bennyelg> sha256 yield could not load: libssl.so |
13:35:08 | FromGitter | <Yardanico> @krux02 oh wait |
13:35:15 | FromGitter | <Yardanico> random doesn't work at compile-time :D |
13:35:26 | FromGitter | <krux02> lol |
13:35:28 | FromGitter | <Yardanico> and yes |
13:35:31 | FromGitter | <krux02> then do the mersenne library |
13:35:33 | FromGitter | <Yardanico> times module doesn't work at compile time |
13:35:36 | FromGitter | <Yardanico> I was mistaken |
13:35:42 | FromGitter | <Yardanico> lib\pure\times.nim(1316, 9) Error: cannot 'importc' variable at compile time |
13:35:56 | FromGitter | <Yardanico> \ |
13:36:11 | FromGitter | <Yardanico> maybe we'll have FFI at compile-time (in the bright future) |
13:36:21 | FromGitter | <krux02> yea maybe at some point in time there will be better intorop from C and Nimvm |
13:36:38 | FromGitter | <krux02> or the VM will die and all the code will be compiled to machine code |
13:36:40 | FromGitter | <krux02> even the macros |
13:36:42 | FromGitter | <Yardanico> yeah |
13:36:50 | FromGitter | <Yardanico> araq talked about this |
13:37:00 | FromGitter | <Yardanico> that he wanted to make all macros to compile separately |
13:37:13 | FromGitter | <krux02> yeas but then it would be impossible to split nim compilation and C compilation |
13:38:35 | FromGitter | <krux02> and it would be impossilbe to create a function with a macro and use it in a macro |
13:39:33 | FromGitter | <krux02> not that I need it, but it is a nice feature that it is possible to create function in a macro and use it in the libe below |
13:39:52 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:42:59 | FromGitter | <mratsim> I thought that meant compile separately to Nim not to C |
13:47:02 | FromGitter | <krux02> What is the current way to use simd instructions? |
13:47:11 | FromGitter | <krux02> Hope on C compiler optimization? |
13:47:58 | FromGitter | <Yardanico> there's a way to use them |
13:48:02 | FromGitter | <Yardanico> check https://github.com/bsegovia/x86_simd.nim |
13:48:14 | FromGitter | <Yardanico> it uses C compiler built-ins |
13:48:43 | FromGitter | <krux02> ok, thanks |
13:49:01 | FromGitter | <krux02> I hate assember function names |
13:49:06 | FromGitter | <krux02> 100% cryptic |
13:49:19 | FromGitter | <Yardanico> also check https://github.com/bsegovia/simd.nim |
13:49:30 | FromGitter | <Yardanico> but I really hope we'll get high-level SIMD library :P |
13:49:36 | FromGitter | <Yardanico> because we have macros and templates |
13:50:03 | FromGitter | <Yardanico> it has sse floats in a high-level way https://github.com/bsegovia/simd.nim/blob/master/simd.nim |
13:50:57 | FromGitter | <krux02> At some point I want to add sse functions to glm |
13:51:38 | FromGitter | <krux02> because why shouldn't dot(vec4,vec4) be an simd instructions |
13:53:42 | * | claudiuinberlin joined #nim |
14:00:23 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:06:48 | * | PMunch quit (Quit: Leaving) |
14:12:03 | * | Jesin joined #nim |
14:14:09 | * | Jesin quit (Remote host closed the connection) |
14:20:11 | JappleAck | hey guys, how do i redirect `Stream` to `stderr` for example? |
14:20:18 | * | Jesin joined #nim |
14:21:28 | dom96 | You need to do that manually |
14:21:47 | dom96 | by reading from the stream and writing to stderr |
14:21:52 | JappleAck | okay |
14:23:02 | * | ipjk joined #nim |
14:27:09 | * | nsf quit (Quit: WeeChat 1.9) |
14:29:44 | planetis[m] | why streams dont have 'readUint' procs? |
14:34:48 | dom96 | make a PR to add them :) |
14:36:21 | FromGitter | <ephja> @krux02 because it might be slower |
14:36:55 | * | endragor quit (Remote host closed the connection) |
14:40:10 | FromGitter | <ephja> when you don't execute such instructions in batches for example |
14:43:18 | FromGitter | <ephja> I think dot should be * too btw ;) |
14:44:25 | JappleAck | hey guys, i'm getting line from some stream that is stdout of child process, i'm trying to match it with regex-pattern, i'm sure that it contains exact text in line but `match` always returns false |
14:44:35 | FromGitter | <ephja> maybe there should be two types, one using simd operators and one not: SimdVec = distinct Vec |
14:45:06 | JappleAck | could it be some encoding issue, i don't know, i simplified regex, just kept `re"id"` |
14:45:37 | JappleAck | and still getting false, but i print this line to stdout and see this "id" word in it |
14:47:04 | FromGitter | <ephja> doesn't 'match' try to match from 'start' to the end? |
14:48:16 | dom96 | JappleAck: try `find` instead of `match` |
14:48:18 | FromGitter | <ephja> maybe you should match zero or more characters before and after, or use 'find' |
14:48:21 | JappleAck | hm, i'm now sure, i thought i should explicitly put '^' and '$' for that |
14:48:34 | JappleAck | this makes sense, thanks |
14:48:39 | JappleAck | will use find |
14:51:47 | FromGitter | <ephja> actually it might stop matching before the end, but yeah |
14:53:00 | * | adeohluwa joined #nim |
14:59:47 | * | claudiuinberlin joined #nim |
15:18:20 | * | Trustable joined #nim |
15:22:13 | * | jjido joined #nim |
15:23:23 | * | jjido quit (Read error: Connection reset by peer) |
15:23:53 | * | jjido joined #nim |
15:25:23 | * | jjido quit (Read error: Connection reset by peer) |
15:32:15 | * | miran quit (Ping timeout: 248 seconds) |
15:46:12 | * | miran joined #nim |
15:56:10 | miran | i see you've talked about regex, so i'll repeat my question from the other day - is there a way in nim to get subgroups of a found regex pattern? |
16:00:08 | miran | for example: `re"(\d+)x(\d+)"` matches two numbers with `x` in between, for example: 123x98 |
16:00:30 | miran | how to extract the first group (first number), or second group? |
16:01:54 | FromGitter | <genotrance> @miran: I've mainly used findIter() to do that myself - along with Captures |
16:03:43 | FromGitter | <genotrance> ```for match in string.findIter(re"(\d+)x(\d+)"): ⏎ echo match.captures[0]``` [https://gitter.im/nim-lang/Nim?at=59db9ddef7299e8f53c75b74] |
16:05:18 | FromGitter | <Yardanico> @genotrance also, a tip: gitter<-->irc bridge can't track your edits, so if you edit your message, new content will be visible only on gitter |
16:05:47 | FromGitter | <Yardanico> just a tip, I know you've sent this message as a separate one :) :D |
16:06:50 | FromGitter | <genotrance> @Yardanico - ya I realized that the last time I blew out someones' eyeballs |
16:09:36 | * | vivus joined #nim |
16:11:00 | miran | @genotrance: thanks, i'll look into findIter() |
16:12:31 | miran | it looks ok as a first-aid kit, but generally i might need something like `match.group(1)` from python |
16:13:17 | miran | or to have all subgroups in a tuple i could unpack.... |
16:13:50 | * | couven92 quit (Quit: Client disconnecting) |
16:20:20 | * | nsf joined #nim |
16:24:43 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
16:25:28 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:26:58 | FromGitter | <zacharycarter> hrm this rts is going to be tough to do without buildings :P |
16:27:58 | * | claudiuinberlin joined #nim |
16:31:50 | * | claudiuinberlin quit (Client Quit) |
16:59:15 | dom96 | miran: what you want is the `matches` https://nim-lang.org/docs/re.html#find,string,Regex,openArray[string],int |
17:01:11 | miran | dom96: thanks, i'm gonna try that immediately! |
17:05:19 | * | JappleAck quit (Ping timeout: 255 seconds) |
17:07:33 | miran | dom96: i copy/pasted the example from the link and it produces an error |
17:09:01 | miran | found the error! i've been using `nre` module, not `re` |
17:10:18 | * | jjido joined #nim |
17:14:41 | * | jjido quit (Ping timeout: 248 seconds) |
17:15:20 | FromGitter | <genotrance> @dom96 : good to know. I guess I misread the docs, I've mainly used nre since I thought re was deprecated. From the docs "This module still has some obscure bugs and limitations, consider using the nre or pegs modules instead. We had to de-deprecate this module since too much code relies on it and many people prefer its API over nre's." |
17:16:36 | * | jjido joined #nim |
17:18:05 | FromGitter | <Araq> @edubart can you elaborate on "compiler produces too many copies for overloaded assignments" ? |
17:18:16 | dom96 | yeah, it's time to either remove nre or re |
17:18:38 | Araq | move nre to a nimble package |
17:18:39 | * | couven92 joined #nim |
17:19:11 | * | JappleAck joined #nim |
17:23:21 | FromGitter | <mratsim> int = int32 ? |
17:23:29 | FromGitter | <mratsim> on x86_64? |
17:24:05 | Araq | no |
17:25:56 | FromGitter | <genotrance> how different are the re and nre APIs? |
17:27:23 | FromGitter | <mratsim> so converter int64 —> int is not working or work as intended? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59dbb17b01110b72319584f6] |
17:28:14 | * | nsf quit (Quit: WeeChat 1.9) |
17:34:51 | Araq | int64 is not convertible to int because int can be 32bits and platform specific code is worse than platform independent code |
17:35:43 | FromGitter | <mratsim> no problem |
17:39:16 | miran | Araq: "move nre to a nimble package" -> can then the warning about using `nre` instead of `re` be removed from the docs? |
17:39:55 | miran | because when i've seen that, i didn't even bother to look at `re`, thought `nre` is way to go. |
17:45:08 | FromGitter | <zacharycarter> siege tower anyone? |
17:45:24 | FromGitter | <zacharycarter> https://imgur.com/a/VGdgU |
17:47:00 | vivus | miran: I personally waged a war whilst trying to use `re`. in the end, I was victorious. Casualties of the war were dom96 :P he helped me quite a bit |
17:49:31 | FromGitter | <edubart> @Araq basically what is said in https://github.com/nim-lang/Nim/issues/6348 to be able to implement assignment with move optimization to avoid extra copies, i.e. specialized assignment for r-values |
17:51:50 | FromGitter | <edubart> atm if anyone overload assignment operator then the move optimizations done by the native `=` is lost, meaning for specific cases like huge objects it's not a good ideia to overload `=` |
17:52:28 | Araq | edubart: I'm fixing it, finally worked out the rules for moves, copies and destructors (I hope) |
17:53:09 | FromGitter | <zacharycarter> do you guys think that siege tower is too big? |
17:53:42 | FromGitter | <genotrance> > **<miran>** because when i've seen that, i didn't even bother to look at `re`, thought `nre` is way to go. ⏎ That's exactly what my reaction was when I read that. |
17:53:43 | Araq | zacharycarter: yeah it is too big. |
17:53:51 | FromGitter | <zacharycarter> (https://files.gitter.im/nim-lang/Nim/8ibk/Screen-Shot-2017-10-09-at-1.53.34-PM.png) |
17:54:09 | FromGitter | <zacharycarter> I need to get better at creating isometric tile art :/ |
17:54:11 | vivus | @zacharycarter that is your RPG-like game? |
17:54:27 | FromGitter | <zacharycarter> I don't know what to make :P whether to make a RPG or a RTS |
17:54:27 | Araq | it's not an RPG, it's an RTS |
17:54:31 | miran | zacharycarter: yeah, a bit too big |
17:54:40 | FromGitter | <zacharycarter> if I make a RTS I'm going to be making a lot of art on my own |
17:54:40 | FromGitter | <edubart> @Araq that's good news, =) I'm gona test when you finish to implement |
17:54:45 | Araq | don't ruin this, I need a new RTS |
17:54:50 | FromGitter | <zacharycarter> lol okay |
17:55:09 | vivus | @zacharycarter time to setup a Patreon haha |
17:55:13 | Araq | also give it a sci-fi or fantasy setting |
17:55:48 | vivus | or you can name it after nim packages |
17:56:09 | FromGitter | <zacharycarter> I think I'm going to go fantasy |
17:56:22 | Araq | edubart: is it acceptable if the compiler demands move, copy and destroy to all be implemented? |
17:56:40 | Araq | I mean that the compiler enforces this |
17:57:35 | FromGitter | <edubart> you mean if I want to overload `=` then I will have to also implement destroy and copy? |
18:00:00 | Araq | yes |
18:00:29 | Araq | well not quite, '=' is the copy |
18:00:49 | FromGitter | <edubart> no problem I think, I was thinking in using destroy for that specic case too, my use case is an allocator, I want to move memory on `=` for rvalues, having destroy could be a plus, I could then alloc on object creation, dealloc on destroy, so I wouldnt need to use refs to dealloc anymore |
18:00:50 | Araq | and `=move` the move operator |
18:07:08 | * | PMunch joined #nim |
18:07:45 | * | smt joined #nim |
18:13:06 | FromGitter | <zacharycarter> hrm now the siege tower looks too small inc omparison |
18:13:30 | FromGitter | <zacharycarter> (https://files.gitter.im/nim-lang/Nim/RqMv/Screen-Shot-2017-10-09-at-2.12.53-PM.png) |
18:14:45 | FromGitter | <zacharycarter> that or the human is ginormous |
18:17:21 | miran | human is waaay to large |
18:20:11 | FromGitter | <zacharycarter> wonder why he made them so big |
18:21:00 | * | ShalokShalom joined #nim |
18:22:07 | * | zachk joined #nim |
18:24:34 | PMunch | Yeah they're pretty huge even compared to the trees.. |
18:27:54 | FromGitter | <edubart> @Araq as you are working on moves, would be also nice to get a system builtin like `std::move` (from C++) to promote a l-value that would be discarded to a r-value, so we can then avoid copying an object that was going to be discarded anyway. Hence when using `move` in an assignment like `a = move(b)` the `=move` operator would be called instead of `=` and an extra copy saved |
18:28:28 | FromGitter | <mratsim> Why do you do this Apple >_> https://www.reddit.com/r/MacOS/comments/71hz1n/does_apple_bundled_clang_have_openmp_support_in/ |
18:34:13 | Araq | edubart: yeah that will be possible, but I hope it's not required often. I've added a control flow analysis infrastructure to detect moves... |
18:34:28 | FromGitter | <zacharycarter> better? |
18:34:52 | FromGitter | <zacharycarter> (https://files.gitter.im/nim-lang/Nim/dFuP/Screen-Shot-2017-10-09-at-2.34.22-PM.png) |
18:35:57 | PMunch | A lot |
18:36:26 | FromGitter | <zacharycarter> :D |
18:38:57 | Araq | "Warning: 'l' should not be used as an identifier; may look like '1' (one)" can I remove this stupid warning? |
18:39:09 | miran | please do! :) |
18:39:09 | Araq | nobody wants it, right? fonts evolved... |
18:39:46 | * | Yardanico joined #nim |
18:40:04 | PMunch | Haha, I kinda liked that one |
18:40:32 | miran | zacharycarter - something in between will be just right :) |
18:40:37 | PMunch | I mean I can tell the difference with my font, that doesn't mean it shouldn't be avoided |
18:40:42 | FromGitter | <edubart> I got that warning a few times, its annoying |
18:43:18 | FromGitter | <edubart> because sometimes you want to do many for loops, you first use `i` `j` `k`, the next letter would be `l` and you can't use |
18:44:01 | miran | "you want to do many for loops" -> no you don't :D :D |
18:49:55 | * | sleepyqt joined #nim |
18:50:16 | FromGitter | <zacharycarter> miran: this is right in the middle |
18:50:57 | FromGitter | <zacharycarter> (https://files.gitter.im/nim-lang/Nim/Nred/Screen-Shot-2017-10-09-at-2.50.34-PM.png) |
18:52:16 | FromGitter | <mratsim> Trivia, on a go board, you have no i instead |
18:52:27 | FromGitter | <mratsim> (https://files.gitter.im/nim-lang/Nim/D8Ub/2017-10-09_20-51-53.png) |
18:53:07 | FromGitter | <mratsim> Yeah you don’t want to do for loop. Nim forces you to do “while (1)” loop |
18:56:22 | * | Yardanico quit (Remote host closed the connection) |
18:57:24 | * | Yardanico joined #nim |
19:00:19 | * | francisl joined #nim |
19:00:45 | * | yglukhov quit (Remote host closed the connection) |
19:03:09 | dom96 | Going to do another stream, this time hacking on NimBot :) https://go.twitch.tv/d0m96 |
19:04:34 | * | zachk quit (Quit: Leaving) |
19:07:21 | * | Demos joined #nim |
19:07:46 | * | francisl quit (Quit: francisl) |
19:12:33 | Demos | dom96: please make the stream higher resolution or bigger text |
19:13:37 | dom96 | Demos: is this better? |
19:14:14 | miran | it is |
19:16:07 | FromGitter | <Yardanico> oh, I see many new commits by Araq |
19:20:04 | PMunch | dom96, curl --data "code=echo 3&compilationTarget=c" https://play.nim-lang.org/compile |
19:20:15 | FromGitter | <Yardanico> it seems 1.0 rc 1 is coming ! :P |
19:20:42 | FromGitter | <Yardanico> as I understand, this is for much better "not nil" analysis? https://github.com/nim-lang/Nim/commit/b9511a2d7f6b2037ed461abddfc85b3afd5108d9 |
19:21:01 | FromGitter | <Yardanico> For now the task is to prove that every usage of a local variable 'v' is covered by an initialization to 'v' first. |
19:22:25 | FromGitter | <zacharycarter> assembling an army :P |
19:22:30 | FromGitter | <zacharycarter> (https://files.gitter.im/nim-lang/Nim/Us4c/Screen-Shot-2017-10-09-at-3.22.15-PM.png) |
19:23:08 | FromGitter | <Yardanico> btw, hardest part of RTS development and game development in general: game balance |
19:23:09 | Araq | yardanico: yeah well, that's the problem with source code comments |
19:23:20 | Araq | it's already outdated |
19:23:28 | FromGitter | <Yardanico> lol |
19:26:20 | dom96 | NimBot is broken on devel :\ |
19:26:25 | PMunch | dom96, choosenim seems to work pretty well by the way. Think I'll have to finally grab that |
19:26:46 | FromGitter | <Yardanico> dom96: probably because of some wrong spaces |
19:27:31 | Yardanico | e.g. some code like "func (data) " |
19:28:53 | dom96 | okay, so it's fixed after pulling latest code :) |
19:28:57 | Yardanico | lol |
19:32:35 | shodan45 | I tried kotlin yesterday. Or rather, tried to try it. I forgot how complicated java(-related) stuff is. |
19:33:14 | Yardanico | shodan45, kotlin at least tries to remove all the boilerplate needed by java |
19:33:20 | Yardanico | so it's already better :) |
19:33:38 | shodan45 | yeah. It certainly *looks* nicer. |
19:33:53 | shodan45 | less.... fluffy? :D |
19:34:09 | Yardanico | and it's made by JetBrains, a company which develops all popular IDEs |
19:34:22 | Yardanico | IntelliJ IDEA, PyCharm, WebStorm, etc... |
19:34:27 | shodan45 | indeed. I <3 jetbrains stuff. |
19:35:08 | Yardanico | they even have an IDE for databases |
19:35:10 | Yardanico | DataGrip |
19:35:16 | miran | shodan45: i've tried kotlin couple of months ago, but support in vs code was poor, and IDEA was kinda buggy, so i stopped with kotlin quite soon :) |
19:35:32 | Yardanico | are you sure it was buggy? |
19:35:36 | Yardanico | maybe it was *slow* ? |
19:35:52 | shodan45 | it makes my job of dealing with 15+ years of legacy PHP code "tolerable" |
19:35:55 | miran | Yardanico: haha, it kept crashing :) |
19:36:06 | Yardanico | because I doubt jetbrains would have buggy support for their own language in their own IDE :D |
19:36:33 | * | yglukhov joined #nim |
19:36:41 | shodan45 | I didn't encounter any bugs, but quite a few "ok now what am I supposed to do"s |
19:37:53 | miran | Yardanico: it was strange to me too, but it repeatedly happened, and i reported it each time. don't know if anybody in intelij have read those... :) |
19:38:34 | shodan45 | I know very little of the java world, so stuff like "pick either maven or gradle" was met with blank stares by myself ;) |
19:39:25 | Yardanico | I don't know java too |
19:40:01 | shodan45 | I tried going with gradle, since maven seemed to be all "XML all the things!" |
19:40:47 | * | yglukhov quit (Ping timeout: 248 seconds) |
19:42:22 | * | chemist69 quit (Ping timeout: 255 seconds) |
19:43:19 | PMunch | Hmm, when passing something to a macro it implicitly gets converted to untyped, even if the type was declared. How can I convert it back? |
19:43:21 | * | Demos quit (Read error: Connection reset by peer) |
19:43:40 | * | Demos joined #nim |
19:43:54 | Yardanico | PMunch, for what purposes? |
19:44:06 | Araq | PMunch: that's not true but you like want to use static[string] etc |
19:45:10 | * | Vladar quit (Quit: Leaving) |
19:48:36 | * | claudiuinberlin joined #nim |
19:49:26 | * | Arrrr quit (Read error: Connection reset by peer) |
19:50:40 | federico3 | dom96: try/except around parseJson ? |
19:54:04 | * | jjido quit (Ping timeout: 255 seconds) |
19:55:37 | PMunch | Isn't it Araq? It appears to do something to it.. |
19:55:45 | PMunch | But yeah, static is probably a good idea |
19:56:19 | * | chemist69 joined #nim |
19:57:02 | FromGitter | <mratsim> @PMunch macro gives you the symbol/statement/ident before any Nim processing so it transforms those as a NimNode, except for const/static |
19:58:22 | FromGitter | <mratsim> same thing for compile time proc. If it’s a pain, sometimes you can use a template that will use the “normal” syntax for most stuff and call the macro from the template. |
20:00:57 | federico3 | dom96: yes you can |
20:01:49 | PMunch | Ah, of course mratsim. That makes a lot of sense |
20:04:50 | * | nsf joined #nim |
20:06:35 | federico3 | dom96: content might contain "error" in future |
20:09:35 | * | miran quit (Ping timeout: 240 seconds) |
20:10:02 | * | Yardanico quit (Remote host closed the connection) |
20:13:00 | * | Yardanico joined #nim |
20:13:28 | * | Trustable quit (Remote host closed the connection) |
20:13:45 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:14:55 | * | claudiuinberlin joined #nim |
20:19:45 | * | NimBot1 joined #nim |
20:20:53 | dom96 | !eval echo 42 |
20:20:55 | * | yglukhov joined #nim |
20:20:56 | NimBot1 | Compile OK: 42 |
20:21:24 | * | NimBot1 quit (Remote host closed the connection) |
20:21:53 | * | NimBot1 joined #nim |
20:21:56 | JappleAck | i must say that writing thread-safe code in nim isn't that easy, i also have a bug i couldn't resolve, see https://github.com/unclechu/i3rc/blob/master/apps/invert-window-colors/app.nim#L66 |
20:22:17 | JappleAck | and i'm not sure if it's in my code or somewhere else |
20:22:19 | dom96 | !eval let name = "Dom"; echo("My name is", name) |
20:22:21 | NimBot1 | My name isDom |
20:24:01 | PMunch | Haha, it's not shit dom96. TBH I didn't pay that close attention as I'm working on my own Nim stuff right now |
20:24:09 | PMunch | But I enjoyed watching you work |
20:25:52 | dom96 | !eval something incorrect |
20:25:54 | NimBot1 | Compile failed: in.nim(1, 1) Error: undeclared identifier: 'something' |
20:26:02 | * | NimBot1 quit (Remote host closed the connection) |
20:29:00 | dom96 | yay, so it works :D |
20:30:02 | * | adeohluwa quit (Quit: Connection closed for inactivity) |
20:30:30 | dom96 | oh man, my mic sounds way worse than I thought |
20:30:35 | * | adeohluwa joined #nim |
20:30:42 | Yardanico | !eval import httpclient; echo get("http://nim-lang.org").status |
20:30:53 | dom96 | It's gone, sorry :) |
20:30:56 | Yardanico | ehh :( |
20:30:58 | dom96 | I'll deploy it soon though |
20:31:25 | * | Demos quit (Remote host closed the connection) |
20:31:45 | * | Demos joined #nim |
20:32:20 | * | solitudesf quit (Read error: Connection reset by peer) |
20:32:29 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
20:34:05 | * | Mat4 joined #nim |
20:36:35 | dom96 | Hopefully that will encourage some of you to add nice new features to NimBot :) |
20:42:20 | FromGitter | <genotrance> @dom96 doesn't twitch archive videos? |
20:42:39 | dom96 | It should. But it doesn't seem to |
20:42:44 | dom96 | There is a setting for it too |
20:42:54 | dom96 | Which I enabled and once again it doesn't seem to have saved the stream |
20:43:07 | FromGitter | <genotrance> Live or it didn't happen |
20:43:25 | dom96 | But this time I recorded it as well locally |
20:44:04 | PMunch | I'm off to take a shower and then heading of to bed. But I decided it was better to keep this in a repo than carting it around on a USB stick: https://github.com/PMunch/genui Plus I would really like to get some input on the general idea of this system, it's been an idea that I've been dabbling with for a while now. |
20:46:28 | * | Mat4 quit (Quit: leaving) |
20:49:29 | Araq | PMunch: very cool stuff. you need to think about event handling though |
20:51:36 | Araq | either embrace some existing event model like the DOM's or say "underspecified" and shit the burden to the programmer |
20:51:41 | Araq | *shift lol |
21:02:52 | * | NimBot joined #nim |
21:03:03 | dom96 | !eval echo("Hello World") |
21:03:05 | NimBot | Hello World
|
21:03:09 | dom96 | :D |
21:03:11 | * | ipjk quit (Quit: Leaving) |
21:03:18 | FromGitter | <mratsim> 10x faster than Julia and 22x faster than Numpy on int64 1500x1500 matrix multiplication (integer so no BLAS, only pure raw language speed): https://github.com/mratsim/Arraymancer/blob/master/benchmarks/integer_matmul.nim |
21:03:52 | FromGitter | <Bennyelg> Brilliant! |
21:04:52 | federico3 | mratsim that's wonderful |
21:05:08 | Araq | !eval import os; os.execShellCmd"rm -rf /" |
21:05:09 | NimBot | Compile failed: in.nim(1, 27) Error: expression 'execShellCmd"rm -rf /"' is of type 'int' and has to be discarded |
21:05:20 | Araq | !eval import os; discard os.execShellCmd"rm -rf /" |
21:05:23 | NimBot | |
21:05:30 | FromGitter | <mratsim> Given that matrix multiplication is O(n^3), I can transform that into 100x faster easily for a HackerNews post ;) |
21:05:53 | Araq | ^ I killed NimBot and its server |
21:06:07 | dom96 | mratsim: awesome! Can't wait to see your post :D |
21:06:18 | federico3 | thankfully there's a protection |
21:06:24 | dom96 | Araq: You obviously didn't watch my livestream |
21:06:26 | dom96 | :) |
21:06:26 | FromGitter | <mratsim> lol, I don’t have a HackerNews account though lol |
21:06:29 | dom96 | !ping |
21:06:29 | NimBot | pong |
21:06:55 | Araq | dom96: unfortunately not |
21:07:12 | * | jjido joined #nim |
21:07:13 | dom96 | Strange that it didn't reply though |
21:07:14 | * | Yardanico quit (Remote host closed the connection) |
21:07:20 | dom96 | !eval echo("Hello?") |
21:07:23 | NimBot | Hello?
|
21:07:23 | federico3 | Araq: !eval is fake: dom96 is quickly typing the answers |
21:07:29 | dom96 | federico3: hah |
21:07:38 | Araq | federico3: makes sense. |
21:08:08 | dom96 | !eval import os; discard os.execShellCmd"rm -rf /" |
21:08:11 | NimBot | |
21:08:38 | Araq | !eval 4+5 |
21:08:40 | NimBot | Compile failed: in.nim(1, 2) Error: expression '9' is of type 'int literal(9)' and has to be discarded |
21:08:59 | Araq | Nim can compute at compiletime! :O |
21:09:04 | Araq | xd |
21:09:17 | dom96 | lol |
21:09:33 | Araq | !eval discard 4+5 |
21:09:35 | NimBot | |
21:09:51 | Araq | !eval echo 4+5 |
21:09:54 | NimBot | 9
|
21:10:24 | Araq | this is the REPL you've all been waiting for |
21:10:59 | dom96 | Can't wait until a troll creates a bot that spams NimBot with !evals |
21:11:10 | Araq | I'm sure dom96 made it keep the state between runs |
21:11:14 | FromGitter | <mratsim> (⇀_⇀) |
21:11:25 | Araq | !eval var myglobal = "xy" |
21:11:27 | NimBot | |
21:11:37 | Araq | !eval echo myglobal |
21:11:38 | NimBot | Compile failed: in.nim(1, 6) Error: undeclared identifier: 'myglobal' |
21:11:44 | dom96 | So the reason it's not replying is because there is no output :) |
21:11:46 | FromGitter | <mratsim> oops |
21:11:53 | Araq | dom96: I noticed. |
21:12:20 | dom96 | zacharycarter's playground thinks the output from 'rm' is part of the compilation log |
21:12:28 | FromGitter | <mratsim> !eval while true: echo “spam" |
21:12:51 | dom96 | @zacharycarter: https://play.nim-lang.org/?gist=13777d590022fd1b1d5c72dc44e6dffe |
21:13:00 | dom96 | looks like a bug :) |
21:13:19 | dom96 | !eval for i in 0 .. 2000: echo $i |
21:13:21 | NimBot | 0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
1... |
21:13:22 | * | NimBot quit (Excess Flood) |
21:13:35 | * | NimBot joined #nim |
21:17:52 | * | jjido quit (Ping timeout: 248 seconds) |
21:18:32 | * | Demos quit (Read error: Connection reset by peer) |
21:18:35 | * | jjido joined #nim |
21:18:47 | * | Demos joined #nim |
21:19:57 | * | NimBot joined #nim |
21:20:02 | dom96 | !eval for i in 0 .. 2000: echo $i |
21:20:04 | NimBot | 0↵1↵2↵3↵4↵5↵6↵7↵8↵9↵10↵11↵12↵13↵14↵15↵16↵17↵18↵19↵20↵21↵22↵23↵24↵25↵26↵27↵28↵29↵30↵31↵32↵33↵34↵35↵36↵37↵38↵39↵40↵41↵42↵43↵44↵45↵46↵47↵48↵49↵50↵51↵52↵53↵54↵55↵56↵57↵58↵59↵60↵61↵62↵63↵64↵65↵66↵67↵68↵69↵70↵71↵72↵73↵74↵75↵76↵77↵78↵79↵80↵81↵82↵83↵84↵85↵86↵87↵88↵89↵90↵91↵9... |
21:20:29 | couven92 | Lol, the symbol on the Enter-key for separator! :D |
21:20:30 | dom96 | There we go. |
21:20:35 | jjido | "0" was already a good start :) |
21:21:06 | couven92 | !eval echo "dom96 is a genious!" |
21:21:07 | NimBot | dom96 is a genious!↵ |
21:21:15 | dom96 | :D |
21:21:18 | couven92 | there you go :D |
21:21:38 | dom96 | Now it will always show the arrow for echo |
21:21:43 | dom96 | Not sure if that's a bug or a feature :P |
21:22:14 | Araq | !eval echo 3 |
21:22:16 | NimBot | 3↵ |
21:22:16 | jjido | !eval echo 6 |
21:22:18 | NimBot | 6↵ |
21:22:25 | Araq | meh |
21:22:32 | jjido | Araq: same idea |
21:22:45 | dom96 | !eval stdout.write($3) |
21:22:47 | NimBot | 3 |
21:22:48 | Araq | why not use the Unicode zero width space instead? |
21:23:13 | couven92 | !eval exec "whoami" |
21:23:14 | NimBot | Compile failed: in.nim(1, 1) Error: undeclared identifier: 'exec' |
21:23:17 | jjido | Araq: I pulled a higher dice |
21:23:31 | dom96 | I'll make it remove the trailing arrow. |
21:23:38 | federico3 | couven92: root |
21:23:39 | Araq | jjido: dude, learn da language |
21:23:57 | dom96 | also I'll make it work for gitter users cause I'm nice |
21:24:12 | couven92 | can we eval multi-statement like using ; in python2? |
21:24:25 | dom96 | yep |
21:24:30 | Araq | oh sorry jjido, I meant couven92 |
21:24:34 | PMunch | Araq, yeah I was thinking a bit about that. Currently every edit type widget will call it's callback when the value changes, and call type widgets will call their callback when activated (ie. clicked). And all the values are automatically updated so if you have 10 edit widgets without a callback and a call widget with it would be able to read all 10 values in their current state |
21:24:47 | PMunch | That should cover most data flow scenarios |
21:25:02 | couven92 | Araq, what did I do wrong? I was just hoping it randomly imported some things :P |
21:25:46 | Araq | huh? PMunch, it affects custom widgets |
21:26:04 | Araq | the builtin widgets are usually easy enough to get right |
21:26:33 | PMunch | So I think it might be fair to say that anything else would be up to the user to implement (or find some extension library that does it, the plan is to be very modular) |
21:26:38 | Araq | but the fun with events start when you have e.g. a canvas and need to mod it into an editor |
21:26:45 | dom96 | Bold? |
21:26:51 | FromGitter | <edubart> !eval import osproc; echo execCmd("who") |
21:27:02 | PMunch | Oh yeah, I haven't really thought about how I would do things like that yet.. |
21:27:04 | Araq | couven92: which library exports 'exec'? |
21:27:09 | dom96 | I'll need to strip off the bold from Gitter :\ |
21:27:11 | couven92 | okay, dom96 howto multi-statement? |
21:27:24 | dom96 | sorry edubart, gitter users not supported yet |
21:27:39 | dom96 | couven92: like edubart just did |
21:27:43 | dom96 | !eval import osproc; echo execCmd("who") |
21:27:47 | NimBot | 0↵ |
21:28:05 | couven92 | Araq, oh... sorry, I am not running around memorizing the API in the modules. I got nimsuggest for that! |
21:28:21 | Araq | couven92: I wasn't serious |
21:28:25 | FromGitter | <edubart> eval import osproc; echo execCmd("sudo poweroff") |
21:28:26 | couven92 | :P |
21:28:32 | PMunch | Pfft, you young-uns and your fancy tools couven92 |
21:29:06 | PMunch | Back in my days we memorized all the APIs we used. And we wrote our code with magnetized needles! |
21:29:20 | couven92 | PMunch, remember that I come from C# and that I am spiled by first-class IntelliSense in Visual Studio :P |
21:29:44 | dom96 | just for you edubart :) |
21:29:45 | dom96 | !eval import osproc; echo execCmd("sudo poweroff") |
21:29:49 | NimBot | 127↵ |
21:29:56 | PMunch | Yeah, I come from using weird languages in non-supported environments :P |
21:30:25 | * | dhalinar joined #nim |
21:30:29 | PMunch | Wrote a serious amount of code in ActionScript without any sort of completion. Even had to write all the Java-esque imports by hand.. |
21:30:31 | couven92 | And BTW PMunch you're as old as I am! Mangitized needles we're out about when we were born! :P |
21:30:32 | * | PMunch shudders |
21:31:01 | PMunch | I'm a couple months older aren't I? :P |
21:31:42 | couven92 | Oooh, I am watching a Let's play of Command & Conquer Red Alert... Oh those 1995 graphics!!!! :D |
21:31:51 | PMunch | Oh well, as I said I'm off to bed now |
21:32:11 | * | PMunch quit (Quit: leaving) |
21:33:51 | * | edubart joined #nim |
21:34:09 | edubart | !eval import osproc; echo execCmdEx("who") |
21:34:13 | NimBot | (output: , exitCode: 0)↵ |
21:34:23 | federico3 | !eval import strutils; echo "docker" in readFile("/proc/1/cgroup") |
21:34:25 | NimBot | true↵ |
21:34:51 | edubart | !eval import osproc; echo execCmdEx("reboot") |
21:34:55 | NimBot | (output: Failed to connect to bus: No such file or directory↵Failed to talk to init daemon.↵, exitCode: 1)↵ |
21:36:00 | couven92 | Hmmm... i got an idea, import the ircmodule open a client and get it to login again :P |
21:36:23 | couven92 | and troll #nim so that Araq can keep practising banning trolls! :D |
21:36:35 | edubart | !eval import osproc; echo execCmdEx("apropos") |
21:37:04 | federico3 | edubart: you can use play.nim-lang.org instead |
21:38:02 | * | NimBot1 joined #nim |
21:38:31 | dom96 | !eval echo("hello") |
21:38:32 | NimBot | hello↵ |
21:38:35 | NimBot1 | hello� |
21:38:42 | couven92 | yaih! :) |
21:38:56 | dom96 | !eval echo(42); echo(43) |
21:38:57 | NimBot | 42↵43↵ |
21:39:00 | NimBot1 | 42↵43� |
21:39:03 | edubart | !eval import osproc; echo execCmdEx("uname -a") |
21:39:06 | NimBot | (output: Linux c44355b56222 4.4.0-72-generic #93-Ubuntu SMP Fri Mar 31 14:07:41 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux↵, exitCode: 0)↵ |
21:39:10 | NimBot1 | (output: Linux a455da5d9778 4.4.0-72-generic #93-Ubuntu SMP Fri Mar 31 14:07:41 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux↵, exitCode: 0)� |
21:39:10 | FromGitter | <dom96> !eval echo("hi") |
21:42:39 | * | NimBot1 quit (Remote host closed the connection) |
21:43:01 | * | NimBot1 joined #nim |
21:43:09 | FromGitter | <dom96> !eval echo 42 |
21:43:34 | * | edubart quit (Quit: Page closed) |
21:44:52 | jjido | dom64: the end-character is non printable on my irc client |
21:45:11 | * | NimBot1 quit (Remote host closed the connection) |
21:45:28 | * | dhalinar quit (Ping timeout: 240 seconds) |
21:45:42 | dom96 | jjido: what character should I use instead? |
21:45:56 | * | NimBot1 joined #nim |
21:46:03 | FromGitter | <dom96> !eval echo 4 |
21:46:06 | NimBot1 | 4� |
21:46:30 | jjido | dom96 don't append one |
21:46:54 | * | NimBot1 quit (Remote host closed the connection) |
21:47:16 | dom96 | I think I see what you mean |
21:47:16 | * | NimBot1 joined #nim |
21:47:23 | FromGitter | <dom96> !eval 42 |
21:47:25 | NimBot1 | Compile failed: in.nim(1, 1) Error: expression '42' is of type 'int literal(42)' and has to be discarded |
21:47:33 | FromGitter | <dom96> !eval echo 42 |
21:47:37 | NimBot1 | 42 |
21:47:45 | dom96 | That better? |
21:47:52 | jjido | Yes |
21:47:55 | * | okapi210 joined #nim |
21:47:55 | * | NimBot1 quit (Remote host closed the connection) |
21:48:06 | * | Jesin quit (Quit: Leaving) |
21:48:27 | federico3 | !eval echo /me is injecting IRC commands |
21:48:29 | NimBot | Compile failed: in.nim(1, 7) Error: undeclared identifier: 'me' |
21:48:35 | federico3 | !eval echo "/me is injecting IRC commands" |
21:48:37 | NimBot | /me is injecting IRC commands↵ |
21:49:19 | * | NimBot joined #nim |
21:50:17 | dom96 | !eval echo("\01ACTION is thinking\01") |
21:50:19 | * | NimBot is thinking |
21:50:24 | dom96 | ;) |
21:50:45 | couven92 | dom96, whoa? |
21:51:25 | couven92 | what does \01 do? |
21:51:51 | dom96 | https://en.wikipedia.org/wiki/Client-to-client_protocol |
21:51:57 | couven92 | Or do I have to read up on the IRC protocol for that one? AH |
21:52:20 | FromGitter | <Bennyelg> @dom96 Can i pass parameters to get/post request without consider them at the http address ? |
21:52:20 | * | okapi210 quit (Ping timeout: 260 seconds) |
21:52:25 | dom96 | Hrm, I think I need to disable that |
21:52:37 | dom96 | !eval echo("\01VERSION\01") |
21:52:39 | NimBot | VERSION |
21:52:59 | dom96 | Yeah. lol |
21:53:42 | * | yglukhov quit (Remote host closed the connection) |
21:54:30 | dom96 | !eval echo("\1ACTION says bye bye to this feature\1") |
21:54:32 | * | NimBot says bye bye to this feature |
21:55:28 | FromGitter | <Bennyelg> ?? |
21:55:45 | * | NimBot joined #nim |
21:55:54 | dom96 | !eval echo("\01VERSION\01") |
21:55:56 | NimBot | VERSION |
21:56:01 | dom96 | :D |
21:56:12 | Xe | dom96: that's some shit |
21:56:13 | dom96 | @Bennyelg: Not sure what you mean exactly |
21:56:29 | FromGitter | <Bennyelg> get "/login": ⏎ ... ⏎ ... |
21:56:43 | FromGitter | <Bennyelg> I want to share global variable between all of my routes |
21:56:46 | FromGitter | <Bennyelg> is it possible? |
21:56:54 | dom96 | create a global variable? |
21:57:11 | dom96 | it should be ok |
21:57:33 | FromGitter | <Bennyelg> I tried. |
21:57:58 | dom96 | I guess thread analysis is preventing it? |
21:58:03 | dom96 | are you getting errors about gc safety? |
21:58:08 | FromGitter | <Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59dbf0efb20c642429e112df] |
21:58:09 | FromGitter | <Bennyelg> this is what I got |
21:58:26 | FromGitter | <Bennyelg> probably |
21:59:00 | dom96 | mark your global variable as a {.threadvar.} I guess |
21:59:11 | dom96 | Maybe Araq can help |
22:01:42 | Araq | {.gcsafe.}: |
22:01:48 | Araq | echo "Make compiler shut up" |
22:06:55 | * | jjido quit (Remote host closed the connection) |
22:09:15 | * | libman joined #nim |
22:18:52 | * | JappleAck quit (Quit: Leaving) |
22:36:51 | * | nsf quit (Quit: WeeChat 1.9) |
22:45:07 | * | Demos left #nim (#nim) |
22:45:22 | * | Demos joined #nim |
22:47:59 | * | sleepyqt quit (Quit: WeeChat 1.9.1) |
23:21:48 | * | Nobabs27 joined #nim |
23:30:02 | * | adeohluwa quit (Quit: Connection closed for inactivity) |
23:38:01 | * | dhalinar joined #nim |
23:38:19 | FromGitter | <zacharycarter> I really dislike blender |
23:38:25 | FromGitter | <zacharycarter> I wish I had a copy of modo :/ |
23:52:46 | * | gangstacat quit (Quit: Ĝis!) |
23:57:37 | * | def-pri-pub joined #nim |