00:00:02 | * | junland quit (Quit: %ZNC Disconnected%) |
00:00:46 | * | junland joined #nim |
00:10:10 | * | solitudesf quit (Ping timeout: 268 seconds) |
00:54:33 | * | hnOsmium0001 quit (Read error: Connection reset by peer) |
00:56:05 | * | hnOsmium0001 joined #nim |
01:02:22 | * | lritter quit (Ping timeout: 260 seconds) |
01:34:33 | FromDiscord | <courtier> im trying to encrypt a string using nimcrypto with cbc, however the only output i can get from the encrypted output seems to be hex |
01:34:47 | FromDiscord | <courtier> can i somehow get a string output |
01:44:12 | FromDiscord | <ElegantBeef> @courtier they override the `$` operator, so i'm uncertain the cleanest way to get it, but one way is to cast it into a `ptr UncheckedArray[char]` and iterate over each char adding it to a string |
01:46:01 | FromDiscord | <courtier> o man ok |
01:46:02 | FromDiscord | <courtier> ill try |
01:53:42 | FromDiscord | <flywind> @Yardanico `Cx Planner` is already on the list. |
01:54:30 | FromDiscord | <flywind> So I will remove one of them. |
01:55:11 | FromDiscord | <flywind> https://media.discordapp.net/attachments/371759389889003532/772277526360752128/unknown.png |
01:58:22 | FromDiscord | <courtier> any normal and good aes256 library recommendations? |
02:01:38 | FromDiscord | <ElegantBeef> I dont know of anything crypto related, is there a reason you dont want to use nim crypto? |
02:11:06 | FromDiscord | <courtier> im new to nim, and it feels like theres an easier way to encrypt with cbc |
02:11:21 | FromDiscord | <courtier> i dont wanna bother with nimcryptos hex stuff |
02:13:24 | * | apahl quit (Ping timeout: 240 seconds) |
02:15:05 | FromDiscord | <Avatarfighter> What is the issue that you're facing with Nimcrypto? Maybe we can help you get comfortable with the syntax? |
02:15:47 | * | apahl joined #nim |
02:19:42 | FromDiscord | <courtier> https://github.com/cheatfate/nimcrypto/blob/master/examples/cbc.nim ive tried using the first example with openarray and the third one with strings, for the first one the only output i seem to be able to get is hex, and with the string one i dont even know its just `�=��7���g!�@4o/~�e�U�c�H��k` |
02:20:50 | FromDiscord | <Avatarfighter> Running the example file gives you those outputs? |
02:20:59 | FromDiscord | <courtier> yeh |
02:21:28 | FromDiscord | <Avatarfighter> Ok that makes sense, the jibberish you're seeing as an output is the raw bytes |
02:21:36 | FromDiscord | <Avatarfighter> if you decode the hex string you should get the same result |
02:21:41 | FromDiscord | <courtier> with the first openarray one the output i get is `E43DBECF37C4E3C56721C840346F32082F7E9065D31455A86305E49848C4E46B` which is wron |
02:21:44 | FromDiscord | <courtier> yea i think i do |
02:21:55 | FromDiscord | <courtier> yea `ä=¾Ï7ÄãÅg!È@4o2/~eÓU¨cäHÄäk` |
02:22:38 | FromDiscord | <Avatarfighter> The reason why running the first example gives you hex is because lines 60-63 <https://github.com/cheatfate/nimcrypto/blob/master/examples/cbc.nim#L60> take the output and convert it to hex |
02:22:50 | FromDiscord | <courtier> ye |
02:23:04 | FromDiscord | <Avatarfighter> What is the issue you're encountering specifically? |
02:23:41 | FromDiscord | <Avatarfighter> Just trying to understand why one gives hex and the other the raw byte? |
02:23:42 | FromDiscord | <Avatarfighter> (edit) "byte?" => "bytes?" |
02:24:49 | FromDiscord | <courtier> no if i convert the hex to ascii, i get a different output from what i do with same settings using working encryption |
02:25:16 | FromDiscord | <courtier> the encryption is not working properly |
02:25:26 | FromDiscord | <Avatarfighter> if you change lines 160-163 to output the strings as hex and compare is the output the smae? |
02:25:29 | FromDiscord | <Avatarfighter> (edit) "smae?" => "same?" |
02:26:05 | FromDiscord | <Avatarfighter> Replace the `$` with `toHex(VARIABLE_HERE)` |
02:26:16 | FromDiscord | <Avatarfighter> (edit) "Replace the `$` ... with" added "in front of the strings" |
02:26:17 | FromDiscord | <courtier> 1 sec |
02:27:27 | FromDiscord | <courtier> yea they are |
02:27:33 | FromDiscord | <courtier> hm |
02:27:35 | FromDiscord | <Avatarfighter> They are the same? |
02:27:58 | FromDiscord | <courtier> yep |
02:28:10 | FromDiscord | <Avatarfighter> It might be that the editor your using is removing characters that it doesn't support for whatever reason and that's why the ascii output differs? |
02:28:58 | FromDiscord | <courtier> it probably is the padding i just realized |
02:30:39 | FromDiscord | <courtier> > It might be that the editor your using is removing characters that it doesn't support for whatever reason and that's why the ascii output differs?↵its not about the characters its the fact that the same program written in java outputs different ting |
02:32:03 | FromDiscord | <ElegantBeef> Can you share your code here? |
02:32:03 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/ |
02:35:57 | FromDiscord | <courtier> ye give me a minute |
02:39:11 | * | oculuxe joined #nim |
02:39:18 | FromDiscord | <courtier> https://play.nim-lang.org/#ix=2CEo# |
02:40:14 | * | oculux quit (Ping timeout: 264 seconds) |
02:46:03 | FromDiscord | <ElegantBeef> What's the expected output? |
02:48:08 | jonjitsu[m] | When using testament, how do you import ./src/code.nim when your test is in ./tests/code.nim? |
02:48:41 | FromDiscord | <ElegantBeef> I'd do `../src/code` but uncertain what's expected |
02:49:01 | FromDiscord | <ElegantBeef> By expected i mean the normal |
02:51:45 | jonjitsu[m] | ok that works thanks |
02:52:32 | FromDiscord | <courtier> well ideally output would be a string value of `2GsmKUSQ5DIHNAd5VtpcGw==` |
02:54:27 | jonjitsu[m] | Any good tutorials out there on the async mechanism? |
02:56:50 | * | xace quit (Quit: leaving) |
02:57:06 | FromDiscord | <Avatarfighter> https://xmonader.github.io/nimdays/day04_asynclinkschecker.html From a quick skim this seems pretty good imo |
02:57:47 | FromDiscord | <ElegantBeef> I have no clue the issue with the crypto library, i do know it's used in production so i imagine it functions 😄 |
03:15:10 | blueberrypie | I don't suppose someone made a package for using youtube's API? (it's probably easy but i'm lazy) |
03:15:47 | * | muffindrake quit (Ping timeout: 268 seconds) |
03:17:04 | FromDiscord | <UNIcodeX> what would be Nim equivalent of `putchar`? |
03:17:42 | FromDiscord | <UNIcodeX> (edit) "what would be Nim equivalent of ... `putchar`?" added "C" |
03:17:55 | * | muffindrake joined #nim |
03:21:02 | FromDiscord | <ElegantBeef> `stdout.write` ? |
03:21:05 | FromDiscord | <iWonderAboutTuatara> now I understand why there isn't a good jpeg library |
03:21:25 | FromDiscord | <iWonderAboutTuatara> writing a jpeg encoder is a huge pain |
03:21:40 | FromDiscord | <iWonderAboutTuatara> for some reason, you walk across the image in a zigzag instead of regularly |
03:23:43 | FromDiscord | <ElegantBeef> Jpeg sucks 😄 |
03:23:49 | FromDiscord | <iWonderAboutTuatara> yeah wow |
03:23:56 | FromDiscord | <iWonderAboutTuatara> I don't want to touch this |
03:24:09 | FromDiscord | <UNIcodeX> that's what I was thinking but it didn't work out the way I needed. I had to cast to cchar to make it work. For context => https://zserge.com/posts/etude-in-c/ |
03:25:15 | FromDiscord | <ElegantBeef> You sure? https://media.discordapp.net/attachments/371759389889003532/772300190488854538/unknown.png |
03:25:28 | FromDiscord | <ElegantBeef> Or are you trying to output an int as a chr? |
03:26:02 | FromDiscord | <UNIcodeX> when piping output to `aplay` to test, I get static, vs what it should be for the current example, a sin wav. |
03:26:04 | FromDiscord | <UNIcodeX> (edit) "wav." => "wave." |
03:26:21 | FromDiscord | <UNIcodeX> (edit) "wave." => "wave (without casting to cchar)." |
03:27:02 | FromDiscord | <ElegantBeef> Can i see your code, just to save me a few seconds? |
03:28:14 | FromDiscord | <UNIcodeX> sent a code paste, see https://play.nim-lang.org/#ix=2CEx |
03:28:30 | * | xace joined #nim |
03:28:35 | FromDiscord | <UNIcodeX> build and pipe that to `aplay` |
03:29:05 | FromDiscord | <UNIcodeX> (edit) "https://play.nim-lang.org/#ix=2CEx" => "https://play.nim-lang.org/#ix=2CEy" |
03:29:47 | blueberrypie | iWonderAboutTuatara look at this for read https://github.com/nothings/stb/blob/master/stb_image.h and this for write https://github.com/nothings/stb/blob/master/stb_image_write.h |
03:30:04 | FromDiscord | <ElegantBeef> It's not noise here |
03:30:14 | FromDiscord | <ElegantBeef> Ah |
03:30:16 | FromDiscord | <ElegantBeef> Without casting |
03:30:19 | FromDiscord | <UNIcodeX> remove `cast[cchar]` |
03:30:20 | FromDiscord | <UNIcodeX> yes |
03:32:11 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=2CEz |
03:36:44 | FromDiscord | <ElegantBeef> You have to convert to a char at the very least due to the fact that the `write` proc will write int's value and not their bytes |
03:37:20 | FromDiscord | <ElegantBeef> Actually that's numb |
03:37:23 | FromDiscord | <ElegantBeef> (edit) "numb" => "dumb" |
03:39:14 | FromDiscord | <ElegantBeef> Aslong as it's converted to a byte i dont get why it outputs the same data |
03:40:18 | FromDiscord | <shashlick> @Phytolizer - cCompile() needs to be called before cImport() to take effect |
03:40:23 | FromDiscord | <shashlick> From the docs |
03:44:13 | FromDiscord | <Phytolizer> I'm going to feel dumb if that works |
03:45:15 | FromDiscord | <UNIcodeX> @ElegantBeef aye |
03:45:34 | FromDiscord | <ElegantBeef> So rude to quote that part :d |
03:45:47 | FromDiscord | <UNIcodeX> ? |
03:46:46 | FromDiscord | <UNIcodeX> I'm agreeing that it doesn't make sense. |
03:47:23 | FromDiscord | <ElegantBeef> It's where i'm calling myself dumb 😄 |
03:47:40 | FromDiscord | <UNIcodeX> oh... i misread then. |
03:47:41 | FromDiscord | <UNIcodeX> my bad |
03:48:06 | FromDiscord | <ElegantBeef> It actually looks like i'm right |
03:48:12 | FromDiscord | <ElegantBeef> !eval stdout.write(100) |
03:48:16 | NimBot | 100 |
03:48:42 | FromDiscord | <UNIcodeX> will it eval the char conversion? |
03:48:52 | FromDiscord | <ElegantBeef> !eval stdout.write(100.char) |
03:48:55 | NimBot | d |
03:49:01 | FromDiscord | <UNIcodeX> hah! |
03:49:27 | FromDiscord | <ElegantBeef> Seems it just calls `$(a: T)` |
03:49:47 | FromDiscord | <UNIcodeX> thanks for the help |
03:50:25 | FromDiscord | <ElegantBeef> No problem |
03:50:29 | FromDiscord | <ElegantBeef> Source of the problem 😄 https://github.com/nim-lang/Nim/blob/version-1-4/lib/system/io.nim#L479 |
03:50:39 | FromDiscord | <ElegantBeef> If you want the bytes of the value use streams |
03:54:06 | FromDiscord | <ElegantBeef> @UNIcodeX just for completion marks https://play.nim-lang.org/#ix=2CEF 😛 |
03:54:43 | FromDiscord | <ElegantBeef> Wait i'm not being graded? |
03:59:58 | Prestige | @ElegantBeef: B+ |
04:00:04 | FromDiscord | <ElegantBeef> Fuck |
04:00:15 | Prestige | (jk I just got here) |
04:00:18 | FromDiscord | <ElegantBeef> Guess i'll go jump into a train |
04:03:08 | FromDiscord | <UNIcodeX> The original C version has more amplitude. Not sure why. |
04:03:18 | FromDiscord | <UNIcodeX> sent a code paste, see https://play.nim-lang.org/#ix=2CEK |
04:03:29 | FromDiscord | <ElegantBeef> 127 |
04:04:22 | FromDiscord | <shashlick> @Phytolizer no worries - it's not intuitive but it's needed to generate standalone wrappers |
04:04:56 | FromDiscord | <UNIcodeX> hahahahah. so it was. d'oh! Never you mind Prestige, Beef, you're my new best friend. 🙂 |
04:05:18 | FromDiscord | <ElegantBeef> I dont get a say in it? |
04:05:25 | FromDiscord | <UNIcodeX> nnnnnope |
04:05:52 | Prestige | he just likes you for your meats |
04:05:59 | FromDiscord | <UNIcodeX> well... I mean... If you really don't want to be friends, I guess I'll be alright. |
04:06:02 | * | supakeen quit (Quit: WeeChat 2.9) |
04:06:14 | FromDiscord | <UNIcodeX> @Prestige haha |
04:06:20 | FromDiscord | <ElegantBeef> Lol i'm just joking, was a fun little problem to solve |
04:06:31 | FromDiscord | <UNIcodeX> oh I know. |
04:06:45 | * | supakeen joined #nim |
04:07:24 | FromDiscord | <UNIcodeX> I'm looking into making a library that will allow for sequential composition like the old nokia phones. For fun and... well... fun. |
04:07:49 | FromDiscord | <ElegantBeef> I have no clue what that means |
04:08:20 | FromDiscord | <UNIcodeX> https://zserge.com/posts/nokia/ |
04:08:31 | FromDiscord | <ElegantBeef> Ah |
04:30:46 | FromGitter | <offbeat-stuff> Hi I have my system's main coming in to my nim program, How do I make it secure |
04:30:58 | FromGitter | <offbeat-stuff> system's main password |
05:04:28 | FromDiscord | <nikki> does nimlsp work fine for people on windows? i'm guessing it's on the client end (trying some coc.nvim + gvim.exe shenanigans) but wondering if there were any issues people ran into with the server itself |
05:16:18 | * | vicfred joined #nim |
05:17:17 | FromDiscord | <Phytolizer> it very nearly worked @shashlick |
05:19:07 | FromDiscord | <Phytolizer> getting an undefined symbol error now, assuming that means i need to just edit the generated code manually now |
05:20:26 | FromDiscord | <Phytolizer> (edit) "undefined symbol" => "undeclared identifier" |
05:22:25 | FromDiscord | <Phytolizer> looks like it swapped the type and the name mistakenly. it's supposed to be defining a std::string called colorspace here https://media.discordapp.net/attachments/371759389889003532/772329673698967582/unknown.png |
05:26:26 | jonjitsu[m] | is there a way of dealing with the indent on a multiline string created with """? |
05:26:37 | Prestige | dedent? |
05:27:25 | FromDiscord | <shashlick> @Phytolizer what does it look like in C |
05:27:39 | FromDiscord | <shashlick> Open an issue if it is wrapped wrong |
05:27:54 | FromDiscord | <shashlick> But note that nimterop doesn't support c++ |
05:30:19 | jonjitsu[m] | I was thinking more like ruby/yamls multiline strings which ignore the leading indents. |
05:31:22 | Prestige | I mean, https://nim-lang.org/docs/strutils.html#dedent%2Cstring%2CNatural seems usable |
05:33:27 | FromDiscord | <Phytolizer> ah, it is c++. but it's ok, it was easy to swap the types out for seq[T] and map |
05:39:06 | FromDiscord | <Phytolizer> nevermind, it's more complicated than that. i found a c version of the tinyobjloader header though so it's good |
05:47:54 | FromDiscord | <Phytolizer> thanks for the help @shashlick |
07:15:28 | * | solitudesf joined #nim |
07:55:57 | * | natrys joined #nim |
08:00:03 | * | waleee-cl quit (Read error: Connection reset by peer) |
08:00:13 | * | waleee-cl joined #nim |
08:38:52 | * | rokups joined #nim |
08:54:33 | * | solitudesf quit (Read error: Connection reset by peer) |
08:57:51 | * | solitudesf joined #nim |
09:05:11 | FromDiscord | <tomck> Hello! Looking for a http server - i found asynchttpserver, but it mentions at the top it's not meant for production https://nim-lang.org/docs/asynchttpserver.html |
09:05:50 | FromDiscord | <tomck> i don't care about async, i just want an http server that'll run certain functions when certain routes are requested |
09:05:59 | FromGitter | <jrfondren> look through `nimble search http` |
09:06:29 | FromDiscord | <tomck> are there any known 'good & stable' ones? |
09:07:04 | FromDiscord | <flywind> It is ready for production if using `nginx` as reverse proxy。 |
09:07:08 | FromDiscord | <flywind> (edit) "proxy。" => "proxy." |
09:07:16 | FromDiscord | <tomck> yes, i don't want that |
09:07:32 | FromDiscord | <tomck> can't have something like nginx running |
09:08:33 | FromDiscord | <flywind> If using it for local, I think `asynchttpserver` is proper. |
09:09:35 | FromDiscord | <flywind> `asynchhtpserver` is the most stable HTTP server in Nim. |
09:10:06 | FromDiscord | <tomck> what's 'not production'a bout it? |
09:10:10 | FromDiscord | <tomck> is it insecure in some way? |
09:12:18 | FromDiscord | <flywind> Yes it can't resist attacks. |
09:14:29 | FromGitter | <jrfondren> slowaris, connection floods, badly behaved clients. the tires haven't been kicked, so they will be found to be flat. That's what I'd assume from that message anyway. Using it is akin to saying that you want to help finishing develop it. |
09:14:39 | FromDiscord | <Rika> slowaris? |
09:15:05 | FromGitter | <jrfondren> clients that maintain a connection, so they never time out, but they send data very slowly, like one byte per packet. |
09:15:57 | FromGitter | <jrfondren> it's a denial of service attack. The class of DOS attacks I'd be concerned about are those that cause the server to consume excessive resources, since a tiny microservice that competes for resources with the server it's running on is a pretty big no-no. |
09:17:32 | FromGitter | <jrfondren> anyway I haven't gotten around to Nim httpd servers so I can't recommend any. I'd start by looking at jester or sinatra |
09:17:57 | FromDiscord | <tomck> Cool, thanks |
09:18:15 | FromDiscord | <tomck> just looking for sommething to serve custom responses to application specific requests, not a full framework |
09:19:27 | FromGitter | <jrfondren> http://nitter.net/ is a pretty cool app that looks to be using jester. behind nginx though |
09:20:32 | FromDiscord | <tomck> i guess running behind nginx isn't too big of an issue |
09:20:52 | FromDiscord | <tomck> is there any way to include a file on the system into the binary at compiletime, as a const string? |
09:20:54 | * | neceve joined #nim |
09:21:10 | FromGitter | <jrfondren> `const contents = readFile("filename")` |
09:21:28 | FromGitter | <jrfondren> there's also staticRead, also called slurp |
09:21:30 | FromDiscord | <flywind> use `staticRead` |
09:21:44 | FromDiscord | <tomck> is readfile done at compile time, embedded into the binary|? |
09:21:57 | FromGitter | <jrfondren> the `const` tells you it has to happen at compile time |
09:23:53 | FromGitter | <jrfondren> that's also a good place to split the file by lines or other process it, and the result's what'll get put int he binary |
09:24:13 | FromDiscord | <Yardanico> @jrfondren it's open source under AGPLv3 |
09:24:17 | FromDiscord | <Yardanico> !repo nitter |
09:24:18 | disbot | https://github.com/zedeus/nitter -- 9nitter: 11Alternative Twitter front-end 15 1652⭐ 58🍴 |
09:24:22 | FromGitter | <jrfondren> is there a reason to staticRead over readFile in const context though? |
09:24:23 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
09:24:40 | FromDiscord | <Yardanico> readFile didn't always work in the vm iirc |
09:30:32 | FromDiscord | <tomck> hmmm, `invalid pragma: async`? |
09:30:38 | FromDiscord | <tomck> just running the asynchttpserver example |
09:31:05 | FromDiscord | <tomck> sent a code paste, see https://play.nim-lang.org/#ix=2CFJ |
09:32:10 | FromDiscord | <Rika> > clients that maintain a connection, so they never time out, but they send data very slowly, like one byte per packet.↵@jrfondren oh so you mean slow loris |
09:32:13 | FromDiscord | <tomck> Oh okay, interesting↵So it's because i had that code inside a template in another file - that file had asyncdispatch imported, but the calling file didn't |
09:32:24 | FromDiscord | <tomck> i guess pragmas don't work with the same template scoping rules (?) |
09:37:03 | FromDiscord | <Yardanico> I think it's already been reported |
09:37:19 | FromDiscord | <Yardanico> And I think it has to do with 1.4 change of making await a template |
09:37:59 | FromGitter | <jrfondren> like https://github.com/nim-lang/Nim/issues/15804 |
09:38:01 | disbot | ➥ Code that work in 1.2.6, but not 1.4.0 ; snippet at 12https://play.nim-lang.org/#ix=2CFM |
09:58:22 | FromDiscord | <windowsboy111> hello, is it normal to have weird uhh errors that are not found by the nim compiler but the C++ compiler? https://media.discordapp.net/attachments/371759389889003532/772399121075011594/unknown.png |
09:59:08 | FromDiscord | <windowsboy111> or can this be caused by libraries? I am using `wxnim` |
10:07:21 | FromGitter | <jrfondren> no, not normal. you might run into codegen errors with experimental features |
10:07:28 | FromGitter | <jrfondren> this though is yeah, the wxnim library |
10:08:53 | FromGitter | <jrfondren> {.cimport.} and such directives contribute to the code that Nim generates. say something exists when it doesn't, get a error at C++ time |
10:20:19 | FromDiscord | <windowsboy111> thx, also what does `immutable` means |
10:26:08 | FromDiscord | <Ryuzaku> hey, is there something similar to pythons namedtuple._replace in nim? I didnt find anything |
10:26:12 | FromGitter | <jrfondren> in what context? as an English word it means that you can't mutate the thing. It's not a keyword in Nim |
10:26:27 | FromGitter | <jrfondren> what's namedtuple._replace ? |
10:26:56 | FromDiscord | <Ryuzaku> its a function that returns a new instance where only the fields that are passed as named arguments to _replace are replaced |
10:27:03 | FromDiscord | <windowsboy111> so mutate is an english word 🤦♂️ okay |
10:27:27 | FromGitter | <jrfondren> I have no idea what that emoji means, but yes. |
10:28:06 | FromDiscord | <Ryuzaku> like this: >>> p = Point(x=11, y=22)↵> p._replace(x=33)↵> Point(x=33, y=22) |
10:28:08 | FromDiscord | <Rika> its a facepalm |
10:28:27 | FromDiscord | <Rika> you can just do `theTuple.x = 33` in nim |
10:28:31 | FromDiscord | <windowsboy111> @Ryuzaku so `_replace` is a method? |
10:28:42 | FromDiscord | <windowsboy111> to replace attributes? |
10:28:47 | FromDiscord | <Ryuzaku> yes, and i need a copy, instead of manipulating the instance |
10:28:53 | FromDiscord | <windowsboy111> and `Point` is a class. |
10:28:53 | FromDiscord | <windowsboy111> okay |
10:28:53 | leorize | see sugar.dup |
10:30:02 | FromDiscord | <windowsboy111> sent a code paste, see https://play.nim-lang.org/#ix=2CG0 |
10:30:40 | FromDiscord | <Rika> its `:` not `=` |
10:30:48 | FromDiscord | <windowsboy111> ah yes |
10:30:52 | FromDiscord | <Rika> inside Cls() |
10:31:03 | leorize | @Ryuzaku: https://play.nim-lang.org/#ix=2CG1 |
10:32:16 | FromDiscord | <windowsboy111> (edit) sent a code paste, see https://play.nim-lang.org/#ix=2CG3 |
10:32:17 | FromDiscord | <Ryuzaku> @leorize this is pretty cool. Thank you. |
10:32:28 | FromGitter | <jrfondren> and for a single updated field you can put the update on the same line |
10:33:22 | leorize | you can also run procedures that modify the value in-place |
10:33:28 | leorize | it's very flexible |
10:34:03 | FromGitter | <jrfondren> looks like it also breaks if Point has reference semantics |
10:34:12 | * | mmohammadi9812 quit (Ping timeout: 272 seconds) |
10:34:43 | FromDiscord | <Ryuzaku> in my case it doesnt. Thx 👍 |
10:35:01 | leorize | I can't imagine why anyone would use dup() on a ref :P |
10:35:36 | Zevv | if you want two refs! |
10:39:20 | FromGitter | <jrfondren> changing its `T` to `T: object`saves anyone from the confusion anyway. although the error isn't that nice |
10:40:00 | leorize | it can also be used on primitives and tuples so that designation wouldn't play out too well :p |
10:43:58 | * | mmohammadi9812 joined #nim |
10:47:27 | * | lritter joined #nim |
10:52:13 | FromDiscord | <mfiano> sent a long message, see http://ix.io/2CGb |
10:57:25 | Zevv | so, what happened? I haven't seen you around in the last few months? |
11:04:27 | FromDiscord | <Yardanico> if all goes well (if there is technical possibility for the building my flat is in), I might get a 250 or 500mbps connection at home for cheap |
11:04:41 | FromDiscord | <Yardanico> i currently have 100mbps as most people |
11:05:16 | Zevv | good thing the USA is asleep. in the good case you'd only get a few rotten tomatoes |
11:05:33 | FromDiscord | <Yardanico> lol |
11:05:34 | Zevv | america is really a 3d world country, internetwise |
11:05:51 | FromDiscord | <Yardanico> well russian internet is one of the cheapest in the world if you compare everything in $ |
11:06:01 | FromDiscord | <Yardanico> https://www.numbeo.com/cost-of-living/country_price_rankings?itemId=33 |
11:06:05 | FromDiscord | <Yardanico> https://www.mentalfloss.com/article/525011/monthly-internet-costs-every-country |
11:06:07 | Zevv | I'm still at 100mpbs because I'm too lazy to upgrade all my home network gear |
11:06:28 | FromDiscord | <Yardanico> well I don't have a lot of devices, only will need to buy a better router (to have 5GHz and 1gbit ports) |
11:06:38 | FromDiscord | <Yardanico> my current one is a really cheap 2.4GHz one |
11:07:01 | Zevv | yeah, but I got 4 AP's, three switches and a router |
11:07:15 | Zevv | not sure what'll happen if I egress at 1G. some stuff will be bottlencking |
11:07:24 | FromGitter | <jrfondren> RIP clear.com, the brief shining light of (slow, gaming-unworthy) cheap decent wireless. After they closed down I went to paying $250 for 50GB metered bandwidth a month, and living like a hobo who has to go to Starbucks to ~bathe~play games. |
11:07:49 | FromDiscord | <Yardanico> wow |
11:07:51 | FromGitter | <jrfondren> and I live in a large city. |
11:08:07 | FromDiscord | <Yardanico> these prices would be unimaginably high there (in rubles, compared to average salaries) :) |
11:08:44 | FromDiscord | <Yardanico> currently I pay 600 rubles (~$7.5) for unlimited mobile data (+500sms, 500minute calls) + 100mbps home connection |
11:09:12 | Zevv | that's nice |
11:09:18 | FromDiscord | <Yardanico> although I live only around 50km away from a big city (Kazan) |
11:09:33 | FromDiscord | <Yardanico> it has more than 1mil population |
11:09:43 | FromGitter | <jrfondren> the problems are A) the industry coordinated to set a price of $10 per GB per month, and B) they also woulndn't even let you pay for a substantial amount of mobile GB per month. The $250 one was a special deal. |
11:10:36 | FromGitter | <jrfondren> it's gotten a little bit better probably, but I also promptly moved to a place (still big city) with miserable mobile reception, so I'd be dead of internet deprivation by now if not for finally getting cable internet. |
11:11:43 | FromGitter | <jrfondren> ... which is still a lot worse than your current plan, price-wise. |
11:11:54 | FromDiscord | <Yardanico> well, russian prices are also much, much worse if you compare in $ :) |
11:11:59 | FromDiscord | <Yardanico> salaries |
11:12:12 | FromGitter | <jrfondren> ah I suppose |
11:12:15 | FromDiscord | <Yardanico> internet speeds on my mobile also range a lot, from 7mbps to 70bmps |
11:12:16 | FromDiscord | <Ryuzaku> sorry guys, I feel a little stupid, but i cant get it to work. Why doesn't this work? : https://play.nim-lang.org/#ix=2CGg |
11:14:55 | FromDiscord | <Rika> it's `dup(x, x = 100)` |
11:15:00 | FromGitter | <jrfondren> https://play.nim-lang.org/#ix=2CGi |
11:15:03 | FromDiscord | <Yardanico> nah |
11:15:03 | FromDiscord | <Rika> wait hm |
11:15:05 | FromDiscord | <Rika> misread |
11:15:18 | FromDiscord | <Rika> i misread smh |
11:15:20 | Zevv | I'm not even sure what yu're trying to do there |
11:15:24 | FromDiscord | <Yardanico> seems like = doesn't work the way you want |
11:15:27 | FromDiscord | <Yardanico> this works though: |
11:15:50 | FromDiscord | <Yardanico> or maybe not |
11:16:09 | FromGitter | <jrfondren> the macro rewrites assignment but not *=, and it doesn't make x available to the expression as a variable either. |
11:16:14 | FromDiscord | <Yardanico> yeah |
11:16:15 | FromDiscord | <Yardanico> https://play.nim-lang.org/#ix=2CGj |
11:16:19 | FromGitter | <jrfondren> it also seems to need a var context, you've got to assign the dup |
11:16:36 | FromDiscord | <Yardanico> jrfondren solution is good I think |
11:17:58 | FromDiscord | <Yardanico> but it kind of defeats the purpose |
11:18:07 | FromDiscord | <Yardanico> since you access a in b :) |
11:21:11 | FromDiscord | <Yardanico> @Ryuzaku there's another way I think |
11:21:19 | FromDiscord | <Ryuzaku> it works, and for me it also doesnt defeat the purpose. But if i try to use two asignments in one line it breaks, while in block notation it works. How does the oneliner work? https://play.nim-lang.org/#ix=2CGk |
11:21:28 | FromDiscord | <Ryuzaku> and whats the other way? |
11:21:52 | FromGitter | <ynfle> How do I get myself out of the `moderated` status on nim forum? |
11:22:07 | FromDiscord | <Yardanico> ask me or dom |
11:22:10 | FromDiscord | <Yardanico> whats your acc |
11:22:27 | FromDiscord | <Yardanico> ah I see |
11:22:32 | FromDiscord | <Yardanico> approved |
11:22:42 | FromGitter | <ynfle> Thanks 👍 |
11:23:04 | FromDiscord | <Yardanico> you replied to a 1 year old forum thread though ;) |
11:23:36 | FromGitter | <ynfle> I know. Is that not allowed/encouraged? |
11:23:51 | FromDiscord | <Yardanico> it's okay |
11:26:41 | * | qeisterfisch is now known as qwertfisch |
11:31:22 | FromGitter | <jrfondren> the other problem with what's wanted there is that *= isn't an expression :/ |
11:32:29 | FromGitter | <ynfle> @jrfondren, was that for me? |
11:33:01 | FromGitter | <jrfondren> no, Ryuzaku |
11:33:21 | FromGitter | <jrfondren> I'd do something more like this: https://play.nim-lang.org/#ix=2CGn |
11:33:22 | FromGitter | <ynfle> 👍 |
11:35:51 | FromDiscord | <Clyybber> @Ryuzaku IMO it should work |
11:36:02 | FromDiscord | <Ryuzaku> yeah, in this scenario it makes a lot of sense, but my actual point class has a couple more fields with meta information attached, and i didnt want to write all |
11:36:11 | FromDiscord | <Ryuzaku> (edit) "yeah, in this scenario it makes a lot of sense, but my actual point class has a couple more fields with meta information attached, and i didnt want to write ... allof" added "down" | "downall ... " added "of them" |
11:36:21 | FromDiscord | <Clyybber> In block notation I mean |
11:36:51 | FromDiscord | <Ryuzaku> it does work in block notation, I was just curious about the one-liner. Its a kinda unhealty obsession of mine, to produce the shortest possible ode |
11:36:54 | FromDiscord | <Ryuzaku> (edit) "ode" => "code" |
11:37:03 | FromGitter | <jrfondren> you only have to write the ones you'll ever change in the definition of initFoo; you only need to write exactly the ones you change when using initFoo |
11:37:05 | FromDiscord | <Ryuzaku> well, not shortest possible, but quite short ^^ |
11:37:27 | FromDiscord | <Ryuzaku> oh. i didnt know that |
11:37:32 | FromDiscord | <Yardanico> @jrfondren one tip - return is not needed here :) nim already allocates the result for you |
11:37:40 | FromDiscord | <Yardanico> so result = Foo(x: x, y: y) is better |
11:37:47 | FromDiscord | <Yardanico> kind of |
11:38:03 | FromDiscord | <Clyybber> @Ryuzaku I mean x = ... should work in block notation too |
11:38:18 | FromDiscord | <Ryuzaku> oh. Ok, ill try that. thx |
11:38:24 | FromDiscord | <Clyybber> No it doesn't :) |
11:38:31 | FromDiscord | <Clyybber> I meant it should |
11:38:33 | FromDiscord | <Clyybber> :D |
11:38:36 | FromDiscord | <Ryuzaku> 😄 |
11:39:22 | FromDiscord | <Ryuzaku> @jrfondren. Sorry I didnt read your example properly on the first go. I guess that is the optimal solution. Its a cool feature to be able to access parameter in the parameter defintion. Didnt know that was there |
11:39:36 | FromDiscord | <Yardanico> well it's not magic |
11:39:40 | FromDiscord | <Yardanico> it just rewrites some stuff |
11:39:45 | FromDiscord | <Yardanico> so you can access variables normally of course |
12:06:02 | * | supakeen quit (Quit: WeeChat 2.9) |
12:06:39 | * | supakeen joined #nim |
12:14:49 | * | NimBot joined #nim |
12:22:23 | FromDiscord | <Yardanico> @narimiran @dom96 any info about updating docs? |
12:22:26 | FromDiscord | <Yardanico> can you drop the cache or something? |
12:22:28 | FromDiscord | <Yardanico> they're still broken |
12:33:17 | Yardanico | !status |
12:33:18 | FromDiscord | Uptime - 1 week, 4 days, 16 hours, and 56 minutes |
13:11:39 | FromDiscord | <dom96> I dropped the cache |
13:15:31 | FromDiscord | <Yardanico> huh so is it not fixed in stable docs? weird |
13:15:33 | FromDiscord | <Yardanico> i thought it got backported? |
13:16:37 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/commit/6d99de7c2c43338a2561e51d5ea8c13108caa4cd |
13:16:50 | FromDiscord | <Yardanico> maybe not this |
13:21:44 | ForumUpdaterBot | New thread by Haydenjones: [Question] Enumerating fields in an enum, see https://forum.nim-lang.org/t/7022 |
14:02:14 | FromDiscord | <alehander42> oi |
14:06:49 | blackbeard420 | when using `nim c --os:FreeRTOS --cpu:esp` how do i tell it to use xtensa-esp32-elf-gcc instead of gcc |
14:09:04 | blackbeard420 | i tried just compiling to C then compiling the c source with xtensa-esp32-elf-gcc directly, but get a missng sys/mmap.h which is infact not available in the esp32 toolchain |
14:10:09 | * | avass quit (Remote host closed the connection) |
14:15:22 | * | a_chou joined #nim |
14:15:34 | FromDiscord | <Rika> --gcc.exe:xtensa-esp32-elf-gcc i think |
14:15:44 | FromDiscord | <Rika> or was it something else i forgot |
14:16:00 | FromDiscord | <Rika> ah, it's `--cc:...` |
14:16:46 | FromDiscord | <Yardanico> that's for specifying what C compiler you're using (the type) |
14:16:50 | FromDiscord | <Yardanico> cc = gcc is by default |
14:16:58 | FromDiscord | <Yardanico> you were right at first with gcc.exe and gcc.linkerexe |
14:17:11 | FromDiscord | <Rika> ah |
14:17:14 | FromDiscord | <Rika> i see |
14:43:07 | * | apahl quit (Ping timeout: 260 seconds) |
14:44:06 | * | Vladar joined #nim |
14:44:13 | * | apahl joined #nim |
14:48:45 | * | tane joined #nim |
14:50:07 | * | a_chou quit (Quit: a_chou) |
14:57:49 | * | Vladar quit (Remote host closed the connection) |
14:59:45 | FromDiscord | <flywind> `opcLdNull, # dest = nullvalue(types[Bx])` Is `opcLdNull` like initialize variable with default value? |
15:38:02 | * | rokups quit (Quit: Connection closed for inactivity) |
15:41:03 | FromDiscord | <lqdev> i'm wondering how y'all compiler devs put up with nimsuggest on a daily basis |
15:41:13 | FromDiscord | <lqdev> because it's been driving me crazy for the past few days |
15:41:29 | FromDiscord | <lqdev> i mean, more than a minute spent just to update syntax highlighting? |
15:42:13 | FromDiscord | <lqdev> and my shitty game is much tinier than the whole compiler |
15:42:18 | FromDiscord | <lqdev> like, how? |
15:42:45 | FromDiscord | <lqdev> compiling the game takes less time than it takes for nimsuggest to highlight my main file |
15:43:03 | FromDiscord | <alehander42> i don't think i use nimsuggest |
15:43:22 | FromDiscord | <alehander42> hm, but maybe i do |
15:43:28 | FromDiscord | <alehander42> does vscode extension use it |
15:43:39 | FromDiscord | <lqdev> think i'm gonna try extending lite with a nim syntax |
15:43:50 | FromDiscord | <lqdev> because the past few days have been absolute pain |
15:54:21 | FromDiscord | <levovix> is there a way to get a pointer to the first element of immutable seq? |
15:55:32 | Zevv | el[0].unsafeAddr |
15:58:27 | FromGitter | <jrfondren> el.toOpenArray(0, 0) |
15:58:54 | FromGitter | <jrfondren> for some purposes. I've been preferring to make stuff 'var' so that .addr will work |
15:59:13 | leorize | it depends on what you're doing most of the time |
15:59:16 | FromGitter | <jrfondren> what precisely is unsafe about .unsafeAddr? are there demonstrations of mistakes with it? |
15:59:34 | FromGitter | <jrfondren> where it's more unsafe than .addr |
15:59:36 | leorize | unsafeAddr is addr but can be used on immutable elements |
15:59:56 | leorize | basically so you don't accidentally mutate things when used for C FFI for example |
16:01:13 | FromGitter | <jrfondren> ah that's it, that it can violate immutability? I guess I should use it more often then. |
16:02:00 | FromGitter | <jrfondren> !eval let s = "hello"; s[1].unsafeAddr[] = 'x'; echo s |
16:02:04 | NimBot | hxllo |
16:02:21 | FromGitter | <jrfondren> I was thinking it was more about an address possibly not being available, so that you get a crash at runtime |
16:02:37 | FromGitter | <jrfondren> ... that's what the error message suggests after all. |
16:03:38 | FromDiscord | <levovix> thanks, it helped, I realized that I was trying to get var element from immutable seq instead ptr |
16:04:51 | leorize | jrfondren: we are certainly not the best when error messages are concerned |
16:06:26 | Zevv | usafeAddr is unsafe because it lets you get the address to something and alias it |
16:06:50 | Zevv | so your code says "immutable" but it is actually not |
16:07:51 | FromGitter | <jrfondren> addr also does that. they both return ptr. I've actually only ever wanted to use unsafeAddr for an immutable view, with no intention of violating immutability. |
16:09:26 | FromGitter | <jrfondren> it's a terrible name but one more to spirit would be preciousAddr :p "make sure you don't track of these. Don't just hand them to any odd proc." |
16:09:27 | leorize | experimental: views is probably better for that purpose |
16:10:41 | FromGitter | <jrfondren> oh I've looked at those: https://github.com/nim-lang/Nim/issues/15778 |
16:10:43 | disbot | ➥ Viewtype codegen error turns a single proc call into two ; snippet at 12https://play.nim-lang.org/#ix=2CHD |
16:11:22 | FromGitter | <jrfondren> and https://github.com/nim-lang/Nim/issues/15746 and https://github.com/nim-lang/Nim/issues/15657 |
16:11:24 | disbot | ➥ Codegen error with uninitialized tuple-of-view-types result ; snippet at 12https://play.nim-lang.org/#ix=2CHE |
16:11:32 | FromGitter | <jrfondren> they seem easy to use though. |
16:37:31 | * | natrys quit (Ping timeout: 246 seconds) |
16:38:07 | ForumUpdaterBot | New post on r/nim by Y01NKUS: What does assert and doAssert mean?, see https://www.reddit.com/r/nim/comments/jm57h1/what_does_assert_and_doassert_mean/ |
16:47:21 | FromDiscord | <enthus1ast> i've used the weekend to start hacking on a cross platform console music player (like moc / mpd) and i've got it in a somewhat usable shape (no network stuff yet).↵i've just tested on windows yet, if you wanna have a look 🙂 ↵https://github.com/enthus1ast/muk |
16:48:57 | FromDiscord | <enthus1ast> The main goal of this player to have a crossplatform "mocp" that also can upload and download music files with one click and withouth configuration, its not planned to have a ncmpcpp, not even near |
16:50:47 | FromDiscord | <enthus1ast> and since it uses mpv as its backend, you can also watch movies with it (when you press 'v' to show the mpv gui) |
16:50:55 | * | natrys joined #nim |
16:57:20 | * | mmohammadi9812 quit (Quit: Quit) |
16:59:37 | * | PMunch joined #nim |
17:02:05 | PMunch | Hi everyone, I'll be streaming again today, probably in about an hour. |
17:13:59 | * | azed joined #nim |
17:24:47 | Prestige | starting off November right :P |
17:29:48 | * | mmohammadi9812 joined #nim |
17:33:33 | PMunch | Haha, I guess you can say that |
17:42:45 | jonjitsu[m] | PMunch, What's the topic going to be? |
17:47:45 | PMunch | More notifishower development, some talk about X and x.org. |
17:48:17 | PMunch | Going to implement keyboard shortcuts, and add backgrounds to things |
17:48:23 | jonjitsu[m] | Given a type Foo = ref object with attribute data: array[16, uint8] a new(Foo) gets allocated on the heap along with the data attribute right? Is it safe to say it's similar to allocing a C struct ? |
17:48:29 | PMunch | Maybe fix up some of the TODOS we left last time |
17:48:55 | PMunch | jonjitsu[m], yes |
17:49:01 | PMunch | It's pretty much the exact same thing |
17:49:04 | jonjitsu[m] | PMunch, cool I was interested in creating a WM with nim |
17:49:16 | PMunch | Have you seen Nimdow? |
17:49:23 | jonjitsu[m] | There are no xcb bindings anywhere right? |
17:49:51 | PMunch | Nothing complete |
17:49:55 | * | Vladar joined #nim |
17:49:57 | PMunch | But there are xlib bindings |
17:50:03 | PMunch | And some support libraries |
17:50:03 | jonjitsu[m] | PMunch, yes but I don't know enough nim right now so I'm concentrating on learning the language first :) |
17:50:18 | PMunch | Nothing like learning with a project ;) |
17:50:36 | PMunch | https://peterme.net/tinywm-implementation-in-nim.html <- That might be interesting |
17:51:03 | jonjitsu[m] | I currently use stumpwm which is written in common lisp and would like a WM which I can configure in the language it's written in and even connect to it and hot plug things |
17:51:25 | Prestige | you could contribute to nimdow ;) lol |
17:51:29 | PMunch | That is the idea for my PiMo WM :) |
17:52:25 | jonjitsu[m] | Nice, actually I think what I want is something more like a window manager library/framework that you write a config for that together becomes the actual window manager |
17:52:39 | FromDiscord | <tomck> Hello! What're the options for watching a file for changes? I see `fsmonitor` is... 'dead'? https://nim-lang.org/0.13.0/fsmonitor.html |
17:52:48 | PMunch | Oooh, I kinda like that idea |
17:53:18 | jonjitsu[m] | Kinda like the way emacs is more of a framework/library for creating an editor/ide. Out of the box it sucks... |
17:54:24 | jonjitsu[m] | PMunch, What's the link for the stream? |
17:54:33 | PMunch | https://www.twitch.tv/pmunche |
17:54:36 | PMunch | Just went live |
17:54:48 | PMunch | And feel free to join the chat on IRC if you prefer that |
17:55:03 | FromGitter | <jrfondren> tomck, nimble search inotify pulls up libfswatch, which looks like a simple enough wrapper over that system |
17:55:18 | PMunch | (Although it is a slight hassle to set up authentication) |
17:56:00 | FromDiscord | <tomck> alright, cool ta |
18:00:08 | * | solitudesf quit (Read error: Connection reset by peer) |
18:00:41 | * | solitudesf joined #nim |
18:04:15 | * | hnOsmium0001 joined #nim |
18:08:25 | blackbeard420 | when compiling a simple hello world for esp32 with `nim c --os:FreeRTOS --cpu:esp --gcc.exe:xtensa-esp32-elf-gcc --app:staticlib esp.nim` i get the missing sys/mman.h for stdlib_system.nim.c. everything else compiles fine. is there a way to tell nim to not use sys/mman.h? |
18:18:44 | FromDiscord | <Yardanico> @blackbeard420 try to add -d:useMalloc |
18:19:05 | FromDiscord | <Yardanico> you also need --gcc.linkerexe:xtensa-esp32-elf-gcc I think |
18:19:22 | FromDiscord | <Yardanico> And of course --gc:arc |
18:20:38 | blackbeard420 | oh wow thanks. --gc:arc, -d:useMalloc and the additional gcc.linkerexe made it compile sucessfully. will verify it runs! thanks again |
18:27:58 | FromDiscord | <haxscramper> There will be a 2020 nim community survey, right? Is it possible to include questions like "how satisfied you are with compilation errors messages?" and "what would you improve in compilation errors?" |
18:33:28 | FromDiscord | <Yardanico> Well, you'll need to remind narimiran about that |
18:33:36 | FromDiscord | <Yardanico> But really I think the questions will be discussed |
18:35:00 | FromDiscord | <tinygiant> sent a code paste, see https://play.nim-lang.org/#ix=2CIi |
18:35:02 | FromDiscord | <tinygiant> sent a long message, see http://ix.io/2CIj |
18:36:14 | FromDiscord | <haxscramper> @Yardanico When (approximately) survey will be launched? Late December, like in 2019? |
18:36:31 | FromDiscord | <Yardanico> honestly I don't know that |
18:36:38 | FromDiscord | <Yardanico> Ask dom or miran :) |
18:39:35 | * | krux02 joined #nim |
18:41:39 | FromDiscord | <haxscramper> @tinygiant Since you will be dealing with json in-memory (e.g. read all, modify etc) you might want to look on https://github.com/Araq/packedjson - it's main concern is more efficient represenation. I haven't used it though. |
18:43:28 | FromDiscord | <juan_carlos> packedjson is good. |
18:43:31 | FromDiscord | <haxscramper> About general algorithm etc. - this looks like mostly heuristics problem to me (like keeping list of all nodes of interest/keys etc). Since json is unordered you might want to make two passes over dom - first to search for necessary patterns and replace everything in second. |
18:44:16 | FromDiscord | <haxscramper> Or maybe there is a more efficient way to do this, I have always been bad at algorithms |
18:45:32 | FromDiscord | <tinygiant> If the file is read in as a string, is there a quick way to throw it away if it doesn't meet criteria (i.e. if the string "THIS_VALUE" is not in the file anywhere, skip)? Or maybe even count the occurrences of "THIS_VALUE" so if I do have to iterate, I know when to quit? |
18:45:47 | FromDiscord | <tinygiant> @haxscramper Thanks for the pointer, I'll check out packedJson this afternoon. |
18:47:02 | FromDiscord | <haxscramper> Well, if `THIS_VALUE` is a string you might just want to do a string search, and then try to do some involved checking for opening/closed braces around it if you don't want to read whole file |
18:47:06 | FromDiscord | <nimi30> I- |
18:47:34 | FromDiscord | <nimi30> don't feel belong here but I joined cuz nim is a nickname my friends give me |
18:47:48 | FromDiscord | <nimi30> aight imma head out |
18:48:10 | * | abm joined #nim |
18:49:02 | FromDiscord | <tinygiant> @haxscramper Thanks for that idea, I'll keep that in mind for the design. The replacement data will also be given in json format, so I figured using functions that dealt with JsonNodes would be easiest, but that's not necessarily the case. |
18:50:10 | FromDiscord | <haxscramper> Well string find/replace might be the fastest, but also the dirties/more involved approach. I would probably just use `std/json` and only optimized if performance wasn't good enough |
18:50:33 | FromDiscord | <haxscramper> Make it work, make it have good UX< make it fast |
18:50:36 | FromDiscord | <haxscramper> Something like that |
18:50:45 | FromDiscord | <haxscramper> (edit) "UX<" => "UX," |
18:50:50 | * | azed quit (Quit: WeeChat 2.9) |
18:51:08 | FromDiscord | <tinygiant> That sounds about right. Grimy --> Dirty --> Soiled --> Wearable --> Usable. |
18:51:50 | * | azed joined #nim |
18:56:04 | * | azed quit (Client Quit) |
19:16:42 | * | neceve quit (Ping timeout: 272 seconds) |
19:32:27 | FromDiscord | <courtier> im curious what does the end keyword do? |
19:35:38 | solitudesf | in normal nim - nothing |
19:35:43 | solitudesf | its used in source code filters |
19:35:54 | solitudesf | https://nim-lang.github.io/Nim/filters.html |
19:38:58 | FromDiscord | <courtier> hm thanks |
19:47:24 | * | mmohammadi9812 quit (Read error: Connection reset by peer) |
19:47:34 | * | mmohammadi9812 joined #nim |
20:13:24 | * | Vladar quit (Quit: Leaving) |
20:40:05 | FromDiscord | <courtier> sent a code paste, see https://play.nim-lang.org/#ix=2CIW |
20:40:12 | FromDiscord | <courtier> leads to `Error: unhandled exception: index out of bounds, the container is empty [IndexError]` |
20:50:07 | jonjitsu[m] | What's the easiest way to read an entire file as a uint8 block of data? |
20:51:24 | jonjitsu[m] | cast[seq[uint8]](File.readAll()) ? |
20:51:58 | jonjitsu[m] | * `cast[seq[uint8]](File.readAll())` ? |
20:54:43 | * | xet7 quit (Quit: Leaving) |
20:58:51 | * | xet7 joined #nim |
21:00:13 | FromDiscord | <ElegantBeef> The otherway would be to use streams |
21:09:41 | PMunch | Oof, my throat is soo dry after talking none-stop for three hours :S |
21:09:49 | PMunch | non* |
21:13:27 | * | lritter quit (Quit: Leaving) |
21:17:27 | FromDiscord | <alehander42> 😄 |
21:21:20 | PMunch | I need to remind myself to bring a glass of water for next time :P |
21:27:28 | FromDiscord | <ElegantBeef> Or bring a replacement throat |
21:28:50 | * | Jesin quit (Quit: Leaving) |
21:34:26 | PMunch | I think doing a throat replacement surgery on myself during a stream might be a bit extreme .P |
21:34:47 | FromDiscord | <ElegantBeef> So for my scripted game idea each ship update takes around 1/10000th of a second which means with 1000 ships the frametime gets to 1/10th of a second, what's the smartest way to manage this, i could probably thread the interpreter calls, but then it'll be 100ms + a frame offset 😄 |
21:37:08 | PMunch | What do you mean? |
21:37:45 | FromDiscord | <ElegantBeef> Each update call per each ship takes roughly 1/10000th of a second which with many ships it causes a large framedelay |
21:37:53 | jonjitsu[m] | nim compiler is complaining of side effects for this function https://pastebin.com/KzsGat9j what side effects is it refering to and how is it deciding that? |
21:38:56 | FromDiscord | <ElegantBeef> I need to find a way to not freeze the main thread, but also not have super delayed inputs from the scripts |
21:40:11 | FromDiscord | <ElegantBeef> ~100ms delay isnt too bad i suppose, since it's still under human response time |
21:40:11 | disbot | no footnotes for `100ms`. 🙁 |
21:40:17 | FromDiscord | <ElegantBeef> lol |
21:41:31 | PMunch | Aah I see |
21:41:47 | PMunch | And is it paramount that every ship get an update every tick? |
21:42:02 | PMunch | Or could you do them round robin style and defer some to the next tick? |
21:42:04 | FromDiscord | <ElegantBeef> Well the ships are controlled by scripts so those are equivlent to the player giving inputs |
21:42:11 | FromDiscord | <ElegantBeef> Yea that's one other alternative i was thinking |
21:42:24 | FromDiscord | <ElegantBeef> Could do batches of X amount every frame on a second thread |
21:43:04 | FromDiscord | <ElegantBeef> That way the framerate stays at 60fps on a lot of hardware |
21:43:21 | FromDiscord | <ElegantBeef> A few frame delay is completely fine since it'd still be faster than a human |
21:44:10 | FromDiscord | <ElegantBeef> On the lowend human response time is like what 200ms, so even if it's 10 frames delayed it's still at 160ms |
21:45:42 | PMunch | Yeah delaying their tick by one probably isn't a big issue |
21:45:52 | PMunch | Not sure how multithreading the NimScript interpreter works |
21:45:56 | PMunch | Might be a bit icky :P |
21:46:08 | FromDiscord | <ElegantBeef> yea that was what i was wondering aswelll |
21:46:14 | * | Jesin joined #nim |
21:46:15 | FromDiscord | <ElegantBeef> It could be a breeze(probably wont be) |
21:46:27 | FromDiscord | <ElegantBeef> IIRC remember there is a global ctx variable |
21:46:46 | FromDiscord | <ElegantBeef> So yea just a user defined `updates per tick` |
21:47:55 | FromDiscord | <ElegantBeef> This is under the category of "premature optimization" but dont tell anyone 😄 |
21:48:16 | PMunch | Haha :P |
21:48:31 | PMunch | I mean it is good to at least think about this stuff in advance |
21:53:42 | FromDiscord | <ElegantBeef> I still want to make a video for nimscripter but dont like any of what i tried so far 😄 |
22:00:38 | * | fredrikhr quit (Read error: Connection reset by peer) |
22:06:04 | PMunch | Haha, what did you try? |
22:06:59 | FromDiscord | <ElegantBeef> Making some quick and dirty explanations |
22:14:10 | FromDiscord | <Avatarfighter> What is good everyone 😄 |
22:15:01 | FromDiscord | <ElegantBeef> Hello |
22:15:12 | FromDiscord | <ElegantBeef> So it seems cputime doesnt work from the intepreter |
22:15:19 | FromDiscord | <Avatarfighter> rip |
22:15:20 | FromDiscord | <ElegantBeef> (edit) "intepreter" => "interpreter" |
22:15:29 | FromDiscord | <ElegantBeef> not a big issue |
22:15:34 | FromDiscord | <ElegantBeef> i can just use nimscripter 😛 |
22:15:44 | FromDiscord | <Avatarfighter> ahaha |
22:15:50 | FromDiscord | <Avatarfighter> Love that |
22:15:51 | PMunch | Why not use epochTime? |
22:16:04 | FromDiscord | <Avatarfighter> I'm currently taking a math test and i am waiting for me to fail |
22:16:05 | FromDiscord | <ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/772584776694628362/unknown.png |
22:16:17 | FromDiscord | <Avatarfighter> PMunch |
22:16:19 | PMunch | A math test, and you're online? |
22:16:21 | FromDiscord | <Avatarfighter> Are you still streaming?\ |
22:16:25 | FromDiscord | <Avatarfighter> yeah |
22:16:33 | PMunch | Nah, stopped about an hour ago |
22:16:36 | FromDiscord | <Avatarfighter> rip |
22:16:54 | PMunch | @ElegantBeef |
22:16:55 | FromDiscord | <Avatarfighter> I have 1 hour 40 minutes to do this test so I am working on other stuff till i panic and need to finish the test |
22:16:58 | PMunch | Oops |
22:17:02 | FromDiscord | <ElegantBeef> Lol |
22:17:08 | FromDiscord | <ElegantBeef> You made my discord badup for nothing |
22:17:27 | PMunch | Depends on what you need, but cpuTime will not count up if the OS sleeps your process for example |
22:17:47 | PMunch | It is only really useful if you actually want to know how much time the CPU has actually spent running an algorithm |
22:17:54 | FromDiscord | <ElegantBeef> yea which isnt an issue atm |
22:18:08 | FromDiscord | <ElegantBeef> The issue is that my quick template for benchmarking uses cpu time and that doesnt work on the vm |
22:18:09 | PMunch | @Avatarfighter, sounds familiar :P |
22:18:36 | FromDiscord | <Avatarfighter> lmao |
22:18:48 | FromDiscord | <Avatarfighter> honestly its not even that bad |
22:18:55 | FromDiscord | <Avatarfighter> I did the test in 10 minutes earlier and got 60% |
22:18:58 | FromDiscord | <Avatarfighter> soooo |
22:19:03 | FromDiscord | <Avatarfighter> im going a tad bit slower this time |
22:20:09 | FromDiscord | <ElegantBeef> The worst part about taking 1/10000th of a second is the update is very very non complex https://play.nim-lang.org/#ix=2CJu |
22:20:25 | FromDiscord | <Avatarfighter> https://media.discordapp.net/attachments/371759389889003532/772585865125560351/unknown.png |
22:20:26 | FromDiscord | <Avatarfighter> im crying |
22:21:15 | FromDiscord | <Avatarfighter> that's it im working on shit |
22:21:24 | PMunch | Huh? |
22:21:38 | FromDiscord | <Avatarfighter> shit is my next gen shitty git alternative |
22:21:54 | FromDiscord | <ElegantBeef> I thought SVN already existed |
22:22:09 | PMunch | Ah :P |
22:22:10 | FromDiscord | <ElegantBeef> Isnt it short for Shit VersioN control? |
22:22:10 | FromDiscord | <Avatarfighter> dude I learned there is a version control called CVS |
22:24:07 | FromDiscord | <Avatarfighter> PMunch: What interesting things have you been working on recently? |
22:24:33 | supakeen | Hah, my first job we used CVS still :) |
22:24:46 | PMunch | Recently I've been working mostly on notifishower and notificatcher (which is also what I have been streaming) |
22:24:51 | supakeen | (it was already old and 'superceded' by SVN at that point) |
22:25:17 | FromDiscord | <ElegantBeef> If you want avatar i can always stream me fighting the performance issues |
22:25:27 | FromDiscord | <Avatarfighter> PMunch: is it safe to assume that they are related to notifications 😛 |
22:25:31 | FromDiscord | <Avatarfighter> Honestly I might stream |
22:25:35 | PMunch | Haha, yes |
22:25:56 | PMunch | Notificatcher catches notifications from the freedesktop dbus interface |
22:25:58 | FromDiscord | <Avatarfighter> Do you have repos for all your code that I can take a peak at? |
22:26:01 | FromDiscord | <Avatarfighter> ah |
22:26:13 | PMunch | And Notifishower can show highly customisable notifications |
22:26:15 | FromDiscord | <Avatarfighter> supakeen: Yeah I assumed CVS was old but not that old lmaooo |
22:26:32 | FromDiscord | <Avatarfighter> How customizable we talking 😛 CSS3/HTML5 🤔 |
22:26:48 | PMunch | I send customiseable, not horrible |
22:27:01 | PMunch | https://github.com/PMunch/notifishower |
22:27:27 | FromDiscord | <Avatarfighter> PMunch: but you could be using cool css3 animations |
22:27:31 | PMunch | I mean you have a visual format language to determine the layout: (-[~icon:32~]-[~title body~]-) |
22:27:36 | FromDiscord | <Avatarfighter> all I'm saying is your living in the past without CSS-shake |
22:27:46 | FromDiscord | <Idefau> no not css no please no not |
22:27:59 | PMunch | And then you can add icons, text, and ninepatches around |
22:28:07 | PMunch | The whole thing can also be ninepatches |
22:28:28 | PMunch | Of course any TTF font you want |
22:28:36 | PMunch | And any colour (including transparent) |
22:28:38 | FromDiscord | <Avatarfighter> I found the coolest lib in nim the other day but its on my other other laptop and idk where that is so now I can't show you all |
22:28:53 | PMunch | What did it do? |
22:29:03 | FromDiscord | <Avatarfighter> html/css/js |
22:29:20 | FromDiscord | <Avatarfighter> https://github.com/juancarlospaco/webgui/ |
22:29:21 | FromDiscord | <Avatarfighter> found it |
22:29:27 | PMunch | And you can click on anything and attach ninepatch backgrounds and hover graphics to any element |
22:29:37 | PMunch | So pretty customisable |
22:29:48 | FromDiscord | <Avatarfighter> Yeah that sounds really customizable lol |
22:30:25 | FromDiscord | <Avatarfighter> im so sad |
22:30:31 | FromDiscord | <Avatarfighter> i think i allocated too much ram to my vm |
22:30:34 | FromDiscord | <Avatarfighter> vps |
22:31:06 | PMunch | Too much? |
22:31:13 | FromDiscord | <Avatarfighter> yeah i think so |
22:31:39 | FromDiscord | <Avatarfighter> I wanted to see what happens when I allocate all the resources I have available and 700+ vCPUs and 2TB ram later my VPS isn't booting at all |
22:32:32 | PMunch | Huh, that is pretty cool |
22:32:48 | PMunch | Haha, that is a bit rough |
22:32:50 | FromDiscord | <Avatarfighter> I mean tbh I was hoping that it would boot so I can take an ss of htop |
22:33:16 | * | solitudesf quit (Ping timeout: 258 seconds) |
22:33:23 | FromDiscord | <Avatarfighter> I was having network issues where my ips got reallocated to other servers so maybe that's why its not booting but I'm unsure |
22:37:45 | PMunch | Hmm, so this is probably why CEF keeps crashes on me :P mmap(NULL, 281239806898176, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory) |
22:38:00 | FromDiscord | <Avatarfighter> hm |
22:38:11 | FromDiscord | <Avatarfighter> I've never used mmap is it easy to use? |
22:38:13 | PMunch | Those are a looot of bytes to try and allocate :P |
22:38:22 | PMunch | Oh this is output from strace |
22:38:28 | FromDiscord | <Avatarfighter> ah |
22:38:31 | PMunch | mmap is basically what malloc does in the background |
22:38:40 | FromDiscord | <Avatarfighter> yeah that makes sense |
22:39:06 | PMunch | I'm pretty sure that tries to malloc from some unassigned field that just has garbage in it |
22:40:15 | PMunch | Might be a derp on some string value |
22:40:39 | FromDiscord | <Avatarfighter> I'm really interested to know what causes that if you manage to track down the issue |
22:43:16 | PMunch | Are any of you on Windows? |
22:43:28 | FromDiscord | <ElegantBeef> I have a partition but i never usue it |
22:43:37 | FromDiscord | <ElegantBeef> Outside of playing games i should say |
22:44:13 | FromDiscord | <Avatarfighter> I am on windows rn |
22:44:17 | FromDiscord | <Avatarfighter> and mac and linux if you need |
22:44:18 | FromDiscord | <ElegantBeef> Doing 100 ship batches per frame seems to work ok https://streamable.com/aipyfv |
22:44:39 | FromDiscord | <ElegantBeef> I can easily move up to like ~170 on my cpu and still be under the frame limit |
22:45:21 | PMunch | I just kinda want to know if you can get the sample thing here working: https://github.com/jangko/nimCEF |
22:45:32 | PMunch | But I think it might be a massive PITA to set up on Windows |
22:45:45 | FromDiscord | <ElegantBeef> As are most things 😛 |
22:46:07 | PMunch | Exactly :P |
22:46:14 | PMunch | On Linux it was pretty easy :P |
22:46:22 | FromDiscord | <Avatarfighter> honestly windows is such a mess |
22:46:32 | * | tane quit (Quit: Leaving) |
22:46:33 | FromDiscord | <Avatarfighter> I swear there are literally 4 official gui libraries for it |
22:46:37 | PMunch | Hmm, they do seem to have a bit of jitter though ElegantBeef, is that caused by the batching, or something else? |
22:47:08 | FromDiscord | <ElegantBeef> Might be approaching the frame time causing the jitter, or you're just seeing sprite rotation artifacts |
22:47:41 | FromDiscord | <ElegantBeef> Actually nah that's too jittery for either of those |
22:49:15 | PMunch | Seems like I might be right: 0x00007ffff351cef3 in cef_string_utf16_set () at ./libcef.so |
22:51:27 | FromDiscord | <Avatarfighter> Dang I think I am officially on the side of chronos async instead of stdlib async |
22:52:00 | FromDiscord | <ElegantBeef> Arent most people on that side? 😄 |
22:52:06 | FromDiscord | <ElegantBeef> Or am i thinking of weave |
22:52:11 | FromDiscord | <Avatarfighter> dude |
22:52:12 | FromDiscord | <Avatarfighter> weave |
22:52:15 | FromDiscord | <Avatarfighter> im in love |
22:52:48 | PMunch | Fuck me.. I'm looking at the CEF source and it's just layer upon layer of intdirection.. |
22:52:52 | PMunch | indirection* |
22:53:28 | FromDiscord | <Avatarfighter> why are you trying to embed chromium l? |
22:53:29 | FromDiscord | <Avatarfighter> (edit) "l?" => "?" |
22:53:50 | FromDiscord | <ElegantBeef> Cause embedding firefox causes burning when you pee |
22:54:07 | * | natrys quit (Ping timeout: 246 seconds) |
22:54:18 | FromDiscord | <Avatarfighter> hm |
22:54:25 | FromDiscord | <Avatarfighter> Although I laughed |
22:54:38 | FromDiscord | <Avatarfighter> I must say that I enjoy the lack of resource usage of firefox |
22:55:27 | PMunch | Well, the end goal is writing my own browser |
22:55:34 | PMunch | Without having to deal with any of the web stuff |
22:55:46 | FromDiscord | <ElegantBeef> Doesnt sound like Pimo 😄 |
22:55:59 | PMunch | I know :P |
22:56:08 | FromDiscord | <Avatarfighter> why not use the webgui library I sent above somewhere |
22:56:11 | FromDiscord | <Avatarfighter> it looks embeddable |
22:56:14 | PMunch | It started as a curiosity last week |
22:56:14 | FromDiscord | <Avatarfighter> i hope |
22:56:23 | PMunch | Like "how difficult would it actually be" |
22:56:35 | PMunch | And it really annoyed me that I couldn't get NimCEF to work |
22:56:45 | PMunch | And I'm not 100% sure if it is Nim or CEF being broken |
23:06:31 | FromDiscord | <Avatarfighter> i lied about chronos my heart is broken because i can't tell if httpclient works with it and i don't think so |
23:08:56 | PMunch | Eh, if someone is bored: http://ix.io/2CJM |
23:09:04 | PMunch | I'm off to bed |
23:09:12 | FromDiscord | <Avatarfighter> gn! |
23:09:23 | * | PMunch quit (Quit: leaving) |
23:35:45 | * | unihernandez22 joined #nim |
23:36:52 | * | krux02 quit (Remote host closed the connection) |
23:44:01 | * | unihernandez22 quit (Quit: Leaving) |