<< 16-05-2017 >>

00:48:09nohusuroIs there a way in nim to get a Process reference by pid?
00:50:08FromGitter<ftsf> skyrylar i made one i can share with you
00:52:06*arnetheduck_ joined #nim
00:52:06*arnetheduck quit (Read error: Connection reset by peer)
00:55:10*couven92 quit (Quit: Client Disconnecting)
01:00:56*skrylar joined #nim
01:01:02skrylarwelp. compilers crazy
01:01:50skrylarif you have something like proc thing(func: callback) it will tell you that it expected '(', instead of either A) using that as a parameter name or B) noticing the parse is entirely wrong and saying such
01:03:17FromGitter<zacharycarter> ftsf: are you putting conditional logic into nico to tell when things are running under the js compiler? Or are you going to have a totally separate codebase for JS? I'm kind of leaning towards the latter with FRAG atm
01:03:41FromGitter<zacharycarter> skrylar: mind putting up a snippet / glot.io ?
01:06:06skrylar@zacharycarter https://glot.io/snippets/epwa37n44q
01:07:28FromGitter<zacharycarter> ah I see what you mean
01:07:38FromGitter<zacharycarter> didn't know func was a reserved keyword
01:10:31skrylari think it used to mean something in ages past
01:10:45FromGitter<zacharycarter> probably
01:11:10skrylarwell old nim{rod} used to be pretty pascal-y so i think func returned values and proc didn't, but i might just be inventing stories now
01:11:27FromGitter<zacharycarter> ahh okay that makes sense
01:11:43FromGitter<zacharycarter> I'm glad that's no longer the case :P
01:12:05skrylarah no. func is reserved for sugar
01:12:16skrylarits listed under the noSideEffect pragma
01:12:35FromGitter<zacharycarter> ah okay
01:16:08FromGitter<zacharycarter> @dom96: I'm going to try to reserve some time for play.nim-lang.org this weekend and add snippets etc
01:17:26*adeohluwa quit (Quit: Connection closed for inactivity)
01:19:49*chemist69 quit (Ping timeout: 246 seconds)
01:44:40skrylaryou know, i've had some ponderings about those immediate mode guis people seem to like
01:45:02skrylari think people just like them because they *look* like there's less boilerplate
01:45:08skrylaryou could probably do the same thing with just macros
01:45:26skrylarbut have it create a scene graph with callbacks instead
01:45:41skrylarso people got their pretty if(button("stuff")){clicky}
01:47:32ftsfskrylar, https://github.com/ftsf/nimsynth/tree/master/src/jack is what i use for jack
01:47:38ftsffeel free to copy it
01:48:17ftsfzacharycarter, currently it's a separate codebase, but i want to split it to a lower level codebase with all platform specific stuff and then a higher level interface which is common
01:52:59skrylarftsf, but i already hand-ported 70% of it .-.
01:53:36skrylarah cute pixel art tho
01:53:38ftsfskrylar, ahh
01:54:08skrylari have part of a sequencer written in straight c with EFL
01:54:23ftsfEFL?
01:54:25skrylarearlier today got it to where it will do forward stepping
01:54:28skrylarenlightenment foundation libraries
01:54:52skrylarhttps://www.enlightenment.org/
01:55:16skrylarthey're interesting. got a bunch of sponsorships from the embedded community because its all super light
02:01:06*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
02:06:41skrylarftsf, the most difficult think about building a sequencer so far (unless you've gotten this far a nd already know :X) is making sure to store notes in like, a sorted array
02:07:42ftsfskrylar, i use a grid sequencer
02:07:59skrylarthe drummachine kind?
02:08:05ftsfthe tracker kind
02:08:08skrylarah.
02:08:22skrylari tried to get in to those. couldn't mentate the letters to sound in my head
02:08:38skrylaryeah your job is a lot easier with a tracker
02:08:48skrylarunless you go tickless. some people have
02:10:10*rauss joined #nim
02:10:11skrylari have an array that stores the 'notes' and those have pointers to the note on and note off events, and all events get sorted on insertion to a big list of pattern events, so it always has the ability to iterate forward to the next immediate midi event and then calculate the offsets in JACK. 'cause JACK just calls you and says i need this many samples worth of data, so some midi notes might be off by a few samples
02:10:32skrylarit doesn't perfectly step from one tick to another
02:10:43skrylarit steps at whatever the user set the buffer size to :b
02:17:43*chemist69 joined #nim
02:43:10*yglukhov joined #nim
02:48:45*yglukhov quit (Ping timeout: 272 seconds)
02:49:53*def-pri-pub joined #nim
03:11:09ftsfdom96, does choosenim have an update mechanism?
03:11:13ftsf(for itself rather than nim)
03:32:35ftsfhmm deadCodeElim:off seems broken, when using it I sometimes get undefined references when linking.
03:46:13*def-pri-pub quit (Quit: leaving)
04:00:50*rauss quit (Quit: WeeChat 1.7.1)
04:29:23*BennyElg quit (Remote host closed the connection)
04:34:42skrylarhrmmm.
04:35:04skrylaron one hand i kinda want to play with nanovg. on the other hand rendering vectors to polygon 20+ times per second seems incredibly wasteful
04:36:11ftsfif it works then who cares? =)
04:36:22skrylari have idiosynchricies that need managing :3
04:36:45skrylaralthough i could just do what Godot does and only re-bake the geometry if something on the screen changes
04:38:11skrylarin the case of music software it sorta is eeh. i mean if you can offload the UX stuff to GPU, then you can just do some really basic dirty bit checks and that does free the CPU up for more plugins
04:39:13ftsfmake it first, then optimise
04:39:24ftsfif you need to
04:40:42skrylarheh. i have one that sorta works right now
04:40:47skrylarits bitmap graphics tho
04:41:02ftsfmine too :3
04:41:09skrylarturbonerds with those super hd monitors get uppity when you give them little pixel interfaces lol
04:41:28ftsfpeople seem to like my pixely interfaces
04:41:33skrylarnot going to overhaul it until i have some idea what it should look like
04:41:41ftsfjust scale up with nearest neighbour
04:41:43skrylarpixel interfaces are fine just make sure you have a 2x scale yeah
04:41:47skrylarsee LMMS doesn't do that
04:41:53ftsfLMMS?
04:42:01skrylarit has a little pixel interface from like '97 and they don't have a scale option
04:42:11ftsfahh
04:42:13ftsfi'll check it out
04:42:22skrylarits ok
04:42:29skrylari just want fl studio's piano roll on my linux
04:42:42ftsfadd a pianoroll to nimsynth =)
04:42:51skrylari wrote one in C
04:43:09ftsfi am planning on making one at some point
04:43:22ftsfbut kinda wanna make it a vertical piano roll
04:43:33skrylarthat was why i originally used the name trackensail
04:43:41skrylarbecause "why is there no tracker and piano roll in the same thing?"
04:43:58skrylarand then i found i didn't get the tracker mindset
04:44:18skrylarbut piano rolls aren't too hard
04:44:33skrylarjust need some basic geometry collision code and some culling
04:45:14ftsfhmm using piano rolls is hard... need to be accurate with the mouse
04:45:37skrylarwell you know the most annoying thing? none of the open source piano rolls delete notes easy
04:45:53skrylarin fruityloops its just right click and drag.
04:45:53ftsfhmm lmms seems ok, just right click to delete
04:45:58skrylaryea
04:46:03skrylarbut no ghost notes. or routing. bleh
04:46:32*yglukhov joined #nim
04:46:57skrylarmight port it to nim. depends
04:47:08skrylartrackensail, not lmms
04:48:30skrylari did miss all these zero cost abstractions though
04:50:41*yglukhov quit (Ping timeout: 240 seconds)
05:09:04*vendethiel quit (Ping timeout: 246 seconds)
05:17:16ftsfhmm a C function takes a const char* argument, I assume in the nim wrapper I just use cstring type?
05:18:47*Trioxin joined #nim
05:26:54ftsfgetting a crash (only on windows) from the c function when reading the const char* passed from nim, I can print it in nim fine, but printf from C causes a segfault
05:29:53skrylari think you're supposed to use the $ operator to convert a cstring back to a nim string
05:30:06skrylaroh. also
05:30:12skrylaris your windows build unicode?
05:30:21ftsfit's crashing in the C code after passing a cstring, i never get it back from cstring.
05:30:33ftsfhmm, i'm not sure how to tell
05:30:34skrylar-DUNICODE does some fky things like replaces all char*s in winapi calls with short*'s
05:30:51skrylarbecause they thought 16-bit chars would escape unicode hell and they were wrong
05:30:53ftsfnot using any winapi, just basic printf fopen etc
05:30:55skrylarbut now they must live with that sin
05:32:36skrylarftsf, is this GCC on windows?
05:32:44ftsfgcc on linux targeting windows
05:32:48skrylarohlawd.
05:33:01skrylari don't have a cross compiler set up to check
05:33:21ftsfhmm maybe i'll try a windows compile and see if i get the same problem
05:33:34ftsfif i can get it working on windows
05:33:44*gokr joined #nim
05:33:46skrylari used to run clang on mingw.
05:33:51skrylarsurprised the urho devs lol
05:34:08skrylar"someone actually uses clang on windows like that?" "turns out all you have to do is just run the cmake."
05:34:43ftsfhmm maybe i should try clang...
05:34:53ftsfusing clang for my osx build
05:35:00skrylarworth a try. haven't done a cross compile with clang
05:35:15skrylarwish muscl worked on windows
05:40:09skrylarwonder if nimrod is smart enough to share generics of pointer types
05:40:26skrylarC++ isnt
05:48:15*xet7 quit (Quit: Leaving)
05:53:37*ephja joined #nim
05:56:20*xet7 joined #nim
05:59:12*chrisheller quit (Remote host closed the connection)
06:00:32*chrisheller joined #nim
06:00:56*chrisheller quit (Remote host closed the connection)
06:00:58skrylarftsf, yey, finished all the binding. i think.
06:04:55ftsfawesome, jack you mean?
06:05:06skrylaryes
06:05:14skrylarit's not tested to see if it blows up horribly but well
06:05:35ftsfwhat could go wrong =)
06:05:50ftsfi am successfully using jack from nim, but only a subset
06:06:05skrylaryeh. no reason it won't work.
06:06:14skrylaryou only need like 12 functions for most cases
06:06:19ephjaskrylar: what do you mean by sharing generics?
06:06:30skrylarhttps://halls-of-valhalla.org/beta/articles/functional-options-pattern-in-go,54/ wonder how well this works in nim
06:07:15skrylartl;dr they're using closures to apply settings and then having functions return closures, so you have APIs that are like makething(port(500), thingdoer(true)) and the api is stable even with new parameters. its neat.
06:07:39skrylarephja, a shared generic understands that two pointers that are never dereferenced are essentially the same so it only makes one instance
06:08:11skrylarso if you have a generic container for a foo* and bar* it doesn't make two copies like C++ templates do
06:08:35skrylarstraight C people often do this because they just use void* and typecast and pray
06:09:11skrylarftsf, it can get obnoxious to do by hand but nim is great at abstracting over simple bindings
06:09:34skrylarsince it translates foo.bar to bar(foo) you just need to name the methods right and you already get almost-oo
06:10:41ftsfyeah
06:11:06skrylarcurious if templates work with get/set
06:14:17skrylarseems they do
06:14:47skrylarneat. so its entirely possible to cover up those gnarly set_option(SOMEOPT, SOMEVALS)
06:26:48Araqskrylar: last time I checked C++ template body deduplication is a linker feature and works
06:30:11ftsfso i have _another_ really weird problem =( i have a C function new_gif(const char *fname) wrapped by a nim proc newGIF(fname: cstring), calling it via newGIF(filename) and it crashes inside the new_gif C function in windows but not linux. trying to print the fname from C crashes it.
06:30:22ftsfI can print the address of it, but not index it.
06:32:34*nsf joined #nim
06:33:07ephjacdecl?
06:33:59ftsfoooh
06:34:09ftsfis that something i need to add to importc procs?
06:34:34ftsfomg it fixes it!
06:34:44ftsfthanks!!
06:39:58*Vladar joined #nim
06:41:25*chrisheller joined #nim
06:42:24*BennyElg joined #nim
06:42:42ephjagood
06:42:42*BennyElg quit (Read error: Connection reset by peer)
06:43:09*BennyElg joined #nim
06:47:22skrylarAraq, i haven't been paying attention to the post c++0x stuff :\
06:47:35ftsfok now i think it's breaking because my filename has : in it, which I guess is invalid on windows
06:47:55skrylarfiles only have :'s in the name on amigas lol
06:48:19*yglukhov joined #nim
06:48:26ftsfworks fine on linux =p
06:48:47ftsfi was putting getClockStr() in the filename
06:52:56*yglukhov quit (Ping timeout: 260 seconds)
06:56:03ephjaskrylar: does the Elementary API seem nice compared to other widget libs?
07:02:55ephjaI'm still waiting for them to get EO to a usable state so that porting EFL to Nim won't be too painful
07:09:32*yglukhov joined #nim
07:11:25skrylarephja, mm well it was as pleasant as one can expect from straight C
07:11:41skrylari do appreciate how its layered
07:12:02skrylartheres a set of just foundational crap like lists and then evas is a 2d canvas manager and the guis are on top of that one
07:13:03skrylarah good there exists an sdl2 binding
07:13:47*yglukhov quit (Remote host closed the connection)
07:16:51skrylari donno if nim will like it but i have a thing that might be fun. mostly involving setting a posix condition and having the UI thread block to that, so when an event happens it can kick the condition and let all the "immediate mode"-esque rendering happen then
07:17:37skrylarprobably not necessary tho
07:21:20ephjayeah. concepts will come in handy when interfacing with those containers
07:24:12*yglukhov joined #nim
07:27:49*yglukhov quit (Remote host closed the connection)
07:36:10*Arrrr joined #nim
07:50:42Arrrr"6. Developers’ sourcecode and project files (.php, .java, .cpp, .pas, .asm)."
07:50:57ArrrrNim for now is a safe language against ransoms
07:51:20*Andris_zbx joined #nim
07:52:54flyxthat's a strange selector.
07:55:52ephjaskrylar: https://nim-lang.org/docs/channels.html#recv,Channel[TMsg]
07:55:59ephjadoes that achieve what you want?
08:14:35*yglukhov joined #nim
08:39:06*vlad1777d joined #nim
08:45:04skrylarephja, heh, a baby version of go channels? :)
08:45:15skrylareeh i'll probably just use an atomic flag or something.
08:45:28skrylardepends on if its safe to push sdl events from realtime threads
08:46:46gokrskrylar: Using Urho3D? Just saw you mentioned urho
08:47:03skrylargokr, sadly no. never ended up doing the project i set it up for
08:47:23gokrThe Atomic engine is really going places.
08:47:28skrylaris it?
08:47:42skrylari remember installing it from the AUR and it segfaulted on launch, so i tossed it and went back to godot
08:47:47gokrIt seems to have a lot of buzz.
08:48:08gokratomicgameengine.com
08:48:18gokrAnd its all MIT now.
08:48:32skrylarit was when i tried it too. but it segfaulted on launch on nix
08:49:07gokrHum, well, what I can see (movies, articles, their forum) - it's very active. Much more than upstream Urho3D it seems.
08:49:25skrylarhaving funding does wonders
08:49:38gokrWell, not sure they have much funding actually.
08:49:47*sz0 joined #nim
08:49:53skrylarisn't the guy who maintains it some ex from a big studio?
08:50:54gokrI am not entirely sure, but he sure does seem to know his stuff :)
08:51:00gokrTheir blog is quite impressive.
08:51:02skrylari know the godot guys did a great job. they get a lot of unfair flak because people are like "oh it has gdscript thats bad"
08:51:27gokrAraq helped us doing a wrapper of Urho3D as you may know.
08:51:38skrylari think i heard of that being worked on before i lef
08:52:42gokrWe used it in integrating Urho3D in Terf (3dicc.com) - but we couldn't finish it due to other reasons. But it was working fine.
08:53:04skrylarUrho is a nice engine
08:53:11gokrAnd we will hopefully come back to it later, although I am not working currently at 3dicc.
08:53:19gokrYeah, very much.
08:53:39skrylari wish the guys who did godot would just meld with them a little bit
08:53:50skrylarthe tooling is really nice in GD. but the 3d is way better in Urho
08:54:03gokrI think Atomic adds a great deal of tooling.
08:54:04*vlad1777d quit (Remote host closed the connection)
08:54:16skrylarIt also adds crashes :)
08:54:21skrylarAnd javascript. blegh
08:55:07gokrAnd C#.
08:55:14skrylarmy mind boggles at people who hate on custom languages only to then use dialected versions of javascript or such
08:55:17gokrWhich one may of course either like or not :)
08:55:23skrylarwell mono is mit now too
08:56:32gokrThe feature reel here is IMHO kinda impressive: https://atomicgameengine.com/blog/atomic-build-1/
08:57:40skrylarI'd hope so.
08:57:46*PMunch joined #nim
08:57:48skrylarUrho is pretty complete and they aped it. lol
08:58:24gokrWell, they are quite open with the fact they build on Urho3D - and they appreciate it.
08:59:17skrylari might see if they fixed the aur package some time
08:59:31skrylarits a long build tho.
09:01:14skrylaralways thought it funny how freepascal, delphi and d could build these monsterous codebases in under a minute
09:01:33skrylarnim does it too
09:01:55FromGitter<andreaferretti> does anyone know how to handle declarations such as this in c2nim? ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ I would like to be able to correctly translate these declarations. For similar ones, I used to just skip the whole `#ifndef` section, but I am not sure whether skipping the whole `__attribute__` can lead to issues [https://gitter.im/nim-lang/Nim?at=591ac003c4d73f445ab02983]
09:02:31skrylargcc attributes mean nothing to nim IIRC.
09:02:57skrylarsince nims just going to output C code and then gcc will deal with the attributes there
09:03:26FromGitter<Araq> ===def CUFFTAPI===
09:03:44Araq#def CUFFTAPI
09:06:41PMunchAraq, ref: https://github.com/nim-lang/Nim/pull/5778 what kind of test do you want? I'm looking at the dumpTree test and it's not much: https://github.com/nim-lang/Nim/blob/devel/tests/macros/tdumptree.nim
09:08:28*bjz joined #nim
09:09:10*bjz quit (Client Quit)
09:10:50FromGitter<andreaferretti> thank you Araq, I am trying `#def`. The only issue I have is that using `#def` changes the symbol seen by c2nim itself - so that then I have to skip a section with a strange guard such as `__attribute__ ((visibility ("default")))`
09:11:30Araqwell you implemented #skip
09:11:37AraqI don't understand your problem
09:12:42*bjz joined #nim
09:13:10FromGitter<andreaferretti> well, you are right :-) but the problem is the following: the token I get from the parser is already transformed by the `#def` rules
09:13:31FromGitter<andreaferretti> so it not always easy to skip it
09:15:34FromGitter<andreaferretti> I would be happy to implement something better, but first I have to understand where to get the token *before* the transformation
09:16:14FromGitter<andreaferretti> I'll see what I can do
09:32:20FromGitter<andreaferretti> @Araq it seems to work with `rawGetTok`, I think it makes sense to consider the raw token in processing ifdefs. If you agree, I am pushing a small change from `getTok` to `getRawTok` in `parseIfdef` and `parseIfndef`
09:33:01Araqnot sure, will review your code instead
09:34:15FromGitter<andreaferretti> ok, I am pushing
09:35:24dom96ftsf: no way for choosenim to update itself yet
09:40:06FromGitter<andreaferretti> another thing I am considering is a constant folding preprocessing step. For instance, consider a typical header guard such as ⏎ ⏎ ```when not defined(GUARD): ⏎ const ⏎ GUARD* = true ⏎ ⏎ # code here``` ⏎ ⏎ which works (at least if GUARD is a rare enough name), but it is a little annoying - I'd rather recognize this pattern and remove the `when` check and the extraneous constant
09:40:06FromGitter... [https://gitter.im/nim-lang/Nim?at=591ac8f633e9ee771cb06302]
09:42:36AraqI wanted to add a pattern matching preprocessor once
09:44:00Araq#pattern { #ifndef X #define X Y #endif } Y
09:44:19FromGitter<andreaferretti> yeah, it would make sense, but I saw that a postprocessor is already in place :-P
09:44:32FromGitter<andreaferretti> maybe it would be easier to tweak that
09:44:42Araqyeah, postprocessing is usually way easier
09:45:25FromGitter<andreaferretti> also, it would catch both `#ifdef` and `#if defined()` in a single rule
09:45:38FromGitter<andreaferretti> because they become equal after processing
09:45:54Araqfor your case, yes. preprocessing is usually much more flexible though
09:46:07FromGitter<andreaferretti> I guess so
10:04:28*bjz quit (Ping timeout: 246 seconds)
10:04:55*bjz joined #nim
10:17:04PMunchWhy doesn't the stream module have Uint versions?
10:17:18PMunchOr rather, is there a reason?
10:19:19*bjz_ joined #nim
10:19:35*bjz quit (Ping timeout: 240 seconds)
10:22:09*Vladar quit (Remote host closed the connection)
10:33:15*bjz joined #nim
10:34:27*bjz_ quit (Ping timeout: 240 seconds)
10:40:54FromGitter<andreaferretti> @how does nim handle alignment directives? I have types defined like ⏎ ⏎ ```struct __device_builtin__ __declspec(align(2)) uchar2 ⏎ { ⏎ unsigned char x, y; ⏎ };``` ⏎ ⏎ I would like to parse them with c2nim, but I am not even sure what nim code should be generated for that [https://gitter.im/nim-lang/Nim?at=591ad73683cb5db073378e5e]
10:42:24PMunchWhat's the difference in implementation between a seq and an openArray?
10:49:06*couven92 joined #nim
10:50:46AraqPMunch: seq is like vector in C++, openarray is ptr, length pair
10:52:21PMunchAh right
10:52:31PMunchBut openarray can't be returned?
10:52:55ftsfopenarray is not really a thing
10:53:01ftsffrom what i understand?
10:53:07ftsfinput only
10:53:28ftsfkind of like a generic sequence type
10:53:54ftsfthat would be generated as either a seq or array code path depending on how it's used
10:54:36PMunchHmm, but can I create a seq using newSeq and then get the .addr to read from a stream into it?
10:55:29couven92PMunch, as I was told a couple of days ago: `myOpenArray[0].addr` gives a C-like array pointer
10:55:55PMunchYeah, I know
10:56:18PMunchBut since I can't return an openArray I was looking into returning a seq
10:57:03couven92You can probably return an openarray, but I bet you can create an instance of one?
10:57:20couven92s/can/can't
10:58:00*Tiberium joined #nim
10:58:03PMunchI'm not too sure, according to the doc: "Note: Openarrays can only be used for parameters."
10:58:55couven92PMunch, true, I just tried
10:59:41couven92The compiler issues: `openarray[int]: invalid type in this context`
11:01:45PMunchYeah, that's what I thought..
11:02:21*Sembei joined #nim
11:02:21*vlad1777d joined #nim
11:02:40*Snircle joined #nim
11:04:32*aedigix quit (Remote host closed the connection)
11:07:04*aedigix joined #nim
11:09:20FromGitter<mratsim> You can get the addr or unsafeAddr of a seq. I use something like this in my array lib ⏎ ⏎ ```template get_data_ptr[T](s: seq[T]): ptr T = unsafeAddr(t[0])``` ⏎ ⏎ If `addr`works for your case use it instead of `unsafeAddr` [https://gitter.im/nim-lang/Nim?at=591adde083cb5db07337b138]
11:19:44*bjz_ joined #nim
11:22:03*bjz quit (Ping timeout: 240 seconds)
11:25:48PMunchHmm, the stream module should also really include a way to do byte ordering
11:36:54Araqwhy? we have endians.nim for that
11:37:47FromGitter<ephja> it could be done mostly implicitly though
11:39:02FromGitter<ephja> but it wouldn't require much effort with high level procs in the endians module
11:40:16FromGitter<ephja> I started working on that some time ago. I should finish it
11:41:21PMunchOh, I tried searching for nim endian and couldn't find it :)
11:46:21*Vladar joined #nim
11:46:27PMunchephja, what do you mean implicitly? I have a file that writes a 32bit magic number. Depending on this the byte ordering is identified and the rest of the file should be read with that byte ordering.
12:00:03ephjaI meant by specifying the byte order upon construction rather than for each read or write. you can't do that yet but it would be nice I think
12:04:03*krux02 joined #nim
12:07:30ephjaI'm working on a binary format atm so I'll probably want to implement such improvements soon
12:11:34*Arrrr quit (Ping timeout: 268 seconds)
12:14:59ephjasomething like messagepack but with both heterogeneous and homogeneous containers, and format specifiers that take up whole bytes, cus, jump tables!
12:15:24PMunchAh right, that sounds useful :)
12:18:27ephjaI can't say I have looked at particularly many formats, and such space and speed optimizations probably won't matter for most users though
12:34:20PMunchHmm, the fromSeconds from the times module seems to be doing weird stuff
12:35:12PMunchOr rather the timeToTimeInfo
12:35:53PMunchI get 2017-05-16T12:23:00+02:00 when I echo the time object, but 2017-05-16T11:23:00+00:00 when I echo the TimeInfo object..
12:59:33*fredrik92 joined #nim
13:03:13*couven92 quit (Ping timeout: 255 seconds)
13:09:25SentreenI am dealing with such a weird bug; the following line ` cmm = addr lmm.memory[t.cont]` (where cmm is a var that is nil up to this point, and lmm.memory is a table) will cause a string in a completely different piece of memory to change....
13:09:58SentreenI actually modify the thing that pointer points to later, but it's fetching the address and assigning it that causes the bug...
13:10:22ftsfanyone know how i can make Windows open a folder in explore from my nim program?
13:11:42*kunev quit (Ping timeout: 240 seconds)
13:12:16dom96ftsf: IIRC you just execute explorer.exe with an argument pointing to the path of the folder.
13:13:43ftsfahh that sounds like it should work =) good thinking!
13:14:05Araqftsf: import browsers; openDefaultBrowser("myfilehere.txt")
13:14:14*kunev joined #nim
13:14:54ftsfAraq, oh nice, that sounds good being cross platform too
13:15:05ftsfalthough browser might not be ideal
13:15:48ftsfhmm on linux xdg-open should probably come before gnome and kde, people are likely to have gnome and kde installed even if they're not using them.
13:16:09*fredrik92 is now known as couven92
13:20:00*krux02- joined #nim
13:20:00*krux02 quit (Disconnected by services)
13:20:09*krux02 joined #nim
13:21:37*krux02- quit (Remote host closed the connection)
13:26:26FromGitter<andreaferretti> is there something in nim such as a forward declaration of a type? analogue to the following C ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ If I parse these files using c2nim, I get a cyclic dependency between modules, and I am not sure what would be the best way to resolve it [https://gitter.im/nim-lang/Nim?at=591afe0233e9ee771cb17b63]
13:28:34dom96You'll need to put the types in the same module
13:29:12FromGitter<andreaferretti> even if I somehow manage to do this, is there a way to have them in different type sections?
13:29:48FromGitter<andreaferretti> because actually getting a single type section would require extensive modification of the original headers
13:29:55FromGitter<andreaferretti> which I am trying to avoid
13:33:17*bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
13:42:29dom96not as far as I'm aware.
13:42:52FromGitter<andreaferretti> uhm... I'll see what I manage to do
13:45:16AraqC only allows it for pointers anyway, workaround, use 'pointer' or a distinct pointer or something
14:01:48FromGitter<andreaferretti> thank you, I will try the workaround!
14:01:56FromGitter<andreaferretti> you are giving me a lot of help :-)
14:02:24FromGitter<andreaferretti> thank you
14:09:04*rauss joined #nim
14:32:38*Tiberium_ joined #nim
14:35:13*Tiberium quit (Read error: Connection reset by peer)
14:41:00*BennyElg quit (Remote host closed the connection)
14:43:34*yglukhov_ joined #nim
14:44:44yglukhov_Araq: how can i know if i'm compiled with --threads:on or off?
14:45:02Araqwhen compileOption("threads")
14:45:12yglukhov_thanks!
14:45:15Araqor maybe when compileOption("threads", "on")
14:45:40*yglukhov quit (Ping timeout: 240 seconds)
15:09:56*yglukhov_ quit (Remote host closed the connection)
15:10:53ftsfaww stack overflow when running the profiler
15:11:32ftsfhttps://gist.github.com/ftsf/eb363b445547cac00ccab74ecaad3de8
15:13:39*rauss quit (Ping timeout: 260 seconds)
15:14:25*rauss joined #nim
15:20:11*yglukhov joined #nim
15:21:36*Arrrr joined #nim
15:24:09ephjaI don't think that has been reported
15:24:22*yglukhov quit (Ping timeout: 246 seconds)
15:25:36dom96ftsf: please report it
15:25:51ftsfshall do
15:29:31ftsfactually, looks like it might be related to memory corruption on my part
15:29:44ftsfwill fix that and see if it still happens
15:34:05*nsf quit (Quit: WeeChat 1.7.1)
15:39:03*couven92 quit (Quit: Client disconnecting)
15:42:28*gokr quit (Ping timeout: 268 seconds)
15:59:11*Andris_zbx quit (Remote host closed the connection)
16:07:07FromGitter<Varriount> Hm. What are the various ways to pass in a value at compile time? For instance, a path to a header file?
16:09:27ldleworkLike in a variable to a macro?
16:09:51ldleworkIf its just to a compile time function there's no difference right?
16:12:25*gokr joined #nim
16:12:56*gokr quit (Client Quit)
16:12:58*gokr1 joined #nim
16:13:00FromGitter<Varriount> I mean, from compiler invokation
16:13:34FromGitter<Varriount> Sorry, what I meant was, how do I pass a value from the command line/compiler invocation to the program?
16:14:05FromGitter<Varriount> I know about '-d' and '--define', however those only define a symbol as present (a boolean condition)
16:17:37*gokr1 quit (Remote host closed the connection)
16:18:18FromGitter<stisa> @Varriount maybe these https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compile-time-define-pragmas ?
16:19:17FromGitter<Varriount> Hrm, that seems like a really oddly designed mechanism
16:20:07FromGitter<Varriount> @stisa I'm mainly asking, as I'm wondering if there is too much fragmentation in how to get various compile-time values
16:20:28FromGitter<Varriount> There's defines, compile time options, platforms, etc
16:22:58*couven92 joined #nim
16:23:58krux02today I went back to find out what was wrong with my offsetof implementation of packed types
16:24:34krux02aparently my code was correct, the code that is wrong is the generated C code that does not properly pack the type
16:24:49*BennyElg joined #nim
16:25:22FromGitter<stisa> @Varriount I think it's fine as long as it's documented properly. I mostly use `-d:<something>` as bool though, never had the need to pass strings etc (yet)
16:28:14FromGitter<Varriount> Yes, but I think it would be better to have just two retrieval functions, 'defined', and something like 'compileOption'
16:30:32*nsf joined #nim
16:36:49*Trustable joined #nim
16:40:36*yglukhov joined #nim
16:44:52*yglukhov quit (Ping timeout: 246 seconds)
16:55:46FromGitter<nordborn> Hi guys ⏎ ⏎ I need help ⏎ ⏎ The aim is to compile nim file with musl support and include mysqlclient into the output binary (linux x86-64). ... [https://gitter.im/nim-lang/Nim?at=591b2f1133e9ee771cb28479]
16:58:18dom96Try adding --dynlibOverride:libmysql.so (or whatever the .so name is)
16:58:46Tiberium_dom96, a suggestion for choosenim - can it use "git" if it's installed on user system? I think it's faster to update nim devel repo using git than download it from scratch :)
17:00:12dom96Tiberium_: Already requested: https://github.com/dom96/choosenim/issues/12
17:00:20Tiberium_dom96, ah, thanks :)
17:03:25Tiberium_but maybe you can make an optional switch for this?
17:16:27FromGitter<nordborn> dom96: "Try adding --dynlibOverride" failed. not linked
17:24:53Araqthat's the point.
17:25:04Araqyou need to add the static link command on your own then
17:26:06krux02Araq: did you see my newest issue I made?
17:26:43krux02aparently the packed types need to emit more __packed__ attributes so that the generated type is actually packed
17:27:13krux02but I don't know where in the code generation process I need to address this
17:27:24krux02I don't know the codebase for code generation
17:28:19Araqpacked structs are stupid shit IMO. if you need a packed layout use an array of bytes and do the unaligned accesses on your own
17:28:49Araqbut the code to touch is compiler/cggtypes.nim
17:29:48krux02well if you should use it or not doesn't really matter in my case, because I need it to work in order to be able to implement the offsetof correctly
17:30:18*Sembei quit (Ping timeout: 260 seconds)
17:46:33krux02Araq: Well for now I don't understand that codebase, and I have to go soon. it would be nice if you could give me a hint on how to implement this. I am willing to it if you accept that change.
17:48:17FromGitter<mratsim> Did I hit a bug ? I’m trying to use _ as a wildcard in a macro for multidimensional array slicing however whether it’s working or not depends on the argument order. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=591b3b61c4d73f445ab2a94f]
17:48:52FromGitter<Varriount> @mratsim 't' must be untyped
17:49:36FromGitter<Varriount> Only untyped parameters will accept undeclared/unbound identifiers
17:51:57FromGitter<mratsim> I still get the same error. @Varriount
17:52:17dom96zacharycarter: is play.nim-lang.org ready for action? i.e. can it be advertised on nim-lang.org?
17:53:47ArrrrI'd like to be able to share nim snippets with play.nim
17:55:55Arrrr(As a suggestion)
17:57:21krux02I just tested play.nim-lang.org the first time. The size of the nim crows constantly changed
17:57:50krux02I don't know the cause, but it was very distracting.
17:58:13krux02anyway I have to go, bye have a nice evening/day/night
17:58:15krux02exit
17:58:16*krux02 quit (Remote host closed the connection)
17:59:44*nsf quit (Quit: WeeChat 1.7.1)
18:01:19*themagician joined #nim
18:01:34FromGitter<Varriount> @mratsim Could you post the full code?
18:01:36FromGitter<mratsim> @Varriount I probably have to do something similar to this bug report: use a template inside a macro - https://github.com/nim-lang/Nim/issues/4669
18:01:44FromGitter<ephja> it seems as though "proc p[T:C; U:C]" where C is (Foo|Bar) doesn't work if T and U aren't both instantiated with Foo or Bar
18:02:15FromGitter<Varriount> @ephja: 'C' must be the same type.
18:05:31*yglukhov joined #nim
18:05:40FromGitter<mratsim> @Varriount There is probably some unforeseen interference/scoping/whatever issue, I’ve created a clean file (without my custom type) and I can get the AST, so bug hunting time. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=591b3f749f4f4ab05bce72b3]
18:05:56FromGitter<ephja> p[Foo, Bar] fails that is, while p[Foo, Foo] doesn't
18:06:37FromGitter<mratsim> I’ve already reported this @ephja
18:07:07*yglukhov quit (Remote host closed the connection)
18:07:19FromGitter<mratsim> Here: https://github.com/nim-lang/Nim/issues/5641 I think it’s the same
18:08:25FromGitter<ephja> Oh I see. Could it be another concept branch regression?
18:09:04FromGitter<mratsim> it was already there before concept branch was merged
18:10:09FromGitter<ephja> you're right
18:13:19*PMunch quit (Quit: leaving)
18:17:41*couven92 quit (Ping timeout: 255 seconds)
18:19:15*Tiberium_ quit (Remote host closed the connection)
18:28:36FromGitter<mratsim> @Varriount I reproduced with `seq` I believe it’s because seq and my custom type already defines a `[]` operation. However I don’t understand why one order works and display the AST tree and the other use the other operation: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=591b44d48a05641b118b9390]
18:30:58*rauss quit (Ping timeout: 260 seconds)
18:32:45*rauss joined #nim
18:35:29*rauss quit (Client Quit)
18:35:42FromGitter<ephja> will type AST introspection allow for the implementation of a typedesc set construct?
18:38:02*dddddd joined #nim
18:44:49*skrylar quit (Remote host closed the connection)
18:45:10*skrylar joined #nim
18:48:21*smt joined #nim
18:51:27*smt_ quit (Ping timeout: 240 seconds)
18:53:59FromGitter<Varriount> typedescs aren't enumerable
18:56:18*Arrrr quit (Read error: Connection reset by peer)
18:57:03*Ven joined #nim
18:57:27*Ven is now known as Guest52168
19:02:39*Vladar quit (Quit: Leaving)
19:06:57*nsf joined #nim
19:09:17*smt_ joined #nim
19:10:45*Trustable quit (Read error: Connection reset by peer)
19:11:01*Trustable joined #nim
19:12:14*planhths joined #nim
19:13:22*smt quit (Ping timeout: 268 seconds)
19:16:45*rauss joined #nim
19:18:18*Matthias247 joined #nim
19:20:17*libman joined #nim
19:21:48*rauss quit (Ping timeout: 272 seconds)
19:26:18*smt joined #nim
19:27:07*Sembei joined #nim
19:30:01*smt_ quit (Ping timeout: 268 seconds)
19:39:11*Guest52168 quit (Ping timeout: 260 seconds)
19:42:23FromGitter<ephja> @Varriount yes that's right, so you would need a separate set implementation that operates on ASTs.
19:42:52*Ven_ joined #nim
19:43:16*Sembei quit (Read error: Connection reset by peer)
19:43:25*yglukhov joined #nim
19:44:31*Sembei joined #nim
19:47:49*skrylar quit (Remote host closed the connection)
19:47:58*Ven_ quit (Ping timeout: 260 seconds)
19:48:15*skrylar joined #nim
19:48:48FromGitter<zacharycarter> @dom96: someone mentioned it on reddit a couple of weeks ago so I don't see why not. Although if we want to add more features first, like snippets I can work on that this weekend.
19:55:28*Jesin quit (Quit: Leaving)
19:58:34*Ven joined #nim
19:58:58*Ven is now known as Guest60500
19:59:35*couven92 joined #nim
20:09:53*Jesin joined #nim
20:13:01*gokr joined #nim
20:25:15*Sembei quit (Read error: Connection reset by peer)
20:25:28*Matthias247 quit (Read error: Connection reset by peer)
20:25:40*Guest60500 quit (Ping timeout: 240 seconds)
20:27:05*Ven_ joined #nim
20:28:27*Sembei joined #nim
20:32:05*rauss joined #nim
20:34:17*m712 quit (Changing host)
20:34:17*m712 joined #nim
20:41:09*Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:48:49*Ven_ joined #nim
20:48:51*bjz joined #nim
20:49:40*couven92 quit (Ping timeout: 240 seconds)
20:51:16*ephja quit (Read error: Connection reset by peer)
20:51:50*couven92 joined #nim
21:02:49*skrylar quit (Remote host closed the connection)
21:03:12*skrylar joined #nim
21:06:26*Sembei quit (Quit: WeeChat 1.9-dev)
21:06:45*Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:10:28*Matthias247 joined #nim
21:36:10*rauss quit (Ping timeout: 240 seconds)
21:37:31*rauss joined #nim
21:44:09*Trustable quit (Remote host closed the connection)
21:46:40*rauss quit (Quit: WeeChat 1.8)
21:47:25*planhths quit (Quit: Konversation terminated!)
21:49:22bozaloshtshIs there a way to tell the compiler to ignore a "defined but unused" hint for a particular proc that I've defined?
21:51:58bozaloshtshdiscard <proc name> just gives me an error (statement returns no value that can be discarded)
21:52:13*nsf quit (Quit: WeeChat 1.7.1)
21:56:06FromGitter<ephja> {.hint[XDeclaredButNotUsed]: off.} ?
22:03:58Araqproc foo() {.used.}
22:21:34bozaloshtshcool thanks
22:24:35*yglukhov quit (Remote host closed the connection)
22:28:20*Trioxin quit (Read error: Connection reset by peer)
22:28:26*Trioxin2 joined #nim
22:36:45FromGitter<ephja> new shortcut, is it?
23:00:49*themagician quit ()
23:02:25bozaloshtshAraq: that doesn't work (using latest devel)
23:14:29*gokr quit (Ping timeout: 268 seconds)
23:19:42*dddddd quit (Read error: Connection reset by peer)
23:21:01*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
23:28:43*Jesin quit (Quit: Leaving)
23:37:02*Jesin joined #nim
23:42:04*pilne joined #nim
23:51:20*skrylar quit (Remote host closed the connection)
23:51:47*skrylar joined #nim