<< 06-09-2017 >>

00:04:51*arnetheduck joined #nim
00:10:50def-pri-pubIf anyone here understands how async stuff works in Nim a bit better, I could use a little help with this:
00:10:53def-pri-pubhttps://forum.nim-lang.org/t/3146/1#19890
00:26:41*def-pri-pub quit (Ping timeout: 248 seconds)
00:30:41*Matthias247 quit (Read error: Connection reset by peer)
00:31:29*arnetheduck quit (Ping timeout: 248 seconds)
00:48:01*onionhammer quit (Ping timeout: 248 seconds)
01:00:57*def-pri-pub joined #nim
01:04:17skrylareh well, time to pack it up for github and nimble
01:04:30skrylardoes the round trip to object/string/epochtime
01:25:01*def-pri-pub quit (Quit: Lost terminal)
01:34:09*yglukhov joined #nim
01:38:39*yglukhov quit (Ping timeout: 248 seconds)
01:39:11*Kingsquee joined #nim
01:41:21*chemist69 quit (Ping timeout: 252 seconds)
01:48:25*onionhammer joined #nim
01:51:06*def-pri-pub joined #nim
01:54:50*chemist69 joined #nim
02:01:44*ipjk_ joined #nim
02:05:00*ipjk quit (Ping timeout: 252 seconds)
02:49:56*skrylar quit (Remote host closed the connection)
02:54:44*pilne quit (Quit: Quitting!)
02:57:04*dddddd quit (Remote host closed the connection)
03:37:30*def-pri-pub quit (Quit: leaving)
03:39:23*shashlick joined #nim
04:12:26*BigEpsilon joined #nim
04:22:25*rauss joined #nim
04:42:13FromGitter<Grabli66> Hi! Is it possible to set big-endian or little-endian for stream?
04:57:58*miran joined #nim
05:08:13*gokr joined #nim
05:13:02*Snircle quit (Ping timeout: 246 seconds)
05:27:59*shashlick quit (Quit: Leaving)
05:30:00*Snircle joined #nim
05:31:17*miran quit (Ping timeout: 260 seconds)
05:41:21*Kingsquee quit (Ping timeout: 240 seconds)
05:43:37*miran joined #nim
05:55:35*gokr quit (Ping timeout: 240 seconds)
05:55:57*BigEpsilon quit (Remote host closed the connection)
05:56:03*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
05:56:09*BigEpsilon joined #nim
06:16:05*miran quit (Ping timeout: 240 seconds)
06:24:16*Vladar joined #nim
06:27:49*nsf joined #nim
06:32:03*rauss quit (Quit: WeeChat 1.9)
06:33:00*rauss joined #nim
06:37:53*mahmudov quit (Remote host closed the connection)
06:43:39livcdi almost bought the nim book yesterday since it was on 50% discount
06:44:30AraqI almost like that
06:45:38livcdwell I really wanted but the price is still steep for me especially when I do not really have a need for it
06:45:45livcdmaybe on christmas :-)
06:50:41Araqno worries
06:54:37FromGitter<Grabli66> Is it possible to set big-endian or little-endian for stream?
06:55:21Araqno, you can use endians.nim to swap byte order though
06:55:44FromGitter<Grabli66> Ok.
06:56:58FromGitter<Grabli66> And why stream has readInt8, readInt16, etc, but does not have writeInt8, writeInt16, etc?
06:57:15*Arrrr joined #nim
06:57:15*Arrrr quit (Changing host)
06:57:15*Arrrr joined #nim
07:21:00*gokr joined #nim
07:28:02*claudiuinberlin joined #nim
07:37:18*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
07:43:00*xet7 quit (Quit: Leaving)
07:46:43*claudiuinberlin joined #nim
07:58:06*vivus quit (Quit: Leaving)
08:04:40*ipjk__ joined #nim
08:06:56*ipjk_ quit (Ping timeout: 248 seconds)
08:10:11*PMunch joined #nim
08:14:48*Matthias247 joined #nim
08:25:38*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:29:58FromGitter<BigEpsilon> Hi all
08:31:50FromGitter<BigEpsilon> @Araq , I updated my PR https://github.com/nim-lang/Nim/pull/6326
08:32:14FromGitter<BigEpsilon> hope It works now
08:33:08Araqwtf, Tarjan's algorithm
08:33:25Araqare you trying to beat me on my homeground? :P
08:33:41FromGitter<BigEpsilon> :P
08:33:59FromGitter<BigEpsilon> Honestly I didn't find a simpler way
08:34:29FromGitter<BigEpsilon> once you split the typeDefinition, merging them back is a mine field
08:34:40FromGitter<BigEpsilon> I needed to do that properly
08:36:29ArrrrGood stuff, this is what nim needs
08:36:31AraqI bet my solution was faster :P
08:36:45Araqbut good work, now ... do you think it's ready to be announced?
08:37:39Araqalso, top level include statements need to be expanded and then you need to test if my wxWidgets wrapper that previously used .noforward: on works with reorder: on instead
08:38:29FromGitter<BigEpsilon> I'm not sure because I dont know the language enough to be sure I didnt miss something
08:38:40FromGitter<BigEpsilon> Ok I can do that
08:39:24FromGitter<BigEpsilon> But what do you mean by expanding the top level imports ?
08:39:24*claudiuinberlin joined #nim
08:40:13Araqnot imports, includes!
08:40:17Araqbig difference
08:40:53Araqtype X = Dependency
08:41:07Araqinclude foo # contains
08:41:12Araqtype Dependency = int
08:41:34FromGitter<BigEpsilon> Ah ok I'll need to read the doc a little and think avout it
08:41:37Araqit's quite simple to do, I hope
08:41:50FromGitter<BigEpsilon> I hope :)
08:41:56Araqyou can just expand the includes before the algorithm starts
08:42:20FromGitter<BigEpsilon> Ok I'll try that
08:42:22Araqbut do not touch includes in a 'when' or stuff like that
08:43:14FromGitter<BigEpsilon> Ok
08:43:58Araqer ... are you aware the algorithm's analysis is a big heuristic?
08:44:32Araqthe dependencies are not accurate at all, does that matter for Tarjan's algorithm?
08:45:42FromGitter<BigEpsilon> what do you mean that they are not accurate ?
08:46:02Araqit's all an educated guess about how things will turn out
08:46:05Araq # not a DAG!
08:46:18FromGitter<BigEpsilon> ah yes
08:46:19Araq # rollback what we did, it turned out to be a dependency that caused
08:46:19Araq # trouble:
08:46:48Araqyou need to keep the order if things get messy
08:47:18FromGitter<BigEpsilon> the order is kept in normal cases
08:47:39FromGitter<BigEpsilon> but I should verify how a messy situation can occur
08:48:05FromGitter<BigEpsilon> For me a messy situation is a circular dependency
08:48:11Araqyes
08:48:16FromGitter<BigEpsilon> there are the legit ones
08:48:32Araqthe cycles can be fake though
08:48:45Araqproc bar() = foo()
08:48:54Araqproc foo() = bar("x")
08:49:00Araqproc bar(s: string) = echo s
08:49:05FromGitter<BigEpsilon> with tarjan's algorithm it is easy to analys such cases
08:49:28FromGitter<BigEpsilon> because they will be put in a strongly connected component
08:49:40Araqsee above, no real cycle but the analysis doesn't perform overloading resolution to see it
08:50:53FromGitter<BigEpsilon> In the worst case we will have to add more checks on the strongly connected components
08:51:51FromGitter<BigEpsilon> And somtimes the reordering will just fail
08:52:06*yglukhov joined #nim
08:52:09FromGitter<BigEpsilon> we should be able to detect when thats happens
08:52:13Araqyup, the important thing is that this failure keeps the original order
08:52:26Araqin the end the programmer knows best.
08:52:28FromGitter<BigEpsilon> I'll keep that in my mind
08:53:48FromGitter<BigEpsilon> The nodes in my graph have an Id which is their initial order
08:54:09FromGitter<BigEpsilon> so it is simple to re-arrenge them
08:56:01*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:56:37*yglukhov quit (Ping timeout: 255 seconds)
08:56:46FromGitter<BigEpsilon> your example with functions overloading compiles for example
08:57:25*sz0 joined #nim
08:57:25FromGitter<BigEpsilon> But I'm sure I can find one that does not
08:58:04Araqwell annotate random modules in compiler/ with {.reorder: on} and see if it breaks bootstrapping
08:58:29Araqthat's a serious smoke test then
08:59:06Araqyou can even go crazy and enable it for every module except 'system'
08:59:38Araq(ok ok, you can also try system)
08:59:58AraqI'd like to make this a default pass in Nim and not yet another pragma option people need to learn about
09:01:28*thomasross_ quit (Remote host closed the connection)
09:01:53*thomasross_ joined #nim
09:02:27*claudiuinberlin joined #nim
09:03:24*yglukhov joined #nim
09:05:40FromGitter<BigEpsilon> Ok I'll try that
09:08:48*BitPuffin|osx joined #nim
09:18:31*dom96|w joined #nim
09:20:56yglukhovdom96: hey
09:21:06dom96|whi
09:21:06yglukhovlets do smth about https://github.com/nim-lang/nimble/pull/401
09:21:46*couven92 joined #nim
09:21:53yglukhovhad to switch to my nimble fork to continue working =)
09:21:59dom96|wD:
09:22:04dom96|wOkay, i'll look into it tonight
09:22:52yglukhovok, thanks. need any input from me?
09:23:34dom96|wMake sure that you cannot reproduce my bug. Maybe try to do what I had done (as described in the issue)?
09:24:12dom96|wThe first thing I will do is try to reproduce it using your issue
09:24:25dom96|wMake sure that you've `nimble install`'ed it
09:26:09yglukhovdom96: i tried your exact steps, cnr
09:26:23yglukhovtried them again just now
09:27:12FromGitter<Grabli66> Has anyone tried nim-godot binding? Is it working? :)
09:27:20dom96|woh well, i'll try it again tonight.
09:27:43dom96|wYou'll just need to be patient :)
09:27:51yglukhovok
09:36:31*cspar_ quit (Ping timeout: 248 seconds)
09:39:00*cspar_ joined #nim
09:47:55*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:57:42*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
09:59:13*dom96|w joined #nim
10:01:01couven92@Yardanico, could you check unicode.editDistance now? I made a new optimization for the "skipping upper triangle part"... Most likely improvements are only going to show up with longer strings though....
10:01:05*cspar_ quit (Ping timeout: 240 seconds)
10:01:29*claudiuinberlin joined #nim
10:03:48*claudiuinberlin quit (Client Quit)
10:06:20*Matthias247 quit (Read error: Connection reset by peer)
10:06:55*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
10:10:15*Yardanico joined #nim
10:11:57couven92anyways, I think unicode.editDistance https://github.com/nim-lang/Nim/pull/6301 is ready now :)
10:12:19Yardanicohi everyone
10:12:23*skrylar joined #nim
10:12:40FromGitter<Yardanico> @Grabli66 yes, definitely working
10:12:48FromGitter<Yardanico> Guys from Xored Inc made it for their game
10:13:00couven92Hi Yardanico! :)
10:13:07FromGitter<Bennyelg> @Yardanico Hi
10:16:29*haha_ joined #nim
10:25:00PMunchcabhishek, you on?
10:26:15*ShalokShalom_ joined #nim
10:29:22*ShalokShalom quit (Ping timeout: 260 seconds)
10:32:01*claudiuinberlin joined #nim
10:32:05FromGitter<zacharycarter> o/
10:35:05FromGitter<zacharycarter> def-pri-pub: reviewing PR now, sorry just got back from camping
10:35:11*claudiuinberlin quit (Client Quit)
10:36:43FromGitter<zacharycarter> @Grabli66 from my understanding yes godot-nim is working or nim-godot
10:37:03Yardanicogodot-nim
10:37:07Yardanicohttps://github.com/pragmagic/godot-nim
10:37:14FromGitter<zacharycarter> that be the one
10:37:27Yardanicoit auto-generated high-level bindings
10:37:55Yardanicoexample
10:37:55Yardanicohttps://github.com/pragmagic/godot-nim-stub/blob/master/src/fpscounter.nim
10:43:09*dom96|w joined #nim
10:50:03FromGitter<mratsim> Godot is shiny
10:50:38*dddddd joined #nim
10:51:52FromGitter<Grabli66> And will be godot-nim works in web browser with webassembly?
10:54:05YardanicoGrabli66: not sure, but maybe it could
10:54:17Yardanicowell this is not top-priority for godot-nim developers :)
10:54:48FromGitter<Grabli66> Sad
10:54:53*dom96|w quit (Read error: Connection reset by peer)
10:56:15Yardanicouse nimgame2
10:56:58Yardanicohttps://github.com/Vladar4/nimgame2 and https://github.com/Jipok/Nim-SDL2-and-Emscripten
10:58:00FromGitter<Grabli66> I want 3D in browser. And dont want write game engine. It's very hard.
10:58:26Yardaniconimgame2 is a game framework
10:58:29Yardanicowell
10:58:32FromGitter<mratsim> Unity already has web browser plugin and I’m pretty sure they will write a WebAssembly version
10:58:33Yardanicouse unreal engine4 :)
10:58:44Yardanicomratsim: but unity can't support nim :)
10:58:48Yardanicoand web browser plugin uses NPAPI
10:58:48FromGitter<Grabli66> I hate unity :)
10:58:55Yardanicoso it doesn't work in any of modern browsers
10:59:06Yardanicobut they have asm.js version
10:59:26YardanicoGrabli66: https://github.com/pragmagic/nimue4
10:59:42Yardanicobut it would be not like pure-nim
10:59:49Yardanicobecause you'll have to use pointers and stuff like that
10:59:59Yardanicobut it's a "3d game in browser"
11:01:04FromGitter<Grabli66> Unity and ue4 makes a large javascript output.
11:01:13Yardanicoyes
11:01:21Yardanicobut "And dont want write game engine. It's very hard."
11:01:29FromGitter<mratsim> What do you recommend as a vim plugin for Nim, zah’s: https://github.com/zah/nim.vim or baabelfish’s: https://github.com/baabelfish/nvim-nim. (Or even better, a way to edit remotely in VScode that doesn’t use “rmate”)
11:01:37FromGitter<Grabli66> I think better choose babylonjs or threejs. I choosed babylonjs
11:01:50Yardanicothese are not game engines
11:02:44FromGitter<Grabli66> Babylonjs is a game engine. Threejs is not
11:02:55Yardanicowell you're not quite right
11:02:59Yardanico"A complete JavaScript framework for building 3D games with HTML5, WebGL, WebVR and Web Audio"
11:03:03Yardanicoit says on babylon js page
11:03:11*dom96|w joined #nim
11:03:50Yardanicoand yes, if you want the game only for browser - create wrapper for babylonjs :)
11:03:52Yardanicoand use Nim :D
11:03:56FromGitter<Grabli66> Yes. It's Framework.
11:04:03Yardanicoit would work and wouldn't make big js output
11:04:39FromGitter<Grabli66> I think about it. But it's need a lot of time.
11:04:50Yardanicowell less time than developing new game engine :)
11:05:24yglukhovdom96: looks like theres some sort of regression in nimble. `nimble install -dy` on my project with a lot of dependencies (and diamonds) fails with: Error: Cannot satisfy the dependency on nimx #head and nimx 0.1
11:05:56dom96|wyglukhov: D:
11:06:06FromGitter<mratsim> An alternative would be to get more people interested in Nim, and then wait for one of them to develop bindings to whatever game engine you like ;)
11:06:24dom96|wyglukhov: Please report it. If you've got some time then please also create a small test case for it.
11:06:46dom96|wHopefully I'll be able to fix it tonight.
11:07:03dom96|wthen I can release a new version in time for the new Nim version :)
11:07:17*Arrrr quit (Ping timeout: 260 seconds)
11:07:27FromGitter<mratsim> oooh, new Nim version? this week?
11:07:28Yardanicodom96|w, so will it be released in this month?
11:07:36*haha_ quit (Quit: haha_)
11:07:43dom96|wYardanico: sure.
11:07:50Yardaniconice
11:07:55dom96|wmratsim: most likely
11:09:36Yardanicohttps://github.com/nim-lang/Nim/compare/master...devel almost 300 commits for new version :)
11:09:41Yardanicomaybe even bigger
11:16:21*haha_ joined #nim
11:20:31FromGitter<Grabli66> Is there free version of Nim in action? Sorry, i am greed. :)
11:21:09*cspar_ joined #nim
11:24:59*xet7 joined #nim
11:25:45Yardanicoofficially - no
11:25:50Yardanicobut someone can share it with you
11:25:59YardanicoI have it, but not the final version
11:27:02FromGitter<Grabli66> Is there something new, that official documentation does not have?
11:27:39*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
11:30:27FromGitter<Grabli66> And, can you share, please? :)
11:31:51livcdi'd like to start using nim. I read some documentation and the by-example stuff. The only use case I have now would be to have a jester app with MSSQL as a data source
11:32:26livcdI believe MSSQL driver is not in a good shape right ? I have seen some odbc packages on github but they did not seem to be maintained anymore
11:33:09*SusWombat_ quit (Ping timeout: 252 seconds)
11:33:19YardanicoGrabli66: what do you mean by "new"?
11:33:29Yardanicodocumentation in devel branch reflects current state of the language
11:35:00FromGitter<Grabli66> Yardanico, some information, that is not in official documentation.
11:35:04Yardanicowell no
11:35:09Yardanicoit just teaches you how to use nim
11:35:13Yardanicowith some example apps
11:35:35Yardanicochat server/client app, "twitter" clone (simple one), fast parallel parser
11:35:47Yardanicoyou can find all cod ehere - https://github.com/dom96/nim-in-action-code
11:35:49Yardanico*code here
11:35:55Yardanicoah, and configurator app
11:35:59Yardanicowhich teaches you to use macros
11:36:59Araqlivcd: odbc has been used successfully with MSSQL once but I don't know more than that
11:38:03Yardanicowell https://github.com/coffeepots/odbc was updated on 24 of may
11:38:07Yardanicoso it probably would still work
11:39:22*cspar_ quit (Ping timeout: 260 seconds)
11:41:59*Arrrr joined #nim
11:41:59*Arrrr quit (Changing host)
11:41:59*Arrrr joined #nim
11:43:13*ShalokShalom_ is now known as ShalokShalom
11:48:52*claudiuinberlin joined #nim
11:49:52*Arrrr quit (Ping timeout: 260 seconds)
11:52:29*Arrrr joined #nim
11:52:29*Arrrr quit (Changing host)
11:52:29*Arrrr joined #nim
11:53:10*BigEpsilon quit (Ping timeout: 264 seconds)
11:53:11*cspar_ joined #nim
11:54:30*BigEpsilon joined #nim
11:58:01livcdAraq: Yardanico oh i guess then I should be happy with that
11:58:14Yardanicodoes it work?
11:58:43*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:02:40*dom96|w joined #nim
12:02:50livcdYardanico: i have not tried the pkg yet
12:03:33*vlad1777d joined #nim
12:07:41*arnetheduck joined #nim
12:10:15*claudiuinberlin joined #nim
12:10:48*claudiuinberlin quit (Client Quit)
12:16:29*Snircle joined #nim
12:22:25dom96|wGrabli66: You can download two of the chapters for free on https://book.picheta.me :)
12:22:56FromGitter<Grabli66> Thanks. :)
12:23:35FromGitter<Grabli66> dom96|w, are you author of streams in nim?
12:24:26YardanicoGrabli: he's probably not
12:24:30YardanicoI bet it's Araq
12:25:13Yardanicowell you can't have 1 author
12:25:18Yardanicoit's open-source
12:25:19*rauss quit (Quit: WeeChat 1.9)
12:25:48FromGitter<Grabli66> I dont understand why stream has readnt8, readInt16, readInt32 procedures, but it does not have write procedures like writetInt8, etc
12:26:08Yardanicobecause it's a stream
12:26:34Yardanicowell it has write procs
12:26:44Yardanicoah
12:26:52Yardanicoyou don't need different write procs
12:26:58FromGitter<Grabli66> Why?
12:30:47Yardanicobecause "write" proc takes ALL possible types
12:30:51Yardanicowhich can be converted to binary
12:30:54*haha_ quit (Quit: haha_)
12:31:00Yardanicohttps://gist.github.com/Yardanico/459edafa2a2458eee377d0aa823f0f90
12:31:16Yardanicoyou need setPosition here to set stream position to zero (to read it from the beginning)
12:31:25Yardanicoif you don't read from stream, and only write - you don't need setPosition
12:31:33Yardanicoand yeah, flush is not needed
12:32:05FromGitter<Grabli66> Ok. Understood now.
12:33:26dom96|wThis is because there is no return type overloading
12:33:32dom96|wSo you can't have a single read()
12:33:50Yardanicoyeah
12:33:59Yardanicoif this was available, it would require you to write code like
12:34:04Yardanicolet x: int8 = data.read()
12:34:12Yardanicoso no big difference
12:34:47Yardaniconeed to make socket stream :)
12:35:05Yardaniconvm
12:35:08Yardanicoit's already here :D
12:35:08FromGitter<Grabli66> Can i create stream from string and then convert stream to string without string copy? It's need, cause websocket uses string to read and send data.
12:35:56FromGitter<Grabli66> But i want to work with streams, not strings
12:36:31Yardanicoimplement websocket interface for streams, this would probably be the best way
12:36:42FromGitter<Grabli66> Good idea :)
12:36:55Yardanicobut why do you use binary types over a websocket ? :)
12:37:26FromGitter<Grabli66> Cause i want send binary data
12:37:34Yardanicogithub is a good thing :)
12:37:34Yardanicohttps://github.com/search?q=language%3Anim+socket+stream&type=Code
12:37:41Yardanicofirst result is exactly that I need
12:39:30skrylari thought there was return type overloading?
12:39:38Yardanicono
12:39:39skrylarpretty sure i did it, even though it confuses the type inferrence
12:39:48Yardanicohow you would use your proc then?
12:39:53Yardanicomaybe you're talking about generic procs?
12:40:00Yardanicoyeah, you can do it with generic procs
12:40:01skrylarassign it to a var where the type is already known
12:40:01Yardanicolike
12:40:15Yardanicolet x = data.read[int8]()
12:40:20Yardanicothis would work too
12:47:16*claudiuinberlin joined #nim
12:58:29Araqno, it's read[int8](data)
12:59:48Yardanicowell this would definitely make streams code a little bit less verbose
13:00:10Yardanicobut backwards compatibility, so no :)
13:01:12*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:07:25*rauss joined #nim
13:10:15couven92Araq, can I use a pragma in Nim code to set a `--clib:<libpath>`... like `{.clib: libpath.}`?
13:10:39AraqI doubt it
13:10:49couven92So I really have to use `{.passL.}`?
13:11:16couven92okay, I'll make that a suggestion
13:22:02ArrrrAraq, will 'let i: int8 = read(data)' work for release?
13:22:13Araqno
13:22:18ArrrrAnd after?
13:22:28AraqI've said it before: return type disambiguation sucks
13:22:53Araqdon't want to see libraries that rely on it.
13:23:26ArrrrBut actually, it is the same except two brackets
13:23:49Arrrrimplementation complexity aside, i don't see what's wrong with that
13:24:37Yardanicowell forcing people to write types when declaring a var while using one libary (and they don't need to write types for other libraries) is not consistent
13:25:43ArrrrYep, looks strange that i can do `write(a)` instead of `write[int](a)` but i can't do the same when reading, for example
13:25:58ArrrrI can live with that if is hard to implement tho.
13:26:26Araqyou have to live with it because it really is a bad idea tho
13:26:46AraqNim has enough ways to write the same thing
13:26:49Araqwe don't need more
13:28:25Arrrrthat one happens to be the most obvious, not one in a million
13:31:37*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
13:36:44*relax joined #nim
13:39:25*claudiuinberlin joined #nim
13:40:26*sz0 quit (Quit: Connection closed for inactivity)
13:45:38*dom96|w quit (Quit: Textual IRC Client: www.textualapp.com)
13:49:05*cspar_ quit (Ping timeout: 240 seconds)
14:02:02FromGitter<Bennyelg> I already Own the book :D
14:05:22*rokups joined #nim
14:07:44*Jesin joined #nim
14:08:07*skrylar quit (Ping timeout: 260 seconds)
14:12:22FromGitter<k0pernicus> @dom96 Do you know if I can “give” my PDF book rights to a given person?
14:12:35FromGitter<k0pernicus> Actually, I own two versions of “Nim In Action"
14:13:11FromGitter<k0pernicus> The MEAP one (only electronic documents), and I ordered the paper one two/three days ago (and I have also electronic documents)
14:13:38FromGitter<Bennyelg> I got the paper week ago
14:13:46FromGitter<k0pernicus> It may be beneficial for other Nim-guy to own a free copy of the “Nim in Action”...
14:13:53FromGitter<Bennyelg> I ordered the book 2 months ago but it wasnt ready yet
14:14:06FromGitter<Bennyelg> excellent book
14:17:04Yardanicok0pernicus: you can definitely do it, but AFAIK PDF version contains your email and name & surname (it was like this in meap edition)
14:18:14Yardanicobut you can remove it
14:18:43FromGitter<k0pernicus> Yep, I know - actually, I asked here to “transmit” my rights to a new “user” (so, instead of my email & name, the email & name of the new owner)
14:18:53FromGitter<k0pernicus> Like a late gift
14:19:04FromGitter<k0pernicus> (or something like that)
14:19:57Yardanicowell you should ask manning for this I think
14:19:58Yardaniconot dom96 :)
14:20:23FromGitter<k0pernicus> It was the easy-way :-p
14:20:36Yardanicowell maybe dom96 has rights like this
14:20:38Yardanicobut I don't know
14:20:55*haha_ joined #nim
14:24:57*mahmudov joined #nim
14:29:12*BigEpsilon quit (Remote host closed the connection)
14:29:29*BigEpsilon joined #nim
14:30:12FromGitter<Bennyelg> Any Nim Summit anytime soon?
14:33:05federico3Bennyelg in which country?
14:33:35FromGitter<Bennyelg> I can come to any place In europe if the summit is big
14:36:19ipjk__I think there have been one or two meetings in DE
14:36:32*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:41:54*coffepot joined #nim
14:42:47*claudiuinberlin joined #nim
14:43:37*coffepot quit (Client Quit)
14:45:28*coffeepot joined #nim
14:53:54*PMunch quit (Quit: Leaving)
14:57:36Yardanicohmmm
14:57:38Yardanicohttps://github.com/Araq/ormin
14:57:49YardanicoI'm following Araq on github :D
14:58:10Araqstalker!
14:58:56*Matthias247 joined #nim
14:59:57yglukhovoh, we have an orm too. for mongo.
15:00:16yglukhovwhat will be yours like? =)
15:00:30Yardanicoyglukhov, i'll give you a link to irc logs now :)
15:00:31Yardanicolet me find it
15:01:43Yardanicohmm, can't find it :P
15:02:34Yardanicoah
15:02:35Yardanicofound it
15:02:46Yardanicostarting from here - https://irclogs.nim-lang.org/01-09-2017.html#15:07:08
15:02:50Yardanicoyglukhov, ^
15:03:28ipjk__Should I think of 'concepts' as traits?
15:03:33Yardanicoand about ormin: 'ormin' is a helper tool that parses SQL and produces Nim code
15:03:36ipjk__Or am I missunderstanding
15:03:46Yardanicoipjk__, user-defined type classes :)
15:03:57Yardanicowell I don't know
15:03:59Yardanicomaybe they are
15:04:42yglukhovnice. i'll be watching it too then :D
15:05:24*PMunch joined #nim
15:16:30*solitudesf26 joined #nim
15:16:50*solitudesf26 quit (Client Quit)
15:20:16*miran joined #nim
15:21:34*Jesin quit (Quit: Leaving)
15:24:50*Jesin joined #nim
15:26:25*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:28:49*claudiuinberlin joined #nim
15:30:36*solitudesf joined #nim
15:31:27FromGitter<ephja> make a DSL that encompasses at the very least standard SQL ;)
15:32:31FromGitter<mratsim> LinQ !
15:33:16coffeepotjust downloaded the latest Nim from github, went through all stages successfully up to "iteration: 2" where it called "compiler\nim1.exe c -d:release --nimcache:nimcache/r_windows_i386 compiler\nim.nim", at which point it fails on an assert "len(ver) == 0 or contains({0, 35, 48..57}, ver[0]) wrong version: master"
15:33:22coffeepotwhat did i screw up :)
15:34:05Yardanicocoffeepot, what file have you downloaded?
15:34:30coffeepotthere doesn't seem to be a nim.nim in the c:\nim\nimcache\r_windows_i386 folder
15:34:46Yardanicocoffeepot, did you clone nim repo?
15:34:51coffeepotuh I just went to https://github.com/nim-lang/Nim#compiling
15:34:55coffeepotyeah
15:35:10Yardanicomaybe you've cloned master branch, not devel?
15:35:31coffeepotseems like it don't it :/
15:37:17coffeepotthat's odd, i've always just been able to use the commands listed https://github.com/nim-lang/Nim#compiling and it's been ok
15:37:41coffeepot$ git clone https://github.com/nim-lang/Nim.git
15:37:41coffeepot$ cd Nim
15:37:41coffeepot$ git clone --depth 1 https://github.com/nim-lang/csources.git
15:37:41coffeepot$ cd csources
15:37:41coffeepot$ sh build.sh
15:37:41coffeepot$ cd ../
15:37:42coffeepot$ bin/nim c koch
15:37:42coffeepot$ ./koch boot -d:release
15:38:30*coffeepot scratches head
15:43:18*Trustable joined #nim
15:43:38yglukhovcoffeepot: this has just been fixed
15:43:43yglukhovi think
15:43:58yglukhovhttps://github.com/nim-lang/Nim/pull/6335
15:44:02coffeepotliterally just? What was the problem out of interest?
15:44:42yglukhovyou likely have packages with versions with dashes?
15:44:53yglukhovin your .nimble/pkgs?
15:45:17coffeepotthat's quite possible yeah i haven't updated my nimble packages for aeons
15:45:53yglukhovwell, you'll need to delete/rename those to bootstrap. after bootstraping with lastest fixes, they should work again
15:46:27coffeepotah ok, i'll just dump my packages folder and re-acquire
15:47:01*relax quit (Ping timeout: 240 seconds)
15:51:27*ipjk__ quit (Quit: Leaving)
15:53:10*gokr quit (Ping timeout: 264 seconds)
15:53:18yglukhovcoffeepot: so that helps?
15:53:35FromGitter<cabhishek> @FromIRC I am now
15:53:55coffeepotliterally just finished: SUCCESS :D
15:54:13coffeepotthanks yglukhov!
15:54:20yglukhovcool
15:59:28*thomasross_ quit (Remote host closed the connection)
15:59:54*thomasross_ joined #nim
16:00:40*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:02:09*claudiuinberlin joined #nim
16:02:50*coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
16:05:23*claudiuinberlin quit (Client Quit)
16:08:47*gokr joined #nim
16:09:22*solitudesf_ joined #nim
16:10:16*claudiuinberlin joined #nim
16:10:37*solitudesf_ quit (Remote host closed the connection)
16:10:52*solitudesf quit (Remote host closed the connection)
16:11:12*solitudesf joined #nim
16:11:20Demos[m]is there a semaphore provided someplace?
16:11:28Demos[m]besides pthreads
16:14:00*enthus1ast__ joined #nim
16:15:01def-Demos[m]: threadpool.nim has one
16:15:47Demos[m]not exported it looks like...
16:16:32*arnetheduck quit (Ping timeout: 248 seconds)
16:17:23YardanicoDemos[m], copy-paste ? :)
16:17:55def-or make a lib/core/semaphores.nim, move it there, export it, document it, and make threadpool import it
16:18:12Demos[m]yeah def that would be the plan
16:18:18def-or put it into locks.nim
16:18:35Demos[m]there may be reason to use system semaphores, not sure
16:19:01def-I can think of a reason NOT to use system semaphores
16:19:11def-unnamed pthreads semaphores are not implemented on mac osx
16:20:30FromGitter<ephja> ENOSYS<3
16:21:25*solitudesf quit (Remote host closed the connection)
16:22:20FromGitter<ephja> it's a godsend for embedded systems
16:22:45Demos[m]well you'd restrict the features I guess
16:23:20Demos[m]wait what?
16:23:28Demos[m]it looks like an unnamed semaphore is the everyday one
16:23:37Demos[m]for within one process
16:23:54*ofelas joined #nim
16:25:56*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
16:36:59r4vianyone written an nginx module with nim?
16:38:22yglukhovr4vi: your question is way specific i guess. it's either "writing c-abi plugins in nim" or "writing nginx plugin in c" =))
16:39:30*yglukhov quit (Remote host closed the connection)
16:40:26r4viI guess it's closer to writing a c-abi plugin in nim. I could just do it but was wondering if there were any gotchas related to nginx
16:42:05Yardanicowell you will need to patch nim stdlib
16:42:12YardanicoI mean memory management
16:42:19Yardanicobecause nginx uses it's own alloc functions
16:42:54*yglukhov_ joined #nim
16:43:06r4viYardanico: I'm not familiar enough with nim to do that so I guess I wont try it
16:45:18Yardanicowell anyway it would require you to write a lot of special nginx-aware code
16:45:23Yardanicoeven if you would do it in C
16:46:14r4viof course but at least there are examples / docs
16:46:46Yardanicowell you would just wrap needed nginx C functions in nim
16:46:49Yardanicoand do the same as in C
16:47:05*yglukhov_ quit (Ping timeout: 240 seconds)
16:55:40*SusWombat joined #nim
17:04:52*Sentreen quit (Ping timeout: 260 seconds)
17:17:23*Sentreen joined #nim
17:26:10*yglukhov joined #nim
17:27:52*haha_ quit (Quit: haha_)
17:30:32*yglukhov quit (Ping timeout: 260 seconds)
17:32:30*haha_ joined #nim
17:34:00*yglukhov joined #nim
17:45:46*BigEpsilon quit (Remote host closed the connection)
17:46:03*BigEpsilon joined #nim
17:48:09*relax joined #nim
17:49:23*claudiuinberlin joined #nim
17:50:52*xet7 quit (Quit: Leaving)
17:52:44*Trustable quit (Remote host closed the connection)
17:53:22*xet7 joined #nim
18:03:09dom96yglukhov: did you get a chance to submit your issue?
18:03:34yglukhovdom96: nope, sorry.
18:05:50*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:05:53*vlad1777d quit (Ping timeout: 248 seconds)
18:06:18*claudiuinberlin joined #nim
18:15:06couven92do we have `|=` in Nim? or is it `result = result or v`?
18:15:19YardanicoI doubt it
18:16:57dom96theindex -> Ctrl+F -> `|=`
18:17:09*Vladar quit (Quit: Leaving)
18:19:53PMunchHmm, how do you grow a nim sequence to a given size?
18:20:33FromGitter<ephja> PMunch: the length? https://nim-lang.org/docs/system.html#setLen,seq[T],Natural
18:20:52PMunchI load some data from a file and I know how many elements there are, so it would be nice to grow the sequence to that size to begin with
18:21:18PMunchAh, nice
18:21:20PMunchThanks
18:21:39FromGitter<ephja> you can set the capacity too but only when initializing
18:22:05Yardanicoyeah
18:22:11Yardanicolike
18:22:19Yardanicovar x = newSeq[int](256)
18:24:37Yardanicooh, it seems I can't directly pass openArray (my proc has argument like that) to newStringTable
18:24:44Yardanicoguess I'll need to iterate over a string table...
18:29:20Yardanico*over openarray
18:29:50Yardanicoomgf
18:30:04Yardanicothe issue was: different names of fields in a tuple
18:31:09*relax quit (Ping timeout: 252 seconds)
18:47:36*relax joined #nim
18:51:07*rauss quit (Quit: WeeChat 1.9)
18:53:56dom96yglukhov: commented on the issue
18:54:03dom96It's much more subtle than I thought
18:54:12dom96But hopefully my explanation makes sense
18:57:45FromGitter<mratsim> If I understand the manually correctly there: https://nim-lang.org/docs/manual.html#type-bound-operations-destructors, having a ``=destroy`` proc and a ``new`` proc with finalizer should cover all cases right? (I’m working on Cuda with GPU memory, and I need to make sure it’s reclaimed)
19:00:08yglukhovdom96: thanks, will look into it
19:05:43*haha_ quit (Quit: haha_)
19:05:44Yardanicomratsim: Be aware that destructors are not called for objects allocated with new. This may change in future versions of language, but for now the finalizer parameter to new has to be used.
19:06:06Yardanicofor now the finalizer parameter to new has to be used
19:06:42Yardanicoalso finalizer refers to all objects of the same type
19:06:47YardanicoThe finalizer refers to the type T, not to the object! This means that for each object of type T the finalizer will be called!
19:08:17*rauss joined #nim
19:12:35FromGitter<mratsim> let’s do a small scenario with objects of the same type, I do `new a`, `new b`, `c = a` (assuming deep copy). ⏎ ⏎ 1) a goes out of scope. Finalizer is called on a, it does not have to wait for b and c to go out of scope right? ⏎ 2) c goes out of scope. =destroy is called on c, because c wasn’t created with new right? [https://gitter.im/nim-lang/Nim?at=59b048a3bc46472974032110]
19:13:32Yardanicofirstly: you should pass finalizer proc to "new"
19:14:24FromGitter<mratsim> yes no problem, assume `new(a, finalizerProc)` in the scenarios
19:16:13yglukhovmratsim: your scenario is illformed somewhat...
19:19:42yglukhovmratsim: also finalizers are not deterministic. they don't depend on scope. it is very likely that if your `a` doesn't have cycles it will be finalized pretty soon, maybe on the next allocation. but that is kinda not guaranteed.
19:20:55Yardanicoyglukhov, well for some reason manual says "=destroy(v) will be automatically invoked for every local stack variable v that goes out of scope."
19:21:00Yardanico"out of scope"
19:21:20yglukhovyup, but `=destroy` is not finalizer
19:22:19FromGitter<mratsim> non-deterministic is fine, I just want to make sure that by having new+ finalizer and a =destroy proc I will reclaim all GPU memory allocated by my program
19:22:41FromGitter<mratsim> however objects were created/allocated
19:23:57yglukhovmratsim: i think finalizers without `=destroy` should be enough for your case. especially if you make sure that your object-to-finalized is not refferred from a cycle.
19:24:36yglukhovi found `=destroy` to not work for me. if you're thinking c++ raii, `=destroy` is not your friend.
19:26:46yglukhovmratsim: also you can call GC_fullCollect in strategic places to make sure that even cycles are collected
19:28:51FromGitter<mratsim> Thanks, I’ll start with finalizers, I’ll see if Cuda/GPU memory leak happen
19:29:06Yardanicodom96, it seems we'll have release notes for nim 0.17.2 ? :) https://github.com/dom96/relnotesgen
19:30:16dom96This has been used for at least 5 versions now
19:30:21dom96It generates the bugs that have been fixed
19:30:26yglukhovmratsim: i'm using finalizers in my game engine, they work fine. also i force GC_fullCollect when scenes change.
19:30:32dom96You should stop stalking me :P
19:30:52YardanicoI didn't :P
19:30:54dom96*generates a list of ....
19:30:58Yardanicojust randomly looked at your repos
19:31:19Yardanicodom96, oh, sorry, I didn't knew :D
19:31:57*oaao1 quit (Quit: Leaving)
19:32:36FromGitter<mratsim> @yglukhov I see, good to know, if games don’t leak with finalizers I should be fine as well
19:41:33*BigEpsilon quit (Ping timeout: 252 seconds)
19:45:13*ofelas quit (Quit: shutdown -h now)
19:50:43*Yardanico quit (Remote host closed the connection)
19:53:22*rokups quit (Quit: Connection closed for inactivity)
19:54:34couven92can dynlib have environment variables in the lib path?
20:01:37*Arrrr quit (Ping timeout: 260 seconds)
20:06:51*gokr quit (Ping timeout: 252 seconds)
20:07:24*couven92 quit (Quit: Client disconnecting)
20:21:42*cspar_ joined #nim
20:32:00*rauss quit (Quit: WeeChat 1.9)
20:45:21*Jesin quit (Ping timeout: 240 seconds)
20:47:57*Jesin joined #nim
20:49:24*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
20:50:10*miran quit (Ping timeout: 264 seconds)
20:53:11*couven92 joined #nim
20:56:01*enthus1ast__ quit (Ping timeout: 248 seconds)
20:57:53*skrylar joined #nim
21:05:43couven92ooops... I created a macro that nicely implements stringify for listed values of a distinct numeric type... I then implemented all windows error codes listed in winerror.h as distinct uint32 values...
21:06:25couven92Now I get an executable that is 5 MiB in size, does absolutely nothing, and stores the name of every Windows Error constant in its constant data! :D
21:07:02FromGitter<ephja> nice
21:08:24couven92well... It's annoying that every executable that I build that uses my Windows SDK nimble-package will now grow 5 MiB in size.... :(
21:11:05*vlad1777d joined #nim
21:18:01*Snircle joined #nim
21:19:08*relax quit (Ping timeout: 240 seconds)
21:31:37FromGitter<zacharycarter> o/
21:35:47couven92Hmmm... I have a template that takes an untyped argument... How do I pass the untyped `ast` parameter to a macro inside the template?
21:36:25*PMunch quit (Quit: leaving)
21:38:05*mahmudov quit (Ping timeout: 240 seconds)
21:44:31FromGitter<zacharycarter> would it be possible to write a macro to do something like
21:44:40FromGitter<zacharycarter> ``````
21:53:22*gokr joined #nim
21:58:35FromGitter<zacharycarter> def-pri-pub: please ping me when you have a chance
22:06:38dom96anybody want to write a xz decompressor for Nim?
22:06:48dom96choosenim having to download a 68MB tar.gz sucks :\
22:07:05FromGitter<zacharycarter> have an example of one written in C?
22:07:42FromGitter<zacharycarter> found one
22:09:15dom96ooh, yay, gonna write one? :)
22:09:52dom96gz is ridiculously bad in comparison to xz
22:09:57dom964mb vs 67mb
22:10:01FromGitter<zacharycarter> oh wow
22:10:09FromGitter<zacharycarter> I might, I need to stare at this implementation some more first
22:10:56dom96cool
22:12:33FromGitter<zacharycarter> looks like most of them are implemented in golang, at least the ones that are well written
22:13:33*Jesin quit (Quit: Leaving)
22:14:14FromGitter<zacharycarter> nm found a nice one written in C
22:14:26FromGitter<zacharycarter> I'll give it a go
22:16:04Araqporting from Go is not hard either, Go has no features so you can just replace {} with nothing and 'x := y' with 'var x = y'
22:17:03FromGitter<zacharycarter> gotcha
22:29:32*def-pri-pub joined #nim
22:29:35dom96https://github.com/nim-lang/Nim/blame/devel/tools/niminst/buildsh.tmpl#L50
22:30:05dom96I'm afraid that this is preventing the release :)
22:30:37*nsf quit (Quit: WeeChat 1.9)
22:33:42dom96so looks like we'll have to scrap unti tomorrow
22:33:45dom96*until
22:35:27Araqcouven92: thanks for that ... -.-
22:35:39couven92Araq?
22:35:53Araqhow hard is it to write posix shell scripts?
22:36:07Xeyou'd be amazed
22:36:30Araquosname=`uname -o` breaks our builds on OSX
22:36:33Araqat least
22:36:39Araqcan't release
22:36:47couven92really? :O
22:36:50Araqyes.
22:36:59couven92Oh, I had no idea :/
22:37:39Araqnow I have to lookup again how to remove fucking git tags because git was created by dyslexics
22:38:54couven92I am sorry, I assumed `uname -o` worked everywhere... man says: "-o, --operating-system print the operating system"
22:39:12dom96Araq: dude
22:39:18dom96Calm down.
22:39:27dom96It's an easy mistake
22:39:32AraqI'm pissed
22:40:38dom96We'll just release tomorrow, it's no big deal
22:41:02couven92Araq, shall I do a quick PR that reverts all that? It'll take me about 20 minutes tops?
22:41:17dom96couven92: It would be better if you created a PR that fixes the issue
22:41:26dom96The '-o' is missing from OS X btw
22:41:42Araqno, it's not obvious how to fix this
22:41:53Araqand reverting it has no priority, I removed the git tags again
22:42:16couven92Araq, dom96, yeah it's not obvious... However, we only need this on Android... so...
22:42:52Araqin the future I'm not gonna accept and shell script updates whatsoever :-)
22:43:15couven92this really only went in there, because android thinks it's linux (which is true, kinda), and there was no other way to detect Android from shell
22:43:26AraqI know why it's there
22:43:38couven92Araq, yeah, shell scripts are horrible! :P
22:43:44Araqit's my mistake for not checking if '-o' is in Posix
22:44:12AraqI was the reviewer, I get the blame
22:44:22Araqbut that doesn't mean I'm not pissed :P
22:44:35dom96No, it's nobody's fault.
22:44:47couven92well, I can share the blame... I should also have checked it... I didn't. I will in the future though!
22:44:48dom96We just need to figure out how to prevent it from happening again
22:44:57dom96And the obvious solution is to have proper macOS testing.
22:45:03Araqtrue
22:45:16Araqbut unknown when it will arrive
22:45:42Araqalso, that -o flag could easily have bitten us on e.g. Solaris
22:45:48Araqand not on OSX
22:46:00Araqso it's better to never touch the shell stuff
22:46:19dom96For all you know Solaris may be broken right now.
22:46:23Araqok, so we need a Solaris tester. and a FreeBSD one
22:46:33Araqand a NetBSD, etc etc
22:46:34dom96Yep, that's the only way to know for sure.
22:46:42dom96Don't forbid changes to something just because it's risky
22:46:58AraqI only forbid changes to the shell scripts
22:47:11Araqnothing wrong with that IMO.
22:47:38dom96I really need sleep so I'm not going to continue arguing
22:47:38dom96Bye
22:47:43Araqbye
22:48:15couven92hmmm... obvious fix: check whether osname is linux, and only then execute `uname -o`
22:48:38Xehow can one know the OS name without knowing the OS name?
22:48:42couven92or even better: try execute `uname -o`, do nothing if it fails
22:49:07couven92Xe we do some other checks for the os name earlier
22:50:38federico3couven92: why -o tho? Is -a being used already and provides the OS name
22:51:25couven92federico3, -a would give us everything like: "Linux FRED 4.4.0-43-Microsoft #1-Microsoft Wed Dec 31 14:42:53 PST 2014 x86_64 x86_64 x86_64 GNU/Linux"
22:52:18couven92federico3, so on android (inside termux): `uname` returns "Linux", but `unmame -o` returns "Android"
22:53:39couven92Araq, actually, I updated the shell script some time ago to receive `--os android` as a command-line option... So technically, we could really recvert the -o stuff, since there is a feasable workaround
22:54:11couven92the -o really only worked on termux anyways as we later found out... the native uname on android, still gives you back "Linux"
22:56:17Araqwell fix it, I don't really care how you do it as long as it works on every Poonix based OS
22:56:27couven92will do
22:56:41*vlad1777d quit (Ping timeout: 255 seconds)
22:58:56*Jesin joined #nim
23:09:15couven92Araq, https://github.com/nim-lang/Nim/pull/6342 on-liner fix :)
23:12:31*def-pri-pub quit (Ping timeout: 248 seconds)
23:25:53*mahmudov joined #nim
23:37:56*yglukhov quit (Remote host closed the connection)
23:44:07couven92Hmm... is there a I-really-know-what-I-am-doing way to get the address of a parameter in a proc?
23:44:51couven92Ah... unsafeAddr
23:46:21*cspar_ quit (Ping timeout: 240 seconds)
23:50:25*cspar_ joined #nim