00:13:29 | vivus | how much impact does the nim survey have on the community? |
00:14:37 | FromGitter | <TiberiumN> ehm? maybe " how much impact Nim community survey have on nim?" |
00:23:46 | demi- | dom96: is there any way i could install choosenim non-interactively? |
00:33:21 | def-pri-pub | zacharycarter: I think I may have asked this before, but is there an outline for the development of zengine? |
00:38:54 | FromGitter | <zacharycarter> def-pri-pub: nothing beyond what I have in my head which is get it to a state where it can be used for making a game |
00:38:58 | FromGitter | <zacharycarter> do you have some ideas? |
00:41:00 | def-pri-pub | eh, more general ideas for Nim that don't really exist, that would mainly help with game develompent, but useful for other things. |
00:42:06 | FromGitter | <zacharycarter> I gotcha |
00:42:25 | dom96 | demi-: yes, take a look at what the .sh script does |
00:42:28 | FromGitter | <zacharycarter> I think zengine needs examples |
00:42:44 | FromGitter | <zacharycarter> because it can most likely do a lot of what raylib can already |
00:45:09 | def-pri-pub | E.g. I don't think there's a really good geometry & maths library out there. |
00:45:35 | FromGitter | <zacharycarter> true |
01:00:17 | * | Sentreen quit (Quit: WeeChat 1.6) |
01:01:23 | * | Sentreen joined #nim |
01:06:44 | * | chemist69 quit (Ping timeout: 246 seconds) |
01:06:52 | * | Sentreen quit (Ping timeout: 260 seconds) |
01:07:21 | def-pri-pub | That's something I really want to do... If only I didn't have so many interests and so little free time.... |
01:19:45 | * | Sentreen joined #nim |
01:20:29 | * | chemist69 joined #nim |
01:27:40 | * | vivus quit (Quit: Leaving) |
01:32:24 | FromGitter | <zacharycarter> I know what you mean |
01:32:30 | FromGitter | <zacharycarter> (https://files.gitter.im/nim-lang/Nim/FVzR/Screen-Shot-2017-08-05-at-9.32.04-PM.png) |
01:39:16 | def-pri-pub | Fresh update of stb_image package done: https://gitlab.com/define-private-public/stb_image-Nim/tags/1.4 |
01:39:33 | def-pri-pub | Updates to the latest stb_image headers (which includes JPEG saving)! |
01:42:02 | FromGitter | <zacharycarter> nice! |
01:59:10 | FromGitter | <singularperturbation> Lots of work still to be done, but using multiple threads for tests does seem to speed things up a bit: ~27 minute build time vs. 44 minute build time for https://github.com/nim-lang/Nim/pull/6190 on Travis |
01:59:36 | FromGitter | <singularperturbation> Need to figure out the SQLite issue and a lot of other stuff before it can be merged though |
02:15:53 | * | rauss joined #nim |
02:16:26 | * | mahmudov quit (Ping timeout: 268 seconds) |
02:19:19 | * | mahmudov joined #nim |
02:25:46 | * | Nobabs27 joined #nim |
02:50:36 | * | mahmudov quit (Remote host closed the connection) |
03:15:15 | def-pri-pub | singularpertubation: Are you trying to make the unit testing module run in parallel? |
03:41:05 | * | def-pri-pub quit (Quit: leaving) |
03:49:25 | * | Nobabs27 quit (Quit: Leaving) |
04:00:08 | * | couven92 quit (Quit: Client Disconnecting) |
04:01:07 | * | endragor joined #nim |
04:05:01 | * | dankrad quit (Ping timeout: 255 seconds) |
04:06:42 | * | dankrad joined #nim |
04:12:28 | * | pilne quit (Quit: Quitting!) |
05:01:58 | dozn | Error when adding the --memtracker:on option to nim on Windows 10 https://paste.ee/p/cEERR |
05:09:03 | dozn | Seems like there's a few ways to implement parallelism and concurrency, would there be any recommended method to spawn off a bunch of http requests? |
05:11:19 | dozn | Araq, thanks for your help with the {.raises.} earlier, I've sucked it up and simply created a main proc which is instantly called, in order to ensure I've caught everything, I believe it's working well =) |
05:15:51 | dozn | Although I do miss being able to stick a "from" or "import" statement right above where it's being used ;) |
05:16:45 | * | andrzejku joined #nim |
05:26:57 | * | enthus1ast- quit (Ping timeout: 240 seconds) |
05:37:27 | dozn | Araq, also, regarding where we should see the auto-implied {.raises[].}, it would be great if <insert IDE plugin> (I'm using VSCode) would show which exceptions bubble up whenever you hover over a function. I'm new to exceptions as a method of error handling as well, so perhaps this isn't required for some reason which I'm obviously oblivious to =b |
05:38:32 | dozn | Actually, even if I manually insert a {.raises[].} pragma, that plugin doesn't display it on the tooltip, although it displays everything else ({.gcsafe, locks: <unknown>.}, etc.}) |
05:52:34 | * | andrzejku quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
05:59:07 | dozn | Is there syntax which allows me to use a function from another package while in a chain? Thinking something along the lines of debugMessage.(debug.println) or something |
05:59:24 | dozn | (the module being called "debug" in this example) |
06:10:58 | * | andrzejku joined #nim |
06:13:19 | dozn | use a function from another package while specifically stating as such*, debug.println() in the example |
06:16:50 | * | v17d quit (Ping timeout: 240 seconds) |
06:20:55 | dozn | Love how the executable is 276kb (not statically linked, but that's only a few kb more), whereas the same application in Rust is 2559kb, and Go is 5417kb |
06:29:00 | dozn | I mean shit, nim.exe is 2851kb haha |
06:30:01 | dozn | Whoops, forgot to add --opt:size, so 180kb =b |
06:31:47 | * | v17d joined #nim |
06:37:33 | * | haha joined #nim |
06:37:58 | * | haha is now known as Guest81170 |
06:42:01 | * | Guest81170 quit (Read error: Connection reset by peer) |
06:43:15 | * | NaClu2 joined #nim |
06:45:16 | * | NaClu2 quit (Client Quit) |
06:51:52 | def- | dozn: i don't know of any such way to chain, why would you want that? |
06:52:11 | dozn | def-, So I can chain whilst there's conflicting functions |
06:52:16 | def- | dozn: a module could re-export the identifier, or you could import the original |
06:52:31 | def- | ah |
06:52:40 | def- | Now I understand, my bad. I thought debugMessage and debug are both modules |
06:52:44 | dozn | S'all good |
06:52:47 | * | Trustable joined #nim |
06:52:55 | dozn | Yeah, I did make the example confusing, due to me having a "debug" module =b |
06:53:04 | def- | debug.println(debugMessage, ...) works |
06:53:16 | def- | If you care about binary size: https://hookrace.net/blog/nim-binary-size/ |
06:53:19 | dozn | Sorry, that was just a random example, not an exact issue I have |
06:53:41 | dozn | I'm content with the nim binary size, in fact, more than content, I'm ecstatic |
06:53:46 | dozn | =) |
06:54:06 | dozn | I really hope I have some time in a few months to write some tutorials/documentation |
06:56:25 | dozn | Part of the file size discrepancy is almost certainly due to not dynamically linking SSL, although I'm unsure of what Rust and Go does specifically for it, I believe Go does not by default include SSL |
06:56:45 | dozn | not statically linking SSL* |
06:56:57 | def- | sounds like a bad idea to statically link ssl |
06:57:19 | def- | need to update your application with each openssl vulnerability |
06:57:37 | def- | but with dyn libs you run into problems of different versions being available on linux distros |
06:57:51 | dozn | Yar, I've gone back and forth for years, but I've finally settled on static binaries |
06:58:09 | dozn | I just watch every dependency and rebuild when need be |
06:58:40 | dozn | I actually built an app which did this for me, I wonder if I still have it hanging around.. |
06:58:58 | dozn | Fuck, I think I wrote it in PHP 15 years ago hahaha |
07:00:42 | dozn | even libssl.a is only ~600->700kb |
07:03:27 | dozn | http://midipix.org/#sec-midipix looks neat, I wonder if it would allow me dynamically link musl on Windows... |
07:03:44 | dozn | Ctrl+F musl |
07:03:47 | def- | why would you want to do that? |
07:04:29 | dozn | I just think it's twisted haha |
07:04:42 | def- | I would understand it if you're writing straight in C |
07:04:52 | def- | But Nim has reasonable Windows support |
07:05:05 | dozn | Do nim binaries include a C std replacement? |
07:05:20 | dozn | Or does it dynamically link to some Windows C backend |
07:05:29 | dozn | (my knowledge regarding Windows is incredibly limited) |
07:05:31 | def- | dyn link against system's c stdlib |
07:05:54 | dozn | Any idea what that would be on Windows, or shall I do some Googling? =D |
07:06:16 | def- | some windows specific dll I assume, forgot its exact name |
07:06:26 | dozn | No worries, thanks a lot for everything |
07:09:53 | dozn | msvcrt.dll |
07:22:36 | * | haha_ joined #nim |
07:24:20 | * | tdc joined #nim |
07:24:57 | * | andrzejku quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
07:26:14 | * | andrzejku joined #nim |
07:26:43 | * | ftsf quit (Ping timeout: 246 seconds) |
07:28:08 | dozn | Eh, can't get it working, oh well, on to things that actually matter =b |
07:30:05 | * | Trustable quit (Remote host closed the connection) |
07:30:48 | * | ftsf joined #nim |
07:43:51 | * | tdc quit (Remote host closed the connection) |
07:48:03 | * | rauss quit (Quit: WeeChat 1.9) |
08:08:23 | * | Ven joined #nim |
08:08:46 | * | Ven is now known as Guest71332 |
08:20:23 | * | ftsf quit (Ping timeout: 246 seconds) |
08:21:43 | FromGitter | <timmyjose> Hey folks, long shot here, but is there any plugin for Nim in Far Manager? |
08:28:33 | * | tdc joined #nim |
08:30:45 | dozn | http://www.farmanager.com/ ? |
08:31:34 | * | yglukhov joined #nim |
08:34:15 | * | ftsf joined #nim |
08:36:07 | * | ShalokShalom joined #nim |
08:37:44 | FromGitter | <timmyjose> @dozn So you mean I must implement it myself if I want a Nim plugin? |
08:38:02 | Araq | dozn: I guess it's just something we need to implement (nimsuggest showing .raises information) |
08:38:17 | * | dozn nods |
08:38:28 | Araq | timmyjose: it's not clear what a plugin would achieve for it |
08:38:42 | FromGitter | <timmyjose> I mean basic syntax highlighting and such |
08:41:49 | FromGitter | <timmyjose> I am used to working with Far Manager on Windows. so it would be lovely to have support for Nim in Far Manager,. Maybe I can consider working on a plugin myself in the near future - that would be an interesting project :-) |
08:45:10 | dozn | Seems like there's a few ways to implement parallelism and concurrency, would there be any recommended method to spawn off a bunch of http requests? |
08:45:51 | * | andrzejku quit (Quit: Textual IRC Client: www.textualapp.com) |
08:45:54 | Araq | dozn: currently, use the asynchttpserver and no threading |
08:46:52 | * | Guest71332 is now known as Ven`` |
08:47:00 | dozn | Okay, let's imagine I'm also at the same time concurrently doing data on the HTML retrieved, what should I be using for concurrency in that instance? (if asynchttpserver still handles that, just say "2" =b) |
08:47:28 | dozn | running functions on the HTML* |
08:48:17 | dozn | Oh sorry, I'm not running a server, I'm running a client |
08:48:22 | dozn | Web scraping |
08:50:02 | dozn | Right now I'm just using `httpclient.newHttpClient().getContent(url).newStringStream.parseHtml`, I want to throw that (using a concurrency primitive) into a longer proc which also does other things (perhaps spawn off more concurrent things) |
08:50:53 | dozn | I'm assuming I want asyncdispatch, but I've never used a language with async before, so asking to be sure there's no better methods. |
08:52:05 | * | Matthias247 joined #nim |
08:55:21 | Araq | in the asynchttpclient's handler, use 'spawn' |
08:55:24 | * | ShalokShalom quit (Ping timeout: 260 seconds) |
08:58:42 | dozn | Oh fuck me, of course there's a corresponding asynchttpclient to the -server version, thanks a lot Araq |
08:59:33 | dozn | Are you planning on merging both httpclient and asynchttpclient at some point? |
09:00:17 | * | ShalokShalom joined #nim |
09:01:45 | Araq | I think they are both in the same module, so no, why? |
09:04:05 | dozn | Derp. |
09:16:39 | * | piotr_ joined #nim |
09:19:10 | * | couven92 joined #nim |
09:20:03 | couven92 | Hello World! Rise and shine everybody! :) |
09:21:26 | dozn | Is it morning already? Shit, I forgot to sleep >_< |
09:24:00 | couven92 | dozn, yeah, it almost midday here :) 11:23 |
09:24:11 | dozn | 2:24 here =b |
09:24:17 | dozn | I won't be going to bed for a few hours yet, however |
09:24:56 | couven92 | i nearly forgot to sleep yesterday as well... After we finished merging Android support into Nim, I decided to treat myself with a game of Civ V... "One More Turn" indeed! :D |
09:25:22 | dozn | I saw that, congrats! Very exciting =) FTL is my drug of choice for single player games to get lost in |
09:25:45 | dozn | http://steamcommunity.com/id/dozn |
09:26:01 | dozn | I don't really game much these days |
09:26:17 | dozn | 980 of those hours in CS:GO are from more than a few years ago |
09:26:55 | couven92 | me neither... but now I am about to finish my M.Sc. and suddenly I only have a job instead of being a full-time student! :P |
09:27:13 | dozn | Oh wow, the free time must be hard to deal with =b |
09:28:27 | couven92 | yeah... though my classmates and I recently seriously started playing Factorio... Very OCD-friendly and highly addictive! :D |
09:28:46 | couven92 | bad time management decisions!!! :P |
09:29:17 | dozn | Oh god, I've been purposely avoiding it |
09:29:25 | dozn | TIS-100 was amazing |
09:29:52 | couven92 | can't say I've heard of that one? |
09:29:56 | * | ftsf quit (Ping timeout: 260 seconds) |
09:29:58 | dozn | http://store.steampowered.com/app/370360/TIS100/ |
09:30:01 | dozn | It's incredibly fun |
09:30:26 | couven92 | huh... cool! :) |
09:30:52 | * | arnetheduck joined #nim |
09:32:10 | dozn | couven92, Do you have http://store.steampowered.com/sub/17602/ or http://store.steampowered.com/app/322330/Dont_Starve_Together/ ? |
09:32:57 | couven92 | I have Don't Starve Together... but only played about 3 hours... Just bought that recently |
09:33:14 | couven92 | http://steamcommunity.com/id/couven92/ |
09:33:55 | dozn | couven92, PM me your email and I'll send you the hacker game |
09:34:12 | dozn | They had glitched pricing for a while, so I bought a bunch |
09:37:09 | dozn | If you have a friend who wants Don't Starve, let me know |
09:38:39 | couven92 | cool :) |
09:46:32 | * | ShalokShalom quit (Quit: No Ping reply in 180 seconds.) |
09:48:00 | * | ShalokShalom joined #nim |
09:48:40 | * | ftsf joined #nim |
09:52:44 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:58:51 | * | Ven joined #nim |
09:59:16 | * | Ven is now known as Guest27753 |
10:08:44 | * | haha_ quit (Read error: Connection reset by peer) |
10:10:22 | FromGitter | <TiberiumN> hacker game? what is it? |
10:11:12 | FromGitter | <TiberiumN> http://steamcommunity.com/id/tiberiumk I don't play much games too ⏎ maybe some Battlefield 1 |
10:12:24 | FromGitter | <TiberiumN> but it's not in steam :) |
10:13:43 | FromGitter | <TiberiumN> also, maybe we can add Android (via termux) in "Compiling" section in readme? |
10:14:01 | FromGitter | <TiberiumN> well after csources will be generated again (for 0.17.2 or 0.18) |
10:17:24 | couven92 | @TiberiumN, good idea, a post in the forum would also be nice... I'll do that soon, just have to finish breakfast :) |
10:18:59 | * | Guest27753 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
10:28:46 | * | yglukhov quit (Remote host closed the connection) |
10:31:43 | * | mahmudov joined #nim |
10:38:09 | FromGitter | <TiberiumN> wow, I didn't knew that strutils.editDistance works for unicode strings too |
10:38:10 | FromGitter | <TiberiumN> cool! |
10:41:05 | * | ShalokShalom quit (Ping timeout: 240 seconds) |
10:42:07 | * | Ven_ joined #nim |
10:42:49 | def- | @TiberiumN: Well, it does something, but I would not assume correct results |
10:43:10 | FromGitter | <TiberiumN> why? it makes correct results |
10:43:19 | def- | I just looked at the implementation |
10:43:27 | def- | It just takes each byte as a character, doesn't seem to handle unicode |
10:43:58 | def- | generally all unicode handling stuff is in unicode module |
10:44:04 | FromGitter | <TiberiumN> well, how does it work then? |
10:44:08 | FromGitter | <TiberiumN> it works for me |
10:44:25 | def- | you might not have tried it with a large enough subset of unicode |
10:44:39 | FromGitter | <TiberiumN> well I only need russian and english :) |
10:44:45 | FromGitter | <TiberiumN> and it works for russian text |
10:47:43 | def- | it should not be too hard to make a proper unicode version though, split into runes and use those runes for comparisons |
10:47:59 | * | BitPuffin|osx joined #nim |
10:50:18 | def- | except if you want to care about combining marks too |
10:51:02 | dozn | Mmm, graphemes |
10:51:14 | dozn | Err, grapheme clusters |
10:51:15 | FromGitter | <TiberiumN> but how does it work for unicode?! i don't understand |
10:51:25 | FromGitter | <TiberiumN> *for a subset of unicode |
10:52:17 | * | mahmudov quit (Quit: Leaving) |
10:52:19 | def- | assuming utf8 encoded strings, if 2 characters have the same prefix bytes and only differ in the last bytes, it should work. as long as you use characters that happen to have the same byte length |
10:52:35 | * | mahmudov joined #nim |
10:52:39 | def- | but if you mix ascii with cyrillic, it should give wrong results |
10:52:53 | FromGitter | <TiberiumN> hmm, ok |
10:54:41 | def- | editDistance("aa", "Дa") |
10:54:55 | def- | changed 1 character, still returns 2 |
10:55:09 | FromGitter | <TiberiumN> well ok |
10:55:35 | * | piotr_ quit (Quit: Leaving) |
10:56:43 | def- | because Д is [0xd0, 0x94] in utf8, so it's interpreted as 2 characters, while a is 0x61 |
10:59:55 | * | haha_ joined #nim |
11:04:48 | FromGitter | <TiberiumN> well I think it would better if I'll just use simple implementation of levenshtein distance, because this implementation seems to be optimized a lot for ascii |
11:08:18 | * | dddddd joined #nim |
11:08:35 | Araq | oh yeah, please move editDistance to the unicode module and fix it |
11:12:28 | couven92 | Araq, the CI run for the Testament upgrade lit up all green during the night: https://github.com/nim-lang/Nim/pull/6058 |
11:12:49 | FromGitter | <TiberiumN> wow, appveyor started to work? |
11:13:12 | FromGitter | <TiberiumN> it seems so - https://github.com/nim-lang/Nim/pull/6190 even here appveyor is passed |
11:13:13 | FromGitter | <TiberiumN> hmm |
11:13:29 | FromGitter | <TiberiumN> oh wait |
11:13:29 | FromGitter | <TiberiumN> in 3 hours in 54 min 58 sec |
11:13:30 | FromGitter | <TiberiumN> wat |
11:16:36 | * | Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
11:17:13 | Araq | TiberiumN: I fixed the windows builds 2 days ago |
11:17:33 | FromGitter | <TiberiumN> ah, ok |
11:17:40 | FromGitter | <TiberiumN> what was the cause? |
11:19:43 | Araq | you don't want to know |
11:19:49 | FromGitter | <TiberiumN> ok :) |
11:19:57 | Araq | but it made perfect sense |
11:20:10 | Araq | and was mostly a conincidence that only windows was affected |
11:21:31 | * | mahmudov quit (Quit: Leaving) |
11:21:51 | * | mahmudov joined #nim |
11:24:57 | * | ShalokShalom joined #nim |
11:25:07 | * | BitPuffin|osx quit (Ping timeout: 276 seconds) |
11:30:59 | * | enthus1ast- joined #nim |
11:41:22 | * | tdc quit (Ping timeout: 276 seconds) |
11:43:34 | Araq | couven92: feel like improving the stdlib at the same time? |
11:43:57 | couven92 | sure, what do you need? |
11:45:49 | Araq | strutils.multiReplace |
11:47:54 | couven92 | Araq, okay... take a table as argument and replace? Or what should it do? |
11:48:34 | Araq | varargs[(string, string)] |
11:49:00 | couven92 | yeah okay, that makes more sense |
11:49:21 | Araq | oh and don't hack the implementation together with the existing replace |
11:49:30 | Araq | a single pass over the input string please |
11:49:45 | couven92 | yeah... avoid allocations, got it! :) |
11:49:58 | Araq | this is required for correctness anyway, think about x.multiReplace(("a", "b"), ("b", "a")) |
11:50:36 | Araq | that needs to swap a's and b's |
11:51:32 | couven92 | yeah... thinking: iterate over the input at each character see if it starts with one of the replacement tuples and then replace |
11:59:02 | * | Ven joined #nim |
11:59:27 | * | Ven is now known as Guest22119 |
12:02:19 | * | yglukhov joined #nim |
12:12:15 | * | http_GK1wmSU joined #nim |
12:13:15 | * | http_GK1wmSU left #nim (#nim) |
12:22:02 | * | yglukhov quit (Remote host closed the connection) |
12:28:48 | * | endragor quit (Remote host closed the connection) |
12:30:44 | * | endragor joined #nim |
12:35:11 | * | endragor quit (Ping timeout: 246 seconds) |
12:36:11 | * | Sentreen quit (Ping timeout: 268 seconds) |
12:36:22 | * | Matthias247 quit (Read error: Connection reset by peer) |
12:40:35 | * | Guest22119 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:49:10 | * | Sentreen joined #nim |
12:58:09 | * | Sentreen quit (Ping timeout: 240 seconds) |
13:03:53 | * | yglukhov joined #nim |
13:11:42 | * | Sentreen joined #nim |
13:16:21 | * | yglukhov quit (Remote host closed the connection) |
13:18:46 | * | haha_ quit (Quit: haha_) |
13:26:43 | * | pilne joined #nim |
13:27:56 | * | ShalokShalom quit (Ping timeout: 260 seconds) |
13:27:58 | * | ShalokShalom_ joined #nim |
13:34:42 | * | mahtov quit (Ping timeout: 260 seconds) |
13:39:44 | * | mahtov joined #nim |
13:40:04 | * | ShalokShalom_ quit (Ping timeout: 260 seconds) |
13:54:59 | * | Vladar joined #nim |
14:08:45 | couven92 | Araq, https://github.com/nim-lang/Nim/pull/6193 |
14:10:03 | couven92 | Araq, But I also need some help... I tried first to preallocate result with the length of s with `result = newString(s.len)` but then add didn't seem to add the replacement strings? |
14:10:31 | FromGitter | <TiberiumN> AFAIK if you preallocate a string or sequence you need to modify it by index |
14:10:37 | FromGitter | <TiberiumN> not by doing "add" |
14:10:44 | def- | couven92: probably a \0 byte inbetween in your string |
14:11:02 | couven92 | hmm... okay |
14:11:26 | def- | @TiberiumN No, you can preallocate, and then use add. |
14:11:37 | FromGitter | <TiberiumN> I know |
14:11:53 | FromGitter | <TiberiumN> but first chars then would be empty |
14:12:00 | def- | Strings are just a bit dangerous because they have both a length and also end on \0 byte |
14:12:10 | def- | but that's only for strings, not sequences |
14:14:45 | couven92 | def-, so how do I do it? https://github.com/couven92/Nim/blob/strutils-multireplace/lib/pure/strutils.nim#L1557 |
14:15:55 | def- | couven92: what's your goal? |
14:16:49 | couven92 | I have result and it should possibly be preallocated with s.len, then i add replacement parts to it as I iterate through s |
14:17:17 | def- | but what do you want to be the content of result? |
14:17:33 | def- | what are "replacement parts"? |
14:17:47 | def- | Ah, I think I understand |
14:17:52 | subsetpark | Araq : can't that just overload on the signature of strutils.replace? |
14:18:00 | def- | use newStringOfCap() |
14:18:44 | couven92 | def-, okay... but what if my new string actually gets longer than the original length of s? Should I realloc then? |
14:18:53 | def- | no, that happens automatically |
14:19:01 | couven92 | Ah! great! :) |
14:19:05 | def- | if you just add until the initially allocated size, no reallocs happen |
14:19:13 | def- | if you add more, it will grow automatically |
14:19:41 | couven92 | very good! exactly what I want... I misunderstood Cap in newStringOfCap :P |
14:20:02 | def- | Yeah, it's just its current capacity, not the maximum capacity it can have |
14:21:13 | couven92 | def-, great! thanks! works like a charm! :) |
14:24:23 | couven92 | okay, Araq https://github.com/nim-lang/Nim/pull/6193 is ready for review :) |
14:26:07 | * | haha_ joined #nim |
14:40:55 | Araq | subsetpark: we could but wouldn't it be a bit weird? multiReplace is a different operation |
14:54:34 | * | endragor joined #nim |
14:59:05 | * | endragor quit (Ping timeout: 240 seconds) |
15:09:53 | * | Sentreen quit (Ping timeout: 248 seconds) |
15:11:17 | * | rauss joined #nim |
15:14:29 | * | javax joined #nim |
15:24:01 | * | Sentreen joined #nim |
15:34:13 | * | cspar joined #nim |
15:35:03 | FromGitter | <TiberiumN> how can I get input from the console on windows, and input is unicode? |
15:38:40 | * | mahmudov quit (Quit: Leaving) |
15:39:01 | * | mahmudov joined #nim |
15:39:41 | FromGitter | <TiberiumN> if I try to input 3 unicode characters in windows console (and I've ran chcp 65001 and console font is lucida console), repr of this input is just 00A7E030"\0\0\0" |
15:47:43 | * | dddddd quit (Ping timeout: 276 seconds) |
15:47:59 | Araq | TiberiumN: Good question |
15:49:16 | FromGitter | <TiberiumN> well it kinda works better now |
15:49:32 | FromGitter | <TiberiumN> I've used proc setConsoleOutputCP(codepage: cint): cint ⏎ ⏎ ```{.stdcall, dynlib: "kernel32", importc: "SetConsoleOutputCP".}``` [https://gitter.im/nim-lang/Nim?at=59873a8cc101bc4e3af2f229] |
15:49:33 | FromGitter | <ephja> hm, "libbearlibterminal.dll" :p |
15:51:04 | FromGitter | <TiberiumN> but nim does not do this by default |
15:59:44 | * | dddddd joined #nim |
16:05:23 | FromGitter | <TiberiumN> omg I can't figure out why I can't send string, which is being read from the console on windows |
16:05:26 | FromGitter | <TiberiumN> e.g. I can echo it |
16:05:43 | FromGitter | <TiberiumN> but when I try to send it - it results in incorrect characters sent to api |
16:07:09 | FromGitter | <TiberiumN> i have no clue... |
16:08:43 | * | Ven joined #nim |
16:09:06 | * | Ven is now known as Guest4921 |
16:11:45 | FromGitter | <TiberiumN> fucking windows |
16:16:10 | FromGitter | <ephja> doesn't powershell default to utf-8? |
16:16:40 | FromGitter | <TiberiumN> no |
16:17:16 | FromGitter | <ephja> silly |
16:17:43 | FromGitter | <TiberiumN> maybe it does have some unicode |
16:17:58 | FromGitter | <TiberiumN> but not enough |
16:18:21 | FromGitter | <ephja> 0-127? :p |
16:36:30 | * | Matthias247 joined #nim |
16:41:36 | FromGitter | <ephja> "libzip_all.o:libzip_all.c:(.text+0x6de8): undefined reference to `crc32'" |
16:41:53 | FromGitter | <ephja> maybe it works on unix where it does this: {.passl: "-lz".} |
16:42:04 | * | Guest4921 quit (Read error: Connection reset by peer) |
16:44:11 | FromGitter | <TiberiumN> yes |
16:51:34 | * | Trustable joined #nim |
16:54:40 | * | Ven_ joined #nim |
17:00:54 | * | Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
17:04:38 | * | smt_ quit (Read error: Connection reset by peer) |
17:14:22 | * | crem quit (Quit: leaving) |
17:14:37 | * | crem joined #nim |
17:15:31 | Araq | https://www.youtube.com/watch?v=o9pEzgHorH0 |
17:17:20 | couven92 | Araq, The multi-replace strutils is now all green: https://github.com/nim-lang/Nim/pull/6193 |
17:18:19 | * | haha_ quit (Quit: haha_) |
17:25:00 | * | haha_ joined #nim |
17:25:46 | FromGitter | <TiberiumN> Araq: wow, I saw that! someone from pypy irc linked this video too, cool talk |
17:30:25 | FromGitter | <TiberiumN> after I started using Nim I found that I don't need classes at all 0_0 |
17:30:31 | FromGitter | <TiberiumN> because I didn't use inheritance |
17:30:46 | FromGitter | <TiberiumN> well I did (because I needed with third-party libraries) |
17:31:09 | FromGitter | <TiberiumN> *integration with |
18:10:18 | subsetpark | Araq: I dunno... I feel like s.replace(sub, by) is just a n=1 case of s.replace((sub, by), (sub, by)...) |
18:11:22 | * | Vladar quit (Quit: Leaving) |
18:21:04 | * | haha_ quit (Quit: haha_) |
18:21:17 | FromGitter | <ephja> []= for cstrings -> segfault??? |
18:22:28 | * | BitPuffin|osx joined #nim |
18:22:36 | * | haha_ joined #nim |
18:27:25 | def- | @ephja if you go over its size or it's been deallocated already, yes |
18:33:37 | * | mahmudov quit (Quit: Leaving) |
18:33:57 | * | mahmudov joined #nim |
18:36:29 | * | Trustable quit (Remote host closed the connection) |
18:38:31 | * | Trustable joined #nim |
18:39:19 | FromGitter | <cyberlis> does nim have function to convert sha1 hash to biginteger? |
18:39:38 | * | Ven joined #nim |
18:40:01 | * | Ven is now known as Guest2480 |
18:46:00 | FromGitter | <TiberiumN> ehm? |
18:46:11 | FromGitter | <TiberiumN> why do you want big int for sha1? |
18:46:25 | FromGitter | <cyberlis> any int |
18:46:33 | FromGitter | <cyberlis> i want compare to sha1 hashes |
18:46:39 | FromGitter | <TiberiumN> well just compare them as strings? |
18:46:40 | FromGitter | <cyberlis> what is begger |
18:47:00 | FromGitter | <TiberiumN> what do you mean "bigger"? |
18:47:04 | FromGitter | <TiberiumN> you can't get file size from sha1 |
18:47:19 | FromGitter | <cyberlis> hashes a big numbers |
18:47:45 | FromGitter | <cyberlis> that is why you can compare them |
18:48:20 | FromGitter | <TiberiumN> well you can compare them as strings too |
18:49:04 | FromGitter | <cyberlis> you think it will give the same result? i will check it in python |
18:49:16 | FromGitter | <TiberiumN> why not? |
18:49:22 | * | Trustable quit (Remote host closed the connection) |
18:49:27 | FromGitter | <TiberiumN> if hashes are different as strings they'll different as numbers |
18:49:37 | FromGitter | <TiberiumN> well there's pure-nim bignums, but it's not very fast AFAIK |
18:49:41 | couven92 | @cyberlis, Uhm no! Hashes are binary blobs with no meaning at all, except that you can sequence compare to hashes. If they're not sequence equal the hash origin are different from each other |
18:50:20 | FromGitter | <TiberiumN> I don't really understand why do you need big numbers, but there is - https://github.com/def-/nim-bigints |
18:50:41 | FromGitter | <TiberiumN> but I think you don't need them |
18:50:42 | FromGitter | <TiberiumN> at all |
18:51:28 | FromGitter | <cyberlis> Wikipedia |
18:51:29 | FromGitter | <cyberlis> A SHA-1 hash value is typically rendered as a hexadecimal number, 40 digits long. |
18:51:33 | FromGitter | <cyberlis> number |
18:51:38 | FromGitter | <TiberiumN> well "typically" |
18:51:43 | FromGitter | <TiberiumN> it's just a matter of the preference |
18:51:49 | FromGitter | <cyberlis> hexadecimal number |
18:51:59 | FromGitter | <TiberiumN> you can have it as bytes |
18:52:09 | FromGitter | <cyberlis> one number can be bigger than other |
18:52:12 | FromGitter | <TiberiumN> can you explain what are you trying to achieve? |
18:52:14 | FromGitter | <cyberlis> is it true? |
18:52:22 | couven92 | @cyberlis No! Wrong, 40 hex digits to represent a 20-byte arre |
18:52:43 | couven92 | *array |
18:53:04 | FromGitter | <cyberlis> ok i see |
18:53:06 | FromGitter | <cyberlis> thanks |
18:57:22 | couven92 | @cyberlis, also, if you'd actually convert a SHA-hash to a value it would be enourmously large! Remember 64-bit values go up to ~18 trillion, A 20-byte numerical value would stretch over 160 bits! And with each bit you double the possible values... It's enomous! |
19:03:29 | * | Araq_ joined #nim |
19:04:24 | * | StarBrilliant1 joined #nim |
19:04:40 | * | Lord_Nightmare2 joined #nim |
19:07:54 | * | jivank[m] quit (*.net *.split) |
19:07:54 | * | TheManiac quit (*.net *.split) |
19:07:55 | * | Lord_Nightmare quit (*.net *.split) |
19:07:55 | * | Araq quit (*.net *.split) |
19:07:56 | * | surma quit (*.net *.split) |
19:07:57 | * | joshbaptiste quit (*.net *.split) |
19:07:57 | * | StarBrilliant quit (*.net *.split) |
19:07:58 | * | StarBrilliant1 is now known as StarBrilliant |
19:07:58 | * | Lord_Nightmare2 is now known as Lord_Nightmare |
19:10:58 | FromGitter | <TiberiumN> @vegansk or @yglukhov, are you here by any chance? just wanted to ask if it's possible to use nim on android via https://github.com/vegansk/jnim ? |
19:12:38 | * | yglukhov joined #nim |
19:13:19 | FromGitter | <TiberiumN> ah it seems it's possible |
19:13:21 | FromGitter | <TiberiumN> but no example apps :) |
19:15:48 | * | MrAxilus[m] quit (Ping timeout: 240 seconds) |
19:15:50 | * | mindB quit (Ping timeout: 240 seconds) |
19:16:11 | * | Demos[m] quit (Ping timeout: 258 seconds) |
19:16:31 | * | ehmry quit (Ping timeout: 240 seconds) |
19:16:39 | * | hohlerde quit (Ping timeout: 255 seconds) |
19:16:47 | * | dyce[m] quit (Ping timeout: 240 seconds) |
19:18:49 | * | surma joined #nim |
19:18:50 | * | joshbaptiste joined #nim |
19:23:11 | * | Guest2480 is now known as Ven`` |
19:30:01 | * | endragor joined #nim |
19:31:37 | * | vivus joined #nim |
19:34:43 | * | endragor quit (Ping timeout: 255 seconds) |
19:38:40 | * | yglukhov quit (Remote host closed the connection) |
19:41:21 | * | v17d quit (Ping timeout: 248 seconds) |
19:42:18 | * | haha_ quit (Quit: haha_) |
19:43:54 | * | haha_ joined #nim |
19:48:08 | * | smt joined #nim |
19:53:35 | * | salewski joined #nim |
19:54:15 | salewski | # how can we construct the name of a const identifier in a macro? |
19:54:21 | salewski | const CX = 7 |
19:54:27 | salewski | macro t(s: string): typed = |
19:54:33 | salewski | echo CX |
19:54:41 | salewski | #echo `C s` # should echo also value 7 when we compile |
19:54:50 | salewski | t("X") |
19:54:55 | * | v17d joined #nim |
19:54:57 | salewski | ? |
19:57:52 | salewski | What I really want to use in the macro is something like "var s = CX" |
19:58:14 | salewski | where CX is a string constant. |
19:59:45 | salewski | I thought that would be easy. But maybe it is easier putting that string constant in a hash table |
20:00:07 | salewski | and accessing that hash table from within the macro. |
20:01:18 | FromGitter | <singularperturbation> so you're passing in the name of the constant to the macro and then setting the var equal to that variable? |
20:01:46 | FromGitter | <singularperturbation> can you pass in the const as a value to the macro instead? and then do quasi-quoting on the expression that's passed in to the macro ? |
20:02:29 | FromGitter | <singularperturbation> only other thing I can think of is building a `newIdentNode` from the string passed in and playing around with that? |
20:03:34 | salewski | The user calls the macro like "connect("draw", myfunc, myarc)" |
20:04:27 | salewski | And in the macro I have to construct an const identifier like "draw_widget" |
20:04:38 | * | Matthias247 quit (Read error: Connection reset by peer) |
20:04:54 | salewski | "draw_widget" is a string constant which i need... |
20:06:03 | salewski | Well, maybe indeed not as easy as I thought. Will try a hash table... |
20:06:16 | FromGitter | <TiberiumN> why it isn't easy? |
20:06:23 | FromGitter | <TiberiumN> do something with this string and generate new const statement? |
20:07:42 | salewski | Yes, I tried that for some time now, no success. Can you provide an example? |
20:10:47 | * | mahmudov quit (Quit: Leaving) |
20:10:50 | FromGitter | <TiberiumN> something like this? https://play.nim-lang.org/?gist=c4c66ba0d261950f7f56a0990b429175 |
20:11:06 | FromGitter | <TiberiumN> well you can generate AST manually instead of using quote do |
20:11:08 | * | mahmudov joined #nim |
20:11:34 | FromGitter | <TiberiumN> proc `!`(s: string): NimIdent {..} ⏎ constructs an identifier from the string s |
20:13:13 | salewski | Maybe an optionn is indeed that users call the macro without quotes like connect(draw, myfunc, myarc) |
20:13:42 | salewski | Thanks TiberiumN, looks great, I will test it. |
20:13:57 | FromGitter | <TiberiumN> without quotes - I think this is possible |
20:14:01 | * | haha_ quit (Quit: haha_) |
20:15:08 | * | hohlerde joined #nim |
20:17:59 | FromGitter | <TiberiumN> well maybe this is a hacky solution |
20:18:14 | FromGitter | <TiberiumN> https://play.nim-lang.org/?gist=d9639f3fdc80e29776b0586700332323 |
20:20:26 | FromGitter | <TiberiumN> salewski: ^ |
20:28:44 | salewski | It is not really what I need :-) I want output 7 when I compile, but get CX: |
20:28:49 | salewski | import macros |
20:28:55 | salewski | const CX = 7 |
20:29:00 | salewski | macro t(s: string): untyped = |
20:29:06 | salewski | let data = "C" & s.strVal |
20:29:13 | salewski | let ident = !data |
20:29:17 | salewski | echo ident |
20:29:49 | salewski | t("X") |
20:31:26 | salewski | What I really want is to access an existing const identifier by constructing its name! |
20:31:47 | * | Lord_Nightmare quit (Ping timeout: 260 seconds) |
20:32:31 | salewski | I guess it is possible, but can not see it currently. Will try tomorrow, bye. |
20:35:37 | * | Ven`` quit (Read error: Connection reset by peer) |
20:43:48 | * | Lord_Nightmare joined #nim |
20:50:27 | * | Nobabs27 joined #nim |
20:52:30 | salewski | Well, table in combination with static works indeed :-) |
20:52:30 | salewski | mport macros, tables |
20:52:32 | salewski | static: |
20:52:39 | salewski | var tr: TableRef[string, int] |
20:52:45 | salewski | tr = newTable[string, int]() |
20:52:51 | salewski | const CX = 7 |
20:52:58 | salewski | tr.add("CX", CX) |
20:53:04 | salewski | #echo tr["CX"] |
20:53:12 | salewski | macro t(s: string): untyped = |
20:53:20 | salewski | var whatINeed = tr["C" & $s] |
20:53:27 | salewski | echo whatINeed |
20:54:17 | * | v17d quit (Ping timeout: 246 seconds) |
20:56:33 | salewski | t("X") |
20:57:39 | salewski | So output is 7 when compiling as desired! |
20:58:33 | * | def-pri-pub joined #nim |
21:02:25 | FromGitter | <TiberiumN> well i think it can be done without any tables |
21:03:00 | def-pri-pub | zacharycarter: I'm trying out zengine. For example 00, I assume I'm supposed to be able to move around? It's not really working for me. |
21:03:46 | def-pri-pub | Also, it's keeping my mouse within the screen, so I can get it out of the window borders. That means that I also can't exit. I have to Alt+F4 to quit. |
21:03:52 | def-pri-pub | (I'm on Linux BTW). |
21:12:44 | FromGitter | <zacharycarter> hrm |
21:13:13 | FromGitter | <zacharycarter> let me point you to some code |
21:14:24 | FromGitter | <zacharycarter> nevermind - let me just explain, left shift and left alt can be used to rotate the camera when held down together |
21:14:24 | FromGitter | <zacharycarter> mouse wheel zooms in and out |
21:14:39 | FromGitter | <zacharycarter> left shift by itself pans |
21:14:58 | FromGitter | <zacharycarter> the keeping your mouse within the screen can be easilyturned off |
21:15:20 | * | jivank[m] joined #nim |
21:16:10 | * | TheManiac joined #nim |
21:16:19 | def-pri-pub | My personal opntion, is that by default the mouse shouldn't be contained to the screen. |
21:16:27 | FromGitter | <zacharycarter> I agree |
21:17:01 | FromGitter | <zacharycarter> for now though please uncomment this line |
21:17:04 | FromGitter | <zacharycarter> errr |
21:17:05 | FromGitter | <zacharycarter> sorry |
21:17:19 | FromGitter | <zacharycarter> change this line from ⏎ ⏎ `````` [https://gitter.im/nim-lang/Nim?at=5987875f1c8697534a938892] |
21:17:30 | * | mindB joined #nim |
21:17:32 | FromGitter | <zacharycarter> ```code paste, see link``` |
21:17:35 | FromGitter | <zacharycarter> line 40 in core.nim |
21:18:51 | * | Demos[m] joined #nim |
21:18:51 | * | MrAxilus[m] joined #nim |
21:19:15 | * | ehmry joined #nim |
21:21:11 | * | dyce[m] joined #nim |
21:41:08 | FromGitter | <TiberiumN> termux is a great app, especially with oh-my-zsh :) |
21:41:11 | FromGitter | <TiberiumN> http://i.imgur.com/exz4Meg.png |
22:07:09 | * | Nobabs27 quit (Quit: Leaving) |
22:17:57 | * | enthus1ast- quit (Ping timeout: 260 seconds) |
22:24:45 | * | enthus1ast- joined #nim |
22:43:02 | * | Sentreen quit (Quit: WeeChat 1.6) |
22:43:30 | * | Sentreen joined #nim |
22:53:49 | * | dddddd quit (Quit: Hasta otra..) |
22:56:11 | * | onionhammer1 quit (Read error: No route to host) |
23:02:29 | * | cspar quit (Read error: Connection reset by peer) |
23:02:56 | * | cspar joined #nim |
23:03:21 | * | Ven joined #nim |
23:03:45 | * | Ven is now known as Guest47023 |
23:05:35 | * | m712 quit (Ping timeout: 240 seconds) |
23:08:28 | * | Guest47023 quit (Ping timeout: 260 seconds) |
23:09:14 | * | m712 joined #nim |
23:32:56 | * | salewski quit (Quit: WeeChat 1.4) |
23:42:44 | * | jinshil joined #nim |
23:56:44 | * | Jesin quit (Quit: Leaving) |