00:04:09 | * | martinium quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
00:07:45 | * | MJCaley joined #nim |
00:28:15 | * | Yardanico[Phone] quit (Quit: Quit) |
00:54:38 | * | xet7 quit (Quit: Leaving) |
01:02:11 | FromGitter | <data-man> https://github.com/leo-yuriev/libmdbx a big updates. Now supports dynamic DB size for Windows too. |
01:04:10 | * | marenz__ quit (Ping timeout: 265 seconds) |
01:12:27 | FromGitter | <RedBeard0531> Neat! I actually had a mostly working version of mongodb on top of lmdb before we decided to go with wired tiger. It had the right set of tradeoffs for us, but I still have a soft spot for lmdb |
01:17:45 | FromGitter | <RedBeard0531> @data-man are you working on mdbx? |
01:18:14 | shashlick | @data-man: what's your plan for scitenim? |
01:20:55 | FromGitter | <data-man> @RedBeard0531: Sometimes ⏎ @shashlick: I updated libs (Scintilla, Lua, SciTE) & renamed Nimrod -> Nim. I planned to add the nimsuggest support. |
01:25:14 | FromGitter | <data-man> @RedBeard0531: Sorry, not "on" and "with". :-) |
01:30:12 | FromGitter | <RedBeard0531> @data-man looks like they didn't fix my biggest annoyance. The custom compare functions really should take a user-supplied void* user data pointer: https://github.com/leo-yuriev/libmdbx/blob/master/mdbx.h#L258-L259 |
01:32:55 | FromGitter | <data-man> @RedBeard0531: Are you using Windows? |
01:34:16 | FromGitter | <RedBeard0531> At the moment, yes. But I do all dev work on linux, either directly or via ssh. |
01:34:46 | FromGitter | <data-man> Try https://github.com/pmwkaa/sophia |
01:35:47 | FromGitter | <RedBeard0531> Given that we acquired WT and merged our dev teams I don't see us switching again any time soon :) |
01:37:04 | FromGitter | <data-man> Sophia not supports Windows :-( |
01:42:05 | * | Serenit0r joined #nim |
01:42:05 | FromGitter | <data-man> But there's fork for previous version with a dirty Windows support. https://github.com/stanhuff/Sophia |
01:42:08 | * | wurui__ joined #nim |
01:45:59 | * | Serenitor quit (Ping timeout: 276 seconds) |
01:53:17 | FromGitter | <Varriount> @RedBeard0531 WT? |
01:54:23 | FromGitter | <RedBeard0531> @Varriount http://www.wiredtiger.com/ |
01:55:56 | FromGitter | <Varriount> Hrm, I'm not a big fan of Mongodb. |
01:56:19 | FromGitter | <Varriount> I was really turned off by the lack of debugging support when executing Javascript. |
02:01:07 | FromGitter | <RedBeard0531> There's always print() :) But seriously, server-side JS is a major PITA for us and we wish everyone would use the newer alternatives that we provide whereever possible. |
02:01:25 | FromGitter | <ervinbosenbacher> > https://github.com/leo-yuriev/libmdbx a big updates. Now supports dynamic DB size for Windows too. That is really really nice. I nearly forgot this one. |
02:01:42 | FromGitter | <ervinbosenbacher> I used to be a heavy user for various purposes |
02:07:44 | * | S1tiSchu joined #nim |
02:11:01 | FromGitter | <Varriount> @RedBeard0531 You can? That never seemed to work for me, at least, not when I ran scripts. |
02:11:45 | * | SitiSchu quit (Ping timeout: 264 seconds) |
02:15:25 | FromGitter | <RedBeard0531> Yup, although printjson() is generally more useful since it does something better than Object.toString()'s "[object Object]" useless output. In the shell it prints to stdout, in the server it prints to the log. |
02:21:48 | * | MJCaley quit (Quit: MJCaley) |
02:27:50 | FromGitter | <Varriount> Printing to a log? :/ |
02:34:40 | FromGitter | <RedBeard0531> Where else would it go? It is intended for development purposes and the log defaults to stdout when you run the server in a shell. It is probably best to move to DM since this is fairly off topic for #nim |
02:36:32 | * | rupil quit (Quit: Connection closed for inactivity) |
02:50:23 | FromGitter | <data-man> Wow! Just now found it: https://github.com/pustladi/Windows-2000 :-) |
02:53:54 | * | dandevelo quit (Remote host closed the connection) |
03:01:06 | * | chemist69 quit (Ping timeout: 246 seconds) |
03:15:33 | * | chemist69 joined #nim |
03:43:19 | * | SitiSchu joined #nim |
03:44:53 | * | S1tiSchu quit (Ping timeout: 268 seconds) |
03:45:25 | * | martinium joined #nim |
03:50:47 | * | vlad1777d quit (Ping timeout: 276 seconds) |
04:38:13 | * | martinium quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
04:46:33 | * | martinium joined #nim |
04:48:45 | * | arecaceae quit (Remote host closed the connection) |
04:49:32 | * | arecaceae joined #nim |
04:54:18 | FromGitter | <data-man> Hmm https://github.com/georgiy-pruss/NimMirror |
05:00:25 | * | Serenit0r quit (Quit: Leaving) |
05:05:53 | * | martinium quit (Quit: Textual IRC Client: www.textualapp.com) |
05:06:59 | * | wurui__ quit (Remote host closed the connection) |
05:08:28 | * | darithorn quit (Quit: Leaving) |
05:40:01 | * | yglukhov joined #nim |
05:44:31 | * | yglukhov quit (Ping timeout: 248 seconds) |
05:50:17 | * | ludocode joined #nim |
05:53:23 | * | ludocode quit (Remote host closed the connection) |
05:53:37 | * | ludocode joined #nim |
05:56:01 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
05:56:23 | * | ludocode quit (Client Quit) |
05:58:22 | * | ludocode joined #nim |
06:04:13 | * | onionhammer1 joined #nim |
06:04:37 | * | sz0 quit (Quit: Connection closed for inactivity) |
06:05:54 | * | onionhammer quit (Ping timeout: 272 seconds) |
06:09:47 | * | onionhammer1 quit (Read error: Connection reset by peer) |
06:10:48 | * | onionhammer1 joined #nim |
06:28:05 | * | onionhammer1 quit (Ping timeout: 240 seconds) |
06:31:53 | * | onionhammer1 joined #nim |
06:38:48 | * | nsf joined #nim |
06:47:00 | * | wurui joined #nim |
06:53:04 | * | wurui quit (Read error: Connection reset by peer) |
07:00:06 | FromGitter | <alehander42> @Yardanico typically you should be able to directly run the test file (if you can also run it succesfully with <python> <testfile> <args>) ⏎ do you have this python code somewhere in public ? |
07:36:39 | FromGitter | <Yardanico> Yes it's open source, I will post it later today |
07:36:43 | FromGitter | <Yardanico> @alehander42 |
07:38:34 | * | PMunch joined #nim |
07:38:48 | FromGitter | <Yardanico> Also - what will happen if a field in a class can be of 3 different types? What will py2nim do? |
07:49:17 | * | heinrich5991 quit (Quit: quit.) |
07:54:36 | * | miran joined #nim |
07:58:16 | FromGitter | <alehander42> thanks, that would be very helpful |
08:00:11 | FromGitter | <alehander42> it depends, the design goal is to generalize it to a generic object type or to generate a variant |
08:01:51 | * | heinrich5991 joined #nim |
08:24:30 | * | Vladar joined #nim |
08:24:52 | * | claudiuinberlin joined #nim |
08:35:32 | * | endragor joined #nim |
08:39:26 | PMunch | dom96, just got plane tickets to go to FOSDEM :) |
08:40:46 | PMunch | Now I just need to find a cheap hostel to stay in |
08:46:59 | * | floppydh joined #nim |
08:47:01 | * | sendell joined #nim |
09:03:27 | * | gmpreussner quit (Ping timeout: 248 seconds) |
09:05:22 | * | gmpreussner joined #nim |
09:16:11 | * | zahary joined #nim |
09:24:56 | * | wurui joined #nim |
09:42:06 | * | wurui quit (Remote host closed the connection) |
09:45:29 | * | wurui joined #nim |
09:50:45 | * | wurui quit (Remote host closed the connection) |
10:14:01 | * | vlad1777d joined #nim |
10:14:52 | * | yglukhov joined #nim |
10:15:06 | * | Yardanico joined #nim |
10:15:24 | Yardanico | @alehander42 , are you around? |
10:17:59 | * | craigger quit (Ping timeout: 255 seconds) |
10:18:53 | * | craigger joined #nim |
10:26:34 | Yardanico | @alehander42 - don't take this example seriously (as I would anyway do a manual translation for now), but here's the file needed for test and python file itself: https://gist.github.com/Yardanico/e42fc343cbc3884871229aee376e51f3 |
10:26:49 | Yardanico | no external deps required, this pyttanko is on github (not mine project) |
10:32:02 | Yardanico | I just want to somehow try to compete in terms of performance and/or code readability with https://github.com/Francesco149/oppai-ng :0 |
10:32:11 | Yardanico | but this C code is harder for me to understand than python |
10:46:24 | FromGitter | <ChristianWitts> that post just broke my gitter |
10:46:41 | FromGitter | <ChristianWitts> the gist just got inlined :D |
10:47:23 | Yardanico | well this file format is config-like |
10:47:46 | Yardanico | (it's a beatmap from game and basically this script calculates how much points you'll get if you complete it) |
10:48:40 | * | gokr joined #nim |
10:49:12 | gokr | dom96: Here? |
10:50:02 | gokr | Or anyone really... I have a jester application and I want to pause during one call. I thought I could do "acyncCheck sleepAsync(2000)". |
10:50:07 | livcd | anyone wants to start short screencasts similar to rubytapas / justforfunc ? :D |
10:50:59 | Yardanico | livcd, can you give a link to rubytapas/justforfunc? |
10:51:57 | livcd | https://www.youtube.com/watch?time_continue=361&v=t9bEg2A4jsw |
10:52:04 | livcd | i am watching / listening to this one atm. |
10:53:27 | * | onionhammer joined #nim |
10:54:56 | * | onionhammer1 quit (Ping timeout: 248 seconds) |
10:58:11 | FromGitter | <allochi_twitter> I watch justforfunc too, actually I was thinking of doing something like it once I get more familiar with the language and finish couple of projects. |
10:58:47 | FromGitter | <allochi_twitter> strange, the same guy made me check nimlang again |
10:59:16 | Yardanico | who ? :) |
10:59:53 | FromGitter | <allochi_twitter> Francesc |
10:59:54 | Araq | gokr: yes, doesn't work? |
11:00:06 | FromGitter | <allochi_twitter> the justforfunc guy :) |
11:00:42 | Yardanico | gokr, asyncCheck will actually call sleepAsync as a different future |
11:00:49 | Yardanico | so your async proc wouldn't block |
11:00:58 | Yardanico | try "await sleepAsync(2000)" |
11:01:26 | livcd | Yardanico: obivously he is doing it as his job as he is paid by google but a volunteer could make some content pay to get. |
11:01:53 | FromGitter | <allochi_twitter> Indirectly though, he has couple of talks in dotgo how Go didn’t do well with functional progemmaing and Machine Learning. |
11:03:10 | livcd | Yardanico: now that i think of it rubytapas subscription is kind expensive |
11:03:13 | dom96 | PMunch: Yay, awesome |
11:03:13 | livcd | 18$/month |
11:10:44 | PMunch | I found one dirth cheap hostel close to the venue, but it had pretty horrible reviews :P |
11:36:18 | gokr | Yardanico: Hmmm. I tried that first, but... let me check |
11:39:29 | Yardanico | well, if jester awaits for your routes to complete - this would block your entire server |
11:40:36 | dom96 | no, it wouldn't. |
11:40:55 | dom96 | 'await' pauses the current async proc |
11:41:06 | dom96 | Not your application |
11:41:26 | gokr | dom96: I can't compile this. |
11:41:37 | gokr | await asyncSleep(2000) - right? |
11:41:42 | dom96 | sleepAsync |
11:41:59 | gokr | Yes, sorry - I can't compile it |
11:42:15 | gokr | await wants a FlowVar, sleepAsync gives a Future |
11:42:29 | dom96 | So you're not inside an async proc |
11:42:45 | gokr | right, so... I tried adding that ... let me try again |
11:42:48 | dom96 | and spawn shouldn't steal my keywords :P |
11:43:09 | Araq | oh yeah sorry about that, will fix it |
11:43:34 | dom96 | Araq: yay, thanks |
11:43:47 | dom96 | do we have interoperability between FlowVar's and Futures yet? |
11:44:21 | gokr | Right.. so async procs can't return something - right? God I feel daft |
11:44:40 | dom96 | they can |
11:44:57 | dom96 | proc foo(): Future[ReturnType] |
11:45:12 | gokr | duh |
11:45:27 | dom96 | Reading chapter 3 of my book would help you out here, but I can understand if you don't have the time/money :) |
11:45:53 | Araq | dom96: we don't because I forgot how this should work |
11:46:03 | dom96 | I'm going to try and make a website for Jester with some nice examples I hope. |
11:46:17 | Araq | a bit annoying I had a good idea of what needs to be done |
11:46:24 | Araq | and lost it. |
11:46:26 | dom96 | Araq: D: |
11:46:43 | dom96 | Next time write a quick issue to remind yourself :) |
11:46:48 | Araq | hey, usually that never happens :P |
11:47:20 | dom96 | But here is what I have in my head: proc getFuture(x: FlowVar[T]): Future[T] (or some other name) |
11:47:24 | gokr | phew. Ok, so... that bubbled into a bunch of Future[yadda] {.async.} and a sprinkle of awaits - but now it compiled. |
11:47:34 | gokr | Just to get my damn pause ;) |
11:47:42 | Araq | we can figure it out together |
11:47:54 | dom96 | gokr: yeah, but if you weren't using async procs your code wasn't really async |
11:47:55 | Araq | gokr: os.sleep() not good enough in a threaded context? |
11:47:58 | * | crem quit (Ping timeout: 265 seconds) |
11:48:16 | gokr | For anyone curious - this is a little server side thingy for https://getcanoe.io |
11:48:26 | gokr | dom96: True indeed. |
11:48:36 | * | sendell quit (Remote host closed the connection) |
11:48:38 | gokr | I am a n00b for the Nim async stuff |
11:48:57 | Zevv | that's what brought me to nim, the async stuff :) |
11:49:04 | dom96 | gokr: awesome. Might be worth adding that to here https://github.com/nim-lang/Nim/wiki/Companies-using-Nim :) |
11:49:13 | dom96 | Zevv: :D |
11:49:14 | gokr | Not a company. ;) |
11:49:14 | Araq | dom96: no, FlowVar can inherit from Future |
11:49:24 | dom96 | Araq: oh yeah, now I remember |
11:49:29 | * | crem joined #nim |
11:50:07 | Araq | and in the callback ... I ... what do I have to do in the callback? |
11:50:38 | Yardanico | dom96, if you use waitFor mymainproc() and in mymainproc you use await to other async procs - they will be able to block the entire application. Good that jester doesn't do that |
11:50:42 | dom96 | Araq: complete the future |
11:50:47 | dom96 | Araq: I think? |
11:50:59 | dom96 | Araq: If you do come up with an implementation, make a PR so I can review it :) |
11:51:21 | * | vlad1777d quit (Ping timeout: 264 seconds) |
11:51:39 | Araq | outline a test case please |
11:51:59 | Araq | otherwise it's like shooting at fog |
11:52:15 | dom96 | Yardanico: not necessarily, any of the async procs you 'await' in mymainproc could be calling another async proc without awaiting it |
11:52:46 | dom96 | Araq: https://github.com/dom96/nim-in-action-code/blob/master/Chapter3/ChatApp/src/client.nim#L42 |
11:52:58 | dom96 | Make it so I can 'await messageFlowVar' |
11:53:12 | Yardanico | dom96, well yes, I'm just about the case when you use await in other async procs |
11:54:02 | dom96 | Yardanico: okay, but you shouldn't be thinking about it this way. |
11:59:06 | Araq | while true: |
11:59:06 | Araq | let inp = await messageFlowVar |
11:59:06 | Araq | asyncCheck socket.send(createMessage(username, inp)) |
11:59:08 | Araq | messageFlowVar = spawn stdin.readLine() |
11:59:10 | Araq | asyncdispatch.poll() |
11:59:12 | Araq | this way? |
11:59:36 | Araq | doesn't seem to be right |
11:59:46 | Araq | it blocks your poll() loop |
12:04:52 | dom96 | oh yeah, you're right |
12:04:58 | * | S1tiSchu joined #nim |
12:05:15 | dom96 | if messageFlowVar.finished: let inp = messageFlowVar.read() |
12:05:22 | dom96 | for this use case |
12:05:27 | dom96 | but 'await' should be possible too |
12:05:53 | dom96 | so in fact, you can do: messageFlowVar.callback = proc () = ... |
12:06:00 | dom96 | that's a better way to implement this |
12:06:13 | dom96 | instead of checking 'finished' every time |
12:06:23 | * | SitiSchu quit (Ping timeout: 248 seconds) |
12:06:30 | dom96 | and 'await' is implemented in terms of 'callback' anyway, so implement this and it will just work (TM) |
12:06:42 | Araq | yeah hmmm |
12:07:02 | Araq | so I don't have to set callback in FlowvarBase, I need to call it once the data arrived |
12:07:03 | miran | speaking of `finished` - Araq, dom96 said i should show this to you: https://forum.nim-lang.org/t/3465 |
12:08:56 | Araq | oh yeah well |
12:09:10 | Araq | I agree but I'm not sure how to fix it. |
12:09:38 | Araq | closure iterators are my worst design. |
12:09:45 | miran | :) |
12:10:09 | Araq | and now all of async depends on it... |
12:10:16 | Araq | :D |
12:10:39 | Araq | that said, I had good intentions and the design makes some sense |
12:10:51 | Araq | when looked at from the right angle |
12:10:52 | Yardanico | is it possible to implement async without iterators ? :) |
12:10:59 | Yardanico | in python they're implemented using iterators too |
12:11:35 | miran | i know you don't like python, but maybe you could take some inspiration from python's `iterator.__next__()`? https://docs.python.org/3/library/stdtypes.html#iterator.__next__ |
12:12:07 | Araq | Yardanico: via .liftLocals and gotoState, all undocumented |
12:12:58 | dom96 | The async dependency on closure iterators is very well hidden |
12:13:08 | dom96 | so do please fix it :) |
12:13:12 | dom96 | we can fix async easily |
12:13:37 | Araq | miran: lol I looked at that and thought "well it's an iterator, so I can call it. what does it mean to call it? to do the next() step obviously" |
12:13:59 | dom96 | The next step should be done via next() |
12:14:19 | dom96 | it would also be nice to have an explicit newIterator() function |
12:14:36 | Araq | so an iterator is nothing I can call? |
12:14:48 | Araq | I can only create an iteration object from it? |
12:14:52 | dom96 | var myIter = newIterator(myIter); myIter.next() |
12:15:04 | dom96 | It's nice to have this encapsulation |
12:15:10 | Araq | so an iterator is just a blueprint |
12:15:27 | miran | this `var c = mycount # instantiate the iterator` (from the manual) just feels wrong |
12:15:31 | Araq | hmmm |
12:15:47 | Araq | miran: well it's overly clever :P |
12:15:55 | dom96 | yeah, it sucks :P |
12:16:04 | dom96 | I never remember if I should give it a () or not |
12:16:15 | Araq | you MUST not give it a () :P |
12:16:31 | dom96 | so bad things happen if I do? |
12:16:36 | Araq | yep |
12:16:38 | miran | error |
12:16:40 | dom96 | lol |
12:17:08 | dom96 | anyway, this sounds like an issue should be made for this |
12:17:12 | dom96 | please do so miran |
12:17:16 | miran | will do |
12:17:26 | Araq | it's another RFC, but ok |
12:17:36 | miran | improved iterator would be a huge plus!! |
12:17:38 | Araq | I wonder if it can work |
12:18:07 | Araq | you can pass iterators around as first class objects |
12:18:13 | miran | the way they are now, i'll probably just try to avoid them as much as possible. and i'm sad because of that |
12:18:18 | Yardanico | maybe we'll be able to use try/except in async if it would be implemented without iterators? :) |
12:18:40 | Araq | Yardanico: I doubt it, for now all I see is a proposal for a better syntax |
12:21:03 | Araq | so what does 'iter' do? what is it if not its closure creation? |
12:21:22 | Araq | newIterator(iter) # ok I guess |
12:22:21 | Araq | proc foo(it: iterator()) = newIterator(it) # ? |
12:22:52 | Araq | this is problemantic as it's a polymorphic object construction |
12:23:52 | Araq | looks hard to implement and once it works, it'll be slower -.- |
12:25:17 | Araq | it's also not consistent with .closure procs |
12:26:10 | miran | how much slower are we talking about? |
12:28:42 | miran | will we have iterator {.inline.}, {.closure.}, {.nice_syntax.}? :D |
12:30:26 | Araq | miran: not sure, another indirect call but I don't even know if it can work |
12:30:46 | Araq | a closure iterator can capture stuff from its environment |
12:31:09 | Araq | so you better create this closure when you return it as a first class citizen |
12:32:40 | Araq | but if we ignore the newIterator() syntax, we can make next(f) an alias for f() |
12:33:03 | Araq | seems a dubious benefit though. |
12:33:20 | dom96 | see how other languages do it? :P |
12:33:25 | miran | if it is just an alias i think it won't work as it should |
12:33:43 | miran | syntax-wise |
12:34:35 | miran | dom96: re: checking other languages - yes please! |
12:35:15 | miran | i'm writing an issue on github, will post the link once i finish |
12:37:36 | dom96 | So do we want to apply for GSOC or should we not bother? |
12:46:01 | * | gokr quit (Ping timeout: 252 seconds) |
12:49:34 | * | Snircle joined #nim |
12:53:49 | * | xet7 joined #nim |
12:54:23 | FromGitter | <mratsim> Oh, there is a new iterator syntax? |
12:54:36 | miran | dom96: it would be nice, don't know how much work there is and if it is doable in given amount of time |
12:54:54 | FromGitter | <mratsim> Would love to have an “init” “next” syntax standard like in Rust or Python (I’m already doing this using templates in Arraymancer) |
12:55:01 | miran | mratsim: unfortunately, no(t yet) |
12:55:11 | miran | but i just opened an issue: https://github.com/nim-lang/Nim/issues/7047 |
12:56:01 | miran | mratsim: maybe you can post a reply to show us how are you doing it now, it might help |
12:57:22 | FromGitter | <mratsim> my use case is inline iterators only though: https://github.com/mratsim/Arraymancer/blob/fc4ad528f6afcd377c16ff99f19151a0f5e46f89/src/tensor/private/p_accessors.nim#L98-L125 |
12:58:07 | FromGitter | <mratsim> and then used like that: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a54bc5f290a1f45616954ca] |
13:00:54 | FromGitter | <mratsim> I’ll try to clean that up before posting because my case is quite complicated (have to iterate on seq that may have holes, or with data stored in column major order or completely arbitrary order, or that need iteration in reverse) |
13:08:39 | livcd | do I need to do something in vs code for channels stuff ? I have this in vscode https://glot.io/snippets/ex78ll0akw and i get undeclared identifier Channel |
13:08:48 | FromGitter | <mratsim> If people say: do imports like python is doing: http://python-notes.curiousefficiency.org/en/latest/python_concepts/import_traps.html |
13:09:13 | FromGitter | <mratsim> @livcd did you compile with threads:on ? |
13:12:00 | Yardanico | livcd, create nim.cfg in project folder |
13:12:05 | Yardanico | and add --threads:on in it |
13:12:28 | Yardanico | vscode uses `nim check` for checking nim code for errors, and `nim check` is similar to nim compiler |
13:12:43 | Yardanico | when threads is not on there's no Channel type |
13:12:52 | FromGitter | <alehander42> what is the idiomatic way to convert a char array to cstring? |
13:13:29 | euantor | I wonder if there's a plan to eventually make `threads:on` the default, and make them opt-out rather than opt-in? |
13:14:02 | Yardanico | euantor, not every program needs threads |
13:14:26 | euantor | If you're not using them, there shouldn't be any downside/drawbacks to them being enabled though surely? |
13:15:03 | euantor | Other languages like Rust and such have thread support on by default without requiring a command line option that people seem to always have to be reminded about |
13:15:27 | livcd | Yardanico: thanks i will try that |
13:21:20 | * | gmpreussner quit (Quit: kthxbye) |
13:23:48 | FromGitter | <mratsim> I agree with euantor, or atleast, importing channels automatically enables threads:on |
13:24:15 | * | gmpreussner joined #nim |
13:25:11 | FromGitter | <krux02> happy new year to all of you |
13:25:21 | FromGitter | <krux02> I am back to work with Nim now |
13:26:15 | Yardanico | happy new year, hello :) |
13:27:16 | FromGitter | <mratsim> Hohoho, happy new year :) |
13:29:32 | * | Yardanico quit (Remote host closed the connection) |
13:30:43 | * | Yardanico joined #nim |
13:31:58 | FromGitter | <krux02> thank |
13:40:15 | * | dddddd joined #nim |
13:40:17 | * | Yardanico quit (Ping timeout: 248 seconds) |
13:46:08 | * | yglukhov quit (Remote host closed the connection) |
13:46:45 | * | yglukhov joined #nim |
13:53:05 | livcd | i should be able to extract nupkg withnim's zip library right ? |
13:53:20 | * | yglukhov quit (Ping timeout: 276 seconds) |
13:55:43 | * | Yardanico joined #nim |
13:57:26 | FromGitter | <mratsim> If it's zip or gz yes. If you want to use nupkg in a build script it might be better to just use nimscript and exec unzip/gunzip. |
14:08:47 | * | gokr joined #nim |
14:13:14 | FromGitter | <krux02> in a template how do I convert an argument into a string literal |
14:13:27 | FromGitter | <krux02> in a macro I would do it with arg.repr.newLit |
14:13:56 | FromGitter | <krux02> but I don't want to use a macro here if it's possible without |
14:14:02 | FromGitter | <krux02> C macros can do it, too |
14:18:05 | PMunch | krux02, what are you trying to do? |
14:19:05 | FromGitter | <krux02> PMunch: do you have c2nim ready? |
14:19:22 | PMunch | Not on this machine |
14:19:29 | PMunch | But I can always install it :P |
14:19:34 | FromGitter | <krux02> hmm, i can't nimble install it |
14:19:46 | FromGitter | <krux02> it doesn.t compile on nim head |
14:20:08 | FromGitter | <krux02> if yes then you can just tanslate this for me: #define foobar(a,b) printf("%s, %s\n", #a, #b) |
14:20:14 | PMunch | Huh, indeed |
14:20:58 | FromGitter | <krux02> the reason it doesn't compile is a backwards incompatibility that I introduced :P |
14:21:06 | PMunch | template foobar(a, b: untyped): untyped = echo $a & ", " & $b |
14:21:10 | PMunch | Something like that? |
14:21:15 | FromGitter | <krux02> no not really |
14:21:30 | FromGitter | <krux02> the ast is transformed into a string literal |
14:21:35 | FromGitter | <krux02> that is something C macros can do |
14:21:44 | FromGitter | <krux02> so I thought nim templates can do it, too |
14:21:47 | PMunch | Ah |
14:21:57 | PMunch | template foobar(a, b: untyped): untyped = $a & ", " & $b |
14:22:10 | PMunch | Hmm, well that's not quite the same |
14:23:27 | PMunch | template foobar(a, b: static[string]): untyped = a & ", " & b |
14:23:38 | PMunch | Maybe something like that would be optimized away |
14:24:35 | PMunch | proc foobar(a, b: string): string {.compileTime.} = a & ", " & b |
14:24:40 | PMunch | Wouldn't that work? |
14:24:53 | FromGitter | <krux02> well it's not really about that function |
14:25:45 | FromGitter | <krux02> and this would actially solve it: ``macro stringize(arg: untyped): string = arg.repr.newLit`` |
14:25:57 | FromGitter | <krux02> but I thought there is something in system that does exactly that |
14:26:18 | FromGitter | <krux02> I am pretty sure it exists but I don't know how it's called |
14:26:51 | PMunch | What's wrong with the compileTime proc though? |
14:27:14 | FromGitter | <krux02> by the way the compile error in rodutils is because an array is not implicitly a cstring anymore |
14:27:48 | FromGitter | <krux02> nothing |
14:28:03 | FromGitter | <krux02> it's just that I don't really need the example that I gave you |
14:28:19 | FromGitter | <krux02> I just gave it as an example that would use the stringize function |
14:29:35 | FromGitter | <krux02> template test(arg) = doAssert(arg, stringize(arg) & "failed") |
14:29:45 | FromGitter | <krux02> that is closer to what I acutally need |
14:31:33 | PMunch | Aaah |
14:34:59 | * | gmpreussner quit (Quit: kthxbye) |
14:35:14 | FromGitter | <mratsim> @krux02 are you perhaps looking for astToStr? |
14:36:55 | * | MJCaley joined #nim |
14:37:54 | * | gmpreussner joined #nim |
14:48:06 | Yardanico | hooray! custom pragmas got merged! https://github.com/nim-lang/Nim/pull/6987 |
14:50:00 | FromGitter | <krux02> @mratsim exactly that was what I was looking for, thank you |
14:50:51 | FromGitter | <krux02> is there a resolve alias function somewhere? |
14:52:19 | * | zahary quit (Quit: Leaving.) |
14:55:59 | FromGitter | <mratsim> Oooh awesome, does that mean I can now use {.align.} pragma and {.restrict.} pragma directly in the type declaration !! |
14:56:14 | * | zahary joined #nim |
14:58:11 | * | gokr quit (Ping timeout: 252 seconds) |
14:58:31 | * | yglukhov joined #nim |
14:58:51 | PMunch | mratsim, looks like that's pretty much exactly what you can do with this: https://github.com/cooldome/Nim/blob/1ef8b892da6a0b88478aa718c7198cfc61d52c73/doc/manual/pragmas.txt#L1092 |
14:59:56 | Yardanico | mratsim: if you define them - yes |
14:59:59 | Yardanico | sorry |
15:00:05 | Yardanico | not define, but check them later in your macros |
15:00:15 | Yardanico | but you won't have backwards compat with 0.17.2 :) |
15:01:17 | FromGitter | <mratsim> Well I'll break compat when 0.18 is released |
15:01:40 | FromGitter | <mratsim> So many breaking stuff anyway (BackwardsIndex and HSlice) |
15:02:57 | * | yglukhov quit (Ping timeout: 248 seconds) |
15:04:19 | FromGitter | <zetashift> Better now than a 1.x release |
15:04:45 | Yardanico | well that's the point |
15:04:54 | Yardanico | break as much stuff as possible to not break it after 1.x :P |
15:04:56 | FromGitter | <krux02> what is backwards index? |
15:05:08 | Yardanico | krux02: slices now are a bit different |
15:05:19 | FromGitter | <krux02> how are they now |
15:05:26 | FromGitter | <krux02> I was inactive since christmas |
15:05:45 | Yardanico | https://github.com/nim-lang/Nim/blob/devel/changelog.md read here |
15:05:50 | euantor | custom pragmas are awesome! I can see them being very useful for data serialization/deserialization purposes for definite |
15:05:51 | Yardanico | "We changed how array accesses ..." |
15:06:34 | * | zahary quit (Quit: Leaving.) |
15:06:40 | miran | any time approximation when 0.18 will be out? |
15:06:48 | FromGitter | <krux02> does that mean that when I want `^` to work, I have to invest extra effort? |
15:07:10 | Yardanico | probably a bit more, but now it's not *magic* and just defined in system.nim |
15:07:11 | miran | i know that v1.0 is "just around the corner" TM :D |
15:07:13 | Yardanico | miran, ask Araq :P |
15:07:20 | FromGitter | <krux02> ``proc `[]`(index: int)`` doesn't work with [^2] anymore? |
15:08:08 | * | zahary joined #nim |
15:08:56 | miran | Yardanico: nah, i don't want to bother him with that question, now that he's working (thinking about) more sensible iterator syntax :D |
15:09:14 | Yardanico | miran, I think he's working with destructors :) |
15:11:05 | miran | isn't that post-1.0 goal? :/ |
15:11:22 | Yardanico | miran, it's not related to 1.0 :P |
15:11:31 | Yardanico | it's a new runtime for nim |
15:11:39 | Yardanico | which will be much less dependent on GC |
15:12:09 | Yardanico | miran, https://github.com/nim-lang/Nim/wiki/Destructors nim v2 :) |
15:12:54 | miran | translate that to english for me :) what benefits will that bring? |
15:13:09 | euantor | less people complaining about GC |
15:13:28 | * | MJCaley quit (Quit: MJCaley) |
15:13:33 | miran | euantor: :D :D |
15:13:50 | Yardanico | miran, better interop with another languages |
15:13:57 | Yardanico | also much better for embedded devices |
15:14:08 | FromGitter | <andreaferretti> It may be a little awkward to explain to newcomers the difference between custom pragmas (as in the latest feature) vs custom pragmas (as in pragma pragma) vs custom pragmas (as in macro decorators) |
15:14:31 | FromGitter | <andreaferretti> There are now three ways for users to introduce stuff that can be used in pragma position |
15:14:46 | FromGitter | <andreaferretti> Apparently completely unrelated to each otehr |
15:14:48 | FromGitter | <andreaferretti> otehr |
15:14:49 | FromGitter | <andreaferretti> other |
15:15:10 | Yardanico | miran, see "What's wrong with Nim's GC?" here https://nim-lang.org/araq/destructors.html |
15:15:56 | * | yglukhov joined #nim |
15:16:05 | * | yglukhov quit (Remote host closed the connection) |
15:19:19 | Yardanico | also it will be easier to add custom allocator |
15:19:26 | Yardanico | (memory allocator) |
15:19:41 | FromGitter | <krux02> I have a challenge for you people if you are interested: |
15:19:42 | FromGitter | <krux02> http://ix.io/DQZ |
15:19:55 | FromGitter | <krux02> implement a "resolve alias" function |
15:21:09 | * | endragor quit (Remote host closed the connection) |
15:21:46 | PMunch | How deep should it resolve? |
15:21:58 | PMunch | I remember doing this at some point, might still have the code around |
15:21:59 | FromGitter | <krux02> just the examples |
15:22:39 | FromGitter | <krux02> I already had it but recent changes in nim broke my solution |
15:22:57 | FromGitter | <krux02> right now I think it's impossible, but I am not 100% sure about it |
15:23:26 | miran | alehander42: can you add some example in the readme of py2nim? |
15:23:47 | Yardanico | miran, there are examples in examples folder |
15:23:53 | * | natrys joined #nim |
15:24:42 | miran | Yardanico: will take a look, but IMO there should be example(s) in readme too |
15:25:16 | miran | Yardanico: there are only python files, not what i was looking for |
15:25:20 | FromGitter | <krux02> I don't use that program, but I agree. a readme should have small examples to get the idea |
15:25:32 | Yardanico | py2nim translates python to nim |
15:25:34 | FromGitter | <krux02> especially on github, where the readme is basically the homepage |
15:25:54 | Yardanico | we got a real py2nim translator right here, still in early stage tho :) |
15:26:26 | miran | Yardanico: that's nice, but - we need the examples to actually see what it does |
15:27:06 | FromGitter | <krux02> Yardanico I think a real py2nim translator is not possible |
15:27:10 | Yardanico | @alehander42: btw, can you change submodule url from [email protected]:metacraft-labs/python-deduckt to https://github.com/metacraft-labs/python-deduckt ? |
15:27:20 | Yardanico | because first one doesn't work |
15:27:31 | * | miran quit () |
15:30:29 | * | nsf quit (Quit: WeeChat 2.0.1) |
15:32:09 | * | MJCaley joined #nim |
15:32:45 | PMunch | Hmm krux02, $arg.getType[1].toStrLit get's you pretty far |
15:32:59 | PMunch | Returns "Vec" for "Vec4f" |
15:33:52 | Yardanico | lol :P |
15:41:44 | FromGitter | <mratsim> @krux02 you need something like this to deal with BackwardsIndex: https://github.com/mratsim/Arraymancer/blob/fc4ad528f6afcd377c16ff99f19151a0f5e46f89/src/tensor/backend/metadataArray.nim#L72 |
15:42:40 | FromGitter | <mratsim> (there is a conpile flag that is set when BackwardsIndex is used and that you can check but I don't remember it so ...) |
15:44:05 | * | Amun_Ra quit (Ping timeout: 260 seconds) |
15:54:16 | FromGitter | <krux02> PMunch: getType should become deprecated, so better if you only use getTypeInst and getTypeImpl |
15:54:29 | * | natrys quit (Quit: natrys) |
15:54:33 | FromGitter | <krux02> I updated the challenge: http://ix.io/DR5 |
15:55:03 | FromGitter | <krux02> PMunch: when you are able to implement ``resolveAliasTypes``, then I would be pretty happy |
15:56:14 | * | Amun_Ra joined #nim |
15:57:06 | FromGitter | <krux02> I just added comments and changed the order |
15:57:08 | PMunch | I'm getting closer |
15:57:20 | PMunch | Got most of the tests passing |
15:57:26 | * | miran joined #nim |
16:00:57 | FromGitter | <krux02> cool |
16:04:05 | PMunch | Hmm, Vec4[float32] is acting weird.. |
16:07:50 | PMunch | It gives me Vec[4, float32][float32] |
16:08:13 | FromGitter | <krux02> hmm, I had that before I updated |
16:08:31 | FromGitter | <krux02> but that's a bug |
16:08:37 | PMunch | Oh it is? |
16:10:04 | PMunch | http://ix.io/DR7/ |
16:10:05 | * | chemist69 quit (Ping timeout: 252 seconds) |
16:10:21 | PMunch | That works for all but Vec4[float32] |
16:11:43 | PMunch | @krux02 ^ |
16:17:50 | * | gokr joined #nim |
16:21:22 | FromGitter | <data-man> Nimble supports recursive cloning of a repo with a git submodules? |
16:21:39 | dom96 | yes |
16:21:45 | dom96 | IIRC it should do that by default |
16:22:13 | * | chemist69 joined #nim |
16:22:31 | FromGitter | <data-man> Thanks! |
16:25:49 | * | floppydh quit (Quit: WeeChat 2.0.1) |
16:25:57 | FromGitter | <krux02> PMunch: what version of nim do you have? |
16:26:10 | FromGitter | <krux02> Seems you have an old version, because I have entirely different results |
16:26:15 | PMunch | 0.17.2 |
16:26:37 | FromGitter | <krux02> well I am on devel and there have been made significant changes |
16:26:49 | FromGitter | <krux02> only 3 of the tests pass |
16:27:04 | PMunch | I get the same on 0.17.3 (choosenim devel) |
16:28:15 | FromGitter | <krux02> that is weird |
16:28:23 | FromGitter | <krux02> can you do nim --version? |
16:28:37 | FromGitter | <krux02> git hash: aff787db69ed67f54d72e9caa43e556a9d0e2674 |
16:28:57 | PMunch | devel didn't show a git hash.. |
16:29:03 | PMunch | Trying with "choosenim #head" now |
16:30:32 | PMunch | Works fine with head as well |
16:30:49 | PMunch | But nim --version still doesn't show me a hash |
16:31:31 | dom96 | that's because choosenim doesn't clone the git repo |
16:32:26 | PMunch | Ah right.. |
16:32:51 | PMunch | But I've got to go now |
16:32:55 | PMunch | TTYL |
16:32:56 | * | PMunch quit (Quit: Leaving) |
16:44:06 | FromGitter | <brentp> hey all. I've posted this in here before, mostly asking for help as I started Nim with this project. But, I've rounded out some bioinformatics functionality in: https://github.com/brentp/hts-nim . It's a wrapper for the most widely use C library for parsing and manipulating genomics files . I'll soon put up a pre-print something like this: https://github.com/brentp/hts-nim/files/1615870/hts-nim.pdf I'd appreciate any |
16:44:06 | FromGitter | ... feedback on the library itself and I'm happy to add co-authors for contributions. Hopefully this can get some people in the genomics community (other than me) using nim. |
16:45:12 | FromGitter | <brentp> and BTW, I've already got a paper out that uses Nim + hts-nim: https://academic.oup.com/bioinformatics/advance-article/doi/10.1093/bioinformatics/btx699/4583630 |
16:45:28 | FromGitter | <brentp> that tool is pretty widely used |
16:48:01 | * | gokr quit (Ping timeout: 248 seconds) |
16:48:45 | * | Trustable joined #nim |
16:49:00 | * | azur_kind joined #nim |
16:51:28 | dom96 | brentp: not sure if you're aware but there is a bioinformatics company using Nim (or at least they used to use Nim). Might be worth getting in touch: https://github.com/onecodex |
16:51:47 | FromGitter | <andreaferretti> Hi @brentp , if you are interested, I wrote a small string library implementing popular algorithms coming from bio informatics |
16:52:07 | FromGitter | <andreaferretti> https://github.com/unicredit/cello |
16:52:42 | FromGitter | <andreaferretti> wavelet trees, FM indices, BW transforms and so on |
16:55:38 | FromGitter | <brentp> @dom96 I didn't know that. will ping them. |
16:56:15 | shashlick | dom96: any idea why the choosenim build failed? https://github.com/dom96/choosenim/pull/48 |
16:58:52 | FromGitter | <brentp> @andreaferretti I'm now watching that repo. I don't have an immediate use for that, but I have wrapped a smith-waterman library. might be nice to try one of your similarity measures where the actual alignment isn't needed. |
17:02:30 | dom96 | shashlick: Interesting. Previous successful build used nim v0.16.0 |
17:04:01 | dom96 | I should have pinned the version |
17:04:10 | dom96 | still odd that 0.17.2 fails though |
17:07:46 | shashlick | worked on my local build with 0.17.2 |
17:12:07 | dom96 | The error means that Nimble cannot find Nim's stdlib |
17:17:04 | FromGitter | <krux02> I have an error with a stack trace, how do I make nim print the stack trace with absolute paths? |
17:17:08 | * | zahary quit (Quit: Leaving.) |
17:17:38 | FromGitter | <krux02> I just get vm.nim(1222) wich sucks because them emacs can't parse that file location |
17:17:59 | FromGitter | <krux02> I compiled with koch temp |
17:18:41 | dom96 | shashlick: I think the reason for this error is that somehow `/home/travis/.nimble/pkgs/lib/` exists |
17:19:14 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
17:19:18 | dom96 | I restarted the build |
17:19:55 | dom96 | krux02: I don't think that feature exists. |
17:20:30 | FromGitter | <krux02> meh |
17:20:49 | FromGitter | <krux02> the stack trace is really unusable like it is now |
17:21:50 | * | nsf joined #nim |
17:23:26 | Yardanico | krux02: vm.nim is probably in compiler directory |
17:23:55 | FromGitter | <krux02> I know where vm.nim is, but it really slows me down that the stacktrace is not machine readable |
17:26:06 | * | natrys joined #nim |
17:28:43 | * | vivus joined #nim |
17:31:21 | * | zahary joined #nim |
17:38:22 | * | Trustable quit (Remote host closed the connection) |
17:41:53 | * | arnetheduck_ quit (Remote host closed the connection) |
17:41:53 | * | arnetheduck quit (Remote host closed the connection) |
17:42:30 | FromGitter | <tim-st> Maybe I'm doing something wrong again but Python gives different result for this: https://gist.github.com/anonymous/8aa22283d43e93197f541041617f76bd |
17:42:40 | FromGitter | <tim-st> https://play.nim-lang.org/?gist=8aa22283d43e93197f541041617f76bd |
17:45:02 | Araq | krux02: what do you mean? the stack trace is lines with filename.nim(linenumber) procname contents |
17:45:12 | Araq | looks machine readable to me |
17:48:24 | dom96 | Araq: He needs the absolute filename |
17:48:47 | Araq | --excessiveStackTraces:on ? |
17:49:02 | Araq | should probably be the default |
17:49:12 | dom96 | oh, didn't know about that |
17:49:16 | dom96 | please don't make it default |
17:49:22 | Araq | why not? |
17:49:36 | dom96 | because it's noisy |
17:50:10 | Araq | true but it's so nice when clicking on it can resolve it |
17:50:42 | Araq | also Python uses absolute filenames in its stack traces :P |
17:51:46 | dom96 | it also shows the line |
17:51:50 | dom96 | shall we just copy Python? :P |
17:52:45 | Yardanico | Araq, I didn't know about this option 0_0 |
17:52:49 | Yardanico | is it documented somewhere? |
17:52:59 | Yardanico | ah, yes |
17:53:28 | Yardanico | time to change my global nim config |
17:53:34 | Araq | well I vote for making it the default |
17:53:41 | Araq | let's see what others think |
17:54:10 | Araq | (the tester needs to pass 'off' though since some tests check the stack traces are correct) |
17:54:26 | FromGitter | <krux02> Araq: I just looked at the stacktrace variable. Even interally it does only know the local filename |
17:55:00 | Araq | krux02: unlikely, msgs.nim knows both |
17:55:11 | FromGitter | <krux02> I wanted to "improve" the print stack trace function to also inclde the path of the file, but that information is not there |
17:55:39 | FromGitter | <krux02> at least with what I found out so far |
17:56:00 | FromGitter | <tim-st> Does anyone has an idea why the result of the code I posted is `2`? |
17:56:00 | dom96 | Araq: Do we want to apply for GSOC? |
17:56:22 | Yardanico | Araq, how can I globally enable --excessiveStackTraces:on ? |
17:56:38 | Yardanico | excessiveStackTraces = on in nim.cfg doesn't work |
17:57:12 | Araq | Yardanico: --excessiveStackTrace:on |
17:57:20 | FromGitter | <krux02> TFrame only has a filename entry |
17:58:21 | dom96 | tim-st: the \n isn't included by the triple quoted string I guess |
17:58:44 | Araq | dom96: on the one hand, chances we're accepted are slim, on the other hand, the community appreciates well written enhancement proposals that nobody works at. |
17:58:50 | FromGitter | <krux02> and even with excessiveStackTraces=on and with --listFullPaths I don't get the paths |
17:59:21 | FromGitter | <tim-st> @dom96 It is. I can only get the pattern working for str.split(str) using triple quoted. |
17:59:27 | Yardanico | fully works for me |
17:59:35 | Yardanico | I get full paths |
17:59:55 | FromGitter | <krux02> Araq, dom96, I have problems resolving alias types. |
18:00:27 | FromGitter | <krux02> there is getTypeImpl, and getTypeInst |
18:00:43 | FromGitter | <krux02> I now also want to add "resolve Alias" |
18:00:52 | FromGitter | <krux02> because as a macros it is impossible to implement |
18:01:28 | miran | here's a vote to improved ("excesive") stack traces! |
18:01:45 | FromGitter | <tim-st> @dom96 I will try it again could be true |
18:01:54 | FromGitter | <krux02> yea I tried, but I don't want to spend too much time on it |
18:02:23 | FromGitter | <krux02> because it is not my focus, just annoying that the stack trace is not machine processable |
18:02:49 | FromGitter | <krux02> well it is machine processable, but filenames are not unique in a project |
18:03:24 | * | darithorn joined #nim |
18:04:43 | FromGitter | <tim-st> @dom96 you're right thanks, but than it's a problem of strutils.split(str) it seems the `\n` is not recognized |
18:06:03 | dom96 | !eval import strutils; echo("f\na b".split()) |
18:06:06 | NimBot | @[f, a, b] |
18:06:42 | FromGitter | <tim-st> "str".split("\n{{") was the pattern |
18:08:30 | dom96 | !eval import strutils; echo("strasd\n{{qweqe".split("\n{{")) |
18:08:33 | NimBot | @[strasd, qweqe] |
18:09:37 | shashlick | dom96: did the choosenim build pass? |
18:09:49 | dom96 | nope |
18:14:43 | * | BitPuffin joined #nim |
18:15:11 | * | yglukhov joined #nim |
18:27:58 | * | natrys quit (Quit: natrys) |
18:31:58 | dom96 | I will try to see what the issue is in a while |
18:32:08 | * | natrys joined #nim |
18:38:16 | Araq | krux02: can you report it? can't be hard to fix |
18:39:19 | * | yglukhov quit (Remote host closed the connection) |
18:40:06 | dom96 | Araq: Please state your thoughts on this https://github.com/nim-lang/Nim/pull/7036 |
18:40:45 | Araq | ha, just did, what a coincidence |
18:41:11 | dom96 | hehe, seems we agree about that at least :) |
18:41:15 | miran | Araq: agree on symmetric difference mess |
18:41:37 | miran | i didn't want to exclude it a priori |
18:41:46 | FromGitter | <tim-st> Ok, it seems "\n" has len 2 and in Python len 1, my doucment seems to be splitted by the len 1 version of "\n" ... |
18:42:09 | dom96 | tim-st: \n is platform-dependent |
18:42:32 | miran | dom96: didn't know that `inc` is idiomatic nim. been using `+=` |
18:42:51 | Araq | dom96: meh, let's not get carried away all the time. so now every += must be based on 'inc' |
18:43:01 | miran | what would sets.inc do? |
18:43:34 | dom96 | Araq: You don't think that should be the case? |
18:43:53 | Araq | does 'inc' even exist for floats? I think this is too extreme, 'inc' is a holdover from Borland Delphi, it's nice but nothing I consider "generic" |
18:43:58 | miran | dom96: python doesn't use + and * for sets, but | and & |
18:44:08 | dom96 | Every library implementing their own `+=` that may or may not be different to `inc` seems worse. |
18:44:12 | miran | so it has |= and &= |
18:44:31 | Araq | dom96: most libs do not bother to implement 'inc' afaict |
18:44:45 | miran | the point i'm trying to make: += is not required for sets, iff there is no + |
18:44:45 | dom96 | yeah, because nobody is aware of this quirk |
18:45:01 | dom96 | but soon people will want x++ |
18:45:11 | dom96 | or at least wonder why it doesn't exist when += does |
18:45:27 | Araq | Python does the same and people swallowed it |
18:45:44 | Araq | ++ is weird with its postfix/prefix differences |
18:45:50 | miran | agreed |
18:46:17 | Araq | += is quite consistent in comparison |
18:46:19 | miran | btw, is there **? or //? :) |
18:46:52 | dom96 | bah |
18:46:59 | dom96 | I've learned to love .inc |
18:47:03 | miran | (because *= is quite more readable) |
18:47:20 | Araq | miran: that said I think 'incl' is better than += :P |
18:47:21 | GitDisc | <treeform> i though inc dec was integer only like div and mod? |
18:47:22 | dom96 | But I guess I can't win that war |
18:47:45 | GitDisc | <treeform> i though it was part of the integer bit operations |
18:48:15 | dom96 | but yes, even += is weird for sets |
18:48:19 | Araq | I like 'inc' too but it's not something I want to base basic arithmetic rules on |
18:48:36 | dom96 | and I wonder if it makes sense to have these operators at all for sets |
18:48:38 | miran | Araq: ooooh! i always thought `incl` is just for single elements, now i see it isnt |
18:49:09 | miran | btw, why is it `incl` and not `add` like for other containers? |
18:49:59 | Araq | miran: historic reasons I guess. |
18:50:07 | miran | dom96: which operators? union and intersection? you prefer words rather than symbols? |
18:50:56 | Araq | 'add' for sets doesn't add though, 'add' would make sense for a multiset |
18:51:14 | Araq | note that 'add' for tables really does 'add' (and some people dislike this :P ) |
18:51:29 | miran | Araq: i just got used how in nim "everything" has `add` (and i don't have to think like in python if it is append or add), and then - i still have to remember sets are different |
18:51:58 | dom96 | hrm, I don't know anymore, I suppose symbols are nice for sets |
18:52:08 | miran | yeah, `incl` is "more correct" word to use, i agree |
18:53:03 | dom96 | I think a different name for sets is fine since they are a bit more specialised. |
18:53:15 | dom96 | (by different name I'm referring to 'incl') |
18:53:20 | miran | dom96: symbols are nice. and set comprehensions are also very nice. unfortunately we don't have them (yet :)) |
18:53:41 | dom96 | oh yeah, what ever happened to allowing for loops as expressions? Araq? |
18:54:18 | Araq | I think we have hit a sweet spot with the namings. generic names are nice but when everything has 'add' and 'len' the type checking becomes too weak |
18:54:40 | Araq | I remember a Nim where len(4) used to compile |
18:54:58 | Araq | it was rewritten to len([4]) and produced 1. |
18:55:21 | Araq | lead to really "nice" bug in the compiler |
18:56:19 | livcd | can you rename seqs to slices ? :D |
18:56:42 | Araq | shouldn't seqs support slices first? |
18:57:20 | Araq | dom96: what was the proposal everybody agreed on? |
18:57:40 | FromGitter | <tim-st> @dom96 I solved it. Nim uses for "\n" the chars char(13) and char(10) on windows, that was the problem. Python only uses char(10) that was exactly the one I needed for "\n" and was used in my utf8 doc for "\n"... |
18:58:09 | dom96 | tim-st: yep, like I said, "\n" in Nim is platform-dependent. |
18:58:37 | Araq | yeah it's a bit of a gotcha; \L does what you want |
18:58:41 | FromGitter | <tim-st> But I dont know if this is what devs want. I never had problems with pythons version |
18:58:42 | dom96 | Araq: No idea |
18:58:48 | * | yglukhov joined #nim |
18:58:51 | dom96 | Araq: This is why we need RFCs :P |
18:59:34 | Araq | tim-st: It's what I want fwiw. |
18:59:52 | Araq | I like the fact that Nim doesn't distinguish between "binary" and "text" files |
19:00:22 | Araq | that one always was misguided everywhere else, there is no such difference, it's all bytes. |
19:00:40 | FromGitter | <tim-st> I hope its only me who faces this problem. I didnt have this problem under python in like 5 years |
19:01:24 | dom96 | !eval echo("\n".repr) |
19:01:41 | * | NimBot joined #nim |
19:01:42 | * | yglukhov quit (Remote host closed the connection) |
19:01:45 | FromGitter | <tim-st> you need ord |
19:01:46 | dom96 | !eval echo("\n".repr) |
19:01:48 | NimBot | 0x41fa60"\10"↵"" |
19:01:55 | dom96 | Bet you it ran out of memory :\ |
19:02:14 | FromGitter | <tim-st> So nimbot is not on windows |
19:02:30 | dom96 | NimBot doesn't evaluate it, it delegates to play.nim-lang.org |
19:02:52 | FromGitter | <tim-st> so only windows user will have this problem... |
19:02:54 | Araq | what we can do is to map \n to \10 everywhere |
19:03:07 | FromGitter | <tim-st> yes, that's perfect |
19:03:22 | Araq | since Windows understands it too, most of the time |
19:03:42 | FromGitter | <tim-st> I only used \r\n once when parsing http headers |
19:03:45 | dom96 | Araq: You'd break canon |
19:03:54 | Araq | argh. |
19:04:06 | dom96 | I like that it works this way |
19:04:20 | FromGitter | <tim-st> I dont. |
19:04:32 | dom96 | Why? |
19:05:02 | FromGitter | <tim-st> because it took me 4 hours to solve it and now I dont know how to build my "own" \n string |
19:05:19 | FromGitter | <tim-st> well I can use $char(10) |
19:05:27 | Araq | \L |
19:05:35 | dom96 | https://nim-lang.org/docs/manual.html#lexical-analysis-character-literals |
19:06:06 | dom96 | It probably would have been better to use a different character for this feature |
19:07:12 | FromGitter | <alehander42> @Yardanico you probably don't have ssh keys for github configured(which is bizarre, how do you use github?) but you're right for the link, it's updated now |
19:07:30 | FromGitter | <alehander42> thanks for the example program, I'll take a look at it tomorrow |
19:07:43 | * | MJCaley quit (Quit: MJCaley) |
19:07:57 | * | azur_kind quit (Remote host closed the connection) |
19:08:40 | Araq | dom96: yet \n is close to "newline" in other languages so often we get away with it :P |
19:08:42 | FromGitter | <alehander42> @krux02 py2nim fully automated translator is not very possible in practical sense, the goal of the tool is to automates some of the work involved |
19:08:47 | FromGitter | <tim-st> @Araq thanks, \L works good. |
19:09:30 | dom96 | Funny, I still remember you telling me to use "\c\L" in my sockets code when I first started using Nim. |
19:09:56 | Araq | that's still true. I don't understand you. |
19:10:13 | dom96 | I'm not saying it's not true |
19:10:25 | dom96 | It's just one of the first things I remember |
19:16:30 | FromGitter | <tim-st> Btw I again found the xmlparser from `parsexml` very good and easy to use 👍 |
19:18:54 | * | MJCaley joined #nim |
19:20:40 | * | yglukhov joined #nim |
19:23:40 | * | gokr joined #nim |
19:25:23 | * | yglukhov quit (Remote host closed the connection) |
19:26:44 | * | nsf quit (Quit: WeeChat 2.0.1) |
19:40:59 | dom96 | tim-st: you might find xmltree module easier to use :) |
19:44:48 | Yardanico | sometimes people are confused and think that nim can't cross-compile to other cpu architectures :P https://forum.nim-lang.org/t/3470/1 |
19:44:56 | Yardanico | (I already answered there) |
19:50:40 | * | claudiuinberlin joined #nim |
19:53:13 | * | BitPuffin quit (Remote host closed the connection) |
20:01:12 | * | ryanhowe joined #nim |
20:01:57 | * | ryanhowe quit (Client Quit) |
20:02:30 | * | sleepyqt joined #nim |
20:18:02 | shashlick | dom96: okay, let me know if there's any code fixes needed in the proxy PR for choosenim |
20:20:31 | * | kafke joined #nim |
20:35:10 | * | Vladar quit (Quit: Leaving) |
20:35:39 | * | Yardanico quit (Remote host closed the connection) |
20:46:20 | Araq | dom96: what's the proper way to call the future's callback? |
20:47:01 | dom96 | future.complete() |
20:47:18 | Araq | hmm yeah, found it after I asked |
20:47:40 | Araq | I don't have the value though -.- |
20:48:11 | dom96 | why? |
21:01:25 | FromGitter | <tim-st> why is the newline char not considered as whitespace in `strutils.Whitespace` ? |
21:05:33 | FromGitter | <tim-st> also both procs rstrip and lstrip additionally to strip(leading, trailing) would be better imo especially for non native speakers |
21:13:04 | FromGitter | <tim-st> @dom96 no, I was serious like it. I remember that I never understand Pythons xml "tree" parser and here it just works as I expect |
21:13:10 | FromGitter | <tim-st> *about it |
21:17:07 | * | yglukhov joined #nim |
21:17:17 | GitDisc | <NopeDK> Hmm, sequence of tuple[string, T] vs critbittree[T] for managing Unix paths, with T holding something like a ParseCFG instance. Thoughts? |
21:18:26 | * | yglukhov quit (Remote host closed the connection) |
21:19:57 | GitDisc | <NopeDK> Or a hash table? |
21:20:03 | * | Ven`` joined #nim |
21:24:43 | dom96 | hash table |
21:29:25 | FromGitter | <data-man> No. ⏎ SuperFasterCoolElasticRadixHashHatBitTree. I will rename it to CrashBugStump. |
21:31:05 | Araq | dom96: because the flowvar API is different, trying to figure out how to make it work |
21:31:41 | dom96 | Araq: Well if you know that the flowvar is finished then surely you can just read its value, no? |
21:31:56 | GitDisc | <NopeDK> Since I haven't tried working with it, some inside joke I'm missing? And would hash table still be preferred if I needed a tree-like structure? (Basically a custom WalkDir, with dynamic exclusion of subpaths based on a config in current folder) |
21:33:21 | Araq | dom96: I don't know when it's finished... you either call ^ or await on it and this blocks until the other thread computed the value |
21:34:42 | Araq | -.- seems hard |
21:34:49 | dom96 | Araq: ahh, what's the underlying object? |
21:34:58 | dom96 | That performs this data transfer? |
21:35:46 | Araq | not sure what you mean, a Posix condition variable? |
21:36:21 | Araq | NopeDK, I think data-man has some special datastructure lying around somewhere |
21:36:39 | dom96 | Araq: Yeah, that's what I mean |
21:37:05 | * | natrys quit (Quit: natrys) |
21:37:37 | GitDisc | <NopeDK> Curiousity has been peaked. |
21:37:49 | dom96 | Araq: Perhaps condition variables can be polled? |
21:38:53 | Araq | well polling is what your example code already does |
21:39:21 | FromGitter | <data-man> @NopeDK: if you need tree-like structure then try https://github.com/Nycto/RBTreeNim |
21:39:25 | dom96 | Araq: I mean via epoll |
21:39:32 | dom96 | with the rest of the fds |
21:39:43 | Araq | unlikey, it has no fd |
21:39:48 | Araq | on windows that can be done |
21:43:03 | Araq | https://stackoverflow.com/questions/8593004/waiting-on-a-condition-pthread-cond-wait-and-a-socket-change-select-simultan |
21:43:17 | Araq | I think I can emit a custom event on the worker thread |
21:44:20 | dom96 | Remember that async now has some support for signals |
21:49:18 | GitDisc | <NopeDK> data-man, good idea but as my data would inherently be unbalanced, an RB tree won't work. Was thinking critbit because it was a pure Nim and could do stuff like: "/" -> "bin", "dev", "home", "usr" with each of those having similar subnodes and if certain criteria is met during the walk, I can easily delete the end-node(s) that match. |
21:49:35 | * | miran quit (Quit: Konversation terminated!) |
21:50:02 | GitDisc | <NopeDK> But everyone is always talking links or hashes, just curious if critbits are the optimal choice for such a structure. |
21:54:07 | * | sz0_ joined #nim |
21:54:09 | FromGitter | <data-man> @NopeDK: Bench! Bench everything! Do not trust anyone! :-) |
21:55:47 | GitDisc | <NopeDK> That is true. Back to the old ways, learning by doing. |
21:59:28 | Araq | just use critbittrees and call it a day |
21:59:50 | Araq | if it supports what you need, it's usually good enough :P |
22:01:04 | GitDisc | <NopeDK> I am too perfectionistic to just go with stuff, always trying to get the "best" possible/available for the use case. |
22:02:35 | FromGitter | <data-man> @NopeDK: How many items do you need to store? |
22:05:19 | * | nsf joined #nim |
22:08:50 | GitDisc | <NopeDK> Dynamic, basically I want to scan an entire Linux system like with WalkDir, if there exists a subdir with a specific name when walking, load config from that subdir, that config then has a list of folders to exclude from the walking (deleting the just added nodes), and on it goes. So probably not many items, but the tree might quickly become to big (which is another concern) |
22:10:01 | FromGitter | <data-man> Just write Nim binding for https://github.com/antirez/rax ⏎ Or port it to Nim. :) |
22:15:45 | GitDisc | <NopeDK> Holy... Porting that is definitely not something for me at this time, a binding is possible but have to research Rax closer. |
22:15:50 | * | nsf quit (Quit: WeeChat 2.0.1) |
22:26:23 | FromGitter | <data-man> https://github.com/Tessil/hat-trie ⏎ https://github.com/Tessil/array-hash ⏎ https://github.com/Tessil/hopscotch-map ⏎ https://github.com/Tessil/sparse-map ⏎ https://github.com/Tessil/robin-map ... [https://gitter.im/nim-lang/Nim?at=5a55418fd0514c785b0ee230] |
22:30:34 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
22:31:01 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:40:20 | GitDisc | <NopeDK> O.o time to get reading |
22:40:27 | GitDisc | <NopeDK> Thanks data |
22:46:36 | * | marenz__ joined #nim |
22:47:48 | shashlick | @nopedk: using nimgen to wrap rax real quick |
22:50:53 | GitDisc | <NopeDK> Firstly is to look through them all, secondly to actually see if they are useful and then we can begin talking wrapping |
22:53:03 | shashlick | already done, if you need it let me know |
22:53:45 | GitDisc | <NopeDK> cool, sure will |
23:00:08 | * | darithorn quit (Quit: Leaving) |
23:03:01 | * | dddddd quit (Remote host closed the connection) |
23:09:48 | * | themagician quit () |
23:12:34 | Calinou | I discovere to my dismay that I'm no longer the record holder of the Nim Snake game :( |
23:12:37 | Calinou | discovered* |
23:12:46 | * | sleepyqt quit (Read error: Connection reset by peer) |
23:14:33 | dom96 | a canadian takes the throne |
23:14:35 | dom96 | nice |
23:14:40 | dom96 | Calinou: Just gotta keep playing :D |
23:15:18 | Calinou | :p |
23:16:24 | * | ludocode quit (Remote host closed the connection) |
23:20:33 | * | yglukhov joined #nim |
23:24:47 | * | yglukhov quit (Ping timeout: 248 seconds) |
23:25:11 | * | FromGitter quit (Remote host closed the connection) |
23:25:12 | * | oprypin quit (Quit: Bye) |
23:25:27 | * | FromGitter joined #nim |
23:26:22 | * | ludocode joined #nim |
23:36:04 | * | yglukhov joined #nim |
23:40:17 | * | yglukhov quit (Ping timeout: 248 seconds) |
23:44:23 | * | oprypin joined #nim |
23:44:31 | * | MJCaley quit (Quit: MJCaley) |