00:02:02 | dom96 | Try running the binary directly |
00:02:27 | dom96 | For some odd reason macOS prevents binaries to pass this env var to other processes |
00:03:19 | FromGitter | <sherjilozair> Same issue |
00:03:22 | FromGitter | <sherjilozair> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae50bca62316e05050e54bd] |
00:07:35 | FromGitter | <sherjilozair> When compiled with nimDebugDlOpen |
00:07:38 | FromGitter | <sherjilozair> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae50cca270d7d3708186ca3] |
00:08:35 | FromGitter | <sherjilozair> even though `/Users/sherjilozair/NimProjects/pong/lib//libcsfml-graphics.dylib` does exist. |
00:15:50 | dom96 | It's looking for libsfml |
00:15:53 | dom96 | You need that too |
00:19:19 | FromGitter | <zacharycarter> hrm - is there anyway to hoist a statement for the JS backend? |
00:19:44 | CodeVance | Js gets hoisted automatically doesn't it? |
00:20:00 | FromGitter | <zacharycarter> well yeah but I'm running into an issue |
00:20:05 | FromGitter | <zacharycarter> sooo |
00:20:34 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae50fd2b01085166cd06aa1] |
00:20:37 | FromGitter | <zacharycarter> results in |
00:20:45 | FromGitter | <zacharycarter> `SyntaxError: import declarations may only appear at top level of a module` |
00:21:14 | FromGitter | <zacharycarter> maybe if I declare those procs in another nim module |
00:21:15 | FromGitter | <zacharycarter> let me try that |
00:22:05 | CodeVance | Are you trying to dynamic load a dll. Haven't you wrote an article about that |
00:23:16 | FromGitter | <zacharycarter> no |
00:23:24 | FromGitter | <zacharycarter> I'm not |
00:23:29 | FromGitter | <zacharycarter> I'm trying to load a JS module |
00:23:51 | skrylar | dom96, probably to prevent some interesting forms of hooks =p |
00:24:17 | skrylar | there were already issues with people getting past Gatekeeper by swapping out SOs |
00:24:26 | CodeVance | zachery require ? |
00:24:35 | * | CodeVance left #nim ("Leaving") |
00:25:00 | FromGitter | <zacharycarter> I don't want to use require syntax if I can avoid it |
00:25:05 | FromGitter | <zacharycarter> I think that this should be supported |
00:25:06 | FromGitter | <CodeVance> skrylar. Its a compiled code limitation i think |
00:25:18 | FromGitter | <ephja> you can use 'import' in this way? |
00:25:28 | FromGitter | <zacharycarter> well - if you're using a bundler like parcel you can |
00:25:38 | FromGitter | <CodeVance> require is the js version of import isn't it? |
00:25:49 | FromGitter | <zacharycarter> well import is eventually going to turn into require |
00:25:56 | FromGitter | <zacharycarter> import is ES module syntax |
00:25:59 | FromGitter | <CodeVance> For everything? |
00:26:01 | FromGitter | <zacharycarter> so some browser support it |
00:26:02 | FromGitter | <zacharycarter> others don't |
00:26:34 | FromGitter | <zacharycarter> require is a nodejs thing / commonjs module thing |
00:26:48 | FromGitter | <zacharycarter> import is in the JS spec / going to be the new way of importing JS modules in the future |
00:26:52 | FromGitter | <CodeVance> the reason import must be top level is because nim makes the nim 2 js code one big js file |
00:26:56 | FromGitter | <CodeVance> Like include |
00:27:12 | FromGitter | <gogolxdong> 路is a chinese charactor. |
00:27:13 | FromGitter | <zacharycarter> well - the spec implies that the import statement must beat the top of the file |
00:27:26 | FromGitter | <zacharycarter> you can't just have an import statement anywhere in your JS |
00:27:33 | FromGitter | <zacharycarter> like you can with a require call |
00:27:50 | FromGitter | <gogolxdong> means road |
00:28:00 | FromGitter | <CodeVance> @zacharycarter no it meant not nested in a function. When block is okay though |
00:28:19 | FromGitter | <zacharycarter> huh? |
00:28:55 | FromGitter | <CodeVance> top-level is different from top-of-the-file |
00:29:16 | FromGitter | <gogolxdong> 路 is a chinese charactor which means road. |
00:29:33 | FromGitter | <zacharycarter> there's only one level in the file. |
00:29:38 | FromGitter | <CodeVance> @gogolxdong what you talking about XD |
00:29:39 | FromGitter | <zacharycarter> @gogolxdong yes - we got that |
00:29:57 | FromGitter | <zacharycarter> most of us are not Chinese |
00:29:58 | FromGitter | <zacharycarter> FYI |
00:30:27 | FromGitter | <ephja> @CodeVance 🤷 was turned into that character by the eval bot |
00:30:45 | FromGitter | <CodeVance> zachary make that a template. not a proc |
00:31:01 | FromGitter | <CodeVance> \🤷 |
00:31:03 | FromGitter | <CodeVance> /🤷 |
00:31:15 | FromGitter | <zacharycarter> I don't think you can importcpp with templates |
00:31:17 | FromGitter | <zacharycarter> I could be wrong |
00:31:36 | FromGitter | <zacharycarter> you can't use ffi at compile time tmk |
00:31:40 | FromGitter | <CodeVance> @zacharycarter its not importing. think of it like copy paste |
00:31:59 | skrylar | you can also put imports inside top level when statements |
00:32:05 | FromGitter | <CodeVance> putting that in a proc would mean it has to run at runtime |
00:32:28 | FromGitter | <CodeVance> putting it in a macro or template is like a compile time proc |
00:33:20 | FromGitter | <zacharycarter> yeah but this isn't a nim import |
00:33:32 | FromGitter | <zacharycarter> and I need a js ffi proc declared to cal it first |
00:33:32 | FromGitter | <CodeVance> So if it is in a template it'll actually understand your intention. Because the nim runtime doesn't have compile time capabilities. (importcpp and so on) |
00:33:47 | FromGitter | <CodeVance> Just try it... it ought to work |
00:33:49 | FromGitter | <zacharycarter> okay I'll try it |
00:33:52 | FromGitter | <CodeVance> hopefully |
00:33:55 | FromGitter | <CodeVance> T_T |
00:34:06 | FromGitter | <zacharycarter> what am I supposed to do - just return a string? |
00:34:33 | FromGitter | <CodeVance> no just put the pragma inside the template body |
00:34:38 | FromGitter | <CodeVance> I think! |
00:34:46 | FromGitter | <zacharycarter> oh okay |
00:34:52 | FromGitter | <CodeVance> And maybe {.inject.} pragma in template head |
00:35:17 | FromGitter | <CodeVance> Though I'm just guessing from fooling around with templates |
00:35:38 | FromGitter | <zacharycarter> ``` {. importcpp: "import * as # from '#'" .}`````` |
00:35:40 | FromGitter | <zacharycarter> doesn't seem to work |
00:35:58 | FromGitter | <zacharycarter> `Error: attempting to call undeclared routine: 'importcpp'` |
00:38:07 | FromGitter | <CodeVance> But that's a cpp... |
00:38:18 | FromGitter | <CodeVance> Is there like a importjs |
00:38:35 | FromGitter | <CodeVance> is the import code a js code? |
00:38:45 | FromGitter | <CodeVance> maybe try {.emit: .} |
00:40:59 | FromGitter | <zacharycarter> yeah - that's what I tried next |
00:41:03 | FromGitter | <CodeVance> what about importc instead of importcpp |
00:41:08 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae514a31130fe3d362a0689] |
00:41:14 | FromGitter | <zacharycarter> importc doesn't work with jsbackend - only importcpp does |
00:41:23 | FromGitter | <CodeVance> what? okkka |
00:41:36 | FromGitter | <zacharycarter> but the js that gets produced is - ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae514bf2d0e228d7bc2584e] |
00:42:03 | FromGitter | <zacharycarter> so obviously like some globals are getting put into the generated code first |
00:42:13 | FromGitter | <zacharycarter> I'll see if I can write some type of hoist pragma |
00:44:46 | FromGitter | <sivakon> When will c2nim support commas? |
00:47:02 | FromGitter | <CodeVance> ```code paste, see link``` ⏎ ⏎ @zacharycarter [https://gitter.im/nim-lang/Nim?at=5ae5160562316e05050e71ac] |
00:47:40 | FromGitter | <CodeVance> Wait %r doesn't make quotes |
00:48:29 | FromGitter | <sherjilozair> Thanks @dom96. Any idea where to place the other extlibs. I get this now: `dlopen(libcsfml-graphics.dylib, 2): Library not loaded: @rpath/../Frameworks/freetype.framework/Versions/A/freetype` |
00:55:21 | * | PMunch quit (Quit: leaving) |
00:55:27 | * | xet7 quit (Read error: Connection timed out) |
00:56:07 | * | xet7 joined #nim |
00:57:29 | * | xet7 quit (Max SendQ exceeded) |
00:57:51 | * | xet7 joined #nim |
01:03:03 | FromGitter | <CodeVance> @zacharycarter https://github.com/bluenote10/KaraxExamples/tree/master/JsIntegration I'm going to try this |
01:05:17 | * | noonien quit (Quit: Connection closed for inactivity) |
01:17:23 | FromGitter | <zacharycarter> @CodeVance - I still don't think it will work the AST needs to be modified |
01:21:57 | * | CodeVance joined #nim |
01:22:09 | FromGitter | <zacharycarter> and I don't think can get access to the full AST with macros |
01:22:12 | FromGitter | <CodeVance> es6 gets imported it says |
01:22:31 | FromGitter | <CodeVance> es6 import is hoisted internet says |
01:22:47 | FromGitter | <zacharycarter> well - it is if it's just vanilla JS |
01:22:47 | * | CodeVance left #nim (#nim) |
01:22:56 | FromGitter | <zacharycarter> err wait |
01:23:07 | FromGitter | <zacharycarter> no - ES6 import statements have to appear at the top of a module |
01:23:10 | * | ftsf joined #nim |
01:23:18 | FromGitter | <zacharycarter> I use them daily at work |
01:24:11 | FromGitter | <CodeVance> It means that module can contain only ImportDeclaration's, ExportDeclaration's or StatementListItem's. According to this StatementListItem could not contain ImportDeclaration nor ExportDeclaration. |
01:24:28 | FromGitter | <CodeVance> As long as it isn't in a statementitem |
01:24:32 | FromGitter | <CodeVance> https://stackoverflow.com/questions/29329662/are-es6-module-imports-hoisted |
01:25:15 | FromGitter | <CodeVance> THe thing is all that code at the top is compatibility stuff |
01:25:24 | FromGitter | <CodeVance> I don't know how to switch that off |
01:25:50 | FromGitter | <zacharycarter> that's what I'm saying - you need to modify the jsgen in the compiler most likely to make this work |
01:27:21 | FromGitter | <amscotti> Hi, if anyone has a min, I wouldn't mind some feedback on something I wrote for the about Nim for the Nim exercism track. Any feedback is welcomed, I want to make sure this is representing Nim correctly. ⏎ ⏎ https://github.com/exercism/nim/pull/61/files ⏎ ⏎ Thanks! :) [https://gitter.im/nim-lang/Nim?at=5ae51f78b01085166cd091bc] |
01:29:39 | FromGitter | <CodeVance> Maybe post in the forums too :) |
01:31:06 | FromGitter | <amscotti> Sure, good idea! |
01:35:26 | FromGitter | <zacharycarter> dom96: is there a way to add a local build of nim to choosenim? |
01:36:00 | FromGitter | <zacharycarter> nevermind I see there is |
01:37:18 | * | ftsf quit (Read error: Connection reset by peer) |
01:38:24 | * | endragor joined #nim |
01:42:59 | * | endragor quit (Ping timeout: 260 seconds) |
01:48:51 | FromGitter | <amscotti> Is there a better way to divide a int by a float then casting the int into a float with `.float`? |
01:52:29 | FromGitter | <CodeVance> converters or something. I'm still new |
01:54:21 | FromGitter | <zacharycarter> @amscotti - I added a review |
01:54:43 | FromGitter | <zacharycarter> yes - there are converters - although I don't know if they'll stick around or not - I think there is debate around its usefulness |
01:56:27 | FromGitter | <amscotti> Thanks for the review @zacharycarter ! So, it sounds like it's best to say with `.float` for now? |
01:57:18 | FromGitter | <zacharycarter> well |
01:59:10 | FromGitter | <zacharycarter> something like - ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae526ee7c3a01610d30469a] |
01:59:55 | FromGitter | <zacharycarter> but yes |
02:00:08 | FromGitter | <zacharycarter> I would stick with the `.float` and do something like ^ |
02:01:55 | FromGitter | <zacharycarter> https://forum.nim-lang.org/t/3772 - btw that's the conversation / thread I was referring to |
02:02:00 | FromGitter | <zacharycarter> when I mentioned debate around converters |
02:04:00 | petersjt014[m] | Is there any way I can get a `TimeInterval` as just seconds? |
02:05:49 | FromGitter | <zacharycarter> ```import times ⏎ ⏎ let interval = TimeInterval(seconds: 300) ⏎ ⏎ echo interval.seconds``` [https://gitter.im/nim-lang/Nim?at=5ae5287d2d0e228d7bc287d5] |
02:05:56 | FromGitter | <zacharycarter> I don't think I'm understanding your question :/ |
02:06:54 | FromGitter | <zacharycarter> do you mean like |
02:07:22 | FromGitter | <zacharycarter> if you had `TimeInterval(days: 1)` |
02:07:54 | FromGitter | <zacharycarter> you'd want to be able to pass that object instance into a proc and return the number of seconds in the time interval? |
02:10:13 | FromGitter | <zacharycarter> I don't think such a proc exists but it should be stupid simple to write |
02:13:06 | FromGitter | <CodeVance> I've read this. http://joeduffyblog.com/2016/02/07/the-error-model/#retrospective-and-conclusions I think errors and failures is the way to go. As long as there is a friendly enough way to use it then I think it'd be good |
02:15:30 | FromGitter | <zacharycarter> petersjt014[m]: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae52ac21130fe3d362a3eff] |
02:16:24 | FromGitter | <CodeVance> isn't there a timedate lib? |
02:16:38 | FromGitter | <zacharycarter> there's the times module in the stdlib |
02:17:08 | FromGitter | <CodeVance> isn't something like that supposed to be in there x_x |
02:17:42 | FromGitter | <zacharycarter> I mean - I think that function is pretty easy to write |
02:17:56 | FromGitter | <zacharycarter> and if someone wants to build on top of the stdlib module - they certainly can |
02:18:00 | FromGitter | <CodeVance> ya just multiply |
02:18:12 | FromGitter | <zacharycarter> but I don't think the stdlib needs to embrace hand holding either |
02:18:13 | FromGitter | <CodeVance> I can't believe you use exponentials |
02:18:28 | FromGitter | <zacharycarter> it should give tools for developers to build on top of |
02:18:31 | FromGitter | <zacharycarter> not do everything for you |
02:18:59 | FromGitter | <CodeVance> Well I just want things to be as simple as possible. and no simpler |
02:19:15 | FromGitter | <CodeVance> not complicated. not getting in the way |
02:19:20 | FromGitter | <CodeVance> all else the dev can do |
02:19:25 | FromGitter | <zacharycarter> well I don't think you can get any more simpler than simpler as possible :P |
02:20:02 | FromGitter | <CodeVance> proc toSeconds(time: Time): float |
02:20:13 | FromGitter | <zacharycarter> that's not the same thing as a TimeInterval though |
02:20:18 | FromGitter | <zacharycarter> different types |
02:21:44 | FromGitter | <CodeVance> T_T |
02:22:03 | * | arecaceae quit (Remote host closed the connection) |
02:22:27 | * | arecaceae joined #nim |
02:26:38 | * | skrylar quit (Remote host closed the connection) |
02:39:08 | FromGitter | <CodeVance> is there a rectangle library? |
02:51:12 | FromGitter | <amscotti> Thanks @CodeVance and @zacharycarter for the feedback on the About Nim, just updated it and I think it sounds a lot better now! :) |
03:05:55 | * | alpha1220 joined #nim |
03:06:07 | FromGitter | <CodeVance> good night or day all |
03:06:34 | alpha1220 | Araq: nil gone from strings and seq, when will null be gone? https://github.com/nim-lang/Nim/issues/5596#issuecomment-311931492 :D |
03:08:01 | * | xet7 quit (Read error: Connection timed out) |
03:08:37 | * | xet7 joined #nim |
03:11:29 | * | alpha1220 quit (Ping timeout: 260 seconds) |
03:51:21 | * | Lord_Nightmare quit (Ping timeout: 264 seconds) |
03:51:53 | * | Lord_Nightmare joined #nim |
04:01:37 | FromGitter | <sherjilozair> This page should be improved: https://learnxinyminutes.com/docs/nim/ |
04:01:42 | FromGitter | <sherjilozair> A lot of people use it to learn. |
04:06:35 | * | SenasOzys quit (Ping timeout: 240 seconds) |
04:24:56 | * | xet7 quit (Read error: Connection timed out) |
04:25:37 | * | xet7 joined #nim |
04:26:58 | * | xet7 quit (Max SendQ exceeded) |
04:27:21 | * | xet7 joined #nim |
04:29:00 | * | xet7 quit (Max SendQ exceeded) |
04:29:23 | * | xet7 joined #nim |
04:29:42 | * | darithorn joined #nim |
05:12:32 | Araq | null will go too indeed. then "" is mapped to nil, saving allocations, giving us the speed back we lost in these internal isNil or len == 0 checks everywhere |
05:16:58 | planetis[m] | nice! |
05:18:56 | planetis[m] | does ``someSeq == @[]`` also have a performance penalty versus ``someSeq.len == 0``, likewise with ""? |
05:20:10 | * | alpha1220 joined #nim |
05:21:03 | * | smt quit (Read error: Connection reset by peer) |
05:21:15 | * | smt joined #nim |
05:21:26 | alpha1220 | Araq: `var se: seq[int]; var se3 = newSeq[int](); echo se; echo se3` gives `nil @[]`. So sequences are still not initialized to empty it seems? |
05:22:50 | Araq | planetis[m]: same for seqs, @[] will be mapped to nil internally. |
05:23:14 | Araq | alpha1220: that's just the representation layer that I haven't touched yet |
05:23:40 | Araq | I'm investigating why the CIs hang now forever in the testsuite. |
05:24:05 | Araq | the joys of refactorings in a complex environment... |
05:24:39 | alpha1220 | Araq: 👍 |
05:24:46 | * | miran joined #nim |
05:30:03 | * | alpha1220 quit (Quit: Page closed) |
05:36:06 | FromGitter | <sherjilozair> Installing `c2nim` gives me this error: ` ... clex.nim(107, 15) Error: undeclared identifier: 'FileIndex'` |
05:36:31 | planetis[m] | did you install from nimble? |
05:36:56 | FromGitter | <sherjilozair> I cloned the repo, and then ran `nimble build`. |
05:38:10 | planetis[m] | try nimble install c2nim afaik it uses a git tag to a working commit |
05:38:59 | miran | yesterday there was a commit to c2nim dealing with 'FileIndex' - do you have the latest version? |
05:40:37 | FromGitter | <sherjilozair> I do have the latest version. I just cloned now. |
05:41:06 | miran | then try the previous version ;) |
05:41:09 | FromGitter | <sherjilozair> I get the same error with `nimble install c2nim` |
05:41:10 | planetis[m] | well you can try fix it. it probably misses an import |
05:41:18 | FromGitter | <sherjilozair> okay. |
05:41:22 | * | darithorn quit (Remote host closed the connection) |
05:41:37 | miran | hmm, maybe the latest version of c2nim works with the latest nim devel? |
05:41:51 | miran | if you're on stable (0.18.0), i would try that first.... |
05:50:30 | FromGitter | <sherjilozair> I get the same error with latest nim. |
05:51:22 | FromGitter | <sherjilozair> with both c2nim versions. |
05:51:33 | miran | file an issue then |
05:54:10 | Araq | works for the CI, c2nim's tests are green |
05:54:21 | Araq | check c2nim's travis script |
05:58:31 | * | xkapastel quit (Quit: Connection closed for inactivity) |
06:01:15 | * | SenasOzys joined #nim |
06:03:01 | * | leorize quit (Quit: WeeChat 2.1) |
06:03:31 | FromGitter | <sherjilozair> Does travis only check against latest commits? |
06:03:49 | FromGitter | <sherjilozair> Shouldn't we also check stable branch? |
06:04:53 | planetis[m] | so you cloned c2nim master and trying to build with nim devel? |
06:05:15 | FromGitter | <sherjilozair> `choosenim "#head"` to be precise. |
06:05:23 | FromGitter | <sherjilozair> Yes. |
06:05:48 | planetis[m] | well we all do mistakes :) |
06:06:34 | * | Trustable joined #nim |
06:07:33 | FromGitter | <sherjilozair> When I follow the travis script, I get this error: `c2nim.nim(11, 42) Error: cannot open 'compiler/llstream'` |
06:07:51 | FromGitter | <sherjilozair> Any ideas? |
06:09:25 | FromGitter | <Varriount> @sherjilozair Run "nimble install nim", I think |
06:09:44 | FromGitter | <Varriount> Or just, "nimble install c2nim" |
06:11:23 | FromGitter | <sherjilozair> @Varriount I've tried those. It doesn't work. |
06:11:48 | FromGitter | <Varriount> Odd |
06:12:16 | FromGitter | <Varriount> Oh, you're using Travis? |
06:12:27 | FromGitter | <Varriount> Hm. |
06:12:45 | FromGitter | <sherjilozair> No. I was running the commands in the travis script. |
06:13:03 | FromGitter | <sherjilozair> That's like the 3rd thing I tried. I tried nimble before. |
06:13:20 | FromGitter | <Varriount> Odd, it's usually not that hard... |
06:14:08 | FromGitter | <sherjilozair> Where does `FileIndex` come from? |
06:14:40 | FromGitter | <sherjilozair> This is the problem with the import semantics. I can't know where FileIndex comes from. |
06:16:11 | FromGitter | <Varriount> You could rgrep for "FileIndex(\*)? =" |
06:16:32 | FromGitter | <Varriount> (With an escaped asterisk) |
06:17:16 | FromGitter | <Varriount> @sherjilozair I'm not currently at my computer. I should be able to help you figure this out more in about 30 minutes. |
06:17:28 | FromGitter | <sherjilozair> Okay, thanks @Varriount . |
06:17:51 | FromGitter | <sherjilozair> I figured out FileIndex is in `compiler/msgs` |
06:17:51 | FromGitter | <Varriount> What method did you use to install Nim? |
06:17:57 | FromGitter | <sherjilozair> but importing it doesn't fix this issue. |
06:18:04 | FromGitter | <sherjilozair> the choosenim method. |
06:18:19 | FromGitter | <sherjilozair> and I ran `choosenim "#head"` later. |
06:18:34 | FromGitter | <sherjilozair> `Version 0.18.1` |
06:21:00 | * | dddddd quit (Remote host closed the connection) |
06:22:38 | FromGitter | <sherjilozair> Changing `FileIndex` to `int32` compiles, but not sure if it would work. |
06:25:31 | Araq | then you don't have Nim devel |
06:25:36 | Araq | but some outdated compiler package |
06:25:43 | Araq | compile with --noNimblePath |
06:26:08 | Araq | anyway, devel is a mess currently and I'm not here to fix it. you have to wait for tonight, sorry. |
06:28:29 | FromGitter | <Varriount> @sherjilozair The current version is something like 0.19 |
06:29:07 | FromGitter | <Varriount> What does your PATH environment variable look like? Where does "which nim" lead you? |
06:29:09 | FromGitter | <sherjilozair> So choosenim didn't really get me latest commit? |
06:29:36 | FromGitter | <sherjilozair> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae566505d7286b43a7c26c1] |
06:30:07 | FromGitter | <sherjilozair> What's the difference between master and devel? |
06:30:41 | FromGitter | <Varriount> Master is the last stable release. Revel is the active development branch |
06:31:21 | FromGitter | <Varriount> That is odd |
06:31:49 | FromGitter | <sherjilozair> So basically choosenim is not working. |
06:31:53 | FromGitter | <sherjilozair> It's not giving me 0.19. |
06:33:44 | FromGitter | <Varriount> I don't know. What does `choosenim show` return? |
06:35:31 | * | Trustable quit (Remote host closed the connection) |
06:35:43 | FromGitter | <sherjilozair> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae567bf2d0e228d7bc330e4] |
06:36:36 | FromGitter | <Varriount> @sherjilozair You ran `choosenim '#head'`, try running `choosenim '#devel'` |
06:38:17 | FromGitter | <Varriount> Also, what is your profile picture of? |
06:40:32 | FromGitter | <sherjilozair> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae568e07c3a01610d31006e] |
06:40:42 | FromGitter | <sherjilozair> That's just me. |
06:42:20 | FromGitter | <sherjilozair> #devel doesn't give 0.18 as well. |
06:42:48 | FromGitter | <sherjilozair> I mean 0.19. |
06:42:57 | FromGitter | <sherjilozair> I cloned nim and built it. That doesn't give me 0.19 as well. |
06:43:44 | FromGitter | <sherjilozair> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae5699f62316e05050f51ff] |
06:43:55 | FromGitter | <Varriount> I was wrong, there is no 0.19 (yet) |
06:44:17 | FromGitter | <Varriount> I think |
06:44:34 | * | miran quit (Ping timeout: 260 seconds) |
06:44:45 | FromGitter | <Varriount> Can you try installing/compiling c2 Nim now? |
06:45:21 | FromGitter | <sherjilozair> Yeah, latest nim worked. |
06:45:32 | FromGitter | <sherjilozair> so for some reason choosenim doesn't give latest nim. |
06:45:47 | FromGitter | <sherjilozair> Any examples on how to actually run c2nim? |
06:46:05 | FromGitter | <Varriount> It's just that #HEAD points to master, not devel |
06:47:22 | FromGitter | <sherjilozair> `#devel` didn't work either though. |
06:47:32 | FromGitter | <sherjilozair> Can c2nim be made to follow headers? |
06:47:40 | FromGitter | <Varriount> https://github.com/nim-lang/c2nim/blob/master/doc/c2nim.rst |
06:47:54 | FromGitter | <Varriount> C2nim is somewhat low-level. |
06:48:18 | FromGitter | <Varriount> I believe Nimgen is the current high-level tool. |
06:48:44 | FromGitter | <Varriount> https://github.com/genotrance/nimgen |
06:49:03 | FromGitter | <Varriount> Shout-out to @genotrance ! |
06:51:51 | FromGitter | <sherjilozair> Nimgen doesn't follow headers included using <> too. :/ |
06:53:20 | * | salewski joined #nim |
06:55:36 | salewski | dom96, further investigations about your macos gintro bug may indicate that you have not installed GtkSourceView package. |
06:56:06 | salewski | User zetashift had a similar issue on windows 10: https://github.com/StefanSalewski/gintro/issues/24 |
06:56:42 | salewski | But he was really smart, watched output from console and fixed the problem. |
06:57:45 | salewski | I will add some special care for these cases for generator script. |
06:58:31 | salewski | Unfortunately, as I am using releases, I would have to do a new release for each small fix. |
06:59:42 | salewski | Or I have to ask users to do "nimble install gintro#@head" -- maybe I will just add that hint to doc page. |
07:05:16 | salewski | For installation, you may try following these instructions: http://macappstore.org/gtksourceview/ |
07:09:31 | * | nsf joined #nim |
07:45:55 | * | yglukhov_ joined #nim |
07:48:33 | * | yglukhov quit (Ping timeout: 268 seconds) |
08:16:54 | yglukhov_ | hey, anyone can confirm that `nim c -r tests/iter/twrap_walkdir` and `nim c -r --debugger:native tests/iter/twrap_walkdir` work with latest devel? |
08:20:46 | FromGitter | <data-man> @yglukhov_: Not works for me |
08:21:05 | yglukhov_ | windows? |
08:21:18 | FromGitter | <data-man> No, Arch |
08:22:36 | yglukhov_ | phew. thought i messed smth up with my yet unmerged iters pr :) |
08:23:03 | FromGitter | <data-man> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae580e6109bb0433211d888] |
08:23:28 | * | nsf quit (Quit: WeeChat 2.0.1) |
08:23:41 | yglukhov_ | yup. and `nim c -r --debugger:native tests/iter/twrap_walkdir` crashes nim itself, right? |
08:23:50 | FromGitter | <data-man> Yes |
08:24:13 | yglukhov_ | Araq: there's smth going on here. not nil strings?.. |
08:57:17 | FromGitter | <dom96> @sherjilozair what makes you think choosenim doesn't grab latest Nim? |
08:58:01 | FromGitter | <sherjilozair> Because compiling c2nim with it gave errors, while cloning and building nim myself worked. |
08:58:33 | FromGitter | <dom96> Salewski: releasing every time you change something isn't practical. This issue also won't affect everyone. |
08:59:32 | FromGitter | <dom96> @sherjilozair any chance you could gist the logs? |
09:00:04 | FromGitter | <dom96> Far more likely that you had an outdated Nim installed somewhere else, perhaps via homebrew? |
09:01:08 | FromGitter | <sherjilozair> I made sure that the nim was in the .nimble directory. I'll get you the logs. |
09:02:16 | * | rauss quit (Read error: Connection reset by peer) |
09:02:54 | * | rauss joined #nim |
09:05:52 | * | athenot joined #nim |
09:06:31 | FromGitter | <sherjilozair> @dom96 https://gist.github.com/sherjilozair/5ec6cc23ff111d6a7bf887936743768e |
09:06:35 | * | SenasOzys quit (Ping timeout: 256 seconds) |
09:09:48 | * | athenot_ joined #nim |
09:10:15 | * | athenot quit (Ping timeout: 255 seconds) |
09:10:16 | dom96 | Oh, that's probably because of this: https://github.com/dom96/choosenim/issues/46 |
09:10:28 | dom96 | Did you try running ``nimble install compiler@#head``? |
09:10:41 | dom96 | oh wait |
09:11:08 | FromGitter | <sherjilozair> I did not. |
09:11:27 | dom96 | I just remembered that I pinned c2nim's compiler dep on a specific commit |
09:12:01 | dom96 | and indeed, I get the same error |
09:12:47 | dom96 | Because of this commit... https://github.com/nim-lang/c2nim/commit/9f05d97d98b2f03ead7213be0f1c80a17a4a0fb6 |
09:12:51 | dom96 | Araq: ^ |
09:12:59 | * | SenasOzys joined #nim |
09:13:21 | FromGitter | <sherjilozair> I mean the commit's okay, because it does compile with latest Nim. |
09:13:24 | FromGitter | <qqtop> With latest nim devel having --lineDir:on always SIGSEGV: Illegal storage access. (Attempt to read from nil?) |
09:14:45 | dom96 | sherjliozair: So after getting the latest Nim manually running `nimble install c2nim` worked? |
09:14:47 | FromGitter | <sherjilozair> @dom96 @Araq I think the travis script should be updated with an install method user's are more likely to use, i.e. stable, etc. |
09:14:51 | FromGitter | <sherjilozair> No. |
09:14:56 | FromGitter | <sherjilozair> well, I didn't try that. |
09:15:03 | FromGitter | <sherjilozair> I cloned c2nim and built it. |
09:15:04 | dom96 | Good, that's what I thought |
09:15:10 | dom96 | And yes, the travis script is wrong |
09:15:25 | FromGitter | <data-man> @dom96: Can we include c2nim to Nim/tools? |
09:15:30 | dom96 | data-man: no |
09:15:38 | dom96 | We should be moving things out of there instead of into there |
09:16:20 | FromGitter | <data-man> But without my PR c2nim not compiled with Nim-devel. |
09:16:23 | * | SenasOzys quit (Read error: Connection reset by peer) |
09:17:34 | dom96 | data-man: Yes, I know. We should update c2nim to work with latest Nim when necessary |
09:17:54 | dom96 | But you didn't update the pinned commit and so installation via Nimble is now broken |
09:19:11 | FromGitter | <data-man> Latest Nim? Release or devel? |
09:20:06 | FromGitter | <alehander42> can I compare if types are equal in a macro? |
09:20:13 | FromGitter | <data-man> Many developers using Nim-devel only :) |
09:20:20 | FromGitter | <alehander42> basically if they are the same Enum type |
09:20:24 | FromGitter | <alehander42> so no generics and stuff |
09:20:39 | FromGitter | <alehander42> I think the name should be sufficient, but maybe not |
09:20:49 | dom96 | data-man: you can still build Nimble with devel |
09:20:50 | FromGitter | <alehander42> they can share a name |
09:20:57 | dom96 | er, you can still build c2nim via nimble |
09:21:57 | * | athenot_ quit (Ping timeout: 255 seconds) |
09:23:30 | dom96 | The installation instructions for c2nim even say to do this :) |
09:26:09 | * | SenasOzys joined #nim |
09:29:45 | FromGitter | <alehander42> it seems `==` works, but I am not sure how reliable is it |
09:34:32 | * | niv quit (Quit: The Lounge - https://thelounge.github.io) |
09:39:17 | * | yglukhov_ quit (Remote host closed the connection) |
09:48:35 | * | miran joined #nim |
10:01:52 | * | yglukhov joined #nim |
10:22:22 | * | noonien joined #nim |
10:24:20 | * | yglukhov quit (Remote host closed the connection) |
10:25:18 | * | yglukhov joined #nim |
10:26:51 | * | yglukhov_ joined #nim |
10:26:52 | * | yglukhov quit (Read error: Connection reset by peer) |
10:30:57 | * | yglukhov_ quit (Ping timeout: 240 seconds) |
11:09:38 | * | Vladar joined #nim |
11:16:38 | FromGitter | <mratsim> By the way @Araq, since my yesterday essages were not properly relayed on IRC. Regarding https://github.com/nim-lang/Nim/issues/7713#issuecomment-385166604 and the {.inheritable.) pragma, can’t we just deprecate it? Are there any use case where it is superior from inheriting from the RootObj? |
11:16:53 | * | CodeVance joined #nim |
11:20:21 | FromGitter | <CodeVance> Maybe all the C interop stuff shoul be in its own lib to discourage usage in regular nim |
11:23:03 | FromGitter | <mratsim> you mean {.importc.} or types like uint? |
11:23:06 | FromGitter | <mratsim> cint* |
11:24:43 | FromGitter | <CodeVance> If their general use is discouraged then they shouldn't be so easy to get to |
11:24:57 | FromGitter | <CodeVance> But its more an austhetic issue. |
11:25:18 | * | CodeVance left #nim ("Leaving") |
11:42:41 | * | atweiden-air joined #nim |
11:44:49 | FromGitter | <mratsim> I’m sure it’s discussed somewhere, and Araq wants to do this |
11:45:08 | atweiden-air | hey, i'm the maintainer of https://aur.archlinux.org/packages/nim-git/ |
11:45:14 | atweiden-air | i don't have the ability to login to my github right now, but i wanted to report an issue with the nim build system |
11:45:22 | atweiden-air | specifically, building the PDF documentation is broken right now, due to ForLoopStmt |
11:45:37 | atweiden-air | that is all... |
11:45:45 | FromGitter | <CodeVance> Have a fix for it? XD |
11:45:59 | FromGitter | <CodeVance> I'll make a report then and tag you? |
11:46:22 | atweiden-air | gr8 |
11:47:45 | FromGitter | <CodeVance> Can you tell me what command you used |
11:47:50 | FromGitter | <CodeVance> And the output |
11:47:55 | FromGitter | <CodeVance> atweidan-air |
11:48:10 | FromGitter | <CodeVance> or are you on a cellphone |
11:48:32 | atweiden-air | an arch user has documented the exception here: https://aur.archlinux.org/packages/nim-git/ |
11:48:37 | atweiden-air | (comments) |
11:53:03 | FromGitter | <mratsim> @Araq ^ |
11:53:51 | FromGitter | <CodeVance> https://github.com/nim-lang/Nim/issues/7724 |
11:54:12 | FromGitter | <mratsim> But it’s strange, ForLoopStmt works on devel, they were added 2 weeks ago |
11:54:38 | FromGitter | <CodeVance> atweidan. Is the program nim 0.18? |
11:54:46 | FromGitter | <mratsim> it’s git |
11:54:49 | FromGitter | <mratsim> so devel |
11:55:17 | * | xet7 quit (Read error: Connection timed out) |
11:55:20 | FromGitter | <CodeVance> why doesn't it rather say nim-devel XD |
11:55:25 | FromGitter | <CodeVance> or nim-nightly |
11:55:37 | * | xet7 joined #nim |
11:55:37 | * | smt` joined #nim |
11:55:48 | FromGitter | <mratsim> git means devel in Arch speak |
11:56:06 | FromGitter | <CodeVance> weird but okay I understand |
11:56:20 | FromGitter | <mratsim> or foo-svn or foo-hg |
11:56:21 | FromGitter | <xmonader> Good morning friends |
11:56:41 | FromGitter | <mratsim> case in point, the Arch packages i’m wrapping: https://github.com/mratsim/Arch-Data-Science |
11:56:42 | * | leru joined #nim |
11:56:59 | * | xet7 quit (Max SendQ exceeded) |
11:57:21 | * | xet7 joined #nim |
11:57:50 | FromGitter | <CodeVance> hello @xmonader monad |
11:58:42 | FromGitter | <xmonader> So i'm planning to continue writing down what i'm learning with nim to provide an easy practical resource to learn nim, so i'm searching for more ideas something like ⏎ http://www.gigamonkeys.com/book/ |
11:59:27 | FromGitter | <xmonader> what do you guys think? |
11:59:28 | FromGitter | <CodeVance> how long you want the guide to be? |
11:59:31 | dom96 | xmonader: just start writing, you can always format it in different ways later :) |
11:59:45 | * | smt quit (Ping timeout: 264 seconds) |
11:59:52 | FromGitter | <mratsim> @xomonader you can get inspiration from: https://github.com/btbytes/nim-cookbook Rosetta code, exercise.io Learn X in Y minutes |
11:59:58 | dom96 | I suggest markdown or asciidoc, i've used the latter for my book. |
12:00:12 | FromGitter | <CodeVance> I think 2000+ words is fine. But remember to break the text up. Because its difficult to process a Wall Of Text (tm) |
12:00:18 | leru | What is the current way to set up a http server? Module httpserver "will soon be deprecated in favour of the asyncdispatch", but asyncdispatch needs module sockets and sockets is deprecated... |
12:00:56 | FromGitter | <CodeVance> leru check out the example folder. |
12:01:15 | FromGitter | <xmonader> @mratsim i'm thinking for full app/library e.g what i did here ⏎ https://github.com/xmonader/nim-dmidecode I'm planning to do the same for the bencode of yesterday and planning to have around 5 more |
12:01:19 | FromGitter | <mratsim> @atweiden-air, why is texlive a Nim dependency? |
12:01:55 | FromGitter | <data-man> @mratsim: pdflatex is required |
12:01:59 | FromGitter | <xmonader> @dom96 markdown is easy enough, I wish it didn't have problems in RTL languages specially with gitbooks, i'd like to increase resources in my native arabic langauge |
12:02:02 | atweiden-air | mratsim: it's a makedepends for building the PDF docs |
12:02:25 | atweiden-air | a binary pkg would not have this dependency |
12:02:30 | dom96 | leru: use asynchttpserver |
12:02:47 | FromGitter | <mratsim> ok, I’m trying to install nim-git on my arch box |
12:02:48 | dom96 | asyncdispatch doesn't need 'sockets' |
12:02:51 | FromGitter | <CodeVance> Yesterday I had to switch from nim-lang/sdl2 to Vladar4/sdl2_nim because the nim-lang/sdl2 doesn't have rect functions |
12:03:23 | FromGitter | <mratsim> @CodeVance it does iirc, it’s just not prefixed with Rect |
12:04:02 | FromGitter | <CodeVance> @mratsim I've search for overlap/intersect word but couldn't find it |
12:04:10 | dom96 | CodeVance: The examples folder contains pretty bad examples |
12:04:30 | dom96 | Somebody should update them |
12:04:42 | FromGitter | <CodeVance> nim_sdl2 contains a bunch of examples. is the other thing |
12:05:45 | FromGitter | <CodeVance> why can't someone else be the official sdl2 package? Because I think the nim devs are busy with lang-specific things. Wrappers aren't really their focus. And that's a good thing |
12:05:46 | dom96 | xmonader: that would be awesome :) |
12:06:26 | FromGitter | <mratsim> @atweiden-air: confirmed I also get manual_snippet_122.nim(4, 20) Error: undeclared identifier: 'ForLoopStmt' |
12:07:04 | FromGitter | <xmonader> @dom96 thanks! I'm expecting lots of help during that ^_^ |
12:07:08 | FromGitter | <CodeVance> dom96, someone can update the examples. But it'd be the same as nim_sdl2 with slightly different words |
12:07:23 | FromGitter | <data-man> Now I created manual.pdf and other pdf-docs without errors and with ForLoopStmt. ⏎ But I'm not using nim-git from Arch's packages. |
12:07:31 | FromGitter | <xmonader> but do you have some ideas in mind for full library / apps can be used to introduce the language? |
12:08:13 | FromGitter | <CodeVance> @xmonader https://play.nim-lang.org/ |
12:08:20 | dom96 | xmonader: use book's from other language for inspiration, in particular Python. Learn Python the Hard Way is a good source of inspiration. :) |
12:08:25 | FromGitter | <mratsim> @data-man I think it’s nim doc that doesn’t know about the ForLoopStmt |
12:08:48 | miran | dom96: the most hated python book/author :) |
12:09:21 | FromGitter | <CodeVance> miran there is such a thing as the most hated python book? |
12:09:34 | miran | indeed there is :) |
12:09:35 | FromGitter | <CodeVance> oh learn python the hard way is stupid |
12:09:40 | FromGitter | <CodeVance> toooo opinionated |
12:10:04 | FromGitter | <data-man> @mratsim: So, how it has appeared in mine manual.pdf? :) |
12:10:21 | FromGitter | <mratsim> ah, dunno :D |
12:10:35 | FromGitter | <mratsim> I use choosenim on my archbox anyway. |
12:11:06 | miran | btw, what we're missing is a stronger presence on coding-exercises sites such as codewars, exercism, etc. |
12:11:29 | dom96 | what we're also missing is a Go tour-like thing |
12:11:30 | FromGitter | <CodeVance> miran speaking of exercism |
12:11:34 | dom96 | We've got the playground for it |
12:11:38 | dom96 | Somebody create a tour :) |
12:11:38 | miran | if somebody is looking how to contribute, this might be a good thing to do |
12:11:47 | FromGitter | <CodeVance> miran https://github.com/exercism/nim/ |
12:11:52 | miran | https://forum.nim-lang.org/t/3735 |
12:12:30 | FromGitter | <CodeVance> yesterday someone asked for suggestions on their nim info |
12:12:35 | FromGitter | <CodeVance> on exercism |
12:12:46 | miran | number of exercism nim tasks haven't changd in year and half (see the dates on https://forum.nim-lang.org/t/2618) |
12:12:46 | FromGitter | <mratsim> I remember that one of the best thing when I learned Haskell was their Project Euler wiki. |
12:13:38 | leru | dom96, CodeVance, they need sockets in the examples |
12:14:04 | dom96 | leru: https://nim-lang.org/docs/asyncnet.html#examples-chat-server |
12:14:27 | miran | IMO, we should choose one if these practice sites and aim for 100 nim tasks on it |
12:15:43 | leru | dom96, that is not an http server. do i need to implement my own? |
12:15:59 | dom96 | leru: I already told you: use asynchttpserver |
12:16:05 | dom96 | You said you wanted sockets examples |
12:16:08 | dom96 | So I gave you them |
12:16:21 | dom96 | Here is asynchttpserver https://nim-lang.org/docs/asynchttpserver.html |
12:16:32 | leru | i wrote "What is the current way to set up a http server?" |
12:17:04 | dom96 | And I replied "use asynchttpserver", https://irclogs.nim-lang.org/29-04-2018.html#12:02:30 |
12:17:51 | FromGitter | <xmonader> @CodeVance u mean a web app like this one? |
12:18:32 | FromGitter | <xmonader> @dom96 yea i'm pretty familiar with python will check :) thanks |
12:18:56 | FromGitter | <CodeVance> @xmonader Webapp? |
12:19:18 | FromGitter | <xmonader> @CodeVance like this playgorund https://play.nim-lang.org ? |
12:19:22 | FromGitter | <CodeVance> oh I was thinking of a place to introduce the language @xmonader |
12:19:51 | FromGitter | <xmonader> ah! tour would be really great! i like the go tour also the tour from eta lang is great!! |
12:20:09 | FromGitter | <CodeVance> If you could have multiple preloaded examples |
12:20:25 | FromGitter | <CodeVance> which they can tweek and run again |
12:20:44 | FromGitter | <data-man> BTW, I uploaded manual.pdf https://github.com/nim-lang/Nim/issues/7724#issuecomment-385247194 |
12:22:11 | * | smt` is now known as smt |
12:29:00 | FromGitter | <dandevelo> I am importing a constant from a C header file like this: var WM_COMMAND* {.importc, header:"windows.h", nodecl.} :cuint . However, I can't use it in a case ... of... statement because the Nim compiler complains: Error: cannot evaluate at compile time: WM_COMMAND. Any ideas? |
12:30:12 | * | Ven`` joined #nim |
12:32:48 | FromGitter | <data-man> @dandevelo: Why WM_COMMAND is var? |
12:33:13 | FromGitter | <dandevelo> @data-man Nim would not accept it as a const or I didn't know how to make it accept it as a const |
12:34:22 | FromGitter | <data-man> @dandevelo: See https://github.com/khchen/winim |
12:36:31 | FromGitter | <dandevelo> Thanks @data-man . I am familiar with winim, my question is related to the Nim compiler. I see that winim redefines all those constants (e.g: WM_COMMAND* = 273 ) and I thought this is duplicate work as those constants are already defined when you include windows.h |
12:38:26 | * | dddddd joined #nim |
12:39:28 | FromGitter | <dandevelo> One benefit of using importc, header:"windows.h" for this is that the generated code will write WM_COMMAND insead of 273 so it is better for debugging |
12:39:30 | FromGitter | <data-man> Linux-users can haven't windows.h |
12:39:47 | FromGitter | <dandevelo> @data-man this code only runs when defined(windows): |
12:40:09 | FromGitter | <dandevelo> It is Windows specific code so there is no reason for it to run on Linux |
12:41:08 | FromGitter | <data-man> For cross-compilation |
12:45:26 | FromGitter | <data-man> Try ```var WM_COMMAND* {.importc: "WM_COMMAND", header:"windows.h", nodecl.} :cuint``` |
12:48:37 | FromGitter | <dandevelo> Still getting this: |
12:48:38 | FromGitter | <dandevelo> Error: cannot evaluate at compile time: WM_COMMAND |
12:49:06 | FromGitter | <mratsim> By the way, I’m celebrating my 100+ Nim issues this week! (currently at 107) |
12:49:14 | FromGitter | <dandevelo> It's funny that this works: var msg = WM_COMMAND but this doesn't: case uMsg ⏎ of WM_COMMAND: |
12:49:41 | FromGitter | <data-man> @mratsim: Why not 100+ PRs? |
12:49:58 | FromGitter | <mratsim> There is a PR by cooldome I think to allow to load C/C++ const in const (currently you have to load them in var) |
12:50:05 | FromGitter | <GULPF> cases must be known at compile time, and `importc` doesn't work with `const` |
12:50:50 | FromGitter | <mratsim> @data-man errrhhh, the compiler scares me :P |
12:51:18 | FromGitter | <data-man> @mratsim: Just improve stdlib! ;) |
12:51:55 | FromGitter | <mratsim> I’m improving what I use. The loopfusion package can be reworked to be added to sugar.nim for example. |
12:52:26 | FromGitter | <mratsim> but I don’t use async/http/strutils nor 2D/3D libs |
12:52:38 | FromGitter | <mratsim> maybe I’ll improve complex if I ever get to use them. |
12:52:39 | FromGitter | <dandevelo> @GULPF do you believe the case statement would work if importc would work with const? |
12:53:14 | FromGitter | <mratsim> @dandevelo yes |
12:54:31 | FromGitter | <dandevelo> @mratsim is there a link to that PR? |
12:54:35 | FromGitter | <mratsim> also I suppose if the project to have Nim compile on GPU starts, I can test, and improve it |
12:54:46 | leru | dom96, you were right. i'm sorry. |
12:54:50 | leru | thank you |
12:56:15 | FromGitter | <mratsim> @dandevelo actually it was on the forum: https://forum.nim-lang.org/t/3762#23408 |
12:58:41 | FromGitter | <data-man> @mratsim: generics version of Complex, IntSet, ... ? |
12:59:45 | FromGitter | <mratsim> yes Complex should work as Complex[float32] and Complex[float64]. Generics of intsets? How does that work? :P |
12:59:52 | * | atweiden-air quit (Quit: Leaving.) |
13:00:24 | FromGitter | <data-man> It's can be useful for uint* types. |
13:00:42 | FromGitter | <data-man> Less memory |
13:01:18 | FromGitter | <mratsim> for uint16, the included sets are fine |
13:01:40 | FromGitter | <mratsim> otherwise casting to int32 or int64 is ok. |
13:02:10 | FromGitter | <data-man> And current implementation of IntSet can't work with int64 on 32bit machines. |
13:02:48 | FromGitter | <mratsim> I see. I have more use for general bitvectors than intsets though. |
13:03:20 | FromGitter | <mratsim> The only place I use intsets for is for an object pool project. intset is used to store ByteAddress. |
13:04:16 | FromGitter | <mratsim> https://github.com/mratsim/Arraymancer/blob/master/src/object_pool/object_pool.nim#L20 |
13:06:00 | * | yglukhov joined #nim |
13:08:26 | FromGitter | <data-man> I ported some code from https://github.com/gpakosz/PackedArray to Nim ⏎ And I like https://github.com/RoaringBitmap/CRoaring |
13:09:47 | FromGitter | <data-man> And https://github.com/lemire/cbitset ⏎ And https://github.com/lemire/EWAHBoolArray ⏎ :-D |
13:09:58 | FromGitter | <mratsim> Ah nice, I wanted to port PackedArray as well, it would be probably quite sueful for my go playing bot |
13:11:19 | FromGitter | <mratsim> For a bool bitbector, here is one in 9 lines of Nim ;): https://github.com/numforge/number-theory/blob/master/src/primes.nim#L6-L15 |
13:12:28 | FromGitter | <data-man> Please, imrove it: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae5c4bc15c9b031144a672c] |
13:13:38 | FromGitter | <mratsim> I think you can copy paste the set proc from Nim compiler. search for inclSet, exclSet, cardSet and co on GIthub |
13:14:58 | FromGitter | <mratsim> also uintBitCount is a power of 2, so instead of div, you can `shr` |
13:15:01 | FromGitter | <data-man> No, I have semifinished bitsets implementaion with variable length. |
13:15:15 | FromGitter | <mratsim> `div 8` is shr 3 (2^3 == 8) |
13:15:39 | FromGitter | <mratsim> and instead of mod you can `and (foo - 1)` |
13:15:53 | FromGitter | <mratsim> `mod 8` is `and 7` |
13:16:28 | FromGitter | <mratsim> mod and div costs about 50 CPU cycles compared to `shr` and `and` which are about 1 cycle |
13:17:46 | miran | mratsim: i use both of those here: https://github.com/narimiran/AdventOfCode2017/blob/master/nim/day15.nim - can you make it faster than this? |
13:19:49 | FromGitter | <mratsim> @miran, maybe dumb, but can’t you just use uint32? |
13:20:17 | miran | haven't tried it, will do... |
13:20:25 | FromGitter | <mratsim> here: https://github.com/narimiran/AdventOfCode2017/blob/c777c60b5ea9c01a57561f68d1295ab14a9d72f6/nim/day15.nim#L9-L12 |
13:20:37 | FromGitter | <mratsim> multiplication will roll over properly |
13:23:04 | FromGitter | <mratsim> also, I’m not sur if it’s faster because you don’t use div/mod at all (and modulo 2^32 is easy) but here is my naive implementation of modular multiplication: https://github.com/numforge/number-theory/blob/master/src/modular_arithmetic.nim#L47-L58 |
13:23:39 | miran | uint32 makes it 50% slower :/ |
13:24:09 | FromGitter | <mratsim> I would have to read the task goal |
13:24:17 | FromGitter | <mratsim> I don’t now what solve and next represent |
13:24:33 | miran | http://adventofcode.com/2017/day/15 |
13:24:53 | miran | if you've not solve it and/or not registered, you'll be able to see only the first part |
13:26:06 | miran | the first part can be solved simpler, but that 'unnecessary complexity' is for part II |
13:27:37 | FromGitter | <mratsim> I don’t think I can speed that up. Your code is already very efficient |
13:28:13 | * | yglukhov quit (Remote host closed the connection) |
13:38:26 | miran | :) |
13:47:30 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:48:21 | * | miran quit (Ping timeout: 240 seconds) |
13:50:12 | * | Ven`` joined #nim |
14:05:30 | * | xkapastel joined #nim |
14:18:01 | leru | Is there any kind of timer in Nim? I want to call a function once an hour. How do I approach this in Nim? |
14:21:57 | federico3 | getEpoch and sleep? |
14:22:09 | * | xet7 quit (Read error: Connection timed out) |
14:22:16 | federico3 | or you want a built in async timer? |
14:22:37 | * | xet7 joined #nim |
14:29:55 | * | darithorn joined #nim |
14:33:09 | FromGitter | <Varriount> @dandevelo For constants, standard practice is to copy the values into Nim consts. You might keep on running into problems by importc-ing them. |
14:49:37 | leru | federico3, this works well! I was irritated, that there was no sleep in threads. But that now is fantastic! Thank you! |
14:49:56 | FromGitter | <mratsim> I really think that might be the most promising UI library for Nim: https://github.com/oskca/webview |
14:56:14 | FromGitter | <data-man> @mratsim: WebKit and MSHTML? Thanks, but not for me. :) |
14:56:49 | FromGitter | <mratsim> well it seems much easier than QT/GTK for a quick app ;) |
14:57:10 | FromGitter | <mratsim> and you don’t need to ship 200MB of electron |
14:57:38 | FromGitter | <data-man> I prefer Dear ImGui |
14:59:41 | FromGitter | <krux02> I think it.s funny/sad that simple flat 2D UI programming is not a solved problem even though it has been done for over 30 years now. |
15:05:46 | FromGitter | <mratsim> I don’t know at all about UI programming. I’ reading on immediate GUI, they are stateless? |
15:08:07 | FromGitter | <mratsim> I like the removal of objects and having everything as procs: http://www.johno.se/book/imgui.html |
15:08:08 | * | xet7 quit (Read error: Connection timed out) |
15:08:37 | * | xet7 joined #nim |
15:10:59 | FromGitter | <ephja> what does it mean for it to be solved? |
15:13:17 | FromGitter | <data-man> @krux02: For a long time it's solved in Delphi/Qt/wxWidgets/etc. IDEs |
15:16:33 | FromGitter | <data-man> @mratsim: I impatiently wait, when it will be realized: https://github.com/ocornut/imgui/issues/1542 :) |
15:17:06 | FromGitter | <mratsim> but it seems like imgui would have resizing issues |
15:18:52 | FromGitter | <data-man> Where it's described? |
15:19:08 | FromGitter | <mratsim> The fonts have aliasing issue |
15:19:30 | FromGitter | <data-man> You can to use FreeType2 |
15:19:36 | FromGitter | <data-man> With ImGui |
15:20:15 | FromGitter | <mratsim> If I need a GUI that would be for something similar to this: http://www.godrago.net/. It’s written in (closed source) Delphi and Windows only unfortunately |
15:21:33 | FromGitter | <data-man> https://yogalayout.com by Facebook |
15:22:42 | FromGitter | <mratsim> So I have to use JS anyway? |
15:23:18 | FromGitter | <krux02> no, not really |
15:23:25 | FromGitter | <krux02> there is always an alternative to js |
15:23:42 | FromGitter | <krux02> in DOS ages it was always common that every program wrote it's UI library on it's own |
15:23:47 | FromGitter | <krux02> its own |
15:24:54 | FromGitter | <krux02> And trust me, wrting a button with all features a button can have isn't hard. |
15:25:05 | FromGitter | <data-man> I worked with TurboVision 2.0 for TurboPascal :) |
15:25:27 | FromGitter | <data-man> For MSDOS :) |
15:26:15 | FromGitter | <krux02> ok, maybe you know more about programming for DOS than be |
15:26:16 | FromGitter | <krux02> me |
15:26:54 | FromGitter | <krux02> I just know that every DOS program looked very unique, and it didn't seem common at all that different programs had a similar UI style. |
15:29:11 | FromGitter | <krux02> There is so much time and energy wasted in discussions about the right UI library. And what is the best one. It is like a discussion on tabs vs spaces. |
15:30:57 | FromGitter | <data-man> Or vim vs emacs :) |
15:31:07 | FromGitter | <krux02> yea |
15:31:27 | FromGitter | <krux02> btw Vim won I guess. But I am using emacs. |
15:31:32 | FromGitter | <krux02> yay. |
15:33:01 | FromGitter | <AjBreidenbach> nvim works really well for nim |
15:33:17 | FromGitter | <AjBreidenbach> is everything in the locks module deprecated ? |
15:33:50 | FromGitter | <krux02> @AjBreidenbach does nimsuggest work properly in nvim? |
15:34:05 | FromGitter | <krux02> I mean does it block input at any time? |
15:34:23 | FromGitter | <krux02> when nimsuggest crashes or hangs, does vim do so, too? |
15:34:30 | FromGitter | <AjBreidenbach> doesn't seem like anything blocks |
15:35:02 | FromGitter | <AjBreidenbach> not sure if I'm running nimsuggest though |
15:35:02 | FromGitter | <krux02> And most importantly, when you edit a nim file that is included somewhere else, does it work properly with highlighting errors |
15:35:22 | FromGitter | <krux02> well nimsuggest is the process that provides completions |
15:35:33 | FromGitter | <krux02> if you have semantic completion nimsuggest is running |
15:35:43 | FromGitter | <AjBreidenbach> it highlights only if the file with the inclusion is open |
15:35:47 | FromGitter | <CodeVance> nim can't find glu what lib should I download |
15:35:50 | FromGitter | <AjBreidenbach> I'm probably not using nimsuggest |
15:36:19 | FromGitter | <krux02> you can als do pgrep nimsuggest |
15:36:33 | FromGitter | <krux02> (search for a running nimsuggest process) |
15:36:34 | FromGitter | <AjBreidenbach> nothing |
15:36:39 | leru | How can I access a global from multiple threads? |
15:36:54 | leru | Right now I get Error: 'func' is not GC-safe as it accesses 'data' which is a global using GC'ed memory |
15:37:05 | FromGitter | <AjBreidenbach> don't you have to use a lock? |
15:37:15 | FromGitter | <AjBreidenbach> I was just trying to figure out if locks are deprecated or not |
15:37:25 | leru | I'm using a lock |
15:37:58 | FromGitter | <krux02> leru: any ref value is thread local |
15:38:06 | FromGitter | <krux02> do not access ref value from threads |
15:38:14 | FromGitter | <krux02> (different threads) |
15:40:02 | * | edcragg quit (Quit: ZNC - http://znc.in) |
15:40:14 | * | edcragg joined #nim |
15:40:38 | leru | How else can I set the data then? |
15:42:33 | FromGitter | <AjBreidenbach> do you just copy a value into it? |
15:42:47 | FromGitter | <AjBreidenbach> or can you use a ptr instead of a ref? |
15:44:34 | leru | I could use a ptr |
15:56:30 | * | CodeVance joined #nim |
16:09:06 | CodeVance | I "fixed" my code from earlier. Pong demo is running. It's super simple |
16:09:52 | leru | Ok, that seems to work. Thanks. Now I have another issue, because of parseHtml is not GC safe. see https://gist.github.com/leruu/f6bad334da2c7a54eb9a672e4a35bd7e |
16:14:54 | * | xkapastel quit (Quit: Connection closed for inactivity) |
16:17:18 | shashlick | sherjilozair: so nimgen has the n.global:quotes and n.global:filter options to allow recursing into #include <xyz.h> but have to be careful that system headers don't get processed |
16:17:27 | shashlick | varriount: thanks :) |
16:18:24 | * | Trustable joined #nim |
16:19:05 | FromGitter | <data-man> @leru: Why not newAsyncHttpClient? |
16:23:57 | FromGitter | <mratsim> I finished my neural net domain specific language! Now I have to cleanup the code :/ and add it to Arraymancer |
16:24:14 | leru | data-man, idk. I will use anything that will work properly. This seems to work fine |
16:26:53 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:28:06 | FromGitter | <data-man> @mratsim: So, congrats! Probably. :) |
16:47:07 | FromGitter | <Varriount> Araq: I'm starting to see why the compiler uses recursion so much. It's pretty much required for complex tree traversal. |
16:49:21 | * | Ven`` joined #nim |
16:54:12 | dom96 | leru: What are you trying to make? web crawler? |
16:54:30 | leru | dom96, yes |
16:55:18 | dom96 | leru: What data do you want to get out of it? |
16:57:20 | leru | dom96, it's for a website with some tables. From two of these tables I need some specific data |
16:58:11 | dom96 | hrm, that sounds more like scraping a single website instead of crawling the web |
16:59:55 | leru | You're right. I thought it's not that different in that context of solving this issue |
17:00:34 | FromGitter | <GULPF> if you're doing web scraping you might be interested in my project, https://github.com/GULPF/nimquery |
17:01:14 | dom96 | In that case you don't need threads at all, a simple program that synchronously grabs the webpages will work |
17:05:21 | leru | Yes and no. The thing is: the target website is updated regularly. But it's very slow and I visit it at least once a day. I don't want to wait that long. So I want the program it to get the latest versiona few times a day and provide it on my own website |
17:11:36 | dom96 | If the website is slow then threads won't help you, you'll be IO bound. |
17:13:35 | * | xet7 quit (Read error: Connection timed out) |
17:14:07 | * | xet7 joined #nim |
17:14:48 | leru | I think, there is a misunderstanding. It is meant as some kind of cache. I don't need the current version of the websites data, just a version that was around for the past few hours. So that would be perfect |
17:22:44 | FromGitter | <leruu> @GULPF Your project seems nice. Will definitely try it |
17:24:25 | dom96 | leru: Sorry, I don't really understand |
17:24:53 | dom96 | You should only use threads if you want parallelism, i.e. scale your program across CPU cores. |
17:27:18 | * | yglukhov joined #nim |
17:27:35 | FromGitter | <leruu> Yes, I'll just split it up into two programs and one of them will run as a cron job |
17:28:29 | * | leru quit (Quit: Leaving) |
17:29:54 | FromGitter | <Varriount> @GULPF You should have a macro that generates a parsing procedure at compile time, when given a static inputs |
17:29:57 | FromGitter | <Varriount> :P |
17:31:21 | * | yglukhov quit (Ping timeout: 240 seconds) |
17:31:33 | FromGitter | <GULPF> @Varriount I've tried a few times to make it work with a normal proc and static[string], but static[string] is just to buggy |
17:32:04 | * | xet7 quit (Read error: Connection timed out) |
17:32:38 | * | xet7 joined #nim |
17:35:41 | dom96 | leruu: I bet you don't need to split it up, but whatever works :) |
17:41:13 | FromGitter | <data-man> @leruu: If the headers of your link contain the lastModified field, then you don't need to download entire page. ⏎ So, check this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae603b8109bb04332139bd4] |
17:42:46 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
17:50:52 | * | miran joined #nim |
17:55:53 | * | ofelas joined #nim |
18:03:03 | * | yglukhov joined #nim |
18:10:01 | * | dddddd quit (Ping timeout: 256 seconds) |
18:13:34 | FromGitter | <geotre> Any ideas on how to pass a function ptr to a c lib so it can interface with a nim proc? |
18:16:51 | FromGitter | <alehander42> oh man quote in a macro generated in a quote in a macro doesn't quite help me |
18:17:08 | FromGitter | <data-man> @geotre: See lib/wrappers. E.g. callbacks for sqlite. |
18:17:57 | FromGitter | <geotre> @data-man thanks I'll have a look |
18:18:34 | * | ofelas quit (Quit: shutdown -h now) |
18:20:25 | * | ofelas joined #nim |
18:23:17 | * | dddddd joined #nim |
18:24:14 | * | SenasOzys quit (Remote host closed the connection) |
18:24:40 | * | SenasOzys joined #nim |
18:43:34 | * | SenasOzys quit (Ping timeout: 264 seconds) |
18:53:23 | * | SenasOzys joined #nim |
19:12:09 | * | leru joined #nim |
19:19:29 | FromGitter | <leruu> @data-man That's a great optimization! The last modified seems not to be accurate, but maybe accurate enought |
19:22:19 | FromGitter | <leruu> > *<dom96>* @leruu: I bet you don't need to split it up, but whatever works :) ⏎ If you have a tip for me, how to handle clients and the website check thingy in one program without having a separate thread or something, I'd be very happy to hear from you |
19:22:41 | FromGitter | <leruu> If you have a tip for me, how to handle clients and the website check thingy in one program without having a separate thread or something, I'd be very happy to hear from you |
19:23:30 | FromGitter | <leruu> (sorry, quotes are kind of different here than I expected) |
19:24:18 | FromGitter | <data-man> @leruu: You can edit your message in gitter ;) |
19:28:50 | FromGitter | <leruu> I already did ;) I thought I could quote someone and write my answer right to it. But the message looks really messy in irc now |
19:34:34 | FromGitter | <Varriount> Hm. If I'm passing a procedure to a macro or template, and the procedure has multiple overloads, how do I pass in a particular overload? |
19:37:57 | dom96 | leruu: Well, I'm not 100% sure what your use case is, but by "handle clients" I guess you want to do two things: accept clients (sockets I guess?) and let them request some sort of data, and perform the web scraping/crawling. |
19:38:54 | FromGitter | <data-man> @leruu: The algorithm looks like this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae61f4edad6fb186ffcb2c3] |
19:40:30 | * | find0x90 joined #nim |
19:41:02 | FromGitter | <data-man> I did not check this code! :) |
19:41:51 | * | craigger quit (Ping timeout: 240 seconds) |
19:41:53 | dom96 | If my assumptions are correct then all you need is async await |
19:42:45 | * | nsf joined #nim |
19:42:48 | * | find0x90 quit (Client Quit) |
19:44:41 | * | craigger joined #nim |
19:44:46 | * | find0x90 joined #nim |
19:45:46 | * | Orange_ joined #nim |
19:48:17 | FromGitter | <leruu> Ok, I tried to simplify my current code. This should really give you an idea ```var data: ptr array[5, seq[string]] ⏎ ⏎ #get the data ⏎ ⏎ var ... [https://gitter.im/nim-lang/Nim?at=5ae621816d7e07082b48d289] |
19:48:33 | FromGitter | <leruu> omg... |
19:49:31 | FromGitter | <leruu> https://gist.github.com/leruu/99c53db362ddfdaab11a7345e464d9e5 |
19:50:23 | FromGitter | <leruu> This is right. |
19:57:55 | Orange_ | Hi. I'm currently learning Nim, and wondering if there's a way to override the type of a seq literal easily. For example, I need a seq[object], but using @[1, 2, 3] creates a seq[int], and therefore raises a compiler error when I try to pass it to a function requiring seq[object]. I could probably use a cast, but is there an easier way? Cheers |
20:00:03 | Orange_ | In the actual example it's not ints and objects (I've just become aware you can't cast an int to an object...), it's a Node type and its subtype |
20:00:22 | * | find0x90 quit (Quit: find0x90) |
20:00:47 | FromGitter | <data-man> @Orange_: ⏎ Something like this: ⏎ ⏎ ```import sequtils ⏎ let x = mapLiterals([value1, value2, ...], YourObjectType)``` [https://gitter.im/nim-lang/Nim?at=5ae6246e270d7d37081bf92a] |
20:00:51 | * | find0x90 joined #nim |
20:01:20 | * | find0x90 quit (Client Quit) |
20:02:16 | * | xet7 quit (Read error: Connection timed out) |
20:02:37 | * | xet7 joined #nim |
20:03:48 | * | Trustable quit (Remote host closed the connection) |
20:05:49 | Orange_ | @data-man Looks like it'd work on Nim 18, but I'm on 17; any other way of doing it before I upgrade? |
20:06:36 | FromGitter | <Varriount> Orange_: Does the sequence contain references, or objects? |
20:07:05 | FromGitter | <Varriount> If it has references, you could theoretically cast it, or just use a `for` loop to copy/convert it. |
20:07:43 | Orange_ | The types are declared as 'ref object', so I think that means they're references. Either way, a cast seems to have worked; thanks for your help! |
20:07:49 | * | nsf quit (Quit: WeeChat 2.0.1) |
20:08:47 | dom96 | Be careful with casting though, it could produce issues silently |
20:10:08 | FromGitter | <Varriount> Orange_: As dom96 said, casting is an unsafe operation. A more safe approach would be to create a new sequence, and copy the references over. |
20:10:59 | FromGitter | <Varriount> Orange_: Also make sure that the casted sequence isn't modified. It's still expecting the Child types as elements, even though it's masquerading as a sequence that knows about parent types. |
20:12:01 | Orange_ | OK, makes sense. Thanks for your guidance |
20:12:05 | * | Orange_ quit (Quit: Page closed) |
20:13:31 | dom96 | leruu: something like this should work: https://gist.github.com/dom96/eb2ae290d1f79233b330bccfd28437f4 |
20:13:59 | FromGitter | <Bennyelg> Anyway I can extract the keys from jsonNode ? |
20:17:21 | dom96 | toSeq(node.fields.keys) # Needs 'sequtils' |
20:17:34 | dom96 | and 'tables' too probably |
20:18:01 | FromGitter | <Bennyelg> Thanks |
20:18:03 | FromGitter | <Bennyelg> /!! |
20:19:48 | * | find0x90 joined #nim |
20:20:48 | * | Orange__ joined #nim |
20:22:08 | Orange__ | Another question; how can I make this code print "It's a Y"? I'm still grasping the basics of Nim like this sort of thing. I've tried changing 'proc' to 'method', but this didn't work. https://gist.githubusercontent.com/OrangeFlash81/07818416dac298b5a7808e289b73222a/raw/b4a42ff4ae160e6309f3d87deee48ac897167b86/gistfile1.txt |
20:23:21 | * | CodeVance quit (Ping timeout: 240 seconds) |
20:23:38 | * | Orange__ quit (Client Quit) |
20:25:37 | * | craigger quit (Ping timeout: 248 seconds) |
20:26:39 | * | craigger joined #nim |
20:34:28 | dom96 | Orange__ https://gist.github.com/dom96/c50e624e65e4580de32378281345c5bf |
20:40:23 | * | miran quit (Ping timeout: 256 seconds) |
20:40:37 | FromGitter | <Varriount> Orange__: If you're modeling trees, you might be better off with object variants |
20:50:40 | * | darithorn quit (Remote host closed the connection) |
20:50:54 | dom96 | In general you're probably better off with object variants :) |
20:52:22 | * | find0x90 quit (Quit: find0x90) |
20:53:09 | * | Vladar quit (Quit: Leaving) |
20:55:38 | * | find0x90 joined #nim |
20:56:19 | * | find0x90 quit (Client Quit) |
21:06:37 | * | find0x90 joined #nim |
21:10:56 | leru | dom96, thank you. This works well except for one thing, when I add the var currentTable to the .respond, see https://gist.github.com/leruu/e9f15d160e80e2f1ebafceb2611e0dc5 |
21:11:11 | leru | currentTable is a string btw |
21:12:57 | * | find0x90 quit (Ping timeout: 264 seconds) |
21:20:11 | dom96 | You don't need `--threads:on` anymore |
21:22:05 | dom96 | if that doesn't help then you might need to mark your global variables with {.threadvar.} |
21:22:55 | * | CodeVance joined #nim |
21:25:06 | leru | Removing `--threads:on` did nothing, but {.threadvar.} made it work! Thank you for helping me out today :) |
21:27:53 | dom96 | no problem :) |
21:27:56 | * | CodeVance quit (Read error: Connection reset by peer) |
21:30:51 | FromGitter | <data-man> @mratsim: Neuromancer? It's cool! :-D |
21:37:34 | * | xet7 quit (Read error: Connection timed out) |
21:38:07 | * | xet7 joined #nim |
21:42:18 | FromGitter | <mratsim> :P |
21:42:46 | FromGitter | <mratsim> I have a regression though, my networks don’t train anymore :/ |
21:43:06 | FromGitter | <mratsim> They have 10% accuracy to recognize 10 digits … aka random |
21:48:16 | FromGitter | <diegogub> somone using Option[] with json module? I'm getting error with using % macro |
21:49:27 | FromGitter | <mratsim> Fixed, I forgot to put the neuron activation… accuracy is not in the 90%+ on digit recognition |
21:51:10 | FromGitter | <diegogub> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae63e4e2b9dfdbc3ae154fd] |
21:52:00 | dom96 | diegogub: I don't think that's implemented for Option[T] yet |
21:54:29 | FromGitter | <diegogub> @dom96 I see, I'm having quite a hard one because I want to accept optional parameters on a json without raising key not found exception..and using Option solve that |
21:56:02 | * | xet7 quit (Read error: Connection timed out) |
21:56:37 | * | xet7 joined #nim |
21:57:42 | FromGitter | <data-man> I need help with macro: :( ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ bindings should contain expanded objects, tuples and arrays [https://gitter.im/nim-lang/Nim?at=5ae63fd52d0e228d7bc62bce] |
21:58:52 | dom96 | diegogub: you can always just work around this by doing something like: if opt.isSome(): %opt.get() else: %nil |
22:11:47 | * | CodeVance joined #nim |
22:12:47 | FromGitter | <mratsim> @data-man usually I use getTypeInst but somehow here it gives me symbols :/ |
22:12:56 | FromGitter | <mratsim> and treerepr instead of repr |
22:13:03 | FromGitter | <mratsim> another candidate for: https://github.com/nim-lang/Nim/issues/7719 |
22:16:04 | FromGitter | <mratsim> .symbol.getimpl doesn’t help as well ... |
22:16:23 | * | xkapastel joined #nim |
22:16:36 | FromGitter | <data-man> I want to add support the complex types to the scanf macro. ⏎ So, instead of ```... = scanf("somePattern", param1, param2, ..., param100)``` we can using ```scanf("somePattern", someTuple(or array, or object)``` |
22:17:57 | * | leru quit (Ping timeout: 240 seconds) |
22:18:04 | FromGitter | <mratsim> oh actually it’s easy |
22:18:19 | FromGitter | <data-man> Help me! :) |
22:18:22 | FromGitter | <mratsim> I thought you wanted to get expanded types |
22:19:04 | * | CodeVance left #nim ("Leaving") |
22:19:11 | FromGitter | <data-man> I need expand and to bind varargs[typed] |
22:21:00 | FromGitter | <data-man> So, arguments can be variables with simple types (int, floats, string) or "complex" types (array, objects or tuples) |
22:22:21 | * | xet7 quit (Remote host closed the connection) |
22:23:34 | FromGitter | <mratsim> seems like fields/fieldsPairs don’t work in macro |
22:24:35 | FromGitter | <mratsim> otherwise something like that can work: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae646226d7e07082b495e7e] |
22:24:55 | FromGitter | <Varriount> @mratsim I've called getTypeInst from a compile time proc |
22:25:24 | FromGitter | <mratsim> Ah, For me I get NimNode instead of what I want |
22:26:36 | FromGitter | <mratsim> ANyway @data-man I’m sorry I can’t investigate more today, it’s late and I’ve been swimming in macros for the whole day ... |
22:28:22 | FromGitter | <data-man> @mratsim: No problem. See you later! :) |
22:39:28 | subsetpark | Can someone help me think through a template problem? I want to write a template that takes `body` and then declares a closure with an argument `foo` inside the template, where `body` is the closure body. But I can't think of how to put it together... I get 'undeclared identifier: foo' |
22:45:17 | * | noonien quit (Quit: Connection closed for inactivity) |
22:53:16 | subsetpark | (and it's not a simple matter of injecting or marking dirty) |
22:57:16 | Araq | subsetpark: a gist would be helpful |
22:58:29 | FromGitter | <data-man> @Araq: Oh, welcome back! :) |
22:59:40 | subsetpark | Araq: https://ghostbin.com/paste/aa8wp |
23:00:08 | subsetpark | That's the basic form. In the actual code, the we do more interesting things in the proc that's defined in the template. |
23:01:36 | Araq | template myTemp(body: untyped): typed {.dirty.} = |
23:01:37 | Araq | proc x(i: int) = |
23:01:37 | Araq | body |
23:01:38 | Araq | x(3) |
23:01:40 | Araq | myTemp: |
23:01:42 | Araq | echo i + 1 |
23:01:59 | Araq | contrary to what you claimed, .dirty fixes it |
23:03:30 | FromGitter | <data-man> @Araq: Do you like my idea for scanf? |
23:05:23 | Araq | haven't seen it |
23:05:51 | subsetpark | Well, Araq, unfortunately if that's the case there's something different in the actual code ... https://github.com/makingspace/cittadino/tree/noNameNecessary |
23:06:10 | subsetpark | You can see in the last commit the change I've made, and the test I'm trying to run that's producing the compile error |
23:06:53 | FromGitter | <data-man> I want to add support the complex types to the scanf macro. ⏎ So, instead of ```... = scanf("somePattern", param1, param2, ..., param100)``` we can using ```scanf("somePattern", someTuple)``` (or array, or object) |
23:07:18 | Araq | autoDelete = false, body: untyped |
23:07:27 | Araq | ^ won't work. |
23:08:40 | Araq | data-man please work on something important instead. |
23:08:51 | Araq | like unicode.nim, what we talked about. |
23:09:29 | FromGitter | <data-man> Yes, I want to use scanf for parsing unicode data |
23:10:24 | FromGitter | <data-man> More convenient and simple way. |
23:10:56 | Araq | touche, but how will it work? |
23:11:16 | Araq | the pattern describes an atom, not a "tuple" or an "array" |
23:11:38 | Araq | "%d %d %d %d", (a, b, c, d) vs |
23:11:44 | Araq | "%d %d %d %d", a, b, c, d |
23:11:55 | Araq | see the problem? nothing gained. |
23:12:17 | Araq | then you start with patterns like %d{4} |
23:12:27 | Araq | and off you go into the rabbit whole |
23:12:43 | Araq | where instead of working on unicode, you invent a parser generator. |
23:13:02 | FromGitter | <data-man> I need to expand a tuple var to var.field1, var.field2, etc. |
23:13:34 | Araq | for 10 fields? so you already wasted more time talking here than writing this. |
23:13:38 | FromGitter | <data-man> And bind them in the scanf instead of varargs. |
23:18:05 | FromGitter | <AjBreidenbach> is there a reason that using allocShared with Channel[Msg] should give me a race condition? |
23:19:08 | FromGitter | <AjBreidenbach> I thought `recv` was supposed to block |
23:20:58 | FromGitter | <AjBreidenbach> `readBuffer` is behaving non-deterministically |
23:22:14 | FromGitter | <ephja> uncertainties makes things more interesting |
23:22:25 | Araq | well if allocShared were so useful with Channel don't you think we would have merged thm? |
23:23:02 | FromGitter | <AjBreidenbach> I think that by saying that you're actually giving me too much credit |
23:23:55 | FromGitter | <AjBreidenbach> so it's better just to copy everything? |
23:29:39 | Araq | well no, but I know both channels and allocShared have been used extensively and are unlikely to contain bugs |
23:30:08 | Araq | so the bugs are likely on your side |
23:32:11 | * | CodeVance joined #nim |
23:35:55 | FromGitter | <AjBreidenbach> it's gonna be a bitch to figure out |
23:38:41 | * | vuLgAr joined #nim |
23:56:05 | FromGitter | <AjBreidenbach> I can't get `send` to block |
23:57:08 | Araq | why would it? it acquires the channel lock and stores data in the underlying queue, then it releases the lock and returns |
23:57:56 | FromGitter | <AjBreidenbach> the documentation for `trySend` explicitly states that it does not block, so I thought it would be the same as `recv` |
23:59:36 | FromGitter | <AjBreidenbach> plus it passes `false` to `sendImpl`for the argument `noBlock` |