<< 19-01-2016 >>

00:02:48ldleworkHmm don't think I've seen this one before, dadren/meta.nim(113, 13) Error: attempting to call undeclared routine: 'type_name='
00:03:09ldleworkoh
00:06:12dom96Xe: Please make an issue about install.sh if you haven't already.
00:07:49Xedom96: i did
00:08:16dom96thanks
00:09:34ldleworkError: interpretation requires too many iterations
00:09:36ldleworkdoh
00:10:55Xecompiler/plugins/active.nim(13, 18) Error: cannot open 'itersgen'
00:12:59*Xe fell back to a tarball install for now
00:16:30Araq_uh oh
00:17:00TrustableNim 0.13.0 - yay :) - thank you guys
00:19:33*brson quit (Read error: Connection reset by peer)
00:20:35*brson joined #nim
00:20:45derkaGuys
00:21:13derkaproc foo(x: var seq[int] = @[]) . You can't pass a literal to a 'var T' type. ?
00:21:16derkacan someone ellaborate please
00:21:36derkawhy isnt it allowed
00:22:54ldleworkderka: think about it
00:22:57dom96Maybe this makes it clearer https://gist.github.com/dom96/a540df86ca4435e9e4b6
00:23:05ldleworkthere you go
00:23:43ldleworkNot sure why those semantics apply to default values
00:23:48ldleworkSince you do have a way to access it
00:23:49ldlework`x`
00:23:50derkaok
00:23:52*Matthias247 quit (Read error: Connection reset by peer)
00:23:53ldleworkinside the scope of the proc
00:24:08*ephja quit (Ping timeout: 272 seconds)
00:24:18ldleworkthat doesn't seem to make sense
00:24:48*pregressive quit (Remote host closed the connection)
00:24:53ldleworkDo we have a quick nim-snippet web thing yet?
00:25:01ldleworkto actually run it and see the output, etc?
00:27:44derkabut this is allowed:
00:27:45derkaproc foo(x: seq[int] = @[]) =
00:27:46derka echo $x
00:27:47derkafoo()
00:28:29ldleworkright
00:30:00derkai see the point now
00:30:20derkai was thinking like we do in python
00:30:34derkasometime we can use a default val list and accumulate stuff on it
00:30:46ldleworkDoes anyone have any interest in helping me draft an outline for a high-level AST library?
00:30:59ldleworkOne that speaks in terms of Nim-language constructs and enforces their semantics?
00:31:18ldleworkI am a good ways along, but I don't really know the best boundries to set.
00:31:27ldleworkBasically design help, not implementation help.
00:31:50*Trustable quit (Remote host closed the connection)
00:36:16Araq_ldlework: I'm interested in the sense that I will add it to the core once it's ready.
00:36:33Araq_because it's definitely a wise thing to do.
00:39:49ldleworkIts hard
00:39:56ldleworkIdent's are used for everything. lol
00:40:32ldleworkIts hard to tell where, where an Ident is accepted, something else is accepted
00:40:44ldleworklike a prefix, or a bracket, and so on
00:41:11dom96ldlework: What do you envision it would look like?
00:41:39ldleworkdom96: you'd have types like ASTProc and ASTType and ASTField and ASTSymbol and so on
00:41:46ldleworkAnd they'd have fields like .exported and so on
00:41:56ldleworkAnd they'd have fields for optional generic discriminators and so on
00:42:00ldleworkIE, model the actual things in the language
00:42:16ldleworkAnd then give them all render procs that produce the full nested raw AST.
00:42:36ldleworkThey'd have parametric initializers for natural use, and also initializers that take a single NimNode
00:42:42ldleworkFor parsing uses.
00:42:50dom96That would be nice
00:43:07dom96I think you should look at what's available in other languages too.
00:43:35dom96There must be some nice libraries for working with ASTs
00:44:01ldleworkWell I think that Nim's AST api is okay, it seems to represent what the actual AST is.
00:44:19ldleworkThe problem is if you want to generate valid Nim, its hard to get right.
00:44:34ldleworkUnless you resort to parsing string-templates
00:44:40ldleworkwhich seems... eh we can do better
00:45:10ldleworkI think I just need to clarifiy, in my mental model, how the various things that Ident is used for, how they are distinct
00:46:25ldleworkSomethings I've identified as being implemented with Idents: proc names, type names, field names, field types, descriminators
00:46:58ldleworkproc return types
00:47:04ldleworkThey can all be exported, except for field types and return types
00:47:49ldleworkproc names, type names, return types and field types can all optionally exist as Brackets or BracketExprs (I'm not sure which cases use which yet)
00:48:29Araq_er that's quite wrong ;-)
00:48:36ldleworkhah, no doubt!
00:48:44Araq_maybe the grammar helps you.
00:49:09ldleworkAraq_: where can I look at that
00:49:22ldleworkI don't know if I know how to read any grammar formats
00:49:44Araq_http://nim-lang.org/docs/manual.html#syntax-grammar
00:50:27Araq_but yeah, doesnt help
00:50:35Araq_we need an AST grammar :-)
00:50:53Araq_that would be cool. great idea.
00:51:25ldleworkgreat idea, let me get on that?
00:51:30ldleworkor great idea, let me know when there is a PR?
00:51:32ldleworkhaha
00:52:35ldleworkI don't think I'm even going to attempt to parse proc bodys...
00:53:13Araq_ldlework: the AST is quirky but also in a good sense
00:53:42Araq_you can very often get away with a basic distinction between atoms and compound trees
00:53:46*kniteli quit (Ping timeout: 240 seconds)
00:54:06ldleworkAraq_: in my current model, types are specified as a recursive list of types yeah.
00:54:22ldleworkAnd if they are len == 1, they get rendered as an ident, >1 they get rendered as a BracketExpr
00:55:03ldleworkBasically I'm just writing various procs and types and seeing how they parse and trying to fit all the different results I see under some unified abstraction
00:55:54ldleworkBut I've rewritten meta.nim like 3 times now... this would be the 4th rewrite :D
00:56:20ldleworkAnother tricky thing
00:56:30ldleworkIs sometimes where an nnkIdent goes, an nnkEmpty can go O_O
00:57:08Araq_that's only possible for anon procs I think
00:57:29Araq_and it makes sense, it's anonymous proc after all
00:57:42ldleworkalso for various places where the compiler will infer the type
00:57:52ldleworklike in proc parameters
00:58:21ldleworkLike if you pass a default, you don't need to pass a type
00:58:27ldleworkBut default can also be empty
00:58:40ldleworkThat might be the only place I had to support it
00:58:53ldleworkoh my god I haven't even considered what the proctypes look like
00:59:17ldleworklike a proc param that is a proctype
01:00:46ldleworkAraq_: Should I start a google-doc maybe where the high-level types could be described
01:00:55ldleworkthen once it makes sense, I can implement it?
01:01:39dom96Xe: hey, still around? Could you try the new and improved installation instructions for Nimble? (In readme) :)
01:05:27Xedom96: checking
01:05:44dom96thanks
01:06:02ldleworkIs the proper name for the type of a variable, or the type of a parameter, or the return type of a proc a "type description" ?
01:06:12ldleworklike
01:06:14ldleworkx: int
01:06:15Xedom96: that worked
01:06:16ldleworkthe `int` part
01:06:18Araq_ldlework: ok but I'm sleeping already
01:06:24dom96Xe: yay, crisis averted :D
01:06:28ldleworkAraq_: no problem, I'll come up with a base
01:06:44Xedom96: yeah lol
01:07:09ldleworkLike could I use "type description" and "type definition" to distinguish between type specifiers and type definition blocks?
01:07:23Araq_ldlework: yes
01:07:32ldleworkok
01:07:56ldleworkMaybe a good name is "type descriptor" ?
01:08:03ldleworkor just "descriptor" ?
01:08:33ldleworkI like descriptor.
01:08:52ldleworkBecause a "data descriptor" is a structure containing information that describes data.
01:08:56ldleworkThat's what a type is, right?
01:09:08ldleworka type is a "struct descriptor"?
01:09:43ldleworkI'm gonna go with "descriptor" because it sounds cool.
01:15:12Araq_scriptor, inquisitor
01:16:52*pregressive joined #nim
01:17:03dom96good night guys
01:17:08ldleworkAraq_: haha
01:24:17*brson quit (Ping timeout: 255 seconds)
01:27:12*derka quit (Quit: derka)
01:27:41*bozaloshtsh joined #nim
01:28:49bozaloshtshI updated to nim 0.13 after not using it since like 0.10, and now I'm getting a strange error: Error: internal error: environment misses: world
01:29:15Xewhat file are you trying to compile?
01:29:16bozaloshtshit raises during compile, on a proc declaration
01:29:31bozaloshtshit's my own program, actually I'm going to make a pastebin hang on
01:30:38bozaloshtshhttp://pastebin.com/qbtnsMNX
01:35:26Araq_bozaloshtsh: sorry, this was never officially supported, I think
01:35:58Araq_are you sure that worked with 0.10 ?
01:36:27bozaloshtshyep, it worked... but yeah I see the issue now. Can't access other parameter in default value.
01:37:53Araq_error message could be better of course. and yeah eventually we will support default parameters refering to other parameters cause they are quite useful
01:38:06Araq_good night.
01:39:14ldleworknight Araq_
01:41:47*pregressive quit ()
01:42:39*pregressive joined #nim
01:47:58ldleworkARGH TUPLE TYPES
01:48:03ldleworkshit on a stick
01:51:30*vendethiel joined #nim
01:59:31*strcmp1 joined #nim
01:59:51ldleworkmaybe just ignore tuple types for now
02:00:11*strcmp1 quit (Client Quit)
02:00:13ldleworkugh this is a hard task
02:00:26*strcmp1 joined #nim
02:14:44*vendethiel quit (Ping timeout: 245 seconds)
02:18:29ldleworkIf I have an object type with say a string field, is it okay to sometimes initialize that field to nil?
02:19:17*vendethiel joined #nim
02:27:49ldleworkobject variants are crazy
02:29:55*lankanmon joined #nim
02:41:11ldleworkCan you use multiple variant fields?
02:41:20ldleworklike multiple variant discrirminators?
02:42:31*vendethiel quit (Ping timeout: 260 seconds)
03:23:28ldleworkdom96: def- how is this looking? https://gist.github.com/dustinlacewell/957646128a24cd6c8141
03:23:42ldleworkthis is purely for just type definitions, no proc support
03:24:39*maikklein_ joined #nim
03:25:05maikklein_Does nim have ownership semantics?
03:25:19maikklein_like in c++ with move?
03:32:03*maikklein_ quit (Ping timeout: 252 seconds)
03:58:32*pregressive quit (Remote host closed the connection)
04:14:08*brson joined #nim
04:27:18veganskArrrr, sorry, no time until february :-(
04:55:01*strcmp1 quit (Quit: peace)
05:09:06mountaingoatsorry if this is a nonsensical question, but is Seq[T] a reference type?
05:09:17mountaingoathow can i pass one as a reference to a function?
05:16:56Xestupid question of the day: what would be the best way to package nimble as a distribution package?
05:31:47*s4 joined #nim
05:33:19*kniteli joined #nim
05:54:37*xtagon joined #nim
06:13:04Xereactormonk: it was intended for it to print 4 every time?
06:14:31reactormonkXe, nope, the other way. But apparently now we go all JS
06:14:48Xewe javascript now?
06:15:11*brson quit (Ping timeout: 264 seconds)
06:25:11mountaingoatis there a way to clear/fill/memset a Seq[T]?
06:25:23mountaingoati mean a standard library proc for it
06:25:51mountaingoatreset[T]()?
06:59:42*derka joined #nim
07:02:07*Demon_Fox quit (Ping timeout: 276 seconds)
07:04:37*derka quit (Quit: derka)
07:05:40*kniteli quit (Ping timeout: 272 seconds)
07:07:43*darkf joined #nim
07:14:03*vendethiel joined #nim
07:16:26*bjz joined #nim
07:21:38*bjz quit (Ping timeout: 276 seconds)
07:37:59*vendethiel quit (Ping timeout: 264 seconds)
07:41:40*bjz joined #nim
07:42:11*satbyy joined #nim
07:42:46*Matthias247 joined #nim
07:45:41*sjums joined #nim
07:48:13*nsf quit (Quit: WeeChat 1.3)
07:49:57*nsf joined #nim
07:52:52*Matthias247 quit (Read error: Connection reset by peer)
07:53:22wuehlmausdom96: hmm, "our" bug is consistent in 0.13
08:04:46*gokr joined #nim
08:08:55Araq_mountaingoat: use x.setLen(0) ? and read some tutorial please ;-)
08:10:42*kniteli joined #nim
08:11:45*vendethiel joined #nim
08:14:03*yglukhov joined #nim
08:15:59*bjz_ joined #nim
08:16:06*bjz quit (Ping timeout: 240 seconds)
08:28:50*Trustable joined #nim
08:33:18*xtagon quit (Quit: Connection closed for inactivity)
08:34:26*vendethiel quit (Ping timeout: 256 seconds)
08:39:10mountaingoatAraq_: i wasn't looking to truncate it, but to zero it
08:40:14mountaingoatright now i'm just iterating over it and manually zeroing each element, but i was wondering if there was an easier way
08:41:05Araq_well you can use zeroMem() but that's unsafe and will screw up RCs
08:41:16Araq_so better do it manually
08:41:41mountaingoatokay
08:42:02mountaingoatthanks
08:50:59*desophos quit (Read error: Connection reset by peer)
08:57:15yglukhovmountaingoat: mySeq.applyIt 0
09:03:29*kniteli quit (Ping timeout: 245 seconds)
09:09:49Araq_hmm maybe I should start using sequtils
09:17:29*kniteli joined #nim
09:21:24*ephja joined #nim
09:22:32*vqrs quit (Ping timeout: 276 seconds)
09:24:00*vqrs joined #nim
09:26:23*Arrrr joined #nim
09:40:28*vendethiel joined #nim
09:55:33*derka joined #nim
09:55:34*derka quit (Client Quit)
10:01:24*vendethiel quit (Ping timeout: 245 seconds)
10:06:53gokrAraq_: Great work man! :)
10:07:08gokr(just skimmed release notes)
10:07:16Araq_well apparently the installer doesn't work properly ... -.-
10:08:46wuehlmaushmmm, when i do `` let t = (0,"hello",'a') and then try echo t[^1] it throws an error
10:10:18wuehlmausthis is with nim 0.13
10:13:02allan0_could someone make a github "release" for the updated csources repo? would make packaging easier.
10:13:57Araq_allan0_: how do I do that? just tag it?
10:15:22allan0_i think so. but there is also some webgui stuff when you click on "release" just above the clone url.
10:15:40Araq_nice let me try
10:22:51*derka joined #nim
10:28:01*vangroan joined #nim
10:29:14*vqrs quit (Ping timeout: 255 seconds)
10:29:55*derka_ joined #nim
10:31:40*vqrs joined #nim
10:32:27*derka quit (Ping timeout: 260 seconds)
10:32:27*derka_ is now known as derka
10:33:16*strcmp1 joined #nim
10:38:17dom96allan0_: Should be tagged now :)
10:44:01allan0_thanks
10:44:59*kniteli quit (Ping timeout: 255 seconds)
11:01:21*strcmp1 quit (Quit: peace)
11:11:15*exebook quit (Remote host closed the connection)
11:15:48*derka quit (Quit: derka)
11:18:30*vendethiel joined #nim
11:20:46*derka joined #nim
11:42:28*vendethiel quit (Ping timeout: 265 seconds)
11:45:22*vendethiel joined #nim
11:45:46*vangroan_ joined #nim
11:46:25*vangroan quit (Read error: Connection reset by peer)
11:48:46*vangroan__ joined #nim
11:50:41*vqrs quit (Ping timeout: 255 seconds)
11:52:12*vangroan_ quit (Ping timeout: 256 seconds)
11:54:11*vqrs joined #nim
12:06:47*vendethiel quit (Ping timeout: 264 seconds)
12:11:32*derka quit (Ping timeout: 276 seconds)
12:12:02*derka joined #nim
12:30:22*vendethiel joined #nim
12:33:13*kniteli joined #nim
12:41:47*derka quit (Quit: derka)
12:44:18*derka joined #nim
12:51:35*vendethiel quit (Ping timeout: 265 seconds)
13:00:47*askatasuna quit (Ping timeout: 264 seconds)
13:01:37*askatasuna joined #nim
13:07:13yglukhovHas anyone seen a template that locks closure scope to be used in loops? I'm pretty sure I've seen a snippet somewhere on the forum or github, but cant exactly remember...
13:08:26*BitPuffin joined #nim
13:11:26*nchambers joined #nim
13:15:22*vendethiel joined #nim
13:18:36*ekarlso quit (Changing host)
13:18:36*ekarlso joined #nim
13:21:44*askatasuna quit (Ping timeout: 256 seconds)
13:24:28yglukhovok, wrote my own. in case anyone needs it: template closureScope(body: untyped): stmt = (proc() = body)()
13:34:30*s4 quit (Quit: Konversation terminated!)
13:36:20*vendethiel quit (Ping timeout: 260 seconds)
13:39:31*vendethiel joined #nim
13:53:45*vangroan__ is now known as vangroan
14:00:06*vendethiel quit (Ping timeout: 240 seconds)
14:07:32*vendethiel joined #nim
14:20:06*vqrs quit (Ping timeout: 256 seconds)
14:20:52*vqrs joined #nim
14:21:53*arnetheduck joined #nim
14:23:57*arnetheduck left #nim (#nim)
14:24:06*arnetheduck_ joined #nim
14:24:16*arnetheduck_ quit (Client Quit)
14:24:43*arnetheduck joined #nim
14:30:18*vendethiel quit (Ping timeout: 256 seconds)
14:39:32*NickMane joined #nim
14:40:33*askatasuna joined #nim
14:40:45*saml joined #nim
14:41:26NickManecan someone tell me how xmlCheckedTag(http://nim-lang.org/docs/htmlgen.html#xmlCheckedTag,NimNode,string,string,string) is supposed to be called? Specifically, what should I pass as the first argument?
14:43:56arnetheducka little toy I came up with: http://forum.nim-lang.org/t/1955
14:44:17arnetheduckcomments welcome ;)
14:45:17dom96hello NickMane, take a look at the source of the other html elements, for example <a> https://github.com/nim-lang/Nim/blob/master/lib/pure/htmlgen.nim#L98
14:45:23dom96They show how to use xmlCheckedTag()
14:46:59NickManeOh... right. I actually tried that, but that was before importing 'macros'. Thanks!
14:47:41dom96arnetheduck: nice! Hope this results in a practical alternative Nim backend :)
14:49:34dom96arnetheduck: seems like you've actually developed quite a lot of it already, how much of Nim does it support?
14:49:52derkayglukhov what is the difference between what you did and using block
14:50:52arnetheduckwell, I did get hello world to link and compile at some point, but I think I broke it again later
14:52:12arnetheduckit reuses the usual nim compiler for all the heavy lifting, so all it has to do is spit out IR.. all the parsing, lambda stuff etc is already taken care of..
14:52:13arnetheduckit
14:52:27arnetheduck's very similar to the c & js backends in that sense
14:54:46yglukhovderka: the difference is noticable when youre creating a closure in a loop. with my template loop locals will be "copied" to env of every created closure.
14:55:32yglukhovotherwise all closures will refer the same locals
14:55:38derkaok interesting
14:56:44derkasorry for asking but in which use case do you need such a behavior ?
14:57:20wuehlmaushmm, nobody has replied to my using of var[^1] on a tuple. was that a stupid way?
14:59:06yglukhovderka: almost always when creating closure in a loop =)
14:59:13derka:)
15:00:40yglukhovfor reference this is the same way as javascript works. so you can read up more on that in regards to js. e.g. http://stackoverflow.com/questions/750486/javascript-closure-inside-loops-simple-practical-example
15:02:29*vangroan quit (Ping timeout: 276 seconds)
15:03:14derkai see your point now
15:03:22derkathx member:yglukhov
15:06:02NickManeis it possible in nim to use procs as infix operators?
15:06:18XeNickMane: like backticking in haskell?
15:06:26*bozaloshtsh quit (Ping timeout: 265 seconds)
15:06:35NickManeXe:yeah
15:06:41XeNickMane: unsure
15:06:51yglukhovNickMane: afaik only operators can be used as infix operators =)
15:06:51*Senketsu joined #nim
15:08:20NickManeyglukhov: aha, and does proc `somesymbol` count as a new operator, or only the inbuilt operators?
15:08:31*Jesin quit (Remote host closed the connection)
15:09:03yglukhovNickMane: you can define custom opertors, but dont use letters in its name.
15:09:07yglukhovproc `%!@`(a, b: int): int = a + b
15:09:11yglukhovlet f = 5 %!@ 7
15:10:04yglukhovoperators are not only procs, but templates and macros as well
15:10:53NickManeyglukhov: ah, thanks! :) I tried that, but didn't omit the `` when using the operator
15:11:10NickManegreat that you cna us
15:11:22NickManegreat that you can use the operator without ``*
15:11:32yglukhov`` are used for function call syntax: let f = `%!@`(5, 7)
15:11:55NickManethat makes sense
15:12:59dom96wuehlmaus: if the compiler crashes then please report it as a bug
15:13:33dom96wuehlmaus: As for whether that should work: I think it should.
15:13:45wuehlmausit does not crash, it just doesn't output the last element
15:13:54wuehlmausand gives a confusing error message :)
15:14:04Araq_I disagree, it does not have to work
15:14:16wuehlmausvar t = (0,"one",'a'); echo t[^1] doesn't work
15:14:36Araq_^1 is rewritten to x.len-1
15:14:46Araq_and tuples have no length
15:14:50dom96Araq_: makes sense
15:15:12yglukhovtuples dont have len?
15:15:14wuehlmausthat's what i wanted to know, so i was stupid, learned something :)
15:17:20yglukhovim pretty sure its possible to write a library template/macro len for tuples
15:17:26yglukhovthen ^1 should work
15:18:35yglukhoveven c++ can has len for tuples! :D
15:19:16*NickMane quit (Quit: Page closed)
15:19:31wuehlmausokay, then i was not stupid to expect it ;)
15:21:09dom96arnetheduck: awesome, hope you stick with it!
15:21:42Araq_arnetheduck: cool! at one point we could adopt it as the standard Nim backend.
15:22:25Araq_yglukhov: yeah it's possible but I'm not sure it's wise
15:22:48Araq_the compiler used to rewrite len(3) to len([3]) for example
15:22:57Araq_so len(3) produced 1.
15:23:09Araq_produced nasty bugs in my code.
15:23:32Araq_as a result Nim distinguishes between 'openarray' and 'varargs' ;-)
15:28:58*gokr quit (Quit: Leaving.)
15:30:22*coffeepot joined #nim
15:30:31coffeepotHey guys!
15:30:39coffeepotcongratulations again on the release :)
15:31:23dom96hello coffeepot, thanks :)
15:31:58dom96ooh, we're on HN now too https://news.ycombinator.com/item?id=10929426
15:32:14coffeepotI got a question regarding templates and generics. Can I make this work? It sigsegv's the compiler. https://gist.github.com/coffeepots/53b17b976f6561c27fbf
15:32:18coffeepotooo cool!
15:32:20*bozaloshtsh joined #nim
15:32:47coffeepotI tried to make a HN account once and the captcha would not produce anything I could read, so I guess that proves I'm a robot
15:33:28Xedom96: where is an example of the nimscript method for nimble package definition?
15:34:04dom96Xe: https://github.com/nim-lang/nimble#the-new-nimscript-format
15:34:11dom96Xe: or you can just run `nimble init`
15:34:12Araq_coffeepot: get rid of the .immediate
15:34:19Araq_and replace 'stmt' with 'untyped'
15:34:55Xedom96: i figured it out, the `name` statement is now gone lol
15:35:01coffeepotrrrooger wilco Araq_ :D
15:36:09dom96Xe: Yeah, it's called "packageName" now... for some reason. Perhaps I should rename it to 'name'.
15:36:16Xedom96: or alias it
15:36:18dom96It is optional now though
15:36:21coffeepotdamn, I get Error: internal error: expr(skType); unknown symbol at line 13
15:36:24Xeah
15:36:33dom96since the name of the file contains the package name
15:38:18dom96coffeepot: They must have noticed that you're a coffee pot heh.
15:39:19coffeepotdom96: I think I'm a relative of that toaster on red dwarf
15:40:18dom96coffeepot: haven't seen a single episode of Red Dwarf sadly
15:40:31coffeepot:-o
15:42:47coffeepotAraq_ any ideas how to get round this expr(skType) thingie?
15:43:24yglukhovAraq: hypothetically. how much time would you need to make closure iters work in js? ;)
15:43:49derkaok
15:43:54derkasorry wrong window :)
15:44:56*pregressive joined #nim
15:45:46Araq_coffeepot: no, sorry. you can always remove the parametrization of the template though
15:46:39Araq_yglukhov: I told you. you need an alternative implementation for every control flow construct (if/case/while/try)
15:46:56Araq_or maybe wait until JS supports 'yield' natively?
15:50:41coffeepothmm, I tried to remove the parametrisation, but as far as I can see I need the generic types for the table
15:51:34Araq_usually you can access the type with the 'type()' operator
15:51:54coffeepotokay! I'll give it a go :)
15:55:48coffeepothaha I was being a dingleberry
15:55:58coffeepotthere's a rather obvious mistake in my code
15:56:17coffeepotI was passing the A type into the table.key proc... d'oh!
15:56:18Xedom96: can you access nimble metadata for a given package from the nimscript integration?
15:56:49dom96Xe: not right now
15:57:03coffeepotcheck it out, works :D https://gist.github.com/coffeepots/4fef19f7e36f400b64c4
15:57:04Xeah
15:57:07dom96Xe: What would you like to do with it?
15:57:16Xei had an idea to make something like
15:57:23Xe`nimble packageListGen`
15:57:31Xethat would generate the corect json
15:57:57Xebut it would mean adding tags to nimble definitions
15:59:01dom96`nimble publish` kinda does that already
15:59:18coffeepot... and with that code, the reason for *not* having a 'tryGet' in tables is weakened - the reason to not have one was that it offered no simplistic advantage to doing getDetault and comparing it to the default value. But now you can do it as a one liner with the template creating the return value var! Mwuahhahahaa!
15:59:35*vendethiel joined #nim
16:00:26coffeepotof course, a "real" version of tryGet would be implemented at the lower level of tables to avoid the hasKey call, meaning only one hash required to simultaneously checking a value exists and retrieving it :)
16:01:01Xealso `nimble publish` doesn't work if you have 2FA :P
16:01:30derkaWhat is the max size of a string?
16:01:33*Jesin joined #nim
16:01:44Xederka: how much ram do you have?
16:02:12coffeepotderka that probably depends on if you're running 32 or 64 bit
16:02:19derkaok
16:02:27derkaso the size is stored in 32 or 64 bits
16:02:33derkadepending on arch
16:02:42coffeepotdon't trust me :)
16:02:45derka:)
16:03:36derkaAraq_ or anyone able to answer, how can we have Nim use jemalloc instead of linux malloc
16:09:45Araq_Xe: dom96 huh? I implemented 'nimble dump' for this
16:10:13Araq_or maybe 'dumb' ... for some reason I never know if it's with a 'p' or a 'b'
16:10:31Xeah
16:10:33Xeokay i see
16:10:36Xethanks
16:11:00Araq_derka: since it doesn't use malloc to begin with, it cannot use jemalloc either
16:11:16Xealso sigh, it doesn't seem like nim parsecfg correctly reads systemd unit files
16:11:48derkaoh ok, so Araq_ how is memory managed
16:11:49Araq_the GC uses its own memory manager.
16:11:51derkais there a doc about it
16:12:18*kniteli quit (Ping timeout: 256 seconds)
16:12:26Araq_no, but you can read lib/system/alloc.nim
16:13:19Xedoes nimscript work on machines that don't have the nim compiler installed?
16:13:51Araq_it needs the core of the stdlib (system.nim)
16:14:03Araq_it cannot work without
16:14:12Xeah, hmm
16:16:57*irrequietus joined #nim
16:19:50*bozaloshtsh quit (Ping timeout: 272 seconds)
16:21:24*vendethiel quit (Ping timeout: 250 seconds)
16:24:14dom96Xe: oh really? I have 2FA and it works :P
16:24:35Xedom96: it didn't work for me!
16:25:50dom96Xe: did you get an error or what?
16:26:04Xeidk, haven't tested again
16:26:19Xeoh
16:26:21Xeit was a while ago
16:26:24Xemigth have been fixed
16:26:27Xeignore me
16:29:44*vendethiel joined #nim
16:30:51dom96Lobsters likes us too https://lobste.rs/s/cbxwkx/nim_v0_13_0_released
16:30:52*Salewski joined #nim
16:34:04SalewskiIn C we have: pango_layout_set_text (layout, "\u2654", -1); # or in bash echo -e "\U2654"
16:34:34SalewskiHow can we use that unicode char (chess king) in a Nim string?
16:37:44*satbyy_ joined #nim
16:40:15Araq_Salewski: write the chess king as utf-8 with your editor
16:40:54Araq_or you have to use the multibyte encoding: \xff\xff
16:42:46XeI am liking how the osproc module works
16:42:50SalewskiSo above is "\x26\54" in a Nim string?
16:43:07Araq_that's not how UTF-8 works
16:43:35*darkf quit (Ping timeout: 260 seconds)
16:44:35*askatasuna quit (Ping timeout: 264 seconds)
16:47:08*yglukhov quit (Ping timeout: 276 seconds)
16:51:18*vendethiel quit (Ping timeout: 250 seconds)
16:52:26XeAraq_: is there a way to embed the system.nim file into something that uses nimscript?
16:54:34*darkf joined #nim
16:58:22*ikay joined #nim
17:04:01Araq_currently that's really hard
17:04:19Araq_eventually you can slurp it into your exe.
17:04:24Xeah
17:04:47Xecan you change where it looks for system.nim?
17:04:55Araq_sure
17:06:00*vendethiel joined #nim
17:12:32*askatasuna joined #nim
17:14:41*strcmp1 joined #nim
17:18:38*brson joined #nim
17:19:16*coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
17:21:05SalewskiAraq: SHIFT CONTROL U 2654 works in gedit and gvim for input -- and hexdump gave me the corresponding four byte string "\xe2\x99\x94\x0a". Both works fine in Nim.
17:21:37*ikay quit (Quit: Page closed)
17:22:31*Salewski quit ()
17:24:35*jsudlow quit (Ping timeout: 255 seconds)
17:25:20*jsudlow joined #nim
17:29:22*vendethiel quit (Ping timeout: 276 seconds)
17:34:21*yglukhov joined #nim
17:39:00*yglukhov quit (Ping timeout: 272 seconds)
17:47:49*Senketsu quit (Quit: Leaving)
17:50:33*yglukhov joined #nim
17:51:16*yglukhov quit (Remote host closed the connection)
17:54:19*kniteli joined #nim
17:54:58*vendethiel joined #nim
17:56:34*jsudlow quit (Read error: Connection reset by peer)
17:57:16*jsudlow joined #nim
17:57:59*brson_ joined #nim
17:59:17*brson quit (Ping timeout: 276 seconds)
17:59:37*Salewski joined #nim
18:00:06*satbyy_ quit (Ping timeout: 240 seconds)
18:03:41SalewskiWe have array constants like: const H = ["a", "b"]; echo H[1]. Is the start index always 0 for this case, or can we have an arbitrary index range? (Of course I can assign the constant to a var and then have an arbitrary index.)
18:05:06*brson_ quit (Quit: leaving)
18:05:13*brson joined #nim
18:11:47*gokr joined #nim
18:15:05Arrrryep, you can do va const H: array[char, char]
18:15:08*stefantalpalaru joined #nim
18:15:57stefantalpalaruHi. Can somebody please regenerate the makefile and help me fix this issue? https://github.com/nim-lang/csources/issues/19
18:17:38stefantalpalaruIn case you're wondering, I can parallelize the compilation using the makefile instead of build.sh and the speed gain is worth it.
18:17:41*vendethiel quit (Ping timeout: 255 seconds)
18:21:37*vendethiel joined #nim
18:24:58*pregressive quit (Read error: Connection reset by peer)
18:25:22*pregressive joined #nim
18:25:36*Jesin quit (Quit: Leaving)
18:30:26Araq_stefantalpalaru: I don't know how the makefile was generated. ping def- ?
18:31:13stefantalpalaruthe comment at the top says "To regenerate run ``niminst csource`` or ``koch csource``"
18:31:25federico3dom96 or others: does anyone wants to elaborate on https://news.ycombinator.com/item?id=10931611 ?
18:31:42*askatasuna quit (Ping timeout: 256 seconds)
18:32:45*buMPnet quit (Remote host closed the connection)
18:33:06*buMPnet joined #nim
18:33:58stefantalpalarufederico3: I don't think Nim offers the kind of concurrency and parallelism guarantees that Pony does. Maybe the commenter confuses the 2 languages.
18:34:22federico3...pony?
18:35:00stefantalpalaruhttp://tutorial.ponylang.org/
18:35:14stefantalpalaruthey were in the news recently for a release
18:35:50federico3*_*
18:35:59stefantalpalaru"the type system ensures at compile time that your concurrent program can never have data races" - I don't think even Haskell does that
18:36:16XeIIRC nim has that
18:38:40*Senketsu joined #nim
18:39:46ldleworkYeah it does
18:39:55ldleworkI've never pushed it to the limit and tried to break it though
18:40:16federico3people really don't get the case insensitivity
18:42:18stefantalpalaruhttps://en.wikipedia.org/wiki/Race_condition#Software - anybody has an example of 2 threads accessing the same memory location in parallel, without locks, and the compiler catching it?
18:42:40ldleworkstefantalpalaru: there is an example on the front page!!
18:42:45ldleworkthe /front page!/
18:42:48ldlework:)
18:42:50Araq_ldlework: not anymore ;-)
18:42:53ldleworkoop
18:42:56ldleworklol
18:43:05Araq_it's not that it didn't work.
18:43:37Araq_it's just that the proof engine was really stupid and would reject valid code
18:43:49Araq_for no obvious reason.
18:44:03ldleworkAh
18:44:08ldleworkDid we deprecate the feature for now?
18:44:18Araq_we moved it to .experimental
18:44:44Araq_it's pretty cool nevertheless, it's just a lot of work left
18:45:01ldleworkneat
18:45:05*Matthias247 joined #nim
18:45:28ldleworkDoes it use complicated math and stuff, or could someone like me just add in tons of heuristics and stuff to get it to work better and better over time?
18:45:56Araq_it uses complicated math and adhoc control flow algorithms
18:46:02Araq_sorry.
18:46:41*Trustable_2 joined #nim
18:46:49*Trustable quit (Read error: Connection reset by peer)
18:47:11ldleworkhehe no problem just curious :)
18:47:13*desophos joined #nim
18:47:41Araq_but in general these "safety over everything" programming languages (like Pony and Rust) have problems with expressiveness.
18:47:53stefantalpalarutrue
18:48:01Araq_creating a safe language is not hard, it's in fact trivial.
18:48:26Araq_"index out of bounds? no problem, we make indexing use modulo array-length"
18:48:35ldleworklol
18:48:52Xethat's one way lol
18:48:55ldleworkThat pcwalton guy does a lot to hurt Nim's image in a time when memory-safety is king/popularized though.
18:49:11Xeoh, where's the string type defined in the nim compiler?
18:49:21ldleworkMaybe hold off 1.0 for a couple of years until the fad wears off.
18:49:24ldlework:P
18:49:58ldleworkEveryone will eventually realize that noone's life depends on their shitty web software written in Rust and flock away
18:50:39Araq_lol, I like Rust but I don't see the need to shit on under-staffed competitors
18:50:43ldlework(I don't mean to say that software written in Rust is shitty, just that the mainstream is looking at rust right now, so there is bound to be tons of really poorly written software in Rust in the next few years)
18:50:53ldleworkI'm not shitting on Rust at all
18:51:05ldleworkRust is glorious progression.
18:51:28Araq_well with "under-staffed competitors" I mean Nim...
18:51:31ldleworkOh you were remarking .. yeah
18:51:41Xei have been considering trying to do haskell FFI from nim before
18:51:59Xei mean, you can call haskell from C
18:52:01Xewhy not nim?
18:52:34Araq_well you can.
18:52:50Xethe FFI barrier would be a bit insane i'd think
18:53:50Araq_I have written Nim code consisting only of .emit with C code in it just to get Nim's awesome build environment
18:54:04ldleworkAraq_: don't tell anyone that.
18:54:16Araq_ooops. too late.
18:54:38Xehmm
18:55:41*lagoon_monster quit (Quit: Page closed)
18:56:02Araq_xe: calling Nim code from C is documented btw: http://nim-lang.org/docs/backends.html
18:56:04Xehow fleshed out are effects?
18:56:10XeAraq_: yeah i've done it before
18:56:15Xevery nice actually
18:56:35dom96"lol, I like Rust but I don't see the need to shit on under-staffed competitors" couldn't have said it better myself
19:01:24*darkf_ joined #nim
19:01:57*darkf quit (Disconnected by services)
19:02:01*darkf_ is now known as darkf
19:04:20*irrequietus quit ()
19:06:59*yglukhov joined #nim
19:07:37*pregressive quit (Read error: Connection reset by peer)
19:08:10*pregressive joined #nim
19:08:58*buMPnet quit (Remote host closed the connection)
19:09:35*buMPnet joined #nim
19:11:46*buMPnet quit (Remote host closed the connection)
19:14:59*askatasuna joined #nim
19:16:16*libman joined #nim
19:16:54*libman bows guiltily.
19:17:08*libman left #nim (#nim)
19:17:52Araq_stefantalpalaru: to answer your question: It's really easy to create races in Nim, but the much bigger problem is that the non-shared-heaps create expressiveness problems
19:18:15stefantalpalaruOK
19:18:32Araq_we have lots and lots of ways to fight races though.
19:19:27Araq_but as long as "sorry, the stdlib has no shared dict" is the real problem I am not concerned with the races
19:20:57Araq_especially since I know how to fight them. I'm pretty confident in our '.locks' annotation.
19:21:04pleiosaurAraq_: take the Go approach and just have the default map type be thread-unsafe :P
19:21:19ldleworkPlease take the anti-go approach in every case, thanks.
19:21:34*Salewski quit ()
19:23:08*bozaloshtsh joined #nim
19:26:53*biscarch joined #nim
19:33:29Araq_VM: Pegs do not work at compile-time. Do they work now?
19:48:54*Matthias247 quit (Read error: Connection reset by peer)
19:48:58*bozaloshtsh quit (Ping timeout: 250 seconds)
19:52:14*gokr quit (Quit: Leaving.)
20:00:43*Ven joined #nim
20:10:35*Demon_Fox joined #nim
20:19:46*Arrrr quit (Quit: WeeChat 1.2)
20:24:39*jsudlow quit (Ping timeout: 260 seconds)
20:25:26*jsudlow joined #nim
20:26:07*Senketsu quit (Remote host closed the connection)
20:28:04*wuehlmaus quit (Ping timeout: 245 seconds)
20:28:21*Senketsu joined #nim
20:53:27*bozaloshtsh joined #nim
20:55:13*wuehlmaus joined #nim
21:03:50*satbyy_ joined #nim
21:04:48*stefantalpalaru left #nim ("Leaving")
21:08:48*gokr joined #nim
21:12:28*xificurC joined #nim
21:22:10*askatasuna quit (Quit: WeeChat 1.3)
21:24:09yglukhovAraq: does pragma rtl have some special meaning?
21:26:45yglukhovdamn, i have to learn to wait for 2 minutes before asking a question...
21:27:56ldleworkwhat?
21:32:53ldleworkAraq_: here are the types I came up with to be able to express just type declarations: https://gist.github.com/dustinlacewell/957646128a24cd6c8141
21:32:57ldleworkAraq_: do you see any glaring holes?
21:33:51ldleworkthese types will render to the raw AST nodes, so we're mostly interested in whether or not I've covered type declarations in terms of the various semantically distinct terms that make them up
21:50:26*brson quit (Ping timeout: 272 seconds)
21:52:37*BitPuffin quit (Ping timeout: 276 seconds)
22:01:04*regtools joined #nim
22:01:46Araq_ TypeKind = enum tkNamed, tkTuple
22:02:04Araq_pretty sure you left out lots and lots of things ;-)
22:02:25Araq_distinct types, proc types, iterator types, concepts
22:03:01Araq_but you're overengineering things
22:03:29Araq_just model what you're confortable with and use NimNode as the fallback covering the rest
22:03:34Araq_*comfortable
22:03:34*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:04:46Araq_you're layering type safety and convenience on top of a system that was designed to cover Nim completely. it's perfectly fine to stop after a useful subset.
22:11:25*brson joined #nim
22:12:31*[1]jsudlow joined #nim
22:13:12*blob_ joined #nim
22:13:51blob_is it supposed to be possible to build nim 0.13.0 on windows?
22:14:40Araq_depends on how you build it
22:15:55blob_when trying to install it from github, I get "Error: unknown operating system: mingw64_nt-6.1"
22:16:02*jsudlow quit (Ping timeout: 276 seconds)
22:16:35Araq_well don't run .sh scripts on windows. windows has its own scripts
22:18:25*[1]jsudlow is now known as jsudlow
22:21:59blob_yeah, I'm an idiot. .bat works
22:23:16*desophos quit (Read error: Connection reset by peer)
22:25:35*blob_ quit (Quit: Page closed)
22:25:55*nchambers quit (Ping timeout: 240 seconds)
22:31:48*[1]jsudlow joined #nim
22:32:04*jsudlow quit (Ping timeout: 265 seconds)
22:34:01*[1]jsudlow quit (Read error: Connection reset by peer)
22:34:51*jsudlow joined #nim
22:34:55*darkf quit (Quit: Leaving)
22:35:20*Jesin joined #nim
22:37:15*[1]jsudlow joined #nim
22:39:12*kniteli quit (Ping timeout: 272 seconds)
22:39:19*jsudlow quit (Ping timeout: 245 seconds)
22:39:20*[1]jsudlow is now known as jsudlow
22:40:56*ephja quit (Ping timeout: 255 seconds)
22:42:30*Trustable_2 quit (Remote host closed the connection)
22:44:04ldleworkAraq_: yeah I was just encouraged by your words yesterday.
22:44:13ldleworkBut I guess you too are seeing the scope of the idea now too.
22:44:18ldleworkIts huge!
22:44:30ldleworkBut maybe not impossible if made iteratively...
22:50:23*derka_ joined #nim
22:52:56*derka quit (Ping timeout: 256 seconds)
22:52:56*derka_ is now known as derka
22:55:41*derka quit (Quit: derka)
23:02:56*pregressive quit (Remote host closed the connection)
23:03:29*pregressive joined #nim
23:05:26*jsudlow quit (Ping timeout: 240 seconds)
23:08:41*pregressive quit (Ping timeout: 276 seconds)
23:09:42*Matthias247 joined #nim
23:14:19*gokr quit (Ping timeout: 245 seconds)
23:14:55*jsudlow joined #nim
23:24:26*xificurC quit (Quit: WeeChat 1.3)
23:26:49*vendethiel quit (Ping timeout: 245 seconds)
23:30:38*derka joined #nim
23:35:52*jsudlow quit (Read error: Connection reset by peer)
23:36:34*jsudlow joined #nim
23:48:30*Matthias247 quit (Read error: Connection reset by peer)
23:51:08*jsudlow quit (Ping timeout: 255 seconds)
23:53:15derkaGuys
23:53:25derkathere is a typo in http://nim-lang.org/news.html#Z2016-01-18-version-0-13-0-released
23:54:02derkain the closure changes first example there is an additional ) at the end, so it should be s.add(proc(): int = return ii*ii) and not s.add(proc(): int = return ii*ii)))
23:56:15*desophos joined #nim
23:56:28*yglukhov quit (Remote host closed the connection)