<< 26-01-2017 >>

00:00:16krux02you could use a very cryptic identifier within the for loop so that other people won't meet this bug as I did.
00:00:33krux02wouldn't solve it, but make it less visible.
00:01:15krux02as long as the workaround works, I am fine
00:01:51AraqI won't introduce a hacky workaround
00:03:17*couven92 quit (Quit: Client disconnecting)
00:04:51*jh32 quit (Ping timeout: 245 seconds)
00:21:59krux02when you are working on the generated names from the compiler, it would be nice, when the compiler would generate names, that encode some readable information, for example the argument types for functions
00:22:38krux02but you probably already know that
00:23:11*bjz_ quit (Ping timeout: 264 seconds)
00:23:46*bjz joined #nim
00:24:32krux02foo_int32_int23_abc123xyz for proc foo(a,b: int32)
00:27:32krux02ok, I quit for today. Was nice to talk to you, good night
00:28:11*yglukhov quit (Remote host closed the connection)
00:29:00*devted joined #nim
00:41:15*krux02 quit (Quit: Leaving)
00:43:52nivfinish.exe with the windows nim distro says "No compatible MingW candidates found", but i have mingw and gcc installed in the path the program listed. It doesn't really give any indication what's wrong with it. so, what do I need to run nim on windows?
00:57:25Xei'm getting a compiler segfault trying to compile the tests for the rethinkdb library: https://github.com/OpenSystemsLab/rethinkdb.nim
00:59:19Xehttps://gist.github.com/Xe/840d59a60bd78ecb0f944f10731b7568
01:00:27Xehttps://gist.github.com/Xe/2b57dbfe6cb050291311ea60164ff1c9
01:14:24*libman joined #nim
01:28:41*yglukhov joined #nim
01:34:51*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
01:39:43*Kingsquee quit (Read error: Connection reset by peer)
01:40:04*Kingsquee joined #nim
01:50:31*reactormonk quit (Ping timeout: 248 seconds)
01:51:40*bjz joined #nim
01:52:13*reactormonk joined #nim
01:57:08FromGitter<Varriount> Xe: Could you compile the Nim compiler in debug mode, and give us the resulting stack trace?
01:58:48*gokr quit (Ping timeout: 240 seconds)
02:01:37XeVarriount: how?
02:03:26*yglukhov quit (Ping timeout: 260 seconds)
02:05:00FromGitter<Varriount> Xe: `koch boot --stackTrace:on --lineTrace:on`
02:05:33FromGitter<Varriount> Or my personal favorite, `koch boot --stackTrace:on --lineTrace:on -d:release`
02:06:10Xehttps://gist.github.com/Xe/687c4853c2a5a3161ff7ad07cdebc77c
02:07:37FromGitter<Varriount> Xe: I think you can turn the verbosity down.
02:08:02Xehttps://gist.github.com/d6c54133e219de01ea3d3002ac009668
02:08:06FromGitter<Varriount> Anyway, if you can develop a minimal test case that causes that same stack trace, and file an issue, then that would be great.
02:09:00FromGitter<Varriount> It looks like something is going wrong with object cases? Are you using object variants at all?
02:12:43Xei am not sure if the author of this library used that or not
02:13:33Xehowever, the line of code that is compiled last before nim segfaults is https://github.com/OpenSystemsLab/rethinkdb.nim/blob/master/private/rql.nim#L268
02:13:52Xehttps://github.com/OpenSystemsLab/rethinkdb.nim/blob/master/private/queries/writing.nim
02:14:48*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
02:20:49*Pisuke quit (Excess Flood)
02:20:53*chemist69 quit (Disconnected by services)
02:20:58*chemist69_ joined #nim
02:21:58*Pisuke joined #nim
02:36:23*arnetheduck quit (Ping timeout: 248 seconds)
02:40:38FromGitter<endragor> /mark-
02:50:09*kulelu88 quit (Quit: Leaving)
02:54:22FromGitter<endragor> @dom96 so in your chat client example 1) there is up to 500ms delay from the moment the line is read till the moment it's processed; 2) there is a race condition - the flow var can get ready before the connect() is finished, so you would send to not connected socket.
02:59:22FromGitter<endragor> (1) could be "fixed" by using `poll(1)` but that's not a natural flow and wastes CPU time. AsyncEvents allow to have a pool of threads that do async IO and communicate with each other naturally.
03:17:03*ludocode quit (Disconnected by services)
03:17:04*ludocode_ joined #nim
03:56:11*brson quit (Quit: leaving)
03:58:33*def-pri-pub quit (Ping timeout: 252 seconds)
03:58:52*libman2 joined #nim
04:00:13*def-pri-pub joined #nim
04:00:16*yglukhov joined #nim
04:01:02*libman quit (Ping timeout: 256 seconds)
04:05:00FromGitter<zacharycarter> think I figured it out
04:06:18*yglukhov quit (Ping timeout: 276 seconds)
04:18:11*libman2 quit (Ping timeout: 260 seconds)
04:23:36*libman joined #nim
04:28:11*libman quit (Ping timeout: 245 seconds)
04:35:08*def-pri-pub quit (Quit: leaving)
04:46:27*devted quit (Quit: Sleeping.)
04:47:45*libman joined #nim
04:52:11*libman quit (Ping timeout: 240 seconds)
05:07:15*manjaroi3 quit (Quit: leaving)
05:12:51FromGitter<barcharcraz> is there a way to set the directory that nim outputs to, not the output filename?
05:13:12FromGitter<barcharcraz> just setting --out to a directory works but the exe name becomes the first module compiled (so like stdlib_system.exe)
05:21:23FromGitter<vegansk> @barcharcraz , just set it with the desired filename. We use it like this in config.nims: ``switch "out", binDir / outFileName.toExe``
05:21:55FromGitter<barcharcraz> right but I want my whole tree to ALWAYS output to a given location
05:22:04FromGitter<barcharcraz> even when I'm just compiling to make sure codegen and stuff works
05:26:31FromGitter<vegansk> @barcharcraz , create function for it. Here is the example of build config. All test produces executables in the ``bin`` directory. https://github.com/vegansk/nimboost/blob/master/config.nims#L49
05:28:09FromGitter<barcharcraz> do you have to execute that with nim e?
05:28:27FromGitter<barcharcraz> I could not get my compiler to pick up nims files when just running nim c {somefile}
05:41:25FromGitter<vegansk> @barcharcraz , nim help shows you all build targest. Then run nim ``target``, for example ``nim test`` runs this task (https://github.com/vegansk/nimboost/blob/master/config.nims#L72). It's documented here: http://nim-lang.org/docs/nims.html
05:42:02FromGitter<vegansk> Build file must be named ``config.nims``
06:03:14*yglukhov joined #nim
06:07:37*yglukhov quit (Ping timeout: 255 seconds)
06:09:25FromGitter<Varriount> Nimscript documentation need better visibility/discoverability
06:11:08FromGitter<khchen> @Varriount just want to say thank you. I use your nimlime a lot.
06:26:49cheatfatekhchen, what features of NimLime your are use most often?
06:35:11FromGitter<khchen> highlight and compile, lol
06:51:41FromGitter<dom96> @endragor imo the solution here is for the channels module to get a async recv proc. I don't know how difficult that is but I'm sure it's doable. Using asyncdispatch from multiple threads seems like a good way to shoot yourself in the foot. I disagree that using AsyncEvent is natural.
06:52:32*nsf joined #nim
06:55:01FromGitter<dom96> Nice catch on the race condition. For simplicity's sake I'm willing to take that risk though.
06:55:11cheatfatedom96: combining `channels` and `asyncdispatch` is not natural, because you can't poll() for async events and channels at the same time...
06:55:15FromGitter<Varriount> What are the plans for async + threads in the future? It's an obvious step forward, but one that's architecturally difficult to do without severely limiting end users.
06:55:40FromGitter<Varriount> @khchen Thanks. :D
06:55:57Araqplans? it needs to work.
06:56:46cheatfateAraq, what must work? channels and async?
06:57:09Araqyes
06:57:17cheatfatestart using pipes
06:57:36FromGitter<dom96> @cheatfate it is perfectly natural. I'm sure whatever way channels are implemented supports polling via epoll et al.
06:57:42FromGitter<Varriount> @Araq I was more asking about the asynchronous stuff in general. Current the implementation is single threaded.
06:58:47cheatfatedom96, interesting do we support epoll only? or we need to support kqueue/epoll/iocp?
06:59:18FromGitter<dom96> I'm not sure yet (!). But I think that async won't automatically start parallelising your code.
06:59:55FromGitter<dom96> @cheatfate "et al. "!
07:00:13FromGitter<dom96> Maybe etc would have been clearer
07:00:22*Vladar joined #nim
07:00:23cheatfatedom96, sorry but english not my own language, i dont know what is "et al."
07:00:25FromGitter<Varriount> @dom96 No, that's not the way to go. But there should certainly be the option.
07:01:02FromGitter<dom96> I am well aware that we support those. But since I am on my phone I don't feel like writing them down.
07:01:05FromGitter<Varriount> @dom96 I think you meant 'etc'. 'et al.' is for a group of people.
07:01:29FromGitter<dom96> Yeah. I just woke up :)
07:01:43cheatfatedom96, on posix systems kqueue/epoll doesn't support any notifications on posix events/threads/mutexes and other shit
07:02:03FromGitter<Varriount> Though, wiktionary tells me both can be used more or less interchangeably, there's still a de facto usage.
07:02:23FromGitter<Varriount> https://dbsoundworks.bandcamp.com/album/crypt-of-the-necrodancer-amplified-ost
07:02:25cheatfatedom96, if you want to start using signals to notify about data available in channel, then it will be large overhead...
07:02:45cheatfatedom96, and this overhead will be much more then just using pipes (asyncpipes)
07:02:56FromGitter<dom96> @Varriount :D
07:03:34FromGitter<dom96> Perhaps the underlying implementation should be AsyncEvent. I don't know.
07:04:24FromGitter<Varriount> @dom96 This might give you ideas: http://pyparallel.org/
07:04:29FromGitter<dom96> @Varriount is C#'s async automatically parallel?
07:05:40cheatfateAraq, the best way to replace AsyncEvent + channels is to use AsyncPipes, maybe you will need to get some marshalling code from channels and just use asyncpipes as data transfer channel...
07:06:24FromGitter<Varriount> @dom96 Wrong person to ask. I could google it though.
07:06:47FromGitter<dom96> The answer is no :p
07:07:20FromGitter<dom96> That :P emote on gutter
07:07:31FromGitter<dom96> *gitter is horrifying.
07:07:50FromGitter<dom96> Also. Auto complete on my phone fails miserably with these programming terms.
07:08:04FromGitter<dom96> Time for work
07:08:14FromGitter<Varriount> @dom96 The easiest way (for both the implementation and end-user api) might be to just have multiple threads that each run their own loop
07:08:41FromGitter<Varriount> And maybe some way for multiple loops to share certain resources (like listening on a port for new connections)
07:08:48FromGitter<dom96> Or you could just let the user do that themselves
07:09:14FromGitter<Varriount> I don't know if the async framework exposes enough for that to be currently done.
07:09:35FromGitter<dom96> Then it should
07:09:54FromGitter<dom96> But it shouldn't automatically parallelize stuff as I've said
07:10:05FromGitter<Varriount> And I agree.
07:10:25FromGitter<Varriount> But provided a nice way for users to start a loop in a new thread, and allow for sharing of resources...
07:10:30FromGitter<Varriount> *providing
07:12:01FromGitter<Varriount> I envision it as some server having a main thread that spawns off 4+ worker threads, each handling a client pool.
07:12:30FromGitter<Varriount> Perhaps with the main thread containing "global" state that all threads need.
07:26:56*filcuc joined #nim
07:28:34FromGitter<barcharcraz> wow I need to sleep
07:29:05FromGitter<barcharcraz> tomorrow I think I'll have a library where you can write stuff like ⏎ ⏎ ```db.exec(sql"select * from test 1``` [https://gitter.im/nim-lang/Nim?at=5889a540c19662f15390aea3]
07:29:15FromGitter<Varriount> No rest for the wicked. Or in my case, for the one who needs to both study for a german course and do 12 hours of work for his job.
07:30:25FromGitter<barcharcraz> yeah same
07:30:33FromGitter<barcharcraz> It's 2:30 AM here
07:31:02FromGitter<barcharcraz> but I have a plan for how to write an sql library that makes nim literally easier to do sql in than plpgsql
07:31:19FromGitter<barcharcraz> *assuming you know your schema at compile time*
07:37:12*Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif)
07:38:45FromGitter<barcharcraz> it'll get all the types right too
07:39:44FromGitter<barcharcraz> and allow the user to define their own types per column (for example maybe I want some blob column to convert to an image type)
07:40:59FromGitter<Varriount> @barcharcraz I recommend starting with a small, well-developed base, and go from there.
07:41:15FromGitter<barcharcraz> yeah I am
07:41:46FromGitter<barcharcraz> getting simple mapping to native types (BLOB to seq[uint8], text to string, etc) working first
07:41:54FromGitter<barcharcraz> also not doing inserts to start
07:43:48FromGitter<barcharcraz> I'd like to allow something like "INSERT INTO table (something) VALUES (:myvariable)" to just automatically generate the binding code to bind a nim variable named myvariable to the :myvariable parameter
07:45:14FromGitter<barcharcraz> using staticExec LIBERALLY
07:45:53*Kingsquee joined #nim
07:49:36FromGitter<barcharcraz> @dom96 c#'s async is not parallel afaik
07:55:26*Guest89004 joined #nim
08:02:10*gokr joined #nim
08:02:23*libman joined #nim
08:11:49FromGitter<endragor> @dom96 asyncdispatch works from multiple threads just fine, and it's not uncommon in other systems for threads to have their own event loops and asyncdispatch is designed to support that. `asyncRecv` for channels would have to use AsyncEvents or some analogy anyway. What I use, specifically, is a wrapper that holds a pair of Channel[T] and AsyncEvent. And it looks/works pretty naturally. ⏎ Channel doesn't use anything related to IO or
08:11:49FromGitter... epoll - it's based on mutexes and condition variables.
08:13:43cheatfateendragor: for such situation its much better to use https://github.com/cheatfate/asynctools/blob/master/asynctools/asyncpipe.nim
08:17:45*jh32 joined #nim
08:18:43FromGitter<endragor> @cheatfate 1) the API is too low-level, Channels support passing GCed objects, while this just supports passing bytes, so I would have to reimplement/copy a part of channels implementation for that to work. 2) pretty sure it would be slower as data is passed through IO pipeline instead of plain memory copying.
08:20:45*yglukhov joined #nim
08:21:12cheatfate1) agree 2) i dont think it would be slower, because i know how AsyncEvent is implemented...
08:22:00cheatfatein your situation it will be slower for big chunks of data
08:22:17cheatfatewhich will be more then pipe buffer data
08:22:24FromGitter<endragor> yes, that's what I mean
08:23:25*yglukhov_ joined #nim
08:23:25*yglukhov quit (Read error: No route to host)
08:26:31*libman quit (Ping timeout: 245 seconds)
08:31:30*yglukhov_ quit (Remote host closed the connection)
08:31:50cheatfateendragor: but you need to understand that pipes are not files and don't use IO pipeline, pipe operations mostly looks like (lock, copy data to userspace/kernelspace, unlock)
08:32:00*libman joined #nim
08:34:19FromGitter<endragor> @cheatfate ok, I might benchmark that when I have time. but anyway AsyncEvent+Channel works pretty well, except for the problem that I mentioned yesterday which is not really about AsyncEvents, but about asyncdispatch's support for multithreading.
08:44:51*Andris_zbx joined #nim
08:45:58*yglukhov joined #nim
08:47:21*cyraxjoe quit (Ping timeout: 255 seconds)
08:47:51FromGitter<dom96> @endragor it might work just fine but it wasn't designed for it.
08:48:22*cyraxjoe joined #nim
08:48:56FromGitter<dom96> And I bet it's not exactly stable as a result of that.
08:53:40FromGitter<endragor> @dom96 what was not designed for it, exactly?
08:54:50FromGitter<dom96> I never placed too much emphasis on threading while designing it, so it wasn't designed for it.
08:57:07FromGitter<endragor> that's a characteristic of Nim's stdlib in general, and that is also an important direction for improvement
08:57:42FromGitter<dom96> sure, and that's because threading was implemented relatively late in Nim's development.
09:03:21FromGitter<dom96> But okay, keep using AsyncEvent just keep in mind that the API of upcoming can still change.
09:04:43FromGitter<endragor> sure, just as any other stdlib API :) I'm fine with that. thanks for your interest and arguments!
09:04:52FromGitter<dom96> I still need to thoroughly look through that code, but based on a quick look I can already see that the ``addEvent`` proc should return a ``Future`` instead of taking a callback.
09:05:02FromGitter<dom96> hehe, sure.
09:08:45*Andris_zbx quit (Ping timeout: 256 seconds)
09:09:13*Andris_zbx joined #nim
09:19:36*hendi_ joined #nim
09:21:38cheatfatedom96, really? maybe you want to change addRead/addWrite to return Future too?
09:24:29FromGitter<dom96> oh. That makes sense :)
09:24:52*PMunch joined #nim
09:26:24*yglukhov quit (Remote host closed the connection)
09:26:29*PMunch quit (Client Quit)
09:26:37*PMunch joined #nim
09:27:34cheatfatei have made my additions named `addXXX` because i can't always understand your `naming conventions`... also addEvent its more suitable to have callback interface, because event can be signaled many times... but Future is one-time only
09:30:32FromGitter<dom96> You've done it correctly. Are you suggesting that my naming conventions don't make sense?
09:35:10cheatfateJust remember or disputes on `sleepAsync` vs `asyncSleep`... also i think asyncCheck must be renamed to something else, because nobody uses it for `check`, everybody uses it for just spawning not controlled task
09:38:10cheatfatemaybe spawnAsync or asyncSpawn will be nice name for asyncCheck
09:39:20Araq^ yup. asyncCheck is misnamed
09:39:37Araqit should be spawnAsync
09:39:50Araqor asyncSpawn ... lol
09:39:55*yglukhov joined #nim
09:40:53*Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif)
09:41:06PMunchHi, I'm looking at some older Nim code (2014) which now throws some errors
09:41:44PMunchSpecifically "discard selector.register(self.socket.getFD, {EvRead}, nil)" which throws "Error: expression '...' has no type (or is ambiguous)"
09:44:29FromGitter<dom96> cheatfate: Araq: Nope. asyncCheck makes sense. it doesn't spawn anything, it checks for exceptions in the returned future.
09:44:50FromGitter<dom96> "Spawning" occurs when you call an async procedure
09:44:58AraqPMunch: so remove the 'discard'
09:45:02Araqthe API changed.
09:45:19FromGitter<dom96> PMunch: it means that register no longer has a return type
09:45:27Araqwhat it does surely looks like spawning to me
09:45:33PMunchAah, that would explain it
09:45:44PMunchAccording to the docs it still has one: http://nim-lang.org/docs/selectors.html#register,Selector,SocketHandle,set[Event],SelectorData
09:45:51PMunchThat's why I was confused :P
09:46:09Araqmaybe the windows version wasn't updated
09:46:14Araqthe docs are build on windows
09:46:17Araq*built
09:46:38FromGitter<dom96> Araq: even more reason to keep the name...
09:46:57FromGitter<dom96> Have you ever looked at the implementation of ``asyncCheck``?
09:47:15FromGitter<dom96> The only thing that might change is that it will become implicit.
09:47:22FromGitter<endragor> @cheatfate so `proc close*(dispatcher: PDispatcher)` would call `selector.close()` on non-Windows and do nothing on Windows, right? or is there anything to be done on Windows?
09:47:25FromGitter<dom96> But I'm not sure what effect that will have yet
09:48:00Araqso what's the proper way to spawn an async task? you know, somehow I need to call the .async proc
09:49:08cheatfateAraq, asyncCheck, lol :)
09:50:04PMunchWow, the Nim version in the Ubuntu repositories is super old :S
09:50:33Araqsurprise.
09:50:50PMunchHaha, guess not. One of the reasons why I've moved on from it..
09:50:55Araqnews: Linux package management is stupid.
09:51:12PMunchEy, Linux package management is great
09:51:36Araqsure, if you want to conflate OS updates with software updates...
09:51:45PMunchIt's just that distributions like Ubuntu with a high focus on stability typically ends up freezing all updates..
09:51:50cheatfateendragor: there is a problem, because if something registered left inside of IOCP port it will not be closed with closeHandle(), and there can be pending IO operations which must be cancelled with CancelIO, and if there pending timers/process/event waiters it must be unregistered
09:52:32PMunchAh, yes that is one of the things that is a bit annoying. But then again, on Linux the line between OS and installed programs is pretty blured in many cases
09:53:20PMunchFor example I can install a distribution with Gnome, and then later on install e.g. KDE and remove Gnome completely.
09:54:07PMunchSo suddenly the entire machine has changed it's look and feel, menues, and many background things. The way to install packages might even have changed.
09:55:20FromGitter<endragor> @cheatfate hmm, maybe in such case it would be a good idea to raise exception from close() because it would mean the developer didn't cleanup the handles properly.
09:55:58Araqdom96: your async work is superb but asyncCheck really is misnamed.
09:56:10Araqyou named it from the implementation perspective.
09:56:26Araqfor a poor user the "spawn" aspect is what matters, not the checking aspect
09:57:44FromGitter<endragor> but the "spawn" happens just when you call the async procedure, as @dom96 said. even if you `discard someAsync()` - the procedure will still execute, you just will never know the results
09:58:18FromGitter<dom96> exactly
09:58:45Araqhmmm true
09:59:00Araqthe spawn is the proc call.
10:01:37*couven92 joined #nim
10:05:23PMunchQuick note, here http://nim-lang.org/download.html it really should be ./koch tools as koch isn't added to path
10:08:21couven92PMunch, works fine on windows with the ./ ! :P
10:08:29couven92s/with/without
10:09:11couven92so, from my point of view a .\koch might be a good idea! :D
10:09:17PMunchYeah, because Windows treats wd as part of the path
10:09:38PMunchBut these are the Linux/Mac OSX install instructions
10:09:39Araqon my Unix systems I have '.' in my PATH too
10:09:42PMunchSo this is a moot point..
10:10:53couven92Anyways, I have always wondered, why don't we put koch into the bin folder next to the nim binary? Because I do that by running >nim c -d:release -o:bin\koch koch
10:11:00couven92Then it would also be in the PATH
10:11:16PMunchYeah, that would be better. Now it puts it in the working directory?
10:11:28couven92Ah wait... koch needs you to be at the Nim source root, right?
10:12:02PMunchSo if you follow the instructions to the letter you have probably gone out to ~ to change .bashrc and when you then run the command koch ends up in ~
10:20:17FromGitter<dom96> You usually only need to use koch once.
10:20:30FromGitter<dom96> So I don't think adding it to the PATH is necessary.
10:21:03couven92@dom96 whaaat? I use it ALL the time! :P (Because I compile Nim from source way too often!) :D
10:22:03FromGitter<dom96> That's usually preceded by a ``git pull`` for me, and since I need to be in Nim's directory for that anyway...
10:23:06couven92Is this maybe a good solution?: ./koch boot -nimroot:./Source/GitHub/nim-lang/Nim
10:23:36couven92i.e. having an arg to koch to specify where it should do its work from?
10:29:01cheatfatedom96, i just want to make everything async named without any suffixes and prefixes and all sync shit must be named with readSync, writeSync :)
10:29:31cheatfatewe need to deprecate all sync functions :)
11:01:08*NhanH quit (Quit: Connection closed for inactivity)
11:02:32*yglukhov quit (Remote host closed the connection)
11:05:08*gangstacat quit (Quit: Ĝis)
11:08:21*gangstacat joined #nim
11:12:38*bjz_ joined #nim
11:13:03*bjz quit (Ping timeout: 252 seconds)
11:14:51PMunchHmm, any examples of how to use the Jester settings macro?
11:17:33*yglukhov joined #nim
11:19:25PMunchNever mind, found something in tests/alltest.nim ..
11:39:34*arnetheduck joined #nim
11:44:52*Andris_zbx quit (Remote host closed the connection)
11:46:21*yglukhov quit (Remote host closed the connection)
11:50:06*Andris_zbx joined #nim
12:03:13*Snircle joined #nim
12:03:34*yglukhov joined #nim
12:06:51*djellemah quit (Remote host closed the connection)
12:12:07*rokups joined #nim
12:18:38*vlad1777d joined #nim
12:19:47*krux02 joined #nim
12:38:36*gokr quit (Ping timeout: 240 seconds)
12:48:55demi-what is the proper way to have a return value be discarded? I'm using os.splitFile(), which seems to return a tuple `(dir, name, ext)` and I'm only interested in the file extension itself, in python i'd write this as `_, _, ext = os.splitFile()` but i'm unsure how to get that same behavior in nim -- i've just tried to use `_` as a variable for the first two values there and it seems to compile and run fine but
12:48:57demi-i'm not sure if that is correct.
12:50:08*devted joined #nim
13:01:45*byte512 joined #nim
13:06:34*gokr joined #nim
13:17:15*yglukhov quit (Remote host closed the connection)
13:17:28*gokr quit (Read error: Connection reset by peer)
13:17:59PMunchdemi-, http://nim-lang.org/docs/tut1.html#advanced-types-tuples
13:18:11PMunchAs you can see your syntax will just assign everything to ext
13:18:15PMunchAnd not actually split it
13:18:24*yglukhov joined #nim
13:19:47demi-sorry, in nim i've written it as `(_, _, ext)`
13:28:29*rupil joined #nim
13:28:40PMunchAh good
13:29:27demi-so that is correct, the single underscore for both means they will get discarded?
13:30:32PMunchI believe so, yes
13:31:01PMunchCan't find much in the docs but googling around it seems like that's the way to do it
13:32:28demi-ok, cool. Thanks!
13:34:40rokupsis there any way to check on backend compiler defines? i need different behavior when glibc is used. `defined()` appears to be working only with nim stuff though
13:36:08hohlerdeis there a way to fully dynamically use a shared library in nim, i.e. getting address of function via symAddr and pass any number of arguments as needed?
13:37:27rokupscertainly
13:38:06hohlerdeI only found examples casting the pointer returned by symAddr to the desired function
13:38:51rokupsdll loading is OS stuff, consult your OS documentations on how its done. then these calls will be importc-pragma-away
13:40:21demi-I am noticing that the nim compiler (transpiler??) is inlining all the procs (in the generated binary) instead of defining them as separate functions, is there a way to disable this behavior?
13:41:05rokupstried disabling optimizations?
13:42:29demi-This is from just running `nim compile foo.nim`
13:44:19*yglukhov quit (Remote host closed the connection)
13:44:51*yglukhov joined #nim
13:47:27*gokr joined #nim
13:51:25*chemist69_ quit (Quit: WeeChat 1.6)
13:51:43*chemist69 joined #nim
13:52:17*gokr quit (Ping timeout: 255 seconds)
13:58:51chemist69Hi Araq, on Github you mentioned the possibility to upload windows binaries for libui (libui.dll). Could you still do that, if possible compiled without debug symbols (because with debug symbols I need additional libs to run it on windows). I tried the binary from https://github.com/rjopek/hbui/tree/master/docs/tutorial#binary-download, but it does work in my hands. My programs directly quit again without
13:58:53chemist69showing a GUI and show no error messages on the win console, either.
14:05:55*yglukhov quit (Remote host closed the connection)
14:06:07*yglukhov joined #nim
14:09:44cheatfatedemi-, it looks like you are macos professional could i ask you some tech questions i'm interested in?
14:09:50*bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
14:12:13demi-lol, i can try
14:18:01cheatfatedemi-, most interesting question is how macos ui event loop is implemented internally, is it possible somehow to catch ui events with `kqueue`?
14:20:09*gokr joined #nim
14:20:24demi-https://opensource.apple.com/source/CF/CF-855.17/CFRunLoop.c <- this is how the native UI event loops are done, we have thread 0 (main thread) dedicated to UI work specifically. All other work gets done on separate threads and calls to update the UI by redrawing the display are dispatched to this main ththread that has this runloop.
14:20:56demi-this is to always have a responsive UI, regardless of any amount of processing or work the system might be involved in.
14:21:29*gokr quit (Read error: Connection reset by peer)
14:26:03cheatfatedemi-, it looks like all this threads are communicating with main thread using machport or machports
14:26:07cheatfateam i right?
14:26:14demi-yeah
14:28:22cheatfatemacos' kqueue supports mach ports, so somehow i can catch this events with kqueue
14:28:36cheatfateso question number 2 is there any ways to get this machport from thread?
14:29:37cheatfatemaybe some `hack` ways? :)
14:29:42*michael_campbell joined #nim
14:30:06demi-are you talking about a process you start up and own?
14:30:30cheatfateyep
14:32:28demi-these two pages will probably be helpful for you: http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/ https://developer.apple.com/library/content/documentation/Darwin/Conceptual/KernelProgramming/Mach/Mach.html
14:33:43demi-this is an aspect that apple doesn't directly document (at all) so here be dragons even though it is how it is officially/formally done.
14:34:46cheatfatethanks for help
14:36:03demi-no problem!
14:38:05*yglukhov quit (Remote host closed the connection)
14:38:40*yglukhov joined #nim
14:40:49*gokr joined #nim
14:43:06*yglukhov quit (Ping timeout: 240 seconds)
14:49:35*arnetheduck quit (Ping timeout: 264 seconds)
14:59:25*yglukhov joined #nim
15:08:08*yglukhov quit (Remote host closed the connection)
15:13:08*yglukhov joined #nim
15:32:06*filcuc quit (Ping timeout: 240 seconds)
15:34:54demi-ok my earlier question about `proc`s becoming inlined is starting to bother me more -- i don't know how nim defines scoping and when variables will be shadowed due to scope when using sequtils.filter/map/apply.
15:50:06*Guest89004 quit (Ping timeout: 240 seconds)
15:52:56*devted quit (Read error: Connection reset by peer)
16:00:07cheatfatedemi-, actually map/filter/apply is declared as {.inline.} its why it inlined
16:01:36*yglukhov quit (Remote host closed the connection)
16:02:33*PMunch quit (Quit: leaving)
16:03:09cheatfateor you talking about your `proc` passed to map/filter/apply?
16:07:22*yglukhov joined #nim
16:16:58*nsf quit (Quit: WeeChat 1.7)
16:18:13*pregressive joined #nim
16:22:20*pregressive quit (Client Quit)
16:22:48*Trustable joined #nim
16:26:50*rupil quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
16:27:47Araqchemist69: http://nim-lang.org/download/libui.dll sorry for the delay
16:27:51Araqthat's the 32bit version
16:27:56Araqworks for me
16:40:05gangstacatcould not load: libui.dll (installed in both the folder with the controlgallery exe and in system32) -d:nimDebugDlOpen doesn't give anything
16:40:41*hendi_ quit (Quit: hendi_)
16:44:42Araqhmmm
16:45:16Araqlet me build a non-debug DLL then
16:46:02cheatfateAraq, for some reason libui.dll you placed has dependency on uxtheme.dll
16:46:35Araqwhat's that? windows 10 specific?
16:49:19*brson joined #nim
16:50:02cheatfatei dont know but looks like it uses too much dlls
16:53:53Araqyay and ofc cmake -DCMAKE_BUILD_TYPE=Release .. does not work
16:54:17Araqnot too mention that's like the most obscure command to produce a release build ... why do people use cmake?
16:54:50krux02because the alternatives are even worse?
16:54:54GaveUp^
16:55:26krux02autotools, scons, qmake, ...
16:55:26cheatfatelooks like cmake is not better then make :)
16:55:39krux02cmake is even more verbose that make
16:56:45krux02I think instead of cmake, they should just have made a facade for the visual studio compiler, to understand gcc/clang/intel compiler option syntax
16:56:55krux02then just make everywhere
16:57:30Araqthe idea to produce makefiles is already bonkers
16:57:49Araqthe make "algorithm" is like 100 lines of code.
16:57:53krux02fun fact, my most stared project on github is https://github.com/krux02/minimal_cmake_example
16:58:13AraqI have implemented it twice.
16:58:28krux02yes exactly what I think, too
16:58:43krux02and it is super indirect
16:59:24krux02I write procedural code, that writes configurations for build targets that then get compiled to make files that then should compile the project
16:59:26krux02yay
16:59:56krux02why not just code that compiles my files?
17:00:03krux02that would be too complicated
17:02:20cheatfatei think somebody must just write smartMake program which just follow #include headers will compile everything without any specific instructions
17:03:00krux02no, someone should replace c++ with a language, that just compiles
17:03:17cheatfatec++ already replaced many times...
17:03:34cheatfatei'm looking for smartMake for C
17:03:56krux02forget it
17:04:01krux02C is not a smart language
17:04:40cheatfatei dont need smart language
17:04:43cheatfatei need to be smart
17:04:49cheatfatenot language
17:06:02AraqI'm trying to build it directly now via .compile pragmas
17:06:23krux02in C you can always recompile everything
17:06:26AraqNim is often better at building C/C++ code than "tools" that claim to do that
17:06:52krux02don't make yourself dependent on environment variables (I hate those people who make me depend on them)
17:07:07Araqha me too.
17:07:15krux02and only introduce modules, when you really need to split the build to be more incremental
17:07:24gangstacatAraq, is nim c controlgallery.nim enough to use your provided dll on Windows?
17:07:43Araqgangstacat: yes but just wait
17:07:54AraqI'm trying to directly embed the C code
17:08:03gangstacatyes no worry, just wondered of there was a switch to add or something
17:08:08gangstacatif*
17:10:18*yglukhov quit (Remote host closed the connection)
17:10:27cheatfateAraq, if i have test: tioselectors.nim and i want to run 2 tests with it like `nim c --threads:on -d:threadsafe tioselectors` and `nim c tioselectors` is it possible?
17:11:00*yglukhov joined #nim
17:11:25Araqcheatfate: yes but you need to touch categories.nim for that
17:11:40cheatfateAraq, omg again
17:11:53cheatfateIs it possible to make via .nims file or .cfg?
17:11:59Araqbbl
17:14:56*yglukhov quit (Remote host closed the connection)
17:15:10*yglukhov joined #nim
17:16:20*yglukhov quit (Remote host closed the connection)
17:25:17*Andris_zbx quit (Remote host closed the connection)
17:31:27demi-cheatfate: I mean my regular `proc`s are being inlined based on the code in the generated binary
17:32:30cheatfatedemi-, i think it was inlined because you are used not `proc` but `iterator`, but i'm mostly low-level guy, so you need to ask Araq about this
17:32:50demi-ok i should make an example for this
17:40:11demi-oh, hmmm, i think i am mistaken and misread the asm; i guess i don't have a problem after all.
17:40:13*askatasuna joined #nim
17:42:36*vlad1777d quit (Remote host closed the connection)
17:44:49*vlad1777d joined #nim
17:51:01demi-if i'm building a nim executable binary by transpiling to C, then compiling that using clang -- should i be able to use clang's tooling to perform additional validation such as ASAN or TSAN or the static analyzer to track down additional issues with my code, or would that more likely turn up false results due to nim's implementation?
17:51:03*hcorion joined #nim
18:01:06*nsf joined #nim
18:02:03cheatfatedemi-, sometimes we have memory troubles too, so i think it will be interesting, but compiler must be modified to implement such step
18:02:26demi-ah, ok
18:03:41*yglukhov joined #nim
18:04:35enthus1ast|traveVarriount, that sublime bug is still in there its popping up randomly, no clear way to reproduce it so far..
18:08:11*yglukhov quit (Ping timeout: 240 seconds)
18:09:55Araqdemi-: the static analyser will likely only produce garbage
18:10:07demi-:(
18:10:12Araqsince it doesn't know there is a GC involved etc
18:10:21chemist69I don't know, but my Win apps don't work anymore with the new libui.dll. They immediately quit without any error messages and are not showing any GUI.
18:10:36Araqchemist69: yes, working on it
18:10:37chemist69The Linux versions run fine.
18:10:48chemist69Ah, ok. Thanks a ton!!!
18:30:57krux02Varriount: I think I can write you, but I don't get your answer in irc
18:31:11krux02it is one way only
18:31:47krux02unless there is some logic that detects that I have both open, and then does what it currently does, but I doubt that
18:33:02krux02Varriount @Varriount 19:18
18:33:02krux02enthus1ast: I might be able to give you a modified version of the core ST plugin module that can at least print stack traces to the console.
18:33:02krux02enthus1ast: What version of ST are you using?
18:33:02krux02Varriount @Varriount 19:26
18:33:02krux02enthus1ast|trave: Could you go into C:\Program Files\Sublime Text\ and find the sublime.py and sublime_plugin.py modules, and gist their contents? I can modify them to show stack traces when used, and that should at least show when certain functions are called.
18:35:59*libman2 joined #nim
18:36:17*libman quit (Ping timeout: 240 seconds)
18:39:16*enthus1ast|trave quit (Ping timeout: 258 seconds)
18:41:34*enthus1ast joined #nim
18:49:47*libman2 quit (Ping timeout: 240 seconds)
18:53:03*stisa joined #nim
19:02:05*rokups quit (Quit: Connection closed for inactivity)
19:06:44stisaI think the mailing list mirroring has been broken since beginning of January, eg: http://www.freelists.org/post/nim-dev/Nim-threads-vs-Pthreads , where should I report it?
19:07:31krux02stisa: that, too?
19:08:54stisakrux02 sorry?
19:09:30*yglukhov joined #nim
19:09:42krux02it's just that I just wrote about that the gitter irc bridge doesn't work anymore
19:09:46krux02yes report it
19:10:04krux02maybe in the issue tracker on github
19:11:01stisaI guess it should go in nimforum issues?
19:11:19AraqI still get the nimforum emails
19:11:27Araqworks for me (tm)
19:12:25krux02I made an issue for the nimbot
19:13:22AraqBlaXpirit created the gitter bridge for us, iirc
19:13:37cheatfateAraq, Nim Manual can't be edited?
19:13:58cheatfatei dont see `edit` button here
19:14:03krux02yes that with the nim manual is also something I noticed
19:14:22Araqyeah well. I don't know where to put the "edit" button
19:14:24krux02there were times I was missing that feature, where I just wanted to an some little information
19:14:53Araqthe edit feature for all the other docs is not exactly used that much -.-
19:15:11cheatfate;
19:15:52krux02The entire language is not used that much, but that never stopped you from making it
19:16:14Araqlol yes
19:16:43Araqbut I could have fixed a bug instead in this time
19:17:15krux02I think the edit button is a valuable feature that will pay off, when there are more people.
19:17:38krux02It's like wikipedia
19:17:44krux02people like to share knowledge
19:18:03krux02when the entrace barrier is low, it will help
19:21:46krux02I remember that I once wanted to clarify that `object` is like a `struct` type because I got that wrong the first time I read the manual
19:22:17krux02then I went to the manual and wanted to edit, I didn't find the edit button and then the edit just didn't happen
19:25:54Araqso patch the docgen
19:27:03*adeohluwa joined #nim
19:37:38*dv- joined #nim
19:37:56euantorIs there are guarantee as to whether code after a `yield` in an iterator will be ran?
19:38:23Araqyeah well, it's a "return and continue afterwards"
19:38:24euantorEG: If the called does something with a yielded value and produces an exception, will code after the `yield` that does cleanup definitely be ran?
19:38:46Araqthat's why we have 'finally'
19:39:31euantorAnd finally will work inside an iterator context?
19:39:59euantorThe use case is: https://github.com/euantorano/serialport.nim/blob/master/private/list_serialports_win.nim#L66
19:40:20euantorI want to make sure that `SetupDiDestroyDeviceInfoList` will be ran. I'll try using try/finally
19:41:43*FromGitter quit (Ping timeout: 256 seconds)
19:41:56euantorYep, that works. Thanks!
19:42:01Araqoh what is wrong with this world
19:42:17AraqI cannot download a recent mingw anymore
19:42:22euantorI was wondering if the codegen maybe did that on its own, but wasn't sure
19:58:46*zetashift joined #nim
20:00:15*byte512 quit (Ping timeout: 260 seconds)
20:01:26*adeohluwa_ joined #nim
20:03:36*adeohluwa quit (Ping timeout: 245 seconds)
20:07:14*bjz joined #nim
20:15:21*stisa2 joined #nim
20:16:35*stisa quit (Ping timeout: 255 seconds)
20:23:29*yglukhov quit (Read error: Connection reset by peer)
20:24:03*yglukhov joined #nim
20:46:19*couven92 quit (Quit: Client disconnecting)
21:04:23federico3is xomachine around?
21:14:29*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:24:59*stisa2 quit (Ping timeout: 264 seconds)
21:25:21*adeohluwa_ quit (Remote host closed the connection)
21:28:11BlaXpiritkrux02, Araq, hm gitter.im does not respond at all from both my location and my server's location. can't do anything with the bridge
21:28:37Araqdo you think it's a temporary problem?
21:30:06zetashiftgitter.im does not work for me either
21:35:13*stisa joined #nim
21:41:31*stisa quit (Ping timeout: 245 seconds)
21:41:36BlaXpiritwell hopefully gitter being down is a temporary problem.....
21:41:54zetashifthttps://twitter.com/gitchat
21:42:02zetashiftseems temporarily
21:43:05*stisa joined #nim
21:56:36*stisa quit (Ping timeout: 256 seconds)
21:57:05*zetashift quit (Quit: Leaving)
21:57:28dom96This is why IRC rules :P
21:58:08GaveUpwhere else can you have idling competitions?
21:58:47*Matthias247 joined #nim
21:59:28*kulelu88 joined #nim
22:00:34dom96GaveUp: Exactly!
22:00:41*chemist69 quit (Ping timeout: 245 seconds)
22:03:22*stisa joined #nim
22:03:40*stisa2 joined #nim
22:05:38*Vladar quit (Quit: Leaving)
22:06:19*jjido joined #nim
22:07:33*stisa quit (Ping timeout: 252 seconds)
22:15:23*stisa2 quit (Ping timeout: 264 seconds)
22:17:54*stisa joined #nim
22:27:57*chemist69 joined #nim
22:39:22*Trustable quit (Remote host closed the connection)
22:41:36*Kingsquee joined #nim
22:46:39*nsf quit (Quit: WeeChat 1.7)
22:47:36*yglukhov quit (Remote host closed the connection)
22:48:30*couven92 joined #nim
23:08:11*jjido quit (Ping timeout: 264 seconds)
23:37:36nivdom96: can i bother you for a sec? im having a nimble noob issue
23:38:19nivwhat do i need to do to make nimble packages with native C files added via {.compile: } work?
23:38:37nivwhen pulled in locally/directly with import, it works, but if installed as a nimble package it fails
23:48:08*yglukhov joined #nim
23:49:24krux02niv: that's not a trivial question. It is best when you provide example code in some form
23:52:11*yglukhov quit (Ping timeout: 240 seconds)