<< 04-10-2018 >>

00:06:05*riataman joined #nim
00:13:09*riataman quit (Ping timeout: 252 seconds)
00:34:30*xet7 quit (Quit: Leaving)
00:51:54FromGitter<mratsim> Today I learned that one of the arch package manager is written in Nim: https://github.com/kitsunyan/pakku/tree/master/src
01:05:55*francisl joined #nim
01:17:00*endragor joined #nim
01:21:11*endragor quit (Remote host closed the connection)
01:23:09*ftsf joined #nim
01:48:11*RenatoCRONMU joined #nim
01:50:36*RenatoCRONMU quit (K-Lined)
02:01:57*snowolf joined #nim
02:02:55*rlr quit (Read error: Connection reset by peer)
02:04:18*rockcavera joined #nim
02:09:54*francisl quit (Quit: francisl)
02:33:13*chamar joined #nim
02:36:46*rockcavera quit (Ping timeout: 246 seconds)
02:38:38*Raqbit joined #nim
02:39:30snowolfVery silly question (apologies if off-topic, wasn't sure if there's a more specific help channel) incoming: Is there some sort of enumerate(seq) or seq.pairs() function where it would yield tuples of value & index that I could then use in .map() ?
02:42:26*francisl joined #nim
02:43:18*Raqbit quit (Ping timeout: 252 seconds)
02:56:36*oberlingXF joined #nim
02:58:06*oberlingXF quit (K-Lined)
03:12:00*francisl quit (Quit: francisl)
03:14:09dom96snowolf: `pairs` is indeed the iterator name IIRC
03:14:13FromGitter<kayabaNerve> snowolf: `.pairs` returns the index and object. `.mpairs` returns the index and object but allows modifications.
03:14:35dom96if you want to use map with that you'll need to use toSeq()
03:14:38FromGitter<kayabaNerve> dom96 slipping in and stealing my street cred for helping :(
03:14:55FromGitter<kayabaNerve> It's almost like he's a core Nim dev and experienced as hell.
03:15:39dom96Don't worry, I won't be in this timezone soon :)
03:16:57dom96mratsim: awesome, but doesn't use Nimble D:
03:17:55dom96on the other hand, meh
03:17:57*tdc quit (Ping timeout: 252 seconds)
03:18:08dom96whatever works
03:22:03snowolfdom96 & kayabaNerve: thank you for the reply. I had called .pairs() but didn't wrap it in toSeq and definitively got confused by the error. It all makes sense now, ty you muchly to both of you!
03:22:42*francisl joined #nim
03:23:53dom96snowolf: No problem :)
03:27:38*dddddd quit (Remote host closed the connection)
03:39:18*malkomalko quit (Quit: leaving)
03:45:31*mgaare_ joined #nim
03:46:16*chemist69 quit (Ping timeout: 260 seconds)
03:47:54FromGitter<timotheecour> @dom96 ok with https://github.com/nim-lang/Nim/pull/9181#issuecomment-426875756 ?
03:48:14*chemist69 joined #nim
03:49:07*mgaare_ quit (Remote host closed the connection)
03:49:14dom96replied
03:56:01*kapil____ joined #nim
03:59:41dom96It looks like the hacktoberfest is actually bringing in some new people :D
04:06:20*francisl_ joined #nim
04:07:11*francisl quit (Ping timeout: 252 seconds)
04:07:12*francisl_ is now known as francisl
04:11:58*endragor joined #nim
04:12:22FromGitter<kayabaNerve> Happy to hear it
04:13:09*voice_ftp joined #nim
04:14:53*Calinou quit (Ping timeout: 252 seconds)
04:15:26*voice_ftp_ quit (Ping timeout: 252 seconds)
04:17:21*Calinou joined #nim
04:18:58*Tongir joined #nim
04:27:21*Taylor__ quit (Quit: Leaving)
04:36:27*narimiran joined #nim
04:40:06*ftsf quit (Remote host closed the connection)
04:40:36*ftsf joined #nim
04:43:34*chamar quit (Read error: Connection reset by peer)
04:48:32*francisl quit (Quit: francisl)
04:48:51*francisl joined #nim
04:49:18*francisl quit (Client Quit)
04:49:39*francisl joined #nim
04:50:05*francisl quit (Client Quit)
04:50:36*francisl joined #nim
04:50:52*francisl quit (Client Quit)
04:51:15*francisl joined #nim
04:55:51*francisl quit (Ping timeout: 252 seconds)
05:06:03FromGitter<gogolxdong> Is there an example of SDL2 audio programming, the example sdl_audio_callback.nim in sdl2 doesn't work.
05:07:04FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bb59ff8bbdc0b2505e2c399]
05:11:38*niiko_RH joined #nim
05:15:08*niiko_RH quit (Remote host closed the connection)
05:21:41FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bb5a3641c100a4f292a7739]
05:22:06FromGitter<gogolxdong> my audio is AUDIO_F32LSB, it doesn't make a sound in 2 seconds.
05:27:17*cheapieew joined #nim
05:28:06*cheapieew quit (K-Lined)
05:30:43*Tongir quit (Remote host closed the connection)
05:33:47FromGitter<kayabaNerve> Can I define a global between files?
05:34:44dom96yes
05:35:16FromGitter<kayabaNerve> 1) I found an alternative. ⏎ 2) Can I do so entirely in source code?
05:35:28FromGitter<kayabaNerve> The 'alternative' is nimscript + strdefine.
05:35:44*redlegion quit (Ping timeout: 252 seconds)
05:38:08FromGitter<gogolxdong> @dom96, async poll has an effect of performance of GUI, used spawn instead of asyncCheck.
05:38:29dom96async poll takes a timeout
05:38:32dom96poll(1)
05:39:44FromGitter<gogolxdong> Is poll better than thread or something else?
05:40:41*nsf joined #nim
05:43:46FromGitter<kayabaNerve> dom96 So is that a no to a pure Nim code alternative?
05:44:18dom96gogolxdong: yes, it's less complicated
05:44:29dom96depends what you're doing though
05:44:40dom96kayabaNerve: No idea what the problem is
05:44:49dom96You can create globals and access them across modules
05:45:59FromGitter<kayabaNerve> I'm asking how lol. I don't mean via importing the same file OR via strdefine.
05:47:21FromGitter<kayabaNerve> I thought the answer would be via {.global.} but that is just for rescoping a var in a proc into the file scope.
05:48:57FromGitter<ephja> 0
05:49:26FromGitter<ephja> --import:<module>?
05:50:54FromGitter<ephja> which might be broken in recent versions
05:52:31*redlegion joined #nim
05:52:31*redlegion quit (Changing host)
05:52:31*redlegion joined #nim
05:53:34FromGitter<ephja> I need to be able to treat `T` and `distinct T` the same somehow for serialization purposes
05:56:01*jjido joined #nim
05:59:29*jjido quit (Client Quit)
06:04:16FromGitter<ephja> a macro using getType should solve that problem
06:06:09*narimiran quit (Quit: Konversation terminated!)
06:15:01FromGitter<kayabaNerve> @ephja That makes everything very very easy but isn't via the codebase.
06:21:21*darithorn quit ()
06:26:49*Jesin quit (Ping timeout: 250 seconds)
06:30:10*Jesin joined #nim
06:41:12FromGitter<ephja> @kayabaNerve I don't know of any other ways. why is that problematic?
06:42:44FromGitter<kayabaNerve> Oh. It's not.
06:42:55FromGitter<kayabaNerve> @ephja You can cast between distinct types.
06:43:11FromGitter<kayabaNerve> *It's not problematic per say. My current solution is strdefine/nimscript.
06:43:39FromGitter<kayabaNerve> I just wanted a pure codebase solution. There isn't one, and I'm sticking with the solution I have for now.
06:46:39FromGitter<Aaron-JM> Hey anyone got an idea for a nim library
06:47:33FromGitter<kayabaNerve> @Aaron-JM I need a library that you import with one line, and that one line import sets up a fully functioning cryptocurrency node.
06:48:11FromGitter<kayabaNerve> Jokes aside, have you considered high speed number base converting?
06:48:37FromGitter<survivorm> Blazing-fast input validation (of any kind described with schema) - like jsonschema, for example
06:48:47FromGitter<kayabaNerve> It's useful; technical; not locked to Nim; good to know; doesn't necessarily require any other libs...
06:48:54FromGitter<kayabaNerve> Easy to do, hard too do fast.
06:48:56FromGitter<survivorm> Not sure there isn't anything in Nim already
06:49:35*tdc joined #nim
07:06:16FromGitter<narimiran> @Aaron-JM matplotlib equivalent? :)
07:12:14FromGitter<narimiran> (but with saner API, without matlab-like syntax, etc. :))
07:12:58FromGitter<Vindaar> @vivus: nah, went to bed early yesterday ⏎ @narimiran @Aaron-JM now that sounds like a perfect weekend project :D
07:14:30FromGitter<narimiran> @Vindaar where do you live? i would also like to have 4382942-day weekends! :D
07:15:54*Vladar joined #nim
07:18:03*Vladar quit (Remote host closed the connection)
07:18:37*Vladar joined #nim
07:23:57FromGitter<Vindaar> haha, in my own little fantasy land in my head :D
07:24:45FromGitter<Vindaar> On a more serious note: I tend to agree that matplotlibs interface isn't the nicest, but do you know *any* plotting library that has a nice interface?
07:25:33FromGitter<ephja> you can't use selectors with non-blocking sockets directly yet because of missing functionality, right?
07:26:44FromGitter<narimiran> @Vindaar well, seaborn is a nice wrapper around matplotlib. similar with the pandas.plot
07:26:51FromGitter<ephja> maybe in a hacky way if recv after a read event guarantees that 0 won't be returned
07:28:58FromGitter<Vindaar> @narimiran hmm, heard about seaborn plenty of times, but I never actually used it. Will check it out
07:31:05FromGitter<narimiran> seaborn was especially useful in times of matplotlib 1.x and its ugly defaults. MPL 2.x made that gap much smaller
07:33:29*rokups joined #nim
07:35:31*redlegion quit (Ping timeout: 260 seconds)
07:53:36AraqputPixel is a nice interface
07:58:35*redlegion joined #nim
07:58:35*redlegion quit (Changing host)
07:58:35*redlegion joined #nim
08:03:26*gmpreussner joined #nim
08:03:57*gmpreussner_ quit (Ping timeout: 252 seconds)
08:11:01*redlegion quit (Quit: Ded.)
08:11:06*Tortice quit (Read error: Connection reset by peer)
08:13:24*redlegion joined #nim
08:13:24*redlegion quit (Changing host)
08:13:24*redlegion joined #nim
08:21:21*krux02 joined #nim
08:22:08*PMunch joined #nim
08:28:07*ftsf quit (Quit: Leaving)
08:29:45*floppydh joined #nim
08:33:59*p14nd4rt joined #nim
08:34:44FromGitter<mratsim> @Vindaar check out cufflinks as well
08:34:51*Tortice joined #nim
08:34:59FromGitter<mratsim> But I will be working on Vega-lite/Altair =)
08:35:34FromGitter<mratsim> ggplot also seemed quite nice
08:40:32*p14nd4rt quit (Ping timeout: 252 seconds)
08:45:05*kapil____ quit (Quit: Connection closed for inactivity)
09:00:06*redlegion quit (Ping timeout: 260 seconds)
09:00:34*glitch13 joined #nim
09:04:53*redlegion joined #nim
09:04:54*redlegion quit (Changing host)
09:04:54*redlegion joined #nim
09:04:57FromGitter<gogolxdong> @dom96 have no idea but asyncCheck without spawn cannot send message.
09:05:09*glitch13 quit (Remote host closed the connection)
09:11:04FromGitter<ephja> are you polling in both cases?
09:11:56FromGitter<ephja> preferably repeatedly, like with runForever if you aren't using it
09:13:35FromGitter<ephja> I don't care for the runForever abstraction myself :p
09:13:49FromGitter<gogolxdong> like ⏎ ⏎ ```proc listen() {.async.} = ... ⏎ proc GUI() {.async.}=... ⏎ asyncCheck listen()``` [https://gitter.im/nim-lang/Nim?at=5bb5d9cd1e23486b93877c86]
09:14:00FromGitter<gogolxdong> asyncCheck GUI()
09:14:17FromGitter<gogolxdong> and polling from GUI
09:16:13FromGitter<ephja> shouldn't you be polling after those calls have returned?
09:17:59FromGitter<ephja> I can't infer much from that
09:19:16FromGitter<gogolxdong> http://ix.io/1ohe
09:22:40FromGitter<ephja> @gogolxdong this is how runForever is defined: "while true: poll()"
09:23:40FromGitter<ephja> so you might want to get rid of that call, because of the infinite loop and because you're already polling elsewhere
09:28:47FromGitter<gogolxdong> removed runForever() , poll has an effect on the GUI rendering once timeout longer than 100 units ( ms?)
09:29:40FromGitter<gogolxdong> what's the meaning of poll(0)?
09:30:24FromGitter<ephja> less than time spent in poll I guess
09:31:06FromGitter<gogolxdong> http://ix.io/1ohj
09:31:50FromGitter<Vindaar> @mratsim With you working on vega-lite, nim-plotly will be obsolete pretty soon anyways :P
09:32:35*ocelotsloth joined #nim
09:32:46FromGitter<ephja> yeah 100ms is too high in your case
09:32:47FromGitter<mratsim> I don’t know, Ih better at dealng with math and low level stuff than JS libraries :P
09:32:59FromGitter<mratsim> I’m much better*
09:34:52FromGitter<gogolxdong> For those who is proficient on system programming, can pin rendering thread on one of NUMA core and socket listening on another. asyncCheck runs on one thread ,right?
09:35:56FromGitter<Vindaar> @mratsim haha, we'll find out :D once you're above the "proof of concept" stage I'll try it and can help (with my also limited JS knowledge :D)
09:36:48FromGitter<mratsim> @gogolxdong asyncCheck runs in the main hardware thread, async is creating a software thread interleaved with the other but it’s like a coroutine
09:37:27FromGitter<mratsim> i.e. async is also what people call coroutines, fibers or green threads
09:38:28*erratic quit (Ping timeout: 252 seconds)
09:39:02FromGitter<gogolxdong> this explaination is straightforward, I'm familiar with goroutines. so it's light weighted thread.
09:39:29FromGitter<ephja> @gogolxdong https://nim-lang.org/docs/threads.html#pinToCpu%2CThread%5BArg%5D%2CNatural
09:39:46FromGitter<mratsim> goroutines are a bit different, it’s M:N threading, M lightweight software threads multiplexed on N heavy hardware thread, similar to Erlang BEAM VM
09:40:06FromGitter<ephja> https://nim-lang.org/docs/threadpool.html#pinnedSpawn%2CThreadId%2Ctyped
09:40:06FromGitter<mratsim> this means that Go implement it’s own scheduler for goroutines (M:N threading is hard)
09:41:05FromGitter<mratsim> In Nim you either have 1:1 threading (1 software thread per 1 hardware thread) via threadpool or createThread, or you have M:1 threading (M lightweight software thread on 1 hardware thread) via async
09:42:02FromGitter<mratsim> if you want something like goroutines, well you have to implement your own scheduler to multiplex/load balance the software threads on the hardware threads available.
09:42:50FromGitter<ephja> who knows how long the rendering might take, so you might want to poll in one thread and run the GUI in another, and possibly communicate with channels or something else
09:44:12FromGitter<gogolxdong> Is spawn hardware threads?
09:45:00FromGitter<gogolxdong> hardware threads pinned to specific cpu fits this use case.
09:45:07*elrood joined #nim
09:46:18FromGitter<ephja> https://github.com/nim-lang/Nim/search?utf8=%E2%9C%93&q=nimPinToCpu&type= 🤔
09:50:05FromGitter<gogolxdong> GUI thread listens the interruption of keyboard and mouse and server thread listens the interruption of NIC. avoid interruption races on one hardware core.
09:54:30FromGitter<gogolxdong> thanks for all your elabration and favor.
09:55:02FromGitter<mratsim> unfortunately, you have both spawn for trheadpool and spawn for async, iirc there was a RFC to rename one because it’s confusing
09:57:43*PMunch quit (Remote host closed the connection)
09:58:00*PMunch joined #nim
10:00:46*ocelotsloth quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
10:02:09*ocelotsloth joined #nim
10:03:18FromGitter<mratsim> maybe @dom96 remembers^
10:03:33FromGitter<gogolxdong> I see spawn in threadpool , problem is nimPinToCpu only works in nimSpawn3, have no idea which magic spawn uses.
10:03:47*ocelotsloth left #nim (#nim)
10:04:24*seni joined #nim
10:18:29FromGitter<gogolxdong> sorry , works in activateWorkerThread, wihch setup uses.
10:24:42FromGitter<gogolxdong> Generally speaking , what I need to do is only -d:nimPinToCpu and spawns , it will pin to cpu with mod automically.
10:25:15FromGitter<kayabaNerve> I don't think there is an async spawn @mratsim
10:25:53FromGitter<kayabaNerve> There's await, yield, and asyncCheck. Ctrl + F on asyncdispatch docs return nothing for "spawn".
10:26:05FromGitter<kayabaNerve> So if you're referring to the past, NVM.
10:31:04*erratic joined #nim
10:33:50*jjido joined #nim
10:33:58FromGitter<mratsim> oh maybe
10:36:34FromGitter<Bennyelg> Yet another Costa's benchmark repo ? ⏎ https://github.com/costajob/app-servers
10:37:23*xet7 joined #nim
10:38:31Yardanico@Bennyelg we can add jester or httpbeast to that benchmark easily
10:39:17FromGitter<Bennyelg> I don't care, it's seems to be useless anyway. that guy (costa) is a probably very bord guy
10:43:59FromGitter<narimiran> Kosta's benchmarks > Costa's benchmarks :P
10:53:18krux02I just see the costa benchmarks for the first time
10:53:55*Tortice quit (Remote host closed the connection)
10:54:21krux02generally those benchmarks don't show a lot.
10:54:45krux02there are many more important things than just raw Req./sec
10:55:00krux02for example how much effert is it to get x Req./sec
10:55:55krux02but certainly interesting is how Nim Cystal Rust and Go just play in a different league of memory consumption.
10:57:15krux02C# uses 172 times more memory than Nim.
10:59:12krux02but the measurements are certainly wrong, how do you get to 5XX% cpu load with 4 cores?
11:02:45*dddddd joined #nim
11:13:55FromGitter<narimiran> hyperthreading?
11:14:07*zakora joined #nim
11:15:07FromGitter<Bennyelg> nim support hyperthreading ?
11:15:28FromGitter<Bennyelg> hyperthreading reffering to lightweight threads aka `green threads `?
11:22:43FromDiscord_<Shield> not much of a "green" when they split cache even more
11:25:09*chemist69 quit (Ping timeout: 252 seconds)
11:25:52*chemist69 joined #nim
11:32:44elroodkrux02, the cpu% in that context is cpu load, not utilization, so more like a job queue and how many processes are waiting for the cpu. not uncommon to be greater than the cpu count
11:33:40krux02I don't care what it measures, when it is can get that high, I see it as bullshit
11:35:27krux02you can measuer min max and mean cpu load. you can say all CPU used to the max at 100% is 100%, or you can sum up the load of eache CPU without normalization.
11:36:08krux02nothing gets you above 400% ever
11:36:40krux02if it is ever above 400% even if it is just for a second it means that the measurement was wrong.
11:36:54*rnrwashere joined #nim
11:37:00elroodhm, if you don't care you're bound to come to wrong conclusions though. read up on cpu load, it's conceptually the same on all nix-based os. admittedly confusing at first sight, but just the way it is
11:37:11*rnrwashere quit (Remote host closed the connection)
11:37:41FromGitter<alehander42> I plan on using readthedocs, i've seen some nice python docs based on it
11:37:48FromGitter<alehander42> oh wait wrong chat
11:41:22*rnrwashere joined #nim
11:43:40*rnrwashere quit (Remote host closed the connection)
11:45:45*stefanos82 joined #nim
11:49:13*jjido quit (Ping timeout: 245 seconds)
11:57:11*rockcavera joined #nim
12:03:03*firstlast joined #nim
12:03:11*firstlast quit (Remote host closed the connection)
12:07:24*kapil____ joined #nim
12:08:33*francisl joined #nim
12:15:04*rockcavera quit (Remote host closed the connection)
12:19:03*rnrwashere joined #nim
12:23:11*rnrwashere quit (Ping timeout: 244 seconds)
12:25:08*rnrwashere joined #nim
12:25:17*Tortice joined #nim
12:31:38FromGitter<rokups> btw a while back i found this https://github.com/septag/deboost.context/tree/master/asm
12:31:48FromGitter<rokups> looks like something that should be integrated to nim
12:32:46FromGitter<rokups> that would make coroutines not suck any more
12:35:08*rockcavera joined #nim
12:37:56FromGitter<mratsim> I think we should remove coroutines and show more example of closure iterators used as coroutines
12:38:31*francisl quit (Quit: francisl)
12:39:59*rnrwashere quit (Remote host closed the connection)
12:40:24*rnrwashere joined #nim
12:42:46*rnrwashere quit (Remote host closed the connection)
12:43:45*sagax quit (Read error: No route to host)
12:47:56FromGitter<rokups> python messed up royally by pretending iterators are coroutines
12:48:34FromGitter<rokups> but removing them is probably a good idea. coroutines can live as external library as long as compiler has needed special bits to make them work
12:50:48FromGitter<mratsim> closure iterators are coroutines
12:51:54FromGitter<rokups> but can we yield execution from arbitrary position down the callstack?
12:51:56FromGitter<mratsim> they can accept arguments while already running. (they Araq said it might be unintended :D)
12:52:22FromGitter<mratsim> give me an example in pseudo code and I can translate it to Nim
12:54:22FromGitter<rokups> something along these lines: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bb60d7e64cfc273f994bf78]
12:54:52elroodbeing provided via external library vs being supported by the stdlib/compiler out of the box does make quite a difference though, rokups
12:55:37FromGitter<rokups> so far all language hacks i have seen require a chain of generators all the way down the callstack in order to yield execution. this is the beauty of stackful coroutines - you can yield from wherever you like
12:56:46elroodeven if one completely disregarded performance and potential version compatibility issues, just the impact on which coding style is encouraged would be huge for such a basic construct
12:56:52FromGitter<rokups> @elrood well nim already does support coroutines, meaning low level bits to make them work are there. at this point i do not see much difference between them being in a package or in stdlib. they would work just as well
12:57:25FromGitter<rokups> > coding style ⏎ ⏎ does not nim advocate choosing whichever coding style we like? :)
12:58:07*rnrwashere joined #nim
12:58:39elrood*cough
12:59:16elroodas if being overly opinionated wasn't one of nim's fundamental issues already
12:59:26*francisl joined #nim
12:59:54*rnrwashere quit (Remote host closed the connection)
13:01:54FromGitter<rokups> anyway ill probably try to put something together at some point, for some relaxation
13:03:15FromDiscord_<Shield> if you value performance it's better to use a simple state machine, it's 45% faster than closure iterators and you can save/manipulate its state
13:05:51*rnrwashere joined #nim
13:06:31FromGitter<mratsim> @rokups: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bb6105764cfc273f994d508]
13:06:47*rnrwashere quit (Remote host closed the connection)
13:07:22FromGitter<mratsim> @Shield, closure iterators are implemented using state machine
13:07:43FromGitter<mratsim> the cost is creating the closure
13:07:55FromGitter<mratsim> since those are heap allocated.
13:08:04*rnrwashere joined #nim
13:08:27FromGitter<rokups> @mratsim ah but that does not address my concern - yielding from something that is not an iterator
13:08:46FromGitter<malkomalko> How does Nim handle proc naming clashes if multiple modules export the same named proc with the same signature?
13:09:27FromGitter<mratsim> @malkomalko it tells you that it’s ambiguous and you have to prefix the procs with name clash with the module name
13:09:34FromGitter<mratsim> A.foo() and B.foo()
13:10:04FromGitter<mratsim> @rokups: but why?
13:11:15*endragor quit (Remote host closed the connection)
13:11:22FromGitter<rokups> @mratsim say we want async file operations. now everything including APIs dealing with files have to be iderators. sucks
13:11:38FromGitter<mratsim> or you can just use the {.async.} pragma
13:11:44FromGitter<mratsim> which does that for you
13:12:08FromGitter<mratsim> while allowing you to keep using the normal syntax.
13:12:08FromGitter<rokups> that is different though. it implies use of multiple threads, right?
13:12:12FromGitter<mratsim> no
13:12:15FromGitter<gogolxdong> I will release the first dencentralized GUI chat node after adding a message sound.
13:12:22FromGitter<mratsim> one hardware thread, implemented on top of closure iterators
13:13:15FromGitter<rokups> > Nim has a builtin thread pool that can be used for CPU intensive tasks. For IO intensive tasks the async and await features should be used instead.
13:15:38*manterolat joined #nim
13:16:24FromGitter<mratsim> isn’t that what I’m saying?
13:16:50FromGitter<rokups> you said "one hardware thread", docs say `async` runs stuff on a dedicated threadpool
13:17:18FromGitter<rokups> another example would be AI system for a game that uses coroutines as micro-threads for each NPC. having ability to yield from anywhere is very handy. AI often needs to sleep for some time all over the place
13:17:24FromGitter<mratsim> no
13:17:31FromGitter<mratsim> Threadpool are threadpools
13:17:41FromGitter<mratsim> Async runs on your main hardware thread
13:17:49FromGitter<mratsim> the same one as your application
13:17:56FromDiscord_<Shield> I know they are mratsim, yet explicitly creating the state machine is faster, it would be even more so if nim case statement supported falling through, i guess that may have something to do with goto being used for closure iterators
13:18:04FromGitter<rokups> oh wait i misread docs. lol
13:18:37FromGitter<rokups> there is literally just one instance of "async" in the docs and its in that bit i pasted. `async` pragma is undocumented? :|
13:18:38FromDiscord_<Shield> I would love if there is a case statement with fallthrough as the default behavior, wrapping it in a while true block feels ugly
13:18:54FromGitter<mratsim> just use computed gotos
13:19:12FromGitter<mratsim> https://github.com/status-im/nimbus/wiki/Interpreter-optimization-resources#nim-implementation-benchmark
13:21:44FromGitter<mratsim> @rokups it’s in asyncdispatch (or in Nim in Action)
13:23:08FromGitter<rokups> ah but its the same thing as iterators, just looks differently. everything still must be async all the way down the callstack
13:23:43FromGitter<rokups> not that its a bad solution, its just not suitable for some applications while being great for others
13:32:14*rockcavera quit (Ping timeout: 268 seconds)
13:32:35*rockcavera joined #nim
13:32:35*rockcavera quit (Changing host)
13:32:35*rockcavera joined #nim
13:44:54*rnrwashere quit (Remote host closed the connection)
13:45:19*rnrwashere joined #nim
13:46:51*rnrwashere quit (Remote host closed the connection)
13:47:18*rnrwashere joined #nim
13:49:03FromDiscord_<Shield> that link was really useful mratsim, thanks
13:50:28*tiorock joined #nim
13:50:28*tiorock quit (Changing host)
13:50:28*tiorock joined #nim
13:50:28*rockcavera quit (Killed (hitchcock.freenode.net (Nickname regained by services)))
13:50:28*tiorock is now known as rockcavera
13:51:33*rnrwashere quit (Ping timeout: 252 seconds)
13:56:38*Vladar quit (Remote host closed the connection)
14:01:24FromGitter<malkomalko> Can anyone suggest a good starter bug/card to work on for hacktoberfest? I just started learning Nim last week, but I'd love to get my hands dirty.
14:04:45*rnrwashere joined #nim
14:06:10*Vladar joined #nim
14:08:50krux02malkomalko: what do you want to do?
14:09:14*rnrwashere quit (Ping timeout: 268 seconds)
14:10:24krux02what is your experience
14:12:04*yoplaid joined #nim
14:12:54federico3malkomalko https://nim-lang.org/blog/2018/10/01/hacktoberfest-with-nim.html
14:23:23FromGitter<manterolat> Hi! I'm also looking to work on some issues for hacktoberfest. I've made some progress with the nim js output file/dir issue (thanks to LemonBoy's tips)
14:26:56*PrimHelios joined #nim
14:27:17FromGitter<gogolxdong> How do I use the example of sdl_audio_callback.nim
14:27:59*nsf quit (Quit: WeeChat 2.2)
14:28:33*krux02_ joined #nim
14:29:10*manterolat_ joined #nim
14:29:31*krux02 quit (Remote host closed the connection)
14:32:32*manterolat quit (Ping timeout: 252 seconds)
14:33:37*rnrwashere joined #nim
14:36:52*rokups quit (Quit: Connection closed for inactivity)
14:37:44*rnrwashere quit (Ping timeout: 250 seconds)
14:39:38*Jikai joined #nim
14:39:45*manterolat_ quit (Quit: Leaving)
14:42:44*Jikai quit (Remote host closed the connection)
14:48:16FromGitter<manterolat> I think I'm done with issue #9154. Am I supposed to Fork, then Branch to commit the changes?
14:52:00FromGitter<manterolat> Or should I commit directly in the fork? It should only be a couple of lines added
14:52:10shashlickbetter to branch then you can continue to work on other stuff
14:52:27shashlickcause the PR can take some time to be merged
14:53:31FromGitter<manterolat> Got it, thanks! Should I name it something like "fixes-9154" like some of the other branches?
15:06:58PMunchThe name doesn't matter all that much
15:07:14PMunchBut fixes-9154 is good since you can then easily find it later
15:15:27*narimiran joined #nim
15:17:25FromGitter<malkomalko> krux02 I've been programming for a long time, so I'm really willing to jump into anything. Thanks for the link federico3
15:18:40*TheLemonMan joined #nim
15:28:44FromGitter<mratsim> I find fix-9154-conversion-of-int better fro branch names
15:29:00TheLemonMan2verbose4me
15:29:21FromGitter<mratsim> are you the guy who renamed all variables in the compiler to a, b, c?
15:29:28FromGitter<mratsim> :D
15:29:37FromGitter<manterolat> Is there a standard on error messages? I currently have them as `Error: cannot write to <path> (<path> is a directory)` and `Error: cannot write to <path> (<dir> does not exist)`
15:29:59FromGitter<manterolat> Oh, hey TheLemonMan! Your tips were really helpful!
15:30:57FromGitter<mratsim> you’re welcome to introduce a standard, both looks fine to me
15:31:07TheLemonManI'm glad people find them useful :) by the end of the month I expect the compiler team to have twice as many people working on the compiler!
15:31:26narimiranTheLemonMan: sooo, 2? :D
15:31:48TheLemonManany number greater than 0 is fine!
15:32:09FromGitter<mratsim> I expect them to foam when they see `tyStatic` :P
15:32:28FromGitter<kdheepak> Is there an easier way to do what I'll call "list comprehension" in Nim?
15:32:45*thomasross quit (Ping timeout: 252 seconds)
15:33:16FromGitter<mratsim> @kdheepak : https://github.com/mratsim/nim-project-euler/blob/master/src/pe004_largest_palindrome_product.nim#L13
15:33:22*thomasross joined #nim
15:33:32narimiran@kdheepak: use `map` and `mapIt`?
15:33:36FromGitter<mratsim> but a for loop is probably faster and easier
15:33:46FromGitter<mratsim> or `newSeqWith`
15:33:50FromGitter<kdheepak> What I'm trying to do is edit a large text, and what I'm doing is created a new list to store each line.
15:34:03FromGitter<mratsim> use the splitLine iterator
15:34:10FromGitter<mratsim> or split, whatever it’s called
15:34:42FromGitter<kdheepak> Let's say you have the following: ⏎ ⏎ ``` a = 1 ⏎ b = 2``` [https://gitter.im/nim-lang/Nim?at=5bb633121e23486b9389e0e4]
15:34:49FromGitter<kaushalmodi> @kdheepak list comprehension in Nim: https://scripter.co/notes/nim/#list-comprehension
15:35:08FromGitter<kaushalmodi> I talk about few ways to do it: `lc`, `=>`, `mapIt`
15:35:11FromGitter<kdheepak> ```body = """ ⏎ a = 1 ⏎ b = 2 ⏎ """``` [https://gitter.im/nim-lang/Nim?at=5bb6332f1c100a4f292e3b17]
15:36:38FromGitter<kdheepak> And you want body to finally be ⏎ ⏎ ```assert body == """ ⏎ [a][A] = [1][0] ⏎ [b][B] = [2][1]``` [https://gitter.im/nim-lang/Nim?at=5bb63385ae7be94016fef461]
15:37:11FromGitter<manterolat> TheLemonMan, I haven't addressed the `writeRopeIfNotEqual` problem from the issue. Should I leave it alone, or ask Araq about it and make a separate pull request?
15:37:22FromGitter<kdheepak> Pasting again here so that IRC/discord can see the edits: ⏎ ⏎ ```assert body == """[a][A] = [1][0] ⏎ [b][B] = [2][1]"""``` [https://gitter.im/nim-lang/Nim?at=5bb633b1435c2a518e4f77c7]
15:37:42TheLemonManmanterolat, the latter, I'm also curious about why it was introduced in first place
15:37:43FromGitter<mratsim> @kdheepak if your file is known at compiletime use slurp/staticRead and then splitLines from strutils
15:37:56FromGitter<mratsim> if it’s at runtime, use streams and readLine: https://nim-lang.org/docs/streams.html#readLine%2CStream%2CTaintedString
15:38:52FromGitter<mratsim> but if you’re just trying to do match and replace use strscans: https://nim-lang.org/docs/strscans.html
15:41:22FromGitter<kdheepak> Thanks all those links are useful.
15:45:11TheLemonManI've just added another Hacktoberfest ticket, it's slightly more involved than the previous one and also touches the VM
15:45:30FromGitter<kdheepak> Does `-d:Release` change the C code that's generated or does it only affect the compilation optimization flags?
15:45:44FromGitter<rokups> what do i do to make sure that nim does not insert any extra stuff to my defined `type`? so it is compatible with `struct` defined in C.
15:46:42TheLemonManrokups, no extra stuff is inserted at any time
15:47:09FromGitter<rokups> isnt there some stuff added to get object type and for dynamic dispatch?
15:47:50TheLemonManthe type information is external (the NTI noise in the C file)
15:48:19FromGitter<rokups> hmm alright. ill revisit this if things blow up then :)
15:48:21FromGitter<mratsim> @kdheepak it changes the C code as well, it doesn’t have the source maps to Nim files/lines, it doesn’t have bounds checks, overchecks
15:48:33FromGitter<mratsim> overflow checks*
15:49:50*floppydh quit (Quit: WeeChat 2.2)
15:51:16narimiranok, enough working on my stuff, time to make some PRs to win that T-shirt!
15:51:22FromGitter<kdheepak> @mratsim thanks for the answer!
15:51:48FromGitter<manterolat> TheLemonMan, I'll check that one out as well. Also, should I make the pull request for the outFile issue now, or wait and add the other commit (if Araq says so) to one overall pull request?
15:52:12narimiranwhere is the source for creating docs page by running `nim doc`?
15:52:19*xylef joined #nim
15:52:43FromGitter<manterolat> `compiler/docgen.nim` has a lot of that
15:53:03narimiranthere are both "doc" and "nimdoc" folders, but that doesn't seem to be what i'm looking for
15:53:07*xylef quit (Client Quit)
15:54:35*PMunch quit (Quit: Leaving)
15:54:43narimiranthanks @manterolat :)
15:56:44*edgar-rft joined #nim
15:56:54FromGitter<manterolat> Np, are you working on #9143?
15:57:25TheLemonMan#9143 already has a PR
15:57:41narimiran@materolat: nope, i'm trying to see if i can fix some general stuff i don't like in the created docs
15:58:36narimirane.g. 1. nim has 80-character limit for code, but even if you're inside of that limit — that line would be too long for created docs!
15:59:15narimiran2. line continuations for proc/iterator headers seem to be funky/crazy
15:59:36narimiransee for example this: https://narimiran.github.io/itertools/#product.i,openArray[T],openArray[U],openArray[V],openArray[W]
15:59:51narimiranwhy is `s4` there where it is? it doesn't make any sense
16:00:26*edgar-rft quit (Remote host closed the connection)
16:00:30FromGitter<manterolat> Ah, gotcha. Good luck!
16:00:50narimirani guess because it expects the first word to be `proc` and not `iterator`, so it has 4 spaces less than needed
16:01:05*Trustable joined #nim
16:02:04FromGitter<manterolat> TheLemonMan, I'm guessing I don't need to make a test for #9143, right?
16:03:31TheLemonManmanterolat, #9143 has been already completed (see #9158)
16:03:42*Tortice quit (Read error: Connection reset by peer)
16:04:23FromGitter<kdheepak> I added a issue today https://github.com/nim-lang/Nim/issues/9189: I wrote what I thought should be invalid Nim but received an error from clang instead of from Nim.
16:04:41TheLemonManyeah, I'm already on it
16:04:59TheLemonManunless somebody wants to tackle it as part of Hacktoberfest
16:05:03FromGitter<kdheepak> I was wondering if this is something I could tackle
16:05:22FromGitter<kdheepak> I'm extremely new to Nim, but would love to give it a shot.
16:05:35*Tortice joined #nim
16:05:48FromGitter<manterolat> Sorry, I meant #9154!
16:05:50TheLemonManof course! I can drop a few hints to get started if you want
16:06:00FromGitter<kdheepak> that would be great!
16:06:03*darithorn joined #nim
16:06:30*kapil____ quit (Quit: Connection closed for inactivity)
16:07:31TheLemonManmanterolat, if you manage to write a test that works across win/lin/osx that'd be nice
16:07:39FromGitter<manterolat> narimiran, is the `s4` supposed to be one tab from the beginning, or on par with `s1`?
16:10:28narimiranwherever, but not where it is now :D
16:14:21*Guest25456 joined #nim
16:14:27FromGitter<manterolat> TheLemonMan, is it possible to make a test for the compiler CLI? What category would it even fall under? :P
16:16:33TheLemonManmanterolat, maybe /misc/? maybe it's not worth the time to write a test :)
16:17:21*Guest25456 quit (Remote host closed the connection)
16:17:28FromGitter<manterolat> haha, maybe not. Should I go ahead and submit this pull request, or wait and bundle it with the other one (if Araq says so)?
16:17:55TheLemonManyeah, the other part can wait
16:19:14FromGitter<kdheepak> @TheLemonMan let me know if there's anythingI can start looking at!
16:19:50FromGitter<kaushalmodi> @kdheepak would you like to tackle rst parser for nim doc?
16:20:13FromGitter<kaushalmodi> the parser is already there, but needs parsing for a different flavor of rst table
16:20:53FromGitter<kaushalmodi> For you or anyone else interested: https://github.com/nim-lang/Nim/issues/6429
16:21:26FromGitter<kdheepak> That sounds like something I can take on!
16:21:55FromGitter<kaushalmodi> I'll add more context to that issue on what's meant by grid table
16:22:04FromGitter<kaushalmodi> *unless you are already aware of that*
16:22:36FromGitter<kdheepak> I don't think I do, at least not the specifics.
16:22:48FromGitter<kdheepak> I can output from pandoc to see what it looks like.
16:23:03FromGitter<kaushalmodi> I'll add a real use case in that issue.
16:25:30TheLemonMankdheepak, done! check out the ticket
16:29:31FromGitter<kaushalmodi> @kdheepak Done: https://github.com/nim-lang/Nim/issues/6429#issuecomment-427083948
16:30:03*endragor joined #nim
16:30:37*endragor quit (Remote host closed the connection)
16:32:12TheLemonManyou must really hate yourself for wanting to write that ascii-art wall
16:32:51FromGitter<kaushalmodi> TheLemonMan: I'm not writing it, Pandoc is
16:33:38TheLemonManthen ask Pandoc to seek help
16:33:46TheLemonMans/ask/tell/
16:34:32FromGitter<kaushalmodi> done that too.. https://github.com/jgm/pandoc/issues/4750
16:34:54FromGitter<kaushalmodi> their point is that the "simple" table is not very versatile.. so no one is interested in implementing that
16:35:04FromGitter<kaushalmodi> grid table is a superset of simple table
16:35:40*Tortice quit (Remote host closed the connection)
16:37:13*junland quit (Quit: Disconnected.)
16:37:44*junland joined #nim
16:41:25*stefanos82 quit (Quit: Quitting for now...)
16:42:13FromGitter<kaushalmodi> The feeling I get on seeing this table incompatibility between pandoc generated table and nim doc parseable table is https://imgur.com/r/all/ypSyEja
16:46:31FromGitter<rokups> system/osalloc.nim is not allowed to be used huh?
16:46:55*NimBot joined #nim
16:49:38FromGitter<malkomalko> Are there any good debugging/profiling tools for nim? Can it tap into instruments or other c based tools since it just compiles down into c?
16:51:04FromGitter<mratsim> just use instruments
16:51:31FromGitter<mratsim> for debugging use LLDB or GDB: https://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.html
16:52:13FromGitter<mratsim> For benchmarking you can use instruments or criterion: https://github.com/LemonBoy/criterion.nim
16:52:23FromGitter<mratsim> perf works as well
16:52:51FromGitter<malkomalko> awesome, thanks... that's enough to get me started
16:53:58FromGitter<mratsim> you can find the generated C code in ~/.cache/nim/yourproject_{d,r} depending id debug or release build
16:54:15FromGitter<mratsim> you can also pass -S to gcc/clang to compile to ASM and check the assembly emitted
16:54:20FromGitter<mratsim> though I prefer instruments for that
16:54:53TheLemonManI hate the fact that you can't easily turn a varargs[untyped] into a NimNode
16:55:35FromGitter<mratsim> I hate the fact that they consume everything
16:56:29TheLemonManeh? varargs are greedy by definition
16:56:47FromGitter<mratsim> no only varargs untyped is gready
16:56:51FromGitter<mratsim> greedy*
16:57:02FromGitter<mratsim> I basically have this in all my libraries: https://github.com/SimonDanisch/julia-challenge/blob/b919d57950485a6e7ea3576bb989c3ebb04cf338/nim/nim_sol_mratsim.nim#L133-L137
16:57:19FromGitter<mratsim> see: https://github.com/nim-lang/Nim/issues/5855
17:01:42*MyMiau joined #nim
17:06:58narimiranwhat would be the best word to describe `openArray`? container? (because it can be seq, array or string)
17:09:46TheLemonManmemoryslice?
17:10:15FromGitter<mratsim> Range, View, Slice, Span pick your choice
17:11:47narimirannothing of those sounds easy/understandable for docs :/
17:11:52krux02_narimiran, ptr/size pair
17:12:16krux02_or better: ptr/len pair
17:12:20krux02_because it is exactly that
17:13:22narimiranyeah, i'm not putting "reverses ptr/len pair `a`" to docs :D
17:13:55krux02_yea that would be very confusing
17:14:09TheLemonMan"reverses the content of the container `a`" ?
17:14:25krux02_TheLemonMan, ^^ yes
17:14:33krux02_I just wanted to type something like that
17:15:00FromGitter<ephja> a lot of these things seem like candidates for concepts
17:15:13narimiranTheLemonMan: that sounds good, thanks!
17:15:30krux02_ephja: actually a lot of these things are being worked on to become concepts
17:16:15krux02_But I am not excactly very happy about it.
17:16:29krux02_sure the in theory it is much more abstract etc.
17:16:44krux02_but the higher the abstraction, the harder it is to understand
17:16:55krux02_and it doesn't really have that much of a benefit.
17:17:46krux02_sure that one obscure custom collection does not just work and it can be sorted, but from a true practical point of view of real beneficial value, not really that much of a gain.
17:19:54FromGitter<ephja> hm maybe not this in particular
17:20:35*MyMiau quit (Ping timeout: 256 seconds)
17:21:44*elrood quit (Quit: Leaving)
17:27:39*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
17:35:35shashlickdom96: why does nimble check the full dependency tree during install? I understand it is conservative but feel it is excessive - if all direct dependencies of a package are satisfied, it should proceed with install with the confidence that the dependencies of those dependencies were checked when they were installed
17:42:38*Tortice joined #nim
17:43:42FromGitter<kdheepak> @TheLemonMan I submitted a PR. I think the error message that is raised is not correct. I wanted to ask how we want to print that to the user.
17:47:34*arecaceae quit (Remote host closed the connection)
17:47:53*arecaceae joined #nim
17:53:54*tefter joined #nim
17:56:08ng0hi, can someone explain $lib to me? my experiments with building nim and changing the config/nim.cfg paths and the resulting differences of nim dump show that it is just wherever "lib" in an FHS system is. I'm not really looking forward to patch even more if this is really what $lib is.. is there no central way to change this? I see it being used in other modules as well.
17:57:23ng0i guess i found it, in c_sources.. is that correct?
17:59:31*rockcavera quit (Remote host closed the connection)
17:59:54shashlickAraq: https://github.com/nim-lang/c2nim/commit/aff8c837f7b9d1a95d44e1ca08a83f9a6c54918c
18:11:51ng0okay, I think I got it figured out in 'compiler' and how it can be configured
18:18:33*Vladar quit (Remote host closed the connection)
18:34:52*rnrwashere joined #nim
18:37:26*mr_yogurt_ left #nim (#nim)
18:39:04*rnrwashere quit (Ping timeout: 240 seconds)
18:40:42*hzx joined #nim
18:41:59*TheLemonMan joined #nim
18:44:42*mr_yogurt joined #nim
18:44:43TheLemonManng0, in case you still need it shashlick wrapped the zbar library (you can find it here https://github.com/genotrance/nimzbar)
18:47:07*nsf joined #nim
18:47:20FromGitter<kaushalmodi> if you have the nim, nim0, nim1, nim2 binaries in the compiler/ dir, you don't need csources, right?
18:47:35FromGitter<kaushalmodi> trying to cut down the size of Nim devel dir locally
18:48:53*hzx quit (Quit: Going offline, see ya! (www.adiirc.com))
18:49:14*hzx joined #nim
18:50:50*Benjamin_ joined #nim
18:53:09ng0TheLemonMan: remind me, why did I want this? Because of qr?
18:53:17TheLemonManng0, yeah
18:53:30ng0thanks
18:54:22ng0this is also great because it shows yet another .nimble and .cfg combination I cna take in consideration for generalizing the system integration
18:58:37shashlickTheLemonMan: looking at getting zbar fully working, still not 100%
18:58:47shashlickbut hope to post here shortly with
18:59:10TheLemonManno worries, I had no time to try it out
18:59:38*kid_ joined #nim
19:00:16FromGitter<bpo217> type ⏎ ⏎ ``` Curl {.importc: "CURL", header: "<curl/curl.h>".} = object``` ⏎ ⏎ proc curl_easy_init(): ptr Curl {.importc, header: "<curl/curl.h>".} ... [https://gitter.im/nim-lang/Nim?at=5bb66340bbdc0b2505e7d9d6]
19:00:30FromGitter<bpo217> oops lol
19:01:10FromGitter<bpo217> ```code paste, see link``` ⏎ ⏎ Anyone got an idea why this won't compile? Im getting an undefined symbols error. [https://gitter.im/nim-lang/Nim?at=5bb66376ae7be94016004539]
19:02:20TheLemonManare you linking against libcurl?
19:02:27FromGitter<bpo217> Yes.
19:02:48FromGitter<bpo217> Am I just missing a compiler flag?
19:03:22TheLemonManpossibly, can you show more code/how you compile it?
19:03:28FromGitter<kayabaNerve> @bpo217 Is it a compiler or linker error?
19:03:35FromGitter<kayabaNerve> Linker, right?
19:03:43*Benjamin_ quit (Ping timeout: 256 seconds)
19:04:14FromGitter<bpo217> `nim --verbosity:3 -o:bin/EmailCurl compile src/EmailCurl.nim`
19:04:42FromGitter<bpo217> directory structure is a typical nim project, with bin, src, and test
19:05:06FromGitter<bpo217> I can do the same thing for like, printf for example.
19:05:19FromGitter<bpo217> and it works.
19:05:47TheLemonManyou need something like `{.passC: "-lcurl".}`
19:06:14FromGitter<bpo217> Thanks for giving me the time of day, I'll mess around with that and check back.
19:06:31FromGitter<kayabaNerve> TheLemonMan passL IIRC
19:07:01FromGitter<kayabaNerve> GCC may forward it to the linker anyways but that's generally a linker arg, not a compiler arg, no?
19:07:34TheLemonManyeah, but you usually don't compile and link by hand, you let CC do it for you
19:07:39FromGitter<kayabaNerve> ```{.passC: "-Isrc/lib/libsodium".} ⏎ {.passL: "-lsodium".}``` ⏎ ⏎ Here's my LibSodium code which may or may not help. [https://gitter.im/nim-lang/Nim?at=5bb664fbae7be94016004d39]
19:08:01FromGitter<kayabaNerve> If you have Nim passL, it's not by hand :thinking:
19:08:07TheLemonManbut yeah, if you want to be precise passL is the way to go
19:08:11FromGitter<kayabaNerve> But true.
19:08:46FromGitter<kayabaNerve> Who wants to flip every passC with every passL in every Nim project we can find and see what happens?
19:10:27FromGitter<bpo217> Is that a local version of lib sodium you are linking with in your project?
19:10:35FromGitter<bpo217> by local I mean local to your project
19:11:02FromGitter<bpo217> @kayabaNerve ^
19:13:04FromGitter<kayabaNerve> The header files are passed in with `passC: "-I"` and those are in my project directory because they are. They donI've been meaning to move them. The sodium library referenced
19:13:22FromGitter<kayabaNerve> The header files are passed in with `passC: "-I"` and those are in my project directory because they are. They don't have to be. I've been meaning to move them. The sodium library referenced by `passL` is installed on the system.
19:14:14FromGitter<bpo217> I see
19:19:01*PMunch joined #nim
19:21:12*francisl quit (Quit: francisl)
19:22:07FromGitter<bpo217> I guess I ultimately don't really understand why my original piece of code doesn't work. I feel like it should, because I can use a similar tactic around stdio `printf` for example without issue. A basic .c file is the same as the nim compiled variation when talking about the types and includes. They are identical but I still get a missing symbol for architecture error. That's what is confusing.
19:22:30FromGitter<bpo217> Did that make sense?
19:24:13FromGitter<bpo217> The .c file created by nim ultimately has ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bb668ddae7be9401600645a]
19:24:47TheLemonManmanterolat, your PR found a small issue in the doc generation process!
19:24:53FromGitter<vivekimsit> Hi everyone, I am just curious why this PR failed. ⏎ https://github.com/dom96/choosenim/pull/90
19:25:55*vivus joined #nim
19:26:22FromGitter<manterolat> TheLemonMan, really? What is it
19:26:35FromGitter<Varriount> @vivekimsit I suspect that it's a transient error.
19:26:48vivusflyx: how do I compile the nimyaml project? I tried nim c yaml.nim but that didn't work
19:26:56vivus`nim c yaml.nim`
19:27:32FromGitter<vivekimsit> @Varriount what should I do then?
19:28:08FromGitter<kayabaNerve> @bpo217 What OS are you on?
19:28:20FromGitter<Varriount> Well, pushing another commit to the PR will cause the tester to re-run. dom96 can also close and reopen the PR to have the tester re-run.
19:28:35TheLemonManvivesimkit, the failure looks unrelated
19:28:53FromGitter<vivekimsit> @Varriount I think second option is better
19:28:55FromGitter<kaushalmodi> @manterolat ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bb669f7c08b8b3067d23629]
19:28:57TheLemonManI think it's caused by this line https://github.com/dom96/untar/blob/master/src/untar.nim#L120 see tempdir = nil
19:29:18FromGitter<vivekimsit> hope dom96 is here
19:30:27FromGitter<bpo217> To compile the nim yams library
19:30:27FromGitter<bpo217> btw
19:30:32FromGitter<bpo217> just to `nim build`
19:30:39TheLemonMansome older PR was failing for that reason tho (if anybody wants an easy hacktoberfest PR ;)
19:31:04FromGitter<bpo217> the task is defined in the config.nims
19:31:21TheLemonManmanterolat, have a look at kochdocs.nim / buildDocs
19:31:27vivusalright let me try that
19:32:06FromGitter<manterolat> Will do
19:36:52FromGitter<manterolat> TheLemonMan, seems to be because the `upload` folder doesn't exist, and my commit throws an error if a path doesn't exist... should I change it so that it allows paths that don't yet exist?
19:38:36TheLemonManmanterolat, what happens is that the first time you run the command nothing was produced and now your PR catches that!
19:39:14TheLemonManyou just have to move the `buildJS` call below `createDir`
19:39:30FromGitter<manterolat> Nice, another pull request
19:39:32FromGitter<manterolat> :p
19:39:52FromGitter<manterolat> I should make it separate, right?
19:41:15TheLemonMando as you wish heh
19:42:08TheLemonManI only pretend to be part of the core team, I'm just a passer-by like you :)
19:42:55FromGitter<bpo217> I legit like this language a lot. I think I'm going to be sticking around. Once I solidify my c-wrapping skills.
19:46:07FromGitter<bpo217> How do we wrap a `void*` now? The compiler is complaining that I'm dated.
19:46:14*vlad1777d joined #nim
19:46:21*vlad1777d quit (Remote host closed the connection)
19:46:22FromGitter<bpo217> using `pointer` doesn't work anymore.
19:46:38*vlad1777d joined #nim
19:46:53TheLemonManpointer is fine, `distinct pointer` is the posh version of that
19:48:08vivus@bop217 after I run nim build, how do I test my custom-built version of the library with my code?
19:48:19FromGitter<bpo217> I see you just have to specify. Thanks.
19:48:48FromGitter<manterolat> TheLemonMan, haha, I guess I'll leave a comment and prepare another branch
19:49:53FromGitter<bpo217> Vivus, let me check you probably install the package to your global nim package stuff somehow then including it is as simple as adding it as a dependency in your .nimble file. Are you using nimble?
19:50:14vivus@bpo217 yes I have nimble installed
19:51:18*PMunch quit (Ping timeout: 245 seconds)
19:51:19vivusso if I have a custom project that is NOT going to be a nimble library but I want to use a custom-compiled lib with my code, I specify everything in a .nimble file in my custom-code folder?
19:51:46TheLemonManmanterolat, if you're feeling fancy you may also use git worktrees
19:52:02FromGitter<bpo217> Vivus, looks like in your nim yaml project folder run `nimble install` and nimble will attempt to install that package.
19:52:14TheLemonManthat way you can check out N branches at the same time
19:52:58FromGitter<bpo217> Vivus, once it is installed, add it as a dependency in your own projects .nimble file
19:53:19*kid_ quit (Remote host closed the connection)
19:53:31FromGitter<bpo217> `requires yaml >= insert_version`
19:53:49*kid_ joined #nim
19:54:06FromGitter<bpo217> oops `requires "yaml >= insert_versions"`
19:54:26FromGitter<manterolat> But will it count as an extra pull request? ;)
19:54:26*PMunch joined #nim
19:54:42FromGitter<manterolat> I'll try it out
19:54:44vivusso a .nimble file looks similar to a requirements.txt file in Python?
19:55:35*francisl joined #nim
19:58:09*hzx quit (Quit: Going offline, see ya! (www.adiirc.com))
19:58:33*nsf quit (Quit: WeeChat 2.2)
19:58:53*kid_ quit (Ping timeout: 268 seconds)
19:59:57FromGitter<bpo217> TheLemonMan, `proc free(distinct pointer: void {.importc, header: "stdlib.h".}` doesn't work for trying to mimic a `void*`. Just trying to wrap the darn `free` function lol.
20:00:33FromGitter<bpo217> `proc free(distinct pointer): void {.importc, header: "sodlib.h".}
20:00:45FromGitter<bpo217> `proc free(distinct pointer): void {.importc, header: "sodlib.h".}`
20:00:52TheLemonMan`proc free(x: pointer): void`
20:01:17FromGitter<bpo217> See I knew it was easy.
20:01:24FromGitter<bpo217> lol
20:01:24FromGitter<kayabaNerve> 1) `: void` shouldn't be needed. ⏎ 2) `std`, not `sod`. ⏎ 3) Don't use `distinct` for this.
20:01:35FromGitter<bpo217> yeah autocorrect was killing me.
20:02:28FromGitter<bpo217> I'm going to make a decent wrapper around the imap portion of the curl library. I think it's going to be pretty useful.
20:08:47*rlr joined #nim
20:22:08vivus@kaushalmodi were you using cligen yday?
20:31:43*francisl quit (Quit: francisl)
20:31:57*narimiran quit (Ping timeout: 252 seconds)
20:34:21FromGitter<bpo217> @kayabaNerve I ended up using push pop with a dynamic library: `{.push dynlib: "/usr/lib/libcurl.dylib"}`. No issues with missing symbols now.
20:39:48FromGitter<kaushalmodi> vivus: not yesterday
20:39:52FromGitter<kaushalmodi> I added it today
20:40:08FromGitter<kaushalmodi> did you try the 0.3.0 release? (assuming you are talking about ntangle)
20:40:23*Trustable quit (Remote host closed the connection)
20:40:37vivus@kaushalmodi how do I run procs with cligen that have no arguments in them? eg. `./some-program do_something` ?
20:41:05FromGitter<kaushalmodi> don't follow.. do_something is an arg
20:41:09*zakora quit (Quit: WeeChat 2.2)
20:41:18FromGitter<kaushalmodi> you mean, *no switches like `--foo`*?
20:41:25vivusyeah, no switches
20:41:46FromGitter<kaushalmodi> use `foo: seq[string]` as the type
20:42:02FromGitter<kaushalmodi> https://github.com/OrgTangle/ntangle/blob/7659d6d41cd6837dced8d7a43dd85fc4986f5120/src/ntangle.nim#L282
20:42:38FromGitter<kaushalmodi> then that do_something will be parsed as `@["do_something"]`
20:42:46*Tortice quit (Remote host closed the connection)
20:43:18vivuswow, thanks so much, that worked. seems like my program is working once again.
20:43:26FromGitter<kaushalmodi> 👍
20:45:00*LarazH joined #nim
20:46:39FromGitter<kaushalmodi> vivus: ...
20:46:51FromGitter<kaushalmodi> do you mind trying the latest release binary for ntangle? :)
20:47:00vivus@kaushalmodi sure.
20:47:03FromGitter<kaushalmodi> it's still bugging me why you were unable to run it yest
20:48:03FromGitter<kaushalmodi> run `curl https://raw.githubusercontent.com/OrgTangle/ntangle/master/tests/quick_test.sh | bash`
20:48:16FromGitter<kaushalmodi> check https://raw.githubusercontent.com/OrgTangle/ntangle/master/tests/quick_test.sh first
20:48:19*LarazH quit (Remote host closed the connection)
20:48:33vivus No tangle blocks found
20:48:56FromGitter<kaushalmodi> ok, great! but that shouldn't happen with that test file
20:49:10FromGitter<kaushalmodi> ntangle does not support 100% org tangling syntax
20:49:13FromGitter<kaushalmodi> yet
20:49:33vivuscan you send me the link to the test file?
20:49:54vivusI dont execute bash scripts from the internet.
20:50:00FromGitter<kaushalmodi> here it is: https://raw.githubusercontent.com/OrgTangle/ntangle/master/tests/tangle_no_yes/tangle_no_yes.org
20:50:09FromGitter<kaushalmodi> vivus: that's a smart choice
20:50:22FromGitter<kaushalmodi> (not executing bash scripts from internet :))
20:50:59FromGitter<kaushalmodi> you can read the script online first.. it's not too complicated
20:51:04vivusWriting file2.nim (2 lines) ... Writing specified_file.nim (2 lines) ..
20:51:13FromGitter<kaushalmodi> yay!
20:51:21FromGitter<kaushalmodi> thanks for testing
20:51:24vivusnp
20:51:26FromGitter<kaushalmodi> and it should be in all color
20:51:32vivusnot sure what this is supposed to do
20:51:35*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
20:51:42FromGitter<kaushalmodi> about what?
20:51:45vivusyeah filenames are in colour
20:51:54vivusthe program, not sure what it does. just creates 2 files lol
20:52:09FromGitter<kaushalmodi> hehe.. it's called Org Tangling
20:52:13FromGitter<kaushalmodi> Literate Programming
20:52:24FromGitter<kaushalmodi> the idea is to have an Org file contain code + documentation
20:52:27FromGitter<kaushalmodi> let me show a real example
20:52:48FromGitter<kaushalmodi> I have this one Org file: https://raw.githubusercontent.com/kaushalmodi/eless/master/eless.org
20:53:02FromGitter<kaushalmodi> from that same file, I generate https://eless.scripter.co/
20:53:24FromGitter<kaushalmodi> and also this script: https://raw.githubusercontent.com/kaushalmodi/eless/master/eless
20:54:02FromGitter<kaushalmodi> so as I add/update to that Org file, I can write the docs at length, knowing that they will fall in the right place in the final doc site
20:54:14FromGitter<kaushalmodi> and the code will go where it's supposed to go.
20:54:27FromGitter<kaushalmodi> That Org -> code export process is called tangling
20:54:28vivusoh I see now
20:54:49FromGitter<kaushalmodi> that test file is a joke.. but I need to start *somewhere*
20:55:04FromGitter<kaushalmodi> eventually I plan to make ntangle mature enough to process eless.org
20:55:20FromGitter<kaushalmodi> if you want to try, ntangle will "work" for https://raw.githubusercontent.com/kaushalmodi/eless/master/eless.org too
20:55:32FromGitter<kaushalmodi> but it will print warnings for the tangle syntax it doesn't yet support
20:57:31vivusI guess 1 day I might need this software and you'd have already written it XD
20:59:46FromGitter<kaushalmodi> This tangling process already works from within Emacs
20:59:58FromGitter<kaushalmodi> That's how I published the code and docs of that eless project.
21:00:11FromGitter<kaushalmodi> With ntangle, I plan to make that tangling process faster
21:06:01*PMunch quit (Remote host closed the connection)
21:08:41*rockcavera joined #nim
21:22:05*rnrwashere joined #nim
21:22:37vivuseless.org doesn't resolve to a website though
21:23:41FromGitter<kaushalmodi> yeah, I don't own that domain :P
21:23:47FromGitter<kaushalmodi> the website is https://eless.scripter.co/
21:24:18FromGitter<kaushalmodi> or were you hinting to buy that domain?
21:28:45*jjido joined #nim
21:30:37*rnrwashere quit (Remote host closed the connection)
21:34:27shashlickhas anyone used zbar before
21:36:50*rockcavera quit (Read error: Connection reset by peer)
21:38:48*rockcavera joined #nim
21:38:48*rockcavera quit (Changing host)
21:38:48*rockcavera joined #nim
21:39:25*rnrwashere joined #nim
22:06:03shashlickokay nimzbar compiles on Windows - https://github.com/genotrance/nimzbar
22:12:07FromGitter<kdheepak> How to run tests on the Nim source code?
22:13:08FromGitter<kdheepak> `nimble test` passes almost immediately, I don't think runs anything
22:13:49*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:14:37FromGitter<kdheepak> Also, when I type `git status` I get a weird file that appears to have been deleted that was already in the repo history.
22:14:51FromGitter<kdheepak> (https://files.gitter.im/nim-lang/Nim/5YQ3/Screen-Shot-2018-10-04-at-4.13.31-PM.png)
22:17:47*mediamonster joined #nim
22:22:53*mediamonster quit (Remote host closed the connection)
22:29:16*darithorn quit ()
22:34:54FromGitter<mratsim> you have to write your own tests @kdheepak
22:35:08FromGitter<mratsim> check the tests/ folder
22:38:43FromGitter<kaushalmodi> @kdheepak If you meant how to run all the existing Nim tests, I see this in travis: https://github.com/nim-lang/Nim/blob/2e5c759736a9458b192a3beb2cf3a38b2f198887/.travis.yml#L45-L46
22:41:37FromGitter<kdheepak> Thanks @kaushalmodi
22:42:37FromGitter<kdheepak> @mratsim I guess I was trying to figure out how to test for something that should fail
22:49:06FromGitter<kdheepak> testament works well!
22:49:35FromGitter<kdheepak> @TheLemonMan I think that PR is ready for review!
22:50:29FromGitter<mratsim> expect(ValueError): raise newException(ValueError, “Oops”)
23:03:02FromGitter<gogolxdong> Is there a media player of Nim?
23:03:14*krux02_ quit (Remote host closed the connection)
23:11:17*vlad1777d quit (Ping timeout: 268 seconds)
23:14:18*rnrwashere quit (Remote host closed the connection)
23:14:53*rnrwashere joined #nim
23:15:32vivuswhat is the best way to compile my program for production use?
23:19:21*rnrwashere quit (Ping timeout: 252 seconds)
23:22:33*darithorn joined #nim
23:22:34*rnrwashere joined #nim
23:22:37*vlad1777d joined #nim
23:26:28*kskkm joined #nim
23:28:59*rnrwashere quit (Remote host closed the connection)
23:29:20*kskkm quit (Remote host closed the connection)
23:31:42*rnrwashere joined #nim
23:35:22*rnrwashere quit (Remote host closed the connection)
23:37:32*JefrenKC joined #nim
23:38:05FromGitter<malkomalko> Do most people use the built in `unittest` for testing or is there another preferred library? It looks minimal but good enough for 80-90%
23:38:06FromGitter<kaushalmodi> How do you define "best"? You'd definitely use `-d:release`, but what are your other requirements?
23:38:48*seni quit (Remote host closed the connection)
23:40:46*rnrwashere joined #nim
23:42:33*Tortice joined #nim
23:48:05*rnrwashere quit (Remote host closed the connection)
23:48:18*JefrenKC quit (Ping timeout: 252 seconds)
23:57:05*rnrwashere joined #nim
23:57:41*thomasross quit (Remote host closed the connection)
23:59:12*rnrwashere quit (Remote host closed the connection)