<< 03-05-2019 >>

00:12:07*cyberjpn quit (Ping timeout: 246 seconds)
00:13:08*rnrwashere quit (Remote host closed the connection)
00:14:01*thomasross quit (Remote host closed the connection)
00:14:30*thomasross joined #nim
00:16:21*thomasross quit (Max SendQ exceeded)
00:16:50*thomasross joined #nim
00:22:08*rnrwashere joined #nim
00:37:56*stefanos82 quit (Remote host closed the connection)
00:39:43*jasper_ quit (Ping timeout: 256 seconds)
00:42:48*rnrwashere quit (Remote host closed the connection)
01:24:32*Snircle_ quit (Read error: Connection reset by peer)
01:25:06*Snircle joined #nim
01:31:13*rockcavera joined #nim
01:34:50*thomasross quit (Read error: Connection reset by peer)
01:36:17*thomasross joined #nim
01:44:19*Elronnd quit (Ping timeout: 264 seconds)
01:46:13*Elronnd joined #nim
01:59:52*tribly quit (Ping timeout: 244 seconds)
02:00:17*banc quit (Quit: Bye)
02:00:19*tribly joined #nim
02:21:06*banc joined #nim
02:22:18*cyberjpn joined #nim
02:31:30*NimBot joined #nim
02:48:33*smitop quit (Quit: Connection closed for inactivity)
02:51:01*cyberjpn quit (Ping timeout: 246 seconds)
03:08:17*Hexeratops quit (Remote host closed the connection)
03:09:31*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
03:38:52*rockcavera quit (Read error: Connection reset by peer)
04:06:55*cyberjpn joined #nim
04:22:44*cyberjpn quit (Ping timeout: 250 seconds)
04:27:18*nsf joined #nim
04:54:22*Jjp137 quit (Ping timeout: 250 seconds)
04:56:45*narimiran joined #nim
04:57:05*cyberjpn joined #nim
05:01:20*Jjp137 joined #nim
05:47:04*rockcavera joined #nim
06:05:24*jjido joined #nim
06:07:39*jasper_ joined #nim
06:12:39*cyberjpn quit (Quit: WeeChat 2.4)
06:19:15*solitudesf joined #nim
06:34:13*krux02 joined #nim
06:36:42FromGitter<alehander42> so hm i wonder if async can match actors/goroutines in throughput
06:37:47FromGitter<alehander42> e.g. if i want to accept 10000 requests , and work on them mostly concurrently so i have low latency for new requests, would that be easy with async
06:37:54FromGitter<alehander42> or would i need to tweak stuff
06:39:53FromGitter<alehander42> how much control do i have on the event loop: and i guess it's effectively cooperative multitasking, is it possible to limit for an async function how much time it spends in the event loop
06:40:37FromGitter<alehander42> e.g. i imagine that it goes like event loop: calling a1 a2 a3 a1 a3 a1 a4 a1 a5 etc but it's possible that a1 gets somewhere , blocks and doesnt yield
06:40:58FromGitter<alehander42> hm i can have nonblocking effects
06:42:20FromGitter<alehander42> or just preemptive functions: a macro which turns a function into preemptive, inserting preemptive yields on each line
06:42:43FromGitter<alehander42> but this wouldn't work as you'd hit a blocking slow call sooner or later
06:43:39FromGitter<alehander42> oh i see goroutines start a new thread when they do some slow syscalls
06:44:02FromGitter<alehander42> so the go scheduler just starts a thread .. and copies args/return ..
06:44:54FromGitter<alehander42> if i am understanding correctly? this might work for such a macro: detect io with effects and automatically convert it to a call into a new thread which is .. awaited
06:45:02FromGitter<alehander42> is it possible to await other thread calls
06:45:11*PMunch joined #nim
06:46:47FromGitter<alehander42> preemptive a: ⏎ b + read() # converted to async .. b + await inThread(read() )
06:46:50FromGitter<mratsim> @alehander42 I guess the best example would be Erlang/Elixir BeamVM, afaik Discord is built using Actors (or was it WhatsApp or both?)
06:46:56FromGitter<alehander42> one would have a pool of threads and reuse them
06:47:17FromGitter<alehander42> yes exactly, but i am trying to imagine how it would look reusing the current async dispatch
06:47:20FromGitter<mratsim> M:N multiplexing is quite hard
06:47:20FromGitter<alehander42> if it's possible at all
06:47:51FromGitter<alehander42> yes whatsapp is a famous erlang-based app
06:47:55FromGitter<mratsim> @stefantalparu integrated the go gc in Nim and you can use goroutines with that
06:48:10FromGitter<alehander42> yeah i guess i can build an actors or golike library
06:48:26FromGitter<alehander42> but i wanted to see if one can reuse async/await somehow
06:48:45FromGitter<mratsim> give me a min, I found an interesting link on implementing actors from scratch for a VM language implemented in Rust
06:49:30FromGitter<alehander42> i think i've seen the go lib by @stefantalparu , great work
06:49:54FromGitter<mratsim> Here you go: https://blog.subnetzero.io/post/building-language-vm-part-22/
06:50:10FromGitter<alehander42> otherwise i remember threads + async wasn't quite ok in nim .. flow vars not mixing well or something
06:50:16FromGitter<alehander42> maybe not sure
06:50:17FromGitter<alehander42> thanks
06:51:04FromGitter<mratsim> and the github: https://github.com/fhaynes/iridium
06:52:22FromGitter<mratsim> I think the BeamVM part is still in construction, the scheduler is super simple
07:00:00*gmpreussner quit (Quit: kthxbye)
07:04:41*gmpreussner joined #nim
07:05:59*slugm joined #nim
07:07:42FromGitter<alehander42> Yeag
07:07:50FromGitter<alehander42> Looks great
07:08:51*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
07:09:17FromGitter<alehander42> But I wonder if an actor framework would be a good fit for nim and how.it would run
07:09:42FromGitter<alehander42> Afaik beam schedules preemptively actors based on calls in bytexode
07:10:06FromGitter<alehander42> Which e.g l. Works because looping is done with recursion
07:10:21FromGitter<alehander42> So it's hard to block without making a call
07:11:25FromGitter<alehander42> But what do.they do with io and syscalls
07:18:18FromGitter<mratsim> monster on the forum wanted to do an actor framework in Nim done right (AFAIK he was experienced with Akka and found many flaws) and after his announcement he disappeared never to be found again ;)
07:18:42FromGitter<mratsim> https://forum.nim-lang.org/t/3291
07:51:18*slugm quit (Read error: Connection reset by peer)
07:51:35*slugm joined #nim
07:58:15*solitudesf quit (Ping timeout: 258 seconds)
08:02:52*Vladar joined #nim
08:13:27*jasper_ quit (Quit: Page closed)
08:36:05FromGitter<alehander42> hm actix (https://github.com/actix/actix-web) also uses actors
08:36:14*floppydh joined #nim
08:36:35FromGitter<alehander42> yeah sounds like reasonable ideas
08:36:41FromGitter<alehander42> i wonder if he made his game
08:36:44FromGitter<alehander42> or started something else
08:37:44FromGitter<alehander42> https://github.com/evacchi/nimoy also
08:40:30*neceve joined #nim
08:51:45FromGitter<mratsim> lol: https://github.com/evacchi/nimoy/issues/2
08:58:56*floppydh quit (Quit: WeeChat 2.4)
09:02:19*floppydh joined #nim
09:10:01*stefanos82 joined #nim
09:13:30FromGitter<zetashift> WhatsApp uses erlang, DIscord uses elixir but they did a lot of stuff to make it work at their scale: https://blog.discordapp.com/scaling-elixir-f9b8e1e7c29b
09:21:58*rockcavera quit (Ping timeout: 246 seconds)
09:26:32*rayman22201 joined #nim
09:42:31*thomasross quit (Remote host closed the connection)
09:44:23*thomasross joined #nim
09:45:07*thomasross quit (Remote host closed the connection)
09:55:49*xet7 joined #nim
09:55:56*Snircle joined #nim
10:04:30*lritter joined #nim
10:05:56*solitudesf joined #nim
10:10:41*smitop joined #nim
10:41:18narimiranleorize: are you here maybe?
10:43:28*leorize waves
10:45:54leorizenarimiran: ping
10:46:04narimirani don't know if it is nvim.nim or some other plugin which was updated, but now my nim code very often gets indented when it shouldn't. e.g. my top-level proc, after some commented line, gets 2-space indent
10:46:57leorizeprobably nim.nvim
10:47:05leorizecan you make a file to demonstrate the bug?
10:48:20narimiranwill do
10:48:21leorizeit doesn't have to be correct Nim
10:48:33leorizejust a few lines around the buggy area should do
10:49:54narimiranok, i have it
10:50:12narimirani guess it checks if the previous non-empty line was indented
10:50:49narimiransee here: http://ix.io/1HTj
10:51:40narimirani started typing `proc bar` without any indent, then suddenly - indented. for test, you can unindent, and start typing `: int` at the end
10:53:12leorizecan't reproduce :P
10:53:21leorizeare you using the latest commits?
10:54:09*Perkol joined #nim
10:55:39narimirani just did `:PlugUpdate` and i can reproduce it
10:55:52leorizealright, wait for me a bit
10:56:40narimiranIIRC you have worked on indentation, so i guess this is connected to it. it is just a bit too eager to indent :)
10:56:58leorizeI reverted it and moved everything to indentexp branch :p
10:57:17leorizeso... how can I reproduce this?
10:57:30leorizeunindent the `bar` at the end then add `: int`?
10:59:05narimiranthat's how i do it :)
10:59:38narimiranit seems it is triggered by `:`
10:59:44leorizeI.. can't reproduce this :p
11:00:09narimirani can type anything else and it is ok, but just as i press `:`, that line gets indented....
11:00:26leorizeyea, that character is an indent trigger
11:00:37leorizehttps://asciinema.org/a/twsEnj3z4ddzod82mG8NDQonS
11:00:44leorizenarimiran: ^ am I doing this correctly ?
11:01:16narimiranyes, that should be it
11:02:04leorizeI've tested on both master and indentexp branches
11:02:09leorizecan't reproduce :/
11:02:25leorizecan you check what commit you're on?
11:02:57narimirantry typing the whole line from the beginning, but exit insert mode after parentheses. then you go to insert mode and press `:`
11:03:10narimiranif i type the whole line without exiting, it is ok :/
11:03:33narimirancommit f5a91a7
11:04:43leorizethat should be the latest one :/
11:04:48leorizenarimiran: https://asciinema.org/a/JArbTuseqej7x9evQqiuMDP62
11:05:08leorizestill can't reproduce :/
11:05:13leorizecan you try recording it?
11:05:46narimirani've never used asciinema, let me see if i can set it up
11:07:05narimiranheh, it seems that restarting nvim is all it took :D :D
11:07:21leorizewait, you didn't restart after update? :p
11:07:30narimiransorry
11:07:49narimirannow you know what to ask for the next time i complain ;)
11:07:54leorizenp :p I caused a bug like that sometime ago, so was worried that I didn't fully fix it :p
11:08:17leorizeif you have time, can you try the indentexp branch?
11:09:07narimiranis there a way to switch to that branch from nvim? or: how do i do it?
11:09:31leorizego to where your plugin installer clone the git repo
11:09:39leorizethen just git checkout indentexp
11:10:12narimiranah, nice and easy. ok, what should i be testing? that LongTuple example that you showed and stuff like that?
11:10:36leorizeyea
11:10:48leorizejust use it for a while with your projects that should be fine :)
11:15:40narimiranok, tested with long tuple and it works as advertised :) will keep using it, and ping you if i find something unexpected. thanks for the help!
11:34:16*jken quit (Quit: ZNC - http://znc.in)
11:36:16*rayman22201 quit (Quit: Connection closed for inactivity)
11:47:35*vlad1777d joined #nim
12:17:57*slugm quit (Read error: Connection reset by peer)
12:18:20*slugm joined #nim
12:23:38*floppydh quit (Quit: WeeChat 2.4)
12:33:23FromGitter<alehander42> i found my laptop screen rotates based on the way i tilt laptop
12:33:36FromGitter<alehander42> modern laptops are confusing me !
12:42:15*Vladar quit (Remote host closed the connection)
12:43:29*nsf quit (Quit: WeeChat 2.4)
13:08:20FromGitter<arnetheduck> wow, laptop with orientation sensor?? is it one of those fancy things that can convert to tablet by flipping the screen around?
13:10:32FromGitter<alehander42> no, but i saw one of those yesterday
13:10:42FromGitter<alehander42> and you can write with a pen on the screen
13:10:47FromGitter<alehander42> (of the tablet one)
13:10:58FromGitter<alehander42> but the guy said its a bit heavy to use as a tablet usually
13:11:09FromGitter<alehander42> i just wanted a ssd
13:11:23*cybj quit (Quit: WeeChat 2.4)
13:11:56FromGitter<alehander42> and now, i was sitting in a room, tilting my laptop in all directions like a GMO androidphone
13:12:15FromGitter<alehander42> but its not bad, i am getting used to it
13:14:35FromGitter<alehander42> might even use it for code editing
13:17:00FromGitter<arnetheduck> when I still had a "normal" 16:9 screen, I'd use it tilted to get a really tall editing area - fantastic for code
13:19:06FromGitter<alehander42> my screen is smaller i guess
13:19:13FromGitter<alehander42> but it seems really nice as an idea
13:19:23FromGitter<alehander42> i think i can even have split screen
13:19:34FromGitter<alehander42> and fit in
13:19:53*smitop quit (Quit: Connection closed for inactivity)
13:20:02FromGitter<alehander42> but i am not used to second monitor
13:25:06FromGitter<arnetheduck> well, with a laptop and external monitor, I kept the external monitor tilted - at work I used to have two 1920x1080 rotated monitors and one straight.. the straight one is good for terminals, but for code and browsing, rotated is king..
13:31:47FromGitter<alehander42> interesting, ii've noticed often i scroll in the terminal, but maybe i am still using too much print-debugging (the irony is not lost on me)
13:34:46*rockcavera joined #nim
13:41:07PMunchHmm, is there a way to limit how much a HttpClient will download?
13:46:33FromGitter<arnetheduck> yeah, but my log lines tend to be long whereas my code is (almost always) 80 chars :) and web pages, well, wide paragraphs are slower to read, generally (not great for movies/gaming though)
13:55:02*Perkol quit (Remote host closed the connection)
14:13:24*PMunch quit (Remote host closed the connection)
14:16:17*JappleAck quit (Ping timeout: 245 seconds)
14:30:12*lritter quit (Read error: Connection reset by peer)
14:32:19*Vladar joined #nim
14:37:54*slugm quit (Remote host closed the connection)
14:39:08*slugm joined #nim
14:56:37FromGitter<iffy> Is there an existing way to parse and format dates in a language/locale other than English? Seems like `times` is English-only?
14:58:09leorizewouldn't `parse` with a custom format work?
15:03:35FromGitter<iffy> leorize: I don't think so. It's the month names that make it hard. For instance, parsing or generating this Polish date: `30 kwi 2019`
15:04:01FromGitter<iffy> which is `Apr 30, 2019` in English
15:05:17leorizeah, i see
15:06:30*slugm quit (Remote host closed the connection)
15:08:01*slugm joined #nim
15:15:00*abm joined #nim
15:16:22FromGitter<iffy> If I was able to contribute locale-aware time parsing/formatting, would it be best as a change to `times`? or should I make an nimble package?
15:18:15narimirani would say nimble package is the way to go
15:27:35*slugm_ joined #nim
15:30:47*slugm quit (Ping timeout: 268 seconds)
15:34:29*krux02 quit (Remote host closed the connection)
15:41:07*lritter joined #nim
16:15:58*hzx joined #nim
16:16:12hzxHey! Any news on Nim-land? :)
16:16:16FromGitter<iffy> hmmm... this is leading me down the interface/abstract class/concept rabbit hole. Any recommendations on the best way to implement locales? They have static things like "names of the month" but they might also have procs like "given a number, convert it to an ordinal number (e.g. 1 -> 1st, 2 -> 2nd, etc...)"
16:23:48*solitudesf quit (Ping timeout: 250 seconds)
16:26:15federico3https://lobste.rs/s/3rgahq/introduction_zig_programming_language Nim is mentioned here
16:29:29*tefter joined #nim
16:43:57shashlickcan anyone send me a lobsters invite?
16:44:21shashlickI'd like to reply to that thread
16:44:36narimiranfederico3: ^
16:51:44disruptekillformed AST is a bug i should always report?
16:52:00leorizedepends
16:52:24disruptekonly if it's due to seemingly valid syntax, right?
16:52:46disruptek(this is hypothetical)
16:54:22*Jesin quit (Quit: Leaving)
16:56:21*nsf joined #nim
16:57:13disruptekso what i don't understand about the const exceptions proposal is, are they just stored on the stack? and we just check for value equality at our handler target sites?
16:58:08*rnrwashere joined #nim
16:59:39*Jesin joined #nim
17:02:18FromGitter<kaushalmodi> shashlick: I sent you one
17:06:24shashlickwow thanks!
17:06:28*solitudesf joined #nim
17:16:37*neceve quit (Read error: Connection reset by peer)
17:17:12FromGitter<kaushalmodi> Is there a way to catch exceptions thrown by importc'd functions?
17:17:58FromGitter<kaushalmodi> I am doing : ⏎ ⏎ ```try: ⏎ some_imported_fn() ⏎ except: ⏎ echo "imported fn failed"``` ⏎ ⏎ that doesn't work [https://gitter.im/nim-lang/Nim?at=5ccc77c6e416b84519249602]
17:18:02*uptime quit (Quit: Ping timeout: 245 seconds)
17:18:41FromGitter<kaushalmodi> In this case, the imported C++ is causing SIGFPE error
17:19:30*Jesin quit (Quit: Leaving)
17:19:59*rnrwashere quit (Remote host closed the connection)
17:22:02*Jesin joined #nim
17:23:10shashlickSounds like you need to use signal handler for that
17:23:24shashlickNot sure if that can even be intercepted
17:23:57FromGitter<kaushalmodi> hmm :/
17:24:13FromGitter<kaushalmodi> I tried this: https://nim-lang.github.io/Nim/manual.html#exception-handling-imported-exceptions, but the thing is that I am not raising those exceptions in Nim
17:24:25FromGitter<kaushalmodi> so that's why that feature doesn't work for me
17:25:40*slugm_ quit (Ping timeout: 246 seconds)
17:26:23FromGitter<kaushalmodi> shashlick: Can you point me to signal handling syntax?
17:31:14shashlickthere's some stuff in the posix module
17:32:50shashlickand here's something from 8 years ago - https://gist.github.com/dom96/908782
17:38:46FromGitter<jrfondren> "maybe some unholy marriage of Nim-Zig". just write a Zig compilation target :)
17:39:11FromGitter<kaushalmodi> shashlick: thanks. It's still not clear how to implement that for catching exception in my case
17:39:19FromGitter<kaushalmodi> I am tracking this issue in the meanwhile: https://github.com/nim-lang/Nim/issues/3571
17:40:42FromGitter<jrfondren> it's not clear? shouldn't it just be setting a SIGFPE handler?
17:41:50shashlick@kaushalmodi: https://github.com/nim-lang/Nim/issues/4057#issuecomment-312347754
17:42:04FromGitter<jrfondren> SIGFPE is apparently a thread-specific signal however
17:42:06shashlickmight want to see how setControlCHook() works
17:43:30shashlickno implementation - must be some vm magic
17:45:16*rnrwashere joined #nim
17:45:23FromGitter<kaushalmodi> shashlick: that didn't work ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ccc7e325b3f941aa5d72630]
17:46:15FromDiscord_<treeform> I wish nim would just compile and run a file without `c -r`. Like `nim foo.nim` would be same as `nim c -r foo.nim`.
17:46:38FromDiscord_<treeform> I want to know why it does not do this already.
17:46:50FromGitter<kaushalmodi> shashlick: By didn't work, I meant that the C++ exception is still happening
17:46:53FromGitter<arnetheduck> afair, the nim signal handling in the nim std lib is broken, as is dom96's example above - there's only a very short list of functions you're allowed call from inside a signal handler - in particular, you can't allocate memory or do stuff like setjmp etc. http://www.man7.org/linux/man-pages/man7/signal-safety.7.html
17:47:35FromGitter<kaushalmodi> @jrfondren I don't know how to use SIGFPE instead of SIGINT in that example; https://en.wikipedia.org/wiki/Signal_(IPC)#POSIX_signals SIGFPE doesn't have a value assigned in the table here (says "n/a")
17:48:45FromGitter<kaushalmodi> ok, I'll catch the person who wrote that C++ library (that my Nim code is using) to do better checks on the input arguments and failing gracefully :)
17:48:49FromGitter<jrfondren> probably 8.
17:49:30shashlick@kaushalmodi - that is catching SIGINT, not SIGFPE
17:51:25FromGitter<kaushalmodi> yes, so i was trying to figure out what enum value to set for SIGFPE
17:52:52shashlickany git experts here - how do i fix this ridiculous history for a single commit change? https://github.com/nim-lang/nimble/compare/master...genotrance:nocompiler-recursive-test?expand=1
17:53:08*rnrwashere quit (Remote host closed the connection)
17:53:33shashlickSIGFPE is defined to 8
17:55:07FromGitter<jrfondren> shashlick: copy your changes, delete your repo, then check it back out, then create a new branch, then put your changes in that branch, then commit and push them, then create a PR from that branch.
17:55:16narimiranshashlick: `git rebase -i 8f0f20d^1` and then squash most of those?
17:55:28FromGitter<jrfondren> not a git expert, which is why any solution I offer will always include those first two steps.
17:55:51shashlickgit sucks
17:56:18FromGitter<jrfondren> well I'm sure some kind of Stockholm syndrome will kick in if I get through this Git Pro book.
17:56:33FromGitter<kaushalmodi> shashlick: In any case, here's the working version of dom's code using current devel: http://ix.io/1HVt
18:00:19FromGitter<jrfondren> speaking of not being a git expert
18:00:32narimiranshashlick: ...or, as @jrfondren said, maybe it will be easier/faster to just create a new branch from current 'upstream/master' and then apply those changes manually :)
18:00:41FromGitter<jrfondren> https://github.com/nim-lang/Nim/pull/11132 <- this is now broken because someone came along and cleaned up the original message.
18:00:50FromGitter<arnetheduck> or leave the branch as-is and press the squash-merge button in github when merging
18:00:58narimiran@jrfondren i'm that someone :)
18:01:27leorizehttps://xkcd.com/1597/
18:01:50shashlickthis is the n'th time i've seen this dumb git log
18:01:58shashlickeven though I git reset --hard upstream/master
18:02:01FromGitter<jrfondren> good example of "ha ha just serious"
18:02:56narimiran@jrfondren you can resolve conflicts on github, it shouldn't be a problem
18:03:22FromGitter<jrfondren> yeah... it's less of a bother than I thought. damnit that Stockholm syndrome is kicking in already.
18:03:36narimiranbtw, nice PR :)
18:04:21narimiran@arnetheduck heh, true, squashing when merging should be the easiest solution by far :)
18:04:48FromGitter<arnetheduck> don't do tomorrow what you can do the day after
18:05:03FromGitter<kaushalmodi> Womwi
18:05:15FromGitter<kaushalmodi> Someone said something about git?
18:05:34FromGitter<kaushalmodi> I wish I could elaborate on that right now but on a move now :)
18:11:02*uptime joined #nim
18:13:42shashlick@kaushalmodi - you should be able to use sigaction in posix
18:14:15shashlickhttps://www.gnu.org/software/libc/manual/html_node/Sigaction-Function-Example.html
18:14:19shashlickall that is exposed in posix
18:23:06*jjido joined #nim
18:30:41*Jesin quit (Quit: Leaving)
18:38:23*Jesin joined #nim
18:58:27FromGitter<liquid600pgm> to anyone with OpenGL experience: is there any *good* documentation for ARB_direct_state_access? the official doc (https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_direct_state_access.txt) is pretty shit, I can't understand any of it
18:59:06FromGitter<liquid600pgm> right now I'm feeding off of krux02's opengl-sandbox repo http://github.com/krux02/opengl-sandbox
18:59:56FromGitter<liquid600pgm> and still can't figure out why all of my textures only have the red channel
19:17:53*abm quit (Remote host closed the connection)
19:18:20*abm joined #nim
19:22:50FromGitter<kaushalmodi> shashlick: thanks for that info on sigaction
19:23:06FromGitter<kaushalmodi> looks like I'll have to make this a separate Nim project for some other day
19:23:18FromGitter<kaushalmodi> need to understand the sigaction struct first: http://man7.org/linux/man-pages/man2/rt_sigaction.2.html
19:32:39noonienhello
19:34:19noonienhow can i assign to an `var x: array[10, byte]`?
19:34:45noonieni've tried `[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]`, but i get a `Error: type mismatch: got <array[0..9, int]> but expected 'array[0..9, byte]'`
19:34:55noonieni'd rather not cast elements if possible
19:35:22FromGitter<liquid600pgm> you only need to cast the first element: `[byte 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]`
19:35:41FromGitter<kaushalmodi> that's not "casting", but yes
19:35:44FromGitter<liquid600pgm> so it's not that terrible
19:35:53FromGitter<kaushalmodi> I like the `0.byte` syntax :)
19:36:14FromGitter<liquid600pgm> I prefer `[byte 0` for arrays, otherwise I use the dot syntax too
19:37:14noonienhehe, this is the only reason i dislike UCS
19:37:20noonieneveryone has a different preference
19:37:31noonienbut the convenience is pretty great
19:37:47FromGitter<kaushalmodi> > everyone has a different preference ⏎ ⏎ that's why Nim rocks!
19:38:42FromGitter<iffy> Is there a way to enforce that an object adheres to a concept?
19:39:06FromGitter<iffy> enforce == fail compilation (or even failing an assertion would be okay)
19:41:11*jasper_ joined #nim
19:44:40FromGitter<iffy> oh... `is` might work
19:47:06FromGitter<iffy> yup, `is` works just fine :)
19:51:41FromGitter<jrfondren> ```$ cat /lib64/libncursesw.so ⏎ INPUT(libncursesw.so.6 -ltinfo)``` [https://gitter.im/nim-lang/Nim?at=5ccc9bcc97dcb371d85a8263]
19:51:46FromGitter<jrfondren> what the hell is that?
20:01:55*narimiran quit (Remote host closed the connection)
20:03:46FromGitter<liquid600pgm> @iffy you can also use generics, like `[T: MyConcept]`
20:04:24*EastByte quit (Read error: Connection reset by peer)
20:04:25*EastByte_ joined #nim
20:05:16*bars0 joined #nim
20:07:34*rnrwashere joined #nim
20:07:49*rnrwashere quit (Client Quit)
20:09:00FromGitter<kaushalmodi> shashlick: I got some work started on sigaction .. started by putting in documentation: http://ix.io/1HWD
20:14:49FromGitter<jrfondren> https://github.com/Udiknedormin/NimContracts looks pretty cool if you're more interested in enforcing invariants than just in concepts
20:16:57FromGitter<kaushalmodi> ok, my eyes are glazing over as I am reading man sigaction
20:27:30shashlick@kaushalmodi - all this is in the posix module, why are you doing it again?
20:28:44*hzx quit (Quit: Going offline, see ya! (www.adiirc.com))
20:37:29*Hexeratops joined #nim
20:40:14FromGitter<kaushalmodi> shashlick: of course! :P
20:40:25FromGitter<kaushalmodi> ok, I will read that source code
20:40:53*abm quit (Remote host closed the connection)
20:41:19*abm joined #nim
20:41:45*abm quit (Client Quit)
20:45:32*Vladar quit (Remote host closed the connection)
20:45:48noonienwhere can i read more about `type`? not the statement, but the type, for example, when passing to a proc: `proc foo(t: type)`
20:46:03noonienif t is an object, how can i get its fields?
21:04:17FromGitter<kaushalmodi> shashlick: thanks to the pointer to posix. Here's an example ( http://ix.io/1HWZ ) that sort of translates the example you posted earlier ( https://www.gnu.org/software/libc/manual/html_node/Sigaction-Function-Example.html )
21:05:23*nsf quit (Quit: WeeChat 2.4)
21:13:31*lritter quit (Ping timeout: 246 seconds)
21:16:07dom96hello all
21:16:56FromGitter<kayabaNerve> Hello
21:21:44*smitop joined #nim
21:32:13FromGitter<kaushalmodi> Can I get help with this code: http://ix.io/1HXb ? ⏎ ⏎ I am getting error: "cannot use symbol of kind 'enumfield' as a 'let'
21:34:48jasper_noonien: Can't help with docs. But for the fields thing, here is a macro solution: http://ix.io/1HX4/nim
21:39:06*TheManiac[m] quit (*.net *.split)
21:39:07*dashed quit (*.net *.split)
21:39:07*nimblepoultry quit (*.net *.split)
21:39:07*msmorgan quit (*.net *.split)
21:41:55FromGitter<kaushalmodi> > Can I get help with this code ⏎ ⏎ OK, figured out.. the `sigType` template argument identifier was getting reused in a different context in that template; fixed by naming
21:43:53*serialdev[m]1 quit (*.net *.split)
21:43:53*MD87 quit (*.net *.split)
21:43:53*l1x quit (*.net *.split)
21:43:53*r4vi quit (*.net *.split)
21:43:53*oprypin quit (*.net *.split)
21:43:53*planetis[m] quit (*.net *.split)
21:43:53*federico3[m] quit (*.net *.split)
21:43:53*Demos[m] quit (*.net *.split)
21:43:53*sendell[m] quit (*.net *.split)
21:43:53*dyce[m] quit (*.net *.split)
21:43:53*avsej quit (*.net *.split)
21:46:22*tefter quit (Remote host closed the connection)
21:52:23*theelous3_ joined #nim
22:02:08FromGitter<kaushalmodi> Can I pass a function identifier to a template and have the template call that function?
22:02:57FromGitter<kaushalmodi> If so, what would be the "type" of that function identifer, and how would I "call" that function (actually a proc) in that template?
22:04:06*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:05:21*jjido joined #nim
22:07:23*TheManiac[m] joined #nim
22:07:32*dashed joined #nim
22:07:41*nimblepoultry joined #nim
22:07:42*msmorgan joined #nim
22:07:56*avsej joined #nim
22:07:59*avsej quit (Changing host)
22:07:59*avsej joined #nim
22:08:18*r4vi joined #nim
22:08:22*MD87 joined #nim
22:08:59*oprypin joined #nim
22:09:08*l1x joined #nim
22:09:13*xet7 quit (Ping timeout: 250 seconds)
22:09:15*snowolf quit (Ping timeout: 250 seconds)
22:09:35*snowolf joined #nim
22:10:32*xet7 joined #nim
22:11:00*serialdev[m]1 joined #nim
22:11:59*dyce[m] joined #nim
22:12:02*sendell[m] joined #nim
22:13:10*federico3[m] joined #nim
22:13:11*planetis[m] joined #nim
22:14:37*Demos[m] joined #nim
22:17:27*FromGitter quit (Ping timeout: 264 seconds)
22:18:12*FromGitter joined #nim
22:18:32*xet7 quit (Quit: Leaving)
22:19:44*isaac[m]1 quit (Ping timeout: 264 seconds)
22:20:08*xet7 joined #nim
22:20:28*xet7 quit (Read error: Connection reset by peer)
22:22:32*solitudesf quit (Ping timeout: 245 seconds)
22:31:59*rnrwashere joined #nim
22:32:03*isaac[m]1 joined #nim
22:34:59*rnrwashere quit (Remote host closed the connection)
22:38:21*jasper_ quit (Ping timeout: 256 seconds)
22:41:47FromGitter<jrfondren> you don't need to do anything special.
22:42:03FromGitter<jrfondren> ```template calltwice(f: untyped, x): untyped = ⏎ f(x) ⏎ f(x) ⏎ calltwice(echo, 'x')``` [https://gitter.im/nim-lang/Nim?at=5cccc3bae416b8451926a9a1]
22:43:09FromGitter<kaushalmodi> thanks
22:43:28*rnrwashere joined #nim
22:43:34FromGitter<kaushalmodi> I ended up with this: http://ix.io/1HXr
22:44:23FromGitter<kaushalmodi> and using that I was able to catch SIGFPE too
22:44:59FromGitter<jrfondren> use posix pause() instead of while True: discard
22:45:30FromGitter<jrfondren> takes no arguments, waits for a signal. it's like a moral busy loop
22:48:21FromGitter<kaushalmodi> cool, will do. I was just adapting from https://gist.github.com/dom96/908782
22:52:30*Cthalupa quit (Ping timeout: 250 seconds)
22:54:09*Cthalupa joined #nim
22:55:53FromGitter<kaushalmodi> just for reference, my earlier snippet started failing the isMainModule test once I added proc arg. Fixed in this: http://ix.io/1HXt
23:05:19nooniencan i import functions from a module as if they were declared in the current module? so the functions can have access to private fields
23:05:23noonienpreferably without import
23:05:27noonieninclude*
23:08:24shashlickThat defeats the purpose right
23:08:35*Jesin quit (Quit: Leaving)
23:08:40noonienhow so?
23:11:41*Jesin joined #nim
23:13:07*dyce[m] quit (Ping timeout: 264 seconds)
23:17:55*dyce[m] joined #nim
23:20:51shashlickIf it isn't exported then the module writer doesn't want stuff exported
23:21:01shashlickInclude is the only option
23:21:14shashlickHow would you not export but export
23:22:11shashlickI guess it will help to explain what you want to do so that some other way can be found to achieve it
23:22:55shashlickWhy don't you want to export? Or is it someone else's module you are using?
23:24:41noonieni think you got it the wrong way around
23:26:38noonieni have my own module, which contains unexported fields, and i want to export some procs from another module, and give it access to those fields
23:26:38noonienso i can avoid doing `proc foo*[T](t: T) = foo(t)`
23:31:23shashlickSo module A has some private fields that you want to access in module B?
23:32:05noonienmod A has private fields, imports B, mod C imports A and wants to use B's procs (exported from A) on A's fields
23:33:43*Frosted joined #nim
23:33:51Frostedhello
23:34:03Frostedalive somebody
23:34:05Frosted?
23:35:45*rnrwashere quit (Remote host closed the connection)
23:36:02Frostedphh
23:38:26*shashlick quit (Ping timeout: 250 seconds)
23:48:18noonienhow can i get the default vale of a type?
23:51:11*ricardo joined #nim