<< 28-01-2016 >>

00:06:11*BitPuffin|osx quit (Ping timeout: 264 seconds)
00:06:18*derka quit (Ping timeout: 272 seconds)
00:09:26*pwernersbach quit (Quit: Page closed)
00:11:39*yglukhov quit (Remote host closed the connection)
00:12:10*rick__ quit (Quit: Page closed)
00:12:28*joe joined #nim
00:12:42*Demon_Fox joined #nim
00:14:51*ilariel quit (Quit: Page closed)
00:23:33*mat4 quit (Quit: Verlassend)
00:24:05*brson quit (Ping timeout: 260 seconds)
00:25:56*Demon_Fox quit (Ping timeout: 272 seconds)
00:26:24*Matthias247 quit (Read error: Connection reset by peer)
00:29:39*brson joined #nim
00:33:46*vendethiel quit (Ping timeout: 276 seconds)
00:40:10*polde quit (Quit: q)
00:46:15*Demon_Fox joined #nim
00:58:30Araq_rick__: not directly but sometimes you can get away with staticRead
01:10:28*Trustable quit (Remote host closed the connection)
01:13:27filwitrick__ already left
01:14:11*vendethiel joined #nim
01:23:00*joe quit (Ping timeout: 252 seconds)
01:24:10*ephja quit (Ping timeout: 260 seconds)
01:24:13Araq_he can read the logs
01:26:38*pregressive joined #nim
01:30:56*pregressive quit (Ping timeout: 240 seconds)
01:34:46*vendethiel quit (Ping timeout: 256 seconds)
01:51:45*gokr quit (Ping timeout: 245 seconds)
02:11:21*brson quit (Quit: leaving)
02:19:42*saml_ joined #nim
02:27:38*endragor joined #nim
02:29:30*girvo joined #nim
02:38:54*jleimgruber joined #nim
02:39:40*dyce joined #nim
02:40:01dyceCan nim compile a statically linked binary?
02:40:17dycelike go does?
02:40:21Xeyes, i'll look at how to do it
02:40:23Xesex
02:40:26Xesec&
02:40:31dyceor java uberjar
02:40:45Xehttps://github.com/Xe/Vardene/blob/master/Dockerfile#L7
02:41:24dyce--passL:-static does the trick?
02:41:39Xeworks for me!
02:41:42dyceand are there any tips for compiling for all platforms?
02:41:50dycewindows, osx, linux
02:43:03dyceim not too familiar with native C libraries
02:43:50filwitdyce: if you're compiling Nim on each of those platforms everything is pretty straight forward (granted you've installed Nim and GCC correctly)
02:44:29filwitdyce: if you're talking about cross-compiling (eg, building a Windows bin from Linux) then use the --os:windows command
02:45:41filwitdynce: there are a lot of other switches for setting things like CPU arch, etc.. take a look at the compiler user guide: http://nim-lang.org/docs/nimc.html
02:45:44def-wine also works for building windows binaries, might be easier than regular cross compiling with mingw
02:46:06jleimgruberhiya Nim folks, i'm a nim n00b, but just took a crack at writing "10 Nim One Liners to Impress Your Friends". http://blog.ubergarm.com/10-nim-one-liners-to-impress-your-friends/
02:46:44filwityes, wine or vitualbox, etc, could be easier than cross-compilation.. but that's not always an option for every platform.. if you want to target Android for example
02:47:10dycemmm so using wine to run the nim exe will not use mingw?
02:47:15filwithello, jleimgruber
02:47:42def-dyce: it will use the bundled windows mingw.
02:47:48dyceoh i see
02:47:59dycealso do you recommend a REST api framework?
02:48:05dycesimilar to python flask or bottle
02:48:37filwitdyce: i've never compiled windows bins using Wine, so I have no idea.. I've only done basic cross-compiling awhile ago.. I have a Linux/Windows/Mac available so I just use those directly
02:51:14filwitdyce: also can't really help you choose the best Nim web libs, sorry. Not really what I use Nim for, though a couple common web-related Nim libs I've seen are Jester and Emerald..
02:52:09dyceI found this: https://github.com/idlewan/nawak
02:52:17dycebut it wasnt updated since 2014
02:52:53def-jleimgruber: cool, nice to see more Nim articles!
02:53:05filwitdyce: there's this: https://h3rald.com/litestore/
02:54:06jleimgruberdef-: thanks! yeah, i wish there were more examples and people posting code snippets. no idea if my solutions are "correct" haha
02:54:51def-jleimgruber: about the TThread warning, the compiler should tell you what file and position is causing the warning, it's probably something in the stdlib
02:55:33def-jleimgruber: well, more readable than separating everything with ;
02:55:50dycefilwit: oh cool thats like couchdb
02:56:50jleimgruberdef-: ahh, its coming from lib/pure/concurrency/threadpool.nim 331, 334...
02:58:04jleimgruber` workers: array[MaxThreadPoolSize, TThread[ptr Worker]]
02:58:14jleimgruberso yeah, standard nim libs
02:59:07def-jleimgruber: oh right, would be fixed by my PR: https://github.com/nim-lang/Nim/pull/3106
02:59:19def-but you can just ignore it for the time being
02:59:36def-there's a style guide for a few things: https://github.com/nim-lang/Nim/wiki/Style-Guide-for-Nim-Code
03:01:06jleimgrubernice, i'll update my post to reflect... 2 day old PR, hot off the presses!
03:05:13*lankanmon quit (Ping timeout: 276 seconds)
03:07:44*lankanmon joined #nim
03:11:28*filwit quit (Read error: Connection reset by peer)
03:25:23*mountaingoat quit (Ping timeout: 264 seconds)
03:27:04*jleimgruber quit (Quit: WeeChat 1.0.1)
03:27:11*jleimgruber joined #nim
03:39:40*jleimgruber quit (Ping timeout: 250 seconds)
03:40:19apotheonIt's like some cruel joke, the way QWERTY puts X and C right next to each other.
03:42:56*mountaingoat joined #nim
03:47:56*aslogar joined #nim
03:49:40*saml_ quit (Ping timeout: 245 seconds)
03:58:55*bjz joined #nim
04:06:28*endragor quit (Remote host closed the connection)
04:07:09*aslogar quit (Quit: Page closed)
04:11:12*Varriount_ joined #nim
04:14:02*Varriount quit (Ping timeout: 265 seconds)
04:34:36*endragor joined #nim
04:47:12*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
04:51:03*dyce quit (Remote host closed the connection)
04:51:28*dyce joined #nim
04:53:41*samdoran quit (Quit: Page closed)
04:55:18*dyce quit (Remote host closed the connection)
04:55:42*dyce joined #nim
05:17:49*bozaloshtsh quit (Ping timeout: 276 seconds)
05:36:36*vendethiel joined #nim
05:52:30*lompik quit (Ping timeout: 260 seconds)
06:13:34*wuehlmaus quit (Quit: Lost terminal)
06:20:22*vendethiel quit (Ping timeout: 256 seconds)
06:21:49*vendethiel joined #nim
06:30:20*dMoult joined #nim
06:39:54*dMoult is now known as dHod
06:43:26*vendethiel quit (Ping timeout: 240 seconds)
06:50:17*vendethiel joined #nim
06:59:14*dHod quit (Ping timeout: 272 seconds)
07:08:39*bjz joined #nim
07:13:31*vendethiel quit (Ping timeout: 276 seconds)
07:14:49*vendethiel joined #nim
07:20:12*girvo quit (Quit: leaving)
07:26:09*gour joined #nim
07:27:01*vangroan joined #nim
07:31:00*darkf joined #nim
07:46:53*yglukhov joined #nim
07:47:10*gokr joined #nim
07:47:12*gokr quit (Read error: Connection reset by peer)
07:47:26*gokr joined #nim
07:56:16*vendethiel quit (Ping timeout: 250 seconds)
08:00:50*vendethiel joined #nim
08:01:33*vangroan_ joined #nim
08:02:27*vangroan__ joined #nim
08:02:51*lankanmon_ joined #nim
08:02:55*lankanmon quit (Ping timeout: 276 seconds)
08:04:35*vangroan quit (Ping timeout: 240 seconds)
08:06:11*vangroan_ quit (Ping timeout: 264 seconds)
08:11:22*vangroan__ quit (Ping timeout: 250 seconds)
08:13:36*vangroan__ joined #nim
08:18:41*apotheon_ joined #nim
08:19:26*apotheon quit (Ping timeout: 240 seconds)
08:28:50*Demon_Fox quit (Quit: Leaving)
08:30:04*mountaingoat quit (Ping timeout: 250 seconds)
08:40:06*Trustable joined #nim
08:42:50*vendethiel quit (Ping timeout: 260 seconds)
08:44:09*mountaingoat joined #nim
08:47:07*vangroan__ is now known as vangroan
08:47:17*desophos quit (Read error: Connection reset by peer)
08:59:57ldleworkWhat was the syntax for parsing that was made nicer by null termination?
09:01:13dom96ldlework: while true: case x[i]: of '\0': ...
09:01:27ldleworkI don't think that was it
09:01:48ldleworkbut similar reach
09:02:10Araq_while s[i] in {'a'..'z', 'A'..'Z'}:
09:02:21Araq_ ident.add s[i]
09:02:23Araq_ inc i
09:02:50Araq_sentinels are useful :P
09:21:39*qazwsx joined #nim
09:22:46*qazwsx quit (Client Quit)
09:23:03*qazwsx joined #nim
09:23:04*wuehlmaus joined #nim
09:25:22veganskAraq, hi!
09:26:05veganskCan you review https://github.com/nim-lang/Nim/pull/3776 again please?
09:29:38*bjz quit (Ping timeout: 256 seconds)
09:30:26*bjz joined #nim
09:36:19gourmorning
09:37:39gourniminst page at github says: "...Some support for Linux' package management systems is also included." and it seems there is support for creating *.deb. what else is planned, rpm?
09:37:49*bjz quit (Ping timeout: 276 seconds)
09:37:58*bjz_ joined #nim
09:39:01*coffeepot joined #nim
09:45:58*vendethiel joined #nim
10:21:01Araq_gour: dunno, is rpm even used anywhere still?
10:22:23Araq_but to support a new format you only need to write a tmpl file
10:27:29gouri'm fine with :deb running Sid, but e.g. Fedora/openSUSE..are rpb-based
10:31:53Araq_I don't think the input files for these package managers differ all that much
10:32:30flyxI know people who strongly argue that they do
10:32:52*RG92 joined #nim
10:35:20Araq_do they happen to have beards?
10:37:45*ephja joined #nim
10:46:25flyxyes
10:54:40*vendethiel quit (Ping timeout: 260 seconds)
10:55:42*Dildosan joined #nim
10:55:54Dildosanhello
10:57:28reactormonko/
11:00:49Araq_hi Dildosan welcome
11:01:11*qazwsx quit (Quit: qazwsx)
11:02:24veganskAraq, I removed lazy inet_ntop detection and reverted to check at startup. But the old PR looks ugly for now, so I created the new one: https://github.com/nim-lang/Nim/pull/3787
11:02:59Dildosanhi Araq_, Nim is amazing, gj making it
11:04:58dom96hello Dildosan!
11:05:21Araq_thanks, always nice to hear. :-)
11:10:53*Matthias247 joined #nim
11:17:41*vendethiel joined #nim
11:29:52wuehlmausAraq_: after reading much about nim i have to say that Nim is really amazing and i am telling everyone in my computer company about it :)
11:30:16wuehlmausand it's so wonderfully short to write
11:30:23*pregressive joined #nim
11:31:43wuehlmausand so fast to execute, too, a dream come true.
11:34:35*pregressive quit (Ping timeout: 240 seconds)
11:37:44coffeepotI feel this way too about Nim, and it's spoiled me for writing in other languages!
11:38:22coffeepotI've not even touched macros yet either :D
11:39:46coffeepotsomething I really like is how good it is to reuse code. Even little things like passing (a: int | float | byte) and stuff just makes life so much simpler
11:39:58*SneakySnake joined #nim
11:40:39coffeepotoften I'll look up some module in the stdlib and despite seeming like it'd be quite complex, it's a tiny bit of code. I think that really shows what makes nim fun to code in
11:41:08nivspeaking about concise and pretty, what's the most elegant nim-ish way to find the first element in a seq/array that matches a condition?
11:41:51nivsequtils has filter(proc), but that grabs all - i want the search to stop at the first match. something like first(proc).
11:43:39coffeepothmm niv, I'm not sure of the most elegant way, but I'd imagine it'd be simple to do it as an iterator
11:43:57nivyeah thats what im doing now. for x in items(): if(..) break
11:47:44reactormonkniv, look for a "find" proc, if there isn't one, write one.
11:48:10*SneakySnake left #nim ("Leaving")
11:48:23wuehlmausfind is in nre at least
11:48:58wuehlmausi was wondering why nre does not have =~ while re and pegs have it. was it forgotten?
11:49:52*qazwsx joined #nim
11:51:07*qazwsx quit (Client Quit)
11:51:59*qazwsx joined #nim
12:04:26*vendethiel quit (Ping timeout: 240 seconds)
12:06:01*vendethiel joined #nim
12:23:02*apotheon_ quit (Ping timeout: 256 seconds)
12:26:51*apotheon joined #nim
12:28:46*vendethiel quit (Ping timeout: 240 seconds)
12:32:12*vendethiel joined #nim
12:33:50*RG92 quit (Quit: ChatZilla 0.9.92 [Firefox 44.0/20160123151951])
12:33:52*aziz joined #nim
12:38:14*BitPuffin joined #nim
12:53:56*vendethiel quit (Ping timeout: 240 seconds)
12:57:53*junw joined #nim
13:00:37*vendethiel joined #nim
13:04:53*BitPuffin quit (Disconnected by services)
13:05:01*itPuffinB joined #nim
13:06:13*itPuffinB is now known as BitPuffin
13:18:34*junw quit (Ping timeout: 256 seconds)
13:24:47*vendethiel quit (Ping timeout: 264 seconds)
13:26:37*qazwsx quit (Quit: qazwsx)
13:26:49Araq_wuehlmaus: people dislike magically introduced local variables like the 'matches' array
13:32:03*bozalosh1sh joined #nim
14:02:03*junw joined #nim
14:04:35*dom96_ joined #nim
14:08:49*gour quit (Quit: WeeChat 1.3)
14:12:58*gour joined #nim
14:15:46dom96_yay, Nim in Action is on HN.
14:17:17coffeepotcongratulations dom96 :)
14:17:49coffeepothow long with the code stay active?
14:21:31reactormonkdom96_, link?
14:21:52dom96_reactormonk: look at front page ;)
14:22:09dom96_coffeepot: around 48 hours
14:22:36reactormonknice
14:23:44coffeepotcool nice one :)
14:30:26*dHod joined #nim
14:31:34*dHod left #nim (#nim)
14:32:25*qazwsx joined #nim
14:35:35dom96_Traffic spike due to HN is truly amazing. 146 users on the Nim website right now.
14:36:04coffeepotwow cool!
14:37:56*niv quickly closes tab
14:48:59*dashed joined #nim
14:52:04jsudlowjust saw your amsterdam talk araq, pretty cool man!
14:53:03*gour just placed order for NiA book
14:58:33dom96_gour: Thank you! :)
14:58:38dom96_niv: why closing the tab?
14:58:52nivjust a lame joke
14:59:17gourdom96_: p+e version ;)
14:59:41dom96_gour: nice!
15:00:24dom96_niv: wanna be safe in case your tab breaks our web server? :P
15:00:38gourdom96_: with a coupon code, it's really not much...i know that writing book is just a labour of love
15:01:17coffeepotyeah didn't expect a book to come out so soon tbf, good job plugging away at that behind the scenes! :)
15:02:03nivdom96_: yeah, thats exactly it! :p but i'd extend congrats to you as well, huge effort that goes into it, i know
15:02:20dom96_niv: Thank you! :)
15:02:34dom96_coffeepot: yeah, it was hard not talking about it here!
15:02:56coffeepotI can only imagine! Well done dude )
15:02:57coffeepot:)
15:03:41dom96_gour: yeah. I think it's pretty cheap even without the code. But I suppose it depends on where you live.
15:04:02*gour is from Croatia
15:04:22*bozalosh1sh quit (Ping timeout: 272 seconds)
15:04:56nivits a decent price for such a technical work (even though i havent looked at it myself yet)
15:05:14gokrMuahaha, let's see if pcwalton drops in now...
15:05:42dom96_gokr: hah, just read your comment. Hope HN doesn't crucify you for it!
15:05:49gokrHe had it coming.
15:06:21gokrOnce is fine, twice is ok. Three times and more? It was getting obvious that he just HAD to dump every time.
15:06:29dom96_Kinda bad timing with this HN thread... in a FOSS conference at the minute.
15:06:40dom96_Feel bad for not listening to people talking
15:07:08gokrbah, programming conferences - noone listens. Everyone is hacking instead :)
15:07:22*vangroan quit (Ping timeout: 256 seconds)
15:09:11gouri bet there is no more 'fear' from wikipedia to rm the article after book is in preparation
15:09:47dom96_ekarlso: Currently listening to a HP Cloud guy give a talk :)
15:09:54dom96_(About OpenStack)
15:10:14dom96_gour: hah, unless they say "Well... it's not a secondary source because a Nim developer wrote it"
15:11:07gourdom96_: well, due to that and similar cases I stopped contributing to them
15:11:20coffeepotsomeone on HN said "perhaps selling the book as aimed more at system/game [dev]". You know, if you ever write another book, or add a chapter on game dev, that would be amazing
15:11:48coffeepotguiding through writing a simple asteroids game in sdl2 or something
15:12:47gouri'd be happy by just having some decent gui bindings available, awaiting new wx-based
15:12:53coffeepotpersonally i disagree with his perspective though - I think focusing on webdev is a great idea.
15:13:23coffeepotgour: yes, that's why I think it's savvy to focus on webdev for now, as it's almost a form of GUI
15:13:51nivquick interjection: how do i make a table of any => type? I want to store a mapping of enums to actual type references. is that possible?
15:14:06gourcoffeepot: i can understand/justify decision considering the whole world is crazy about web, but i still believe taht Nim deserves better usage than that ;)
15:14:15coffeepotaraq mentioned getting async to work with multithreading, if jester uses async, that could be quite interesting since it scores well on single threaded benchmarks
15:15:34coffeepotgour: definitely but I feel like webdev is a huge driver of developer interest and well suited to 'scripting' stuff quickly, and nim's metaprogramming allows DSLs to be created so easily that it's probable we could build our own django competition in theory
15:15:48coffeepotniv: I'd like to know this too, afaik it's not possible
15:15:58nivhmm, right
15:16:05coffeepotniv: you mean storing typedesc right?
15:16:13flyxniv: there is no „any“ in a static type system.
15:16:16nivyes, i want to be able to check a object against a type at runtime
15:16:34nivi guess thats true flyx :)
15:16:38coffeepoti was building an entity component system and wanted exactly that
15:16:43flyxsince there is no „any“, there is no need to check an object against a type at runtime, because the type is already known.
15:16:45coffeepoti ended up working around it
15:17:48coffeepotit would be neat if we could store, say, a list of types (or as niv wants a table of types)
15:18:00flyxwhy?
15:18:05flyxwhat's the use case?
15:18:24coffeepotwell, so that you can create things from their types at run time
15:19:04flyxif you don't know the type, you wouldn't be able to provide a variable to store the result of this action
15:19:21coffeepotfor example I wanted to have an ECS that you could say entity.add(PhysicsData) etc
15:19:55coffeepotin the end I had to go entity.add(idPhysicsData) and then associate that int ID with the type
15:20:37flyxyou can implement add as a template, then you can have PhysicsData as typedesc argument
15:20:54coffeepothuh, well that's a good point :)
15:20:59coffeepotdidn't think of that
15:22:15flyxthat's how newException works, for example.
15:22:21*gour quit (Quit: WeeChat 1.3)
15:23:01*gour joined #nim
15:23:45flyxniv: what's your use-case?
15:23:55flyxit's probably also solvable at compile time
15:24:30nivflyx: im unpacking binary data into distinct types through explictily giving generic types to a unbox proc, like so:
15:24:39dom96_The reason for myself focusing on web dev so much is because I know it best
15:25:09coffeepotflyx: huh... just looked at the newException code. Might have to redo my ECS now. Tbh I got to rework it anyway cos it's sloooooow so this is a good opportunity to make it a bit slicker
15:25:13coffeepotcheers :D
15:25:22nivflyx: https://gist.github.com/niv/f735661a7a142f457d15
15:25:27dom96_I also want to share my beautiful async await stuff ;)
15:25:52nivi want to map the field type thats stored in the binary stream to a generic type (at compile time), so i can check the type on unpack
15:26:05coffeepotdom96_ I'm trying to learn webdev so the approach in your book is great for me :D
15:26:53flyxniv: I don't completely understand what you're doing, but perhaps this helps you: https://github.com/flyx/NimYAML/blob/master/yaml/serialization.nim#L307
15:27:19flyxyou can overload a proc taking a typedesc with type parameters
15:27:20gourdom96_: still it would be nice to mentions that Nim is completely adequate to write desktop apps as well :-)
15:27:24nivflyx: dont worry, i dont completely understand what im doing either
15:27:36nivwhats the difference between type T and typedesc[T]?
15:27:40dom96_gour: I'll make a note to emphasise that :)
15:28:22flyxniv: typedesc[T] may be used as a proc parameter (although it's handled at compile time)
15:28:39flyxthink of it as kind of like C++ template specialization
15:28:50nivbut im using my (constrained) generic as a proc param too
15:29:13gouri also hope people will start doing it since I'm sure the experience would be much better (with decent bindings) than with Ada/D/Go/Pascal (Lazarus)/Rust/...
15:29:20flyxyes, you can input a generic type parameter into a typedesc[…] param
15:29:46flyxnim will resolve the overloaded proc at compile time based on the actual type
15:29:58nivmy understanding problem is a bit deeper. i'm using "type T" as a type to a param to my proc and that seems to work too?
15:30:22nivit picks the correct type variant at least, at compile time
15:31:19flyxI never used type T, so I don't really know what it does
15:31:36nivalright
15:31:39*pregressive joined #nim
15:32:19flyxmy point is, if you want to check whether T is ord, you can use proc isOrd(t: typedesc): bool = false // proc isOrd(t: typedesc[ord]): bool = true
15:32:28dom96_gour: I hope that yglukhov's nimx will take off as a GUI toolkit
15:33:00gourdom96_: native? D now has dlangui...
15:33:36dom96_gour: no, its drawn using sdl
15:34:24gourdom96_: do you believe it can stand out being suitable for desktop apps or more for games?
15:34:50dom96_gour: good question. I think it depends on what type of desktop app.
15:35:11gourdom96_: more or less 'classical' or business-one type
15:35:36dom96_It probably leans more for games though
15:35:42dom96_or for tools for games
15:36:21gouryeah, that's my impression as well...
15:37:03nivflyx: i guess my question is, can i use a generic type parameter in a comparison operation inside a proc? i guess not?
15:37:12ldleworkgokr: bad idea to get defensive with pcwalton
15:37:16nivit would have to generate different variants based on that comparison
15:38:19nivsomething like proc (mytype: typdesc[T]) = .. if mytype == TypeClassIUse: ..
15:42:09nivflyx: if you'd care to look, i've shown what i want here https://gist.github.com/niv/f735661a7a142f457d15 -- i want to check the generic type against the param passed in. i was hoping to put that into a const table and then compare without writing a generic procs for each type
15:42:28nivbut i suspect that cant be done with the generic/static type system nim has, right?
15:44:35*apotheon quit (Ping timeout: 260 seconds)
15:51:53coffeepotniv: have you looked at the introspective object streaming module marshall.nim?
15:52:13coffeepotnot sure what format that uses though
15:52:54nivi'll check, thanks
15:55:41*apotheon joined #nim
15:56:24coffeepotit's json format
15:57:39coffeepotbtw how would I get my odbc lib on here http://nim-lang.org/docs/lib.html
15:58:45ldleworklink?
15:58:49ldleworkoops
15:59:29coffeepotidlework link to my odbc lib or was that a mischat
15:59:36coffeepot?
16:00:42coffeepotand looks like i need to sort out nimble publishing for that... I lazied out when i couldn't get the github token working first time
16:02:12*orangejuice joined #nim
16:02:31orangejuiceHi. Following along Nim book chpt1 from Hacker News.
16:03:08orangejuiceinstalled via sudo sh install.sh /usr/local/bin. But nimble package manager doesn't seem to be working
16:03:43dom96_orangejuice: that's a bug with the `install.sh` installation method, sorry about that.
16:04:12dom96_The simplest workaround would be to not install using install.sh, but just adding `nim` to your PATH
16:05:18dom96_The issue in question: https://github.com/nim-lang/nimble/issues/203
16:07:34orangejuiceOk. /usr/local/bin/nim and /usr/local/lib/nim
16:07:42orangejuiceRemoved those. Will try again from source.
16:07:46*qazwsx quit (Quit: qazwsx)
16:07:54gokrldlework: I don't care.
16:08:34orangejuiceWish I could help improve the website and documentation.
16:09:46reactormonkorangejuice, think of a few examples and add them.
16:09:46*vendethiel joined #nim
16:11:32coffeepotorangejuice the source is here i think if you want to make a pr https://github.com/nim-lang/Nim/tree/devel/web
16:11:34flyxniv: you should be able to check the type of a generic parameter with "when type(T) == type(int)"
16:11:54nivoh, when. of course. nice. thanks
16:12:29orangejuiceI'm not a real programmer. But the python like feel and go like tooling is real cool in Nim. so came in to check it out.
16:13:06orangejuiceDefinitely keep an eye out. And as I understand the lang more, I'll adding some pages
16:13:40*BitPuffin quit (Ping timeout: 256 seconds)
16:17:29*sdegutis joined #nim
16:18:06*sdegutis quit (Client Quit)
16:19:58reactormonkorangejuice, examples for any kind of function in the documentation would be real nice.
16:21:25coffeepotespecially nice to have new eyes give perspectives for documentation
16:23:32*bozalosh1sh joined #nim
16:24:27*orangejuice quit (Ping timeout: 252 seconds)
16:28:45*Jesin quit (Quit: Leaving)
16:32:35*vendethiel quit (Ping timeout: 240 seconds)
16:42:43*Trustable quit (Remote host closed the connection)
16:43:41*Trustable joined #nim
16:47:42*vendethiel joined #nim
16:49:12*dom96_ quit (Ping timeout: 252 seconds)
17:02:11*BitPuffin joined #nim
17:04:33*coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
17:05:22*Dildosan quit (Remote host closed the connection)
17:08:06*vendethiel quit (Ping timeout: 240 seconds)
17:08:10Xedom96: liked the first chapter of nim book
17:14:12*bozalosh1sh quit (Ping timeout: 272 seconds)
17:15:37*vendethiel joined #nim
17:16:02*xet7 joined #nim
17:17:14reactormonkXe, now read the others ;-)
17:19:28Xereactormonk: gotta wait for a paycheck :D
17:20:19*ldlework quit (Remote host closed the connection)
17:23:19*BitPuffin quit (Ping timeout: 265 seconds)
17:25:26gourreactormonk: thank you for nim-mode!!
17:26:11reactormonkgour, thank yuutayamada, I'm just sitting in my chair and looking important.
17:26:24reactormonkhttps://github.com/nim-lang/nim-mode/graphs/contributors
17:27:58gourreactormonk: well, that's also something ;)
17:28:01*xet7 left #nim ("Leaving")
17:30:20*dashed quit (Quit: Connection closed for inactivity)
17:36:26dom96Xe: Glad to hear that :)
17:44:51dom96Araq_: what happened to `nim pretty`?
17:48:50dom96oh, moved to nimfix
17:52:24*brson joined #nim
17:54:09federico3dom96: a lot of people complain about case/underscore insensivitiy claiming that "Foobar == FooBar" might introduce bugs. I'm thinking that the compiler could do an optional "linting" by printing a warning if the same variable is being named in different ways
17:57:26*vendethiel quit (Ping timeout: 240 seconds)
17:57:36*vendethiel joined #nim
18:00:10dom96federico3: perhaps, I don't understand people's fears though
18:00:21dom96They simply need to *try it* :)
18:03:11federico3on one side, yes. OTOH a lot of people might refuse to try it because of that, and maybe knowing that there is a linting option would make them feel safer
18:10:29*gour quit (Quit: WeeChat 1.3)
18:15:05*yglukhov quit (Ping timeout: 245 seconds)
18:18:04nivis there a prettier way to do: for x in 0..(len-1): ?
18:18:11nivsomething like for x in times(len):
18:22:02*allan0 quit (Quit: no)
18:23:11Araq_niv: for x in 0..<len
18:23:24Araq_is slightly nicer
18:23:32nivah. :)
18:24:17nivIs there a way to do list comprehensions? let myseq: seq[int] = for x in 0..<len: x
18:24:52*allan0 joined #nim
18:25:17Araq_there is something in future.nim but I forgot its syntax
18:25:54*ldlework joined #nim
18:25:54nivcrazy, thanks
18:28:22gmpreussnernow i want to know. what's the syntax?
18:29:35*allan0 quit (Ping timeout: 264 seconds)
18:30:10*silven quit (Ping timeout: 276 seconds)
18:30:30*silven joined #nim
18:35:07nivgmpreussner: lc[elem | iter, type]. for example, lc[$x | x <- 0..<5, string] => @[0, 1, 2, 3, 4]
18:36:12*allan0 joined #nim
18:38:09gmpreussnerinteresting. thanks niv!
18:38:10ldleworkhi gmpreussner
18:38:20gmpreussnerhey ldlework
18:40:49*qazwsx joined #nim
18:42:27*qazwsx quit (Client Quit)
18:45:49*gour joined #nim
18:45:58*brson quit (Ping timeout: 265 seconds)
18:47:11*brson joined #nim
18:53:02*yglukhov joined #nim
18:53:32nivwell, i managed to break it somehow. clang compiler errors ..
18:57:28*yglukhov quit (Ping timeout: 250 seconds)
18:59:37*qazwsx joined #nim
19:05:13*Varriount_ is now known as Varriount
19:05:26*endragor_ joined #nim
19:05:26*Salewski joined #nim
19:06:49SalewskiI am not sure how to write something like this best in Nim:
19:06:57Salewskiif expensiveProc(a) == 1 or expensiveProc(a) == 6:
19:07:37gmpreussnerlet x = expensiveProc(a); if x == 1 or x == 6 ...
19:07:42SalewskiCreate a temp variable, or just hope that compiler will do it good?
19:07:46*endragor quit (Ping timeout: 240 seconds)
19:08:14VarriountCreate a temp variable, if nothing else for readability.
19:09:22SalewskiOO, thanks. Indeed in the past I always used a temp variable -- seems that is still the way to go.
19:10:27VarriountIt's doubtful a the store/load required will take too many cycles, especially with register renaming and such.
19:12:50Xewhere can I get a nim sticker?
19:14:49*desophos joined #nim
19:15:47wuehlmausor a T-shirt "Have you tried nim today?" :)
19:17:56Xehow do you do signal handling in num?
19:21:51def-Xe: ctrl-c or other signals? There's setControlCHook in the system module
19:22:03Xedef-: other signals
19:22:20def-Xe: posix module: http://nim-lang.org/docs/posix.html#signal,cint,proc(cint)
19:22:34Xeah, I see
19:22:36Xethanks
19:22:51def-there is no higher level module for signals yet
19:24:14def-niv: clang compiler error should be reported at https://github.com/nim-lang/nim/issues if it isn't already
19:24:36nivdef-: i know, but cant for the life of me find a simple test case
19:26:06Araq_niv: so submit a complex test case
19:26:24Araq_as I keep saying I don't want to overfit the compiler to toy examples anyway
19:27:00nivwill do, once i have cut down my library to an example. it's somehow related to specific int typing - myseq[int32] instead of [int], then referencing that somewhere
19:33:07VarriountXe: If someone has a link to that honey badger illustration that filwit made as the Nim mascot, I could come up with a T-shirt design to submit to Zazzle or something.
19:35:25VarriountOr wait, I think dom96 already did that.
19:35:45*yglukhov joined #nim
19:35:47Varriounthttp://forum.nim-lang.org/t/1624
19:37:40*endragor_ quit (Ping timeout: 256 seconds)
19:38:21*jsudlow quit (Read error: Connection reset by peer)
19:39:05*jsudlow joined #nim
19:45:05*[1]jsudlow joined #nim
19:46:57*[1]jsudlow quit (Client Quit)
19:47:15*jsudlow quit (Ping timeout: 240 seconds)
19:49:25*aziz quit (Remote host closed the connection)
19:59:50flyxI got „internal error: expr: var not init :env_250921“ while compiling. :env seems to be the var that's not initialized, what is it?
20:00:11*endragor joined #nim
20:01:00dom96Varriount: I don't think we should use that mascot, it's a bit unfriendly
20:04:02*endragor quit (Remote host closed the connection)
20:07:15flyxdom96: I'd really like to have one of those stickers…
20:08:11Araq_flyx: that is something completely impossible, cause I fixed every LL bug ... *barf*
20:08:31flyxAraq_: I'll try to come up with a minimal example
20:11:21*darkf quit (Quit: Leaving)
20:14:10*qazwsx quit (Quit: qazwsx)
20:17:12*junw quit (Ping timeout: 250 seconds)
20:18:56*silven quit (Ping timeout: 250 seconds)
20:19:36*silven joined #nim
20:20:30dom96flyx: I'm planning on purchasing more of those and allowing everyone to buy them on the Nim site.
20:21:53def-Araq_: Does SharedString work already?
20:23:37*yglukhov quit (Remote host closed the connection)
20:24:09Araq_def-: never tested it
20:24:32flyxdom96: \o/
20:25:14dom96I got this really nice Red Hat earphones today
20:25:18dom96*these
20:25:39dom96They have the Red Hat logo on the back of them, would be cool to have Nim branded earphones :P
20:29:23*yglukhov joined #nim
20:37:56flyxAraq_: https://github.com/nim-lang/Nim/issues/3788 well that got pretty minimal
20:38:11flyxit's a different error than what I got before, but probably the same cause
20:49:35federico3dom96: https://github.com/terinjokes/StickerConstructorSpec
20:50:42*shodan45 joined #nim
20:54:43*gour quit (Quit: Using Circe, the loveliest of all IRC clients)
20:54:56*gour joined #nim
20:54:56*gour quit (Client Quit)
20:57:03*bozaloshtsh joined #nim
21:05:34*junw joined #nim
21:10:41*yglukhov quit (Read error: Connection reset by peer)
21:11:11dom96federico3: that would be cool
21:11:22*yglukhov joined #nim
21:11:42nivis taint mode something that is supposed to be developed on?
21:11:47nivor will it go away eventually?
21:12:25federico3dom96: Nimble is not aware of system libraries that a Nim library needs, is that right?
21:12:48Xefederico3: it is not no
21:13:09federico3Xe: you might guess why I was asking :D
21:13:33Xeyeah, C deps needs your system package manager involved
21:14:51federico3I think Nimble should help the user with that: the upstream dev could specify a required system lib in the .nimble file and Nimble could warn the users if the lib is not there
21:17:05dom96federico3: Yes, I have a plan for that.
21:17:41dom96With NimScript we should be able to create a script which you can import into your .nimble file, and use it to install system deps
21:17:57dom96but I need to think about that one more
21:19:23federico3Xe: readme updated
21:19:33Xefederico3: readme of what?
21:19:40federico3Xe: libnotify
21:19:44Xeoh that
21:19:46Xeyeah
21:20:37Xefederico3: you also need the `gtk2` nimble package
21:21:10federico3thanks
21:21:27Xenp
21:21:34federico3I'd like to have a way to list the required deps while doing a build
21:21:40Xeyou can
21:21:51Xehttps://github.com/FedericoCeratto/nim-libnotify/blob/master/libnotify.nimble#L9
21:21:53*qazwsx joined #nim
21:22:08federico3while doing a build
21:22:26Xelike system deps or nimble deps?
21:22:54federico3both ideally
21:24:54federico3e.g. I can list dynamic system libraries at runtime using strace
21:27:48Xemm
21:27:50Xeyeah
21:28:49ephjaniv: it does serve a purpose already, don't you think?
21:29:20nivephja: yes, absolutely. i was just trying it out and it failed on a pure lib at first attempt so i was wondering how much attention it receives in general
21:30:18ephjaniv: in what way?
21:30:36nivephja: https://github.com/nim-lang/Nim/issues/3789
21:34:24gokrdom96: Just be careful to not opening a can of worms... when you enable scripting in Nimble you may... regret it :)
21:34:49dom96gokr: it's already enabled, but yes, I'm keeping a close eye on it.
21:36:06dom96niv: It doesn't receive as much attention as it should unfortunately, would be awesome if you could help us ensure the stdlib works with taint mode.
21:36:07ephjaniv: right. I assume it will be kept. no one has tested the stdlib with taint mode much apparently
21:36:34*allan0 quit (Ping timeout: 250 seconds)
21:37:07*derka joined #nim
21:40:08nivalright :) i cant exactly promise extensive testing help, but maybe it could be added to the test suite. haven't even looked at that though
21:41:12*allan0 joined #nim
21:43:20*qazwsx quit (Quit: qazwsx)
21:49:01*Wildefyr joined #nim
21:56:28*bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
22:01:28*yglukhov_ joined #nim
22:01:29*yglukhov quit (Read error: Connection reset by peer)
22:02:30*allan0 quit (Ping timeout: 250 seconds)
22:07:21*allan0 joined #nim
22:12:52*Jesin joined #nim
22:22:10*zaquest quit (Ping timeout: 245 seconds)
22:26:01*vqrs quit (Max SendQ exceeded)
22:27:17*vqrs joined #nim
22:28:50*dashed joined #nim
22:30:13*mat4 joined #nim
22:31:59nivwhats the difference between cast[uint32](myint32) and myint32.uint32?
22:33:15*allan0 quit (Quit: no)
22:33:42*Dildosan joined #nim
22:34:08*zaquest joined #nim
22:36:11mat4to citate the manual: "ype casts are a crude mechanism to interpret the bit pattern of an expression as if it would be of another type. Type casts are only needed for low-level programming and are inherently unsafe."
22:36:33*Demon_Fox joined #nim
22:36:40*allan0 joined #nim
22:40:07nivmat4: yep, thanks. i want a cast in my case; however im wondering what .int32 does differently. cant find anything regarding that in the manual, and reading system.nim isnt very enlightening
22:41:13ldleworkniv: non-cast conversions must be field-alike, I think
22:41:35nivwhat's field-alike?
22:41:37ldleworkIE, you can't just convert between two struct types without writing a converter, even if they are the same total size
22:41:44ldleworktype
22:41:47ldlework A = object
22:41:53*xtagon joined #nim
22:41:53mat4I can't help in these case because I don't know this syntax. For me it seems myint32.uint32 references the element uint32 from the record myint32
22:41:55ldlework a: int
22:41:57nivah, right. so .type always calls a converter proc, otherwise fails if none exists?
22:42:12ldleworkmat4: no universal call syntax
22:42:19ldleworkthere is no .uint32 field
22:42:24ldleworkits uint32(myint32)
22:42:42mat4yes, that look familiar to me
22:43:33nivim (mis)using casts to read unsigned integer values from a stream. stream only provides GetIntXX(), not GetUIntXX() .. in case you're wondering :)
22:43:50ldleworkmat4: https://gist.github.com/dustinlacewell/5538fbad526b58743f09
22:43:59ldleworkPoint and Vector are field-alike
22:44:13ldleworkIf you tried to interpret the memory of a Vector as a Point, things will work out rationally
22:44:27ldleworkIf you try to interpret a Point as a BigInt, it wont make semantic sense at all
22:44:43nivyeah, got that
22:44:47ldleworkIf you had some strange type that had two fields that stored half of a big number, then you would have to fight the type system
22:44:49ldleworkand cast
22:44:54nivi was just wondering what type(xx) did, but i guess i figured it out
22:45:08ephjaniv: if the input doesn't fit in the target fail, then an error will be raised, but maybe you got that
22:45:11ldleworkIt, at compile time, asks the compiler to treat the symbol as a different type
22:45:19ephjas/fail/type
22:45:25nivtarget fail :D
22:46:08nivephja: yeah i got that. i just want a bit pattern ive just read from a stream to be considered a unsigned int. i could expand stream.nim i guess to provide unsigned accessors too ..
22:46:08ephjauint32.high for example is outside the int32 range
22:46:37nivyea
22:47:23ephjamaybe this is another case of discouraging unsigned integers
22:47:37ephjathe use of unsigned integers, rather
22:47:54nivi dont feel the need to be discouraged - the binary im parsing is explicitly supporting unsigned 32/64bit wide data types, so i kind of need to support it in my lib
22:49:55ephjaI'm saying that it might be why it's missing, similar to how unsigned operations were defined in the unsigned module before
22:49:55Wildefyranyone written a vim-syntax file yet for nim?
22:50:02ephjathough it was kind of backwards
22:50:08ephjaWildefyr: yes
22:50:31def-Wildefyr: https://github.com/nim-lang/Nim/wiki/editor-support
22:50:35mat4there exist some differencies (carry and borrow propergation) between signed and unsigned integer formats dependent of usage. Because of this discouraging unsigned integer formats would be disadvantageous in my opinion
22:51:14mat4as both are needed (or simplier to use)
22:54:31Wildefyrthanks def-
22:54:36Wildefyrworks like a charm
23:01:17Wildefyrwhat's wrong with install.sh?
23:01:17*yglukhov_ quit (Read error: Connection reset by peer)
23:06:26*vendethiel quit (Ping timeout: 240 seconds)
23:11:56*vendethiel joined #nim
23:12:09def-Wildefyr: it spreads the files in /usr/ and is not used by many people, so it has a few bugs
23:12:21*shodan45 quit (Quit: Konversation terminated!)
23:13:34mat4Wildefyr: it's simplier just to add your bin directory to the PATH variable
23:15:08*Dildosan quit (Quit: Leaving)
23:15:54gokrI love Jehan.
23:16:19mat4hi gokr
23:16:48gokrhey!
23:17:30gokrAraq_: https://news.ycombinator.com/item?id=10991702
23:18:12gokrmat4: How is it going? Doing anything fun?
23:19:19mat4quite well, I'm working on implementing a processor design for embedded usage
23:20:00gokrSounds cool. I am now working at Evothings - lots of toys at the office.
23:20:40Wildefyrmat4 : that's really not a solution for writing a maintainable pkgfile or equilivant
23:20:59gokrAnd playing at night with Ni :) I am fiddling with quoting etc right now - writing an article on the homoiconicity of Ni.
23:21:03Wildefyrguess I'll just use install.sh for now
23:21:40gokrWildefyr: I would advise against that :)
23:21:52Wildefyris my system gonna blow up?
23:22:09gokrNo, but... IIRC multiple nims can get confused about where to find libs etc.
23:22:15Wildefyroh
23:22:32gokrNim finds everything relative to its own location primarily.
23:22:50Wildefyrwell my package scripts keep track of where all components of the package were installed too
23:22:57gokrSo keeping it where its at works very well. Then you can have multiple nims - just point at the one you are using.
23:23:03gokr(with the PATH that is)
23:23:06Wildefyrif I update the version it'll update all those files
23:23:20gokrOk, sorry, perhaps I ... missed the context here.
23:23:26Wildefyryeah don't care too much about multiple versions
23:23:32Wildefyrjust want latest stable tarball
23:23:49gokrSo you are making a package for some distro?
23:23:58*gokr should read history...
23:24:02WildefyrI've already made it :)
23:24:09Wildefyryeah crux.nu
23:24:10mat4gokr: I had take a look at there web representance, quite interesting
23:24:14Wildefyra source distero
23:25:34gokrmat4: Yeah
23:26:02gokrNever used crux, but I did have a few years in the Lunar Linux community, also a source distro.
23:26:13Wildefyrah cool
23:26:15gokrWas fun but a total time sink of course.
23:26:35gokrBut I liked Lunar.
23:26:38Wildefyryeah, with crux it's mostly self-maintainable
23:26:42mat4I had a similar experience with Gentoo linux
23:26:45Wildefyrjust bump up package versions
23:27:33gokrLunar wasn't hard either - but you know... you get sucked in and then one day you realize that you have made 35 modules of your own and... well, was it really worth those hours? :)
23:27:44gokrBut it was fun.
23:27:45WildefyrYes! ,)
23:28:13gokrWonder if Lunar is still active...
23:29:11*yglukhov joined #nim
23:30:29*pregressive quit ()
23:31:29*Xe quit (Changing host)
23:31:29*Xe joined #nim
23:33:30*yglukhov quit (Ping timeout: 250 seconds)
23:33:30*vendethiel quit (Ping timeout: 250 seconds)
23:39:54def-http://hookrace.net/blog/writing-an-async-logger-in-nim/
23:47:51*vendethiel joined #nim
23:47:54*derka quit (Quit: derka)
23:53:00mat4ciao
23:53:03*mat4 quit (Quit: Verlassend)