<< 16-02-2017 >>

00:07:20*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
00:17:40demi-if a package defines its own `passL` pragma, is there anyway i can over-ride that? it is breaking my linker
00:19:55demi-i know i can turn off all linking and do it myself but i really rather not do that if i can avoid it
00:20:58ftsfdemi-, i don't think so, other than modifying the package
00:21:05demi-:(
00:21:33demi-that is very unfortunate, this is making me want to just re-wrap the package which is kinda terrible as well as that would be the third wrapper
00:22:23ftsfwell if there's a problem with the package, you should fix the package and submit a PR i guess?
00:22:35ftsfwhat is it trying to link that's the problem?
00:24:26demi-I was looking at terminal interface libraries, there is ncurses which i could use but is pretty crap -- i saw there were two termbox wrappers for nim; however one (https://github.com/fowlmouth/nim-termbox) is only implmeneted for linux and the other (https://notabug.org/vktec/nimbox/src/master) is passing flags that my linker doesn't recognize
00:25:06demi-the first one would be easy to fix to work for os x but has been inactive for so long that i don't know if it is worth trying to PR and hope it gets patched.
00:25:32demi-the second would also be an easy fix but that would mean creating an account with that service to do the PR which isn't worth it
00:25:41Araqdemi- fork it :-)
00:26:39demi-Araq: sure, but it would still yield yet another wrapper for this library, which i don't know how i feel about vs just running c2nim over the C headers and using that myself
00:27:14demi-it isn't something i want to maintain
00:27:18Araqa fork is not "yet another wrapper" :-)
00:27:35demi-it still requires maintenance
00:30:16ftsfthat's why you should create a PR and get the current maintainer to include your change
00:32:05demi-but in the mean time there is no proper way for me to install it without it becoming a recognized fork
00:32:13demi-and thus require me to maintain it
00:41:09*Kingsquee joined #nim
00:56:12*couven92 quit (Quit: Client disconnecting)
01:03:59*zachcarter joined #nim
01:08:10*pregressive joined #nim
01:09:08*pregressive quit (Read error: Connection reset by peer)
01:09:38*pregressive joined #nim
01:10:09FromGitter<Varriount> demi-: What's the problem with making an account? It's not like it usually takes that long.
01:10:21*pregressive quit (Read error: No route to host)
01:10:21demi-i don't want to
01:10:30demi-i'm not going to use an account there
01:10:51*pregressive joined #nim
01:12:49*devted joined #nim
01:14:49*pregressive quit (Ping timeout: 240 seconds)
01:22:01*krux02 quit (Quit: Leaving)
01:29:23*Snircle joined #nim
01:35:17*vlad1777d quit (Quit: Leaving)
01:52:55*roygbiv joined #nim
01:59:03*ftsf quit (Ping timeout: 256 seconds)
01:59:28*ftsf joined #nim
02:03:36FromGitter<Varriount> demi-: Fine, I will.
02:03:56FromGitter<Varriount> The problem is the use of --passL in the nimble file?
02:24:03*sz0 joined #nim
02:33:04cheatfatedemi-, i think you can easily translate whole `termbox` to nim without any problems, and you don't need to maintain old broken packages )
02:37:51cheatfatebecause what is termbox, its 5 syscalls and a bunch of constants
02:48:32*Jesin quit (Ping timeout: 255 seconds)
03:05:53*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
03:07:30*UxerUospr joined #nim
03:13:10*Jesin joined #nim
03:30:02*Kingsquee quit (Read error: Connection reset by peer)
03:30:19*Kingsquee joined #nim
03:42:31*mcc joined #nim
04:00:57*brson quit (Quit: leaving)
04:29:36*smt joined #nim
04:32:29*devted quit (Quit: Sleeping.)
04:32:52*abbiya quit (Ping timeout: 245 seconds)
04:37:57*abbiya joined #nim
04:54:16*sz0 quit (Quit: Connection closed for inactivity)
05:21:36*yglukhov joined #nim
05:26:01*yglukhov quit (Ping timeout: 260 seconds)
05:36:52*def-pri-pub quit (Quit: leaving)
05:37:40*UxerUospr quit (Quit: Lost terminal)
06:04:03*nsf joined #nim
06:19:39*arnetheduck quit (Remote host closed the connection)
06:40:54*roygbiv quit (Quit: ™)
07:04:20*hcorion joined #nim
07:04:45hcorionHey, does anybody have some good use-cases for StreamStreams in Nim?
07:06:23ftsfstreamstreams?
07:06:30*yglukhov joined #nim
07:06:31hcorionI found some examples online but they relate more to C++ and use them as a way to make it look better, however nim doesn't have this problem.
07:06:35ftsfStringStreams?
07:06:53hcorionhttps://nim-lang.org/docs/streams.html
07:07:09ftsfI guess when you want to use the same interface for dealing with Strings and Files?
07:07:16*yglukhov quit (Remote host closed the connection)
07:07:21ftsfor you mean streams as oppposed to normal file IO commands?
07:08:41hcorionYeah, but what would the benifit of using a StringStream be? Is there any benefit to using StringStreams instead of normal string operations?
07:09:33ftsflike i said, having the same interface for both strings and files, so you don't need two different code paths
07:11:45hcorionOk, I was kind of hoping for a strong argument, but that works too
07:11:46*ibk joined #nim
07:13:13ibkHi, is there something like `FlowVar` for `thread spawn` that can be used for Future?
07:13:35ftsfhcorion, if you have a file format loader that should work with a file or memory loaded some other way, eg out of a zipfile you could use that
07:24:33*filcuc joined #nim
07:26:24*ftsf quit (Quit: :q!)
07:32:46*mcc quit (Quit: Connection closed for inactivity)
07:38:03*hcorion quit (Quit: Konversation terminated!)
07:40:52*libman quit (Quit: Connection closed for inactivity)
07:48:44*gokr joined #nim
07:51:39FromGitter<jacobdufault> Are there any tools to debug "out of memory" errors? There's no stack so I have no idea which allocation is causing the issue
07:51:57FromGitter<jacobdufault> (I get that determining a stack probably allocates memory)
07:52:20FromGitter<jacobdufault> (though, that memory could probably be preallocated and reserved in debug builds...)
07:59:29*Vladar joined #nim
07:59:33FromGitter<jacobdufault> sometimes I'm lucky though, and I do get a stack trace, but the trace doesn't make a ton of sense (which I suppose makes sense assuming stack corruption or similar) ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=58a55be400c00c3d4f46a21e]
08:00:40FromGitter<jacobdufault> stack trace comes with a `SIGSEGV: Illegal storage access. (Attempt to read from nil?)`
08:01:18FromGitter<jacobdufault> Not sure how that is happening though. The code verifies all of the pointers for c before using it / https://github.com/nim-lang/Nim/blob/devel/lib/system/alloc.nim#L550
08:06:47FromGitter<jacobdufault> ^ seems like there is a bug in line number reporting. got another stack trace that doesn't make any sense w.r.t. lines
08:14:11*yglukhov joined #nim
08:29:50*Arrrr joined #nim
08:31:28*yglukhov quit (Remote host closed the connection)
08:32:10FromGitter<jacobdufault> Filed #5400
08:32:16FromGitter<jacobdufault> (for stack trace issue)
08:36:20*Andris_zbx joined #nim
08:41:58FromGitter<Varriount> ibk: Most of the developers are asleep at the moment
08:42:58FromGitter<Varriount> ibk: What are you attempting to do?
08:47:51*yglukhov joined #nim
08:49:24FromGitter<Araq> @jacobdufault use threads?
08:49:55FromGitter<jacobdufault> @Araq wrong person :P
08:50:29ibkVarriount : with FlowVar, i can wait execution of several threads. How to wait for several futures?
08:51:04bblhttps://nim-lang.org/docs/asyncdispatch.html#all,varargs%5BFuture%5BT%5D%5D
08:54:41*arnetheduck joined #nim
08:55:59*bjz joined #nim
08:56:16*rokups joined #nim
08:57:42*vlad1777d joined #nim
08:59:26ibkbbl : thanks.
09:11:11*yglukhov quit (Remote host closed the connection)
09:12:48*PMunch joined #nim
09:17:31*abbiya quit (Remote host closed the connection)
10:07:27*yglukhov joined #nim
10:08:56*gangstacat quit (Quit: Ĝis)
10:09:10*yglukhov quit (Remote host closed the connection)
10:09:47*yglukhov joined #nim
10:12:35*gangstacat joined #nim
10:14:02*yglukhov quit (Ping timeout: 255 seconds)
10:27:48*yglukhov joined #nim
10:31:06*yglukhov quit (Remote host closed the connection)
10:35:50*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
10:37:19*devted joined #nim
10:43:01*bjz joined #nim
10:49:06*bjz_ joined #nim
10:49:23*bjz quit (Ping timeout: 240 seconds)
10:50:18*yglukhov joined #nim
11:00:04*yglukhov quit (Remote host closed the connection)
11:00:40*yglukhov joined #nim
11:04:37*couven92 joined #nim
11:05:13*yglukhov quit (Ping timeout: 260 seconds)
11:24:00PMunchHmm, what's this syntax here: "proc add*[SomeWidget: Widget](b: Box; child: SomeWidget; stretchy=false)"
11:24:16PMunchSpecifically the [] notation after the procedure name
11:25:38cheatfatePMunch, `SomeWidget` - is a generic parameter which accepts only `Widget` type as generic parameter
11:26:10PMunchAaah
11:27:26PMunchSo you could do something like proc sum[Number: int,float](nums: seq[Number])
11:27:44PMunchTo have a function that would be able to sum a sequence of numbers or a sequence of floats
11:27:49cheatfateproc sum[Number: int|float](nums: seq[Number])
11:28:05PMunchAh, sure
11:29:02PMunchIs there any point in doing it with only one type though?
11:29:27cheatfatemaybe this was done for future?
11:29:47PMunchHmm, possible. Or an artifact from the past :P
11:29:54cheatfateyep
11:32:16Araqnope, it's required
11:32:32Araqnot only 'Widget' is allowed but also a subtype of Widget
11:32:56Araqand the subtypes have their own fields so I need a generic
11:33:11PMunchAaah
11:33:12Araqso that the typesafe specialized field is used
11:33:19cheatfatelooks like `undocumented` feature :)
11:34:52PMunchI was thinking of rewriting my wxWidgets UI macro to use libui instead
11:35:01Araqwell you can either document features in isolation or the combinatoric explosion of features.
11:35:14Araqthe latter is usually not done.
11:35:35PMunchIf someone ever writes a guide on OO in Nim then it would probably be mentioned there
11:35:46PMunchAs the way to take a parent type or any child
11:38:13AraqPMunch got it to work with my updated installation instructions?
11:38:23PMunchAh yes, it worked fine
11:39:38PMunchBut I still don't quite understand what was wrong. I tried to change the linux part of the ui.nim file to make it work with the system-installed version but I had some trouble
11:39:44PMunchMight look more into it later today
11:41:21PMunchSo that you can actually do "nimble install ui" and have it work :)
11:46:11*yglukhov joined #nim
11:48:33Araqyeah create a PR please, should't be hard with NimScript
12:01:59*Snircle joined #nim
12:11:12Jipok[m]Do you think this format is relevant to the nim community?
12:11:13Jipok[m]https://github.com/nin-jin/tree.d
12:16:11Araq"idents must use tabs", no thanks :-)
12:16:51Jipok[m]MB does anyone know another simple, user-readable format?
12:17:50Jipok[m]https://habrastorage.org/getpro/habr/post_images/29f/851/63f/29f85163fd5c1673b90be117105850a2.png
12:18:09Jipok[m]like this
12:19:33*themagician joined #nim
12:19:45Jipok[m]Araq: Why you don't like tabs?
12:20:52Araqthey have strange "spaces modulo N" semantics when mixed with spaces and this is not visible
12:21:19Araqthey most certainly do not mean "1 level of indentation"
12:21:36enthus1asthave a look at http://loup-vaillant.fr/projects/monocypher/ looks very kuhl
12:21:46enthus1astand c2nim wrapped it for us https://github.com/enthus1ast/nimMonocypher
12:21:47Araqand nobody knows how many spaces they should take up.
12:22:21Araqand some editors "compress" X spaces to 1 tab, ugh
12:23:13Araqjust say no to tabs.
12:24:00AraqJipok: use an .ini file instead
12:24:16Jipok[m]ini bad
12:24:57Jipok[m]it does not support more than one nesting level
12:25:13Araqthat's good, nesting is bad :P
12:25:30Jipok[m]why?
12:26:08Jipok[m]How do I transfer the trees using ini?
12:27:02Araqwell if you really have trees and not some misguided crappy hierarchy ini files are indeed the wrong tool
12:27:05Jipok[m]json is not readable. And all of these brackets are annoying.
12:27:14Araquse yaml then
12:27:35Jipok[m]xml fat
12:27:43Araqyaml
12:28:49Araqor Lisp :-)
12:32:16enthus1astmime : )
12:32:33euantorTOML isn't bad, but don't know if there's a parser for Nim
12:32:33*Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif)
12:36:02*bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
12:42:48bblAraq: https://github.com/nim-lang/Nim/issues/5403 why isn't that B(x) a compile time error?
12:44:21*devted quit (Quit: Sleeping.)
12:48:37Araqbbl: because types do not have locations
12:49:10Araqthe compiler is not smart enough to determine this will always fail at runtime because you convert a var
12:49:23Araqfor parameters the type conversion could work in principle
12:50:16bblI thought that worked that way because it wasn't a compile time error :P
12:51:36bblthanks for clearing that up
12:53:48Jipok[m]euantor: thx
12:58:54*bjz joined #nim
13:00:58*devted joined #nim
13:05:34*devted quit (Ping timeout: 258 seconds)
13:18:09*yay joined #nim
13:21:17flyxJipok[m]: alone the table at the beginning of this tree.d readme makes me cringe
13:22:01flyxso some guy invented some categories without specifying their meaning, then invented some values without specifying their reasoning, then implies without saying it that his approach is the best
13:22:49flyxsome of the numbers can trivially be proven wrong.
13:32:11*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
13:41:36FromGitter<andreaferretti> how are the flags `defined(macos)` or `defined(linux)` determined?
13:41:53FromGitter<andreaferretti> it seems that running inside docker on mac
13:42:02FromGitter<andreaferretti> `defined(macos)` is true
13:42:11FromGitter<andreaferretti> arguably, though, one is running on linux
13:45:36*UxerUospr joined #nim
13:53:09*zachcarter quit (Quit: zachcarter)
13:59:51FromGitter<Varriount> @andreaferretti I presumed it was determined by the system Nim is compiled on.
14:00:22FromGitter<Varriount> And is then changeable by the `--os:` flag
14:02:52FromGitter<andreaferretti> ok, I will try it
14:12:47*Vladar quit (Remote host closed the connection)
14:13:06FromGitter<andreaferretti> oh, it was just a silly error when running docker :-)
14:13:42FromGitter<andreaferretti> not quoting the command + using `&&` made the second command run on the host machine :-D
14:15:06*libman joined #nim
14:20:01demi-i'm getting this error when trying to use parseopt2: /Users/Samantha/Projects/necromancy/src/nimcache/necromancy_necromancy.c:889:86: error: no member named 'key' in 'struct OptParser_w3uFmxpwEmgEXFUJjUl10w'
14:30:55*Vladar joined #nim
14:31:59FromGitter<Varriount> demi-: Can you show us your code?
14:32:20*zachcarter joined #nim
14:32:21*mjanssen left #nim (#nim)
14:32:35*Andris_zbx quit (Remote host closed the connection)
14:32:48*nsf quit (Quit: WeeChat 1.7)
14:33:11FromGitter<Varriount> demi-: Also, are you using Nim to raise the dead? I don't know if that's part of the intended use of the language.
14:33:39demi-https://github.com/samdmarshall/necromancy/blob/master/src/necromancy.nim#L45 like, this is the exact same code i've used a bunch of times elsewhere without issue?
14:43:34flyxobviously, the undead are feasting on your code while you are trying to compile it
14:44:22flyxbut for a serious remark, this could be a compiler bug, because C code is generated and then fails to compile
14:44:32FromGitter<Varriount> demi-: My first thought would be a compiler bug in code generation.
14:45:06FromGitter<Varriount> demi-: Could you track down the struct OptParser_w3uFmxpwEmgEXFUJjUl10w in the cached C files, and see what members it has?
14:45:27FromGitter<Varriount> And if there might be other OptParser_* structure definitions?
14:47:18demi-yeah it looks like this: https://gist.github.com/samdmarshall/fb4b4a92feedd263ee8b3cfb1ee4b0bc
14:47:25demi-and there aren't other definitions as far as i can see
14:48:00*flyx guesses this is a bug introduced by the new name mangling
14:48:49demi-i was able to compile similar code yesterday and i don't believe i updated nim
14:49:03flyxsimilar != same
14:49:17FromGitter<andreaferretti> is this something you started now?
14:49:27FromGitter<andreaferretti> is it possible that nimcache is stale?
14:49:37FromGitter<andreaferretti> in that case you could try removing i
14:49:38FromGitter<andreaferretti> it
14:49:40demi-i tried nuking that already
14:49:48FromGitter<andreaferretti> ok
14:50:03demi-my nim was built from source on feb 3rd
14:50:24demi-because Araq said mac users should upgrade to 0.16.1 (master)
14:54:11flyxyou could try downgrading to 0.15.2 and check if it compiles there. if yes, that's a regression
14:55:46demi-ok good news, i can compile with 0.16.0
14:56:00demi-so somewhere between that release and 4ac6a26, this was introduced
14:57:03flyxgreat! file a regression issue
15:07:40demi-here it is, if someone with github access wants to categorize it: https://github.com/nim-lang/Nim/issues/5404
15:08:30*Ven joined #nim
15:12:03demi-is there a similiar concept to C's __FILE__ to get the current file name? I would like my application's debug logging to capture that to help make it easier to trace what is going on
15:14:21*Andris_zbx joined #nim
15:15:25cheatfatedemi-, https://nim-lang.org/docs/system.html#instantiationInfo
15:15:31cheatfateis what are you looking for?
15:15:45Araqdemi-: thanks for the bug report, but what I am supposed to do?
15:15:50zevlgtaking `addr' of exported proc isn't possible in nim? nim yields with "expression has no address" for `addr myProcWithExportCpragma`
15:16:21demi-Araq: do you need more info?
15:16:47Araqof course
15:18:06demi-oh sorry i didn't see your comment on the issue, going to paste a link to the code in question.
15:19:57demi-cheatfate: yes i think that would do it, if i create a template like that, would it be initialized to where the template code is or where the template gets used?
15:20:23cheatfatedemi-, i can't help, never used it
15:20:34demi-heh, ok i will give it a try
15:22:52*smt_ joined #nim
15:24:53*smt quit (Ping timeout: 240 seconds)
15:25:04*smt_ is now known as smt
15:27:42*PMunch quit (Quit: leaving)
15:31:28*arnetheduck quit (Ping timeout: 240 seconds)
15:32:10Araqdemi-: Do you use somehere .importc: "key" ?
15:33:24demi-oh, yes i do
15:34:08demi-cheatfate: yes that does work exactly the way i want, thank you
15:36:09*ibk quit (Quit: Connection closed for inactivity)
15:46:15rokupsAraq: what am i supposed to do with `GC_step()` to make it happy about coroutines? Should it operate on current active stack or somehow iterate all stacks?
15:59:09Araqdemi-: why?
15:59:26demi-it is a type defined by the library i'm using?
16:05:03Araqwell the new codegen assumes that 'importc' identifiers are potential #defines and so doesn't generate these names
16:06:21Araqthat means the name mangling rules differ from generated C file to generated C file, but that's usually not a problem. seems to be a problem for your code though, makes me wanna vomit
16:08:08Araqrokups: I told you partial stack scanning is unsound.
16:08:22*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:08:52demi-Araq: :( sorry
16:09:16Araqah well now I can answer your question though
16:09:33Araqgenerating C code is a clusterfuck because C's preprocessor adheres to no scoping rules whatsoever.
16:12:40demi-yup this is why preprocessors are bad news
16:16:49demi-Araq: I assume this wouldn't be as much of a problem if the `main` code was inside of it's own proc, which would cause the `key` from the `getopt()` to be properly scoped?
16:17:27Araqno, the codegen avoids generating a potential #define, independent of scoping
16:17:38Araqbecause the C preprocessor has no scoping.
16:17:50Araq#define foo 8
16:18:06Araqobj.foo // transformed to obj.8
16:21:01demi-right, but isn't the the case of this code, the name "key" irrelevant? as that is a local variable that happens to be called after the member name?
16:21:58Araqhow do we know it's not #define key in the stuff you importc'ed?
16:22:57demi-sorry, yes i see where you are saying the problem is
16:52:41*yay quit (Quit: yay)
16:54:43*pregressive joined #nim
17:00:15*yglukhov quit (Remote host closed the connection)
17:06:01*filcuc quit (Ping timeout: 260 seconds)
17:07:46*shashlick quit (Ping timeout: 260 seconds)
17:08:47*shashlick joined #nim
17:09:56*Arrrr quit (Quit: Leaving.)
17:11:30*yglukhov joined #nim
17:15:47*Andris_zbx quit (Remote host closed the connection)
17:15:55*yglukhov quit (Ping timeout: 260 seconds)
17:18:10*Jesin quit (Quit: Leaving)
17:20:52*Jesin joined #nim
17:22:33*Trustable joined #nim
17:23:34*krux02 joined #nim
17:24:09krux02try creating a closure with argument name ClEnv
17:25:50Araqkrux02: he, that should work :-)
17:26:58krux02well, not really, the c compiler complains
17:27:42krux02N_CLOSURE(Bool32_lrv4aZgVTmBUYdrYUkLMlg, myWatch_aonEKX3tmTv9cOEzCphXsrw)(Event_Uzh9aP43ffUpM9aa6vZvNEug* ClEnv, void* ClEnv);
17:28:53zachcartergot 3d going again w/ bgfx - http://imgur.com/a/uEI1B
17:29:19krux02not that I would need ClEnv as an argument name, just by reading the source I saw that it would not be possible
17:29:43krux02zachcarter: how if bgfx?
17:29:53zachcarterawesome krux02
17:29:59krux02I saw it, I think it is interesting but I do not fully understand it
17:30:00krux02yet
17:30:19zachcarterI’ve used it previously in a C++ project
17:30:26zachcarteror I used a C++ that used it previously
17:30:32zachcartera C++ project*
17:30:54krux02I mean it has a lot of backends, but how do you deal with them?
17:30:58zachcarteryou don't
17:31:05zachcarterthe API does for you
17:31:19krux02is there an abstraction layer?
17:31:24zachcarterbasically all I have to do is hand it a GLFW context with no API set
17:31:26krux02how do I do it then with shaders?
17:31:40zachcarteryou write the shaders in language comparable to GLSL
17:31:52krux02but it's nots
17:31:53krux02?
17:31:55zachcarterand they get compiled to binary files (which are really just plain text files with a .bin extension)
17:32:01zachcarterit’s not quite GLSL but it’s very close
17:32:30zachcarteryou can actually encode shaders as nim files
17:32:33zachcartercheck this out -
17:32:53zachcarterhttp://pastebin.com/JB5kA9Sz
17:32:56krux02I know that I can compile nim to glsl, but I don't really want to.
17:33:04zachcarteroh no not that
17:33:21zachcarterI just mean I can write a shader and bgfx has a tool which will encode the shader as a header file
17:33:23zachcarterI can then run c2nim on that
17:33:32zachcarterso I don’t have to do any file i/o to load shaders
17:33:54*gokr quit (Ping timeout: 258 seconds)
17:33:56zachcarterI need to automate the process though right now it’s manual
17:34:18*nsf joined #nim
17:34:29zachcarterbut yeah anyway, you write your shaders in this language, here’s an example - https://github.com/bkaradzic/bgfx/tree/master/examples/01-cubes
17:34:35krux02I put a """ string literal in my sourcecode, and generate all the binding that is necessary to glue the nim context to the shader context
17:34:48zachcarterand then you run the shader source files through a compiler
17:34:54zachcarterwhich spits out shaders for different backends
17:35:08zachcarteryeah I’ve seen your opengl dsl it’s very nice
17:35:21krux02In other words I can embed shader literals, and access local variables in the nim context from the shader
17:35:30zachcarterright
17:35:37zachcarterthat’s pretty awesome
17:37:04krux02Well I do not support anything else but OpenGl, but OpenGl is supposed to be the platform independent layer, I don't think it's the right idea to put another one on top of that
17:38:11krux02I mean it might be necessary for some platforms, but then I just don't support that platform
17:40:52krux02zachcarter: https://github.com/bkaradzic/bgfx/blob/master/examples/01-cubes/varying.def.sc#L4 what is the second name after the colon for?
17:40:58krux02COLOR0 etc
17:41:47zachcarterI believe those are the attribute names he has picked for standards across all shaders
17:41:51zachcarterso you’ll set those attributes in code
17:42:36zachcartersomething like - bgfx.Add(result.vDecl, bgfx.Attrib.Attrib_TexCoord0, 2, bgfx.AttribType.AttribType_Float)
17:43:21demi-Araq: when importing a struct from C, do i have to `{.importc: "foo". header: "bar.h".}` for all of the struct's members or just on the type declaration?
17:43:22krux02https://github.com/bkaradzic/bgfx/blob/master/examples/01-cubes/vs_cubes.sc#L13 this is stll very strange to me. A vector has to be multiplied from left. But yea I know that style exists
17:44:55krux02zachcarter: that is exactly what I wanted to avoid, predefined fixed names for attributes like TexCoord0 TexCoord1 etc. I wanted arbitrary names, anything any any amount possible
17:45:24zachcarteryeah i think he’s probably forced into doing it to standardize things across all the api’s he’s targetting
17:46:21krux02yes and c++ does not allow such a tight language as I have done it. It is only possible because of the macros.
17:46:37krux02my library is not portable to c++
17:48:00krux02Maybe some day I want to port it to other programming languages. Not be dependent on Nim. But currently Nim is the only choice I see.
17:52:23dom96demi-: Just the type declaration should be fine as long as the field types match
17:54:59*brson joined #nim
17:56:39demi-ok, that is what i thought but was erring on the side of caution with some c2nim generated code
17:57:03*yglukhov joined #nim
17:58:26*zachcarter quit (Ping timeout: 255 seconds)
18:00:58*yglukhov quit (Ping timeout: 240 seconds)
18:02:15cheatfatedemi-, its better to '{}' all struct's members.
18:02:34cheatfatedemi-, because of alignment issues of different fields
18:03:40demi-because c is bad
18:04:17cheatfatedemi-, i dont think its not C, its developers using C.
18:04:27cheatfatei think its not C, but developers using C
18:20:53*yglukhov joined #nim
18:22:26demi-i've been writing C for a long time and it is pretty bad for modern development
18:22:55demi-and it doesn't help that many people are bad at writing C code
18:23:11FromGitter<barcharcraz> tbh proper modules would go a long way for C
18:23:37FromGitter<barcharcraz> like C with modules and perhaps libgc would be not too bad
18:25:52krux02well most people suck at all programming languages, the problem with C is, that it has a lot of spikes that you have to run into before you actually have the chance to become good.
18:25:53*rauss joined #nim
18:25:56demi-personally i would prefer ARC to GC but yeah that would do a lot
18:26:06krux02arc?
18:26:17GaveUpauto ref counter
18:26:40demi-automatic reference counting, where the compiler inserts the reference counting code to free memory when it is done being used
18:26:57krux02well when you want C with a garbage collector, then I recommend the programming language Go
18:27:00krux02it's pretty much that
18:27:08demi-in more OO languages, that would be retain/release calls, in C that would probably be just free
18:27:30krux02OO smells
18:27:37GaveUpwhat rust does iirc
18:27:59demi-yeah, as does Objective-C (on apple platforms) and Swift (on all platforms)
18:28:18FromGitter<barcharcraz> I don't really understand how ARC is diffrent from GC except that it can't do cycles
18:28:19krux02rust has no single retain or release call, and relying on the programmer to put them anywhere is pretty bad if you ask me
18:28:34krux02rust has move semantics, as C++ has it, too.
18:28:34FromGitter<barcharcraz> and tbh in a cycle free graph gc should have almost the same perf as ref counting
18:29:03krux02the only problem is, that it does not cover the things that already exist in C or C++
18:29:29FromGitter<barcharcraz> gc is not really for the same things as ref counting
18:29:30FromGitter<barcharcraz> imo
18:29:35FromGitter<barcharcraz> like both can be used for memory
18:29:47demi-barcharcraz: http://stackoverflow.com/questions/6385212/how-does-the-new-automatic-reference-counting-mechanism-work/6418410#6418410 and https://lists.apple.com/archives/objc-language/2011/Jun/msg00013.html
18:29:49FromGitter<barcharcraz> but often for memory (and sometimes other stuff) I don't really care if it's freed immediately
18:30:43krux02well the problem is mostly in the head of the people that they think that garbage collection solves anything at all.
18:30:44FromGitter<barcharcraz> fwiw ref counting can still (sorta) stop the world, since the count itself needs to be atomic
18:31:26FromGitter<barcharcraz> like if you used as much heap memory in C as people do in C# or java your perf would probably only be a little better in C, and maybe worse
18:32:11FromGitter<barcharcraz> not to mention with ref counting it's harder to spread the work of deallocating a large structure over time
18:32:37krux02The problem with java is that it is horribly memory inefficient
18:32:50FromGitter<barcharcraz> well yeah, it uses lots of heap mem
18:32:57GaveUpunderstatement of the century
18:33:06FromGitter<barcharcraz> tbh there's a reason people do that though, it makes everything the same size
18:33:09*brson quit (Ping timeout: 252 seconds)
18:33:29FromGitter<barcharcraz> which is important if you want to use indirect calls a lot
18:33:41FromGitter<barcharcraz> (by indirect calls I pretty much mean virtual functions)
18:34:27FromGitter<barcharcraz> I always saw ARC as a way to get the benifits of GC (mostaly) without scaring people that don't like GC
18:35:28krux02I don't know how you are programming, but in my experience in the Java World everything is an Object with an object header + reference to it
18:35:42krux02makes an overhead of 16 bytes
18:36:00krux02and everything is encapsulates as objects
18:36:15FromGitter<barcharcraz> yeah
18:36:16FromGitter<barcharcraz> boxing
18:36:26FromGitter<barcharcraz> not great for perf and memory usage
18:36:35krux02even ints are used in generic collections as Integer (32 bit data 128 bit overhead)
18:36:36FromGitter<barcharcraz> but on the other hand slicing is a real bad time
18:37:03*brson joined #nim
18:37:10FromGitter<barcharcraz> for example in Qt almost everything will also have 16bytes of overhead
18:37:29krux02that's the one of the reasons why I avoid Qt
18:37:31FromGitter<barcharcraz> 8 for the vtbl and 8 for a private data pointer
18:37:39FromGitter<barcharcraz> it makes sence for GUI programming
18:37:48krux02the other reason is the moc compiler
18:37:59FromGitter<barcharcraz> I don't mind moc
18:38:07FromGitter<barcharcraz> like there are things that are impossible to do in c++
18:38:24FromGitter<barcharcraz> such as generate good runtime metadata
18:38:27FromGitter<barcharcraz> it's coming
18:38:46FromGitter<barcharcraz> but until c++ has compile time reflection I think moc is the best option
18:38:48krux02first of all, it forces you to use these inefficient mechanisms, and then it disallows to use the more interesting features of c++, templates (they don't go well with moc).
18:39:11FromGitter<barcharcraz> you can use templates in the majority of your code
18:39:34FromGitter<barcharcraz> you don't have to use private data and whatnot
18:39:47krux02well yea I know where I can use templates and where I can't
18:39:57FromGitter<barcharcraz> people tend to because it helps compile times and makes it harder to screw up your ABI
18:41:00krux02horrible c++ memories, compile time optimizations
18:41:11FromGitter<barcharcraz> yeah
18:41:20FromGitter<barcharcraz> that's one of the reasons I gave up on rust as well
18:41:24krux02I never want to work in a project again where I have to wait 30 minutes for a rebuild
18:41:34FromGitter<barcharcraz> although tbh with pimpl in qt it's definately also an ABI stability thing
18:41:41krux02never, and I don't want to worry about compile times anymore
18:41:49FromGitter<barcharcraz> yeah
18:41:54krux02it feels such a waste of time to think about compile time optimizations
18:42:08FromGitter<barcharcraz> imo with modules the compiler should be able to do all the bullshit that you need to do in c++
18:42:19FromGitter<barcharcraz> and it /is/ bullshit
18:42:43krux02yes I totally agree
18:42:50krux02I never want to write a header again
18:44:51krux02things that are broken/useless in c++: public, private, protected, methods
18:45:18*gokr joined #nim
18:45:19krux02make everything a struct, and don't declare methods at all, and you have a much better live
18:46:53krux02I Nim I realized that non virtual methods have actually no advantage to just function calls. They only have disadvantages
18:48:27FromGitter<barcharcraz> yeah
18:48:56FromGitter<barcharcraz> Bjarne Strostrup wants to get nim style universal function call syntax into the language, but it met some resistance.
18:49:21krux02yes, but Bjarne also has weird ideas
18:49:39FromGitter<barcharcraz> idk his proposals are pretty good lately
18:49:51FromGitter<barcharcraz> they just never get that far
18:51:52krux02well modules in c++ are more important
18:52:01FromGitter<barcharcraz> true
18:52:54krux02universal function call syntax is not that universal
18:53:31krux02it is good, an improvement, but it is mostly estetical
18:53:42krux02so no real reason to push it
18:54:00FromGitter<barcharcraz> yeah
18:54:04krux02modules and compile time reflection is the key important thing for c++
18:54:11FromGitter<barcharcraz> I totally agree
18:54:18krux02get a completely header free experience in c++
18:54:57FromGitter<barcharcraz> god people will cling to headers because "it's good that it seperates implementation and definition...."
18:55:32krux02it doesn't do that
18:55:37FromGitter<barcharcraz> I know
18:55:42FromGitter<barcharcraz> but people love to think it does
18:56:17*yglukhov quit (Remote host closed the connection)
18:56:53krux02well people really like to stick to what they once learned
18:57:02FromGitter<barcharcraz> yeah
18:57:19FromGitter<barcharcraz> esp when what they learned was a super painful thing that no other language has had to deal with since like 1975
18:57:39*yglukhov joined #nim
18:58:11krux02even when it is just removing some common, there will be someone who made a living out of knowing the pitfalls, who doesn't like the improvement.
18:58:45krux02totally agree
18:59:05krux02the more painful it is to learn something the more the people want to stick to it
18:59:21krux02I think that's the reason that vim and emacs is still a thing
18:59:45krux02it just is very painful to learn and then in the end it is just an editor like every other editor
19:00:17FromGitter<barcharcraz> well until the rise of these new javascript based editors there was not that much better
19:00:57krux02well javascript emacsLisp, I don't care that much
19:01:13krux02vims
19:01:46krux02ok it's better to stick to just one sucky scripting language, we don't need 100's of them
19:02:11*yglukhov quit (Ping timeout: 264 seconds)
19:02:32FromGitter<barcharcraz> well from observation it seems atom/code/brackets are much easier to write extensions and support plugins for
19:02:51FromGitter<barcharcraz> definately easier than Visual Studio
19:02:56FromGitter<barcharcraz> *shudders*
19:03:09gokrvscode too
19:03:30krux02well maybe one day those editors rule the world.
19:03:51krux02But I would like to be able to write plugins in that language, that I am also editing at the same time
19:04:05gokrAs much as I hate to say praise for an MS product - vscode is really nice. Of course, sucks RAM like a donkey, like all electron things (including our own tool :)).
19:04:50gokrHa! ;) Yeah. As a Smalltalker I totally agree - a reflective IDE is what you want. However, I haven't heard about many such beasts in manifest statically typed langs.
19:05:20krux02well for c++ there is now 4coder
19:05:37gokrok? A reflective env in C++?
19:06:53krux02more like "read the api docs" than iterating through reflection I guess, I haven't tried it yet
19:07:11krux02it's just what is used in the stream Handmade Hero
19:07:45stisaVSCode plugins are JS right? Would it be possible to write the plugin in nim and compiling to js?
19:07:47gokrI want the whole monty - live reflective - like Smalltalk. And... it's hard to pull off unless your lang/runtime was designed for it.
19:08:05FromGitter<barcharcraz> gokr: you used Juno?
19:08:06gokrstisa: Yeah, probably works. But... not sure what you gain.
19:08:07krux02pretty cool youtube series that covers making a game in c++, everything included on stream including software rendering and os abstractions (no SDL used)
19:08:23gokrJuno... 3D stuff in Smalltalk, right?
19:10:09*kunev quit (Quit: е те!)
19:10:38krux02I have little knowledge about smalltalk, but for me any language that does not have at least a simple type system and C like subset with composable structs and arrays is like a knife that doesn't cut.
19:10:52FromGitter<barcharcraz> Juno is the Julia plugin for Atom
19:11:37krux02what I like about Julia is this: 1 ∈ [1,2,3] ---> true
19:11:45gokrkrux02: When you say "type system" I suspect you mean manifest statical typing?
19:11:46FromGitter<barcharcraz> yeah
19:11:57FromGitter<barcharcraz> I'd love julia if not for the INSANE module system
19:12:02krux02[1,2,3] ∩ [2,3,4] ---> [2,3]
19:12:17gokrkrux02: Further, not sure what you refer to with "composable structs and arrays".
19:13:28krux02I mean struct of structs, array of structs, struct of arrays, and all of that without hidden headers (overhead fields)
19:14:23*kunev joined #nim
19:15:23krux02so when I put an array in a struct, I want the array to be embedded in the struct, not a hidden pointer to an array object with array header
19:15:42krux02that's what julia does
19:15:55krux02julia can also embed a struct, but only when it is immutable
19:16:01FromGitter<barcharcraz> I think that's an open problem tho
19:16:04FromGitter<barcharcraz> like just how to do that
19:16:09krux02that might be ok for some people, but not for me
19:16:14gokrRight, I understand. Well, Smalltalk is higher level - so no - only objects basically.
19:16:53gokrA bit of a simplification, but ... yeah.
19:17:43krux02well Nim offers this low level acces to memory layout
19:17:49krux02that's what I like about that language
19:17:53gokryup
19:18:24krux02go does it, too. But go sucks at other things.
19:31:17*gokr quit (Ping timeout: 240 seconds)
19:33:19krux02ok I think that was enough ranting for the day
19:37:05*djellemah_ joined #nim
19:43:42*Arrrr joined #nim
19:43:42*Arrrr quit (Changing host)
19:43:42*Arrrr joined #nim
19:48:59*djellemah_ quit (Quit: Leaving)
19:49:18*smt_ joined #nim
19:49:47*djellemah_ joined #nim
19:52:50*smt quit (Ping timeout: 260 seconds)
19:53:44subsetparkCan someone help me out with object inheritance? I've got my first in-earnest usage and I'm not sure what I'm doing
19:55:02*pregressive quit (Read error: Connection reset by peer)
19:55:06subsetparkbasically I've got a hierarchy that looks like this: type O[T, T2] = ref object of RootObj; type O2 = ref object of O[ConcreteType, ConcreteType2]; type O3 = ref object of O2
19:55:45subsetparkAnd I'm trying to instantiate O3 and then call it with a proc that takes an O
19:56:09subsetparkThis seems correct to me, but I'm getting a type mismatch error - i'm sure I don't understand it yet
20:00:30*couven92 quit (Read error: Connection reset by peer)
20:03:34*bjz joined #nim
20:04:08*smt_ is now known as smt
20:04:37subsetparkBTW, making the proc a method doesn't solve things
20:06:28*pregressive joined #nim
20:08:00Araqsubsetpark: report it properly please
20:08:35subsetparkAraq: what do you mean? I don't think it's a bug, I think I just don't understand how to use child objects
20:09:34Araqwell your description sounds it should work, do you use 'var O' ?
20:09:55*yglukhov joined #nim
20:11:41subsetparkyeah i do... i'll try to make a minimal case
20:12:38Araqwell if you use 'var O' for the parameters the compiler is correct :P
20:13:30subsetparkhm, I'm not sure what you mean, but using `var` or not in the proc parameters doesn't change anything
20:15:12subsetparkok, I'm pretty confident i'm just not declaring things correctly. My minimal case doesn't fail.
20:22:42*Arrrr quit (Quit: Leaving.)
20:23:19*pregressive quit (Read error: Connection reset by peer)
20:23:40subsetparkok I think I figured it out - if I declare that proc as `method f[T, T2](o: O[T, T2])...` I can get further
20:28:34*pregressive joined #nim
20:29:06*couven92 joined #nim
20:33:57*pregress_ joined #nim
20:34:04*pregressive quit (Read error: Connection reset by peer)
20:44:51*UxerUospr quit (Read error: Connection reset by peer)
20:58:05*gokr joined #nim
21:00:39*gokr quit (Client Quit)
21:00:53*gokr joined #nim
21:02:55*brson quit (Quit: leaving)
21:03:02*brson joined #nim
21:05:12*yglukhov quit (Remote host closed the connection)
21:13:29*yglukhov joined #nim
21:17:33*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:31:11*pregress_ quit (Read error: Connection reset by peer)
21:31:44*pregressive joined #nim
21:44:27*bjz joined #nim
21:48:25FromGitter<raydf> How can i initialize a seq with 0 items inside?
21:49:12FromGitter<raydf> nevermind
21:49:12AraqnewSeq(0)
21:49:18Araq@[]
21:49:20FromGitter<raydf> thanks Araq
21:49:47FromGitter<raydf> ohhh i didn't knew about the @[], nice
21:49:59*Matthias247 joined #nim
21:53:13*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
22:05:10*nsf quit (Quit: WeeChat 1.7)
22:10:15FromGitter<raydf> I'm receiving Error: undeclared identifier: '=>'
22:10:29FromGitter<raydf> which module has this operator?
22:11:27FromGitter<Varriount> Where are you using it?
22:11:34FromGitter<raydf> in a map
22:11:39gokrhttps://nim-lang.org/docs/theindex.html#%60%3D%26gt%3B%60
22:11:40FromGitter<raydf> i imported sequtils
22:12:00gokrSo seems to be future
22:12:09*rokups quit (Quit: Connection closed for inactivity)
22:12:43*yglukhov quit (Remote host closed the connection)
22:16:21FromGitter<raydf> thanks it's future, i'm bookmarking the index
22:32:56*rauss quit (Quit: WeeChat 1.7)
22:33:09*yglukhov joined #nim
22:35:22*djellemah_ quit (Ping timeout: 245 seconds)
22:39:20dyce[m]i am curious if nim could benefit from RAD tools like what delphi had
22:39:44dyce[m]or is RAD dead and web is the replacement
22:51:24*Trustable quit (Remote host closed the connection)
22:52:38Araqyep, pretty much :-)
22:53:24Araqeven internal business apps are often done as web apps now
22:53:54FromGitter<philip-wernersbach> @all @Araq @dom96 I hate to be that guy, but do we have a timeline for 0.16.2? It would be nice to have a preinstalled nimble that works
22:54:31Araqhmm, is the nimble with 0.16.0 broken?
22:55:01FromGitter<philip-wernersbach> yeah, i'll put it in a gist
22:55:34FromGitter<philip-wernersbach> https://gist.github.com/philip-wernersbach/f0fd0292906145b467cdc0842909ae2c
22:56:15demi-hmm, that works for me on 0.16.0
22:56:19Araqthat's just an old Nim?
22:56:53*pregressive quit (Remote host closed the connection)
22:57:12FromGitter<philip-wernersbach> No, it's 0.16.0: Nim Compiler Version 0.16.0 (2017-01-13) [MacOSX: amd64]
22:57:29*pregressive joined #nim
22:57:49Araqyeah but you have outdated nimble-version in your ./nimble/pkgs and that is picked up instead
22:57:50demi-is it from homebrew?
22:58:09FromGitter<philip-wernersbach> Oooooh
22:58:33Araqbut yeah, new nimble avoids that, iirc
22:58:49FromGitter<philip-wernersbach> No, it's manually compiled. On OS X, koch nimble on 0.16.0 errors out, so I just copied dist/nimble/src/nimble into place
22:59:09Araqcheck your ./nimble/pkgs please
23:00:10Araqer, I mean ~/.nimble
23:01:00FromGitter<philip-wernersbach> No matches for wildcard '~/.nimble/pkgs/*nimble*'.
23:01:50*pregressive quit (Ping timeout: 260 seconds)
23:02:16Araqhmmm and what does 'nimble -v' say?
23:06:56FromGitter<philip-wernersbach> nimble v0.8.2 compiled at 2017-02-16 17:50:27
23:07:14FromGitter<philip-wernersbach> I had to copy it from list/nimble/src/nimble into ~/.nimble/bin
23:07:19FromGitter<philip-wernersbach> So that's probably the issue
23:07:41Araqit should be next to the nim compiler binary
23:09:56*PMunch joined #nim
23:10:16dom96that's not necessary
23:10:20dom96try clearing /tmp
23:10:23demi-yeah, that sounds like it is installed wrong
23:10:29dom96or see if /tmp/nimble* exists
23:11:31dom96Other thing I can think of is that you have an older Nim version installed somewhere?
23:11:32Araqok, good dom96 is taking over. I'm out of ideas :-)
23:12:14demi-if you are on os x then you should be installing from homebrew, ideally
23:13:15dom96why?
23:13:39dom96I wouldn't be surprised if homebrew does it wrong.
23:13:51Araqnah, build from source like the rest of us. packagers sometimes eat mushrooms
23:14:00demi-homebrew does it correct as far as i can tell
23:14:42dom96@philip-wernersbach what error does 'koch nimble' give?
23:17:22FromGitter<philip-wernersbach> @dom96 https://gist.github.com/philip-wernersbach/7aae8213b23b0cf422474c6507dafaaf
23:17:44FromGitter<philip-wernersbach> Okay, so I got it to work with @Araq and @dom96 's help
23:18:18Araqwhat was the cause?
23:19:20FromGitter<philip-wernersbach> I had to rm -Rf ~/.nimble/bin/nimble ~/.nimble/pkgs/nimble-* /tmp/nimble* and then mkdir bin && cp dist/nimble/src/nimble dist/nimble/src/nimblepkg bin
23:20:16FromGitter<philip-wernersbach> So it was a combination of things in my .nimble directory and /tmp/nimble, and then not having nimblepkg next to nimble due to the above error
23:20:34FromGitter<philip-wernersbach> Thanks for your help @Araq @dom96 but wow that was painful
23:21:17FromGitter<philip-wernersbach> Wouldn't have been able to fix it without the help
23:21:39*UxerUospr joined #nim
23:21:53Araqwell yes. would be nice if we could improve it for 0.16.2, but I still don't know what the problem was
23:22:42Araqdom96: does nimble 'cache' the /tmp/nimble file?
23:22:52AraqI mean "only write if not exists"
23:23:38dom96Araq: That was fixed, but possibly only in 0.8.4
23:23:55FromGitter<philip-wernersbach> Sorry, I meant there were a bunch of directories in /tmp that started with "nimble" so I just deleted them all
23:24:11*sz0 joined #nim
23:24:14dom96The biggest failure is 'koch'
23:24:17dom96That should be fixed
23:24:21Araqhey.
23:24:41Araqwhat's wrong with it?
23:25:37FromGitter<philip-wernersbach> I like koch, but it did give me an error that made me manually copy all this in the first place
23:26:59dom96Araq: https://gist.github.com/philip-wernersbach/7aae8213b23b0cf422474c6507dafaaf
23:27:40Araq"copy all this"? it's a single binary file
23:27:42*Vladar quit (Remote host closed the connection)
23:27:51Araqand if it's not where koch thinks it is, you have some other problem
23:36:36*arnetheduck joined #nim
23:46:35*couven92 quit (Quit: Client disconnecting)
23:54:07*Matthias247 quit (Read error: Connection reset by peer)
23:56:40FromGitter<philip-wernersbach> It's a single binary file plus the nimblepkg directory
23:57:27FromGitter<philip-wernersbach> And then if you have nimble directories in /tmp or ~/.nimble/pkgs, you're gonna have a bad time
23:58:44FromGitter<philip-wernersbach> It's not terrible, but there's definitely room for improvement. All I did was extract nim-0.16.0.tar.xz and run "nim c koch && ./koch nimble", so not sure what the error could be