<< 20-06-2017 >>

00:02:22skrylar_Araq this is an API situation though
00:02:41skrylar_in the case of GL you have to decide when you make the wrapper (though don't we already have one?)
00:07:36*WhiskyRyan joined #nim
00:15:15*NimBot joined #nim
00:15:18*enthus1ast quit (Write error: Broken pipe)
00:15:19*niv quit (Quit: Ping timeout (120 seconds))
00:15:24*smt_ quit (Remote host closed the connection)
00:15:24*jackv quit (Remote host closed the connection)
00:15:24*aerx_ quit (Remote host closed the connection)
00:15:34*shmup quit (Write error: Broken pipe)
00:15:44*gsingh93 quit (Excess Flood)
00:15:44*jonesz quit (Write error: Broken pipe)
00:15:45*SianaGearz quit (Write error: Broken pipe)
00:15:45*dexterk_ quit (Write error: Broken pipe)
00:15:51*Nobabs27 quit (Remote host closed the connection)
00:15:56*pleiosaur quit (Remote host closed the connection)
00:16:11*gsingh93 joined #nim
00:16:24*niv joined #nim
00:16:31*Pisuke joined #nim
00:17:00*niv quit (*.net *.split)
00:17:00*Calinou quit (*.net *.split)
00:17:01*d10n quit (*.net *.split)
00:17:01*joebo quit (*.net *.split)
00:17:01*shodan45 quit (*.net *.split)
00:17:01*askatasuna quit (*.net *.split)
00:17:06*shodan45 joined #nim
00:17:07*d10n joined #nim
00:17:07*d10n quit (Changing host)
00:17:07*d10n joined #nim
00:17:13*Calinou joined #nim
00:17:25*niv joined #nim
00:18:28*shmup joined #nim
00:18:45*suswombat__ quit (Ping timeout: 276 seconds)
00:19:07*askatasuna joined #nim
00:19:47*myp joined #nim
00:20:08*cjh` quit (Ping timeout: 260 seconds)
00:23:33*mal`` quit (Quit: Leaving)
00:24:35*joebo joined #nim
00:28:54*aerx quit (Quit: WeeChat 1.8)
00:32:58*mal`` joined #nim
00:35:39*Trioxin joined #nim
00:43:01*SusWombat joined #nim
00:49:34libmanhttps://www.reddit.com/r/openwrt/comments/6iao8x/crosscompiling_for_openwrt_with_various/
00:50:56libmanEncore: https://www.quora.com/What-is-a-good-alternative-to-C++/answer/Alex-Libman-2
00:52:51*WhiskyRyan quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
00:53:28*WhiskyRyan joined #nim
01:04:39*Jesin joined #nim
01:08:15*WhiskyRyan quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
01:13:00Trioxinwant to make graphics engine
01:19:58skrylar_needs a lot of math and patience.
01:20:07skrylar_unless its 2d in which case not as much math but still patience
01:21:11Trioxinwhat extra maths?
01:22:17*chemist69 quit (Ping timeout: 258 seconds)
01:22:23*WhiskyRyan joined #nim
01:22:50Trioxinhttps://gamedevelopment.tutsplus.com/tutorials/lets-build-a-3d-graphics-engine-points-vectors-and-basic-concepts--gamedev-8143
01:22:56Trioxinjust algebra. no big deal
01:25:02Trioxinwill probably take forever but will be fun. first things first though. need to draw
01:28:30Trioxinstart with IUP?
01:31:54Trioxinshould what I use to draw meet any specific criteria?
01:32:32TrioxinI wouldn't think I'd need to code that since it's already been done.
01:34:38*chemist69 joined #nim
01:36:33*demi- quit (Ping timeout: 255 seconds)
01:36:52*demi- joined #nim
02:08:41Trioxinnimx isn't working. I posted an issue
02:12:09*WhiskyRyan quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
02:21:34*WhiskyRyan joined #nim
02:44:29*rauss quit (Quit: WeeChat 1.8)
02:49:52*xet7 quit (Ping timeout: 255 seconds)
02:50:58*pilne quit (Quit: Quitting!)
03:04:35*WhiskyRyan quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
03:06:18*xet7 joined #nim
03:17:17*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
03:54:19*Trioxin2 joined #nim
03:54:32*Trioxin quit (Ping timeout: 240 seconds)
04:03:18*def- quit (Quit: -)
04:08:20*libman quit (Quit: Connection closed for inactivity)
04:16:52*def-pri-pub quit (Quit: leaving)
04:21:25*def- joined #nim
05:18:28*yglukhov joined #nim
05:21:33*Trioxin2 quit (Ping timeout: 255 seconds)
05:22:32*yglukhov quit (Ping timeout: 240 seconds)
05:48:33*Vladar joined #nim
05:51:39*Vi- joined #nim
06:11:25*xet7 quit (Remote host closed the connection)
06:14:36*xet7 joined #nim
06:15:57*couven92 joined #nim
06:16:20FromGitter<ephja> nimx is great. I just couldn't bother to use the latest compiler revision that it works with at this point in time :-p
06:30:03FromGitter<ephja> I wonder how relevant the vulkan validator layer is with the presence of moderm metaprogramming features
06:42:39*Arrrr joined #nim
06:49:52*skrylar_ quit (Quit: Textual IRC Client: www.textualapp.com)
06:53:29*nsf joined #nim
07:08:09Vi-Can I somehow get a __declspec(dllimport) on a variable? After some headaches I managed to get the opengl wrapper to use glew so I can do this now:
07:08:14Vi-var GLEW_KHR_debug {.importc: "__imp____GLEW_KHR_debug"}: GLboolean
07:08:20Vi-but the __imp__ prefix bothers me a bit
07:11:51Araqyou can use Nim's dynlib module for this but it has no compiler support
07:13:01Vi-Oh I did try this: var GLEW_KHR_debug {.dynlib: "glew32.dll", importc: "__GLEW_KHR_debug"}: GLboolean
07:13:32Vi-but still getting a linker error
07:13:58FromGitter<ephja> do dll's really support variables?
07:14:03Vi-yes they do
07:15:45Vi-msvc adds the dllimport for functions automatically but not for variables, I guess thats why this is not working here...
07:15:47FromGitter<ephja> why are you using GLEW? for conditional loading?
07:16:04Vi-yea
07:17:13Vi-Suppose I'll just write a macro for these... I was just wondering if I could add the __declspec(dllimport) instead of typing the __imp__ prefix myself
07:19:56FromGitter<ephja> I dunno if you can. isn't this flag exposed through a function?
07:20:28Vi-Not that I know of, thats why I'm asking ^^
07:26:52Araqyou can also play with the .codegenDecl pragma for variables
07:30:43*yglukhov joined #nim
07:32:23*chrishel_ joined #nim
07:34:56*chrisheller quit (Ping timeout: 260 seconds)
07:36:19*Vi- quit (Ping timeout: 246 seconds)
07:37:06FromGitter<andreaferretti> We are again over 1000 issues! :-D
07:37:24FromGitter<andreaferretti> I tried this filter to figure out which ones are actually language issues
07:37:32FromGitter<ephja> do we need to declare function pointers instead in order to implement conditional extension loading?
07:37:39FromGitter<andreaferretti> `is:issue is:open -label:"Error messages" -label:"Feature" -label:"question" -label:"Tools" -label:"Stdlib" -label:"Documentation" -label:"postponed" `
07:37:57FromGitter<andreaferretti> currently it returns 594 issues
07:38:20FromGitter<andreaferretti> more than I would think, but many issues still do not have labels, so there may be many false positives
07:39:27ArrrrAdd crash and high priority
07:40:27FromGitter<ephja> but aren't these label exlusions?
07:40:59FromGitter<andreaferretti> yep
07:41:13FromGitter<andreaferretti> there are 29 `Crash` and 19 `High priority`
07:41:35FromGitter<ephja> I'm still annoyed by the inability to track relevant threads on the forum
07:41:59FromGitter<andreaferretti> I would like to help by adding some labels, but I do not have rights to do so
07:42:10FromGitter<ephja> we are funding one more dev now though IIRC, so that's nice
07:42:22FromGitter<andreaferretti> is there a way to grant such right on github without giving full access?
07:48:45Araqandreaferretti: I can give you access rights, I trust you enough
07:52:23FromGitter<ephja> Vi-: I'm thinking about ways to implement conditional loading again
07:52:57FromGitter<ephja> Araq: should we migrate to proc pointers in order to support this?
07:54:34Araqephja: I'm not a fan, can't we do avaliable(openglProc): bool somehow instead?
07:55:06Araqthe compiler produces the proc vars for us, that's quite a nice thing
07:56:12FromGitter<andreaferretti> @Araq thank you, I would appreciate it. I will just add labels for now :-)
07:57:37FromGitter<ephja> would it be necessary to modify the compiler? if so, where do I look?
08:00:09FromGitter<ephja> people are busy, and I can never find what I want in the compiler source
08:00:31Araqephja: it's in compiler/cgen.nim
08:00:45Araqand a bit complex :-/
08:02:56*ldleworker quit (Excess Flood)
08:03:04*ldlework joined #nim
08:03:04*ldlework quit (Changing host)
08:03:04*ldlework joined #nim
08:03:51Araqephja: but does it require a codegen change? I think 'avaliable' could get away with an .emit
08:05:25FromGitter<ephja> I did suggest adding support from the user side before, which currently requires writing to a file at compile time and then reading it at run time if I'm not mistaken
08:05:31FromGitter<ephja> ok
08:42:28*sakalli joined #nim
08:49:31*irrequietus joined #nim
08:52:56*PMunch joined #nim
08:59:18FromGitter<TiberiumN> @andreaferretti also in your list of not-language issues (labels) you forgot RFC
08:59:42FromGitter<TiberiumN> without RFC it return 573 issues
09:06:58*literal_ is now known as literal
09:29:19FromGitter<andreaferretti> 568 with `is:issue is:open -label:"Error messages" -label:"Feature" -label:"question" -label:"Tools" -label:"Stdlib" -label:"Documentation" -label:"postponed" -label:"S: Waiting on author" -label:"RFC" `
09:29:27FromGitter<andreaferretti> still a lot, though
09:30:21AraqI fixed 26 bugs by merging zahary's branch :P
09:32:40FromGitter<TiberiumN> ohh
09:32:43FromGitter<TiberiumN> so many fixes
09:32:52FromGitter<TiberiumN> love it
09:32:59FromGitter<TiberiumN> (https://files.gitter.im/nim-lang/Nim/u0WP/image.png)
09:40:41FromGitter<andreaferretti> great! :_D
09:49:05ArrrrDoes it exist a shortcut for 'del seq, find(seq, element)' that i'm no aware of?
09:52:49AraqArrrr: nah
09:52:49*gangstacat quit (Ping timeout: 246 seconds)
09:55:26*gangstacat joined #nim
09:59:08*smt__ quit (Read error: Connection reset by peer)
10:02:26*smt joined #nim
10:10:57*smt quit (Read error: Connection reset by peer)
10:14:26*rokups joined #nim
10:27:31FromGitter<ephja> ``````
10:28:09*smt joined #nim
10:29:08FromGitter<ephja> couldn't you do inline highlighting?
10:30:24*PMunch quit (Ping timeout: 260 seconds)
10:34:18*kunev quit (Ping timeout: 255 seconds)
10:34:59FromGitter<ephja> now, was there something else that didn't work for typedescs?
10:36:17*PMunch joined #nim
10:36:29*kunev joined #nim
10:38:46*chemist69 quit (Ping timeout: 255 seconds)
10:39:10*chemist69 joined #nim
10:59:29PMunchHmm, I'm trying to use the Gtk/Gdk bindings
10:59:35PMunchAnd I need to set a color
10:59:57PMunchThey are defined as 0-65536 guint16
11:00:28PMunchThis guint16 is set as equal to int16 in the bindings for some reason, so I can't set it to 65536
11:02:22*Snircle joined #nim
11:02:58AraqPMunch: fix the bindings please
11:03:19Araqprobably a holdover from the times where Nim lacked unsigned integer types
11:03:33PMunchAh
11:04:12euantorhad a minor success story with Nim this week. An old third party service we use at work refuses to work on Windows Server 2012 R2 for whatever reason. I replicated what it did in ~200 lines of Nim and it uses 25% of the memory of the old version (down from 4.2MB to ~920KB) :)
11:15:17Araqeuantor: yay, cool :D
11:17:48PMunchMan, Gtk is full of guints...
11:29:53*sakalli quit (Quit: leaving)
11:30:18FromGitter<dandevelop> Taking a look here: https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-codegendecl-pragma can anyone shed more light on how the format strings work in that example -> $# $#$# ?
11:31:59FromGitter<andreaferretti> @Araq I have tagged a few issues. Would it be a problem to add a couple of labels, such as `macros` or `effect system`?
11:32:40Araqno, of course not
11:33:25Araqdandevelop: for vars $1 is the type and $2 is the name, for procs it's return type, name, parameter list
11:33:29Araqin that order.
11:36:15FromGitter<dandevelop> @Araq: so this: ----> a {.codegenDecl: "$# progmem $#".}: int <---- would generate this: int progmem a ?
11:36:31Araqyes
11:37:22FromGitter<dandevelop> Thank you, is this specified anywhere in the docs? (for vars $1 is the type and $2 is the name, for procs it's return type, name, parameter list)
11:38:52dave24how can I convert a BiggestInt to a uint8?
11:39:46Araqdandevelop, no a PR would be nice
11:40:04Araqdave24: uint8(...)?
11:41:32dave24oh, well that was easy
11:41:35dave24thanks
11:43:49dave24is there documentation for that? how does it behave in case of overflow?
11:48:44FromGitter<dandevelop> @Araq: should I do the PR on this file? https://github.com/nim-lang/Nim/blob/9303a02d6bf68ac6e64e3ee0c4a018ab54c7ee99/doc/manual/pragmas.txt#L1008
11:52:24Araqyes
11:52:44Araqdave24: I don't know :-) it should raise a RangeError
11:56:10dave24ok, thanks
11:58:09*stefan2 joined #nim
11:58:17*stefan2 is now known as Guest58895
11:59:47Guest58895PMunch, in the GTK3 bindings the color values are just uint16, that should be OK.
12:00:03PMunchThese are the gtk2 bindings though
12:01:35Guest58895Than you have to fix it :-)
12:03:59Guest58895Bye, salewski. (no idea why WeeChat calls me guest...)
12:04:02*Guest58895 quit (Quit: WeeChat 1.4)
12:15:15FromGitter<dandevelop> @Araq: will this: --> proc myinterrupt() {.codegenDecl: "__interrupt $# $#$#".} <-- generate this: __interrupt void myinterrupt() ?
12:15:58PMunchFinally!
12:22:52PMunchhttps://github.com/nim-lang/gtk2/pull/22
12:23:15PMunch1145 lines changed :S
12:29:48*Amun_Ra quit (Quit: さよなら)
12:31:06FromGitter<dandevelop> @Araq: not sure if this is ok but I submitted a PR here: https://github.com/nim-lang/Nim/pull/6006
12:31:14*Amun_Ra joined #nim
12:31:46koppehMhh.. question about enums.
12:31:56koppehI have defined an enum like so:
12:32:05koppehShaderType* = enum GLenum
12:32:14koppeh FragmentShader = GL_FRAGMENT_SHADER
12:32:39koppehAnd so on. I can not convert from ShaderType to GLenum, apparently?
12:32:45koppehBut if I add {.pure.}, it works?
12:33:13*couven92 quit (Quit: Client disconnecting)
12:43:34koppehOut of curiosity, why can enums be marked as {.pure.} but not procs?
12:45:12koppehI suppose this is to avoid forcing a specific typing style on a user of a lib for example, but..
12:45:47koppehshader.compile() vs shader.compileShader() ... or compile(shader) vs compileShader(shader)
12:47:51Arrrryou can use this: `from module import nil`
12:52:09FromGitter<andreaferretti> @Araq Does the `tools` label apply to `nim doc` and `nim suggest` or should I use different ones?
12:56:07PMunchHmm, why is gtk_entry_set_alignment not in the wrapping?
13:08:04*vlad1777d joined #nim
13:14:58*salewski joined #nim
13:16:15salewskiPMunch, that one is also in the GTK3 wrapper!
13:16:36salewskiAre you using GTK2 because of Windows or Mac?
13:17:18PMunchNo
13:18:15PMunchI'm using Gtk2 partially because it is what I had installed, partially because it's what I've used before, and I prefer the look of Gtk2.
13:19:25salewskiFor Linux there may exist GTK3 themes that look like GTK2.
13:20:06salewskiI think the Nim GTK2 wrapper has some missing stuff and some bugs.
13:20:43salewskiIt is very old, and Dom was the only real user and tester with Aporia.
13:21:09PMunchHmm, guess I should switch to Gtk3 then..
13:21:16PMunchThat's the second UI switch now..
13:22:03PMunchWait, which bindings are there for Gtk3?
13:22:06salewskiNow, beside the GTK3 wrapper we even have a GObject introspection based high level wrapper.
13:22:49salewskiGTK3 low level is at github.com/ngtk3
13:23:18salewskiHigh level wrapper is at github.com/stefansalewski
13:23:59salewskiBut the later is nearly untested still.
13:25:00PMunchHmm
13:26:03salewskiThe low level one should be fine! It is for GTK 3.20 created with c2nim.
13:26:39salewskiIt is used with my NEd Nim editor and with the chess game.
13:27:07*rauss joined #nim
13:27:21salewskiThe gobject introspection based bindings will need much testing unfortunately.
13:27:52PMunchIt's not in Nimble?
13:28:11salewskiNo, due to name conflicts.
13:28:27salewskiAnd due to no one interested in using it at all.
13:29:15salewskiSee https://github.com/StefanSalewski/nim-chess3 for install instructions.
13:30:38*rauss quit (Client Quit)
13:31:34*user0 joined #nim
13:31:44FromGitter<andreaferretti> what name conflict?
13:32:04salewskicairo, pango, glib2...
13:33:49salewskiThe Nim GTK3 bindings have many modules, more than 12...
13:34:19salewskiAnd using names like cairo3 or glib3 makes no sense for these...
13:34:29FromGitter<andreaferretti> I see
13:35:38salewskiI have never tried to resolve the name conflicts, as there are still no people really inteested in it.
13:36:22salewskiAnd for the high level wrapper it is better, name is nim-gi, so no toplevel name conflict.
13:37:28salewskiWhen Manning finally releases Doms's book, I will read the nimble chapter and make nimble nim-gi package.
13:37:41*couven92 joined #nim
13:38:10FromGitter<TiberiumN> Manning is too slow for some reason
13:39:00FromGitter<TiberiumN> Can someone help me with this crash (latest devel): ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59492573a44c60fa4c4497db]
13:39:40FromGitter<TiberiumN> from github nim issue issue
13:39:46*vlad1777d quit (Quit: Leaving)
13:39:56FromGitter<TiberiumN> Windows 10 x64 Creators Update
13:41:17salewskiBye...
13:41:20*salewski quit (Quit: WeeChat 1.4)
13:41:24FromGitter<TiberiumN> ?
13:41:50*vlad1777d joined #nim
13:43:15FromGitter<qqtop> linux says 2208987402
13:45:24FromGitter<TiberiumN> let me google this issue
13:45:55FromGitter<TiberiumN> This - ttps://github.com/nim-lang/Nim/issues/5704
13:46:25FromGitter<andreaferretti> uh? For me it works and prints `2208988800`
13:46:36FromGitter<TiberiumN> platform-specific bugs, yay
13:46:37FromGitter<andreaferretti> Ubuntu 16.04 with latest devel
13:46:44FromGitter<TiberiumN> It crashes for me on Win...
13:47:07vlad1777dHello to all =) Can I somewhere see old design of "nim-lang.org" website?
13:47:16FromGitter<TiberiumN> yes, probably
13:47:22vlad1777dMaybe somebody has screenshots?
13:47:43FromGitter<TiberiumN> Here you are - http://web.archive.org/web/20161201001409/https://nim-lang.org
13:47:51FromGitter<TiberiumN> There's a lot of snapshots at web archive
13:50:40FromGitter<TiberiumN> hmm, on Win it fails with getLocalTime failed assert
13:51:04koppehArrrr: Still doesn't quite answer my question. Naming a proc "link" without a {.pure.} equivalent means it'll show up in auto completion where I really only intend it to be called as program.link().
13:52:18koppehOh wait you're saying program.link() would still work if I don't import anything?
13:53:36koppehBut then I feel like I'd want to do "import foo except <all of the procs I would want to be called with member syntax>"
14:01:25*smt quit (Read error: Connection reset by peer)
14:01:37*smt joined #nim
14:08:11*krux02 joined #nim
14:13:30PMunchHmm, so all of the modules are split..
14:25:16*rauss joined #nim
14:31:06*rauss quit (Ping timeout: 268 seconds)
14:31:34*rauss joined #nim
14:39:28*couven92 quit (Ping timeout: 240 seconds)
14:43:42FromGitter<krux02> Hello people, how are you?
14:47:09*chemist69 quit (Ping timeout: 276 seconds)
14:49:15*chemist69 joined #nim
14:50:57jmkrb/uffer 38
14:51:05jmkrsorry :X
14:56:14LyndsySimonIs there any interest here in creating a Nim meetup in Virginia? I'm in Charlottesville, but wouldn't mind driving to NoVA or Richmond if there are more users there.
15:03:07*yglukhov quit (Remote host closed the connection)
15:08:43koppehIs it possible to attach constant values to types?
15:09:37koppehI currently have some generic code that does a when check for each valid type.
15:09:51koppehwhen T is Program: const getiv = glGetProgramiv
15:10:05koppehBut I'm wondering if I could get rid of that and just do T.getiv ..?
15:13:58*yglukhov joined #nim
15:15:31*yglukhov quit (Remote host closed the connection)
15:16:55ArrrrYou can do `proc id*(t: typedesc[MyType]): int = 5`
15:17:57koppehHmm, yes, I saw that before.
15:18:32koppehAnd with a macro or template one could make this even smaller.
15:27:49*couven92 joined #nim
15:47:55*ofelas joined #nim
16:25:56FromGitter<ephja> I recall suggestions for creating proc aliases a long time ago
16:26:08FromGitter<ephja> no one thought of using 'const' for that apparently
16:27:09*yglukhov joined #nim
16:28:59*yglukhov quit (Remote host closed the connection)
16:29:39*yglukhov joined #nim
16:34:02*yglukhov quit (Ping timeout: 246 seconds)
16:39:58*yglukhov joined #nim
16:42:16*pilne joined #nim
16:52:51FromGitter<TiberiumN> How can I split string into chunks of 2 characters?
16:53:05FromGitter<TiberiumN> Like convert "HRHDDT" to @["HR", "HD", "DT"]
16:58:31FromGitter<TiberiumN> This is my naive solution: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59495436bf1bfe6770d007d7]
17:02:14FromGitter<ephja> define an iterator if you want to reuse it
17:03:10Vladaryep, iterator is the way to go
17:03:46Vladarsomething like that https://pastebin.com/FjaBtTuS
17:06:53*jsgrant- joined #nim
17:09:10*yglukhov quit (Remote host closed the connection)
17:10:33*yglukhov joined #nim
17:13:12FromGitter<TiberiumN> Vladar: big thanks!
17:17:23Vladarnp
17:26:01*yglukhov quit (Remote host closed the connection)
17:29:17*jsgrant- quit (Quit: Peace Peeps. o/ If you need me asap, message me at msg[(at)]jsgrant.io & I'll try to get back to you within 24-36 hours.)
17:32:00*jsgrant- joined #nim
17:33:50*jsgrant- quit (Remote host closed the connection)
17:35:04*smt quit (Read error: Connection reset by peer)
17:35:16*smt joined #nim
17:36:22*chemist69 quit (Ping timeout: 255 seconds)
17:36:33*jsgrant- joined #nim
17:46:10*aerx joined #nim
17:48:46*aerx quit (Read error: Connection reset by peer)
17:50:15*aerx joined #nim
17:54:56*chemist69 joined #nim
18:01:57*Vi- joined #nim
18:03:35*yglukhov joined #nim
18:14:25*WhiskyRyan joined #nim
18:21:31PMunchMan, I need to write genui for gtk..
18:38:06*smt quit (Read error: Connection reset by peer)
18:38:11*smt_ joined #nim
18:44:20*jsgrant- quit (Quit: Peace Peeps. o/ If you need me asap, message me at msg[(at)]jsgrant.io & I'll try to get back to you within 24-36 hours.)
18:46:41*jsgrant- joined #nim
18:47:07*rusua joined #nim
18:48:50*jsgrant- quit (Remote host closed the connection)
18:51:18*WhiskyRyan quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:51:19subsetparka) Does anyone have personal experience with einheit? b) is there a way to only run a certain test or suit in unittest?
18:52:36*WhiskyRyan joined #nim
18:53:59*WhiskyRyan quit (Client Quit)
18:56:06*WhiskyRyan joined #nim
18:57:52*WhiskyRyan quit (Client Quit)
19:00:41*couven92 quit (Ping timeout: 246 seconds)
19:00:46PMunchIs there way to get the reference of an object?
19:01:06*jsgrant- joined #nim
19:01:06PMunchI want to have one sequence of packed structures, and one sequence of references to these structures
19:01:12PMunchTo avoid copying the data
19:01:15*Arrrr quit (Read error: Connection reset by peer)
19:02:47AraqPMunch: addr operator?
19:03:04PMunchHmm, an untracked pointer?
19:03:13PMunchWouldn't that be a bad idea?
19:03:50*jsgrant- quit (Remote host closed the connection)
19:04:00*dddddd joined #nim
19:04:22Araqpart the 'colony' data structure to Nim and don't use a 'seq'
19:04:27Araqand then 'addr' is safe
19:04:47PMunchcolony?
19:04:57Araqlook it up
19:06:31*jsgrant- joined #nim
19:10:28*WhiskyRyan joined #nim
19:10:44*yglukhov quit (Remote host closed the connection)
19:11:27*yglukhov joined #nim
19:15:00*WhiskyRyan quit (Client Quit)
19:15:46*yglukhov quit (Remote host closed the connection)
19:16:28*WhiskyRyan joined #nim
19:17:47*yglukhov joined #nim
19:19:35PMunchHmm, cstring to string?
19:19:46def-PMunch: $?
19:19:51PMunchDur
19:20:06Araqdef-: can you please review the makefile change
19:20:09PMunchI'm working with Gtk, so I forgot there exists nice things
19:20:14def-Araq: sure, link?
19:21:05def-I guess it's this one? https://github.com/nim-lang/Nim/pull/5830
19:21:12Araqhttps://github.com/nim-lang/Nim/pull/5830/files
19:21:28def-Oh, you wrote my name there. I should set up notifications
19:24:20*WhiskyRyan quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:26:51*WhiskyRyan joined #nim
19:29:27*WhiskyRyan quit (Client Quit)
19:34:30FromGitter<Varriount> PMunch: GTK has no nice things?
19:34:45PMunchJust kidding :P
19:34:55PMunchIt's actually fairly easy to work with
19:35:07PMunchBut it is very C++ like, which is weird when working with Nim
19:36:30FromGitter<Varriount> Even though it's written in C?
19:39:00*WhiskyRyan joined #nim
19:40:10*WhiskyRyan quit (Client Quit)
19:40:35*rokups quit (Quit: Connection closed for inactivity)
19:42:52PMunchErr, I meant Cish
19:42:53PMunch:P
19:42:59PMunchI was doing wxWidgets earlier
19:43:03PMunchWhich is C++
19:54:13*yglukhov quit (Remote host closed the connection)
20:01:29*yglukhov joined #nim
20:03:41*kier quit (Remote host closed the connection)
20:04:17*jsgrant- quit (Quit: Peace Peeps. o/ If you need me asap, message me at msg[(at)]jsgrant.io & I'll try to get back to you within 24-36 hours.)
20:04:55*kier joined #nim
20:06:22*jsgrant- joined #nim
20:07:31*Vi- quit (Ping timeout: 240 seconds)
20:13:48*jsgrant- quit (Quit: Peace Peeps. o/ If you need me asap, message me at msg[(at)]jsgrant.io & I'll try to get back to you within 24-36 hours.)
20:15:31PMunchI really need to create genui for Gtk...
20:15:39PMunchIt's so much nicer to use :P
20:16:28*jsgrant- joined #nim
20:17:33AraqGtk >> wxWidgets?
20:17:53PMunchWell wxWidgets uses native controls across all platform
20:18:15PMunchSo it uses Gtk on Linux, MSW (or whatever it's called) on Windows, and Cocoa on Mac I believe
20:19:36PMunchBut since the toolkits aren't exactly 1:1 on features some things don't work properly, and other things work on some platforms and not all.
20:19:38*Vladar quit (Quit: Leaving)
20:20:17PMunchSo for what I was working on it just didn't work out
20:21:48Araqwhat problems did you encounter?
20:26:34PMunchI wanted to change the background colour of textviews
20:27:26PMunchAnd various issues with scrollbars
20:29:17*jsgrant- quit (Quit: Peace Peeps. o/ If you need me asap, message me at msg[(at)]jsgrant.io & I'll try to get back to you within 24-36 hours.)
20:31:49*jsgrant- joined #nim
20:33:50*jsgrant- quit (Remote host closed the connection)
20:36:22*jsgrant- joined #nim
20:42:11subsetparkIs dom96 around?
20:42:35dom96I is here
20:43:30subsetparkI am in nimble hell :(
20:44:33*rauss quit (Quit: WeeChat 1.8)
20:44:55subsetparkI have one binary package that relies on two library packages - i cannot for the life of me organize them such that a) nimble dump raises no errors; b) the binary package is able to import all the modules from the two library packages
20:45:54*couven92 joined #nim
20:46:01dom96subsetpark: D:
20:46:07dom96What's the layout of your packages?
20:46:24dom96I assume the errors you're getting aren't errors but namespacing warnings?
20:46:36subsetparkcorrect
20:48:33subsetparkhttps://www.irccloud.com/pastebin/arzn9vYs/
20:49:43subsetparkThat produces no warnings - but when the binary package, which includes that as a dependency, tries to import 'syphus' it fails
20:50:47dom96You can either "import syphus/syphus"
20:50:54dom96or get rid of that 'syphus' directory
20:51:05dom96just have syphus.nim at the top-level
20:51:16dom96other suphus modules would still need to be in a 'syphus' directory though
20:54:25PMunchAh, finally got my little notes application working as I wanted :)
20:59:39subsetparkdom96: I see - so the purpose of the 'module-name' directory is for all OTHER modules...
21:00:08subsetparkso if I have syphus.nim at top-level, and (eg) syphus_support.nim in the 'syphus' directory - can i still 'import syphus_support' inside of syphus.nim ?
21:00:09FromGitter<dandevelop> Is there any way to make a nim file automatically compile as objective C?
21:00:34dom96subsetpark: nope, you'd also need to specify the directory.
21:00:46dom96For modules that are in the same directory you don't need to specify the directory
21:01:45subsetparkhm i see
21:02:14FromGitter<TiberiumN> @dandevelop I think you can't compile only one file as ObjC, and others as another languages
21:02:21FromGitter<dandevelop> I can rephrase that: is there any way to make the nim compiler automatically translate a file to objective-C instead of C?
21:02:33FromGitter<TiberiumN> yes
21:02:42FromGitter<TiberiumN> "nim c file.nim"
21:02:45FromGitter<TiberiumN> c is not a command
21:02:53FromGitter<TiberiumN> c means C language
21:02:57FromGitter<TiberiumN> so just do "nim objc file.nim"
21:03:03FromGitter<dandevelop> What if I have multiple files in the project?
21:03:21FromGitter<dandevelop> And some of those should be translated to C and others to objective-c ?
21:03:27FromGitter<TiberiumN> oh, then I don't know
21:03:34FromGitter<TiberiumN> why do you want that?
21:04:33subsetparkdom96: in general, for larger projects, is that how you'd recommend it? projectname.nim and projectname/ at the top level, and all imports in projectname.nim are namespaced: import projectname.support1, projectname.support2
21:04:36subsetpark?
21:04:40FromGitter<dandevelop> I thought of using an existing C library and somehow my head thought that I should specify C as a translation target for the nim compiler. But maybe those C libraries would also work fine if I do nim objc
21:04:53FromGitter<TiberiumN> yes, they probably would
21:04:57FromGitter<TiberiumN> just try it yourself :)
21:05:03dom96subsetpark: yep.
21:05:29subsetparkok, very good to know... that's been a real source of confusion for a while D:
21:05:47PMunchhttp://serv.peterme.net/uploads/note-example2.png
21:05:54PMunchThat's what I was trying to do Araq
21:05:56dom96subsetpark: Hrm, any ideas how we can make that easier to understand? :)
21:06:17dom96Maybe I should create a simple barebones Nimble package.
21:06:27subsetparkdom96: I think it's just a matter of giving the readme and the warnings emitted by nimble a once-over.
21:06:30PMunchThat would be great dom96
21:06:40dom96subsetpark: PRs welcome :)
21:06:54subsetparkyes, now i've got two features to add!
21:07:51PMunchAll the text is selectable so I can easily copy it. The top left buttons changes sort order, the first combobox selects if it should sort by Time or Source, the second combobox selects a source (to only view one), and the text entry below is a search bar for the current selection.
21:08:24PMunchIt also allows images
21:11:24PMunchAnd Nim is brilliant, all this is under 250 lines of code :)
21:11:38PMunchEven factoring in the horrible mess that is GUI code...
21:13:54subsetparkdom96: I think in general the play will simply to be more prescriptive - there are too many options now
21:14:18*jsgrant- quit (Quit: Peace Peeps. o/ If you need me asap, message me at msg[(at)]jsgrant.io & I'll try to get back to you within 24-36 hours.)
21:14:35PMunchAt least a minimal example would be nice :)
21:16:26*couven92 quit (Quit: Client Disconnecting)
21:16:40dom96subsetpark: Hrm, you mean we should tell people what they should do instead of saying "You can either do this or this?"
21:16:46subsetparkExactly
21:16:55*jsgrant- joined #nim
21:17:15PMunchAt least for me when I get to package creating I just want to get it done
21:17:28PMunchSo having a sample layout to copy, at least for simple packages, would be great
21:18:51*jsgrant- quit (Remote host closed the connection)
21:19:20subsetpark"You should have a single .nim file with the same name as the nimble file at the top level. You should have any other project source files in the source directory, (which also has the same name by default, but can be specified in the case of hybrid packages). Any modules you import in your top-level .nim module will need to be namespaced with the source directory name."
21:19:55subsetparkClarity is reassuring :)
21:23:02FromGitter<TiberiumN> what, what srcDir is for?
21:23:55subsetparksrcDir is for specifying the name of the directory that contains all secondary source files required by the project .nim file
21:24:11subsetparkif the directory doesn't share the same name as the project file
21:27:58subsetparkAcctually - I'm wrong about that
21:28:13subsetparkIt's not even necessary then, because the secondary source dir will be namespaced in the top-level imports
21:28:24dom96Ideally 'nimble init' should create a directory layout as well
21:28:32subsetparkSo it's only necessary when the "top-level" directory is not actually at the top-level
21:40:33*yglukhov quit (Remote host closed the connection)
21:45:38*fox2 joined #nim
21:45:56fox2wow this ought to be a cool channel
21:47:40dom96hey fox2 :)
21:48:45*xet7 quit (Quit: Leaving)
21:49:08fox2yo hey guys
21:49:11fox2:-)
21:49:48subsetparkSo - when diagnosing "not thread-safe" warnings, the topmost warning says "Foo is not GC-safe as it calls 'Bar'" - but how do I know what global variables are accessed in Bar, especially if I can't tell by reading the proc code?
21:51:01fox2tricky...
21:56:10dom96subsetpark: You ask Araq nicely to improve the error messages :P
21:56:57subsetpark:/
21:59:10fox2how about a reeducation - in that error messages are a real nice cool thing and you don't wanna live without "errors" anymore ?
21:59:54PMunchOh hi fox2 :)
22:01:10fox2greetz out to ya, PMunch !
22:02:19*nsf quit (Quit: WeeChat 1.7.1)
22:02:26subsetparkOk, now I think I'm just doing something wrong... Even marking Bar as {.gcsafe.} doesn't get rid of those errors
22:03:22subsetparkAh - I was. I needed to mark the forward declaration with a pragma :)
22:06:24subsetparkSo now it's just the original mystery...
22:10:49subsetparkWhoa. Weird - if I move the proc up so it doesn't need a forward declaration, the error goes away. dom96 is that supposed to happen?
22:20:36*NimBot joined #nim
22:22:45*ofelas quit (Quit: shutdown -h now)
22:22:51*fox2 quit (Quit: Konversation terminated!)
22:24:38*pleiosaur joined #nim
22:32:10PMunchAh, added in highlighting of hits now :)
22:58:02FromGitter<philip-wernersbach> Hey everyone, what's the Nim-y way to specify a return type that can be null, when the underlying type doesn't support null?
22:58:38FromGitter<philip-wernersbach> For instance, a string can be null, so that's easy, but an int cannot be null
22:58:54FromGitter<philip-wernersbach> So I need a way to signal "absence of value"
22:59:21subsetparkphilip-wernersbach - generally you are advised to use setinel values or options, as is appropriate
22:59:32subsetparkI like options, though they can be a bit heavy for really low-level stuff
22:59:38FromGitter<philip-wernersbach> sentinel values?
23:00:04subsetparkyeah, like - function and caller both agree that -1 actually means "not present"
23:00:30subsetparkthen you can declare a const NOT_PRESENT* = -1 and check for that instead
23:01:20FromGitter<philip-wernersbach> Oh I see, that's not possible here. Normally I would do that, but I need the full range of int data types.
23:01:21*irrequietus quit ()
23:01:45FromGitter<philip-wernersbach> That would also present an issue for boolean values
23:01:52subsetparkFor one-off things you could also use tuples to create tagged values - have an enum {ok, error} - and return a tuple (error, 0) or (ok, <insert value here>)
23:02:28subsetparkbut i would recommend you look into options first - they're in the standard lib and work quite well
23:02:48FromGitter<philip-wernersbach> That's a good idea, but I might as well use options like you say.
23:03:04subsetparkyeah, I use them all over the place
23:03:23FromGitter<philip-wernersbach> Are there examples of Nim projects using options? I know how they work, but I don't really know "best practices" so to speak
23:03:24subsetparkThey're particularly good if you want to start using them as a poor man's monad
23:04:09subsetparkHere's an example from a program of mine: https://github.com/subsetpark/ad/blob/master/src/parse.nim
23:10:04*dexterk_ joined #nim
23:11:32*dexterk quit (Ping timeout: 260 seconds)
23:14:34FromGitter<philip-wernersbach> Thanks!
23:14:40FromGitter<philip-wernersbach> Interesting
23:18:20*PMunch quit (Quit: leaving)
23:20:26*Trioxin joined #nim
23:34:56*Trioxin2 joined #nim
23:35:01*Trioxin quit (Ping timeout: 255 seconds)
23:36:40*rusua quit (Quit: Connection closed for inactivity)
23:51:01*dddddd quit (Ping timeout: 240 seconds)
23:52:50*krux02 quit (Remote host closed the connection)