<< 09-05-2016 >>

00:05:54*kseg joined #nim
00:24:01*derka joined #nim
00:32:03*derka quit (Ping timeout: 240 seconds)
00:34:43*yglukhov_ quit (Remote host closed the connection)
00:35:40*derka joined #nim
00:41:45*fastrom quit (Quit: Leaving.)
01:01:46*derka quit (Quit: derka)
01:02:11*derka joined #nim
01:02:43*derka quit (Client Quit)
02:00:39*chemist69 quit (Ping timeout: 260 seconds)
02:13:47*chemist69 joined #nim
02:17:56*PMunch quit (Ping timeout: 276 seconds)
02:25:41*rgv151 joined #nim
02:26:04*rgv151 quit (Client Quit)
02:33:12*kseg quit (Quit: kseg)
02:36:25*nande quit (Remote host closed the connection)
02:51:21*kseg joined #nim
02:52:08*brson quit (Quit: leaving)
03:19:02*Varriount quit (Ping timeout: 276 seconds)
03:28:45*space-wizard joined #nim
04:00:04*kseg quit (Quit: kseg)
04:23:26*kseg joined #nim
04:24:35*kseg quit (Client Quit)
04:44:50*kseg joined #nim
04:45:26*silven quit (Ping timeout: 244 seconds)
04:46:08*silven joined #nim
05:02:33*space-wi_ joined #nim
05:02:45*space-wizard quit (Ping timeout: 246 seconds)
05:03:08*space-wi_ quit (Max SendQ exceeded)
05:03:39*space-wizard joined #nim
06:17:06*endragor joined #nim
06:43:05*space-wizard quit (Quit: My Mac has gone to sleep. ZZZzzz…)
07:23:11*chemist69 quit (Quit: WeeChat 1.4)
07:24:57*chemist69 joined #nim
07:35:08*Trustable joined #nim
07:47:42*derka joined #nim
07:50:22*gokr joined #nim
08:00:53*Arrrr joined #nim
08:00:53*Arrrr quit (Changing host)
08:00:53*Arrrr joined #nim
08:06:35*kseg quit (Quit: kseg)
08:07:12*yglukhov joined #nim
08:11:45*yglukhov quit (Ping timeout: 265 seconds)
08:12:53Araq_hey #nim! I'm alive.
08:13:08Araq_had no internet for my holidays, how refreshing.
08:23:47ArrrrDid you come with new ground-breaking ideas?
08:27:05nsf:P
08:31:42Araq_I only improved the debugging support a little and worked a bit on the GC
08:32:01*kseg joined #nim
08:32:21Araq_and wrote a parser generator, but I'm not that pleased with its results for now
08:41:30*derka quit (Ping timeout: 246 seconds)
08:41:52*derka joined #nim
08:52:26*derka quit (Quit: derka)
08:55:08*Demon_Fox quit (Quit: Leaving)
09:00:22*fastrom joined #nim
09:01:09Arrrrtypical holydays entertainment
09:03:44*GangstaCat quit (Quit: Leaving)
09:10:52*GangstaCat joined #nim
09:17:41*yglukhov joined #nim
09:22:18*yglukhov quit (Ping timeout: 250 seconds)
09:33:21*yglukhov joined #nim
09:37:59*yglukhov quit (Ping timeout: 276 seconds)
09:43:29dom96Nim in Action is 50% off today, discount code is dotd050916au: https://manning.com/books/nim-in-action?a_aid=niminaction&a_bid=78a27e81 :)
09:56:44pigmejbtw dom96 how is selling going ?
10:01:33*kseg quit (Quit: kseg)
10:03:01*kseg joined #nim
10:03:51*kseg quit (Client Quit)
11:00:41*chemist69 quit (Ping timeout: 250 seconds)
11:06:03*chemist69 joined #nim
11:23:39*chemist69 quit (Ping timeout: 250 seconds)
11:30:27*chemist69 joined #nim
11:53:11*vendethiel quit (Ping timeout: 276 seconds)
11:53:16*vendethiel- joined #nim
12:02:05dom96pigmej: It's selling pretty well I think. Although I'm not entirely sure what is considered good for a programming book to be honest :)
12:02:57pigmejwell, below/above your expectaions ?
12:13:55dom96definitely above
12:14:45*mal`` quit (Quit: Leaving)
12:17:30*elrood joined #nim
12:47:16*mal`` joined #nim
13:03:13*BitPuffin joined #nim
13:25:27*gokr quit (Ping timeout: 265 seconds)
13:28:05*chemist69 quit (Ping timeout: 276 seconds)
13:31:30*chemist69 joined #nim
13:33:00*JohnS_ quit (Ping timeout: 250 seconds)
13:39:19*lubos_cz joined #nim
13:52:37onionhammerAraq_ yay parser generator!
13:53:06onionhammernim parser rewrite incoming :P
13:53:33Araq_well as I said, I'm not pleased with its results. I like it better than pegs though.
13:54:05onionhammeris it macro based or does it spit out code to files?
13:54:17Araq_macro based, of course.
13:54:21onionhammernaturally
13:55:51Araq_at the end I always like my hand-written recursive decent parsers best.
13:55:55Araq_*in the end
13:56:15Araq_it's so hard to come up with a good parser generator.
13:56:16onionhammerwell, you could always write a DSL for that
13:56:24Araq_that's what I did.
13:56:40Araq_but hmm meh ;-)
13:56:58onionhammeri like the idea of parser generators though
13:57:08onionhammereven if they can be kinda diffiult in practice to get the grammar right
13:57:18onionhammerand difficult to generate code you like
13:57:24onionhammeryou're not supposed to look at the code :)
13:58:07Araq_I tried to implement a toy Python parser with my new DSL.
13:58:19onionhammerat the end of the day you have a nice grammar thats easy to see rules on, whereas I feel like its often less clear to grok w/ recursive descent parsers
13:58:23Araq_so somebody can turn this into a python2nim project :Ü
13:59:47Araq_but even with parser generators or macro based DSLs it's still not doable with a few minutes of work, so I'm not happy
14:00:32onionhammerdoes it generate a LALR parser?
14:01:33Araq_ifStmt ::= 'if' expr ':' expr ('elif' expr ':' expr)* ( 'else' ':' expr)? # ok, so you can write something like this now:
14:01:57onionhammerooh
14:02:20onionhammerdid you not like that syntax, the output, or how your macros were written? :P
14:02:20Araq_"if", expr, ".", expr, *("elif" expr) ... # write it in Nim syntax
14:02:38onionhammeroh
14:02:47onionhammerthe 1st is what you wanted the 2nd is what you ended up with?
14:03:04*saml joined #nim
14:03:07Araq_no, the 2nd is what I have right now, kind of
14:03:18onionhammeryou should try my approach; triple quoted strings around the code ;)
14:03:19Araq_and the problem is that both are severely lacking
14:03:32onionhammerthen udont have to worry about nims lexer/parser getting in the way :P
14:03:35Araq_since they don't do AST construction
14:04:14Araq_so instead you have something like:
14:04:51Araq_if input.matches("if", expr as cond, ":", expr as action, ...):
14:05:00Araq_ result = newIfStmt(cond, action)
14:05:50Araq_you can automate the AST construction too but then the AST is somewhat inflexible
14:06:15Araq_and the DSL is even more messy
14:07:36onionhammerlet ast = AST""" ifExpr 'if' expr ':' expr { If($1,$2) } """
14:07:57onionhammerwell, $1,$4
14:08:00onionhammeryou get the idea
14:08:05Araq_but then you have numbers instead of names.
14:08:11Araq_that's a step backwards :P
14:08:14onionhammerlol
14:08:29onionhammerwell you could invent syntax to name them
14:08:44Araq_I used Nim's binary 'as' operator instead :P
14:08:45onionhammer'if' (myExpr:expr) ':'
14:09:02onionhammerthen If($myExpr) in the construction
14:09:47onionhammeris as new? lol i dont remember that one :)
14:10:09Araq_no, it's quite old but was never used for anything until I read the spec one day :P
14:10:15onionhammerlol
14:10:18onionhammeri like it
14:10:30onionhammerreminds me of the C# 6 proposal that never got in
14:11:36Araq_I started with the triple string idea btw, but then you implement a parser for your parser generator
14:11:46onionhammerlol, yeah
14:11:55onionhammeryou could use the parser generator for the parser generator though
14:12:31Araq_that way they figured out yacc cannot be parsed by yacc
14:12:35Araq_;-)
14:12:46onionhammerlol
14:13:34Araq_and after AST construction, you want general AST transformations to ease code generation tasks
14:14:02Araq_after a few iterations they came up with ML as a "meta language" to do these tasks
14:14:43Araq_with builtin sum types and pattern matching.
14:15:20onionhammeri wish nim was an ML
14:15:22onionhammersorry :P
14:16:00Araq_no worries.
14:16:07onionhammeri'm smitten with F#
14:16:29Araq_but ML is not the productivity booster that I am seeking
14:16:37onionhammerthey had to make compromises though, to get it to interop with .net
14:16:43*PMunch joined #nim
14:16:51onionhammerand to just work on top of .net
14:17:26onionhammerdifferent goals, it's understandable. I still have a very soft sport in my heart for Nim, and try to keep up with developments obviously (since im here :))
14:20:34Araq_anyway, the example is still toyish since the 'elif' shall be on the same column as the 'if' for an identation based language
14:21:11Araq_and now watch 90% of the parser generators explode with this additional requirement
14:21:54Araq_and even if your language is not indentation based, maybe you want to emit a warning in the case the columns don't match?
14:23:34Araq_what's the syntax for that? ifStmt ::= 'if'(pushInd) expr ':' expr ('elif'(sameInd) expr ':' expr)*
14:23:55Araq_lovely now we have immediate actions after single tokens to guide the parsing process
14:25:14flyxheh, which parsers are able to emit such a warning for non-indentation-based languages? the only one I know of is GNAT.
14:26:31Araq_indeed only GNAT comes to mind. :-)
14:33:15arnetheduckhey Araq_, what's the plan on forward declarations?
14:33:47Araq_I have a branch where all sort of things work without including recursively dependent modules
14:34:01Araq_*without forward decls
14:35:07arnetheduckbut..?
14:35:29Araq_but I don't see it producing a workable Nim anytime soon so I intend to merge it but under .noforward: on
14:36:23Araq_so things continue to work until one day we can make .noforward the default
14:36:55*yglukhov joined #nim
14:37:49arnetheduckok nice. then I won't bother fixing the few forward-declaration dependent tests that currently seem to fail in nlvm ;)
14:39:20Araq_er...
14:39:52Araq_but it sounds interesting to look into
14:40:08Araq_why would nlvm fail with forward decls?
14:41:16*yglukhov quit (Ping timeout: 252 seconds)
14:41:54*Arrrr quit (Ping timeout: 260 seconds)
14:42:35arnetheduckbecause it schedules functions for compilation differently than the c gen
14:44:00arnetheduckthe c gen does an extra pass to try to compile body-less functions once more after it's done compiling everything.. i'd expect that oddity to go away if the compiler is fixed to not require forward delcs
14:45:24*novavis joined #nim
14:46:52arnetheduckthis: https://github.com/nim-lang/Nim/blob/devel/compiler/cgen.nim#L1313
14:50:56*novavis quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
14:51:17*pregressive joined #nim
15:04:15*yglukhov joined #nim
15:09:21*Arrrr joined #nim
15:09:21*Arrrr quit (Changing host)
15:09:21*Arrrr joined #nim
15:28:51*lubos_cz quit (Quit: Leaving)
15:29:07*lubos_cz joined #nim
15:29:32*lubos_cz quit (Remote host closed the connection)
15:29:51*lubos_cz joined #nim
15:41:36*gokr joined #nim
15:43:58*endragor_ joined #nim
15:47:34*endragor quit (Ping timeout: 240 seconds)
15:48:09*endragor_ quit (Ping timeout: 246 seconds)
15:49:58*gokr quit (Ping timeout: 265 seconds)
15:53:17*arnetheduck quit (Ping timeout: 260 seconds)
16:05:59*jivank quit (Quit: WeeChat 0.3.8)
16:06:29*chemist69 quit (Ping timeout: 260 seconds)
16:06:53*jivank joined #nim
16:13:13*chemist69 joined #nim
16:27:07*gokr joined #nim
16:37:37*space-wizard joined #nim
16:43:22*gokr quit (Read error: Connection reset by peer)
16:47:32flyxI still found no solution for „template/macro instantiation too nested“
16:47:48flyxis this just some arbitrary compiler constraint?
16:50:14*brson joined #nim
16:54:08dom96flyx: perhaps, can you paste the code?
17:01:16*yglukhov_ joined #nim
17:01:17*yglukhov quit (Read error: Connection reset by peer)
17:02:31flyxdom96: well it's NimYAML. I can commit it to some branch
17:03:02dom96go for it
17:04:05flyxhttps://github.com/flyx/NimYAML/tree/variant-objects
17:04:07flyxnim c test1
17:04:09*yglukhov_ quit (Remote host closed the connection)
17:09:10*yglukhov joined #nim
17:13:43*yglukhov quit (Remote host closed the connection)
17:19:02dom96flyx: hrm, strange restriction
17:19:15dom96Perhaps worthy of a bug report. Araq_ can you take a look?
17:30:16*space-wizard quit (Quit: My Mac has gone to sleep. ZZZzzz…)
17:33:30*space-wizard joined #nim
17:35:23flyxcreated an issue: https://github.com/nim-lang/Nim/issues/4138
17:36:10*silven quit (Ping timeout: 252 seconds)
17:36:37*silven joined #nim
17:37:33*space-wizard quit (Ping timeout: 240 seconds)
18:14:17*gokr joined #nim
18:22:59*chemist69 quit (Ping timeout: 260 seconds)
18:26:57*chemist69 joined #nim
18:34:25Araq_flyx: your fastparse uses templates like no tomorrow
18:34:52*zaquest quit (Ping timeout: 260 seconds)
18:34:58Araq_and I cannot even imagine what the expansion looks like
18:35:19Araq_it's bad for the code cache, it's bad for the CPU, it's bad for the compiler. :-)
18:35:28Araq_use more procs.
18:36:54flyxI know
18:37:47*zaquest joined #nim
18:37:54flyxoriginal problem was that I cannot use yield statements in sub-procs
18:37:59flyxbut I kinda overused templates
18:39:54*brson quit (Ping timeout: 260 seconds)
18:41:16flyxI didn't know it has performance implications
18:41:17*brson joined #nim
18:41:36flyxis this the reason for my issue?
18:46:46Araq_well the compiler doesn't expand endlessly, there is a limit
18:46:59Araq_not sure where it is, I never hit it :P
18:47:03*bozaloshtsh quit (Ping timeout: 276 seconds)
18:48:58flyxbut most template in fastparse expand into the proc parse. the error is elsewhere, so templates in fastparse shouldn't be a problem…
18:50:03flyxis instantiating generics also considered template expansion?
18:55:13Araq_good question, I think that got its own counter
19:04:49*Arrrr quit (Quit: WeeChat 1.4)
19:40:43*BitPuffin quit (Read error: Connection reset by peer)
19:50:27*pregressive quit (Read error: Connection reset by peer)
19:50:51*pregressive joined #nim
20:01:32*yglukhov joined #nim
20:06:08*yglukhov quit (Ping timeout: 244 seconds)
20:07:59dom96Araq_: What is that pragma that fills in variable/field names for you? Like `using renderer: blah = 123` -> `renderer.blah`
20:08:12dom96or did that never make it into the language?
20:09:25Araq_dom96: 'using' now has different semantics, but you can use {.this: self.}
20:09:47Araq_and then blah = 123 is rewritten to self.blah = 123
20:09:55dom96cool
20:09:57Araq_kind of like in Java.
20:10:00dom96what does 'using' do?
20:10:08cheatfateinteresting currently async implementation can register socket for reading and writing but needs only one operation to pass through
20:10:24Araq_it shortcuts parameter decls for non-templates ...
20:10:31Araq_using
20:10:34Araq_ p: Parser
20:10:39Araq_proc foo(p) = ...
20:10:44Araq_proc bar(p) = ...
20:10:51Araq_proc yetanother(p) = ...
20:11:07Araq_for some reason I'm very proud of this feature.
20:11:45Araq_I call it poor-man's type inference.
20:11:58dom96So this documentation is outdated? http://nim-lang.org/docs/manual.html#statements-and-expressions-using-statement
20:12:10Araq_yup
20:12:20Araq_devel has an up-to-date version though
20:13:06Araq_oh I remember why I'm proud: No other language has that feature, it's my very own invention.
20:14:13dom96hrm, so it's a per-module thing.
20:14:33dom96Wouldn't it make sense to make it so that the procs that want the effect need to be indented under the 'using'?
20:15:00*yglukhov joined #nim
20:15:22Araq_maybe but I dislike indented procs
20:19:34*yglukhov quit (Ping timeout: 244 seconds)
20:24:27*JStoker quit (Ping timeout: 250 seconds)
20:25:08*bozaloshtsh joined #nim
20:25:32dom96Araq_: This should output (x: 0, y: 0) right? https://gist.github.com/dom96/ba9b6e12bb2d82fb7e0f4226c2187798
20:25:58dom96in both the C backend and JS backend
20:27:19*JStoker joined #nim
20:27:57Araq_0, 0
20:29:13Araq_add needs to call the deepcopy, hmmm
20:29:21Araq_surely a JS codegen bug
20:30:39dom96https://github.com/nim-lang/Nim/issues/4139
20:30:51dom96indeed looks like it
20:31:09dom96I checked the generated source code, when assigning to a new var `nimCopy` is called.
20:31:25dom96Not called when adding to a seq though
20:32:44dom96Do we have tests for the JS backend yet?
20:32:53gokrAraq_: Did you ever skim how PetitParser works? http://www.lukas-renggli.ch/blog/petitparser-1
20:33:37Araq_dom96: yup, we have a few tests and Yuri is adding more
20:33:40gokrAraq_: Saw you are talking at Polyconf
20:34:03gokrA friend of mine wondered if I wanted to go there with him and his collegue
20:34:11dom96Araq_: awesome
20:41:04Araq_gokr: cool :-)
20:41:49Araq_PetitParser is interesting, but I'm not even sure my goals are achievable.
20:41:51gokrNot sure if I can, but the conf sounded fun
20:42:32gokrI can only say that... PetitParser is clearly the most usable such generator I have ever used. Very easy to organically grow a parser.
20:42:51Araq_I envision something where I can create a toyish Python to Nim converter in an afternoon. parsing is only a part of the problem
20:43:56gokrBtw, is wxNim going places? I also stumbled on that libui thing which... looked kinda nice, but... small project, no idea if its around next year.
20:44:18gokr"going places" as in... "used by someone"?
20:44:34Araq_not that I'm aware of :-)
20:44:39gokrHehe
20:44:43gokrDid you see libui?
20:44:54Araq_yeah, looks nice.
20:45:32Araq_in fact, we have a wxNim alternative/competitor that's planned for an upcoming project
20:45:42Araq_well it's still Nim and wxWidgets
20:45:43gokrI am getting itchy trying to make some kind of UI for Spry soon
20:45:55gokrAh, some kind of abstraction on top?
20:45:57Araq_but a different wrapper, not written by me
20:46:53Araq_abstraction on top? well it supports Nim's strings and closures, so I think that does count
20:47:02gokrIn Squeak a few years back we realized that most tools in the IDE were built with a certain smallish subset of widgets/combos. So an abstraction layer was created to make the tools work in different UI toolkits.
20:47:17dom96we just need to wrap webkit just like Node did.
20:47:33dom96In fact, with Nim's JS backend it might work very well.
20:47:55gokrAt work we use Electron now (Evothings) but... I dunno. There still isn't any real good UI library AFAICT.
20:48:18gokrAtom and VSCode both look darn nice, but... the UI stuff is not available separately as a good UI toolkit.
20:48:52gokrBtw, VSCode is... one of the more freaky things IMHO. Who would have thought!
20:50:57gokr(VSCode being the MIT licensed, Electron built, light weight IDE by ... (drum roll) Microsoft!)
20:51:04gokrI almost thought it was 1st april.
20:51:50dom96Indeed. Electron is simply "good enough".
20:52:02dom96Every time Atom is mentioned I see people complaining about how slow it is
20:52:18dom96Doesn't stop millions (probably) from using it.
20:52:37dom96But hey, what do I know, I'm still using Aporia :)
20:52:39gokrJavascript is eating the world.
20:52:50gokrYou know, I use Aporia too - even for non Nim files :)
20:52:59gokrAnd gedit ;)
20:53:05dom96ooh, awesome.
20:53:20dom96I recently spent days getting it to work nicely on OS X.
20:53:25dom96It was painful to say the least.
20:53:30dom96But it works very well now.
20:53:40dom96and looks acceptable as well :)
20:53:41gokrFor Spry IDE I was also thinking that I could use Aporia as a starter.
20:54:00dom96The biggest PITA was compiling GTK+ on OS X.
20:54:05gokrHehe, yeah.
20:54:18gokrHomebrew is a saver though.
20:54:48dom96yes, but I wanted an app bundle which I could distribute.
20:54:55gokrI can't really understand why so many devs love OSX. I mean... it's not really comfy.
20:54:58dom96The binaries that Homebrew produced weren't good enough.
20:55:54dom96Personally I bought a MacBook because I couldn't find any Windows/Linux laptops that were of the same quality, plus I got a huge student discount.
20:56:06gokrI just love my Lenovo :)
20:56:15dom96OS X isn't bad enough to warrant installing Windows on my MBP.
20:56:53dom96In fact, I can even stream GTA 5 from my desktop to my MacBook and it works incredibly well thanks to Steam.
20:57:00Araq_dom96: merged my PRs? :P
20:57:31dom96Araq_: I will once I am ready to release a new Aporia
20:57:46gokrBtw, did an insane thing the other day - made the Spry AST "lossless" so it actually keeps comments and formatting around.
20:58:03dom96Nim used to do that IIRC
20:58:13Araq_yup.
20:58:19Araq_it wasn't really successful
20:58:20gokrI would like to experiment in the direction of "hey ma, no source!"
20:58:31Araq_but maybe I just did it wrong.
20:58:51Araq_that said, IMHO there should only be the AST.
20:58:57gokrWell, for Spry it may be more interesting - since ... homoiconicity etc.
20:59:01gokrYeah! :)
20:59:08Araq_"hey ma, no source!" is exactly the right thing.
20:59:23Araq_look at how mathematica does it.
20:59:25gokrSmalltalk got close but never went the last mile.
20:59:31Araq_still the best thing in the world
20:59:37Araq_and unknown.
21:00:14gokrSince Spry is aiming at live coding etc - it feels natural.
21:01:05*yglukhov joined #nim
21:05:33*yglukhov quit (Ping timeout: 240 seconds)
21:11:34*GangstaCat quit (Ping timeout: 260 seconds)
21:23:58*fastrom quit (Quit: Leaving.)
21:50:10*zxtx joined #nim
21:53:55*elrood quit (Quit: Leaving)
21:56:38*GangstaCat joined #nim
22:01:13*libman joined #nim
22:07:39cheatfatedom96, i think async can working wrong on more complex protocols (like many read/send in one socket)
22:09:14cheatfatesingle proc can register both operations in one future... and write operations becomes ready if no data available so it can make writes while no data received
22:14:32*pregressive quit (Remote host closed the connection)
22:15:06*pregressive joined #nim
22:20:15*pregressive quit (Ping timeout: 276 seconds)
22:27:02*Trustable quit (Remote host closed the connection)
22:40:50*Demon_Fox joined #nim
22:47:33*gokr quit (Ping timeout: 240 seconds)
23:09:21*Demon_Fox quit (Remote host closed the connection)
23:12:52*Demon_Fox joined #nim
23:26:31*nande joined #nim
23:41:35*bozaloshtsh quit (Ping timeout: 244 seconds)