<< 01-11-2020 >>

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:33FromDiscord<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:47FromDiscord<courtier> can i somehow get a string output
01:44:12FromDiscord<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:01FromDiscord<courtier> o man ok
01:46:02FromDiscord<courtier> ill try
01:53:42FromDiscord<flywind> @Yardanico `Cx Planner` is already on the list.
01:54:30FromDiscord<flywind> So I will remove one of them.
01:55:11FromDiscord<flywind> https://media.discordapp.net/attachments/371759389889003532/772277526360752128/unknown.png
01:58:22FromDiscord<courtier> any normal and good aes256 library recommendations?
02:01:38FromDiscord<ElegantBeef> I dont know of anything crypto related, is there a reason you dont want to use nim crypto?
02:11:06FromDiscord<courtier> im new to nim, and it feels like theres an easier way to encrypt with cbc
02:11:21FromDiscord<courtier> i dont wanna bother with nimcryptos hex stuff
02:13:24*apahl quit (Ping timeout: 240 seconds)
02:15:05FromDiscord<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:42FromDiscord<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:50FromDiscord<Avatarfighter> Running the example file gives you those outputs?
02:20:59FromDiscord<courtier> yeh
02:21:28FromDiscord<Avatarfighter> Ok that makes sense, the jibberish you're seeing as an output is the raw bytes
02:21:36FromDiscord<Avatarfighter> if you decode the hex string you should get the same result
02:21:41FromDiscord<courtier> with the first openarray one the output i get is `E43DBECF37C4E3C56721C840346F32082F7E9065D31455A86305E49848C4E46B` which is wron
02:21:44FromDiscord<courtier> yea i think i do
02:21:55FromDiscord<courtier> yea `ä=¾Ï7ÄãÅg!È@4o2/~eÓU¨cä˜HÄäk`
02:22:38FromDiscord<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:50FromDiscord<courtier> ye
02:23:04FromDiscord<Avatarfighter> What is the issue you're encountering specifically?
02:23:41FromDiscord<Avatarfighter> Just trying to understand why one gives hex and the other the raw byte?
02:23:42FromDiscord<Avatarfighter> (edit) "byte?" => "bytes?"
02:24:49FromDiscord<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:16FromDiscord<courtier> the encryption is not working properly
02:25:26FromDiscord<Avatarfighter> if you change lines 160-163 to output the strings as hex and compare is the output the smae?
02:25:29FromDiscord<Avatarfighter> (edit) "smae?" => "same?"
02:26:05FromDiscord<Avatarfighter> Replace the `$` with `toHex(VARIABLE_HERE)`
02:26:16FromDiscord<Avatarfighter> (edit) "Replace the `$` ... with" added "in front of the strings"
02:26:17FromDiscord<courtier> 1 sec
02:27:27FromDiscord<courtier> yea they are
02:27:33FromDiscord<courtier> hm
02:27:35FromDiscord<Avatarfighter> They are the same?
02:27:58FromDiscord<courtier> yep
02:28:10FromDiscord<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:58FromDiscord<courtier> it probably is the padding i just realized
02:30:39FromDiscord<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:03FromDiscord<ElegantBeef> Can you share your code here?
02:32:03FromDiscord<ElegantBeef> https://play.nim-lang.org/
02:35:57FromDiscord<courtier> ye give me a minute
02:39:11*oculuxe joined #nim
02:39:18FromDiscord<courtier> https://play.nim-lang.org/#ix=2CEo#
02:40:14*oculux quit (Ping timeout: 264 seconds)
02:46:03FromDiscord<ElegantBeef> What's the expected output?
02:48:08jonjitsu[m]When using testament, how do you import ./src/code.nim when your test is in ./tests/code.nim?
02:48:41FromDiscord<ElegantBeef> I'd do `../src/code` but uncertain what's expected
02:49:01FromDiscord<ElegantBeef> By expected i mean the normal
02:51:45jonjitsu[m]ok that works thanks
02:52:32FromDiscord<courtier> well ideally output would be a string value of `2GsmKUSQ5DIHNAd5VtpcGw==`
02:54:27jonjitsu[m]Any good tutorials out there on the async mechanism?
02:56:50*xace quit (Quit: leaving)
02:57:06FromDiscord<Avatarfighter> https://xmonader.github.io/nimdays/day04_asynclinkschecker.html From a quick skim this seems pretty good imo
02:57:47FromDiscord<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:10blueberrypieI 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:04FromDiscord<UNIcodeX> what would be Nim equivalent of `putchar`?
03:17:42FromDiscord<UNIcodeX> (edit) "what would be Nim equivalent of ... `putchar`?" added "C"
03:17:55*muffindrake joined #nim
03:21:02FromDiscord<ElegantBeef> `stdout.write` ?
03:21:05FromDiscord<iWonderAboutTuatara> now I understand why there isn't a good jpeg library
03:21:25FromDiscord<iWonderAboutTuatara> writing a jpeg encoder is a huge pain
03:21:40FromDiscord<iWonderAboutTuatara> for some reason, you walk across the image in a zigzag instead of regularly
03:23:43FromDiscord<ElegantBeef> Jpeg sucks 😄
03:23:49FromDiscord<iWonderAboutTuatara> yeah wow
03:23:56FromDiscord<iWonderAboutTuatara> I don't want to touch this
03:24:09FromDiscord<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:15FromDiscord<ElegantBeef> You sure? https://media.discordapp.net/attachments/371759389889003532/772300190488854538/unknown.png
03:25:28FromDiscord<ElegantBeef> Or are you trying to output an int as a chr?
03:26:02FromDiscord<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:04FromDiscord<UNIcodeX> (edit) "wav." => "wave."
03:26:21FromDiscord<UNIcodeX> (edit) "wave." => "wave (without casting to cchar)."
03:27:02FromDiscord<ElegantBeef> Can i see your code, just to save me a few seconds?
03:28:14FromDiscord<UNIcodeX> sent a code paste, see https://play.nim-lang.org/#ix=2CEx
03:28:30*xace joined #nim
03:28:35FromDiscord<UNIcodeX> build and pipe that to `aplay`
03:29:05FromDiscord<UNIcodeX> (edit) "https://play.nim-lang.org/#ix=2CEx" => "https://play.nim-lang.org/#ix=2CEy"
03:29:47blueberrypieiWonderAboutTuatara 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:04FromDiscord<ElegantBeef> It's not noise here
03:30:14FromDiscord<ElegantBeef> Ah
03:30:16FromDiscord<ElegantBeef> Without casting
03:30:19FromDiscord<UNIcodeX> remove `cast[cchar]`
03:30:20FromDiscord<UNIcodeX> yes
03:32:11FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=2CEz
03:36:44FromDiscord<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:20FromDiscord<ElegantBeef> Actually that's numb
03:37:23FromDiscord<ElegantBeef> (edit) "numb" => "dumb"
03:39:14FromDiscord<ElegantBeef> Aslong as it's converted to a byte i dont get why it outputs the same data
03:40:18FromDiscord<shashlick> @Phytolizer - cCompile() needs to be called before cImport() to take effect
03:40:23FromDiscord<shashlick> From the docs
03:44:13FromDiscord<Phytolizer> I'm going to feel dumb if that works
03:45:15FromDiscord<UNIcodeX> @ElegantBeef aye
03:45:34FromDiscord<ElegantBeef> So rude to quote that part :d
03:45:47FromDiscord<UNIcodeX> ?
03:46:46FromDiscord<UNIcodeX> I'm agreeing that it doesn't make sense.
03:47:23FromDiscord<ElegantBeef> It's where i'm calling myself dumb 😄
03:47:40FromDiscord<UNIcodeX> oh... i misread then.
03:47:41FromDiscord<UNIcodeX> my bad
03:48:06FromDiscord<ElegantBeef> It actually looks like i'm right
03:48:12FromDiscord<ElegantBeef> !eval stdout.write(100)
03:48:16NimBot100
03:48:42FromDiscord<UNIcodeX> will it eval the char conversion?
03:48:52FromDiscord<ElegantBeef> !eval stdout.write(100.char)
03:48:55NimBotd
03:49:01FromDiscord<UNIcodeX> hah!
03:49:27FromDiscord<ElegantBeef> Seems it just calls `$(a: T)`
03:49:47FromDiscord<UNIcodeX> thanks for the help
03:50:25FromDiscord<ElegantBeef> No problem
03:50:29FromDiscord<ElegantBeef> Source of the problem 😄 https://github.com/nim-lang/Nim/blob/version-1-4/lib/system/io.nim#L479
03:50:39FromDiscord<ElegantBeef> If you want the bytes of the value use streams
03:54:06FromDiscord<ElegantBeef> @UNIcodeX just for completion marks https://play.nim-lang.org/#ix=2CEF 😛
03:54:43FromDiscord<ElegantBeef> Wait i'm not being graded?
03:59:58Prestige@ElegantBeef: B+
04:00:04FromDiscord<ElegantBeef> Fuck
04:00:15Prestige(jk I just got here)
04:00:18FromDiscord<ElegantBeef> Guess i'll go jump into a train
04:03:08FromDiscord<UNIcodeX> The original C version has more amplitude. Not sure why.
04:03:18FromDiscord<UNIcodeX> sent a code paste, see https://play.nim-lang.org/#ix=2CEK
04:03:29FromDiscord<ElegantBeef> 127
04:04:22FromDiscord<shashlick> @Phytolizer no worries - it's not intuitive but it's needed to generate standalone wrappers
04:04:56FromDiscord<UNIcodeX> hahahahah. so it was. d'oh! Never you mind Prestige, Beef, you're my new best friend. 🙂
04:05:18FromDiscord<ElegantBeef> I dont get a say in it?
04:05:25FromDiscord<UNIcodeX> nnnnnope
04:05:52Prestigehe just likes you for your meats
04:05:59FromDiscord<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:14FromDiscord<UNIcodeX> @Prestige haha
04:06:20FromDiscord<ElegantBeef> Lol i'm just joking, was a fun little problem to solve
04:06:31FromDiscord<UNIcodeX> oh I know.
04:06:45*supakeen joined #nim
04:07:24FromDiscord<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:49FromDiscord<ElegantBeef> I have no clue what that means
04:08:20FromDiscord<UNIcodeX> https://zserge.com/posts/nokia/
04:08:31FromDiscord<ElegantBeef> Ah
04:30:46FromGitter<offbeat-stuff> Hi I have my system's main coming in to my nim program, How do I make it secure
04:30:58FromGitter<offbeat-stuff> system's main password
05:04:28FromDiscord<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:17FromDiscord<Phytolizer> it very nearly worked @shashlick
05:19:07FromDiscord<Phytolizer> getting an undefined symbol error now, assuming that means i need to just edit the generated code manually now
05:20:26FromDiscord<Phytolizer> (edit) "undefined symbol" => "undeclared identifier"
05:22:25FromDiscord<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:26jonjitsu[m]is there a way of dealing with the indent on a multiline string created with """?
05:26:37Prestigededent?
05:27:25FromDiscord<shashlick> @Phytolizer what does it look like in C
05:27:39FromDiscord<shashlick> Open an issue if it is wrapped wrong
05:27:54FromDiscord<shashlick> But note that nimterop doesn't support c++
05:30:19jonjitsu[m]I was thinking more like ruby/yamls multiline strings which ignore the leading indents.
05:31:22PrestigeI mean, https://nim-lang.org/docs/strutils.html#dedent%2Cstring%2CNatural seems usable
05:33:27FromDiscord<Phytolizer> ah, it is c++. but it's ok, it was easy to swap the types out for seq[T] and map
05:39:06FromDiscord<Phytolizer> nevermind, it's more complicated than that. i found a c version of the tinyobjloader header though so it's good
05:47:54FromDiscord<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:11FromDiscord<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:50FromDiscord<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:59FromGitter<jrfondren> look through `nimble search http`
09:06:29FromDiscord<tomck> are there any known 'good & stable' ones?
09:07:04FromDiscord<flywind> It is ready for production if using `nginx` as reverse proxy。
09:07:08FromDiscord<flywind> (edit) "proxy。" => "proxy."
09:07:16FromDiscord<tomck> yes, i don't want that
09:07:32FromDiscord<tomck> can't have something like nginx running
09:08:33FromDiscord<flywind> If using it for local, I think `asynchttpserver` is proper.
09:09:35FromDiscord<flywind> `asynchhtpserver` is the most stable HTTP server in Nim.
09:10:06FromDiscord<tomck> what's 'not production'a bout it?
09:10:10FromDiscord<tomck> is it insecure in some way?
09:12:18FromDiscord<flywind> Yes it can't resist attacks.
09:14:29FromGitter<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:39FromDiscord<Rika> slowaris?
09:15:05FromGitter<jrfondren> clients that maintain a connection, so they never time out, but they send data very slowly, like one byte per packet.
09:15:57FromGitter<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:32FromGitter<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:57FromDiscord<tomck> Cool, thanks
09:18:15FromDiscord<tomck> just looking for sommething to serve custom responses to application specific requests, not a full framework
09:19:27FromGitter<jrfondren> http://nitter.net/ is a pretty cool app that looks to be using jester. behind nginx though
09:20:32FromDiscord<tomck> i guess running behind nginx isn't too big of an issue
09:20:52FromDiscord<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:10FromGitter<jrfondren> `const contents = readFile("filename")`
09:21:28FromGitter<jrfondren> there's also staticRead, also called slurp
09:21:30FromDiscord<flywind> use `staticRead`
09:21:44FromDiscord<tomck> is readfile done at compile time, embedded into the binary|?
09:21:57FromGitter<jrfondren> the `const` tells you it has to happen at compile time
09:23:53FromGitter<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:13FromDiscord<Yardanico> @jrfondren it's open source under AGPLv3
09:24:17FromDiscord<Yardanico> !repo nitter
09:24:18disbothttps://github.com/zedeus/nitter -- 9nitter: 11Alternative Twitter front-end 15 1652⭐ 58🍴
09:24:22FromGitter<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:40FromDiscord<Yardanico> readFile didn't always work in the vm iirc
09:30:32FromDiscord<tomck> hmmm, `invalid pragma: async`?
09:30:38FromDiscord<tomck> just running the asynchttpserver example
09:31:05FromDiscord<tomck> sent a code paste, see https://play.nim-lang.org/#ix=2CFJ
09:32:10FromDiscord<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:13FromDiscord<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:24FromDiscord<tomck> i guess pragmas don't work with the same template scoping rules (?)
09:37:03FromDiscord<Yardanico> I think it's already been reported
09:37:19FromDiscord<Yardanico> And I think it has to do with 1.4 change of making await a template
09:37:59FromGitter<jrfondren> like https://github.com/nim-lang/Nim/issues/15804
09:38:01disbotCode that work in 1.2.6, but not 1.4.0 ; snippet at 12https://play.nim-lang.org/#ix=2CFM
09:58:22FromDiscord<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:08FromDiscord<windowsboy111> or can this be caused by libraries? I am using `wxnim`
10:07:21FromGitter<jrfondren> no, not normal. you might run into codegen errors with experimental features
10:07:28FromGitter<jrfondren> this though is yeah, the wxnim library
10:08:53FromGitter<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:19FromDiscord<windowsboy111> thx, also what does `immutable` means
10:26:08FromDiscord<Ryuzaku> hey, is there something similar to pythons namedtuple._replace in nim? I didnt find anything
10:26:12FromGitter<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:27FromGitter<jrfondren> what's namedtuple._replace ?
10:26:56FromDiscord<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:03FromDiscord<windowsboy111> so mutate is an english word 🤦‍♂️ okay
10:27:27FromGitter<jrfondren> I have no idea what that emoji means, but yes.
10:28:06FromDiscord<Ryuzaku> like this: >>> p = Point(x=11, y=22)↵> p._replace(x=33)↵> Point(x=33, y=22)
10:28:08FromDiscord<Rika> its a facepalm
10:28:27FromDiscord<Rika> you can just do `theTuple.x = 33` in nim
10:28:31FromDiscord<windowsboy111> @Ryuzaku so `_replace` is a method?
10:28:42FromDiscord<windowsboy111> to replace attributes?
10:28:47FromDiscord<Ryuzaku> yes, and i need a copy, instead of manipulating the instance
10:28:53FromDiscord<windowsboy111> and `Point` is a class.
10:28:53FromDiscord<windowsboy111> okay
10:28:53leorizesee sugar.dup
10:30:02FromDiscord<windowsboy111> sent a code paste, see https://play.nim-lang.org/#ix=2CG0
10:30:40FromDiscord<Rika> its `:` not `=`
10:30:48FromDiscord<windowsboy111> ah yes
10:30:52FromDiscord<Rika> inside Cls()
10:31:03leorize@Ryuzaku: https://play.nim-lang.org/#ix=2CG1
10:32:16FromDiscord<windowsboy111> (edit) sent a code paste, see https://play.nim-lang.org/#ix=2CG3
10:32:17FromDiscord<Ryuzaku> @leorize this is pretty cool. Thank you.
10:32:28FromGitter<jrfondren> and for a single updated field you can put the update on the same line
10:33:22leorizeyou can also run procedures that modify the value in-place
10:33:28leorizeit's very flexible
10:34:03FromGitter<jrfondren> looks like it also breaks if Point has reference semantics
10:34:12*mmohammadi9812 quit (Ping timeout: 272 seconds)
10:34:43FromDiscord<Ryuzaku> in my case it doesnt. Thx 👍
10:35:01leorizeI can't imagine why anyone would use dup() on a ref :P
10:35:36Zevvif you want two refs!
10:39:20FromGitter<jrfondren> changing its `T` to `T: object`saves anyone from the confusion anyway. although the error isn't that nice
10:40:00leorizeit 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:13FromDiscord<mfiano> sent a long message, see http://ix.io/2CGb
10:57:25Zevvso, what happened? I haven't seen you around in the last few months?
11:04:27FromDiscord<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:41FromDiscord<Yardanico> i currently have 100mbps as most people
11:05:16Zevvgood thing the USA is asleep. in the good case you'd only get a few rotten tomatoes
11:05:33FromDiscord<Yardanico> lol
11:05:34Zevvamerica is really a 3d world country, internetwise
11:05:51FromDiscord<Yardanico> well russian internet is one of the cheapest in the world if you compare everything in $
11:06:01FromDiscord<Yardanico> https://www.numbeo.com/cost-of-living/country_price_rankings?itemId=33
11:06:05FromDiscord<Yardanico> https://www.mentalfloss.com/article/525011/monthly-internet-costs-every-country
11:06:07ZevvI'm still at 100mpbs because I'm too lazy to upgrade all my home network gear
11:06:28FromDiscord<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:38FromDiscord<Yardanico> my current one is a really cheap 2.4GHz one
11:07:01Zevvyeah, but I got 4 AP's, three switches and a router
11:07:15Zevvnot sure what'll happen if I egress at 1G. some stuff will be bottlencking
11:07:24FromGitter<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:49FromDiscord<Yardanico> wow
11:07:51FromGitter<jrfondren> and I live in a large city.
11:08:07FromDiscord<Yardanico> these prices would be unimaginably high there (in rubles, compared to average salaries) :)
11:08:44FromDiscord<Yardanico> currently I pay 600 rubles (~$7.5) for unlimited mobile data (+500sms, 500minute calls) + 100mbps home connection
11:09:12Zevvthat's nice
11:09:18FromDiscord<Yardanico> although I live only around 50km away from a big city (Kazan)
11:09:33FromDiscord<Yardanico> it has more than 1mil population
11:09:43FromGitter<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:36FromGitter<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:43FromGitter<jrfondren> ... which is still a lot worse than your current plan, price-wise.
11:11:54FromDiscord<Yardanico> well, russian prices are also much, much worse if you compare in $ :)
11:11:59FromDiscord<Yardanico> salaries
11:12:12FromGitter<jrfondren> ah I suppose
11:12:15FromDiscord<Yardanico> internet speeds on my mobile also range a lot, from 7mbps to 70bmps
11:12:16FromDiscord<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:55FromDiscord<Rika> it's `dup(x, x = 100)`
11:15:00FromGitter<jrfondren> https://play.nim-lang.org/#ix=2CGi
11:15:03FromDiscord<Yardanico> nah
11:15:03FromDiscord<Rika> wait hm
11:15:05FromDiscord<Rika> misread
11:15:18FromDiscord<Rika> i misread smh
11:15:20ZevvI'm not even sure what yu're trying to do there
11:15:24FromDiscord<Yardanico> seems like = doesn't work the way you want
11:15:27FromDiscord<Yardanico> this works though:
11:15:50FromDiscord<Yardanico> or maybe not
11:16:09FromGitter<jrfondren> the macro rewrites assignment but not *=, and it doesn't make x available to the expression as a variable either.
11:16:14FromDiscord<Yardanico> yeah
11:16:15FromDiscord<Yardanico> https://play.nim-lang.org/#ix=2CGj
11:16:19FromGitter<jrfondren> it also seems to need a var context, you've got to assign the dup
11:16:36FromDiscord<Yardanico> jrfondren solution is good I think
11:17:58FromDiscord<Yardanico> but it kind of defeats the purpose
11:18:07FromDiscord<Yardanico> since you access a in b :)
11:21:11FromDiscord<Yardanico> @Ryuzaku there's another way I think
11:21:19FromDiscord<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:28FromDiscord<Ryuzaku> and whats the other way?
11:21:52FromGitter<ynfle> How do I get myself out of the `moderated` status on nim forum?
11:22:07FromDiscord<Yardanico> ask me or dom
11:22:10FromDiscord<Yardanico> whats your acc
11:22:27FromDiscord<Yardanico> ah I see
11:22:32FromDiscord<Yardanico> approved
11:22:42FromGitter<ynfle> Thanks 👍
11:23:04FromDiscord<Yardanico> you replied to a 1 year old forum thread though ;)
11:23:36FromGitter<ynfle> I know. Is that not allowed/encouraged?
11:23:51FromDiscord<Yardanico> it's okay
11:26:41*qeisterfisch is now known as qwertfisch
11:31:22FromGitter<jrfondren> the other problem with what's wanted there is that *= isn't an expression :/
11:32:29FromGitter<ynfle> @jrfondren, was that for me?
11:33:01FromGitter<jrfondren> no, Ryuzaku
11:33:21FromGitter<jrfondren> I'd do something more like this: https://play.nim-lang.org/#ix=2CGn
11:33:22FromGitter<ynfle> 👍
11:35:51FromDiscord<Clyybber> @Ryuzaku IMO it should work
11:36:02FromDiscord<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:11FromDiscord<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:21FromDiscord<Clyybber> In block notation I mean
11:36:51FromDiscord<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:54FromDiscord<Ryuzaku> (edit) "ode" => "code"
11:37:03FromGitter<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:05FromDiscord<Ryuzaku> well, not shortest possible, but quite short ^^
11:37:27FromDiscord<Ryuzaku> oh. i didnt know that
11:37:32FromDiscord<Yardanico> @jrfondren one tip - return is not needed here :) nim already allocates the result for you
11:37:40FromDiscord<Yardanico> so result = Foo(x: x, y: y) is better
11:37:47FromDiscord<Yardanico> kind of
11:38:03FromDiscord<Clyybber> @Ryuzaku I mean x = ... should work in block notation too
11:38:18FromDiscord<Ryuzaku> oh. Ok, ill try that. thx
11:38:24FromDiscord<Clyybber> No it doesn't :)
11:38:31FromDiscord<Clyybber> I meant it should
11:38:33FromDiscord<Clyybber> :D
11:38:36FromDiscord<Ryuzaku> 😄
11:39:22FromDiscord<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:36FromDiscord<Yardanico> well it's not magic
11:39:40FromDiscord<Yardanico> it just rewrites some stuff
11:39:45FromDiscord<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:23FromDiscord<Yardanico> @narimiran @dom96 any info about updating docs?
12:22:26FromDiscord<Yardanico> can you drop the cache or something?
12:22:28FromDiscord<Yardanico> they're still broken
12:33:17Yardanico!status
12:33:18FromDiscordUptime - 1 week, 4 days, 16 hours, and 56 minutes
13:11:39FromDiscord<dom96> I dropped the cache
13:15:31FromDiscord<Yardanico> huh so is it not fixed in stable docs? weird
13:15:33FromDiscord<Yardanico> i thought it got backported?
13:16:37FromDiscord<Yardanico> https://github.com/nim-lang/Nim/commit/6d99de7c2c43338a2561e51d5ea8c13108caa4cd
13:16:50FromDiscord<Yardanico> maybe not this
13:21:44ForumUpdaterBotNew thread by Haydenjones: [Question] Enumerating fields in an enum, see https://forum.nim-lang.org/t/7022
14:02:14FromDiscord<alehander42> oi
14:06:49blackbeard420when using `nim c --os:FreeRTOS --cpu:esp` how do i tell it to use xtensa-esp32-elf-gcc instead of gcc
14:09:04blackbeard420i 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:34FromDiscord<Rika> --gcc.exe:xtensa-esp32-elf-gcc i think
14:15:44FromDiscord<Rika> or was it something else i forgot
14:16:00FromDiscord<Rika> ah, it's `--cc:...`
14:16:46FromDiscord<Yardanico> that's for specifying what C compiler you're using (the type)
14:16:50FromDiscord<Yardanico> cc = gcc is by default
14:16:58FromDiscord<Yardanico> you were right at first with gcc.exe and gcc.linkerexe
14:17:11FromDiscord<Rika> ah
14:17:14FromDiscord<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:45FromDiscord<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:03FromDiscord<lqdev> i'm wondering how y'all compiler devs put up with nimsuggest on a daily basis
15:41:13FromDiscord<lqdev> because it's been driving me crazy for the past few days
15:41:29FromDiscord<lqdev> i mean, more than a minute spent just to update syntax highlighting?
15:42:13FromDiscord<lqdev> and my shitty game is much tinier than the whole compiler
15:42:18FromDiscord<lqdev> like, how?
15:42:45FromDiscord<lqdev> compiling the game takes less time than it takes for nimsuggest to highlight my main file
15:43:03FromDiscord<alehander42> i don't think i use nimsuggest
15:43:22FromDiscord<alehander42> hm, but maybe i do
15:43:28FromDiscord<alehander42> does vscode extension use it
15:43:39FromDiscord<lqdev> think i'm gonna try extending lite with a nim syntax
15:43:50FromDiscord<lqdev> because the past few days have been absolute pain
15:54:21FromDiscord<levovix> is there a way to get a pointer to the first element of immutable seq?
15:55:32Zevvel[0].unsafeAddr
15:58:27FromGitter<jrfondren> el.toOpenArray(0, 0)
15:58:54FromGitter<jrfondren> for some purposes. I've been preferring to make stuff 'var' so that .addr will work
15:59:13leorizeit depends on what you're doing most of the time
15:59:16FromGitter<jrfondren> what precisely is unsafe about .unsafeAddr? are there demonstrations of mistakes with it?
15:59:34FromGitter<jrfondren> where it's more unsafe than .addr
15:59:36leorizeunsafeAddr is addr but can be used on immutable elements
15:59:56leorizebasically so you don't accidentally mutate things when used for C FFI for example
16:01:13FromGitter<jrfondren> ah that's it, that it can violate immutability? I guess I should use it more often then.
16:02:00FromGitter<jrfondren> !eval let s = "hello"; s[1].unsafeAddr[] = 'x'; echo s
16:02:04NimBothxllo
16:02:21FromGitter<jrfondren> I was thinking it was more about an address possibly not being available, so that you get a crash at runtime
16:02:37FromGitter<jrfondren> ... that's what the error message suggests after all.
16:03:38FromDiscord<levovix> thanks, it helped, I realized that I was trying to get var element from immutable seq instead ptr
16:04:51leorizejrfondren: we are certainly not the best when error messages are concerned
16:06:26ZevvusafeAddr is unsafe because it lets you get the address to something and alias it
16:06:50Zevvso your code says "immutable" but it is actually not
16:07:51FromGitter<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:26FromGitter<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:27leorizeexperimental: views is probably better for that purpose
16:10:41FromGitter<jrfondren> oh I've looked at those: https://github.com/nim-lang/Nim/issues/15778
16:10:43disbotViewtype codegen error turns a single proc call into two ; snippet at 12https://play.nim-lang.org/#ix=2CHD
16:11:22FromGitter<jrfondren> and https://github.com/nim-lang/Nim/issues/15746 and https://github.com/nim-lang/Nim/issues/15657
16:11:24disbotCodegen error with uninitialized tuple-of-view-types result ; snippet at 12https://play.nim-lang.org/#ix=2CHE
16:11:32FromGitter<jrfondren> they seem easy to use though.
16:37:31*natrys quit (Ping timeout: 246 seconds)
16:38:07ForumUpdaterBotNew 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:21FromDiscord<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:57FromDiscord<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:47FromDiscord<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:05PMunchHi everyone, I'll be streaming again today, probably in about an hour.
17:13:59*azed joined #nim
17:24:47Prestigestarting off November right :P
17:29:48*mmohammadi9812 joined #nim
17:33:33PMunchHaha, I guess you can say that
17:42:45jonjitsu[m]PMunch, What's the topic going to be?
17:47:45PMunchMore notifishower development, some talk about X and x.org.
17:48:17PMunchGoing to implement keyboard shortcuts, and add backgrounds to things
17:48:23jonjitsu[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:29PMunchMaybe fix up some of the TODOS we left last time
17:48:55PMunchjonjitsu[m], yes
17:49:01PMunchIt's pretty much the exact same thing
17:49:04jonjitsu[m]PMunch, cool I was interested in creating a WM with nim
17:49:16PMunchHave you seen Nimdow?
17:49:23jonjitsu[m]There are no xcb bindings anywhere right?
17:49:51PMunchNothing complete
17:49:55*Vladar joined #nim
17:49:57PMunchBut there are xlib bindings
17:50:03PMunchAnd some support libraries
17:50:03jonjitsu[m]PMunch, yes but I don't know enough nim right now so I'm concentrating on learning the language first :)
17:50:18PMunchNothing like learning with a project ;)
17:50:36PMunchhttps://peterme.net/tinywm-implementation-in-nim.html <- That might be interesting
17:51:03jonjitsu[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:25Prestigeyou could contribute to nimdow ;) lol
17:51:29PMunchThat is the idea for my PiMo WM :)
17:52:25jonjitsu[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:39FromDiscord<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:48PMunchOooh, I kinda like that idea
17:53:18jonjitsu[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:24jonjitsu[m]PMunch, What's the link for the stream?
17:54:33PMunchhttps://www.twitch.tv/pmunche
17:54:36PMunchJust went live
17:54:48PMunchAnd feel free to join the chat on IRC if you prefer that
17:55:03FromGitter<jrfondren> tomck, nimble search inotify pulls up libfswatch, which looks like a simple enough wrapper over that system
17:55:18PMunch(Although it is a slight hassle to set up authentication)
17:56:00FromDiscord<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:25blackbeard420when 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:44FromDiscord<Yardanico> @blackbeard420 try to add -d:useMalloc
18:19:05FromDiscord<Yardanico> you also need --gcc.linkerexe:xtensa-esp32-elf-gcc I think
18:19:22FromDiscord<Yardanico> And of course --gc:arc
18:20:38blackbeard420oh wow thanks. --gc:arc, -d:useMalloc and the additional gcc.linkerexe made it compile sucessfully. will verify it runs! thanks again
18:27:58FromDiscord<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:28FromDiscord<Yardanico> Well, you'll need to remind narimiran about that
18:33:36FromDiscord<Yardanico> But really I think the questions will be discussed
18:35:00FromDiscord<tinygiant> sent a code paste, see https://play.nim-lang.org/#ix=2CIi
18:35:02FromDiscord<tinygiant> sent a long message, see http://ix.io/2CIj
18:36:14FromDiscord<haxscramper> @Yardanico When (approximately) survey will be launched? Late December, like in 2019?
18:36:31FromDiscord<Yardanico> honestly I don't know that
18:36:38FromDiscord<Yardanico> Ask dom or miran :)
18:39:35*krux02 joined #nim
18:41:39FromDiscord<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:28FromDiscord<juan_carlos> packedjson is good.
18:43:31FromDiscord<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:16FromDiscord<haxscramper> Or maybe there is a more efficient way to do this, I have always been bad at algorithms
18:45:32FromDiscord<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:47FromDiscord<tinygiant> @haxscramper Thanks for the pointer, I'll check out packedJson this afternoon.
18:47:02FromDiscord<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:06FromDiscord<nimi30> I-
18:47:34FromDiscord<nimi30> don't feel belong here but I joined cuz nim is a nickname my friends give me
18:47:48FromDiscord<nimi30> aight imma head out
18:48:10*abm joined #nim
18:49:02FromDiscord<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:10FromDiscord<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:33FromDiscord<haxscramper> Make it work, make it have good UX< make it fast
18:50:36FromDiscord<haxscramper> Something like that
18:50:45FromDiscord<haxscramper> (edit) "UX<" => "UX,"
18:50:50*azed quit (Quit: WeeChat 2.9)
18:51:08FromDiscord<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:27FromDiscord<courtier> im curious what does the end keyword do?
19:35:38solitudesfin normal nim - nothing
19:35:43solitudesfits used in source code filters
19:35:54solitudesfhttps://nim-lang.github.io/Nim/filters.html
19:38:58FromDiscord<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:05FromDiscord<courtier> sent a code paste, see https://play.nim-lang.org/#ix=2CIW
20:40:12FromDiscord<courtier> leads to `Error: unhandled exception: index out of bounds, the container is empty [IndexError]`
20:50:07jonjitsu[m]What's the easiest way to read an entire file as a uint8 block of data?
20:51:24jonjitsu[m]cast[seq[uint8]](File.readAll()) ?
20:51:58jonjitsu[m] * `cast[seq[uint8]](File.readAll())` ?
20:54:43*xet7 quit (Quit: Leaving)
20:58:51*xet7 joined #nim
21:00:13FromDiscord<ElegantBeef> The otherway would be to use streams
21:09:41PMunchOof, my throat is soo dry after talking none-stop for three hours :S
21:09:49PMunchnon*
21:13:27*lritter quit (Quit: Leaving)
21:17:27FromDiscord<alehander42> 😄
21:21:20PMunchI need to remind myself to bring a glass of water for next time :P
21:27:28FromDiscord<ElegantBeef> Or bring a replacement throat
21:28:50*Jesin quit (Quit: Leaving)
21:34:26PMunchI think doing a throat replacement surgery on myself during a stream might be a bit extreme .P
21:34:47FromDiscord<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:08PMunchWhat do you mean?
21:37:45FromDiscord<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:53jonjitsu[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:56FromDiscord<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:11FromDiscord<ElegantBeef> ~100ms delay isnt too bad i suppose, since it's still under human response time
21:40:11disbotno footnotes for `100ms`. 🙁
21:40:17FromDiscord<ElegantBeef> lol
21:41:31PMunchAah I see
21:41:47PMunchAnd is it paramount that every ship get an update every tick?
21:42:02PMunchOr could you do them round robin style and defer some to the next tick?
21:42:04FromDiscord<ElegantBeef> Well the ships are controlled by scripts so those are equivlent to the player giving inputs
21:42:11FromDiscord<ElegantBeef> Yea that's one other alternative i was thinking
21:42:24FromDiscord<ElegantBeef> Could do batches of X amount every frame on a second thread
21:43:04FromDiscord<ElegantBeef> That way the framerate stays at 60fps on a lot of hardware
21:43:21FromDiscord<ElegantBeef> A few frame delay is completely fine since it'd still be faster than a human
21:44:10FromDiscord<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:42PMunchYeah delaying their tick by one probably isn't a big issue
21:45:52PMunchNot sure how multithreading the NimScript interpreter works
21:45:56PMunchMight be a bit icky :P
21:46:08FromDiscord<ElegantBeef> yea that was what i was wondering aswelll
21:46:14*Jesin joined #nim
21:46:15FromDiscord<ElegantBeef> It could be a breeze(probably wont be)
21:46:27FromDiscord<ElegantBeef> IIRC remember there is a global ctx variable
21:46:46FromDiscord<ElegantBeef> So yea just a user defined `updates per tick`
21:47:55FromDiscord<ElegantBeef> This is under the category of "premature optimization" but dont tell anyone 😄
21:48:16PMunchHaha :P
21:48:31PMunchI mean it is good to at least think about this stuff in advance
21:53:42FromDiscord<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:04PMunchHaha, what did you try?
22:06:59FromDiscord<ElegantBeef> Making some quick and dirty explanations
22:14:10FromDiscord<Avatarfighter> What is good everyone 😄
22:15:01FromDiscord<ElegantBeef> Hello
22:15:12FromDiscord<ElegantBeef> So it seems cputime doesnt work from the intepreter
22:15:19FromDiscord<Avatarfighter> rip
22:15:20FromDiscord<ElegantBeef> (edit) "intepreter" => "interpreter"
22:15:29FromDiscord<ElegantBeef> not a big issue
22:15:34FromDiscord<ElegantBeef> i can just use nimscripter 😛
22:15:44FromDiscord<Avatarfighter> ahaha
22:15:50FromDiscord<Avatarfighter> Love that
22:15:51PMunchWhy not use epochTime?
22:16:04FromDiscord<Avatarfighter> I'm currently taking a math test and i am waiting for me to fail
22:16:05FromDiscord<ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/772584776694628362/unknown.png
22:16:17FromDiscord<Avatarfighter> PMunch
22:16:19PMunchA math test, and you're online?
22:16:21FromDiscord<Avatarfighter> Are you still streaming?\
22:16:25FromDiscord<Avatarfighter> yeah
22:16:33PMunchNah, stopped about an hour ago
22:16:36FromDiscord<Avatarfighter> rip
22:16:54PMunch@ElegantBeef
22:16:55FromDiscord<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:58PMunchOops
22:17:02FromDiscord<ElegantBeef> Lol
22:17:08FromDiscord<ElegantBeef> You made my discord badup for nothing
22:17:27PMunchDepends on what you need, but cpuTime will not count up if the OS sleeps your process for example
22:17:47PMunchIt is only really useful if you actually want to know how much time the CPU has actually spent running an algorithm
22:17:54FromDiscord<ElegantBeef> yea which isnt an issue atm
22:18:08FromDiscord<ElegantBeef> The issue is that my quick template for benchmarking uses cpu time and that doesnt work on the vm
22:18:09PMunch@Avatarfighter, sounds familiar :P
22:18:36FromDiscord<Avatarfighter> lmao
22:18:48FromDiscord<Avatarfighter> honestly its not even that bad
22:18:55FromDiscord<Avatarfighter> I did the test in 10 minutes earlier and got 60%
22:18:58FromDiscord<Avatarfighter> soooo
22:19:03FromDiscord<Avatarfighter> im going a tad bit slower this time
22:20:09FromDiscord<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:25FromDiscord<Avatarfighter> https://media.discordapp.net/attachments/371759389889003532/772585865125560351/unknown.png
22:20:26FromDiscord<Avatarfighter> im crying
22:21:15FromDiscord<Avatarfighter> that's it im working on shit
22:21:24PMunchHuh?
22:21:38FromDiscord<Avatarfighter> shit is my next gen shitty git alternative
22:21:54FromDiscord<ElegantBeef> I thought SVN already existed
22:22:09PMunchAh :P
22:22:10FromDiscord<ElegantBeef> Isnt it short for Shit VersioN control?
22:22:10FromDiscord<Avatarfighter> dude I learned there is a version control called CVS
22:24:07FromDiscord<Avatarfighter> PMunch: What interesting things have you been working on recently?
22:24:33supakeenHah, my first job we used CVS still :)
22:24:46PMunchRecently I've been working mostly on notifishower and notificatcher (which is also what I have been streaming)
22:24:51supakeen(it was already old and 'superceded' by SVN at that point)
22:25:17FromDiscord<ElegantBeef> If you want avatar i can always stream me fighting the performance issues
22:25:27FromDiscord<Avatarfighter> PMunch: is it safe to assume that they are related to notifications 😛
22:25:31FromDiscord<Avatarfighter> Honestly I might stream
22:25:35PMunchHaha, yes
22:25:56PMunchNotificatcher catches notifications from the freedesktop dbus interface
22:25:58FromDiscord<Avatarfighter> Do you have repos for all your code that I can take a peak at?
22:26:01FromDiscord<Avatarfighter> ah
22:26:13PMunchAnd Notifishower can show highly customisable notifications
22:26:15FromDiscord<Avatarfighter> supakeen: Yeah I assumed CVS was old but not that old lmaooo
22:26:32FromDiscord<Avatarfighter> How customizable we talking 😛 CSS3/HTML5 🤔
22:26:48PMunchI send customiseable, not horrible
22:27:01PMunchhttps://github.com/PMunch/notifishower
22:27:27FromDiscord<Avatarfighter> PMunch: but you could be using cool css3 animations
22:27:31PMunchI mean you have a visual format language to determine the layout: (-[~icon:32~]-[~title body~]-)
22:27:36FromDiscord<Avatarfighter> all I'm saying is your living in the past without CSS-shake
22:27:46FromDiscord<Idefau> no not css no please no not
22:27:59PMunchAnd then you can add icons, text, and ninepatches around
22:28:07PMunchThe whole thing can also be ninepatches
22:28:28PMunchOf course any TTF font you want
22:28:36PMunchAnd any colour (including transparent)
22:28:38FromDiscord<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:53PMunchWhat did it do?
22:29:03FromDiscord<Avatarfighter> html/css/js
22:29:20FromDiscord<Avatarfighter> https://github.com/juancarlospaco/webgui/
22:29:21FromDiscord<Avatarfighter> found it
22:29:27PMunchAnd you can click on anything and attach ninepatch backgrounds and hover graphics to any element
22:29:37PMunchSo pretty customisable
22:29:48FromDiscord<Avatarfighter> Yeah that sounds really customizable lol
22:30:25FromDiscord<Avatarfighter> im so sad
22:30:31FromDiscord<Avatarfighter> i think i allocated too much ram to my vm
22:30:34FromDiscord<Avatarfighter> vps
22:31:06PMunchToo much?
22:31:13FromDiscord<Avatarfighter> yeah i think so
22:31:39FromDiscord<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:32PMunchHuh, that is pretty cool
22:32:48PMunchHaha, that is a bit rough
22:32:50FromDiscord<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:23FromDiscord<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:45PMunchHmm, 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:00FromDiscord<Avatarfighter> hm
22:38:11FromDiscord<Avatarfighter> I've never used mmap is it easy to use?
22:38:13PMunchThose are a looot of bytes to try and allocate :P
22:38:22PMunchOh this is output from strace
22:38:28FromDiscord<Avatarfighter> ah
22:38:31PMunchmmap is basically what malloc does in the background
22:38:40FromDiscord<Avatarfighter> yeah that makes sense
22:39:06PMunchI'm pretty sure that tries to malloc from some unassigned field that just has garbage in it
22:40:15PMunchMight be a derp on some string value
22:40:39FromDiscord<Avatarfighter> I'm really interested to know what causes that if you manage to track down the issue
22:43:16PMunchAre any of you on Windows?
22:43:28FromDiscord<ElegantBeef> I have a partition but i never usue it
22:43:37FromDiscord<ElegantBeef> Outside of playing games i should say
22:44:13FromDiscord<Avatarfighter> I am on windows rn
22:44:17FromDiscord<Avatarfighter> and mac and linux if you need
22:44:18FromDiscord<ElegantBeef> Doing 100 ship batches per frame seems to work ok https://streamable.com/aipyfv
22:44:39FromDiscord<ElegantBeef> I can easily move up to like ~170 on my cpu and still be under the frame limit
22:45:21PMunchI just kinda want to know if you can get the sample thing here working: https://github.com/jangko/nimCEF
22:45:32PMunchBut I think it might be a massive PITA to set up on Windows
22:45:45FromDiscord<ElegantBeef> As are most things 😛
22:46:07PMunchExactly :P
22:46:14PMunchOn Linux it was pretty easy :P
22:46:22FromDiscord<Avatarfighter> honestly windows is such a mess
22:46:32*tane quit (Quit: Leaving)
22:46:33FromDiscord<Avatarfighter> I swear there are literally 4 official gui libraries for it
22:46:37PMunchHmm, they do seem to have a bit of jitter though ElegantBeef, is that caused by the batching, or something else?
22:47:08FromDiscord<ElegantBeef> Might be approaching the frame time causing the jitter, or you're just seeing sprite rotation artifacts
22:47:41FromDiscord<ElegantBeef> Actually nah that's too jittery for either of those
22:49:15PMunchSeems like I might be right: 0x00007ffff351cef3 in cef_string_utf16_set () at ./libcef.so
22:51:27FromDiscord<Avatarfighter> Dang I think I am officially on the side of chronos async instead of stdlib async
22:52:00FromDiscord<ElegantBeef> Arent most people on that side? 😄
22:52:06FromDiscord<ElegantBeef> Or am i thinking of weave
22:52:11FromDiscord<Avatarfighter> dude
22:52:12FromDiscord<Avatarfighter> weave
22:52:15FromDiscord<Avatarfighter> im in love
22:52:48PMunchFuck me.. I'm looking at the CEF source and it's just layer upon layer of intdirection..
22:52:52PMunchindirection*
22:53:28FromDiscord<Avatarfighter> why are you trying to embed chromium l?
22:53:29FromDiscord<Avatarfighter> (edit) "l?" => "?"
22:53:50FromDiscord<ElegantBeef> Cause embedding firefox causes burning when you pee
22:54:07*natrys quit (Ping timeout: 246 seconds)
22:54:18FromDiscord<Avatarfighter> hm
22:54:25FromDiscord<Avatarfighter> Although I laughed
22:54:38FromDiscord<Avatarfighter> I must say that I enjoy the lack of resource usage of firefox
22:55:27PMunchWell, the end goal is writing my own browser
22:55:34PMunchWithout having to deal with any of the web stuff
22:55:46FromDiscord<ElegantBeef> Doesnt sound like Pimo 😄
22:55:59PMunchI know :P
22:56:08FromDiscord<Avatarfighter> why not use the webgui library I sent above somewhere
22:56:11FromDiscord<Avatarfighter> it looks embeddable
22:56:14PMunchIt started as a curiosity last week
22:56:14FromDiscord<Avatarfighter> i hope
22:56:23PMunchLike "how difficult would it actually be"
22:56:35PMunchAnd it really annoyed me that I couldn't get NimCEF to work
22:56:45PMunchAnd I'm not 100% sure if it is Nim or CEF being broken
23:06:31FromDiscord<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:56PMunchEh, if someone is bored: http://ix.io/2CJM
23:09:04PMunchI'm off to bed
23:09:12FromDiscord<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)