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:29 | watzon | \q |
01:05:14 | FromGitter | <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:50 | FromGitter | <watzon> How would you get the last n characters of a string? |
01:30:34 | FromGitter | <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:41 | FromGitter | <ephja> not that I know |
01:36:44 | FromGitter | <ephja> I think you mean 'high' (len - 1) |
01:38:03 | FromGitter | <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:56 | FromGitter | <Sud0nim> You could also shorten it just a little like: echo str[str.len - 5 .. ^1] |
01:58:12 | FromGitter | <Sud0nim> without the echo of course |
02:09:56 | FromGitter | <zacharycarter> is what I meant to drag over |
02:10:43 | FromGitter | <watzon> Here's yet another, are ternary if's possible? |
02:10:56 | FromGitter | <zacharycarter> no need for ternary |
02:11:00 | FromGitter | <watzon> No? |
02:11:01 | FromGitter | <zacharycarter> if / else can be used as expression |
02:11:08 | FromGitter | <zacharycarter> so |
02:11:20 | FromGitter | <zacharycarter> if foo: bar else: foobar |
02:12:17 | FromGitter | <watzon> Amazing |
02:12:24 | FromGitter | <watzon> I'm loving this language |
02:12:46 | FromGitter | <zacharycarter> :D |
02:13:16 | FromGitter | <zacharycarter> (https://files.gitter.im/nim-lang/Nim/QGtE/test.gif) |
02:14:20 | FromGitter | <watzon> Dude that's sick af! |
02:14:29 | FromGitter | <watzon> Great job |
02:14:31 | FromGitter | <zacharycarter> thanks :D |
02:14:57 | FromGitter | <watzon> Does it work with the javascript compiler currently? |
02:15:02 | FromGitter | <watzon> Or will it? |
02:15:06 | FromGitter | <zacharycarter> hrm that's a good question |
02:15:15 | FromGitter | <zacharycarter> it definitely won't currently |
02:15:31 | FromGitter | <zacharycarter> could it, most definitely if I wrote all the opengl code with webgl and got rid of all the OS calls |
02:15:40 | FromGitter | <watzon> If it could eventually that would be amazing |
02:16:27 | FromGitter | <zacharycarter> may have to toy with that over the next week or so ;) |
02:16:42 | skrylar | hrmm webgl. |
02:16:52 | FromGitter | <zacharycarter> I could go emscripten / webassembly |
02:16:53 | FromGitter | <zacharycarter> and use egl |
02:17:12 | FromGitter | <watzon> I'm primarily a web dev, so if it get's to that point I'll definitely be using it |
02:17:45 | skrylar | I 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:39 | FromGitter | <zacharycarter> but it's dead now right? |
02:18:46 | FromGitter | <zacharycarter> like poke it with a stick? |
02:18:47 | skrylar | believe so |
02:18:53 | FromGitter | <zacharycarter> hrm :/ |
02:18:55 | skrylar | mozilla refused to support it because :politics: |
02:19:01 | FromGitter | <zacharycarter> bleh |
02:19:15 | FromGitter | <zacharycarter> well I will try to get zengine on the web, it's one of my goals |
02:19:30 | FromGitter | <zacharycarter> how it gets there, is up for debate |
02:19:33 | skrylar | can always pifler from the superpowers engine |
02:19:36 | skrylar | they're doing webgl |
02:19:49 | FromGitter | <zacharycarter> yeah I've played with superpowers |
02:20:01 | skrylar | it's ok |
02:20:21 | FromGitter | <zacharycarter> very much agree |
02:20:26 | skrylar | Godot is more mature but they got thrashed by the plugin bs |
02:20:33 | FromGitter | <zacharycarter> yes |
02:20:47 | FromGitter | <zacharycarter> I don't even aim to compete with either of those engines |
02:20:51 | skrylar | Unity 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:00 | skrylar | I think they do emscripten but performance is **awful** |
02:21:19 | FromGitter | <zacharycarter> probably linking everything under the sun |
02:21:22 | skrylar | i think unity just gave up on the web |
02:21:41 | FromGitter | <zacharycarter> I don't blame them, it's not even that popular of a target anymore |
02:21:46 | FromGitter | <zacharycarter> not with steam etc |
02:21:52 | skrylar | it still is, it's just not worthwhile anymore |
02:22:41 | skrylar | With 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:53 | skrylar | So you get things like "use HTML5!" "but mozilla can't even play sounds properly" |
02:23:08 | FromGitter | <zacharycarter> heh |
02:23:30 | skrylar | Pico8 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:49 | skrylar | anyway |
02:23:52 | skrylar | bgfx looks neat. |
02:23:59 | FromGitter | <zacharycarter> ooo |
02:24:04 | FromGitter | <zacharycarter> this new engine is bgfxless |
02:24:11 | FromGitter | <zacharycarter> frag used bgfx |
02:24:13 | skrylar | did you throw it in the garbage? |
02:24:20 | FromGitter | <zacharycarter> I did |
02:24:31 | skrylar | someone wanted urho to run on bgfx but they wouldn't; too much intertia |
02:24:36 | skrylar | "but we already wrote our own middle layer" |
02:24:37 | FromGitter | <zacharycarter> it was too much for new users to get started with |
02:24:55 | skrylar | curious about compute shaders though |
02:24:57 | FromGitter | <zacharycarter> I probably will eventually write another rendering backend using bgfx |
02:25:20 | skrylar | eeh i dunno. not a good enough reason to stop using it imo |
02:25:26 | skrylar | one can always pile abstractions upwards |
02:25:36 | skrylar | but fixing stuff dumbed down at the lower end is exponentially harder |
02:26:06 | FromGitter | <zacharycarter> true, the author of bgfx has already thought through a lot of this stuff |
02:26:32 | skrylar | shrugs. not my engine |
02:26:41 | FromGitter | <zacharycarter> it's tough ground to stand on, people want something that is simple and they can prototype with |
02:27:07 | skrylar | well 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:18 | skrylar | libgdx and allegro have all their neat sprite sheet stuff on top of a render layer anyway |
02:27:38 | FromGitter | <zacharycarter> yeah |
02:27:40 | skrylar | although high end stuff is sadly solved these days :( |
02:27:42 | skrylar | for 2D |
02:28:49 | skrylar | eh well. have to clean up a box for work |
02:29:48 | FromGitter | <zacharycarter> o7 gl |
02:39:44 | * | handlex joined #nim |
02:48:53 | skrylar | I 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:05 | FromGitter | <Varriount> skrylar: I can't find one |
04:47:53 | FromGitter | <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:11 | skrylar | 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:12 | FromGitter | <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:46 | skrylar | pretty sure that's exactly what nimble does |
04:50:58 | skrylar | although uses get hub instead of their own system |
04:51:33 | FromGitter | <watzon> I guess I am more referring to the lack of a web interface |
04:51:33 | FromGitter | <Varriount> @watzon https://github.com/nim-lang/packages |
04:54:05 | FromGitter | <Varriount> I remember a time when flash games ruled |
04:55:22 | skrylar | 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:51 | FromGitter | <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:30 | FromGitter | <watzon> Yay |
06:07:02 | FromGitter | <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:17 | FromGitter | <watzon> Is there any way to have dynamic properties on an object? |
07:05:51 | * | yingjun quit (Remote host closed the connection) |
07:07:49 | Araq | yes, add a field of type 'JsonNode' to your object |
07:08:48 | * | yingjun joined #nim |
07:18:27 | FromGitter | <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:47 | ftsf_ | why are all programming languages named after games these days? =p |
07:34:17 | Araq | tbh 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:35 | ftsf_ | 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:01 | FromGitter | <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:15 | FromGitter | <Sud0nim> I couldn't find it in https://nim-lang.org/docs/tables.html#Table |
07:54:13 | * | couven92 joined #nim |
08:02:33 | Arrrr | I think there isn't. |
08:04:55 | * | arnetheduck joined #nim |
08:12:07 | FromGitter | <Varriount> @Sud0nim doesn't one generally just use two maps for those cases? |
08:16:23 | * | ShalokShalom_ joined #nim |
08:18:17 | FromGitter | <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:02 | ftsf_ | 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:28 | FromGitter | <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:14 | koppeh | Hi guys. |
10:27:38 | koppeh | We have a little project that builds on other libs. |
10:28:25 | koppeh | The 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:52 | FromGitter | <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:29 | FromGitter | <TiberiumN> oh, there is :) |
11:21:04 | FromGitter | <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:03 | koppeh | Mhh.. if we make a standalone application, should we even create a nimble package? |
11:46:51 | Araq | no. |
11:47:18 | koppeh | I figured. |
11:47:45 | koppeh | Then 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:16 | koppeh | Then how would you go about adding dependencies to a standalone project? |
11:59:42 | Araq | you add --path stuff to your config? |
12:02:54 | * | Snircle joined #nim |
12:11:19 | Demos[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:38 | FromGitter | <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:09 | FromGitter | <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:10 | Araq | I have grown to dislike GCs but the question wasn't related to v1.0 really. |
12:50:34 | Araq | I just wanted to know what people think in general. maybe it should be phrased differently |
12:51:07 | Araq | looking at http://www.unicode.org/Public/10.0.0/ucd/CaseFolding.txt is Turkish the only "special" language out there? |
12:51:20 | Araq | and how come German's ß is not listed? |
12:53:13 | FromGitter | <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:42 | yglukhov | AnorakTech_twitter: sorry, that's my bug, give me a sec |
12:54:02 | FromGitter | <AnorakTech_twitter> Uh, okay. THX |
12:54:29 | FromGitter | <AnorakTech_twitter> BTW, germans just got a new letter. ẞ which is a uppercase ß. |
12:55:00 | yglukhov | AnorakTech_twitter: pls try again |
12:55:11 | Araq | anorak: I'm aware |
12:55:17 | Araq | still the question remains |
12:55:39 | Demos[m] | what's caused you to move away from gcs araq? |
12:55:42 | Araq | can't build a decent unicode module if I don't understand these ascii tables |
12:56:12 | Araq | Demos[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:05 | Araq | and it makes multi threading harder. if you don't want to debug a concurrent GC, that is. |
12:57:16 | Demos[m] | that's fair. it's saved all of us time though |
12:57:31 | FromGitter | <Piripant> Of the GC alternatives listed on the survey what would you be in favour of? |
12:57:40 | Araq | maybe, I dunno, Demos. |
12:57:55 | Araq | I feel like it only moves the costs to later stages of development |
12:58:17 | Araq | a GC transforms crashes into logical memory leaks, good luck hunting these |
12:58:52 | Araq | ofc often it also transforms crashes into working programs that don't need further work, difficult to get some objective results |
12:59:06 | Demos[m] | maybe. but at the same time I like having my memory freed "sometime in the future" instead of immediately |
12:59:13 | Demos[m] | yeah |
12:59:38 | Araq | Piripant: probably Swift's ARC. |
13:00:10 | Demos[m] | I never understood how ARC was really different from a gc that just does not handle cycles |
13:00:56 | Araq | depends on how you do it: if it's an implementation detail, you cannot attach 'close' to the RC==0 condition |
13:01:15 | Araq | if it's in the spec, you get working destructors |
13:01:46 | Araq | Python does RC but it's not in the spec, so you get finalizers, 'with' statements etc |
13:02:41 | Demos[m] | if you start attaching stuff to the destructor then you end up needing to actually free memory immediately though |
13:02:58 | Araq | yes |
13:03:32 | FromGitter | <AnorakTech_twitter> @yglukhov Thanks, that did the trick. :) Thumbs up. |
13:04:22 | * | ShalokShalom quit (Ping timeout: 246 seconds) |
13:04:36 | FromGitter | <Varriount> Where's the survey? |
13:05:06 | FromGitter | <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:43 | FromGitter | <Varriount> @Araq One of the reasons I was drawn to Nim was because of the GC. |
13:08:36 | * | v17d joined #nim |
13:09:09 | FromGitter | <Varriount> For many of the applications I write, managing memory would slow down development time. |
13:09:37 | FromGitter | <Piripant> Well an implementation like Swift's ARC wouldn't really have you manually manage memory |
13:10:15 | * | Sentreen joined #nim |
13:10:20 | FromGitter | <Varriount> Isn't that susceptible to cyclic references? |
13:11:06 | Demos[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:56 | FromGitter | <Piripant> Yeah cyclic references wouldn't be possible with ARC |
13:12:46 | Demos[m] | also the atomic reference count actually can destroy performence, not as much as a thread safe gc but still |
13:12:57 | Demos[m] | even if you're not actually sharing the memory afaik |
13:13:03 | Araq | not true, reference counting can deal with cycles via trial deletions |
13:13:17 | Araq | but it makes things even more expensive :-) |
13:13:39 | Araq | yeah 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:25 | Demos[m] | but that's what I want my GC to do! |
13:14:33 | Demos[m] | manage single objects |
13:15:04 | * | gangstacat quit (Quit: Ĝis!) |
13:15:26 | * | gangstacat joined #nim |
13:16:24 | FromGitter | <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:25 | Araq | varriount: yeah, I think that's what most of us want :-) |
13:17:31 | Araq | somewhat automatic MM |
13:17:58 | Demos[m] | imo newer FORTRAN does a pretty good job without the gc |
13:18:06 | Demos[m] | sorry Fortran |
13:19:55 | * | rauss joined #nim |
13:20:17 | * | PMunch joined #nim |
13:24:02 | Araq | how so? |
13:24:20 | Araq | what does it do except copy arrays around? :-) |
13:32:15 | PMunch | Hmm, is there a way to convert a seq to an array? |
13:32:52 | PMunch | I 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:39 | PMunch | For 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:04 | FromGitter | <codenoid> sup |
13:34:21 | FromGitter | <codenoid> hi, i'm nim new user, my background is text plain |
13:34:39 | FromGitter | <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:34 | FromGitter | <Piripant> I don't know much about your error |
13:36:47 | FromGitter | <Piripant> But you are using an older version of the nim compiler |
13:37:06 | FromGitter | <codenoid> ok, i'll update it |
13:37:59 | FromGitter | <Varriount> PMunch: There's an undocumented rtarrays module in the standard library |
13:38:25 | FromGitter | <Varriount> Probably better just to use a sequence and setLen() it |
13:38:36 | PMunch | Hmm |
13:42:22 | PMunch | This might be harder to do than I expected |
13:42:32 | * | user0 joined #nim |
13:43:24 | user0 | How can I have a place holder within echo? like echo("The variable is: %s", $var) |
13:44:12 | PMunch | user0, either with strutils or for simple things like the end of a line echo is a varargs function |
13:45:12 | FromGitter | <Varriount> user0: the strutils module has a format function |
13:45:42 | FromGitter | <ephja> and https://bitbucket.org/lyro/strfmt |
13:46:21 | koppeh | I've been using % for this. |
13:47:02 | koppeh | "$# is '$#'." % ["variable", 2] |
13:50:48 | PMunch | koppeh, isn't that just a macro for format? |
13:51:57 | koppeh | Oh.. yeah it would be weird if it wasn't. |
13:54:53 | user0 | I was looking at writefmt https://lyro.bitbucket.io/strfmt/#writing-formatted-output-to-a-file-writefmt |
13:55:12 | user0 | Can any kind fellow give me an example of writefmt? |
13:55:32 | FromGitter | <ephja> it's a proc |
13:55:39 | user0 | I don't understand what 'f' means in the parameter |
13:55:59 | PMunch | File |
13:56:31 | PMunch | So if you did: var f = open("hello.txt", fmWrite) |
13:56:53 | PMunch | Then you could do f.writefmt("Hello %1", "World") |
13:57:12 | PMunch | And it would write "Hello World" to your file |
13:58:08 | Araq | PMunch: a seq has no access overhead over an array so it's pointless to convert it to an array |
13:59:35 | PMunch | Well, 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:02 | PMunch | s/exist/consist |
14:00:17 | PMunch | So it would be pointless to store the seqs length fields |
14:00:51 | FromGitter | <codenoid> hi, how to add the `bin` directory to your PATH. |
14:01:01 | koppeh | So, Araq, there's no way for standalone projects to have a simple way of handling nimble dependencies? |
14:01:25 | user0 | Oh 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:29 | FromGitter | <codenoid> i just update my nim, but when do -v it's not upgraded |
14:01:43 | PMunch | How did you update? |
14:02:03 | FromGitter | <codenoid> via the command https://github.com/nim-lang/Nim |
14:02:07 | PMunch | Probably you have the old version installed from the software center and the new one from sources? |
14:02:11 | FromGitter | <codenoid> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=596cc3634bcd78af56bb0d47] |
14:02:37 | PMunch | codenoid, it's better to install with choosenim |
14:03:42 | PMunch | user0, is the import strfmt from your file? |
14:05:07 | user0 | PMunch: Can you rephrase? I mean the writefmt proc, as the link suggested, belongs to the strfmt module |
14:06:16 | PMunch | strfmt is not part of the standard library, did you install it? |
14:06:47 | user0 | Oh I see. I didn't install the library. |
14:06:50 | user0 | Thanks, 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:12 | Araq | koppeh: well you can use nimble for standalone projects |
14:12:25 | Araq | but manual --path handling is not hard either, IMHO |
14:12:31 | koppeh | So just a .nimble file with dependencies and nothing else. |
14:14:08 | koppeh | ?* |
14:15:06 | * | jsgrant joined #nim |
14:16:21 | * | jsgrant quit (Remote host closed the connection) |
14:18:10 | * | jsgrant joined #nim |
14:22:33 | FromGitter | <TiberiumN> yes ⏎ then you can |
14:22:38 | FromGitter | <TiberiumN> nimble install to install all deps |
14:33:14 | PMunch | Hmm, what does shallowCopy do? |
14:34:19 | PMunch | I 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:50 | PMunch | And 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:40 | PMunch | http://ix.io/yxp |
15:01:02 | PMunch | Why doesn't the last two lines echo the same number? |
15:01:17 | * | endragor_ joined #nim |
15:01:51 | PMunch | Oh, because I'm dumb.. |
15:02:16 | PMunch | t.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:20 | subsetpark | koppeh: nimble install -d only installs dependencies |
15:30:52 | koppeh | So 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:10 | koppeh | Mhh 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:39 | koppeh | I guess you can't override the build task in the .nimble? :/ |
15:39:07 | koppeh | Mhh.. I don't think I should be using nimble (script) tasks. |
15:39:18 | koppeh | It's sort of nice to have though. |
15:39:34 | koppeh | Just running "nimble <task>" |
15:44:55 | * | v17d joined #nim |
15:46:15 | * | Sentreen joined #nim |
15:47:36 | koppeh | Apparently "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:49 | Zevv | Hi; 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:02 | FromGitter | <Varriount> Zevv: Don't use things like 'addr' 'ptr' and 'cast' |
17:25:43 | FromGitter | <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:54 | Zevv | Ok, so the "not nil" is a do instead of a don't |
17:31:28 | * | yglukhov quit (Ping timeout: 240 seconds) |
17:32:09 | FromGitter | <Varriount> `proc foo(v: ref Bar not nil)` means "accept a parameter Bar that is known not to be nil" |
17:33:00 | FromGitter | <Varriount> Not nil checking is planned to become the default, however the system has several bugs in it. |
17:34:15 | FromGitter | <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:52 | FromGitter | <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:59 | FromGitter | <shalabhc> yeah not nil default would be fantastic! |
17:56:21 | Zevv | I'll keep in mind to not-nil whenever possible |
17:56:34 | Zevv | just like using let instead of var whenever I can |
17:59:08 | * | PMunch joined #nim |
18:04:01 | FromGitter | <Varriount> Zevv: It's easier if you create your types with it. |
18:05:18 | * | Sentreen quit (Ping timeout: 268 seconds) |
18:05:23 | FromGitter | <Varriount> Zevv: https://nim-lang.org/docs/manual.html#types-not-nil-annotation |
18:12:59 | Zevv | Varriount: yes, that's what I'm currently doing |
18:13:27 | Zevv | having 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:40 | Araq | 103687 lines compiled; 3.998 sec total; 326.371MiB peakmem; # old style strings |
18:41:48 | Araq | 103687 lines compiled; 3.971 sec total; 326.367MiB peakmem # new immutable strings |
18:42:09 | Araq | but the variance is 0.5s on this machine for some reason |
18:42:22 | Araq | so ... all within the noise |
18:42:31 | Araq | does anybody have a decent string handling benchmark? |
18:42:55 | Araq | the compiler itself doesn't strings really in the critical path based on these numbers |
18:47:24 | * | Sentreen joined #nim |
18:51:55 | yglukhov | Araq: what about memory footprint? |
18:54:32 | * | Sentreen quit (Ping timeout: 240 seconds) |
18:56:13 | Araq | look at the numbers |
18:59:22 | Araq | 326MiB peakmem for both |
18:59:25 | Araq | no difference |
19:00:35 | Araq | but the compiler doesn't use stupid getters and setters that favor immutable strings |
19:01:18 | Araq | looking for a realistic benchmark |
19:01:35 | Araq | but most benchmarks don't deal with strings or focus on concatenation |
19:04:21 | Araq | and what varriount will hate ;-) I can get the same performance characteristics with the existing string design |
19:04:51 | Araq | all it takes is to tweak how 'shallow' works under the hood |
19:06:02 | Araq | and 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:10 | Araq | hmmm |
19:10:40 | * | jmkr joined #nim |
19:11:02 | * | gsingh93 joined #nim |
19:12:09 | Araq | I think my way of benchmarking is flawed |
19:12:39 | Araq | with -d:immutableStrings I perform many complex compiletime transformations in a macro |
19:14:28 | Araq | hmm no, it simply doesn't matter |
19:14:59 | * | Sentreen quit (Ping timeout: 268 seconds) |
19:18:37 | FromGitter | <watzon> Is there a guild anywhere on meta programming in nim? |
19:19:27 | * | Nobabs27 joined #nim |
19:23:02 | FromGitter | <Varriount> Araq: Sort lines in a file? |
19:23:19 | FromGitter | <watzon> Also is it possible to make an instance of a object/type from a `typedesc` |
19:23:30 | FromGitter | <Varriount> @watzon Well, @dom96 has an e-book. |
19:23:49 | Araq | varriount: sorting uses 'swap' aka no copies either way |
19:25:14 | FromGitter | <Varriount> Araq: What about making http requests? |
19:27:11 | Araq | seems bad because I don't fully understand http req's performance profiles |
19:28:31 | * | Sentreen joined #nim |
19:28:45 | Araq | also 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:52 | FromGitter | <Varriount> Araq: If you think an immutable string type is a bad addition to the language, I won't object. |
19:37:31 | FromGitter | <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:10 | Araq | varriount: I don't mind "immutable" strings but the split between StringBuilder and strings is a pita |
19:38:30 | Araq | and as far as I can see we can have our cake and eat it too |
19:38:40 | Araq | conceptually immutable strings but with fast concats |
19:40:11 | Araq | well 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:46 | Araq | the existing design with 'shallow' seems *almost* perfect and with a couple of patches it will be perfect |
19:41:40 | FromGitter | <Varriount> I just hate it when I see benchmarks that assume Nim strings are like Python/Java strings, and then perform badly. |
19:41:51 | FromGitter | <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:55 | FromGitter | <Varriount> @AnorakTech_twitter What's the permissions on your linker binary? |
19:42:59 | * | Nobabs27 quit (Quit: Leaving) |
19:43:21 | Araq | varriount: where are these benchmarks? |
19:43:45 | FromGitter | <AnorakTech_twitter> @Varriount I am on Windows, so I guess default. Did not change anything as far as I know. |
19:44:01 | FromGitter | <Varriount> Do you have a compiler installed? |
19:44:04 | Araq | also we can introduce 'StringBuilder' so that you don't forget to call 'freeze' (aka 'shallow') eventually |
19:44:15 | Araq | for newbies it might be nice |
19:44:26 | FromGitter | <AnorakTech_twitter> @Varriount ... I should get gcc. Sorry for the trouble. xD |
19:44:42 | Araq | but the old code can do without and get the same benefits with the old strings |
19:45:03 | * | tankfeeder joined #nim |
19:45:21 | FromGitter | <AnorakTech_twitter> @Varriount Ops, wait. I downloaded / installed mingw64 according to finish.exe |
19:48:47 | FromGitter | <Varriount> @AnorakTech_twitter Hm... can you run the compiler with --verbosity:3 ? |
19:50:00 | * | couven92 joined #nim |
19:51:23 | FromGitter | <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:23 | FromGitter | ... "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:25 | FromGitter | <Varriount> It should be printing out the linker invocation. |
19:56:07 | FromGitter | <Varriount> @AnorakTech_twitter I would look at your PATH environment variable and see if it matches up with your compiler location. |
19:57:53 | FromGitter | <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:11 | FromGitter | <AnorakTech_twitter> *whitespace in the folder name. |
20:00:14 | Araq | not true, that's even part of our test suite |
20:00:21 | Araq | a dir with spaces in it |
20:05:55 | FromGitter | <Varriount> Araq: You mean, finish.exe is tested on a path with spaces? |
20:06:43 | Araq | er 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:34 | FromGitter | <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:13 | FromGitter | <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:33 | FromGitter | <ephja> let's see how the recent async changes behave.... compilation error. d'oh |
21:25:19 | FromGitter | <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:07 | FromGitter | <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:52 | FromGitter | <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:04 | FromGitter | <ephja> it seems to be timing-dependent |
22:13:21 | FromGitter | <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:28 | FromGitter | <cyberlis> i think you need ref |
22:16:45 | FromGitter | <cyberlis> Value = ref object of Node |
22:18:25 | FromGitter | <watzon> Doing that ends up breaking the `traverseAndCheck` proc for `Value` |
22:18:53 | FromGitter | <watzon> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=596d37cc3230e14f3a6b27a5] |
22:23:41 | FromGitter | <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:55 | FromGitter | <cyberlis> https://nim-lang.org/docs/tut2.html |
22:24:00 | FromGitter | <cyberlis> Objects |
22:24:10 | FromGitter | <cyberlis> top of the page |
22:34:28 | FromGitter | <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:23 | FromGitter | <cyberlis> try repr |
22:35:30 | FromGitter | <cyberlis> for debug |
22:35:59 | * | rauss quit (Quit: WeeChat 1.9) |
22:36:00 | FromGitter | <watzon> Duh lol |
22:36:02 | FromGitter | <watzon> That works |
22:36:42 | FromGitter | <cyberlis> you are welcome |
22:36:49 | * | rauss joined #nim |
22:38:08 | FromGitter | <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:46 | FromGitter | <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:37 | FromGitter | <ephja> crash after the last statement. interesting |
22:56:49 | FromGitter | <Varriount> @watzon `repr` implementation is in the compiler source code. |
22:57:56 | * | tankfeeder quit (Quit: Connection closed for inactivity) |
23:00:19 | FromGitter | <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:19 | FromGitter | <ephja> is the default implementation no good? |
23:02:45 | FromGitter | <cyberlis> i think you can use macros. iterate over all fields and generate $ functions. but i think it will be difficult |
23:03:10 | FromGitter | <cyberlis> i am new in nim and i can be wrong |
23:03:28 | FromGitter | <watzon> @ephja yeah it doesn't work anymore. Gives me `type mismatch: got (Node)` |
23:03:56 | FromGitter | <ephja> `echo node[]`? |
23:04:39 | FromGitter | <watzon> @cyberlis that's what I was thinking, but I have no idea how to iterate over fields in a macro |
23:08:01 | FromGitter | <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:58 | FromGitter | <ephja> are variants not a better fit than inheritance? |
23:10:15 | FromGitter | <ephja> https://nim-lang.org/docs/typeinfo.html |
23:10:26 | FromGitter | <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) |