<< 17-07-2017 >>

00:00:06*mwbrown quit (Quit: Exiting)
00:02:20*mwbrown joined #nim
00:06:58*chemist69 quit (Ping timeout: 276 seconds)
00:20:20*v17d quit (Remote host closed the connection)
00:24:37*chemist69 joined #nim
00:53:16*yglukhov joined #nim
00:57:32*yglukhov quit (Ping timeout: 240 seconds)
01:04:29watzon\q
01:05:14FromGitter<watzon> Lol here I go forgetting how to exit `irc`
01:05:26*watzon quit (Quit: Lost terminal)
01:09:50*chemist69 quit (Disconnected by services)
01:09:55*chemist69_ joined #nim
01:27:50FromGitter<watzon> How would you get the last n characters of a string?
01:30:34FromGitter<watzon> Is there a better way than this? `str[str.len - 5 .. str.len]`
01:32:24*mwbrown quit (Quit: Exiting)
01:34:45*mwbrown joined #nim
01:36:41FromGitter<ephja> not that I know
01:36:44FromGitter<ephja> I think you mean 'high' (len - 1)
01:38:03FromGitter<ephja> another shortcut: https://nim-lang.org/docs/system.html#^,int
01:47:04*smt quit (Ping timeout: 276 seconds)
01:51:16*skrylar joined #nim
01:57:56FromGitter<Sud0nim> You could also shorten it just a little like: echo str[str.len - 5 .. ^1]
01:58:12FromGitter<Sud0nim> without the echo of course
02:09:56FromGitter<zacharycarter> is what I meant to drag over
02:10:43FromGitter<watzon> Here's yet another, are ternary if's possible?
02:10:56FromGitter<zacharycarter> no need for ternary
02:11:00FromGitter<watzon> No?
02:11:01FromGitter<zacharycarter> if / else can be used as expression
02:11:08FromGitter<zacharycarter> so
02:11:20FromGitter<zacharycarter> if foo: bar else: foobar
02:12:17FromGitter<watzon> Amazing
02:12:24FromGitter<watzon> I'm loving this language
02:12:46FromGitter<zacharycarter> :D
02:13:16FromGitter<zacharycarter> (https://files.gitter.im/nim-lang/Nim/QGtE/test.gif)
02:14:20FromGitter<watzon> Dude that's sick af!
02:14:29FromGitter<watzon> Great job
02:14:31FromGitter<zacharycarter> thanks :D
02:14:57FromGitter<watzon> Does it work with the javascript compiler currently?
02:15:02FromGitter<watzon> Or will it?
02:15:06FromGitter<zacharycarter> hrm that's a good question
02:15:15FromGitter<zacharycarter> it definitely won't currently
02:15:31FromGitter<zacharycarter> could it, most definitely if I wrote all the opengl code with webgl and got rid of all the OS calls
02:15:40FromGitter<watzon> If it could eventually that would be amazing
02:16:27FromGitter<zacharycarter> may have to toy with that over the next week or so ;)
02:16:42skrylarhrmm webgl.
02:16:52FromGitter<zacharycarter> I could go emscripten / webassembly
02:16:53FromGitter<zacharycarter> and use egl
02:17:12FromGitter<watzon> I'm primarily a web dev, so if it get's to that point I'll definitely be using it
02:17:45skrylarI don't know why people didn't just adopt native client. it was more efficient in every way to webassembly
02:17:49*skrylar shrugs
02:18:39FromGitter<zacharycarter> but it's dead now right?
02:18:46FromGitter<zacharycarter> like poke it with a stick?
02:18:47skrylarbelieve so
02:18:53FromGitter<zacharycarter> hrm :/
02:18:55skrylarmozilla refused to support it because :politics:
02:19:01FromGitter<zacharycarter> bleh
02:19:15FromGitter<zacharycarter> well I will try to get zengine on the web, it's one of my goals
02:19:30FromGitter<zacharycarter> how it gets there, is up for debate
02:19:33skrylarcan always pifler from the superpowers engine
02:19:36skrylarthey're doing webgl
02:19:49FromGitter<zacharycarter> yeah I've played with superpowers
02:20:01skrylarit's ok
02:20:21FromGitter<zacharycarter> very much agree
02:20:26skrylarGodot is more mature but they got thrashed by the plugin bs
02:20:33FromGitter<zacharycarter> yes
02:20:47FromGitter<zacharycarter> I don't even aim to compete with either of those engines
02:20:51skrylarUnity and Godot were screwed by the "let's just make a plugin" "we're going to stop allowing user plugins" "ok lets do native client" "we're going to stop doing native client" "F. F. S."
02:21:00skrylarI think they do emscripten but performance is **awful**
02:21:19FromGitter<zacharycarter> probably linking everything under the sun
02:21:22skrylari think unity just gave up on the web
02:21:41FromGitter<zacharycarter> I don't blame them, it's not even that popular of a target anymore
02:21:46FromGitter<zacharycarter> not with steam etc
02:21:52skrylarit still is, it's just not worthwhile anymore
02:22:41skrylarWith Flash artificially dead, and native client dead, and plugins dead, the only way to target the browser is HTML5. And while Flash/Plugins were maintained by people paid to write plugins, HTML5 is implemented by people who mostly have browsers as necessary expenses and not paid to be fixed
02:22:53skrylarSo you get things like "use HTML5!" "but mozilla can't even play sounds properly"
02:23:08FromGitter<zacharycarter> heh
02:23:30skrylarPico8 has an html5 export and they have a warning that anyone using firefox should just press mute becaues it will cause the entire browser to chop out
02:23:49skrylaranyway
02:23:52skrylarbgfx looks neat.
02:23:59FromGitter<zacharycarter> ooo
02:24:04FromGitter<zacharycarter> this new engine is bgfxless
02:24:11FromGitter<zacharycarter> frag used bgfx
02:24:13skrylardid you throw it in the garbage?
02:24:20FromGitter<zacharycarter> I did
02:24:31skrylarsomeone wanted urho to run on bgfx but they wouldn't; too much intertia
02:24:36skrylar"but we already wrote our own middle layer"
02:24:37FromGitter<zacharycarter> it was too much for new users to get started with
02:24:55skrylarcurious about compute shaders though
02:24:57FromGitter<zacharycarter> I probably will eventually write another rendering backend using bgfx
02:25:20skrylareeh i dunno. not a good enough reason to stop using it imo
02:25:26skrylarone can always pile abstractions upwards
02:25:36skrylarbut fixing stuff dumbed down at the lower end is exponentially harder
02:26:06FromGitter<zacharycarter> true, the author of bgfx has already thought through a lot of this stuff
02:26:32skrylarshrugs. not my engine
02:26:41FromGitter<zacharycarter> it's tough ground to stand on, people want something that is simple and they can prototype with
02:27:07skrylarwell its mostly that high end stuff is ultimately build on the low end stuff. so reinventing the low end stuff is questionable unless there's a good reason
02:27:18skrylarlibgdx and allegro have all their neat sprite sheet stuff on top of a render layer anyway
02:27:38FromGitter<zacharycarter> yeah
02:27:40skrylaralthough high end stuff is sadly solved these days :(
02:27:42skrylarfor 2D
02:28:49skrylareh well. have to clean up a box for work
02:29:48FromGitter<zacharycarter> o7 gl
02:39:44*handlex joined #nim
02:48:53skrylarI don't remember, did we have a spooky hash implementation?
02:55:09*yglukhov joined #nim
02:58:50*pilne quit (Quit: Quitting!)
02:59:20*skrylar quit (Quit: My iMac has gone to sleep. ZZZzzz…)
02:59:56*yglukhov quit (Ping timeout: 260 seconds)
03:00:14*skrylar joined #nim
03:08:03*yingjun joined #nim
03:08:39*handlex quit (Quit: handlex)
03:11:19*handlex joined #nim
03:18:18*endragor joined #nim
03:18:59*vivus quit (Quit: Leaving)
03:55:21*handlex quit (Quit: handlex)
04:29:54*yingjun quit (Remote host closed the connection)
04:30:05*yingjun joined #nim
04:31:51*yingjun quit (Remote host closed the connection)
04:38:47*yingjun joined #nim
04:38:53*yingjun quit (Remote host closed the connection)
04:39:24*yingjun joined #nim
04:43:31*yingjun quit (Ping timeout: 246 seconds)
04:47:05FromGitter<Varriount> skrylar: I can't find one
04:47:53FromGitter<Varriount> We need more hash implementations similar to the "hashes" module. The current hash libraries on Nimble are awkward to use.
04:48:31*dddddd quit (Remote host closed the connection)
04:49:11skrylar I checked nimble. But doesn't always mean anything, since I know there also some gnome bindings floating around that are not on there either
04:50:12FromGitter<watzon> Speaking of nimble... is there a reason why there isn't a centralized repo like npm? It would make searching for packages a bit more user friendly
04:50:46skrylar pretty sure that's exactly what nimble does
04:50:58skrylar although uses get hub instead of their own system
04:51:33FromGitter<watzon> I guess I am more referring to the lack of a web interface
04:51:33FromGitter<Varriount> @watzon https://github.com/nim-lang/packages
04:54:05FromGitter<Varriount> I remember a time when flash games ruled
04:55:22skrylar I think Adobe killing flash might have been a little premature, although I suppose your browser security is much better for it.
04:57:39*rauss quit (Quit: WeeChat 1.9)
04:57:46*yglukhov joined #nim
04:57:47*yingjun joined #nim
04:58:13*rauss joined #nim
05:02:43*yglukhov quit (Ping timeout: 276 seconds)
05:14:49*rauss quit (Quit: WeeChat 1.9)
06:05:51FromGitter<stisa> @watzon there are some, like http://nimism.co/ (git https://github.com/molnarmark/nimism.co ) ( and this one used to work too https://github.com/FedericoCeratto/nim-package-directory)
06:06:30FromGitter<watzon> Yay
06:07:02FromGitter<watzon> Nim needs to be more widely used. Googling anything involving nim is difficult
06:10:10*Vladar joined #nim
06:15:01*ShalokShalom joined #nim
06:32:13*nsf joined #nim
06:47:30*andrzejku joined #nim
07:05:17FromGitter<watzon> Is there any way to have dynamic properties on an object?
07:05:51*yingjun quit (Remote host closed the connection)
07:07:49Araqyes, add a field of type 'JsonNode' to your object
07:08:48*yingjun joined #nim
07:18:27FromGitter<mratsim> Googling Nim is easier than google go, and on the same level than googling Rust :D
07:22:30*yglukhov joined #nim
07:32:47ftsf_why are all programming languages named after games these days? =p
07:34:17Araqtbh I wasn't aware "nim" is a game
07:37:23*Arrrr joined #nim
07:37:23*Arrrr quit (Changing host)
07:37:23*Arrrr joined #nim
07:43:35ftsf_Araq, nor I until I stumbled across it trying to search for nim stuff
07:46:46*andrzejku quit (Quit: Textual IRC Client: www.textualapp.com)
07:50:01FromGitter<Sud0nim> Is there anything similar to a bimap (two way lookup table) in Nim, so that you can find a key from its value or its value from a key?
07:50:15FromGitter<Sud0nim> I couldn't find it in https://nim-lang.org/docs/tables.html#Table
07:54:13*couven92 joined #nim
08:02:33ArrrrI think there isn't.
08:04:55*arnetheduck joined #nim
08:12:07FromGitter<Varriount> @Sud0nim doesn't one generally just use two maps for those cases?
08:16:23*ShalokShalom_ joined #nim
08:18:17FromGitter<Sud0nim> Yes, I just thought it felt like a hack in some way - if there was a better/idiomatic way to do it I wanted to do it that way instead, but if not then it's all good. Thanks though
08:19:02ftsf_Seems like the common way to do it, but I guess you could make something that abstracts it away.
08:19:23*ShalokShalom quit (Ping timeout: 260 seconds)
08:20:28FromGitter<Sud0nim> No worries, just making sure - thanks all
08:21:48*yingjun quit (Remote host closed the connection)
08:23:37*yingjun joined #nim
08:23:39*yingjun quit (Remote host closed the connection)
08:24:15*yingjun joined #nim
08:26:06*tankfeeder joined #nim
08:26:45*gokr joined #nim
08:58:51*gokr left #nim (#nim)
09:08:33*yingjun quit (Remote host closed the connection)
09:15:43*yingjun joined #nim
09:23:58*v17d joined #nim
09:26:45*v17d quit (Remote host closed the connection)
09:28:12*v17d joined #nim
09:50:42*floppydh joined #nim
09:58:36*ShalokShalom_ quit (Remote host closed the connection)
09:58:47*ShalokShalom joined #nim
10:07:17*couven92 quit (Read error: Connection reset by peer)
10:17:57*kunev quit (Ping timeout: 240 seconds)
10:20:03*kunev joined #nim
10:27:14koppehHi guys.
10:27:38koppehWe have a little project that builds on other libs.
10:28:25koppehThe build process takes a unreasonably long amount of time and seems to rebuild files that were not touched.
10:30:25*Arrrr quit (Read error: Connection reset by peer)
10:34:19*couven92 joined #nim
10:46:45*floppydh quit (Quit: WeeChat 1.9)
10:56:05*crem joined #nim
11:03:08*smt joined #nim
11:14:52FromGitter<TiberiumN> I'm writing a small article about generics and converters in Nim, and I wanted to ask a question - is it true that there's no conventers in Nim stdlib? only in test suite?
11:15:29FromGitter<TiberiumN> oh, there is :)
11:21:04FromGitter<Sud0nim> In the end I made a shortcut to avoid retyping the whole inverse table proc toInverseTable*A, B (pairs: Table[A, B]): Table[B, A] = ⏎ result = initTableB, A (rightSize(pairs.len)) ⏎ for key, val in pairs: result[val] = key
11:34:27*yingjun quit (Remote host closed the connection)
11:46:03koppehMhh.. if we make a standalone application, should we even create a nimble package?
11:46:51Araqno.
11:47:18koppehI figured.
11:47:45koppehThen I can probably use the appropriate compiler methods to not recompile every little thing.
11:55:17*Sentreen quit (Quit: WeeChat 1.4)
11:55:27*Sentreen joined #nim
11:56:16koppehThen how would you go about adding dependencies to a standalone project?
11:59:42Araqyou add --path stuff to your config?
12:02:54*Snircle joined #nim
12:11:19Demos[m]koppeh: I'm pretty sure nim does not do seperate compilation for the nim part, just the C part. This is just because nobody had a project big enough to really need seperate compilation
12:20:27*skrylar quit (Quit: My iMac has gone to sleep. ZZZzzz…)
12:34:57*yingjun joined #nim
12:38:38FromGitter<Piripant> I just finished the 2017 nim survey. There was a part about removing the garbage collector. Is there any specific reason why that is being discussed?
12:39:09FromGitter<Piripant> Also wouldn't removing the GC postpone even more the 1.0 release?
12:41:05*yingjun quit (Ping timeout: 240 seconds)
12:50:10AraqI have grown to dislike GCs but the question wasn't related to v1.0 really.
12:50:34AraqI just wanted to know what people think in general. maybe it should be phrased differently
12:51:07Araqlooking at http://www.unicode.org/Public/10.0.0/ucd/CaseFolding.txt is Turkish the only "special" language out there?
12:51:20Araqand how come German's ß is not listed?
12:53:13FromGitter<AnorakTech_twitter> Hi there. I am getting into nim. Downloaded the latest 0.17.0 x64 for Windows. Got it up and running. Now I want to install nimx, but while processing the installation with nimble, a error pops up that I need nim-0.17.1. How can I upgrade?
12:53:42yglukhovAnorakTech_twitter: sorry, that's my bug, give me a sec
12:54:02FromGitter<AnorakTech_twitter> Uh, okay. THX
12:54:29FromGitter<AnorakTech_twitter> BTW, germans just got a new letter. ẞ which is a uppercase ß.
12:55:00yglukhovAnorakTech_twitter: pls try again
12:55:11Araqanorak: I'm aware
12:55:17Araqstill the question remains
12:55:39Demos[m]what's caused you to move away from gcs araq?
12:55:42Araqcan't build a decent unicode module if I don't understand these ascii tables
12:56:12AraqDemos[m]: I spent more time on Nim's GC than I ever spent on manual memory management problems
12:56:51*Sentreen quit (Ping timeout: 258 seconds)
12:57:05Araqand it makes multi threading harder. if you don't want to debug a concurrent GC, that is.
12:57:16Demos[m]that's fair. it's saved all of us time though
12:57:31FromGitter<Piripant> Of the GC alternatives listed on the survey what would you be in favour of?
12:57:40Araqmaybe, I dunno, Demos.
12:57:55AraqI feel like it only moves the costs to later stages of development
12:58:17Araqa GC transforms crashes into logical memory leaks, good luck hunting these
12:58:52Araqofc often it also transforms crashes into working programs that don't need further work, difficult to get some objective results
12:59:06Demos[m]maybe. but at the same time I like having my memory freed "sometime in the future" instead of immediately
12:59:13Demos[m]yeah
12:59:38AraqPiripant: probably Swift's ARC.
13:00:10Demos[m]I never understood how ARC was really different from a gc that just does not handle cycles
13:00:56Araqdepends on how you do it: if it's an implementation detail, you cannot attach 'close' to the RC==0 condition
13:01:15Araqif it's in the spec, you get working destructors
13:01:46AraqPython does RC but it's not in the spec, so you get finalizers, 'with' statements etc
13:02:41Demos[m]if you start attaching stuff to the destructor then you end up needing to actually free memory immediately though
13:02:58Araqyes
13:03:32FromGitter<AnorakTech_twitter> @yglukhov Thanks, that did the trick. :) Thumbs up.
13:04:22*ShalokShalom quit (Ping timeout: 246 seconds)
13:04:36FromGitter<Varriount> Where's the survey?
13:05:06FromGitter<Piripant> You can find the link here https://nim-lang.org/blog/2017/06/23/community-survey-2017.html
13:06:58*v17d quit (Ping timeout: 260 seconds)
13:07:43FromGitter<Varriount> @Araq One of the reasons I was drawn to Nim was because of the GC.
13:08:36*v17d joined #nim
13:09:09FromGitter<Varriount> For many of the applications I write, managing memory would slow down development time.
13:09:37FromGitter<Piripant> Well an implementation like Swift's ARC wouldn't really have you manually manage memory
13:10:15*Sentreen joined #nim
13:10:20FromGitter<Varriount> Isn't that susceptible to cyclic references?
13:11:06Demos[m]I really don't like the fact that ARC/RAII frees memory immediately. It's rarely what I really want and makes some constructs annoying (big graphs and stuff)
13:11:56FromGitter<Piripant> Yeah cyclic references wouldn't be possible with ARC
13:12:46Demos[m]also the atomic reference count actually can destroy performence, not as much as a thread safe gc but still
13:12:57Demos[m]even if you're not actually sharing the memory afaik
13:13:03Araqnot true, reference counting can deal with cycles via trial deletions
13:13:17Araqbut it makes things even more expensive :-)
13:13:39Araqyeah well, use ARC to manage memory regions, not single objects
13:14:12*gangstacat quit (Changing host)
13:14:12*gangstacat joined #nim
13:14:25Demos[m]but that's what I want my GC to do!
13:14:33Demos[m]manage single objects
13:15:04*gangstacat quit (Quit: Ĝis!)
13:15:26*gangstacat joined #nim
13:16:24FromGitter<Varriount> Araq: I don't particularly care what direction the GC goes in, as long as I don't have to manually manage memory.
13:17:25Araqvarriount: yeah, I think that's what most of us want :-)
13:17:31Araqsomewhat automatic MM
13:17:58Demos[m]imo newer FORTRAN does a pretty good job without the gc
13:18:06Demos[m]sorry Fortran
13:19:55*rauss joined #nim
13:20:17*PMunch joined #nim
13:24:02Araqhow so?
13:24:20Araqwhat does it do except copy arrays around? :-)
13:32:15PMunchHmm, is there a way to convert a seq to an array?
13:32:52PMunchI have a data structure that have a tree of fixed size nodes and a tail that grows until it's the right size before being inserted.
13:33:22*rauss quit (Quit: WeeChat 1.9)
13:33:32*rauss joined #nim
13:33:39PMunchFor performance reasons it would be nice to have my nodes simply be an array of n elements, but my tail as a seq
13:34:04FromGitter<codenoid> sup
13:34:21FromGitter<codenoid> hi, i'm nim new user, my background is text plain
13:34:39FromGitter<codenoid> btw, https://github.com/nim-lang/nimble/issues/377
13:35:50*tankfeeder quit (Quit: Connection closed for inactivity)
13:36:02*v17d quit (Ping timeout: 240 seconds)
13:36:34FromGitter<Piripant> I don't know much about your error
13:36:47FromGitter<Piripant> But you are using an older version of the nim compiler
13:37:06FromGitter<codenoid> ok, i'll update it
13:37:59FromGitter<Varriount> PMunch: There's an undocumented rtarrays module in the standard library
13:38:25FromGitter<Varriount> Probably better just to use a sequence and setLen() it
13:38:36PMunchHmm
13:42:22PMunchThis might be harder to do than I expected
13:42:32*user0 joined #nim
13:43:24user0How can I have a place holder within echo? like echo("The variable is: %s", $var)
13:44:12PMunchuser0, either with strutils or for simple things like the end of a line echo is a varargs function
13:45:12FromGitter<Varriount> user0: the strutils module has a format function
13:45:42FromGitter<ephja> and https://bitbucket.org/lyro/strfmt
13:46:21koppehI've been using % for this.
13:47:02koppeh"$# is '$#'." % ["variable", 2]
13:50:48PMunchkoppeh, isn't that just a macro for format?
13:51:57koppehOh.. yeah it would be weird if it wasn't.
13:54:53user0I was looking at writefmt https://lyro.bitbucket.io/strfmt/#writing-formatted-output-to-a-file-writefmt
13:55:12user0Can any kind fellow give me an example of writefmt?
13:55:32FromGitter<ephja> it's a proc
13:55:39user0I don't understand what 'f' means in the parameter
13:55:59PMunchFile
13:56:31PMunchSo if you did: var f = open("hello.txt", fmWrite)
13:56:53PMunchThen you could do f.writefmt("Hello %1", "World")
13:57:12PMunchAnd it would write "Hello World" to your file
13:58:08AraqPMunch: a seq has no access overhead over an array so it's pointless to convert it to an array
13:59:35PMunchWell, ideally the tree would only exist of arrays, internal ones containing pointers to new arrays, leaf ones containing data. Wether it's a leaf or internal can be decided by the tree length.
14:00:02PMunchs/exist/consist
14:00:17PMunchSo it would be pointless to store the seqs length fields
14:00:51FromGitter<codenoid> hi, how to add the `bin` directory to your PATH.
14:01:01koppehSo, Araq, there's no way for standalone projects to have a simple way of handling nimble dependencies?
14:01:25user0Oh just one more thing, if I import strutils, stdout.writefmt("Sending %1.", message) says "attempting to call undeclared routine: 'writefmt'" Module strfmt does not exist (import strfmt) what am I doing wrong?
14:01:29FromGitter<codenoid> i just update my nim, but when do -v it's not upgraded
14:01:43PMunchHow did you update?
14:02:03FromGitter<codenoid> via the command https://github.com/nim-lang/Nim
14:02:07PMunchProbably you have the old version installed from the software center and the new one from sources?
14:02:11FromGitter<codenoid> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=596cc3634bcd78af56bb0d47]
14:02:37PMunchcodenoid, it's better to install with choosenim
14:03:42PMunchuser0, is the import strfmt from your file?
14:05:07user0PMunch: Can you rephrase? I mean the writefmt proc, as the link suggested, belongs to the strfmt module
14:06:16PMunchstrfmt is not part of the standard library, did you install it?
14:06:47user0Oh I see. I didn't install the library.
14:06:50user0Thanks, PMunch:
14:06:54*NitenDoraku joined #nim
14:07:09*NitenDoraku left #nim (#nim)
14:11:48*jsgrant quit (Quit: Peace Peeps. o/ If you need me asap, message me at msg[(at)]jsgrant.io & I'll try to get back to you within 24-36 hours.)
14:12:12Araqkoppeh: well you can use nimble for standalone projects
14:12:25Araqbut manual --path handling is not hard either, IMHO
14:12:31koppehSo just a .nimble file with dependencies and nothing else.
14:14:08koppeh?*
14:15:06*jsgrant joined #nim
14:16:21*jsgrant quit (Remote host closed the connection)
14:18:10*jsgrant joined #nim
14:22:33FromGitter<TiberiumN> yes ⏎ then you can
14:22:38FromGitter<TiberiumN> nimble install to install all deps
14:33:14PMunchHmm, what does shallowCopy do?
14:34:19PMunchI want to copy an object to that all it's fields are the same as another, but updates aren't applied to both.
14:34:50PMunchAnd I don't want to copy the data at references, just the reference itself
14:41:22*yingjun joined #nim
14:43:34*ShalokShalom joined #nim
14:46:00*yingjun quit (Ping timeout: 260 seconds)
14:59:27*endragor quit (Remote host closed the connection)
14:59:54*endragor joined #nim
15:00:00*ShalokShalom quit (Ping timeout: 260 seconds)
15:00:40PMunchhttp://ix.io/yxp
15:01:02PMunchWhy doesn't the last two lines echo the same number?
15:01:17*endragor_ joined #nim
15:01:51PMunchOh, because I'm dumb..
15:02:16PMuncht.addr is of course the position in memory of the reference, not the reference itself..
15:02:49*ShalokShalom joined #nim
15:04:37*endragor quit (Ping timeout: 276 seconds)
15:05:28*endragor_ quit (Ping timeout: 240 seconds)
15:08:14*shashlick joined #nim
15:12:08*endragor joined #nim
15:19:39*Jesin joined #nim
15:28:59*Trustable joined #nim
15:30:20subsetparkkoppeh: nimble install -d only installs dependencies
15:30:52koppehSo as long as I have a nimble file (say, with ONLY dependencies), that'd work?
15:31:02*Trustable quit (Remote host closed the connection)
15:31:10koppehMhh not quite, I do need some other fields.
15:32:25*Sentreen quit (Ping timeout: 246 seconds)
15:35:06*Trustable joined #nim
15:36:39koppehI guess you can't override the build task in the .nimble? :/
15:39:07koppehMhh.. I don't think I should be using nimble (script) tasks.
15:39:18koppehIt's sort of nice to have though.
15:39:34koppehJust running "nimble <task>"
15:44:55*v17d joined #nim
15:46:15*Sentreen joined #nim
15:47:36koppehApparently "nimble compile" is an undocumented command in nimble..?
15:51:08*ShalokShalom quit (Ping timeout: 240 seconds)
15:51:21*ShalokShalom joined #nim
16:18:41*Sentreen quit (Ping timeout: 248 seconds)
16:19:18*Trustable quit (Remote host closed the connection)
16:20:10*Trustable joined #nim
16:27:19*cspar joined #nim
16:29:58*cspar_ quit (Ping timeout: 260 seconds)
16:31:29*yglukhov quit (Remote host closed the connection)
16:32:24*yglukhov joined #nim
16:32:26*Sentreen joined #nim
16:37:07*yglukhov quit (Ping timeout: 268 seconds)
16:40:17*gggs quit (*.net *.split)
16:42:32*demi- quit (Ping timeout: 240 seconds)
16:43:19*demi- joined #nim
17:00:49ZevvHi; is there a generic rule to follow to separate 'safe' from 'unsafe' Nim code; where 'safe' means something like 'no segfaults ever'?
17:10:26*ehmry quit (Ping timeout: 246 seconds)
17:10:26*dyce[m] quit (Ping timeout: 246 seconds)
17:10:28*TheManiac quit (Ping timeout: 240 seconds)
17:10:37*Demos[m] quit (Ping timeout: 258 seconds)
17:11:07*MrAxilus[m] quit (Ping timeout: 246 seconds)
17:11:10*jivank[m] quit (Ping timeout: 264 seconds)
17:11:11*stisa quit (Ping timeout: 255 seconds)
17:11:22*mindB quit (Ping timeout: 276 seconds)
17:11:22*hohlerde quit (Ping timeout: 276 seconds)
17:11:46*Jipok[m] quit (Ping timeout: 264 seconds)
17:12:19*couven92 quit (Quit: Client disconnecting)
17:13:41*PMunch quit (Remote host closed the connection)
17:21:57*nhywyll joined #nim
17:22:20*stisa joined #nim
17:25:02FromGitter<Varriount> Zevv: Don't use things like 'addr' 'ptr' and 'cast'
17:25:43FromGitter<Varriount> Decorate your references with 'not nil' (although the inferencing system for that is still buggy)
17:27:04*MrAxilus[m] joined #nim
17:27:05*dyce[m] joined #nim
17:27:05*mindB joined #nim
17:27:05*Demos[m] joined #nim
17:27:05*ehmry joined #nim
17:27:07*yglukhov joined #nim
17:27:12*jivank[m] joined #nim
17:27:12*Jipok[m] joined #nim
17:27:12*TheManiac joined #nim
17:27:12*hohlerde joined #nim
17:29:54ZevvOk, so the "not nil" is a do instead of a don't
17:31:28*yglukhov quit (Ping timeout: 240 seconds)
17:32:09FromGitter<Varriount> `proc foo(v: ref Bar not nil)` means "accept a parameter Bar that is known not to be nil"
17:33:00FromGitter<Varriount> Not nil checking is planned to become the default, however the system has several bugs in it.
17:34:15FromGitter<Varriount> I don't actually run into segfaults due to uninitialized variables all that often though. It tends to be exceptions thrown due to accessing an invalid index
17:35:52FromGitter<Varriount> Zevv: Unfortunately, Nim doesn't have as strong safety mechanisms as a language like Rust. This is mainly due to lack of development support.
17:43:59*yingjun joined #nim
17:48:26*yingjun quit (Ping timeout: 255 seconds)
17:51:59FromGitter<shalabhc> yeah not nil default would be fantastic!
17:56:21ZevvI'll keep in mind to not-nil whenever possible
17:56:34Zevvjust like using let instead of var whenever I can
17:59:08*PMunch joined #nim
18:04:01FromGitter<Varriount> Zevv: It's easier if you create your types with it.
18:05:18*Sentreen quit (Ping timeout: 268 seconds)
18:05:23FromGitter<Varriount> Zevv: https://nim-lang.org/docs/manual.html#types-not-nil-annotation
18:12:59ZevvVarriount: yes, that's what I'm currently doing
18:13:27Zevvhaving a default for that would be great indeed, but I understand the complexity of the subject is not to be underestimated
18:15:27*vivus joined #nim
18:17:50*Tiberium joined #nim
18:18:30*Sentreen joined #nim
18:20:57*yglukhov joined #nim
18:22:04*Tiberium quit (Remote host closed the connection)
18:29:35*endragor quit (Remote host closed the connection)
18:29:36*couven92 joined #nim
18:34:48*Sentreen quit (Ping timeout: 260 seconds)
18:38:53*Matthias247 joined #nim
18:41:40Araq103687 lines compiled; 3.998 sec total; 326.371MiB peakmem; # old style strings
18:41:48Araq103687 lines compiled; 3.971 sec total; 326.367MiB peakmem # new immutable strings
18:42:09Araqbut the variance is 0.5s on this machine for some reason
18:42:22Araqso ... all within the noise
18:42:31Araqdoes anybody have a decent string handling benchmark?
18:42:55Araqthe compiler itself doesn't strings really in the critical path based on these numbers
18:47:24*Sentreen joined #nim
18:51:55yglukhovAraq: what about memory footprint?
18:54:32*Sentreen quit (Ping timeout: 240 seconds)
18:56:13Araqlook at the numbers
18:59:22Araq 326MiB peakmem for both
18:59:25Araqno difference
19:00:35Araqbut the compiler doesn't use stupid getters and setters that favor immutable strings
19:01:18Araqlooking for a realistic benchmark
19:01:35Araqbut most benchmarks don't deal with strings or focus on concatenation
19:04:21Araqand what varriount will hate ;-) I can get the same performance characteristics with the existing string design
19:04:51Araqall it takes is to tweak how 'shallow' works under the hood
19:06:02Araqand lots of stdlib patches
19:07:28*Sentreen joined #nim
19:09:50*gsingh93 quit (Ping timeout: 258 seconds)
19:09:53*jmkr quit (Ping timeout: 246 seconds)
19:10:10Araqhmmm
19:10:40*jmkr joined #nim
19:11:02*gsingh93 joined #nim
19:12:09AraqI think my way of benchmarking is flawed
19:12:39Araqwith -d:immutableStrings I perform many complex compiletime transformations in a macro
19:14:28Araqhmm no, it simply doesn't matter
19:14:59*Sentreen quit (Ping timeout: 268 seconds)
19:18:37FromGitter<watzon> Is there a guild anywhere on meta programming in nim?
19:19:27*Nobabs27 joined #nim
19:23:02FromGitter<Varriount> Araq: Sort lines in a file?
19:23:19FromGitter<watzon> Also is it possible to make an instance of a object/type from a `typedesc`
19:23:30FromGitter<Varriount> @watzon Well, @dom96 has an e-book.
19:23:49Araqvarriount: sorting uses 'swap' aka no copies either way
19:25:14FromGitter<Varriount> Araq: What about making http requests?
19:27:11Araqseems bad because I don't fully understand http req's performance profiles
19:28:31*Sentreen joined #nim
19:28:45Araqalso btw, the split between MutString and string caused me to introduce 'unsafeBorrow' which I think is otherwise unnecessary
19:30:23*jsgrant quit (Quit: Peace Peeps. o/ If you need me asap, message me at msg[(at)]jsgrant.io & I'll try to get back to you within 24-36 hours.)
19:35:02*andrzejk_ joined #nim
19:36:52FromGitter<Varriount> Araq: If you think an immutable string type is a bad addition to the language, I won't object.
19:37:31FromGitter<watzon> Is there a way to do this that guarantees that `kind` will be of type `NNode` and not just any type?: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=596d11fb0de4d2545e38b67d]
19:38:10Araqvarriount: I don't mind "immutable" strings but the split between StringBuilder and strings is a pita
19:38:30Araqand as far as I can see we can have our cake and eat it too
19:38:40Araqconceptually immutable strings but with fast concats
19:40:11Araqwell ok, you can 'setLen' an existing string but it will not invalidate the other strings that point to it so who would object to that
19:40:43*couven92 quit (Ping timeout: 260 seconds)
19:40:46Araqthe existing design with 'shallow' seems *almost* perfect and with a couple of patches it will be perfect
19:41:40FromGitter<Varriount> I just hate it when I see benchmarks that assume Nim strings are like Python/Java strings, and then perform badly.
19:41:51FromGitter<AnorakTech_twitter> Hei there, got a fresh installation of nim. When compiling, I get this Error: ```Error: invocation of external linker program failed. Access is denied.``` Any clues?
19:42:55FromGitter<Varriount> @AnorakTech_twitter What's the permissions on your linker binary?
19:42:59*Nobabs27 quit (Quit: Leaving)
19:43:21Araqvarriount: where are these benchmarks?
19:43:45FromGitter<AnorakTech_twitter> @Varriount I am on Windows, so I guess default. Did not change anything as far as I know.
19:44:01FromGitter<Varriount> Do you have a compiler installed?
19:44:04Araqalso we can introduce 'StringBuilder' so that you don't forget to call 'freeze' (aka 'shallow') eventually
19:44:15Araqfor newbies it might be nice
19:44:26FromGitter<AnorakTech_twitter> @Varriount ... I should get gcc. Sorry for the trouble. xD
19:44:42Araqbut the old code can do without and get the same benefits with the old strings
19:45:03*tankfeeder joined #nim
19:45:21FromGitter<AnorakTech_twitter> @Varriount Ops, wait. I downloaded / installed mingw64 according to finish.exe
19:48:47FromGitter<Varriount> @AnorakTech_twitter Hm... can you run the compiler with --verbosity:3 ?
19:50:00*couven92 joined #nim
19:51:23FromGitter<AnorakTech_twitter> Indeed ```Hint: "\"PATH\nim-0.17.0\dist\mingw64\bin\gcc.exe\"" -o "PATH\AnoraksF\AnoraksF.exe" "PATH\AnoraksF\nimcache\AnoraksF.o" "PATH\AnoraksF\nimcache\stdlib_system.o" "PATH\AnoraksF\nimcache\stdlib_strutils.o" "PATH\AnoraksF\nimcache\stdlib_unsigned.o" "PATH\AnoraksF\nimcache\bigints_bigints.o" "PATH\AnoraksF\nimcache\stdlib_parseutils.o" "PATH\AnoraksF\nimcache\stdlib_math.o"
19:51:23FromGitter... "PATH\AnoraksF\nimcache\stdlib_algorithm.o" [Exec] Error: invocation of external linker program failed. Access is denied.```
19:55:09*andrzejk_ quit (Quit: Textual IRC Client: www.textualapp.com)
19:55:25FromGitter<Varriount> It should be printing out the linker invocation.
19:56:07FromGitter<Varriount> @AnorakTech_twitter I would look at your PATH environment variable and see if it matches up with your compiler location.
19:57:53FromGitter<AnorakTech_twitter> Checked that several times. But I found the problem now. Turns out that one can not simply use nim in a subfolder containing a whitespace.
19:58:11FromGitter<AnorakTech_twitter> *whitespace in the folder name.
20:00:14Araqnot true, that's even part of our test suite
20:00:21Araqa dir with spaces in it
20:05:55FromGitter<Varriount> Araq: You mean, finish.exe is tested on a path with spaces?
20:06:43Araqer no :-) but we test 'nim c "path with spaces"' works
20:20:21*pilne joined #nim
20:24:51*Trustable quit (Remote host closed the connection)
20:27:48*vlad1777d joined #nim
20:27:54*v17d quit (Read error: Connection reset by peer)
20:51:18*Vladar quit (Remote host closed the connection)
20:54:41*rosshadden joined #nim
20:57:02*rauss quit (Quit: WeeChat 1.9)
20:57:49*rosshadden quit (Client Quit)
20:57:58*rauss joined #nim
20:59:34FromGitter<cyberlis> I can't find any libtorrrent binding. Maybe some one can give me a link to repository. Or maybe some one can explain how make this binding.
21:08:32*yglukhov quit (Remote host closed the connection)
21:20:57*couven92 quit (Ping timeout: 240 seconds)
21:21:13FromGitter<ephja> how odd that I can connect to localhost and then send with asyncnet, but I can only connect when specifying my public address. sending fails
21:21:37*yglukhov joined #nim
21:24:33FromGitter<ephja> let's see how the recent async changes behave.... compilation error. d'oh
21:25:19FromGitter<ephja> have you tried the recent changes with any of the official tools that rely on networking?
21:28:59*Sentreen quit (Ping timeout: 258 seconds)
21:32:07FromGitter<ephja> "lib\pure\asyncfutures.nim(168, 13) Error: undeclared field: 'cb'". this might be the culprit https://github.com/nim-lang/Nim/commit/797690ba3ff415a457499ddf0edda24c31644b1d
21:38:52FromGitter<ephja> more like it missed something, I think. I'll fix it
21:42:19*Sentreen joined #nim
21:45:10*nhywyll quit (Quit: nhywyll)
21:47:26*yingjun joined #nim
21:50:30*arnetheduck quit (Ping timeout: 240 seconds)
21:51:58*yingjun quit (Ping timeout: 260 seconds)
22:04:39*couven92 joined #nim
22:05:04*yglukhov quit (Remote host closed the connection)
22:11:04FromGitter<ephja> it seems to be timing-dependent
22:13:21FromGitter<watzon> Is it possible to make a sequence of type `Node` that also holds any of Node's children without removing their properties? For instance: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Right now this echoes: `@[(lineno: 0, colno: 0)]` rather than `@[(lineno: 0, colno: 0, value: "Hello")]` [https://gitter.im/nim-lang/Nim?at=596d36801c8697534a33d920]
22:16:23*nsf quit (Quit: WeeChat 1.9)
22:16:28FromGitter<cyberlis> i think you need ref
22:16:45FromGitter<cyberlis> Value = ref object of Node
22:18:25FromGitter<watzon> Doing that ends up breaking the `traverseAndCheck` proc for `Value`
22:18:53FromGitter<watzon> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=596d37cc3230e14f3a6b27a5]
22:23:41FromGitter<cyberlis> `Ref objects should be used whenever inheritance is used. It isn't strictly necessary, but with non-ref objects assignments such as let person: Person = Student(id: 123) will truncate subclass fields.`
22:23:55FromGitter<cyberlis> https://nim-lang.org/docs/tut2.html
22:24:00FromGitter<cyberlis> Objects
22:24:10FromGitter<cyberlis> top of the page
22:34:28FromGitter<watzon> Ok so that works, but it ends up breaking the `$` proc for everything involving `Node`. Is it possible to get a list of all arguments within a proc? Something similar to javascript's `arguments`
22:35:23FromGitter<cyberlis> try repr
22:35:30FromGitter<cyberlis> for debug
22:35:59*rauss quit (Quit: WeeChat 1.9)
22:36:00FromGitter<watzon> Duh lol
22:36:02FromGitter<watzon> That works
22:36:42FromGitter<cyberlis> you are welcome
22:36:49*rauss joined #nim
22:38:08FromGitter<watzon> Yeah thanks haha. Looking at the source for `repr` it doesn't really have any code. What does the `.magic` pragma actually do under the hood? I can't find anything in the docs
22:38:46FromGitter<watzon> I've seen it a lot though while combing through the Nim source
22:45:38*user0 quit (Quit: user0)
22:47:49*user0 joined #nim
22:53:37FromGitter<ephja> crash after the last statement. interesting
22:56:49FromGitter<Varriount> @watzon `repr` implementation is in the compiler source code.
22:57:56*tankfeeder quit (Quit: Connection closed for inactivity)
23:00:19FromGitter<watzon> Ok then, so if I wanted to implement `$` for `Node` and all of it's children how difficult would that be? Basically I just want to return something like this `#Value(lineno: 0, colno: 10, value: "Hello")` but, seeing as I have close to 30 objects that inherit from `Node` it would be nice if I didn't have to do it for all of them
23:02:19FromGitter<ephja> is the default implementation no good?
23:02:45FromGitter<cyberlis> i think you can use macros. iterate over all fields and generate $ functions. but i think it will be difficult
23:03:10FromGitter<cyberlis> i am new in nim and i can be wrong
23:03:28FromGitter<watzon> @ephja yeah it doesn't work anymore. Gives me `type mismatch: got (Node)`
23:03:56FromGitter<ephja> `echo node[]`?
23:04:39FromGitter<watzon> @cyberlis that's what I was thinking, but I have no idea how to iterate over fields in a macro
23:08:01FromGitter<watzon> @ephja ok that does work. Here's my updated code ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ However it only prints the fields in Node, not the extra field that's in Value [https://gitter.im/nim-lang/Nim?at=596d4351bf7e6af22cea5e07]
23:09:58FromGitter<ephja> are variants not a better fit than inheritance?
23:10:15FromGitter<ephja> https://nim-lang.org/docs/typeinfo.html
23:10:26FromGitter<ephja> https://nim-lang.org/docs/system.html#fieldPairs.i,T
23:26:07*Matthias247 quit (Read error: Connection reset by peer)
23:38:27*vlad1777d quit (Remote host closed the connection)
23:44:33*couven92 quit (Quit: Client Disconnecting)
23:49:20*yingjun joined #nim
23:53:52*yingjun quit (Ping timeout: 260 seconds)