<< 02-08-2015 >>

00:00:32VarriountCould we please not throw around insults?
00:00:39Araqswap(ref objectA, ref objectB);
00:00:45SirCmpwnin any case, I want to change the properties (is that what they're called) of the object, I don't necessarily want to change the object
00:01:00SirCmpwnbut it says it cannot be assigned to
00:01:18VarriountSirCmpwn: Can you show us your code?
00:01:50SirCmpwnhttps://gist.github.com/SirCmpwn/69ca1c129c9c3be97679
00:02:16SirCmpwnthe relevant bit is at the end
00:04:58Araq public async void foo(ref string x)
00:04:59Araq {
00:05:01Araq x = "woo";
00:05:02Araq }
00:05:19Araq--> Async methods cannot have 'ref' or 'out' parameters
00:05:27SirCmpwnAraq: the source of our disagreement is that I am asking questions about setting the values within an object, not the object itself
00:05:45SirCmpwnref makes no difference in that case in C#.
00:05:57Araqthere is no disagreement, I said "I wonder" and you felt obliged to answer
00:06:08VarriountSirCmpwn: The client object needs to be a ref
00:06:09SirCmpwnyeesh, just shut up already
00:06:45SirCmpwnVarriount: okay, but then calling `client.connect()` gives me an error
00:07:13VarriountOh? What error do you get?
00:07:25SirCmpwnhttps://sr.ht/99324.txt
00:07:42SirCmpwncorrection: this line is `asyncCheck client.connect()`
00:08:12SirCmpwnalso, what are the implications of `asyncCheck`? Does it block? What happens if an error occurs later on?
00:08:54VarriountSirCmpwn: That's a question best answered by dom96. I think it blocks.
00:09:02SirCmpwnseems like an odd thing to do
00:09:09SirCmpwnis there a way to run an async proc, you know, async
00:09:39Varriount"Sets a callback on future which raises an exception if the future finished with an error."
00:09:52SirCmpwnoh, so the exception would be raised from the callback?
00:09:56SirCmpwnthe callback being a closure, I guess?
00:10:10SirCmpwnand I guess runForever() can be pre-empted?
00:12:48VarriountSirCmpwn: https://gist.github.com/Varriount/43b7bca3bb8ed7624a32
00:13:38VarriountSirCmpwn: An object type can be both on the stack or the heap, and can't be modified from a parameter without the parameter being a 'var' type.
00:14:00Varriount'var' in that case means 'implicitly pass a pointer to'
00:14:36SirCmpwngot an error on the "new" line
00:14:42*SirCmpwn greps docs for new
00:14:44VarriountSince async procedures are turned into closure, they can't capture var types, otherwise they risk holding invalid references when the stack changes.
00:14:58VarriountSirCmpwn: Huh? It compiled for me.
00:15:14SirCmpwnhttps://sr.ht/8e16.txt
00:15:45SirCmpwnwhoops, missed your change to line 23
00:15:46VarriountSirCmpwn: Did you copy all the code I just pasted, or just a part of it?
00:15:52SirCmpwnworks now, thanks
00:16:19VarriountSirCmpwn: 'ref' types are always on the heap, and always garbage collected, thus they can always be captured.
00:16:23SirCmpwnasync/await in nim uses coprocs, right? They all run on the same thread?
00:16:28VarriountYes.
00:16:32Varriount(For now)
00:16:35SirCmpwngood, makes things easier
00:17:12SirCmpwnis the use of {.inline.} encouraged or is that best left up to the compiler's optimizer?
00:17:23SirCmpwnI'm inclined to say the latter if it eventually goes through gcc
00:17:42VarriountSirCmpwn: Well, I wouldn't say 'discouraged', because the issue hasn't really come up.
00:18:09VarriountIt's used occasionally within the standard library, however the tedium of writing it out is generally discouragement enough.
00:18:17SirCmpwnyeah, verbosity is bad
00:18:27SirCmpwnis there a way to export things you've imported?
00:18:34SirCmpwnso I can split up a module
00:18:42VarriountYes. The export statement.
00:18:43SirCmpwnI tried `import *modulename` but that doesn't work
00:19:08VarriountSirCmpwn: You can also use the 'include' statement, which is similar to C and C++'s include.
00:19:08SirCmpwnworks, thanks :)
00:19:22SirCmpwnisn't it an anti-pattern to include code into code?
00:19:37VarriountHowso?
00:19:46*perturbation joined #nim
00:19:49SirCmpwnwell, in C if you #include "foobar.c" you'll get crucified
00:20:00SirCmpwnthe preferred pattern is to create foobar.h and use that
00:20:03VarriountGenerally the only code you include is code that you yourself have control over.
00:20:20SirCmpwnsure, but using a header also improves the usability of things like incremental compilation
00:20:35VarriountNim doesn't have headers though. :3
00:20:49SirCmpwnanother question: is nim upstream aware of how verbose the compiler output is, which hides useful information
00:21:08renesacusually you use import, that is much better than any header solution using c
00:21:22Varriount'Upstream'? You mean the development version?
00:21:41SirCmpwnI just mean are the maintainers of the language aware of it and do they plan on improving it
00:21:44perturbationSirCmpwn: you can set verbosity with the --verbosity:0 to 3 for most terse to most verbose
00:21:51renesacI already complained that I wanted a verbosity 0.5 or something like that
00:22:03SirCmpwnI feel like a successful compile, by default, should show no output
00:22:09SirCmpwnand hints/warnings from external code should not show at all
00:22:13VarriountSirCmpwn: Are you using the version of Nim available on the master branch, or on the devel branch?
00:22:20SirCmpwnI'm using `sudo pacman -S nim`
00:22:20renesacSirCmpwn: then use --verbosity:0
00:22:35SirCmpwnrenesac: that helps for sure, but I still see things from external code
00:22:47renesacright
00:22:48SirCmpwnkind of lame to add such a long argument to every invocation of the compiler, too
00:22:57renesacyou can change it in your config file
00:23:00VarriountSirCmpwn: If you look in Nim/config, you'll see a 'nim.cfg' file.
00:23:09SirCmpwnaha, that'll help
00:23:22renesacI'm not sure if it will hide all hints, though
00:23:29VarriountIt controls default arguments and such.
00:23:39SirCmpwngrepping for verbosity doesn't get me anywhere
00:23:45SirCmpwndo I just add `verbosity = 0`?
00:23:53SirCmpwnah, I see how to do it
00:24:27SirCmpwnthanks for the tip, renesac
00:24:58VarriountSirCmpwn: If that doesn't work, it shouldn't be too hard to add it to the config parser. I'm not sure how aware of all the compiletime options it is, at last check.
00:25:18SirCmpwnjust had to add `--verbosity: "0"` to the config
00:25:22AraqSirCmpwn: yeah we're aware and OnO is working on it
00:25:33SirCmpwnOnO is the BDFL around here?
00:25:44VarriountUh.. no.. Araq is.
00:25:49SirCmpwnoh, alright
00:26:36SirCmpwnVarriount: I'm still not following how `new(...)` works there
00:26:45*yglukhov joined #nim
00:26:47SirCmpwndoes it assume that you want the return type implicitly?
00:26:55VarriountSirCmpwn: new() allocates memory to a reference.
00:27:19SirCmpwnright, but wouldn't it have to know the type so it knows how much memory to allocate? and so the rest of the proc doesn't make the compiler throw up?
00:27:23SirCmpwnwhere does that type come from?
00:27:37VarriountIn that instance, I am allocating memory to the 'result' variable, which is the implicit variable given to a procedures return value.
00:27:55SirCmpwnoh, I see
00:27:59VarriountIt's type corresponds to the return type of the procedure.
00:28:06SirCmpwncan that be done explicitly instead? Something like `let result = new(Client)`?
00:28:20SirCmpwnor would you do `let result: Client` and `new(result)`?
00:29:08VarriountYou can't re-declare the result variable, unfortunately.
00:29:33SirCmpwnwell, give it another name, just an example
00:29:41SirCmpwnwhat I'm asking is how do I use new outside of what is effectively a constructor
00:30:03VarriountSame way. 'new(nameOfAVariablePreviouslyDeclared)'
00:30:23SirCmpwn`let c = new(Client)` just compiled without error, is it doing what I expect?
00:30:34SirCmpwnand I guess my old way was using the stack?
00:31:13VarriountSirCmpwn: Yes. Object types are allocated on the stack, unless they are part of a ref type or are in a container such as a sequence.
00:31:18*yglukhov quit (Ping timeout: 272 seconds)
00:31:24perturbationAraq: added an example to reproduce #3140 at https://gist.github.com/singularperturbation/de5d2b5239e9751ce1b0
00:31:56SirCmpwnis there object unpacking like we have tuple unpacking? Would be useful
00:31:59VarriountSirCmpwn: Hm. I wasn't aware you could pass a type to `new`, that might be a recent development.
00:32:35VarriountSirCmpwn: You mean, breaking an object down into it's member values? No.
00:32:36perturbationtried using {.push overflowChecks: off.} pragma around the findIter iterator in nre.nim as a workaround, but still occurs if compiler built with them enabled
00:32:54SirCmpwnVarriount: more like result = { address: address, port: port, user: user }
00:32:56*vendethiel quit (Ping timeout: 265 seconds)
00:33:05SirCmpwnor better yet, { address, port, user } and use implicit names
00:33:50AraqClient(address: address, port: port, user: user)
00:33:52Araqworks
00:33:57SirCmpwnnot on the heap, though, right
00:34:06SirCmpwnor does it, hmm
00:34:07VarriountAraq: But that doesn't work for ref types, does it?
00:34:14SirCmpwnno, probably not
00:34:25Araqit does work
00:34:29SirCmpwnyeah, it does
00:34:30SirCmpwnneato
00:34:47Araq(ref Client)(field: field) # works too if Client is an object
00:35:05VarriountSirCmpwn: Could you show me?
00:35:11*X67r quit (Quit: leaving)
00:35:22SirCmpwnhttps://sr.ht/b9a5.txt
00:35:45AraqSirCmpwn: you don't need the new(result) then
00:35:58SirCmpwnindeed, very nice
00:36:01Araqand it allocates a superfluous object
00:36:08Araqwhen you use it
00:36:11SirCmpwnwell
00:36:15SirCmpwnthat can be fixed at the compiler level
00:36:19VarriountNow I feel embarassed. I'm supposed to know these things.
00:36:21SirCmpwnin the name of cleaner code, I will use this
00:36:28SirCmpwnand assume that later it'll be optimzied :)
00:37:35AraqVarriount: you're simply for too long into Nim ;-) and missed a few recent developments where 'recent' means ~2 years ago :P
00:38:28SirCmpwnanything good for a .gitignore, other than nimcache/ and the executable?
00:38:34SirCmpwnalso, side note, would be nice if it were .nimcache
00:39:14VarriountEugh. Not another dotfile.
00:39:25SirCmpwnwhat's wrong with dotfiles?
00:39:33VarriountSirCmpwn: I use Windows.
00:39:37SirCmpwnwell that's your fault
00:39:42Varriount-_-
00:39:52SirCmpwnit could behave differently based on your platform, though
00:40:00SirCmpwnor through a config option
00:40:33Araq--nimcache
00:40:42VarriountAlthough, now that I think about it, making nimcache hidden on windows wouldn't do me any good either, since I have the 'view hidden files mode' on.
00:41:15*hauzer joined #nim
00:41:17Araqsame here, I never got the concept of a "hidden file"
00:41:36SirCmpwnI do it one of the SDKs I've written
00:41:46SirCmpwnall of the files the SDK needs are in .knightos/
00:42:00SirCmpwnkeeps you from having to think about things that aren't related to _your_ codebase
00:45:18AraqI usually use beer for this
00:46:45*hauzer quit (Quit: Page closed)
00:46:56SirCmpwnalso nice for keeping it from messing with your tab completion
00:48:59*Sahnvour quit (Quit: Leaving)
00:49:07VarriountSirCmpwn: You work on KnightOS?
00:49:12SirCmpwnI maintain it
00:49:32SirCmpwnI'm what Araq is to Nim, but for KnightOS
00:49:40VarriountNeat. I've seen posts of it on Reddit.
00:50:01SirCmpwnit's a fun project.
00:54:12*perturbation quit (Remote host closed the connection)
00:58:05SirCmpwnnim does GC for me, right
00:58:16SirCmpwnI don't have to think about getting rid of things?
00:58:19VarriountYes.
00:58:23SirCmpwncool.
00:58:24SirCmpwnloving it so far.
00:59:07SirCmpwnstupid question that I probably know the answer to already: can it compile to ANSI C?
00:59:08VarriountAlthough, I don't know how well the GC would do on small devices. You can turn it off though.
00:59:36VarriountSirCmpwn: I believe it's C99 compatible? At least, for most of the standard features.
00:59:43VarriountOr was it C98?
00:59:43SirCmpwnoh well
00:59:47SirCmpwnKnightOS has an ANSI C compiler
01:00:03AraqSirCmpwn: it compiles to "some C as implemented by all the big C compilers"
01:00:23SirCmpwnor to javascript, which is cool
01:00:31SirCmpwndoes it run the C through emscripten or do you directly emit JS instead of C
01:00:40VarriountDirectly emit JS
01:00:43SirCmpwnneato
01:00:45Araqcannot compile to Ansi C but Ansi C doesn't mean much since the standard is full of holes and inconsistencies
01:01:04SirCmpwnANSI C isn't so unclear that it can't be targetted
01:01:20SirCmpwnbut I don't expect nim to try
01:03:26AraqVarriount: btw I know why you never could get the fix for s.add(s.high) to work
01:03:58VarriountOh?
01:04:24VarriountThat was the one where the length was unexpected, right?
01:04:30Araqright
01:04:58Araqthe fix really was as simple as I described it
01:05:06*perturbation joined #nim
01:05:18Varriount... but I'm no good at fixing the compiler?
01:05:29Araqbut you need to introduce proc incrSeqV2 in order to keep bootstrapping from working
01:05:56Araqotherwise the old compiler uses the wrong -- already updated -- version of proc incrSeq
01:06:03VarriountAh.
01:06:22Araqer
01:06:37Araq"in order to keep bootstrapping working" lol
01:06:57Araqperturbation: cannot reproduce but I think I know why
01:07:51perturbationvery strange... I've tested in OS X and Linux (but not windows), and both are 64-bit
01:08:06Araqyeah I'm on 32 bits
01:08:14Araqand then int.high means something different
01:08:23Araqbut internally the compiler always uses int64
01:08:30Araqso ... yep. now I can reproduce
01:10:06*vendethiel joined #nim
01:10:28SirCmpwnare you guys happy with the package manager? Sending a PR up to nim-lang/packages seems like it doesn't scale very far
01:11:21VarriountSirCmpwn: Well, it works well enough for now.
01:11:35AraqSirCmpwn: no, I think it is completely broken
01:11:39SirCmpwnwell, I'm seeing it as a potential place where I could help with improvements
01:11:52SirCmpwnhttps://packages.knightos.org/ is mine, fwiw
01:11:56perturbationokay, that makes sense... I had tried to trace through to get better info as to the cause by reading through ccgexprs / semfold, but there was a bit too much magic going on in ccgexprs for me to follow '-.-
01:12:26AraqI consider Nimble hardly usable without it being able to make PRs automatically
01:12:47SirCmpwnhow good/bad of an idea is it to write web services in nim right now?
01:13:05Araqtalked with dom96 about it and it's hard to implement ... thanks to github -.-
01:13:22SirCmpwnI think that github is a poor choice of platform for this use-case
01:14:40AraqSirCmpwn: people already use it for web services but I would not call it "stable"
01:14:44SirCmpwnwhere is forum.nim-lang.org hosted?
01:14:52SirCmpwnand how happy are you with the code?
01:15:26SirCmpwnnevermind, after browsing it for a minute I can guess how happy you are with it
01:17:25AraqI don't even know what its code looks like now
01:18:14SirCmpwnconsidering the amount of work required upfront to develop a usable web development ecosystem
01:18:26SirCmpwnI would suggest that some other language be used for such things
01:18:28SirCmpwn(for now)
01:18:43Araqha no way
01:18:45Xeweb development is just stupid in general
01:18:58Araqwe use Nim for everything, no matter if wise or not
01:19:07SirCmpwnalright, fair enough.
01:19:31SirCmpwndoes nim have any sort of reflection capability
01:19:34SirCmpwnprobably not
01:19:44Xehow about you read the documentation
01:19:59Araqha, it has the most powerful macro system known to mankind
01:20:21SirCmpwnit'll take a while for me to grok the macro docs, Xe
01:20:23Araqwhich means you can reflect all you want, once you know how to do it
01:20:42Araq(or you use the limited typeinfo module)
01:21:11dom96ohhh.
01:21:22dom96Did you just imply that NimForum's code is bad?
01:21:26AraqI have to sleep now, but feel free to come up with a way to get rid of this "pull requests required for nimble" bullshit. (sorry dom96)
01:21:36SirCmpwndom96: :<
01:22:05SirCmpwnAraq: the clear solution is to build a service around it instead of trying to shoehorn it on top of github services
01:22:15SirCmpwnwhich I might start prototyping if I have time
01:23:09dom96Araq: Yeah, let me spend a couple of months working a website instead.
01:23:30dom96I thought you were after "get it working asap instead of wasting time"
01:23:42dom96*working on
01:24:16VarriountI think the forum works pretty well.
01:24:29SirCmpwnyou're right
01:24:48dom96I think it's a good show case of what Nim can do.
01:24:54SirCmpwnehh
01:25:01dom96But it's a PITA to maintain
01:25:10SirCmpwn^ this statement invalidates the prior one
01:25:21SirCmpwnI wrote an IRC bot in brainfuck, doesn't mean it's a good showcase of brainfuck
01:25:25dom96hrm?
01:25:41dom96I'd say it does
01:26:01SirCmpwnmaybe as a hack
01:26:16SirCmpwnnot to demonstrate a language's ability to effectively fulfill a use-case
01:27:14dom96It's a good test of the compiler and the standard library.
01:27:18SirCmpwnthat's not to say that nim will never be able to fulfill that use-case effectively
01:27:27SirCmpwnbut the tooling around it needs to be improved in that direction
01:27:37SirCmpwns/tooling/modules/
01:28:15dom96I agree.
01:29:16SirCmpwnare nim modules always distributed in source form?
01:29:26perturbationsay we replaced it with something standard like flask/sinatra/RoR/django/phpBB... we might get more "conversions" as far as people who decide to stick around because of the forum having a better UI
01:29:40SirCmpwnthe ui isn't a problem, the ui is great, I love it
01:29:57dom96I don't see what the web framework has to do with the UI.
01:30:07perturbationbut we (meaning dom96) wouldn't be eating our own dog food and improving the stuff that needs to be improved for using nim as a web dev framework
01:30:08perturbationhmmm
01:30:15VarriountSirCmpwn: Well, it's theoretically possible to distribute using a DLL and a nim source file that declares/defines all the procedures/types.
01:30:26SirCmpwnthere isn't really a web framework to speak of, perturbation
01:30:31perturbationwhat *are* the complaints for the forum then? Hard to maintain / difficult to add new features? Lack of auth?
01:30:32dom96SirCmpwn: Nimble packages are
01:30:38SirCmpwnthough I agree that the project should be driving the development of one
01:30:41dom96perturbation: Lack of time
01:30:44dom96lack of volunteers
01:30:48SirCmpwnperturbation: maintainability
01:31:05SirCmpwnperturbation: plus it's a big hack written without support of good web dev modules
01:31:14dom96The only PITA really is that I don't have time to maintain it.
01:31:24dom96SirCmpwn: That's not true.
01:31:30dom96What makes you think that?
01:31:43perturbationSirCpmwn: I've used jester for some side projects and liked it okay... I don't do that much web stuff though
01:31:49SirCmpwna large basis of experience with web frameworks for many other languages
01:32:34SirCmpwnI can point out the specific flaws if you like, but I'd rather not tear it apart in here
01:33:32dom96I'm curious, write them in a gist and send me the link.
01:33:44SirCmpwnsure.
01:35:10dom96But in regards to the real issue. I am the maintainer of like ... 6+ projects.
01:35:24SirCmpwnlol
01:35:30SirCmpwnvisit my github account sometime
01:35:32dom96If any of you guys are bored any help is appreciated.
01:35:49*Xe goes back to dicking with Go and Haskell
01:38:10perturbationdom96: This (https://github.com/nim-lang/nimforum) the repo for the forum? I have some time to burn, so I'll try to see what I can do with the open issues
01:38:33perturbationalso might refactor the `||` template to use option types instead
01:39:34dom96perturbation: sure, play around with it. It should be pretty easy to get up and running.
01:39:58dom96If you don't understand something in the code base let me know and i'll do my best to help.
01:40:03perturbationI'll need to install postgres though... I think I'll set up a VM just so everything's tidy
01:40:14dom96If I don't reply then you can also ask in the forum/
01:40:21dom96you don't need to
01:40:26dom96it uses sqlite
01:40:28perturbationthanks - I'm sure I'll run into something sooner or later
01:40:29perturbationoh
01:40:58perturbationthat should definitely let me get up and running more quickly
01:41:23dom96One thing you can already improve: edit the readme to mention that
01:50:33dom96good night
02:15:41perturbationnice - this is small enough that I can wrap my head around it... maybe some cleanup just with moving formBodies out of forum.nim and into their own files.
02:15:58perturbationanyway - getting late for me as well
02:16:02perturbation'night all
02:16:16*perturbation quit ()
02:25:56*vendethiel quit (Ping timeout: 272 seconds)
03:20:17*darkf joined #nim
03:20:37*Kingsquee quit (Read error: Connection reset by peer)
03:20:49*Kingsquee joined #nim
05:05:55*BitPuffin|osx quit (Ping timeout: 256 seconds)
05:21:46*phira joined #nim
05:28:29*pregressive quit (Read error: Connection reset by peer)
05:28:44*pregressive joined #nim
06:26:19*elbow_jason quit (Ping timeout: 246 seconds)
06:46:35VarriountHm. I wonder how a natural COM api could work in Nim.
06:48:07*jszymanski joined #nim
06:59:31infinity0bogen: hm ok, but what i built "works" as in, it bootstraps itself fine, so i'm hoping i don't need to do extra tests?
06:59:43infinity0actually yeah, how do i run the unit tests?
07:07:29*dgellow quit (Remote host closed the connection)
07:12:45notfowlKoch test iirc
07:13:32*Kingsquee quit (Read error: Connection reset by peer)
07:13:48*Kingsquee joined #nim
07:22:35*pregressive quit (Remote host closed the connection)
07:24:48*X67r joined #nim
08:01:31*wan quit (Ping timeout: 246 seconds)
08:02:12*gmpreussner|work quit (Read error: Connection reset by peer)
08:14:27*wan joined #nim
08:33:27*Raimondi quit (Ping timeout: 252 seconds)
08:48:43*xcombelle joined #nim
09:10:00*wan quit (Ping timeout: 264 seconds)
09:12:07*jszymanski quit (Quit: computer sleeps...)
09:22:39*wan joined #nim
09:24:29*BitPuffin|osx joined #nim
09:28:27*dv- quit (Ping timeout: 255 seconds)
09:29:45*dv- joined #nim
09:32:37*dv- quit (Changing host)
09:32:37*dv- joined #nim
09:44:36infinity0hmm, koch test fails, and it says "run with --parallelBuilds:1 to see the error message" but that still doesn't output the error message
09:50:43infinity0ah ok i have to pass it to the cc command
09:50:53infinity0$ nim cc --parallelBuild:1 --taintMode:on tests/testament/tester
09:51:04infinity0tests/testament/tester.nim(15, 22) Error: cannot open 'compiler/nodejs'
09:51:10infinity0and indeed nodejs is not compiled yet
09:51:17infinity0why isn't it automatically done so? (this is 0.11.2)
09:52:48infinity0oh wait, was using the system nim intstead of the built nim
10:04:05*drewsrem joined #nim
10:23:33infinity0so i get a few red lines like: tmapper.nim [reOutputsDiffer] but the overall "koch test" process returns 0, is this still ok?
10:23:48infinity0slightly confusing to have the red colour show up like that, if everything is ok (if it is an ignored test)
10:27:40*yglukhov joined #nim
10:29:30*vendethiel joined #nim
10:38:17*yglukhov quit (Remote host closed the connection)
10:48:06*dalarmmst quit (Ping timeout: 255 seconds)
10:48:58*Trustable joined #nim
10:58:35dom96infinity0: Some tests always fail.
10:58:45dom96the process returns 0 no matter what IIRC
10:59:02infinity0oh
10:59:05infinity0so what's the point?
10:59:19infinity0if there are 5 failing tests, what action can i take about that as a user?
11:01:08*dalarmmst joined #nim
11:01:13dom96fix them? I guess.
11:01:20*unclechu joined #nim
11:02:15*Sahnvour joined #nim
11:05:16dom96you can get more details in the testresults.html file
11:09:45*wan quit (Quit: WeeChat 1.2)
11:12:23infinity0hm ok
11:12:59infinity0i guess i mean, why was the version i'm testing (0.11.2) released with failing tests... at least they have have been annotated as "expected to fail"?
11:13:09infinity0as opposed to, i have no idea if the build messed up the bytecode logic or something like that
11:13:14infinity0e.g. as may be the case on freebsd
11:13:29infinity0at least they should have*
11:17:07*X67r_ joined #nim
11:19:10*X67r_ quit (Read error: Connection reset by peer)
11:20:24*X67r quit (Ping timeout: 244 seconds)
11:22:05*X67r joined #nim
11:38:53*yglukhov joined #nim
11:41:13bogeninfinity0: nim cc --parallelBuild:1 --taintMode:on tests/testament/tester # does not return any errors for me
11:41:48bogen./koch test shows failures though. (and some passes)
11:43:19*yglukhov quit (Ping timeout: 265 seconds)
11:59:26*Kingsquee quit (Quit: Konversation terminated!)
11:59:36*Kingsquee joined #nim
12:22:29*Demon_Fox joined #nim
12:24:43*jszymanski joined #nim
12:41:08*Kingsquee quit (Read error: Connection reset by peer)
12:41:22*Kingsquee joined #nim
12:43:05*zielmicha quit (Remote host closed the connection)
13:00:33*Raimondi joined #nim
13:03:33Sahnvourcould someone tell me what's wrong in the following short code : http://pastebin.com/dH9ERnBC , when trying to access an element of the `offset` array ?
13:04:15*gmpreussner|lapt joined #nim
13:05:02*yglukhov joined #nim
13:08:18*xcombelle quit (Remote host closed the connection)
13:19:41dom96Sahnvour: That's not the syntax for array constructors.
13:19:47dom96Get rid of the "Left: "
13:19:54dom96"Right: "
13:19:55dom96etc
13:36:00*drewsrem quit (Quit: Leaving)
13:48:55Sahnvourok, i'm still having an error
13:49:09Sahnvourerror: 'Position92004' has no member named 'Field0'
13:49:12Sahnvourerror: 'Position92004' has no member named 'Field1'
13:51:17*devzerp quit (Remote host closed the connection)
13:51:17*no_name quit (Remote host closed the connection)
13:54:54dom96interesting
13:55:00dom96Sahnvour: it's a compiler bug, report it
14:02:37*dalarmmst quit (Ping timeout: 246 seconds)
14:09:25*gmpreussner|lapt quit (Ping timeout: 240 seconds)
14:09:36*gmpreussner|lapt joined #nim
14:10:02Sahnvourok
14:10:27*strcmp1 joined #nim
14:12:12dom96It looks like for some reason the compiler thinks that your type is a tuple.
14:15:11Sahnvourbtw, what's the most convenient way to format/build strings in nim ?
14:17:13*xcombelle joined #nim
14:17:30*BitPuffin|osx quit (Remote host closed the connection)
14:17:49*BitPuffin|osx joined #nim
14:18:34*xcombelle_ joined #nim
14:19:16*dalarmmst joined #nim
14:23:34dom96Sahnvour: appending via .add and strutils.`%`.
14:23:47dom96depends what you're building though
14:24:43Sahnvoursimple output with some variables in it. but i find strutils' % a bit of a hassle
14:26:01*xcombelle quit (Quit: Leaving)
14:26:36*xcombelle_ is now known as xcombelle
14:27:09dom96Sahnvour: maybe you would like this package: https://github.com/bluenote10/nim-stringinterpolation/
14:27:37dom96I never used it though
14:27:45dom96bbl
14:35:59renesacand there is strfmt if you like python format syntax
14:36:08renesacand you can simply use concatenation with &
14:42:37Sahnvourrenesac: strfmt looks nice thanks
14:47:12Sahnvourdom96, i don't really know what the source problem is. indexing on enum apparently has no effect here, but initializing the array elements from a function or a type directly yields different error messages
14:51:26dom96Sahnvour: you can s/object/tuple/ for now
14:51:44dom96I'll look into it more later, for now gotta go!
14:52:23Sahnvourno problem
14:52:25Sahnvourthanks
15:01:30*X67r quit (Ping timeout: 272 seconds)
15:02:05*X67r joined #nim
15:03:39*Arrrr joined #nim
15:14:02ArrrrCould anyone explain this to me? http://pastebin.com/B0eyMEsL
15:20:22*gmpreussner|lapt quit (Quit: Leaving)
15:20:47notfowlArrrr you wrote to the string so it made a new one to resize it
15:21:12Arrrrbut i made a string of 16 len, and only wrote 1 byte
15:23:08notfowlArrrr they arent the same string anymore
15:23:21notfowlThey arent equivalent because you modified one kf them
15:24:10notfowlNewstringstream() does the copy
15:24:35Arrrraah, i thought it was using the same
15:24:38*X67r_ joined #nim
15:24:54ArrrrI mean, the first assert passes
15:26:12notfowl== compare by value not identity
15:26:33Arrrrujj
15:26:41*X67r quit (Ping timeout: 252 seconds)
15:27:27ArrrrSo, if i want to avoid this, i have to reassign source to stream.data i suppose
15:29:41notfowlMaybe. I dunno what your goal is
15:30:30ArrrrOk, thank you notfowl.
15:33:03*X67r_ quit (Ping timeout: 244 seconds)
15:34:38*X67r joined #nim
15:38:08*wb joined #nim
15:53:12*dalarmmst quit (Ping timeout: 264 seconds)
16:03:07*wb_ joined #nim
16:05:12*dalarmmst joined #nim
16:06:44*wb quit (Ping timeout: 265 seconds)
16:11:19*X67r quit (Remote host closed the connection)
16:12:16*X67r joined #nim
16:14:54*vendethiel quit (Ping timeout: 250 seconds)
16:19:21*X67r quit (Ping timeout: 250 seconds)
16:19:56*X67r joined #nim
16:23:30*wuehlmaus quit (Quit: Lost terminal)
16:28:08*perturbation joined #nim
16:34:58*vendethiel joined #nim
16:42:46*wuehlmaus joined #nim
16:51:36*darkf quit (Quit: Leaving)
16:57:36onionhammer@Varriount ooh, theres an idea
17:08:34*dalarmmst quit (Ping timeout: 246 seconds)
17:14:43onionhammer@Varriount sublime mousemap:)
17:23:57*jonathon joined #nim
17:26:01*dalarmmst joined #nim
17:33:26*X67r quit (Ping timeout: 244 seconds)
17:34:19*X67r joined #nim
17:47:24reactormonkVarriount, sup
18:10:55*NimBot joined #nim
18:13:35perturbationis there a way to convince the "not nil" checker that a reference type returned from new(TConcreteType) is not nil? Some sort of assertion after new?
18:15:35*NimBot joined #nim
18:15:55Araqcompiler/sempass2.nim already deals with mNew in line 696
18:16:08perturbationwell, I can kind of cheat
18:16:11AraqI wonder why the 'not nil' checker isn't affected by this
18:16:15Araq!lag
18:16:25AraqNimbot is back! :-)
18:16:47perturbationvar shaky: ref TFooType = new(TFooType) # defined the not nil reference type as FooType elsewhere and then do:
18:17:02Araqfix
18:17:04Araqthe
18:17:06Araqchecker
18:17:07Araqinstead!
18:17:10perturbationif not isNil(shaky) actual: FooType = shaky
18:17:14perturbation:)
18:17:16perturbationI'll give it a go
18:18:15perturbationbut I'll probably get stuck somewhere
18:18:20*perturbation starts to read through sempass2.nim
18:20:46Araqsempass2 is actually rather simple if you studied compilers and control flow algorithms before ...
18:21:24onionhammerVarriount it'd be nice if you could help with the idetools thing; Im not enough of a python programmer to figure out why the damn thing hangs when nimsuggest crashes
18:22:05Araqnimsuggest crashes? that's crazy talk
18:23:17perturbationAraq: I haven't studied compilers, though I'd like to learn more... current skill level is maybe good enough to do a simple interpreter. Last time I tried I got too caught up in productions, left-factoring and other craziness to get anywhere
18:23:53Araqoh yeah all this parsing theory that nobody uses anyway
18:24:47Araqquick, is this still LALR(1) or already LR(1)?
18:27:05perturbation:( I read through some tutorials on recursive descent, and that looked understandable. But everyone says that shouldn't be used for 'serious' parsers, though I haven't figured out why... bad worst-case behavior? Pathological behavior?
18:29:23SirCmpwnso this does not work the way I had hoped: https://gist.github.com/SirCmpwn/41338a2c30d2464edef5
18:29:28SirCmpwnis there something I can do to change that?
18:29:52Araqon the contrary, everybody uses recursive decent parsing, perhaps with some modifications for operator precedences etc
18:30:19Araqnobody uses the old LR(1) parsing stuff
18:30:29notfowlSirCmpwn depends on what you were hoping for and what it doesn't do
18:30:35*dalarmmst quit (Ping timeout: 256 seconds)
18:30:50SirCmpwnwell, I didn't want to use a magic string with events.emit("magic string", ...)
18:31:04SirCmpwnso I was hoping to put it elsewhere, one source of truth for the value of that string
18:31:11SirCmpwnthe enums seemed like it'd work for this, but apparently not
18:31:18AraqSirCmpwn: don't use the events module, it's nothing to do with async
18:31:32SirCmpwnasync isn't important here
18:31:38SirCmpwnit's just a means to an end, this isn't a library
18:31:43notfowlThe string value enum is the string representation for that enum value
18:31:54notfowlIt doesnt mean the enum value is a string, its actually 0
18:32:03SirCmpwnis there a way to get it?
18:32:06Araqyou can use $ to turn an enum into its string representation
18:32:08notfowlYes, $
18:32:17SirCmpwnthanks :)
18:42:32*yglukhov quit (Remote host closed the connection)
18:42:39*dalarmmst joined #nim
18:48:18onionhammerAraq yrah i think it also doesnt priperly close the socket when it does too
18:50:50*jonathon quit (Ping timeout: 240 seconds)
18:51:38*NimBot joined #nim
18:52:56SirCmpwnecho("foo: %s" % "bar")
18:53:01SirCmpwn"cannot be called"
18:53:03SirCmpwn?
18:53:47SirCmpwnno, that's now the problem
18:54:59SirCmpwns/now/not/
18:56:19*Sornaensis quit (*.net *.split)
18:56:20*rinukkusu quit (*.net *.split)
18:56:20*SirCmpwn quit (*.net *.split)
18:56:20*reactormonk quit (*.net *.split)
18:56:20*BitR quit (*.net *.split)
18:56:33*SirCmpwn joined #nim
18:56:36*reactormonk joined #nim
18:56:39*rinukkusu joined #nim
18:57:18*Sornaensis joined #nim
18:59:16SirCmpwnokay, this is the problem that's confusing me: https://gist.github.com/SirCmpwn/9cc13a5945e3d2f26c0f
19:01:36*BitR joined #nim
19:02:02Araqyou use the 'do' notation wrong
19:02:20SirCmpwn:(
19:02:41SirCmpwnreplacing it with proc yields the same result, though
19:02:47SirCmpwnlike so: https://sr.ht/844e3.txt
19:03:15*NimBot joined #nim
19:04:00Araqis your clients.events mutable?
19:04:21SirCmpwnhttps://sr.ht/eb47.txt
19:04:40SirCmpwnam I mutating it by using .on?
19:04:50*wb_ quit (Quit: See y'all around)
19:04:59SirCmpwnI have another bit of code elsewhere that doesn't give the same error: https://sr.ht/00a3.txt
19:05:27*pregressive joined #nim
19:09:19Araqwell at this point I need the full program, not snippets
19:09:23SirCmpwnsure
19:09:24*Arrrr quit (Quit: WeeChat 1.2)
19:09:25SirCmpwnone moment
19:10:11SirCmpwnhttps://github.com/SirCmpwn/nimworm/tree/demonstrate-nim-problem
19:10:50*gsingh93 quit (*.net *.split)
19:10:50*Rush quit (*.net *.split)
19:10:50*zama quit (*.net *.split)
19:10:51*jsjoberg quit (*.net *.split)
19:10:51*xxx quit (*.net *.split)
19:10:51*max1 quit (*.net *.split)
19:10:52*bw_ quit (*.net *.split)
19:11:03*bw_ joined #nim
19:11:04*jsjoberg joined #nim
19:11:04*max1 joined #nim
19:11:10*gsingh93 joined #nim
19:11:13*zama joined #nim
19:11:22*xxx joined #nim
19:12:01*RushPL joined #nim
19:13:24Araqugh, 3 files, git clone here I come ...
19:13:39SirCmpwnsorry to burden you with a whole 3 files :P
19:17:08Araqer, how do you expect this to work?
19:17:29*Jesin quit (Quit: Leaving)
19:17:38AraqRawMessageEventArgs != EventArgs
19:17:46Araqand 'on' takes EventArgs
19:17:54Araqthe error message could be better though :P
19:18:47SirCmpwnAraq: I assumed that I could subclass EventArgs so I could pass along additional information to event handlers?
19:18:55SirCmpwnRawMessageEventArgs is "of" EventArgs
19:19:02SirCmpwnperhaps I'm not understanding the type system yet
19:19:26Araqthis is not how the subtyping relation works
19:19:42SirCmpwncan you explain how it does work for me?
19:20:02*Jesin joined #nim
19:20:52AraqA <: B doesn't imply F[A] <: F[B]
19:21:03SirCmpwnyou've already lost me
19:21:12SirCmpwnwhat is <: supposed to be
19:21:34Araqthe subtype relation
19:22:01Araqlong story short
19:22:21Araqthe parameter type needs to be EventArgs but you're free to use a type conversion in the proc's body
19:22:41SirCmpwnand declaring it as RawMessageEventArgs* = object of EventArgs
19:22:44SirCmpwnis correct?
19:22:56Araqwhich performs a runtime check cause what you wrote is not typesound
19:23:13Araqyeah I think so
19:23:58SirCmpwnthis is what I ended up with https://sr.ht/e975.txt
19:24:02SirCmpwnbut this fails to compile as well
19:24:07SirCmpwnexternal program failed
19:24:17perturbationdom96, Araq: incredibly small PR (https://github.com/nim-lang/Nim/pull/3175) for inline images in Forum with rstgen.nim. Took me a lot longer to find cause than I expected, but works now. Tested locally :)
19:24:25SirCmpwnhttps://sr.ht/1fce.txt
19:26:21Araqdon't use cast but a type conversion
19:26:40SirCmpwnhow does that work
19:26:52Araqbut that's a nice codegen bug that you found
19:27:10Araqseriously
19:27:15SirCmpwnyw
19:27:16Araqdon't use fucking events.nim
19:27:24SirCmpwnwell what if I want events :(
19:27:44SirCmpwnmultiple procs registering for a particular thing that happens
19:27:50SirCmpwnbuild it myself?
19:28:08Araq*shrug* I only use events in UIs when I have to
19:28:21Araqthey fuck up control flow
19:28:22SirCmpwnfor this use-case, it seems like a good design
19:28:31SirCmpwnthis is an IRC client module
19:28:42Araqfucking up control flow is never a good design in my opinion
19:28:46SirCmpwnyou create a client object, register for the things you care about (and there are lots of things you may not care about), and then hand over control
19:28:55SirCmpwnI don't think this fucks up control flow
19:31:53Varriount-_-
19:32:08VarriountGood morning!
19:32:12SirCmpwnmorning
19:35:04AraqSirCmpwn: the trick is to not use inheritance but instead the closure's environment. and swoosh you get typesafety for free
19:35:11SirCmpwnhmm
19:35:14SirCmpwnthat's not going to work
19:35:27SirCmpwnbecause the information is in the event emitter and needs to be given to the handler
19:35:32SirCmpwnthey live in different scopes
19:35:44VarriountSirCmpwn: The events module is really old, so you might be better off making something of our own, or tweaking its source code.
19:35:50SirCmpwnyeah, I probably will
19:35:57Araqpretty sure there are mathematical proofs that disagree with you
19:36:03VarriountFor example, it should probably support methods.
19:36:14SirCmpwn...
19:36:20Varriount(runtime dispatch instead of static dispatch)
19:36:34SirCmpwnw/e, I'll mull this over later
19:36:34Varriount(for types)
19:36:45SirCmpwnfriend I never get to hang out with is asking me to hang out, so I'm gonna do that
19:37:07VarriountAh, well then, have a good hangout. :D
19:38:26Araqhrm I wonder if saturated arithmetic at compile time is allowed by the spec
19:38:58VarriountI'd love saturated arithmatic at runtime.
19:39:14Varriount*sigh*
19:39:27Araqcompiler/saturate.nim ?
19:39:39Araq## Saturated arithmetic routines. XXX Make part of the stdlib?
19:40:29VarriountOh! Neat.
19:40:55VarriountCould probably be sped up by intrinsics though. I think I recall GCC having some.
19:41:14Araqfor the stdlib, yeah
19:41:19Araqin the compiler it's meaningless
19:41:39VarriountOh, interesting article: http://locklessinc.com/articles/sat_arithmetic/
19:41:47VarriountBranch free saturated arithmatic
19:41:55Araqah lockless
19:42:01Araqthese guys know their shit
19:42:15VarriountComing from you, that's high praise. :3
19:42:54*xificurC quit (Read error: Connection reset by peer)
19:43:08*yglukhov joined #nim
19:44:56VarriountHello yglukhov!
19:47:30*yglukhov quit (Ping timeout: 260 seconds)
19:54:53perturbationwhat's the best debugging solution right now? I was just using gdb with nim --debugger:native to track down this issue with RST and inline images and it works
19:55:26perturbationbut there's a lot of stuff whenever you go into a proc for stack frames and gc that can make it difficult to tell what's going on
19:55:53perturbation(and using gdb to inspect variables is a bit clumsy unless it's a primitive)
19:56:00Araq--stackTrace:off --debugger:native ?
19:56:39Araqbut iirc --debugger:native should imply stackTrace:off
20:01:28perturbationhmm... it does seem to help. Thanks Araq
20:05:46*xcombelle quit (Quit: Leaving)
20:07:09*jszymanski quit (Quit: computer sleeps...)
20:09:46Araqperturbation: I thought the forum disallows submitting images for spam prevention reasons?
20:10:29perturbation:(
20:11:02perturbationit's one of the open issues (https://github.com/nim-lang/nimforum/issues/41) and it's otherwise allowed in rstgen?
20:11:33perturbationbut if that's the case, I think we should still fix it in rstgen and then disallow that directive in the forum code
20:11:46Araqyeah true
20:17:24*NimBot joined #nim
20:18:11*minus joined #nim
20:22:29Araqping zahary1
20:32:43*NimBot joined #nim
20:40:36*no_name joined #nim
20:40:37*devzerp joined #nim
20:45:21dom96perturbation: nice
20:45:50perturbation:)
20:55:07onionhammerVarriount any thoughts?
21:01:56*jonathon joined #nim
21:02:44jonathonis there any easier way of converting a Unix timestamp to an RFC822 date (for RSS) than this:
21:02:53jonathontimes.format(times.parse($fromSeconds(1438233545), "ddd MMM dd HH:mm:ss yyyy"), "ddd, dd MMM yyyy HH:mm:ss '+'zz'00'")
21:03:07jonathonthat just seems obtuse
21:05:24*xificurC joined #nim
21:06:54Araqseems just right, it's unix. what do you expect? a useful API?
21:07:29Araqmaybe you can pipe it to /usr/bin/tmcnvrt though
21:07:31jonathonGoLang equivalent: time.Unix(1438233545), 0).Format(time.RFC1123Z)
21:07:35jonathon:)
21:08:00jonathonI'm porting an RSS generator I wrote in Go to Nim to see how they compare
21:08:30Araqmaybe you also compare the money that went into both systems :P
21:08:31jonathonmost of the parts are far more concise in Nim, but 'times' is not a handy library
21:08:34jonathon:P
21:08:46Araqhint: for Nim this number is close to 0.
21:09:11jonathonI'm not complaining, it's just when I write something like that I think I'm doing something wrong...
21:09:20jonathonit just looks so inelegant
21:10:02Araqyou can always PR times.nim
21:10:23jonathonI might make that a project
21:10:36jonathon;)
21:11:17*NimBot joined #nim
21:13:48jonathonah, getGMTime looks to work better:
21:13:49jonathontimes.format(times.getGMTime(fromSeconds(1438233545)), "ddd, dd MMM yyyy HH:mm:ss zz'00'")
21:14:05jonathonrelatively happy with that
21:16:58jonathonhmm... looks like another bug there too... with getLocalTime, ZZZ == BST, z == 0, which is wrong, should be +1.
21:16:59Varriountonionhammer: On the tooltip? As I said, I don't think there's a way we could display on mouseover. The best that could be done is on double-click.
21:17:12onionhammerVarriount no i meant about the crashing issue
21:17:19onionhammerI got it to work on ctrl+click
21:17:35onionhammerbut I think nimsuggest crashing = sublime crashes
21:17:47onionhammernot sure how to fix it so i wondered if u could take a look.. if u can get it to work at all
21:18:26Varriountonionhammer: You know me 'fixing' it would probably mean rewriting it.
21:18:53onionhammerha, knock yourself out...
21:27:40*mal`` quit (Ping timeout: 265 seconds)
21:29:10dom96jonathon: const RFC1123Z = "ddd, dd MMM yyyy HH:mm:ss '+'zz'00'"
21:29:34*yglukhov joined #nim
21:29:52Varriountonionhammer: Your use of staticmethods is killing me.
21:30:47*NimBot joined #nim
21:31:25dom96jonathon: getGMTime(fromSeconds(1438233545)).format("ddd, dd MMM yyyy HH:mm:ss zz'00'")
21:31:40dom96hrm, nimbot seems to be reconnecting a lot
21:33:09*NimBot joined #nim
21:33:31dom96interesting: https://gist.github.com/dom96/3a72afdcf43e6d1dbb04
21:34:05*yglukhov quit (Ping timeout: 252 seconds)
21:36:44jonathondom96: thanks :)
21:36:56*mal`` joined #nim
21:41:20*pregressive quit (Remote host closed the connection)
22:13:14Sahnvourdom96: about my earlier problem on const arrays. i made you a gist if you wanna look into it https://gist.github.com/Sahnvour/9fb9ef23acbe2b435d40
22:24:03*Sahnvour quit (Quit: Leaving)
22:31:40*unclechu quit (Remote host closed the connection)
22:45:27*Trustable quit (Quit: Leaving)
22:48:38*jonathon left #nim (#nim)
22:56:32*Demos joined #nim
22:58:06*pregressive joined #nim
23:22:55*alpaca joined #nim
23:24:51*NimBot joined #nim
23:33:33*X67r quit (Quit: leaving)
23:34:09alpacahi, everyone! I'm trying to find a way to make documentation for code, generated with macros by `nim doc2`
23:36:08alpacai found usage of <CommentStmt>.comment property inside compiler/docgen, but i did not found any way to set this property inside my macro
23:36:44Varriountalpaca: Could you show us your macro's code?
23:37:13alpacais there any documented/proper/tricky way to set it, so `nim doc2` will produce doc with proper comment text
23:38:18Varriountalpaca: Well, the proper way would be to add the appropriate node to the macro's output?
23:38:24Varriounter 'output.'
23:39:41alpacahttps://gist.github.com/alpacagh/f3b6728d3b839fce01a8 gist
23:41:01alpacait's a rewite of second tutorial's last example to use a single constant tuple instead of multiple constants
23:46:00Varriountalpaca: It looks like there isn't a way to modify doccomments yet, sorry,
23:48:09alpacafrom compiler/docgen.nim:152 it looks like there is a `comment` property inside of a node (kind=nkCommentStmt) (i did not dig deep enough to find it's definition), but macros.nim::NimNodeObj has no such property
23:48:12Araqalpaca: yeah I think that part is not yet exposed
23:48:14Araq*however*
23:48:23Araqif you can generate the doc comment
23:48:45Araqyou can also write the documentation in a way that doesn't treat me like an idiot ;-)
23:49:07Araqproc getFoo(): Foo
23:49:15Araq ## Gets the Foo.
23:49:27Araqseriously? ;-)
23:49:55alpacaAraq: well, it would be too simple and give me nothing in terms of nim-knowledge )
23:50:43Araqso instead just do something like ## Trivial setters and getters are not documented. Perhaps -- as a Nim programmer -- you can actually read Nim's signatures.
23:52:03alpacaalso, if i'll try to use class-helper macro from by-example tutorial, that could make impossible to doc-comment on class-type itself
23:52:54Araqyeah that's a very good point
23:53:00Araqso add this feature, it's not hard
23:58:46*vendethiel quit (Ping timeout: 246 seconds)
23:59:11alpacaAny hint where to find a NimNode definition?