<< 05-02-2016 >>

00:02:53*Demon_Fox joined #nim
00:25:47*Matthias247 quit (Read error: Connection reset by peer)
00:28:51*lompik joined #nim
00:42:49*NimBot joined #nim
00:45:51ephjahm, the error message when removing one of the parameters is: "invalid indentation"
00:48:12*Demon_Fox joined #nim
01:16:24*mahasamoot quit (Ping timeout: 256 seconds)
01:17:25*jaco60 quit (Ping timeout: 260 seconds)
01:25:48*desophos quit (Ping timeout: 272 seconds)
01:44:10*low-profile quit (Ping timeout: 256 seconds)
01:47:04*low-profile joined #nim
01:54:04*jck quit (Ping timeout: 250 seconds)
02:11:46*Trustable quit (Remote host closed the connection)
02:27:48*ludocode quit (Ping timeout: 248 seconds)
02:28:27*jck joined #nim
02:39:04*ludocode joined #nim
02:42:32*pregressive joined #nim
02:46:05*gokr quit (Ping timeout: 260 seconds)
02:49:58*filwit quit (Quit: Leaving)
03:01:45*oio joined #nim
03:02:13*oio quit (Client Quit)
03:06:16*FreezerburnV quit (Ping timeout: 252 seconds)
03:13:30*brson quit (Ping timeout: 260 seconds)
03:26:48*lompik quit (Ping timeout: 252 seconds)
03:40:55*ephja quit (Ping timeout: 245 seconds)
03:58:58*mountaingoat quit (Ping timeout: 240 seconds)
03:59:03*desophos joined #nim
04:27:22*mountaingoat joined #nim
04:30:17*pregressive quit (Remote host closed the connection)
04:32:30*Earthling joined #nim
04:32:44Earthlinghello
04:33:27EarthlingI tried to register on the forum, and it never sent me the e-mail to do the confirmation. Who can I contact to fix this?
04:38:51*pregressive joined #nim
04:45:34*vendethiel joined #nim
04:57:37*brson joined #nim
04:59:31*pregressive quit (Remote host closed the connection)
05:05:29*s4 joined #nim
05:08:26*vendethiel quit (Ping timeout: 240 seconds)
05:15:24*Earthling quit (Ping timeout: 252 seconds)
05:21:15*BitPuffin|osx quit (Ping timeout: 240 seconds)
05:28:50*StarBrilliant quit (Quit: ZNC - http://znc.in)
05:44:20*endragor joined #nim
05:46:40*vendethiel joined #nim
06:03:55*bjz joined #nim
06:04:58*qazwsx_ joined #nim
06:07:55*bjz quit (Ping timeout: 240 seconds)
06:10:22*dashed quit (Quit: Connection closed for inactivity)
06:28:15*vendethiel quit (Ping timeout: 240 seconds)
06:42:53*warkid joined #nim
06:47:42*qazwsx_ quit (Quit: qazwsx_)
06:52:07*vendethiel joined #nim
07:29:22*dashed joined #nim
07:31:45*vendethiel quit (Ping timeout: 245 seconds)
07:35:28*filcuc joined #nim
07:44:14*arnetheduck joined #nim
07:56:46*endragor quit (Ping timeout: 250 seconds)
07:59:55*gokr joined #nim
08:01:45*Ven joined #nim
08:05:14*Demon_Fox quit (Quit: Leaving)
08:10:01*endragor joined #nim
08:14:42*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:15:24*darkf joined #nim
08:18:00*yglukhov joined #nim
08:37:31*jaco60 joined #nim
08:41:50*jaco60 quit (Ping timeout: 250 seconds)
08:42:49*gour joined #nim
08:46:03*warkid quit (Ping timeout: 252 seconds)
08:47:08*warkid joined #nim
08:49:09Araqearthling: dom96
08:55:42*vendethiel joined #nim
08:57:00*brson quit (Ping timeout: 250 seconds)
08:59:31*Ven joined #nim
09:03:53arnetheduckAraq, any plans for the standard library with regards to platform specific stuff? ie try to reimplement everything using a standard interface or provide thin wrappers to platform code?
09:05:48arnetheduckie java does everything the java way, while for example rust has a libc library wrapper which exposes as much as possible of the native libc as available on each platform
09:08:42Araqwe have posix.nim and iirc linux.nim (as a nimble package?) as well extensive windows api wrappers
09:09:09Araqbut the stdlib is the stdlib, it tries to provide a most convenient Nim interface
09:16:45*vendethiel quit (Ping timeout: 245 seconds)
09:20:51*BlaXpirit quit (Quit: Bye)
09:21:26*BlaXpirit joined #nim
09:23:16arnetheduckok.. I see some code in for example posix.nim which does something like if nimscript: const a = 100 else: var a: { importc, header: xxx.h }.. you mentioned in the llvm thread that you'd be open to header deps in the std lib, was it this kind of code you were referering to?
09:26:43arnetheducker, ansi_c.nim
09:32:23*BlaXpirit quit (Quit: Bye)
09:33:21*BlaXpirit joined #nim
09:34:56*Skrylar joined #nim
09:36:27*Giro joined #nim
09:38:01GiroJoin
09:38:10*Giro quit (Client Quit)
09:52:41*coffeepot joined #nim
09:58:09*Trustable joined #nim
09:58:19*vendethiel joined #nim
09:59:54*brson joined #nim
10:00:33veganskAraq, hi! What do you think about including => and -> macros in system module? Maybe the time has come to treat them as a standard language constructions? :-)
10:01:03Araqarnetheduck: yeah
10:01:23Araqvegansk: yes for '->', not sure I like => all that much
10:03:07veganskNo no! Do not throw `=>` away, it will kill my code :-)
10:04:16veganskAraq, what do you prefer instead of `=>` ?
10:05:55*derka joined #nim
10:07:20Araqanon procs if I need a proc, otherwise I use oldschool for+if+break
10:07:35*brson quit (Ping timeout: 245 seconds)
10:09:01Araqwhich is just much more ergonomic, 3 concepts rather than 12 ? (filter, map, groupby, flatmap, join, repeat, ... )
10:11:21AraqFP is overrated :P just like OO was back in the days. nothing beats imperative code. ymmv
10:13:56veganskSuch a `holy war` theme :-)
10:20:58*vendethiel quit (Ping timeout: 272 seconds)
10:22:21veganskAraq, but it doesn't mean that it is not allowed to use Nim for functional programming. We already use Nim as a FP language in production, rewriting peaces of c++ code.
10:22:51Araqof course not, Nim contains much more than just my personal preferences
10:23:35Araqplus the foundations for '=>' have to be in the language anyway for lots of other reasons
10:23:44veganskSo, maybe I'll make a PR with both of them? :-)
10:24:43Araqkeep in mind that system.nim shouldn't import macros.nim, so you have to patch the compiler to move -> and => out of the future module
10:25:48veganskOk, I'll try :-)
10:27:27*desophos quit (Read error: Connection reset by peer)
10:28:02Araqbut since both macros.nim and the compiler essentially use the same API, it shouldn't require too much thinking :-)
10:32:30*Skrylar quit ()
10:36:32*Ven quit (Ping timeout: 252 seconds)
10:37:41*vegansk left #nim ("Ухожу я от вас (xchat 2.4.5 или старше)")
10:41:26*vegansk joined #nim
11:04:11*Ven joined #nim
11:13:54*NimBot joined #nim
11:21:09*warkid quit (Ping timeout: 252 seconds)
11:24:52*Gonzih joined #nim
11:25:30*Sornaensis joined #nim
11:25:33*Roin joined #nim
11:29:54*brson joined #nim
11:34:37*derka quit (Quit: derka)
11:37:37*yglukhov joined #nim
11:38:45*vendethiel joined #nim
11:39:02*vegansk quit (Quit: Ухожу я от вас (xchat 2.4.5 или старше))
11:39:22*vegansk joined #nim
11:50:37*derka joined #nim
11:55:29arnetheduckwhat would the best way be to express "unless already defined"? ie what I'm after is a fallback - for example on linux, sigusr1 has value 10, so in linux.nim, I'd like to put const SIGUSR1 = 10.. then, in posix,nim, I'd like to say, "if SIGUSR1 is not defined, use var SIGUSR1 value from signal.h".. that way, for implemented platform one avoids a dep on the header file, while maintaining portability in the compile-to-c version (I would need this for
11:55:29arnetheducknlvm)
11:56:07arnetheduckor any better idea?
11:56:31coffeepotwhen not defined(SIGUSR) maybe?
11:56:37Araqwhen not declared(...)
11:56:48Araqdefined is only for -d:switches
11:56:56coffeepoti always get those mixed up... XD
11:57:09Araqthey used to be one and the same
11:57:22Araqbut it was too error prone
11:57:23*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:57:36coffeepotI'm glad they're different tbf
11:59:22arnetheduckany way to shorten that? say, for 100 such constants?
11:59:37arnetheduckwhere each is checked individually...
12:00:05arnetheduck(to avoid repeating "when not defined")
12:00:21arnetheducker, declared
12:01:45Araqtemplates ftw
12:02:05*vendethiel quit (Ping timeout: 276 seconds)
12:02:05ephjayay
12:02:41arnetheduckah, can stick when in a template? cool
12:08:37ephjais there anything that can't go in a template?
12:15:11*brson quit (Read error: Connection reset by peer)
12:15:26Araqno. and unittest.nim nests templates 3 or 4 levels deep ...
12:15:52coffeepot<3 templates
12:16:32coffeepotbtw is it bad pactice todeclare vars with untyped template params?
12:16:59Araqtemplate t(a, b)
12:17:00coffeepotlike template a(b: untyped) = var b: int
12:17:32Araqis short for:
12:17:40Araqtemplate t(a, b: untyped)
12:17:55Araq'untyped' is just fine, templates are sharp tools
12:17:56*derka quit (Quit: derka)
12:17:56coffeepotcool :)
12:18:16Araqbut injecting a 'var' however ... :P
12:19:23*derka joined #nim
12:26:19*lg_ joined #nim
12:27:32*BitPuffin joined #nim
12:29:49*junw joined #nim
12:34:55coffeepotnot just for injecting a var ofc, but things like tables trygetvale[a,b](theValue): bool meaning i dont need the extra line for defining the value
12:36:31coffeepotalso template timeIt(t: expr, action: stmt) = var t = cpuTime() ...
12:38:02*derka quit (Quit: derka)
12:44:18*derka joined #nim
12:50:41*lompik joined #nim
12:55:18*Ven joined #nim
12:56:48coffeepotis there a performance guide for nim about?
12:57:27coffeepotthought i was saving time by using a massive set[uint16] rather than an IntSet or hash table...
12:58:24coffeepotuntil I looked at the C code and realised in order to traverse the set it does "if (!(i_113134 <= ((NI) 65535))) goto <after loop>"
12:58:48coffeepotofc sets are really quick when they're not uint16 in size
12:59:22coffeepotbut IntSets are much faster way of doing what I wanted
13:00:55coffeepotdidn't expect it iterating all values when the nim code was just "var s: set[uint16] = {1, 2}; for item in s: ..."
13:01:28*s4 quit (Quit: Konversation terminated!)
13:03:34coffeepot*iterating all possible numbers I mean
13:05:29*Jehan_ joined #nim
13:21:46Araqcoffeepot: sparse big sets are better done with an IntSet or a hash table, that's no surprise
13:21:50*gour quit (Quit: WeeChat 1.3)
13:22:07Araqdense big sets can still be faster with 'set'
13:22:15Araqand small sets are always faster with 'set'
13:23:04Araqit's really not that complicated and since Nim is a systems programming language there is not SmartSet[T] which uses both implementations under the hood
13:23:23Araqbut feel free to create it :-)
13:25:21coffeepotIt's not that complicated... once you know that! I was testing the best impl for quickly adding/removing big sets of data between hashtable, intset and sets and sets are stupidly fast to add/remove from so I thought 'great, lets use these'. It was only when I came to iterate over them that I realised my mistake.
13:27:27coffeepotI'm all for the right tool for the right job, but sometimes you need to know what's happening behind the scenes to select the right tool. As a systems programming language, it'd be handy to have a guide for selecting the right tool
13:27:48coffeepotI mean, I could put in things I've found I guess and maybe cobble something together
13:31:09coffeepotAnother thing is knowing when copies are made. Nim seems to be pretty clever about this, but sometimes I'm not always sure how or when, say, seqs are copied. They're reference types but have value semantics, except sometimes AFAICT. I'm not super sure, so I have to dig into the C code sometimes to see. Sometimes I just want to alias a seq for less
13:31:09coffeepottyping/cleaner code, and definitely do not want to copy. You probably know how to do this, but I'm not sure right now. I feel it would be nice to have an article that explained this kinda thing.
13:32:55Jehan_coffeepot: Using `let` generally avoids copying. Also, passing a seq as a procedure argument doesn't copy.
13:33:35coffeepotah okay. See, I thought let generally DID copy! Also, using let means you can't change the seq, right?
13:34:19arnetheduckany convention on files which as meant to be included (as opposed to imported)?
13:34:23ephjathat's correct, but you also have var parameters
13:34:53*gour joined #nim
13:35:12Jehan_coffeepot: Correct, `let` variables are immutable (or, more precisely, immutable views of potentially mutable data).
13:36:02Jehan_arnetheduck: include is pretty much a textual include. It's only for when you want to create a variant version of a module or split a module in several parts or some such thing.
13:37:57*vendethiel joined #nim
13:39:06arnetheduckJehan_, yeah, I know.. I'm thinking about how to organize platform specific code - one way would be through textual includes
13:40:08Jehan_arnetheduck: That's definitely an option. Just remember that if you include something multiple times (or both include and import it) that the code/data in the module will be replicated for each instance, which can be wasteful.
13:42:26*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:53:37*filwit joined #nim
13:55:17coffeepotthanks Jehan_ so what is the best way to alias a mutable? If I do a var on a non-ref I think it's going to copy?
13:55:50Jehan_coffeepot: Hmm, what do you need a mutable alias for?
13:56:58Jehan_coffeepot: You can use shallowCopy, that's one way (but potentially unsafe).
13:57:33coffeepotwell say if you have a.b.c[i] and you want to update that - in that case just for typing and readability. Or, in terms of performance if you have data that's looked up and you want to update it in a loop whilst saving the lookup cost
13:58:26*vendethiel quit (Ping timeout: 240 seconds)
13:58:34coffeepotshallowCopy is one solution, although as you say I'd be concerned about safety there
13:59:42*derka quit (Ping timeout: 256 seconds)
14:00:44*yglukhov quit (Ping timeout: 272 seconds)
14:00:48coffeepotI guess I'd have to retrieve the address if possible or as you say shallowCopy to copy the ref
14:02:47Jehan_If it's a side-effect free expression, I'd just use `template`.
14:03:09*Ven joined #nim
14:03:15Jehan_And let the compiler deal with it during its CSE pass.
14:04:01Jehan_About shallowCopy and safety: That's really only an issue if the rhs is immutable.
14:04:26Jehan_I've been bugging Araq to have a safe version: shallowAssign[T](x, y: var T) or something like that.
14:05:08coffeepotJehan_ shallowCopy: as I understand it the GC only collects on new allocations anyway and IIRC only outside of a proc so I guess that's okay for aliasing
14:06:07Jehan_coffeepot: No, the problem occurs if the rhs is actually a constant. In that case, the GC code may try to mess with a reference count that is not actually there.
14:06:21Jehan_That's unrelated to having a collection going on.
14:07:11coffeepotyeah it would be really nice to have some kind of 'real' way to demand a simple alias and avoid having to know what's going on behind the scenes.
14:07:34coffeepotJehan_ ah ok well that's fair enough on the constant thing.
14:07:41coffeepotwhat do you mean by rhs btw?
14:07:49Jehan_right-hand side.
14:07:52coffeepotah! :D
14:07:53Jehan_of the assignment.
14:09:35coffeepotI'm quite often aliasing in my code and didn't realise it until I got into Nim
14:11:17coffeepotusing a template does save typing but would still take the lookup hit if the expression is complex
14:11:36coffeepotunless the 'CSE' pass can solve this for me?
14:11:48*vendethiel joined #nim
14:13:22*derka joined #nim
14:14:23coffeepotor the copy hit if you're making a var. I guess at that point though you'd have to think about using a ref for the thing that's accessed, which is not always wanted
14:15:05*lompik quit (Ping timeout: 245 seconds)
14:22:22Jehan_CSE = common subexpression elimination. You can count on modern compilers optimizing that away.
14:22:36Jehan_Unless you do weird side-effecty stuff as part of it.
14:22:44*endragor quit (Remote host closed the connection)
14:24:18coffeepotwell that's nice to know. I guess the main thing is just to profile stuff and sort any hot loops out as they turn up. Trouble is for me, the profiler doesn't go very deep into the stack trace so whilst I can find slow procs, it's not always obvious why they're slow (at least in my toy game project)
14:26:35*Jehan_ quit (Quit: Leaving)
14:27:54*yglukhov joined #nim
14:32:30*vendethiel quit (Ping timeout: 260 seconds)
14:44:13*vendethiel joined #nim
14:48:31*irrequietus joined #nim
14:51:44*Jehan_ joined #nim
14:57:46*endragor joined #nim
15:04:31*Ven quit (Disconnected by services)
15:05:16*Ven_ joined #nim
15:05:56*vendethiel quit (Ping timeout: 240 seconds)
15:06:06*gokr quit (Quit: Leaving.)
15:07:29*endragor quit (Remote host closed the connection)
15:20:35flyxis there a possibility to peek onto an iterator (inspect the next element without advancing the iterator)? I would guess not, but before I rewrite my API completely, it may be good to ask
15:26:32*krux02 joined #nim
15:28:08filwitflyx: just do the reverse and store the previous element, then compare against the current
15:28:43*vendethiel joined #nim
15:29:04krux02in scala a block evaluates to it's last expression. I there is simalar construct in nim, too?
15:29:41coffeepotkrux02: can you use a template?
15:30:36krux02I would like to create an object, apply some procs on it and then have that value in a single expression
15:31:07coffeepotsounds like a template would work for this
15:31:18*arnetheduck quit (Ping timeout: 272 seconds)
15:31:22krux02in javascript that pattern is often done with anonymous functions that are evealuated in place
15:32:20krux02ok, but somehow I do not know how
15:32:39coffeepota starter: http://nim-lang.org/docs/tut2.html#templates
15:32:40*arnetheduck joined #nim
15:32:49coffeepot:)
15:33:18krux02in c++ I could use the comma operator (can't be uglier, but it does what I want)
15:33:36coffeepotmore info in the manual ofc here http://nim-lang.org/docs/manual.html#templates
15:34:44krux02I know that tutorial, and I basically know how templates work, but still I have no idea how you think the solution looks like
15:34:56krux02best i put some example
15:35:09filwitkrux02: yeah that works in Nim: let x = (var y: int; foo(i); i)
15:35:54filwitwhich is basically the same as using a template like coffeepot suggested
15:36:07krux02filwit: ok, thank you a lot, that looks exactly like what I want to have, even though I think it is as ugly as the c++ comma operator
15:36:55krux02coffeepot just suggested templates, you gave an example so it actually helped me
15:37:29filwitwell the ugly syntax is why you use a template.. that expression syntax is very useful for macros though
15:37:33coffeepotsomething like this? https://gist.github.com/coffeepots/82255e018d146b061465
15:38:28filwitbtw, all procedures in nim evaluate to their last expression, not just templates
15:39:21*Varriount quit (Disconnected by services)
15:39:21*Varriount_ joined #nim
15:40:39coffeepotor rather this https://gist.github.com/coffeepots/7ee94e112f7efc9f04a7
15:41:03coffeepotthe first one had an error :)
15:41:26*arnetheduck quit (Ping timeout: 240 seconds)
15:41:29*pregressive joined #nim
15:42:36krux02filwit: the problem is that block is not an expression that evaluates to their last expression
15:43:09krux02is scala every block, independantly where it is used, is an expression that evaluates to it's last expression
15:43:51*derka quit (Quit: derka)
15:44:29filwitI don't understand.. you mean the literal 'block' keyword in Nim?
15:44:31coffeepotyou could probably make a construct using a template that acts like a block and evals to an expr if you pass the stmt type as a parameter to the template
15:46:05coffeepotnot quite sure on the semantics of that tho
15:46:22flyxfilwit: but then the item is not in the iterator anymore.
15:46:22coffeepot*syntax I mean
15:47:00*Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:47:03flyxfilwit: currently, I'm creating a new iterator which first returns the previously returned element and then iterates over the original iterator
15:48:02*Varriount joined #nim
15:48:14filwitflyx: i'm not following that exactly.. but I need to focus more on other things now
15:48:40*nikesprint joined #nim
15:48:50krux02# I think this should work, but it doesn't
15:48:50krux02let ii = block:
15:48:50krux02 var i = 0
15:48:50krux02 foo(i)
15:48:50krux02 i
15:49:05flyxfilwit: that's fine, thanks for answerin
15:49:18def-krux02: no, blocks don't return anything, procs and templates can
15:49:38*Varriount_ quit (Ping timeout: 256 seconds)
15:49:55*nikesprint left #nim (#nim)
15:50:03coffeepoti tried to work out a template that takes a stmt and returns and expr but don't know how that would work :/
15:50:26*vendethiel quit (Ping timeout: 250 seconds)
15:51:09krux02luckyly I can write a macro that transforms the block thing in the (;;)-representation
15:51:41coffeepotkrux02: cool! :D
15:51:51krux02that I like a lot in nim, I can just write a macro that rewrites everything how I want it :D
15:51:57coffeepoti still think it could be done with templates but don't know enough :/
15:52:18coffeepotyeah I must say metaprograming is amazing in nim
15:53:44*vendethiel joined #nim
15:54:06krux02coffeepot: the question would be, could it be done with a single template for all occurances where I want a block to evaluate to it's last element? Because I do not like to introduce a template for each, because I somhow fear name collisions
15:54:44krux02the reason I want this construct, is because I do not want to introduce more variables or names or anything in global scope
15:56:20krux02so a solution where I introduce a template each time I want to avoid creating a variable is somewhat not what I want.
15:56:22filwitkrux02: templates in Nim are hygienic, meaning they don't inject their variables into their callers scope so you wont get name collisions (unless you use the {.dirty.} pragma on them to prevent that)
15:56:52krux02filwit: yes but the template itself still has a name that can collide
15:57:16filwitoh i see, sorry I'm barely following chat right now..
15:59:19coffeepotkrux02: I don't see why not. So to summarise, you want a single named template (or similar) that takes a list of statements (like block:), and returns an expression?
16:00:07coffeepotperhaps it would look like this? var result = exprBlock: ... list of statements ending with an expression, which then gets evaluated and put into result?
16:00:48krux02yes
16:01:32krux02I would like to have something that looks like `block:`, but returns a StmtListExpr
16:02:41Jehan_krux02: Not sure I'm following. For what it's worth, any statement list (in a block or otherwise) evaluates to the result of the last statement in the list.
16:03:11*dom96_ joined #nim
16:04:01*dom96 quit (Ping timeout: 240 seconds)
16:04:01*dom96_ is now known as dom96
16:04:03flyxcoffeepot: like this? https://gist.github.com/flyx/e5325e40e11eb14eba9f
16:04:27*Sornaenst joined #nim
16:04:43coffeepotflyx: that looks like the job! I tried it with generics and broke the compiler :/
16:05:13flyxpersonally, I always found the do notation a bit awkward.
16:05:36coffeepoti've never used it, what's it ... uh... do?
16:06:08*vega_nsk joined #nim
16:06:09krux02coffeepot: somewhat, just with the difference that the final value of i is returned and can be assigned to a let variable, and no other variable will be introduced
16:06:16flyxit basically allows you do specify a block as input parameter to a proc/template
16:07:03flyxI use it sometimes within macros, because it's convenient for generating code without having to build it with the macros API
16:07:19krux02but for some reasons, in macros you do not need to write the `do
16:07:29coffeepotflyx: sounds like exactly what krux02 needs
16:08:28*filcuc_ joined #nim
16:08:29coffeepotkrux02 I think the problem is how to separate out a stmt into the last expression, but as Jehan_ says, the result is an expr anyway
16:09:09flyxaccording to the manual, it is even able to take multiple stmts: http://nim-lang.org/docs/manual.html#procedures-do-notation
16:09:58*BlaXpirit_ joined #nim
16:10:56coffeepothuh, well today I learned, cheers flyx. Nim has a lot of interesting things to learn
16:11:19flyxI also found it more by chance
16:14:30*vegansk quit (*.net *.split)
16:14:30*Sornaensis quit (*.net *.split)
16:14:31*BlaXpirit quit (*.net *.split)
16:14:31*filcuc quit (*.net *.split)
16:14:32*dv-_ quit (*.net *.split)
16:14:41*BlaXpirit_ is now known as BlaXpirit
16:15:23Jehan_I'm still not sure why `block:` isn't good enough? If I understand the question correctly?
16:16:45*vendethiel quit (Ping timeout: 245 seconds)
16:17:12ephjait can't be used as an expression
16:17:23Jehan_ephja: It can.
16:17:39Jehan_let a = (block:
16:17:39Jehan_ var x = 1
16:17:39Jehan_ echo x
16:17:39Jehan_ x)
16:18:48ephjasomeone said it couldn't. you don't need the parentheses with 'if' though
16:21:22*dv- joined #nim
16:27:33ephjacoffeepot: just keep it readable ;) a lot of code contains too much magic and too few module qualifications
16:27:48coffeepotso, with what Jehan_ said, you could do this maybe? https://gist.github.com/coffeepots/dc9adcb029e8c53a2e4e
16:28:44coffeepotephja: yeah more readable is very important!
16:30:16coffeepot^^ gist is only if you don't want to have brackets
16:30:55coffeepothonestly though, not sure if this is an improvement, a bit hard to read the flow imo
16:31:07Jehan_For what it's worth, it may be possible to sweet-talk the parser in accepting a block without parentheses.
16:32:19ephjathough in some cases it wouldn't matter, with the presence of semantic analysis
16:34:27*vendethiel joined #nim
16:34:38flyxwhen I define a concept type, can I define pragmas for the procs?
16:34:52flyxi.e. can I define „there must be a proc with {.raises:[].}
16:35:45ephjaa high quality engine of which takes a ton of man hours to create apparently
16:37:01*Varriount quit (Ping timeout: 276 seconds)
16:37:40Araqflyx: nah.
16:39:41ephjano ever did a "s/\<nimrod\>/nim/g"? ;)
16:40:27Araqit used to be more complex :P
16:40:48Araqfor example, you cannot rename magics this way or bootstrapping breaks
16:43:36ephjathe methods used seem to have been rather crude in any case, but only a few instances left now :p
16:43:41*gour quit (Quit: WeeChat 1.3)
16:45:58ephjacompiler/commands.nim: result = unixToNativePath(p % ["nimrod", getPrefixDir(), --- compiler/nimconf.nim: projectConfig = changeFileExt(gProjectFull, "nimrod.cfg")
16:46:17*vendethiel quit (Read error: Connection reset by peer)
16:46:27*vendethiel joined #nim
16:46:33*gour joined #nim
16:46:37ephjaok so it checks in multiple dirs. nevermind
16:56:10*vendethiel quit (Ping timeout: 272 seconds)
16:58:01*filcuc_ quit (Read error: Connection reset by peer)
16:59:24*gour quit (Quit: WeeChat 1.3)
17:03:24ephjaAraq: what about this one: result = options.completeGeneratedFilePath("nimrod.gid")
17:03:43ephjaand the identifier for code-block
17:04:30AraqPRs are always welcome
17:05:44ephjaworking on it
17:13:08*coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
17:30:52*brson joined #nim
17:33:26XeHmm, is there a simple example on how to embed nimscript into an arbitrary nim program?
17:34:40*Jehan_ quit (Quit: Leaving)
17:35:33*nande joined #nim
17:38:30*vendethiel joined #nim
17:47:35*yglukhov quit (Ping timeout: 264 seconds)
18:06:12*nande quit (Remote host closed the connection)
18:06:43*vendethiel quit (Ping timeout: 276 seconds)
18:12:24*sheerun joined #nim
18:23:10*vendethiel joined #nim
18:23:44AraqXe: look at how nimble does it
18:23:49Araqnimble is open source
18:35:17*yglukhov joined #nim
18:39:38*yglukhov quit (Ping timeout: 256 seconds)
18:39:52*Wildefyr quit (Ping timeout: 250 seconds)
18:44:06*vendethiel quit (Ping timeout: 245 seconds)
18:53:57*jsudlow quit (Read error: Connection reset by peer)
18:56:51*jaco60 joined #nim
19:02:45*lompik joined #nim
19:28:48*BitPuffin quit (Ping timeout: 272 seconds)
19:32:56*lompik quit (Ping timeout: 240 seconds)
19:38:08*gokr joined #nim
19:39:59*vendethiel joined #nim
19:43:22*Matthias247 joined #nim
19:46:25*Matthias247 quit (Read error: Connection reset by peer)
19:47:48*Matthias247 joined #nim
19:56:00*yglukhov joined #nim
20:02:45*vendethiel quit (Ping timeout: 240 seconds)
20:02:46*gokr quit (Quit: Leaving.)
20:11:49*nande joined #nim
20:29:22yglukhovCan nim output docs in rst?
20:39:39Araqyglukhov: not really
20:39:58yglukhovok thanks
20:45:29*desophos joined #nim
20:45:43*Varriount joined #nim
20:51:26*yglukhov quit (Remote host closed the connection)
20:53:43*gokr joined #nim
20:55:17*theduke_ quit (Remote host closed the connection)
20:55:38*Ven joined #nim
20:57:43*yglukhov joined #nim
21:02:33*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:03:57*Ven joined #nim
21:08:20*matkuki joined #nim
21:09:14*Varriount quit (Remote host closed the connection)
21:19:14yglukhovoh btw =)
21:20:59yglukhovi've been thinking about how nim + task + nims works, and i configured my projects to run tests via "nim test myproj.nims" and it seems to work pretty well. Unfortunately cant say the very same about nimble, because it has this not-yet-installed-dependency problem.
21:21:47yglukhovso now running tasks with nims is a pretty common pattern for me and i guess ill stick to it for the time being.
21:23:19yglukhovone slight incovenience though is the need to pass nims file name to nim invocation. would be much nicer to "nim tests" instead of "nim tests nimx.nims". what do you say?
21:24:27ldleworkAraq: are methods going away for suresies?
21:25:22*tinAndi joined #nim
21:27:09Araqldlework: no. but at the same time I don't want to spend more time on them
21:28:11Araqyglukhov: not sure we need yet another feature. use a bash alias perhaps?
21:28:48ldleworkAraq: they've worked okay in the ways I've used them, do they have some bad cases
21:29:08ldleworkif its a long answer just ignore the question
21:29:10Araqthey don't work well with generics
21:33:41*Guest4360 is now known as zielmicha
21:34:25yglukhovAraq: bash alias is a bad answer for cross-platform team environment. seeing windows terminal on my collegues pc is a pain =) and thats why we're still using nake =)
21:35:47yglukhovbut ok, not that critical if you dont like the idea
21:39:36*yglukhov_ joined #nim
21:39:36*yglukhov quit (Read error: Connection reset by peer)
21:42:46*desophos quit (Ping timeout: 252 seconds)
21:43:12Araqon windows I sometimes write batch files to shorten the stuff
21:43:23*yglukhov_ quit (Read error: Connection reset by peer)
21:43:40*yglukhov joined #nim
21:49:27*yglukhov quit (Read error: Connection reset by peer)
21:49:31*yglukhov_ joined #nim
21:49:41*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:50:41*mat4 joined #nim
21:50:44mat4hello
21:50:51Araqservus mat4
21:51:01mat4hi Araq
21:51:17ldleworkhi mat4
21:51:25mat4and hello ldlework
21:53:35*yglukhov_ quit (Read error: Connection reset by peer)
21:58:20mat4one question: Does one see the need for namespaces and implicit destructors (I guess though an destructor keyword or pragma) ?
21:59:41*yglukhov joined #nim
22:01:22*zaquest quit (Ping timeout: 256 seconds)
22:03:53Araqwe have destructors but they are experimental and nobody pays me to make them work
22:04:20Araqand we have namespaces, it's just that people don't know what a namespace is
22:04:27*ldlework coughs.
22:07:44*junw_ joined #nim
22:10:13*vendethiel joined #nim
22:11:18*junw quit (Ping timeout: 250 seconds)
22:14:31*Demon_Fox joined #nim
22:17:04Araq'from foo import nil' is exactly as annoying as you want it to be.
22:17:26Araqexcept that it's more consistent than you like to think about it.
22:17:41Araqthat still doesn't mean that Nim lacks namespaces.
22:21:05ephjais there a 'find' proc that takes a predicate?
22:24:36ldleworkephja: http://nim-lang.org/docs/sequtils.html
22:25:05ldleworkBut maybe you're looking for the index?
22:29:48ephjaldlework: yep. actually, 'delete' taking a predicate would be more appropriate. I'll consider adding those. it sure would be nice to use 'var' in concepts though, so that a truly generic container interface could be added already
22:30:16mat4Araq: That's different from the explicit encapsulation many are familiar with (C#, C++). Personally I never had any problem with name conflicts (side effect of hungarian notation)
22:30:24ephjaplease throw some money at zah ;)
22:30:42ldleworkActually 'import foo' is exactly as annoying as I want it to be.
22:31:01Araqmat4: no, it's really quite comparable to C# and C++ ...
22:31:02ldleworkassuming it doesn't actually do 'from foo import *'
22:31:46ldleworkbut then you can't call functions with magic dot syntax
22:31:55*Varriount joined #nim
22:32:24AraqI don't feel like telling you again that Python is not better in any way in this respect and it's frankly much worse due to the dynamic typing.
22:32:26ephjaldlework: it means that qualifications are optional
22:33:00ephja(module name preceding symbols)
22:33:25*vendethiel quit (Ping timeout: 245 seconds)
22:34:52Araqephja: 'var' in concepts is allowed
22:35:10mat4Araq: I mean the explicit "namespace <name>" syntax ... 'feature'
22:35:47ephjastill buggy I think
22:36:17Araqah ok then. well I wanted to do 'submodule foo' but dom96 claimed he would leave Nim then if it gets added
22:36:28*irrequietus quit (Ping timeout: 250 seconds)
22:36:30ephja:o
22:36:37Araqbut it means I would need a 'submodule' filter for nimble.
22:36:56ephjait's possible to work around it by using 'ptr' instead IIRC
22:37:36Araqso that nimble would not list any nimble package that uses 'submodule'
22:38:03ldleworkdynamic typing has nothing to do with this
22:38:13Araqbecause I really loathe System.Text.RegularExpression.Regex more than you can love it :P
22:39:27*wuehlmaus quit (Quit: Lost terminal)
22:39:30ldleworkI would take 'import foo' creating a name 'foo' and never being able to use first_arg.f(second_arg)
22:39:36ldleworkbut that's just me, I'm not complainign at all
22:40:11*Varriount_ joined #nim
22:40:28*Varriount quit (Ping timeout: 256 seconds)
22:40:59ldleworkhaving 'import foo' actually mean 'from foo import *' tends to work out fine, because of function overloading or whatever its called.
22:41:13*Varriount_ quit (Read error: Connection reset by peer)
22:41:36*irrequietus joined #nim
22:41:37*tinAndi quit (Quit: ChatZilla 0.9.92 [Firefox 43.0.4/20160105164030])
22:43:19*vendethiel joined #nim
22:47:24*Varriount joined #nim
22:47:52*sheerun quit ()
22:48:41*Varriount quit (Client Quit)
22:49:01*Varriount joined #nim
22:49:22*Ven joined #nim
22:52:08*Ven quit (Client Quit)
22:57:14*matkuki quit (Quit: ChatZilla 0.9.92 [Firefox 44.0/20160123151951])
23:01:28*yglukhov_ joined #nim
23:01:28*yglukhov quit (Read error: Connection reset by peer)
23:02:53*Ven joined #nim
23:04:49*Ven quit (Client Quit)
23:05:58*vendethiel quit (Ping timeout: 256 seconds)
23:06:56*saml quit (Remote host closed the connection)
23:17:23*desophos joined #nim
23:18:52*pregressive quit ()
23:48:39*irrequietus quit ()
23:48:46*mat4 quit (Quit: Verlassend)
23:57:37*lompik joined #nim