<< 29-04-2018 >>

00:02:02dom96Try running the binary directly
00:02:27dom96For some odd reason macOS prevents binaries to pass this env var to other processes
00:03:19FromGitter<sherjilozair> Same issue
00:03:22FromGitter<sherjilozair> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae50bca62316e05050e54bd]
00:07:35FromGitter<sherjilozair> When compiled with nimDebugDlOpen
00:07:38FromGitter<sherjilozair> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae50cca270d7d3708186ca3]
00:08:35FromGitter<sherjilozair> even though `/Users/sherjilozair/NimProjects/pong/lib//libcsfml-graphics.dylib` does exist.
00:15:50dom96It's looking for libsfml
00:15:53dom96You need that too
00:19:19FromGitter<zacharycarter> hrm - is there anyway to hoist a statement for the JS backend?
00:19:44CodeVanceJs gets hoisted automatically doesn't it?
00:20:00FromGitter<zacharycarter> well yeah but I'm running into an issue
00:20:05FromGitter<zacharycarter> sooo
00:20:34FromGitter<zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae50fd2b01085166cd06aa1]
00:20:37FromGitter<zacharycarter> results in
00:20:45FromGitter<zacharycarter> `SyntaxError: import declarations may only appear at top level of a module`
00:21:14FromGitter<zacharycarter> maybe if I declare those procs in another nim module
00:21:15FromGitter<zacharycarter> let me try that
00:22:05CodeVanceAre you trying to dynamic load a dll. Haven't you wrote an article about that
00:23:16FromGitter<zacharycarter> no
00:23:24FromGitter<zacharycarter> I'm not
00:23:29FromGitter<zacharycarter> I'm trying to load a JS module
00:23:51skrylardom96, probably to prevent some interesting forms of hooks =p
00:24:17skrylarthere were already issues with people getting past Gatekeeper by swapping out SOs
00:24:26CodeVancezachery require ?
00:24:35*CodeVance left #nim ("Leaving")
00:25:00FromGitter<zacharycarter> I don't want to use require syntax if I can avoid it
00:25:05FromGitter<zacharycarter> I think that this should be supported
00:25:06FromGitter<CodeVance> skrylar. Its a compiled code limitation i think
00:25:18FromGitter<ephja> you can use 'import' in this way?
00:25:28FromGitter<zacharycarter> well - if you're using a bundler like parcel you can
00:25:38FromGitter<CodeVance> require is the js version of import isn't it?
00:25:49FromGitter<zacharycarter> well import is eventually going to turn into require
00:25:56FromGitter<zacharycarter> import is ES module syntax
00:25:59FromGitter<CodeVance> For everything?
00:26:01FromGitter<zacharycarter> so some browser support it
00:26:02FromGitter<zacharycarter> others don't
00:26:34FromGitter<zacharycarter> require is a nodejs thing / commonjs module thing
00:26:48FromGitter<zacharycarter> import is in the JS spec / going to be the new way of importing JS modules in the future
00:26:52FromGitter<CodeVance> the reason import must be top level is because nim makes the nim 2 js code one big js file
00:26:56FromGitter<CodeVance> Like include
00:27:12FromGitter<gogolxdong> 路is a chinese charactor.
00:27:13FromGitter<zacharycarter> well - the spec implies that the import statement must beat the top of the file
00:27:26FromGitter<zacharycarter> you can't just have an import statement anywhere in your JS
00:27:33FromGitter<zacharycarter> like you can with a require call
00:27:50FromGitter<gogolxdong> means road
00:28:00FromGitter<CodeVance> @zacharycarter no it meant not nested in a function. When block is okay though
00:28:19FromGitter<zacharycarter> huh?
00:28:55FromGitter<CodeVance> top-level is different from top-of-the-file
00:29:16FromGitter<gogolxdong> 路 is a chinese charactor which means road.
00:29:33FromGitter<zacharycarter> there's only one level in the file.
00:29:38FromGitter<CodeVance> @gogolxdong what you talking about XD
00:29:39FromGitter<zacharycarter> @gogolxdong yes - we got that
00:29:57FromGitter<zacharycarter> most of us are not Chinese
00:29:58FromGitter<zacharycarter> FYI
00:30:27FromGitter<ephja> @CodeVance 🤷 was turned into that character by the eval bot
00:30:45FromGitter<CodeVance> zachary make that a template. not a proc
00:31:01FromGitter<CodeVance> \🤷
00:31:03FromGitter<CodeVance> /🤷
00:31:15FromGitter<zacharycarter> I don't think you can importcpp with templates
00:31:17FromGitter<zacharycarter> I could be wrong
00:31:36FromGitter<zacharycarter> you can't use ffi at compile time tmk
00:31:40FromGitter<CodeVance> @zacharycarter its not importing. think of it like copy paste
00:31:59skrylaryou can also put imports inside top level when statements
00:32:05FromGitter<CodeVance> putting that in a proc would mean it has to run at runtime
00:32:28FromGitter<CodeVance> putting it in a macro or template is like a compile time proc
00:33:20FromGitter<zacharycarter> yeah but this isn't a nim import
00:33:32FromGitter<zacharycarter> and I need a js ffi proc declared to cal it first
00:33:32FromGitter<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:47FromGitter<CodeVance> Just try it... it ought to work
00:33:49FromGitter<zacharycarter> okay I'll try it
00:33:52FromGitter<CodeVance> hopefully
00:33:55FromGitter<CodeVance> T_T
00:34:06FromGitter<zacharycarter> what am I supposed to do - just return a string?
00:34:33FromGitter<CodeVance> no just put the pragma inside the template body
00:34:38FromGitter<CodeVance> I think!
00:34:46FromGitter<zacharycarter> oh okay
00:34:52FromGitter<CodeVance> And maybe {.inject.} pragma in template head
00:35:17FromGitter<CodeVance> Though I'm just guessing from fooling around with templates
00:35:38FromGitter<zacharycarter> ``` {. importcpp: "import * as # from '#'" .}``````
00:35:40FromGitter<zacharycarter> doesn't seem to work
00:35:58FromGitter<zacharycarter> `Error: attempting to call undeclared routine: 'importcpp'`
00:38:07FromGitter<CodeVance> But that's a cpp...
00:38:18FromGitter<CodeVance> Is there like a importjs
00:38:35FromGitter<CodeVance> is the import code a js code?
00:38:45FromGitter<CodeVance> maybe try {.emit: .}
00:40:59FromGitter<zacharycarter> yeah - that's what I tried next
00:41:03FromGitter<CodeVance> what about importc instead of importcpp
00:41:08FromGitter<zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae514a31130fe3d362a0689]
00:41:14FromGitter<zacharycarter> importc doesn't work with jsbackend - only importcpp does
00:41:23FromGitter<CodeVance> what? okkka
00:41:36FromGitter<zacharycarter> but the js that gets produced is - ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae514bf2d0e228d7bc2584e]
00:42:03FromGitter<zacharycarter> so obviously like some globals are getting put into the generated code first
00:42:13FromGitter<zacharycarter> I'll see if I can write some type of hoist pragma
00:44:46FromGitter<sivakon> When will c2nim support commas?
00:47:02FromGitter<CodeVance> ```code paste, see link``` ⏎ ⏎ @zacharycarter [https://gitter.im/nim-lang/Nim?at=5ae5160562316e05050e71ac]
00:47:40FromGitter<CodeVance> Wait %r doesn't make quotes
00:48:29FromGitter<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:03FromGitter<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:23FromGitter<zacharycarter> @CodeVance - I still don't think it will work the AST needs to be modified
01:21:57*CodeVance joined #nim
01:22:09FromGitter<zacharycarter> and I don't think can get access to the full AST with macros
01:22:12FromGitter<CodeVance> es6 gets imported it says
01:22:31FromGitter<CodeVance> es6 import is hoisted internet says
01:22:47FromGitter<zacharycarter> well - it is if it's just vanilla JS
01:22:47*CodeVance left #nim (#nim)
01:22:56FromGitter<zacharycarter> err wait
01:23:07FromGitter<zacharycarter> no - ES6 import statements have to appear at the top of a module
01:23:10*ftsf joined #nim
01:23:18FromGitter<zacharycarter> I use them daily at work
01:24:11FromGitter<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:28FromGitter<CodeVance> As long as it isn't in a statementitem
01:24:32FromGitter<CodeVance> https://stackoverflow.com/questions/29329662/are-es6-module-imports-hoisted
01:25:15FromGitter<CodeVance> THe thing is all that code at the top is compatibility stuff
01:25:24FromGitter<CodeVance> I don't know how to switch that off
01:25:50FromGitter<zacharycarter> that's what I'm saying - you need to modify the jsgen in the compiler most likely to make this work
01:27:21FromGitter<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:39FromGitter<CodeVance> Maybe post in the forums too :)
01:31:06FromGitter<amscotti> Sure, good idea!
01:35:26FromGitter<zacharycarter> dom96: is there a way to add a local build of nim to choosenim?
01:36:00FromGitter<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:51FromGitter<amscotti> Is there a better way to divide a int by a float then casting the int into a float with `.float`?
01:52:29FromGitter<CodeVance> converters or something. I'm still new
01:54:21FromGitter<zacharycarter> @amscotti - I added a review
01:54:43FromGitter<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:27FromGitter<amscotti> Thanks for the review @zacharycarter ! So, it sounds like it's best to say with `.float` for now?
01:57:18FromGitter<zacharycarter> well
01:59:10FromGitter<zacharycarter> something like - ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae526ee7c3a01610d30469a]
01:59:55FromGitter<zacharycarter> but yes
02:00:08FromGitter<zacharycarter> I would stick with the `.float` and do something like ^
02:01:55FromGitter<zacharycarter> https://forum.nim-lang.org/t/3772 - btw that's the conversation / thread I was referring to
02:02:00FromGitter<zacharycarter> when I mentioned debate around converters
02:04:00petersjt014[m]Is there any way I can get a `TimeInterval` as just seconds?
02:05:49FromGitter<zacharycarter> ```import times ⏎ ⏎ let interval = TimeInterval(seconds: 300) ⏎ ⏎ echo interval.seconds``` [https://gitter.im/nim-lang/Nim?at=5ae5287d2d0e228d7bc287d5]
02:05:56FromGitter<zacharycarter> I don't think I'm understanding your question :/
02:06:54FromGitter<zacharycarter> do you mean like
02:07:22FromGitter<zacharycarter> if you had `TimeInterval(days: 1)`
02:07:54FromGitter<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:13FromGitter<zacharycarter> I don't think such a proc exists but it should be stupid simple to write
02:13:06FromGitter<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:30FromGitter<zacharycarter> petersjt014[m]: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae52ac21130fe3d362a3eff]
02:16:24FromGitter<CodeVance> isn't there a timedate lib?
02:16:38FromGitter<zacharycarter> there's the times module in the stdlib
02:17:08FromGitter<CodeVance> isn't something like that supposed to be in there x_x
02:17:42FromGitter<zacharycarter> I mean - I think that function is pretty easy to write
02:17:56FromGitter<zacharycarter> and if someone wants to build on top of the stdlib module - they certainly can
02:18:00FromGitter<CodeVance> ya just multiply
02:18:12FromGitter<zacharycarter> but I don't think the stdlib needs to embrace hand holding either
02:18:13FromGitter<CodeVance> I can't believe you use exponentials
02:18:28FromGitter<zacharycarter> it should give tools for developers to build on top of
02:18:31FromGitter<zacharycarter> not do everything for you
02:18:59FromGitter<CodeVance> Well I just want things to be as simple as possible. and no simpler
02:19:15FromGitter<CodeVance> not complicated. not getting in the way
02:19:20FromGitter<CodeVance> all else the dev can do
02:19:25FromGitter<zacharycarter> well I don't think you can get any more simpler than simpler as possible :P
02:20:02FromGitter<CodeVance> proc toSeconds(time: Time): float
02:20:13FromGitter<zacharycarter> that's not the same thing as a TimeInterval though
02:20:18FromGitter<zacharycarter> different types
02:21:44FromGitter<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:08FromGitter<CodeVance> is there a rectangle library?
02:51:12FromGitter<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:07FromGitter<CodeVance> good night or day all
03:06:34alpha1220Araq: 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:37FromGitter<sherjilozair> This page should be improved: https://learnxinyminutes.com/docs/nim/
04:01:42FromGitter<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:32Araqnull 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:58planetis[m]nice!
05:18:56planetis[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:26alpha1220Araq: `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:50Araqplanetis[m]: same for seqs, @[] will be mapped to nil internally.
05:23:14Araqalpha1220: that's just the representation layer that I haven't touched yet
05:23:40AraqI'm investigating why the CIs hang now forever in the testsuite.
05:24:05Araqthe joys of refactorings in a complex environment...
05:24:39alpha1220Araq: 👍
05:24:46*miran joined #nim
05:30:03*alpha1220 quit (Quit: Page closed)
05:36:06FromGitter<sherjilozair> Installing `c2nim` gives me this error: ` ... clex.nim(107, 15) Error: undeclared identifier: 'FileIndex'`
05:36:31planetis[m]did you install from nimble?
05:36:56FromGitter<sherjilozair> I cloned the repo, and then ran `nimble build`.
05:38:10planetis[m]try nimble install c2nim afaik it uses a git tag to a working commit
05:38:59miranyesterday there was a commit to c2nim dealing with 'FileIndex' - do you have the latest version?
05:40:37FromGitter<sherjilozair> I do have the latest version. I just cloned now.
05:41:06miranthen try the previous version ;)
05:41:09FromGitter<sherjilozair> I get the same error with `nimble install c2nim`
05:41:10planetis[m]well you can try fix it. it probably misses an import
05:41:18FromGitter<sherjilozair> okay.
05:41:22*darithorn quit (Remote host closed the connection)
05:41:37miranhmm, maybe the latest version of c2nim works with the latest nim devel?
05:41:51miranif you're on stable (0.18.0), i would try that first....
05:50:30FromGitter<sherjilozair> I get the same error with latest nim.
05:51:22FromGitter<sherjilozair> with both c2nim versions.
05:51:33miranfile an issue then
05:54:10Araqworks for the CI, c2nim's tests are green
05:54:21Araqcheck 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:31FromGitter<sherjilozair> Does travis only check against latest commits?
06:03:49FromGitter<sherjilozair> Shouldn't we also check stable branch?
06:04:53planetis[m]so you cloned c2nim master and trying to build with nim devel?
06:05:15FromGitter<sherjilozair> `choosenim "#head"` to be precise.
06:05:23FromGitter<sherjilozair> Yes.
06:05:48planetis[m]well we all do mistakes :)
06:06:34*Trustable joined #nim
06:07:33FromGitter<sherjilozair> When I follow the travis script, I get this error: `c2nim.nim(11, 42) Error: cannot open 'compiler/llstream'`
06:07:51FromGitter<sherjilozair> Any ideas?
06:09:25FromGitter<Varriount> @sherjilozair Run "nimble install nim", I think
06:09:44FromGitter<Varriount> Or just, "nimble install c2nim"
06:11:23FromGitter<sherjilozair> @Varriount I've tried those. It doesn't work.
06:11:48FromGitter<Varriount> Odd
06:12:16FromGitter<Varriount> Oh, you're using Travis?
06:12:27FromGitter<Varriount> Hm.
06:12:45FromGitter<sherjilozair> No. I was running the commands in the travis script.
06:13:03FromGitter<sherjilozair> That's like the 3rd thing I tried. I tried nimble before.
06:13:20FromGitter<Varriount> Odd, it's usually not that hard...
06:14:08FromGitter<sherjilozair> Where does `FileIndex` come from?
06:14:40FromGitter<sherjilozair> This is the problem with the import semantics. I can't know where FileIndex comes from.
06:16:11FromGitter<Varriount> You could rgrep for "FileIndex(\*)? ="
06:16:32FromGitter<Varriount> (With an escaped asterisk)
06:17:16FromGitter<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:28FromGitter<sherjilozair> Okay, thanks @Varriount .
06:17:51FromGitter<sherjilozair> I figured out FileIndex is in `compiler/msgs`
06:17:51FromGitter<Varriount> What method did you use to install Nim?
06:17:57FromGitter<sherjilozair> but importing it doesn't fix this issue.
06:18:04FromGitter<sherjilozair> the choosenim method.
06:18:19FromGitter<sherjilozair> and I ran `choosenim "#head"` later.
06:18:34FromGitter<sherjilozair> `Version 0.18.1`
06:21:00*dddddd quit (Remote host closed the connection)
06:22:38FromGitter<sherjilozair> Changing `FileIndex` to `int32` compiles, but not sure if it would work.
06:25:31Araqthen you don't have Nim devel
06:25:36Araqbut some outdated compiler package
06:25:43Araqcompile with --noNimblePath
06:26:08Araqanyway, devel is a mess currently and I'm not here to fix it. you have to wait for tonight, sorry.
06:28:29FromGitter<Varriount> @sherjilozair The current version is something like 0.19
06:29:07FromGitter<Varriount> What does your PATH environment variable look like? Where does "which nim" lead you?
06:29:09FromGitter<sherjilozair> So choosenim didn't really get me latest commit?
06:29:36FromGitter<sherjilozair> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae566505d7286b43a7c26c1]
06:30:07FromGitter<sherjilozair> What's the difference between master and devel?
06:30:41FromGitter<Varriount> Master is the last stable release. Revel is the active development branch
06:31:21FromGitter<Varriount> That is odd
06:31:49FromGitter<sherjilozair> So basically choosenim is not working.
06:31:53FromGitter<sherjilozair> It's not giving me 0.19.
06:33:44FromGitter<Varriount> I don't know. What does `choosenim show` return?
06:35:31*Trustable quit (Remote host closed the connection)
06:35:43FromGitter<sherjilozair> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae567bf2d0e228d7bc330e4]
06:36:36FromGitter<Varriount> @sherjilozair You ran `choosenim '#head'`, try running `choosenim '#devel'`
06:38:17FromGitter<Varriount> Also, what is your profile picture of?
06:40:32FromGitter<sherjilozair> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae568e07c3a01610d31006e]
06:40:42FromGitter<sherjilozair> That's just me.
06:42:20FromGitter<sherjilozair> #devel doesn't give 0.18 as well.
06:42:48FromGitter<sherjilozair> I mean 0.19.
06:42:57FromGitter<sherjilozair> I cloned nim and built it. That doesn't give me 0.19 as well.
06:43:44FromGitter<sherjilozair> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae5699f62316e05050f51ff]
06:43:55FromGitter<Varriount> I was wrong, there is no 0.19 (yet)
06:44:17FromGitter<Varriount> I think
06:44:34*miran quit (Ping timeout: 260 seconds)
06:44:45FromGitter<Varriount> Can you try installing/compiling c2 Nim now?
06:45:21FromGitter<sherjilozair> Yeah, latest nim worked.
06:45:32FromGitter<sherjilozair> so for some reason choosenim doesn't give latest nim.
06:45:47FromGitter<sherjilozair> Any examples on how to actually run c2nim?
06:46:05FromGitter<Varriount> It's just that #HEAD points to master, not devel
06:47:22FromGitter<sherjilozair> `#devel` didn't work either though.
06:47:32FromGitter<sherjilozair> Can c2nim be made to follow headers?
06:47:40FromGitter<Varriount> https://github.com/nim-lang/c2nim/blob/master/doc/c2nim.rst
06:47:54FromGitter<Varriount> C2nim is somewhat low-level.
06:48:18FromGitter<Varriount> I believe Nimgen is the current high-level tool.
06:48:44FromGitter<Varriount> https://github.com/genotrance/nimgen
06:49:03FromGitter<Varriount> Shout-out to @genotrance !
06:51:51FromGitter<sherjilozair> Nimgen doesn't follow headers included using <> too. :/
06:53:20*salewski joined #nim
06:55:36salewskidom96, further investigations about your macos gintro bug may indicate that you have not installed GtkSourceView package.
06:56:06salewskiUser zetashift had a similar issue on windows 10: https://github.com/StefanSalewski/gintro/issues/24
06:56:42salewskiBut he was really smart, watched output from console and fixed the problem.
06:57:45salewskiI will add some special care for these cases for generator script.
06:58:31salewskiUnfortunately, as I am using releases, I would have to do a new release for each small fix.
06:59:42salewskiOr I have to ask users to do "nimble install gintro#@head" -- maybe I will just add that hint to doc page.
07:05:16salewskiFor 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:54yglukhov_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:46FromGitter<data-man> @yglukhov_: Not works for me
08:21:05yglukhov_windows?
08:21:18FromGitter<data-man> No, Arch
08:22:36yglukhov_phew. thought i messed smth up with my yet unmerged iters pr :)
08:23:03FromGitter<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:41yglukhov_yup. and `nim c -r --debugger:native tests/iter/twrap_walkdir` crashes nim itself, right?
08:23:50FromGitter<data-man> Yes
08:24:13yglukhov_Araq: there's smth going on here. not nil strings?..
08:57:17FromGitter<dom96> @sherjilozair what makes you think choosenim doesn't grab latest Nim?
08:58:01FromGitter<sherjilozair> Because compiling c2nim with it gave errors, while cloning and building nim myself worked.
08:58:33FromGitter<dom96> Salewski: releasing every time you change something isn't practical. This issue also won't affect everyone.
08:59:32FromGitter<dom96> @sherjilozair any chance you could gist the logs?
09:00:04FromGitter<dom96> Far more likely that you had an outdated Nim installed somewhere else, perhaps via homebrew?
09:01:08FromGitter<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:31FromGitter<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:16dom96Oh, that's probably because of this: https://github.com/dom96/choosenim/issues/46
09:10:28dom96Did you try running ``nimble install compiler@#head``?
09:10:41dom96oh wait
09:11:08FromGitter<sherjilozair> I did not.
09:11:27dom96I just remembered that I pinned c2nim's compiler dep on a specific commit
09:12:01dom96and indeed, I get the same error
09:12:47dom96Because of this commit... https://github.com/nim-lang/c2nim/commit/9f05d97d98b2f03ead7213be0f1c80a17a4a0fb6
09:12:51dom96Araq: ^
09:12:59*SenasOzys joined #nim
09:13:21FromGitter<sherjilozair> I mean the commit's okay, because it does compile with latest Nim.
09:13:24FromGitter<qqtop> With latest nim devel having --lineDir:on always SIGSEGV: Illegal storage access. (Attempt to read from nil?)
09:14:45dom96sherjliozair: So after getting the latest Nim manually running `nimble install c2nim` worked?
09:14:47FromGitter<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:51FromGitter<sherjilozair> No.
09:14:56FromGitter<sherjilozair> well, I didn't try that.
09:15:03FromGitter<sherjilozair> I cloned c2nim and built it.
09:15:04dom96Good, that's what I thought
09:15:10dom96And yes, the travis script is wrong
09:15:25FromGitter<data-man> @dom96: Can we include c2nim to Nim/tools?
09:15:30dom96data-man: no
09:15:38dom96We should be moving things out of there instead of into there
09:16:20FromGitter<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:34dom96data-man: Yes, I know. We should update c2nim to work with latest Nim when necessary
09:17:54dom96But you didn't update the pinned commit and so installation via Nimble is now broken
09:19:11FromGitter<data-man> Latest Nim? Release or devel?
09:20:06FromGitter<alehander42> can I compare if types are equal in a macro?
09:20:13FromGitter<data-man> Many developers using Nim-devel only :)
09:20:20FromGitter<alehander42> basically if they are the same Enum type
09:20:24FromGitter<alehander42> so no generics and stuff
09:20:39FromGitter<alehander42> I think the name should be sufficient, but maybe not
09:20:49dom96data-man: you can still build Nimble with devel
09:20:50FromGitter<alehander42> they can share a name
09:20:57dom96er, you can still build c2nim via nimble
09:21:57*athenot_ quit (Ping timeout: 255 seconds)
09:23:30dom96The installation instructions for c2nim even say to do this :)
09:26:09*SenasOzys joined #nim
09:29:45FromGitter<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:38FromGitter<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:21FromGitter<CodeVance> Maybe all the C interop stuff shoul be in its own lib to discourage usage in regular nim
11:23:03FromGitter<mratsim> you mean {.importc.} or types like uint?
11:23:06FromGitter<mratsim> cint*
11:24:43FromGitter<CodeVance> If their general use is discouraged then they shouldn't be so easy to get to
11:24:57FromGitter<CodeVance> But its more an austhetic issue.
11:25:18*CodeVance left #nim ("Leaving")
11:42:41*atweiden-air joined #nim
11:44:49FromGitter<mratsim> I’m sure it’s discussed somewhere, and Araq wants to do this
11:45:08atweiden-airhey, i'm the maintainer of https://aur.archlinux.org/packages/nim-git/
11:45:14atweiden-airi 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:22atweiden-airspecifically, building the PDF documentation is broken right now, due to ForLoopStmt
11:45:37atweiden-airthat is all...
11:45:45FromGitter<CodeVance> Have a fix for it? XD
11:45:59FromGitter<CodeVance> I'll make a report then and tag you?
11:46:22atweiden-airgr8
11:47:45FromGitter<CodeVance> Can you tell me what command you used
11:47:50FromGitter<CodeVance> And the output
11:47:55FromGitter<CodeVance> atweidan-air
11:48:10FromGitter<CodeVance> or are you on a cellphone
11:48:32atweiden-airan arch user has documented the exception here: https://aur.archlinux.org/packages/nim-git/
11:48:37atweiden-air(comments)
11:53:03FromGitter<mratsim> @Araq ^
11:53:51FromGitter<CodeVance> https://github.com/nim-lang/Nim/issues/7724
11:54:12FromGitter<mratsim> But it’s strange, ForLoopStmt works on devel, they were added 2 weeks ago
11:54:38FromGitter<CodeVance> atweidan. Is the program nim 0.18?
11:54:46FromGitter<mratsim> it’s git
11:54:49FromGitter<mratsim> so devel
11:55:17*xet7 quit (Read error: Connection timed out)
11:55:20FromGitter<CodeVance> why doesn't it rather say nim-devel XD
11:55:25FromGitter<CodeVance> or nim-nightly
11:55:37*xet7 joined #nim
11:55:37*smt` joined #nim
11:55:48FromGitter<mratsim> git means devel in Arch speak
11:56:06FromGitter<CodeVance> weird but okay I understand
11:56:20FromGitter<mratsim> or foo-svn or foo-hg
11:56:21FromGitter<xmonader> Good morning friends
11:56:41FromGitter<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:50FromGitter<CodeVance> hello @xmonader monad
11:58:42FromGitter<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:27FromGitter<xmonader> what do you guys think?
11:59:28FromGitter<CodeVance> how long you want the guide to be?
11:59:31dom96xmonader: just start writing, you can always format it in different ways later :)
11:59:45*smt quit (Ping timeout: 264 seconds)
11:59:52FromGitter<mratsim> @xomonader you can get inspiration from: https://github.com/btbytes/nim-cookbook Rosetta code, exercise.io Learn X in Y minutes
11:59:58dom96I suggest markdown or asciidoc, i've used the latter for my book.
12:00:12FromGitter<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:18leruWhat 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:56FromGitter<CodeVance> leru check out the example folder.
12:01:15FromGitter<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:19FromGitter<mratsim> @atweiden-air, why is texlive a Nim dependency?
12:01:55FromGitter<data-man> @mratsim: pdflatex is required
12:01:59FromGitter<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:02atweiden-airmratsim: it's a makedepends for building the PDF docs
12:02:25atweiden-aira binary pkg would not have this dependency
12:02:30dom96leru: use asynchttpserver
12:02:47FromGitter<mratsim> ok, I’m trying to install nim-git on my arch box
12:02:48dom96asyncdispatch doesn't need 'sockets'
12:02:51FromGitter<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:23FromGitter<mratsim> @CodeVance it does iirc, it’s just not prefixed with Rect
12:04:02FromGitter<CodeVance> @mratsim I've search for overlap/intersect word but couldn't find it
12:04:10dom96CodeVance: The examples folder contains pretty bad examples
12:04:30dom96Somebody should update them
12:04:42FromGitter<CodeVance> nim_sdl2 contains a bunch of examples. is the other thing
12:05:45FromGitter<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:46dom96xmonader: that would be awesome :)
12:06:26FromGitter<mratsim> @atweiden-air: confirmed I also get manual_snippet_122.nim(4, 20) Error: undeclared identifier: 'ForLoopStmt'
12:07:04FromGitter<xmonader> @dom96 thanks! I'm expecting lots of help during that ^_^
12:07:08FromGitter<CodeVance> dom96, someone can update the examples. But it'd be the same as nim_sdl2 with slightly different words
12:07:23FromGitter<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:31FromGitter<xmonader> but do you have some ideas in mind for full library / apps can be used to introduce the language?
12:08:13FromGitter<CodeVance> @xmonader https://play.nim-lang.org/
12:08:20dom96xmonader: use book's from other language for inspiration, in particular Python. Learn Python the Hard Way is a good source of inspiration. :)
12:08:25FromGitter<mratsim> @data-man I think it’s nim doc that doesn’t know about the ForLoopStmt
12:08:48mirandom96: the most hated python book/author :)
12:09:21FromGitter<CodeVance> miran there is such a thing as the most hated python book?
12:09:34miranindeed there is :)
12:09:35FromGitter<CodeVance> oh learn python the hard way is stupid
12:09:40FromGitter<CodeVance> toooo opinionated
12:10:04FromGitter<data-man> @mratsim: So, how it has appeared in mine manual.pdf? :)
12:10:21FromGitter<mratsim> ah, dunno :D
12:10:35FromGitter<mratsim> I use choosenim on my archbox anyway.
12:11:06miranbtw, what we're missing is a stronger presence on coding-exercises sites such as codewars, exercism, etc.
12:11:29dom96what we're also missing is a Go tour-like thing
12:11:30FromGitter<CodeVance> miran speaking of exercism
12:11:34dom96We've got the playground for it
12:11:38dom96Somebody create a tour :)
12:11:38miranif somebody is looking how to contribute, this might be a good thing to do
12:11:47FromGitter<CodeVance> miran https://github.com/exercism/nim/
12:11:52miranhttps://forum.nim-lang.org/t/3735
12:12:30FromGitter<CodeVance> yesterday someone asked for suggestions on their nim info
12:12:35FromGitter<CodeVance> on exercism
12:12:46mirannumber of exercism nim tasks haven't changd in year and half (see the dates on https://forum.nim-lang.org/t/2618)
12:12:46FromGitter<mratsim> I remember that one of the best thing when I learned Haskell was their Project Euler wiki.
12:13:38lerudom96, CodeVance, they need sockets in the examples
12:14:04dom96leru: https://nim-lang.org/docs/asyncnet.html#examples-chat-server
12:14:27miranIMO, we should choose one if these practice sites and aim for 100 nim tasks on it
12:15:43lerudom96, that is not an http server. do i need to implement my own?
12:15:59dom96leru: I already told you: use asynchttpserver
12:16:05dom96You said you wanted sockets examples
12:16:08dom96So I gave you them
12:16:21dom96Here is asynchttpserver https://nim-lang.org/docs/asynchttpserver.html
12:16:32lerui wrote "What is the current way to set up a http server?"
12:17:04dom96And I replied "use asynchttpserver", https://irclogs.nim-lang.org/29-04-2018.html#12:02:30
12:17:51FromGitter<xmonader> @CodeVance u mean a web app like this one?
12:18:32FromGitter<xmonader> @dom96 yea i'm pretty familiar with python will check :) thanks
12:18:56FromGitter<CodeVance> @xmonader Webapp?
12:19:18FromGitter<xmonader> @CodeVance like this playgorund https://play.nim-lang.org ?
12:19:22FromGitter<CodeVance> oh I was thinking of a place to introduce the language @xmonader
12:19:51FromGitter<xmonader> ah! tour would be really great! i like the go tour also the tour from eta lang is great!!
12:20:09FromGitter<CodeVance> If you could have multiple preloaded examples
12:20:25FromGitter<CodeVance> which they can tweek and run again
12:20:44FromGitter<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:00FromGitter<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:48FromGitter<data-man> @dandevelo: Why WM_COMMAND is var?
12:33:13FromGitter<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:22FromGitter<data-man> @dandevelo: See https://github.com/khchen/winim
12:36:31FromGitter<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:28FromGitter<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:30FromGitter<data-man> Linux-users can haven't windows.h
12:39:47FromGitter<dandevelo> @data-man this code only runs when defined(windows):
12:40:09FromGitter<dandevelo> It is Windows specific code so there is no reason for it to run on Linux
12:41:08FromGitter<data-man> For cross-compilation
12:45:26FromGitter<data-man> Try ```var WM_COMMAND* {.importc: "WM_COMMAND", header:"windows.h", nodecl.} :cuint```
12:48:37FromGitter<dandevelo> Still getting this:
12:48:38FromGitter<dandevelo> Error: cannot evaluate at compile time: WM_COMMAND
12:49:06FromGitter<mratsim> By the way, I’m celebrating my 100+ Nim issues this week! (currently at 107)
12:49:14FromGitter<dandevelo> It's funny that this works: var msg = WM_COMMAND but this doesn't: case uMsg ⏎ of WM_COMMAND:
12:49:41FromGitter<data-man> @mratsim: Why not 100+ PRs?
12:49:58FromGitter<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:05FromGitter<GULPF> cases must be known at compile time, and `importc` doesn't work with `const`
12:50:50FromGitter<mratsim> @data-man errrhhh, the compiler scares me :P
12:51:18FromGitter<data-man> @mratsim: Just improve stdlib! ;)
12:51:55FromGitter<mratsim> I’m improving what I use. The loopfusion package can be reworked to be added to sugar.nim for example.
12:52:26FromGitter<mratsim> but I don’t use async/http/strutils nor 2D/3D libs
12:52:38FromGitter<mratsim> maybe I’ll improve complex if I ever get to use them.
12:52:39FromGitter<dandevelo> @GULPF do you believe the case statement would work if importc would work with const?
12:53:14FromGitter<mratsim> @dandevelo yes
12:54:31FromGitter<dandevelo> @mratsim is there a link to that PR?
12:54:35FromGitter<mratsim> also I suppose if the project to have Nim compile on GPU starts, I can test, and improve it
12:54:46lerudom96, you were right. i'm sorry.
12:54:50leruthank you
12:56:15FromGitter<mratsim> @dandevelo actually it was on the forum: https://forum.nim-lang.org/t/3762#23408
12:58:41FromGitter<data-man> @mratsim: generics version of Complex, IntSet, ... ?
12:59:45FromGitter<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:24FromGitter<data-man> It's can be useful for uint* types.
13:00:42FromGitter<data-man> Less memory
13:01:18FromGitter<mratsim> for uint16, the included sets are fine
13:01:40FromGitter<mratsim> otherwise casting to int32 or int64 is ok.
13:02:10FromGitter<data-man> And current implementation of IntSet can't work with int64 on 32bit machines.
13:02:48FromGitter<mratsim> I see. I have more use for general bitvectors than intsets though.
13:03:20FromGitter<mratsim> The only place I use intsets for is for an object pool project. intset is used to store ByteAddress.
13:04:16FromGitter<mratsim> https://github.com/mratsim/Arraymancer/blob/master/src/object_pool/object_pool.nim#L20
13:06:00*yglukhov joined #nim
13:08:26FromGitter<data-man> I ported some code from https://github.com/gpakosz/PackedArray to Nim ⏎ And I like https://github.com/RoaringBitmap/CRoaring
13:09:47FromGitter<data-man> And https://github.com/lemire/cbitset ⏎ And https://github.com/lemire/EWAHBoolArray ⏎ :-D
13:09:58FromGitter<mratsim> Ah nice, I wanted to port PackedArray as well, it would be probably quite sueful for my go playing bot
13:11:19FromGitter<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:28FromGitter<data-man> Please, imrove it: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae5c4bc15c9b031144a672c]
13:13:38FromGitter<mratsim> I think you can copy paste the set proc from Nim compiler. search for inclSet, exclSet, cardSet and co on GIthub
13:14:58FromGitter<mratsim> also uintBitCount is a power of 2, so instead of div, you can `shr`
13:15:01FromGitter<data-man> No, I have semifinished bitsets implementaion with variable length.
13:15:15FromGitter<mratsim> `div 8` is shr 3 (2^3 == 8)
13:15:39FromGitter<mratsim> and instead of mod you can `and (foo - 1)`
13:15:53FromGitter<mratsim> `mod 8` is `and 7`
13:16:28FromGitter<mratsim> mod and div costs about 50 CPU cycles compared to `shr` and `and` which are about 1 cycle
13:17:46miranmratsim: 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:49FromGitter<mratsim> @miran, maybe dumb, but can’t you just use uint32?
13:20:17miranhaven't tried it, will do...
13:20:25FromGitter<mratsim> here: https://github.com/narimiran/AdventOfCode2017/blob/c777c60b5ea9c01a57561f68d1295ab14a9d72f6/nim/day15.nim#L9-L12
13:20:37FromGitter<mratsim> multiplication will roll over properly
13:23:04FromGitter<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:39miranuint32 makes it 50% slower :/
13:24:09FromGitter<mratsim> I would have to read the task goal
13:24:17FromGitter<mratsim> I don’t now what solve and next represent
13:24:33miranhttp://adventofcode.com/2017/day/15
13:24:53miranif you've not solve it and/or not registered, you'll be able to see only the first part
13:26:06miranthe first part can be solved simpler, but that 'unnecessary complexity' is for part II
13:27:37FromGitter<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:26miran:)
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:01leruIs 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:57federico3getEpoch and sleep?
14:22:09*xet7 quit (Read error: Connection timed out)
14:22:16federico3or you want a built in async timer?
14:22:37*xet7 joined #nim
14:29:55*darithorn joined #nim
14:33:09FromGitter<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:37lerufederico3, this works well! I was irritated, that there was no sleep in threads. But that now is fantastic! Thank you!
14:49:56FromGitter<mratsim> I really think that might be the most promising UI library for Nim: https://github.com/oskca/webview
14:56:14FromGitter<data-man> @mratsim: WebKit and MSHTML? Thanks, but not for me. :)
14:56:49FromGitter<mratsim> well it seems much easier than QT/GTK for a quick app ;)
14:57:10FromGitter<mratsim> and you don’t need to ship 200MB of electron
14:57:38FromGitter<data-man> I prefer Dear ImGui
14:59:41FromGitter<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:46FromGitter<mratsim> I don’t know at all about UI programming. I’ reading on immediate GUI, they are stateless?
15:08:07FromGitter<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:59FromGitter<ephja> what does it mean for it to be solved?
15:13:17FromGitter<data-man> @krux02: For a long time it's solved in Delphi/Qt/wxWidgets/etc. IDEs
15:16:33FromGitter<data-man> @mratsim: I impatiently wait, when it will be realized: https://github.com/ocornut/imgui/issues/1542 :)
15:17:06FromGitter<mratsim> but it seems like imgui would have resizing issues
15:18:52FromGitter<data-man> Where it's described?
15:19:08FromGitter<mratsim> The fonts have aliasing issue
15:19:30FromGitter<data-man> You can to use FreeType2
15:19:36FromGitter<data-man> With ImGui
15:20:15FromGitter<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:33FromGitter<data-man> https://yogalayout.com by Facebook
15:22:42FromGitter<mratsim> So I have to use JS anyway?
15:23:18FromGitter<krux02> no, not really
15:23:25FromGitter<krux02> there is always an alternative to js
15:23:42FromGitter<krux02> in DOS ages it was always common that every program wrote it's UI library on it's own
15:23:47FromGitter<krux02> its own
15:24:54FromGitter<krux02> And trust me, wrting a button with all features a button can have isn't hard.
15:25:05FromGitter<data-man> I worked with TurboVision 2.0 for TurboPascal :)
15:25:27FromGitter<data-man> For MSDOS :)
15:26:15FromGitter<krux02> ok, maybe you know more about programming for DOS than be
15:26:16FromGitter<krux02> me
15:26:54FromGitter<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:11FromGitter<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:57FromGitter<data-man> Or vim vs emacs :)
15:31:07FromGitter<krux02> yea
15:31:27FromGitter<krux02> btw Vim won I guess. But I am using emacs.
15:31:32FromGitter<krux02> yay.
15:33:01FromGitter<AjBreidenbach> nvim works really well for nim
15:33:17FromGitter<AjBreidenbach> is everything in the locks module deprecated ?
15:33:50FromGitter<krux02> @AjBreidenbach does nimsuggest work properly in nvim?
15:34:05FromGitter<krux02> I mean does it block input at any time?
15:34:23FromGitter<krux02> when nimsuggest crashes or hangs, does vim do so, too?
15:34:30FromGitter<AjBreidenbach> doesn't seem like anything blocks
15:35:02FromGitter<AjBreidenbach> not sure if I'm running nimsuggest though
15:35:02FromGitter<krux02> And most importantly, when you edit a nim file that is included somewhere else, does it work properly with highlighting errors
15:35:22FromGitter<krux02> well nimsuggest is the process that provides completions
15:35:33FromGitter<krux02> if you have semantic completion nimsuggest is running
15:35:43FromGitter<AjBreidenbach> it highlights only if the file with the inclusion is open
15:35:47FromGitter<CodeVance> nim can't find glu what lib should I download
15:35:50FromGitter<AjBreidenbach> I'm probably not using nimsuggest
15:36:19FromGitter<krux02> you can als do pgrep nimsuggest
15:36:33FromGitter<krux02> (search for a running nimsuggest process)
15:36:34FromGitter<AjBreidenbach> nothing
15:36:39leruHow can I access a global from multiple threads?
15:36:54leruRight now I get Error: 'func' is not GC-safe as it accesses 'data' which is a global using GC'ed memory
15:37:05FromGitter<AjBreidenbach> don't you have to use a lock?
15:37:15FromGitter<AjBreidenbach> I was just trying to figure out if locks are deprecated or not
15:37:25leruI'm using a lock
15:37:58FromGitter<krux02> leru: any ref value is thread local
15:38:06FromGitter<krux02> do not access ref value from threads
15:38:14FromGitter<krux02> (different threads)
15:40:02*edcragg quit (Quit: ZNC - http://znc.in)
15:40:14*edcragg joined #nim
15:40:38leruHow else can I set the data then?
15:42:33FromGitter<AjBreidenbach> do you just copy a value into it?
15:42:47FromGitter<AjBreidenbach> or can you use a ptr instead of a ref?
15:44:34leruI could use a ptr
15:56:30*CodeVance joined #nim
16:09:06CodeVanceI "fixed" my code from earlier. Pong demo is running. It's super simple
16:09:52leruOk, 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:18shashlicksherjilozair: 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:27shashlickvarriount: thanks :)
16:18:24*Trustable joined #nim
16:19:05FromGitter<data-man> @leru: Why not newAsyncHttpClient?
16:23:57FromGitter<mratsim> I finished my neural net domain specific language! Now I have to cleanup the code :/ and add it to Arraymancer
16:24:14lerudata-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:06FromGitter<data-man> @mratsim: So, congrats! Probably. :)
16:47:07FromGitter<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:12dom96leru: What are you trying to make? web crawler?
16:54:30lerudom96, yes
16:55:18dom96leru: What data do you want to get out of it?
16:57:20lerudom96, it's for a website with some tables. From two of these tables I need some specific data
16:58:11dom96hrm, that sounds more like scraping a single website instead of crawling the web
16:59:55leruYou're right. I thought it's not that different in that context of solving this issue
17:00:34FromGitter<GULPF> if you're doing web scraping you might be interested in my project, https://github.com/GULPF/nimquery
17:01:14dom96In that case you don't need threads at all, a simple program that synchronously grabs the webpages will work
17:05:21leruYes 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:36dom96If 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:48leruI 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:44FromGitter<leruu> @GULPF Your project seems nice. Will definitely try it
17:24:25dom96leru: Sorry, I don't really understand
17:24:53dom96You should only use threads if you want parallelism, i.e. scale your program across CPU cores.
17:27:18*yglukhov joined #nim
17:27:35FromGitter<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:54FromGitter<Varriount> @GULPF You should have a macro that generates a parsing procedure at compile time, when given a static inputs
17:29:57FromGitter<Varriount> :P
17:31:21*yglukhov quit (Ping timeout: 240 seconds)
17:31:33FromGitter<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:41dom96leruu: I bet you don't need to split it up, but whatever works :)
17:41:13FromGitter<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:34FromGitter<geotre> Any ideas on how to pass a function ptr to a c lib so it can interface with a nim proc?
18:16:51FromGitter<alehander42> oh man quote in a macro generated in a quote in a macro doesn't quite help me
18:17:08FromGitter<data-man> @geotre: See lib/wrappers. E.g. callbacks for sqlite.
18:17:57FromGitter<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:29FromGitter<leruu> @data-man That's a great optimization! The last modified seems not to be accurate, but maybe accurate enought
19:22:19FromGitter<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:41FromGitter<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:30FromGitter<leruu> (sorry, quotes are kind of different here than I expected)
19:24:18FromGitter<data-man> @leruu: You can edit your message in gitter ;)
19:28:50FromGitter<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:34FromGitter<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:57dom96leruu: 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:54FromGitter<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:02FromGitter<data-man> I did not check this code! :)
19:41:51*craigger quit (Ping timeout: 240 seconds)
19:41:53dom96If 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:17FromGitter<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:33FromGitter<leruu> omg...
19:49:31FromGitter<leruu> https://gist.github.com/leruu/99c53db362ddfdaab11a7345e464d9e5
19:50:23FromGitter<leruu> This is right.
19:57:55Orange_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:03Orange_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:47FromGitter<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:49Orange_@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:36FromGitter<Varriount> Orange_: Does the sequence contain references, or objects?
20:07:05FromGitter<Varriount> If it has references, you could theoretically cast it, or just use a `for` loop to copy/convert it.
20:07:43Orange_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:47dom96Be careful with casting though, it could produce issues silently
20:10:08FromGitter<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:59FromGitter<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:01Orange_OK, makes sense. Thanks for your guidance
20:12:05*Orange_ quit (Quit: Page closed)
20:13:31dom96leruu: something like this should work: https://gist.github.com/dom96/eb2ae290d1f79233b330bccfd28437f4
20:13:59FromGitter<Bennyelg> Anyway I can extract the keys from jsonNode ?
20:17:21dom96toSeq(node.fields.keys) # Needs 'sequtils'
20:17:34dom96and 'tables' too probably
20:18:01FromGitter<Bennyelg> Thanks
20:18:03FromGitter<Bennyelg> /!!
20:19:48*find0x90 joined #nim
20:20:48*Orange__ joined #nim
20:22:08Orange__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:28dom96Orange__ https://gist.github.com/dom96/c50e624e65e4580de32378281345c5bf
20:40:23*miran quit (Ping timeout: 256 seconds)
20:40:37FromGitter<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:54dom96In 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:56lerudom96, 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:11lerucurrentTable is a string btw
21:12:57*find0x90 quit (Ping timeout: 264 seconds)
21:20:11dom96You don't need `--threads:on` anymore
21:22:05dom96if that doesn't help then you might need to mark your global variables with {.threadvar.}
21:22:55*CodeVance joined #nim
21:25:06leruRemoving `--threads:on` did nothing, but {.threadvar.} made it work! Thank you for helping me out today :)
21:27:53dom96no problem :)
21:27:56*CodeVance quit (Read error: Connection reset by peer)
21:30:51FromGitter<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:18FromGitter<mratsim> :P
21:42:46FromGitter<mratsim> I have a regression though, my networks don’t train anymore :/
21:43:06FromGitter<mratsim> They have 10% accuracy to recognize 10 digits … aka random
21:48:16FromGitter<diegogub> somone using Option[] with json module? I'm getting error with using % macro
21:49:27FromGitter<mratsim> Fixed, I forgot to put the neuron activation… accuracy is not in the 90%+ on digit recognition
21:51:10FromGitter<diegogub> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae63e4e2b9dfdbc3ae154fd]
21:52:00dom96diegogub: I don't think that's implemented for Option[T] yet
21:54:29FromGitter<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:42FromGitter<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:52dom96diegogub: 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:47FromGitter<mratsim> @data-man usually I use getTypeInst but somehow here it gives me symbols :/
22:12:56FromGitter<mratsim> and treerepr instead of repr
22:13:03FromGitter<mratsim> another candidate for: https://github.com/nim-lang/Nim/issues/7719
22:16:04FromGitter<mratsim> .symbol.getimpl doesn’t help as well ...
22:16:23*xkapastel joined #nim
22:16:36FromGitter<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:04FromGitter<mratsim> oh actually it’s easy
22:18:19FromGitter<data-man> Help me! :)
22:18:22FromGitter<mratsim> I thought you wanted to get expanded types
22:19:04*CodeVance left #nim ("Leaving")
22:19:11FromGitter<data-man> I need expand and to bind varargs[typed]
22:21:00FromGitter<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:34FromGitter<mratsim> seems like fields/fieldsPairs don’t work in macro
22:24:35FromGitter<mratsim> otherwise something like that can work: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae646226d7e07082b495e7e]
22:24:55FromGitter<Varriount> @mratsim I've called getTypeInst from a compile time proc
22:25:24FromGitter<mratsim> Ah, For me I get NimNode instead of what I want
22:26:36FromGitter<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:22FromGitter<data-man> @mratsim: No problem. See you later! :)
22:39:28subsetparkCan 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:16subsetpark(and it's not a simple matter of injecting or marking dirty)
22:57:16Araqsubsetpark: a gist would be helpful
22:58:29FromGitter<data-man> @Araq: Oh, welcome back! :)
22:59:40subsetparkAraq: https://ghostbin.com/paste/aa8wp
23:00:08subsetparkThat'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:36Araqtemplate myTemp(body: untyped): typed {.dirty.} =
23:01:37Araq proc x(i: int) =
23:01:37Araq body
23:01:38Araq x(3)
23:01:40AraqmyTemp:
23:01:42Araq echo i + 1
23:01:59Araqcontrary to what you claimed, .dirty fixes it
23:03:30FromGitter<data-man> @Araq: Do you like my idea for scanf?
23:05:23Araqhaven't seen it
23:05:51subsetparkWell, Araq, unfortunately if that's the case there's something different in the actual code ... https://github.com/makingspace/cittadino/tree/noNameNecessary
23:06:10subsetparkYou 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:53FromGitter<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:18AraqautoDelete = false, body: untyped
23:07:27Araq^ won't work.
23:08:40Araqdata-man please work on something important instead.
23:08:51Araqlike unicode.nim, what we talked about.
23:09:29FromGitter<data-man> Yes, I want to use scanf for parsing unicode data
23:10:24FromGitter<data-man> More convenient and simple way.
23:10:56Araqtouche, but how will it work?
23:11:16Araqthe pattern describes an atom, not a "tuple" or an "array"
23:11:38Araq"%d %d %d %d", (a, b, c, d) vs
23:11:44Araq"%d %d %d %d", a, b, c, d
23:11:55Araqsee the problem? nothing gained.
23:12:17Araqthen you start with patterns like %d{4}
23:12:27Araqand off you go into the rabbit whole
23:12:43Araqwhere instead of working on unicode, you invent a parser generator.
23:13:02FromGitter<data-man> I need to expand a tuple var to var.field1, var.field2, etc.
23:13:34Araqfor 10 fields? so you already wasted more time talking here than writing this.
23:13:38FromGitter<data-man> And bind them in the scanf instead of varargs.
23:18:05FromGitter<AjBreidenbach> is there a reason that using allocShared with Channel[Msg] should give me a race condition?
23:19:08FromGitter<AjBreidenbach> I thought `recv` was supposed to block
23:20:58FromGitter<AjBreidenbach> `readBuffer` is behaving non-deterministically
23:22:14FromGitter<ephja> uncertainties makes things more interesting
23:22:25Araqwell if allocShared were so useful with Channel don't you think we would have merged thm?
23:23:02FromGitter<AjBreidenbach> I think that by saying that you're actually giving me too much credit
23:23:55FromGitter<AjBreidenbach> so it's better just to copy everything?
23:29:39Araqwell no, but I know both channels and allocShared have been used extensively and are unlikely to contain bugs
23:30:08Araqso the bugs are likely on your side
23:32:11*CodeVance joined #nim
23:35:55FromGitter<AjBreidenbach> it's gonna be a bitch to figure out
23:38:41*vuLgAr joined #nim
23:56:05FromGitter<AjBreidenbach> I can't get `send` to block
23:57:08Araqwhy would it? it acquires the channel lock and stores data in the underlying queue, then it releases the lock and returns
23:57:56FromGitter<AjBreidenbach> the documentation for `trySend` explicitly states that it does not block, so I thought it would be the same as `recv`
23:59:36FromGitter<AjBreidenbach> plus it passes `false` to `sendImpl`for the argument `noBlock`