<< 05-08-2020 >>

00:17:23disruptekcps needs more testes.
00:17:26disruptek!repo cps
00:17:26disbothttps://github.com/disruptek/cps -- 9cps: 11Continuation-Passing Style for Nim 🔗 15 17⭐ 1🍴
00:17:36disrupteknew version that kinda works more than it did.
00:18:40disruptekyou can see how fast zevv's web-server is, for example.
00:20:05disruptekoh, nevermind, it doesn't work in arc.
00:28:24FromDiscord<flywind> cps seems very nice. I will try it.
00:29:20disruptekcool, it's very early but let's see what you can make with it. 😄
00:30:29FromDiscord<flywind> I think async ecosystem in Nim is very early too. 😜
00:30:54disruptekthere is a lot of room for improvement everywhere.
00:52:29*maier joined #nim
00:57:49*maier quit (Ping timeout: 264 seconds)
01:06:44FromDiscord<flywind> `select` doesn't scale in windows. I happen to work on `ioselctors plus`(based on `wepoll`) for `httpbeast`. Though it is only for test `httpbeast`(not robust) now, it maybe useful for `cps` too.
01:06:45FromDiscord<flywind> https://github.com/xflywind/ioselectors
01:06:54FromDiscord<flywind> https://github.com/xflywind/wepoll
01:07:19FromDiscord<flywind> based on: https://github.com/piscisaureus/wepoll
01:08:57FromDiscord<flywind> Of course, when the project becomes larger, we should have a pure nim version of `wepoll` just like `mio` in `Rust`.
01:09:55*apahl quit (Ping timeout: 272 seconds)
01:11:21*apahl joined #nim
01:13:10*unihernandez22 joined #nim
01:20:57*Jjp137_ quit (Read error: Connection reset by peer)
01:21:14*Jjp137 joined #nim
01:22:17*unihernandez22 quit (Quit: Leaving)
01:22:30disrupteknice.
01:23:27disruptekdoes the api have timers?
01:24:54FromDiscord<flywind> Current not, because `httpbeast` doesn't need timer. When `ioselectors` is stable, I'm happy to contribute to `cps`.
01:25:23disruptekokay, i don't have a windows machine to test it. maybe i can build one, though.
01:25:58disrupteki was just curious because iirc it's one of the main issues for portability (without regard to performance).
01:26:17*unihernandez22 joined #nim
01:27:38FromDiscord<flywind> I am a newbie in system programming. But I will try to learn that. Thanks for tips. 😄
01:27:59disrupteki don't really know anything.
01:28:35disruptekwepoll looks pretty decent, though.
01:28:47disruptekit should work okay.
01:29:18disrupteki am hoping to use iouring in linux in any event, so to speak, so rest assured that cps will not depend on any particular event system.
01:30:02disruptekcps has a broader mandate towards providing a paradigm that just happens to be conducive to async design...
01:32:16FromDiscord<flywind> I am also working on `liburing`(rewrite in pure Nim), but doesn't have enough time to finish it.
01:32:46disrupteki only did a small amount, myself.
01:32:49disruptek!repo yourang
01:32:50disbothttps://github.com/disruptek/yourang -- 9yourang: 11Thread-safe performant async I/O for Linux 15 6⭐ 0🍴
01:34:07*unihernandez22 quit (Quit: Leaving)
01:36:40FromDiscord<flywind> BTW, there is also one person is working on a new async runtime. 😜
01:36:41FromDiscord<flywind> https://github.com/iocrate/netkit
01:37:38disruptekah, but that's async/await-based. very different.
01:37:54*unai joined #nim
01:37:55disruptekhow is your iouring interface going to work?
01:38:00*unai is now known as unihernandez22
01:38:34*unihernandez22 quit (Client Quit)
01:38:43*unihernandez22 joined #nim
01:39:34FromDiscord<flywind> I just rewrite c code to Nim based on `liburing`.
01:39:54FromDiscord<flywind> https://github.com/axboe/liburing
01:40:00disruptekbut will you provide a high-level interface?
01:43:17FromDiscord<flywind> Now I want to only supply similar interface like `liburing`.
01:43:26FromDiscord<flywind> ```nim↵proc io_uring_prepare_readv*(ring: var io_uring, index: int, fd: int, buf: IOVec, off: uint64) =↵ io_uring_prepare_base(ring, index, IOURING_OP_READV, fd, buf.iov_base, uint32(buf.iov_len), off)↵```
01:43:44disruptekgotcha.
02:03:17FromDiscord<Varriount> Hm, but uring doesn't work on Windows
02:04:11FromDiscord<Varriount> What kernel versions is it available in for Linux?
02:04:26disrupteki wanna say low 4+. 4.14 or something.
02:07:22disrupteki think i want testes to just echo each line of your code and highlight any assertions or exceptions.
02:07:48disruptekless like a test suite and more like a debugging aid.
02:21:39disruptekRunning 10s test @ http://localhost:8000
02:21:39disruptek 10 threads and 10 connections
02:21:39disruptek Thread Stats Avg Stdev Max +/- Stdev
02:21:40disruptek Latency 66.00us 9.94us 437.00us 92.19%
02:21:41disruptek Req/Sec 14.97k 329.88 15.29k 85.15%
02:21:42disruptek Latency Distribution
02:21:44disruptek 50% 69.00us
02:21:46disruptek 75% 71.00us
02:21:49disruptek 90% 74.00us
02:21:51disruptek 99% 103.00us
02:21:54disruptek 1504409 requests in 10.10s, 139.17MB read
02:21:56disruptekRequests/sec: 148963.27
02:21:59disruptekTransfer/sec: 13.78MB
02:22:01disruptekthis is zevv's lil server under cps. single-threaded.
02:27:46*hyiltiz quit (Quit: hyiltiz)
02:31:53FromDiscord<flywind> Wonderful!
02:46:20*audiofile quit (Quit: Default Quit Message)
02:53:40*maier joined #nim
02:56:51*waleee-cl quit (Quit: Connection closed for inactivity)
02:57:07*muffindrake quit (Ping timeout: 260 seconds)
02:58:32*maier quit (Ping timeout: 256 seconds)
02:59:00*muffindrake joined #nim
03:01:17FromGitter<iffy> What's the equivalent of Python's struct.{pack,unpack}? I'm trying to pack an int into a binary string and then read it out again
03:02:27FromDiscord<flywind> !repo struct
03:02:27disbothttps://github.com/OpenSystemsLab/struct.nim -- 9struct.nim: 11Python-like 'struct' for Nim 15 25⭐ 5🍴 7& 8 more...
03:03:51FromGitter<iffy> perfect, thank you!
03:04:01FromDiscord<flywind> np
03:10:53*apahl quit (Ping timeout: 272 seconds)
03:11:41*apahl joined #nim
03:17:02*rockcavera quit (Remote host closed the connection)
03:20:42*endragor joined #nim
03:29:25*vicfred quit (Quit: Leaving)
04:03:00*krux02_ quit (Remote host closed the connection)
04:03:19*unihernandez22 quit (Quit: Leaving)
04:03:33*unai joined #nim
04:03:58*unai is now known as Guest15123
04:04:11*unai_ joined #nim
04:04:39*unihernandez22 joined #nim
04:04:41*unai_ quit (Client Quit)
04:04:41*unihernandez22 quit (Remote host closed the connection)
04:04:41*Guest15123 quit (Client Quit)
04:04:52*unihernandez22 joined #nim
04:06:02*supakeen quit (Quit: WeeChat 2.8)
04:06:05*Kaivo quit (Ping timeout: 240 seconds)
04:06:43*supakeen joined #nim
04:08:17*unihernandez22 quit (Client Quit)
04:11:20FromDiscord<Varriount> Hm, I wonder if using generics to compose API traits would work.
04:12:51*unihernandez22 joined #nim
04:13:11FromDiscord<Varriount> `Buffered[Readable[Writable[FileStream]()`
04:13:18*hyiltiz joined #nim
04:13:18*hyiltiz quit (Changing host)
04:13:18*hyiltiz joined #nim
04:13:18*hyiltiz quit (Client Quit)
04:13:43FromDiscord<Varriount> Though, order would matter in that case
04:15:42*unihernandez22 quit (Client Quit)
04:16:31FromDiscord<Varriount> Anyone know of a language with an easy but efficient data stream model?
04:17:38*hyiltiz joined #nim
04:17:39*hyiltiz quit (Changing host)
04:17:39*hyiltiz joined #nim
04:41:31*Kaivo joined #nim
04:54:50*maier joined #nim
04:59:24*maier quit (Ping timeout: 265 seconds)
05:03:40*jhgalino joined #nim
05:05:02*jhgalino quit (Client Quit)
05:05:14*lritter joined #nim
05:08:28*vicfred joined #nim
05:09:43*vicfred quit (Client Quit)
05:23:19*maier joined #nim
05:25:52*Tlanger joined #nim
05:28:25*Tongir quit (Ping timeout: 264 seconds)
05:34:14*Kaivo quit (Ping timeout: 260 seconds)
05:52:39Zevvhaskell?
06:10:04*solitudesf joined #nim
06:18:45*narimiran joined #nim
06:34:53voltistIs there a nim library for downloading from FTP servers where one doesn't have to deal with async stuff?
06:35:27voltistOr is the async features in the standard library not too much hassle for this? I'm not particularly experienced with that kinda stuff in Nim
06:57:43ZevvYou can just take the async example and do the waitfor()
06:57:45*PMunch joined #nim
06:57:52Zevvunder the hood it does async, but in practice it will just block until done
06:57:56Zevvwould that work?
06:58:21Zevvit doesn't force you to leak async into the rest of your program
07:03:47voltistZevv: Yeah I'm trying that now
07:09:31voltistHmm, why would I be getting `Exception message: Expected reply '227' got: 530 Please login with USER and PASS` for a public ftp server?
07:11:53Oddmongerhello
07:12:10Oddmongerare "set" defined only as type ?
07:12:30Oddmongercan i do var a = set[int16] (obviously no)
07:13:00narimiranchange `=` to `:`
07:13:10Oddmongerah… oh… sorry
07:13:12Oddmongerthank you
07:24:38PMunchThat would define `a` as an empty set of type int16
07:24:50PMunchSo you could do a.incl(5.int16)
07:25:08euantorLooks like `devel` has a change to `asyncdispatch` that broke one of my libraries :(
07:25:46euantorhttps://github.com/euantorano/serial.nim/issues/44#issuecomment-669027454 - seems like an object was renamed that was exposed publicly. Probably going to break other stuff too
07:25:49disbotundeclared identifier: 'PCustomOverlapped' ; snippet at 12https://play.nim-lang.org/#ix=2tid
07:26:53euantorWill have to re-think the approach a bit today and see what I can do to resolve it
07:27:42narimiraneuantor: would `when (NimMajor, NimMinor) < (1, 3): oneThing; else: otherThing` help?
07:28:54PMunchWas it just a rename?
07:29:00euantornarimiran: possibly, but might be easier if I can just alter the library to use the file types from the stdlib, which should be possible so long as I can get the underlying handle/fd
07:29:20euantorYeah, a whole bunch of objects were renamed in a commit that doesn’t mention the rename :(
07:29:55euantorWas impossible to even find through GitHub search due to it not being mentioned in the commit message. Had to go through the history on the file to find it
07:30:10*Kaivo joined #nim
07:46:40voltistIs there a standard library proc that can parse scientific notation like "1.3e+04" into a float?
07:49:04PMunchparseFloat from strutils
07:49:09PMunchhttps://play.nim-lang.org/#ix=2tie
07:51:29voltistHmmm `Error: unhandled exception: invalid float: 1.3e+05 [ValueError]`
07:51:51voltistOh too big maybe?
07:52:43voltistYeah
07:54:06narimiranthere is `parseBiggestFloat` in parseutils
07:54:44narimiranhmmm, but `parseFloat` already calls it, so it shouldn't make a difference!?
07:56:57narimiranare you sure you're not having a whitespace after the last character?
07:57:12narimiranbecause `1.3e+05 [ValueError]` has two spaces there
07:57:44narimiranan i can trigger the same thing if i try to parse `1.3e+05 `
07:57:49narimiranvoltist: ^
08:05:25*Vladar joined #nim
08:09:03voltistSorry AFK
08:09:44voltistYeah twas a whitespace issue
08:26:29*oculuxe quit (Quit: blah)
08:26:47*oculux joined #nim
08:26:56*andinus quit (Remote host closed the connection)
08:32:32*ehmry joined #nim
08:37:05*NimBot joined #nim
08:48:21voltistThat feeling in your gut when you realize "I'm gonna have to use python for this"
08:48:43voltistI get it less now that I'm an avid Nim user, but it still happens
08:50:10FromDiscord<Varriount> voltist: You should see the Python DSL I wrote for Nimterop
08:50:41PMunchWhat do you have to resort to Python for now?
08:51:02PMunchOnly thing I've used Python for in the past couple of years has been as a scripting language for something that didn't accept anything else..
08:51:21PMunch(Until I wrote a PR that made it accept dynamic libraries so I could rewrite my code in Nim)
08:51:53PMunchAnyone know why this wasn't included in the latest release by the way? https://github.com/nim-lang/Nim/pull/14137
08:51:54disbotAdd RSA key reading and encrypt/decrypt to openssl
08:52:08voltistIt's not that there is any one thing I can't do, just that I'm doing some quick data processing that doesn't need to be fast (and Python has an excellent data science ecosystem as well :))
08:52:22voltistSo its just a major convenience
08:52:29PMunchAh
08:55:15FromDiscord<Varriount> PMunch: Primarily ease of subprocess launching
08:55:53FromDiscord<Varriount> https://github.com/Varriount/Nimterop-Deprocessor
08:56:23FromDiscord<Varriount> See my regex-powered monstrosity
08:57:33PMunchHmm, what am I looking at here?
08:58:13FromDiscord<Varriount> It's mainly a tool to help wrap the Windows SDK
08:58:14voltistAlthough, it would be more fun if I did it in Nim...
08:58:37FromDiscord<Varriount> PMunch: Which file?
09:09:11*waleee-cl joined #nim
09:12:21PMunchNo just in general :P I'm not sure why you sent that to me :P
09:12:49PMunchOr did you just reply to me with why you ended up using Python instead of Nim and then send the github link to voltist?
09:13:32FromDiscord<Varriount> I meant to show both of you
09:13:46FromDiscord<Varriount> *should have shown
09:23:33PMunchHmm, it would be cool if the new-tab page of browsers could be set to a local HTML file that had access to some special JS API to get information about your browser
09:23:47PMunchSo that you could create a custom start page with recently closed tabs, bookmarks, etc.
09:34:00PMunchHmm, it seems to be doable in FF at least with a pretty minimal addon
09:40:58shashlick@varriount you need to explain this at some point
09:46:56FromDiscord<Varriount> @shashlick Why I'm using it?
09:47:03FromDiscord<Varriount> Or how it works?
09:51:13FromDiscord<Varriount> shashlick: My biggest reason for using it is that I need to perform regex replacements on header files before they are processed, and want to run Nimterop in parallel
10:10:22*andinus joined #nim
10:10:37*Trustable joined #nim
10:31:39*Trustable quit (Remote host closed the connection)
10:32:39FromDiscord<Ricky Spanish> is there a difference between ```{.push,exportc,dynlib.}``` and ```{.stdcall,exportc,dynlib.}``` because nim seems to have a seizure with the latter even though iv found multiple examples doing it
10:34:00FromDiscord<Ricky Spanish> or lemme ask in a different way, what does .push actually do
10:34:27FromDiscord<Rika> one applies exportc and dynlib to everything below it before a pop↵and the other only works when its beside a proc signature
10:34:47FromDiscord<Rika> push pushes the pragmas onto a "stack" which then applies the pragmas to everything below it
10:34:53FromDiscord<Rika> should be on the manual actually
10:35:16FromDiscord<Ricky Spanish> aaah ok thanks so much for explaining @Rika
10:36:24PMunchhttps://nim-lang.org/docs/manual.html#pragmas-push-and-pop-pragmas
10:36:41voltistDoes anyone know if it's possible to embed a web page in NiGui? Like some sort of embedded browser?
10:37:02FromDiscord<Rika> that is complex
10:37:17FromDiscord<Rika> you'd need to actually embed a browser as you say
10:38:01FromDiscord<Rika> then somehow render the output onto your window (i dont know how it would exactly work)
10:39:11voltistYeah
10:44:20PMunchIt shouldn't be impossible I think..
10:44:53PMunchNot quite sure how you'd do the browser <-> nigui bridging though..
10:49:13voltistProblem might be making it cross-platform
10:55:26PMunchHmm, I think embedded Chromium should be cross platform
10:55:49PMunchOr Gecko for that matter, but I'm not sure if that has bindings for Nim
10:55:54PMunchYou could also try Sciter
10:56:01PMunchDepends on what you actually want to show
11:09:53FromDiscord<Clyybber> servo would probably be a good choice
11:19:02FromDiscord<Yardanico> Sciter is not really about real web pages though
11:19:22FromDiscord<Yardanico> It's their own HTML + CSS + TiScript engine
11:20:30PMunchWhich is why I said "depends on what you actually want to show" ;)
11:20:47PMunchIf he just wanted to create a more complex UI component using HTML then it could work
11:25:22*narimiran quit (Ping timeout: 246 seconds)
11:29:57*narimiran joined #nim
11:31:06Oddmongercome on, no Nim on https://benchmarksgame-team.pages.debian.net/benchmarksgame/index.html
11:38:14*Vladar quit (Quit: Leaving)
11:38:38FromDiscord<kodkuce> @treeform your ws has no exposed ws headers right, there is that TODO, https://github.com/treeform/ws/blob/master/src/ws.nim 142.. i want to add authorization token to reqest, so only way to do is to hack this right
11:56:19*waleee-cl quit (Quit: Connection closed for inactivity)
11:59:33*audiofile joined #nim
12:00:18FromDiscord<kodkuce> hmm and 1 wierd thing, if no req hader i return 404 code and dont even build ws but your client for some reason says its open xD
12:04:15*rockcavera joined #nim
12:05:17*krux02 joined #nim
12:06:02*supakeen quit (Quit: WeeChat 2.8)
12:06:39*supakeen joined #nim
12:06:46*abm joined #nim
12:10:05*vicfred joined #nim
12:19:22FromDiscord<kodkuce> @treeform https://pastebin.com/xZWrrGuq
12:26:01dom96Oddmonger, I don't know if the author of that changed their mind, but they were pretty against Crystal/Nim being included not too long ago: https://web.archive.org/web/20170316004217/http://benchmarksgame.alioth.debian.org/play.html
12:27:15FromDiscord<kodkuce> am i retarded or what if ws connection fails should it default to http response or what?
12:27:28*mbuchel quit (Ping timeout: 256 seconds)
12:29:13*mbuchel joined #nim
12:40:54Oddmongerdom96: ok
12:41:00*FromDiscord quit (Remote host closed the connection)
12:41:17*FromDiscord joined #nim
12:44:24FromDiscord<Ricky Spanish> @kodkuce doesent the ws implementation provide defaults for connection failures during the initiali http handshake with the server?
12:49:26FromDiscord<kodkuce> it rasises soem exeptions form what i see it does not default to read normal HTTP resonse "raise newException(WebSocketError, ...."
13:22:32*dulsi_ joined #nim
13:25:04*dulsi quit (Ping timeout: 246 seconds)
13:28:42FromDiscord<Zachary Carter> Voltist maybe checkout webview
13:30:31FromDiscord<Zachary Carter> https://github.com/webview/webview
13:39:51*dulsi_ is now known as dulsi
13:50:32*rockcavera quit (Remote host closed the connection)
13:51:09FromDiscord<Zachary Carter> dom96: It looks like Julia was mentioned in that blurb but now is on the benchmark game
13:52:05FromGitter<iffy> What would be a good way to read from one File (at an offset) and write to another (at an offset)? File.readX procs all expect non-file things. Am I stuck reading into memory first?
13:52:32FromDiscord<Zachary Carter> streams?
13:52:55FromDiscord<Zachary Carter> you can `setPosition` and `getPosition`
13:53:07FromDiscord<Zachary Carter> https://nim-lang.org/docs/streams.html#getPosition%2CStream
13:54:15FromGitter<iffy> @zacharycarter I'm not seeing a proc that will read from one stream and write directly to another stream
13:54:51FromGitter<iffy> I guess just `dst.write(src.read())`?
13:55:56FromGitter<iffy> err... there is no `proc read()` which returns a string (that isn't the whole file)
13:56:55FromDiscord<arnetheduck> so what's with the new stale bot? I spend time on creating minimized test cases for issues that I run across - they're still not fixed, and now a bot closes them?
13:58:09FromDiscord<mratsim> https://github.com/nim-lang/Nim/issues/15159
13:58:09disbot[RFC] Stale bot
13:58:11dom96The bot pings issues to make sure they are still relevant
13:58:28dom96it doesn't close them unless you (or someone else) doesn't respond
13:59:21*Vladar joined #nim
14:01:52FromDiscord<Clyybber> Almost everybody is against it, for ovious reasons
14:07:01*PMunch quit (Quit: Leaving)
14:13:13*schurig joined #nim
14:14:36schurigin a proc, can I dynamically allocate an array (e.g. for a height map) process and return it? All I saw was to make use seq.add(), but I want to access arbitrary elements
14:19:54shashlickWhat's the fastest sha512 implementation
14:23:33FromDiscord<Rika> schurig: newSeq[T](size)
14:26:52FromDiscord<Zachary Carter> iffy: well you have to know how much data you want to read
14:26:56FromDiscord<Zachary Carter> and write
14:27:11FromDiscord<Zachary Carter> no it won't be as simple as `dst.write(src.read())`
14:35:04schurigRika: thanks, worked
14:35:04*Guest39052 quit (Ping timeout: 246 seconds)
14:35:46*vicfred quit (Quit: Leaving)
14:39:42FromDiscord<Zachary Carter> Who developed the stale bot and let it loose?
14:40:01FromDiscord<Rika> you mean who let it loose
14:40:54FromDiscord<Zachary Carter> well I'm curious to know answers to both questions
14:41:06FromDiscord<kodkuce> i just now figured out that var mystuff is same as my_stuff
14:41:20FromDiscord<kodkuce> dident know you can put _ in var name
14:41:22FromDiscord<Zachary Carter> and var myStuff
14:41:56FromDiscord<Rika> but not Mystuff
14:42:13FromDiscord<kodkuce> and no _mystuff
14:43:16FromDiscord<Zachary Carter> ah narimiran did it
14:43:42FromDiscord<Rika> _mystuff is impossible; leading or trailing underscores are not allowed
14:43:53FromDiscord<Rika> while Mystuff is still allowed, just not equal to mystuff
14:47:06*dadada joined #nim
14:47:31*dadada is now known as Guest10225
14:51:25FromDiscord<Zachary Carter> Someone should write a bot to iterate through all the issues that are marked stale and leave a comment
14:51:27FromDiscord<Zachary Carter> robot wars
14:53:14disruptekno point.
14:54:05disruptekvarriount: see concepts.
14:54:24FromDiscord<Zachary Carter> I mean I would counter with there's no point of having a stale bot
14:54:25FromDiscord<Zachary Carter> but...
14:54:26disruptekoh i'm way, way far back in scroll. 🤣
14:55:08disrupteki don't get enough email these days, so it's nice to hear from stale[bot].
14:57:01FromDiscord<Zachary Carter> I'll email you
14:57:04FromDiscord<Zachary Carter> dick picks
14:57:08FromDiscord<Zachary Carter> (edit) 'picks' => 'pics'
14:57:21FromDiscord<Zachary Carter> but that's it
14:57:58disruptekbeggars can't be choosers.
14:59:32dom96I'm honestly amazed by the push back.
15:00:41Yardanicobecause many people (including me) don't see advantages of the stalebot in the context of nim repo :)
15:00:42narimirandom96: i guess it is only three of us for it, against the whole world against it
15:02:31FromDiscord<kodkuce> what is stalebot?
15:02:43narimiranit is modern day hitler
15:02:49Yardanicoa bot which marks old issues (which didn't have activity for a long time) as "stale"
15:02:52dom96I think this is a classic case of being naturally against something that you are not familiar with.
15:02:58Yardanicoand then if still no one replies it's closed
15:03:05Yardanicodom96: yeah, sure, let's just forget about old issues, who needs them
15:03:12Yardanicoas we discussed yesterday, we just need to close all issues older than 1 day
15:03:46dom96Not every "issue" is a relevant issue, some are not even issues!
15:03:47Yardanicomost of old nim issues are still not solved
15:03:52Yardanicodom96: most of them are
15:03:54FromDiscord<Zachary Carter> what's there to get familiar with?
15:04:05FromDiscord<Zachary Carter> well just arbitrarily closing old issues doesn't solve that problem
15:04:11dom96It's not arbitrary
15:04:20FromDiscord<Zachary Carter> it is if people don't leave a comment
15:04:25dom96so leave a comment
15:04:30dom96if you care about an issue leave a comment
15:04:32FromDiscord<Zachary Carter> not everyone is going to though
15:04:33dom96I don't see the problem here
15:04:35Yardanicoit's not about "caring"
15:04:44dom96so if nobody does then why should we keep these issues open?
15:04:45Yardanicowe shouldn't just "forget" about issues even if the original poster doesn't use nim anymore
15:04:48dom96obviously nobody cares about them
15:04:51Yardanicodom96: because they're still valid issues
15:05:01FromDiscord<Zachary Carter> there are people that opened issues that are relevant that aren't active community members anymore
15:05:26YardanicoI don't understand why do you not like old issues so much
15:05:35Yardanicothey don't make the repo worse
15:05:57dom96I don't dislike old issues
15:06:00FromDiscord<Zachary Carter> I don't think lemonboy is going to suddenly reappear and be like - oh I care about these issues now because of stale bot
15:06:01dom96In fact the very opposite
15:06:07dom96I want to be reminded of all these old issues
15:06:14dom96I want others to be reminded too
15:06:17disruptekthen visit the repo some time.
15:06:38Yardanicoyeah, so we just mark them as stale and close because we want to be reminded of them
15:06:52Yardanicoeven if it's already solved, you still need a test-case so it doesn't break in the future
15:06:53disruptekmany, many people put effort in to enumerate nim's shortcomings.
15:07:57YardanicoI guess you all already saw https://github.com/nim-lang/Nim/issues/15159 :)
15:07:58disbot[RFC] Stale bot
15:08:01disrupteki think it would make more sense to close issues that don't have a test case we can monitor with software.
15:08:30disruptekif it's a discussion, it belongs in the rfc repo.
15:08:38Yardanicothis is directly related to the nim _repo_ though
15:09:01narimirandisruptek: agree about don't having a test case, or having one which you can only replicate if you use special custom made switches
15:09:11Yardanicohehe
15:09:30Yardanicowell in my issues the first test case I make is usually the one which fails :)
15:09:34disrupteki still want to finish my tool that builds a test suite from issues.
15:09:35Yardanicobut I don't have many issues outside of ARC
15:09:36narimirani had so many false negatives, until i've gone through the code and noticed `when declared(someShit)`
15:09:52narimiranor `when defined`, i always confuse the two
15:10:08Yardanicoyeah timo's issues are not easy for me to understand quite often
15:10:22narimiran...to put it mildtly
15:10:26narimiran*mildly
15:11:00narimiranif we cannot run `tissue` on your issue to reproduce what you've reported — adios
15:11:21dom96sounds fair
15:12:19FromDiscord<treeform> @kodkuce Yeah it should not say open when it 404s, ill take a look.
15:13:33*vicfred joined #nim
15:15:43disrupteki'm getting to where i have too many arc blockers to make progress on projects.
15:17:28narimiranso, how do we proceed with some issue-closing bot for issues that don't have a code block with a reproducible bug? because there are some valid issues without it too
15:18:20disruptekfor one thing, it would make much more sense to have the template indicate this behavior so that new users have the right expectation set.
15:18:22narimiranwhat about stale PRs? do we want to ask the author to rebase it on the latest devel?
15:18:39disruptekthen, we only enact the bot on issues created since, say, august 1st.
15:18:57disruptekit's hard to consider PRs that aren't rebased.
15:18:58Yardanicowell yeah, I agree about PRs a bit
15:19:02Yardanicowe have quite a lot of staled once
15:19:04Yardanicoones*
15:19:54Yardanicoalso btw about https://github.com/nim-lang/Nim/pull/10781
15:19:55disbotdefault to threads:on (#9878)
15:20:00Yardanicothere apparently was an accepted RFC about this
15:20:12Yardanicohttps://github.com/nim-lang/Nim/issues/9878
15:20:13disbot[RFC] switch threads to on by default
15:20:24Yardanicoit's accepted for 1.5 years without progress :)
15:22:28dom96It's okay, let me reject it now :P
15:22:36Yardanicowhy
15:22:38Yardanicoit's a good idea :)
15:22:59*Vladar quit (Quit: Leaving)
15:23:00Yardanicobut it should be moved to RFCs repo
15:23:59FromDiscord<treeform> @kodkuce I have added a 404 test to ws, can you show me how your case differs? https://github.com/treeform/ws/blob/master/tests/test_404.nim
15:26:04FromDiscord<kodkuce> yo sec
15:30:14*ForumUpdaterBot quit (Remote host closed the connection)
15:30:21*ForumUpdaterBot joined #nim
15:31:49FromDiscord<kodkuce> ok am b
15:34:20FromDiscord<treeform> Also sorry I don't think I will be merging your HTTP headers PR because well Browser HTML5 API does not support it.
15:36:24FromDiscord<treeform> But I am interested in a reproducible case for your other bug.
15:36:44*lritter quit (Ping timeout: 256 seconds)
15:38:59FromDiscord<kodkuce> sent a long message, see http://ix.io/2tjY
15:39:46*arecacea1 quit (Read error: Connection reset by peer)
15:40:42FromDiscord<kodkuce> about my PR hmm, i am no network expert or whatewer but is it not the point of using jwt tokens for autorization, so i wanted to prevent ws connection even establishing if no token, ofc plan to use https ?
15:41:37*arecacea1 joined #nim
15:42:07FromDiscord<kodkuce> @treeform what cookies has to do with anything?
15:42:26shashlickdisruptek: tissue can create tests out of issues
15:43:39FromDiscord<treeform> @kodkuce setting cookis is a known way to set a single websocket header. There are no other ways it looks like.
15:45:29FromDiscord<treeform> if you want to set headers from HTML5 API that's the only one you can.
15:45:31FromDiscord<kodkuce> hmm duno if i am too dumb or what but isent header sent with HTTP request itself
15:46:04FromDiscord<treeform> yeah but you are not allowed to add your own HTTP headers ... its not in the spec.
15:46:22FromDiscord<treeform> the only one browsers do is cookies
15:46:41FromDiscord<kodkuce> hmm then how you add jwt tokens to http requests if not in header?
15:47:35FromDiscord<treeform> you don't use http headers to pass the jwt token to a websocket...
15:47:47FromDiscord<treeform> you pass it in like a jwt packet after you connected
15:47:53FromDiscord<treeform> if you want to use jwt
15:48:27FromDiscord<dom96> Isn't the typical flow that it gets passed via a Set-Cookie header?
15:48:41FromDiscord<treeform> To a websocket? I don't think so.
15:49:24FromDiscord<kodkuce> hmm isent a websocket just a http request that gets upgraded, so i am doing http request and pass jwt in header, if jwt is not good i newer upgrade socket so its not an websocket connection ?
15:49:56FromDiscord<treeform> yes but passing jwt header is not allowed, there isn't an API for it.
15:50:17FromDiscord<treeform> you had to PR an API to set header for my library `ws`
15:50:22FromDiscord<treeform> but you can't PR every browser to add that?
15:50:28FromDiscord<dom96> You can pass headers when the ws connection is established
15:50:34FromDiscord<treeform> No you can't
15:50:37FromDiscord<dom96> Why not?
15:50:38FromDiscord<treeform> how me
15:50:40FromDiscord<treeform> (edit) 'how' => 'show'
15:51:09FromDiscord<treeform> Show me in Chrome or Firefox how you would do that.
15:51:53FromDiscord<dom96> Doesn't the browser pass cookies implicitly in the HTTP request it makes when connecting via WS?
15:52:04FromDiscord<kodkuce> hmm w8 , so if i am not doing an websockt connection, emample am doing just an normal Get request i am allowed to put jwt in header , but if i do it for WS i am not, is that what you saying?
15:52:06FromDiscord<treeform> yes the only way to pass it is via cookies that is correct
15:52:07*dddddd quit (Remote host closed the connection)
15:52:36FromDiscord<treeform> @kodkuce yeah that's what I am saying. I don't like it. But that's how it is.
15:53:31FromDiscord<kodkuce> ok q number 2, what bad stuff will heppend to me in i do 🙂
15:53:32FromDiscord<treeform> This is how normal people to the JWT with websocket: https://gist.github.com/jfromaniello/8418116#gistcomment-2245753
15:53:58FromDiscord<treeform> The just create their own "authenticate" packet and go on from there.
15:54:11FromDiscord<treeform> You can call it "login", "auth" etc... up to you
15:54:31disrupteknormal people sure are creepy.
15:54:54FromDiscord<kodkuce> hmm cuz atm am passing it in header and it all works
15:55:20FromDiscord<treeform> Can you show me how you would do that from the browser?
15:56:00FromDiscord<treeform> I am making a WebSocket API, not some WebSocket+Header API.
15:56:45FromDiscord<dom96> I don't know how ws' API looks like, but I would assume that you have access to the raw HTTP request before you call ws' code
15:57:01FromDiscord<dom96> so ws doesn't need to care about any extra headers at all
15:57:03FromDiscord<treeform> What I don't want people todo, is make rely on headers, then say "hey" my server supports websockets, but it doesn not, because no browser can use it because it can't set headers.
15:57:52FromDiscord<kodkuce> oh meybe you right
15:57:53FromDiscord<treeform> @dom96 only on the server side, on the client side I don't expose access to headers because browser don't expose access to headers.
15:58:20FromDiscord<treeform> Well except the cookie header... that you can set.
15:58:23FromDiscord<kodkuce> sec i was testing whole time in godot editor did not build for browser
15:58:34FromDiscord<dom96> oh, I'm not thinking at all about the client
15:58:48disrupteksituation normal, then.
15:58:50FromDiscord<treeform> this conversion was all about the client
15:59:08FromDiscord<treeform> on the server side you can do whatever you want.
16:06:05*dddddd joined #nim
16:07:22*maier quit (Ping timeout: 265 seconds)
16:09:22FromDiscord<kodkuce> yep i think you are right, i was whole time testing vie godot but not in browser and it worked, but when build for browser from what i see my header gets striped away
16:09:40FromDiscord<kodkuce> https://media.discordapp.net/attachments/371759389889003532/740602431565725816/2020-08-05_180648.png
16:09:43FromDiscord<kodkuce> 😦
16:09:56FromDiscord<kodkuce> no tocker from what isee
16:10:32disruptekmy great grandfather got his tocker shot off in the war.
16:11:51FromDiscord<kodkuce> wtf
16:12:37disrupteki hear that a lot.
16:19:22Zevvdisruptek: Arak told me to keep an eye on you during his absence. I'm watching you.
16:19:33disruptekwut
16:19:34ZevvNo scaring the visitors
16:20:03disrupteki'm not scary.
16:20:12ZevvBe nice. Be polite. Be well-manared
16:20:13Yardanicoyou can be
16:20:15Yardanicoto new people :)
16:20:16disruptekdo you wanna see a picture of my great-grandfather's tocker?
16:20:25Zevvbefore or after the incident?
16:20:52disruptekhow could i take a picture before?
16:20:59disrupteki was holding a rifle.
16:21:02FromDiscord<treeform> Trying to debug this odd --gc:arc and {.threadvar.} but... It just segfaults trying to add to a table for the first time. Any one know which commit could have caused it?
16:21:10Yardanicogive me a snippet
16:21:14YardanicoI'll find it for you
16:21:36FromDiscord<treeform> I can't distill it to a snippet. It does not happen in a small code base.
16:21:47FromDiscord<treeform> Well I can try.
16:21:52disruptektreeform: try manual init the table, i guess.
16:22:06disrupteki don't have this problem with eventqueue in cps.
16:22:19disrupteki have other problems...
16:22:36disruptekZevv: we really need this arc thing fixed.
16:22:37FromDiscord<treeform> I know that Jun2's commit 4301a3da9d333de88cf01cd952760716e8117bfa, after that its broken.
16:23:00FromDiscord<treeform> its a recent breakage in the last 2 months.
16:23:11Yardanicotry before/after the optimizer PR
16:23:18Zevvdisruptek: you hold clyybber
16:23:29Yardanico@treeform try before https://github.com/nim-lang/Nim/pull/14962
16:23:31disbotAn optimizer for ARC
16:23:57Zevvwhile I talk to him, persuasively
16:24:04disrupteki'm minimizing an inheritance bug with exceptions in macros.
16:24:12disruptekworks in cpp, not in c.
16:25:09FromDiscord<treeform> @Yardanico I'll try it.
16:25:28Yardanicoalso you can patch 1 line in the compiler
16:25:34Yardanicoto see if it's a cursor inference fault
16:25:39FromDiscord<kodkuce> @treeform https://pastebin.com/hmN04x2R
16:25:54FromDiscord<kodkuce> here this confused me, duno if this is bug or i am traded
16:25:56disruptekZevv: how does 0.0.13 look?
16:26:12Yardanico@treeform line 1005 in injectdestructors.nim
16:26:16YardanicocomputeCursors
16:26:25Yardanicoif you comment that one and your code works - it's a cursor inference bug
16:26:39YardanicoI'm talking about latest devel of course
16:26:53Zevvdisruptek: works for my as far as I tested
16:27:05ZevvIf I found the courage I will continue growing tzevv
16:27:19disruptekAIIEIEEE
16:27:35disrupteki need to make my testes bigger.
16:27:44disrupteki mean, better.
16:28:15Zevvwhat's with the mutant thingy, is that something you want to keep?
16:28:57disrupteki want to be able to operate on values.
16:29:11disruptekmaybe it's a stupid idea. it doesn't work yet, anyway.
16:29:16Zevvah ok
16:30:53Zevvso, one optimization we need to make
16:30:56Zevvis not cps's non-cps blocks
16:31:07disruptekyeah, i know.
16:31:18FromDiscord<treeform> is there a way to choosenim my location (the git checkout of nim)?
16:31:27disruptekit's probably one line of code, if you wanna tackle it.
16:31:28Yardanicoi think there is but I don't use it
16:32:01Zevvdisruptek: I don't dare to admit it. But I really didn't spend enought time grokking your code yet.
16:32:05disruptekfork gitnim.
16:32:24disruptekthe code is crap. but it's useful because it passes tests.
16:33:11Zevvright. anyway, in the original xfrms were only done if `isCpsBlock` agreed. Does that still hold?
16:33:20FromDiscord<treeform> compiling nim takes soo long
16:33:27Yardaniconot really :P
16:33:32Yardanico./koch temp is pretty fast
16:33:37disruptekprobably not, because it's a little more complex than that.
16:33:37Yardanicobecause it uses -d:leanCompiler
16:33:38Zevvtreeform: not for me. Are you compilking nim with a debug compiler maybe?
16:33:42FromDiscord<treeform> I guess I am doing build_all
16:33:47Yardanicothat's unneccessary
16:34:03disruptek~gitnim
16:34:04disbotgitnim: 11https://gitnim.com/ -- choosenim for choosey nimions -- disruptek
16:34:04Zevvthat builds from c sources and builds again and again to make sure the 2nd build matches the 3d build
16:34:06Yardanicoit rebuilds nim from csources and then builds new nim with that and builds new nim with new nim
16:34:08Zevvit's doing all the bootstrap
16:34:13Yardanicosame as ./koch danger
16:34:19Yardanico./koch boot I mean
16:34:30Yardanicoif you just want to test a change in the compiler, ./koch temp is what you should use usually
16:34:39FromDiscord<treeform> what should I run instead?
16:34:42Yardanico./koch temp
16:34:44Zevv./koch temp
16:34:49Yardanicoe.g.
16:34:53Zevvok, I'll shut up, there's echo on the line
16:34:55FromDiscord<treeform> looks like its working
16:34:57disrupteklol
16:34:59Yardanico./koch temp c -r file.nim
16:35:22YardanicoZevv: you sent yours two seconds after me :P
16:35:42Zevvtime is relative on IRC. It's a distributed network
16:35:48Yardanicoi know
16:35:51Yardanicobut two seconds
16:35:53Zevvso messages don't necesserliy come in order
16:36:11Zevvand https://en.wikipedia.org/wiki/Pre-echo
16:36:17Yardanicolol
16:36:39Zevvit's due to quantization noise being spread over the entire transform-window of the IRC codec
16:36:44Yardanicomhm
16:36:51disruptekZevv: inside a non-cps block you have to handle returns, named breaks, and other calls which might change control flow. so "non-cps block" is a misnomer much of the time.
16:36:53FromDiscord<kodkuce> @treeform did you check pastebin?
16:36:56ZevvI like good explanations. Did I ever show http://zevv.nl/bug-a-day/ ?
16:37:25Zevvdisruptek: no, but if I have a while that just whiles over some locals while not doing CPS things, I don't want that while transformed
16:37:27FromDiscord<treeform> @kodkuce yes, but focused on this arc issue now
16:37:29dom96> is there a way to choosenim my location (the git checkout of nim)?
16:37:31dom96yes
16:37:38dom96choosenim ~/path/to/nim
16:37:40disruptekZevv: good, yes, yes, good.
16:38:13disruptekso many bugs.
16:38:19Zevv*so* *many* *bugs*
16:38:25Zevvand I love each and every one of them
16:38:38Zevv"
16:38:43ZevvSerious Syntax Problem Bug"
16:38:48Zevvwho makes up such a thing
16:38:55FromDiscord<treeform> @dom96 thanks!
16:39:07Zevv"Temporary Topology Condition"
16:39:19disrupteki like this termtosvg but i dislike that it removes all my emojis.
16:39:31Yardanicothat's good
16:39:35Yardanicoyou use too much emojis :P
16:39:39Yardanicoin source code
16:39:46disruptekemojis are great.
16:40:25FromDiscord<treeform> @Yardanico commenting out `#computeCursors(owner, n, g.config)` did not work 😦
16:40:34Yardanicowell then it's not so simple :)
16:40:51Yardanicotry before/after the optimizer PR, but really try to run git bisect
16:40:56Yardanico./koch temp supports git bisect run btw
16:41:34Yardanicoyou have to make sure that when your stuff works it completes with 0 exit code though
16:41:51Yardanicogit bisect start; git bisect good goodcommit; git bisect bad devel; git bisect run ./koch temp c --gc:arc blablabla file.nim
16:42:06FromDiscord<treeform> yeah that does not work for me
16:42:09Yardanicowhy?
16:42:14FromDiscord<treeform> dome DLL issue
16:42:20Yardanico?
16:44:02FromDiscord<Varriount> I don't see how a DLL issue would happen, unless there's some commit that changes DLL loading behavior
16:44:08FromDiscord<treeform> https://gist.github.com/treeform/0c9c57acd2322a7003093d5c2332dec2
16:44:22FromDiscord<treeform> ok "lib" issue
16:44:41FromDiscord<treeform> I think both koch and my thing wants to be in a spesific path
16:44:44Yardanicoyeah
16:44:51Yardanicokoch expects to run in nim repo as cwd I think :)
16:45:05FromDiscord<treeform> my thing expects to run in its own repo as cwd
16:45:21FromDiscord<treeform> I could fix my thing
16:45:23FromDiscord<treeform> fix on a fix
16:45:30FromDiscord<Varriount> Merge the directories?
16:45:41FromDiscord<kodkuce> @treeform ok np 🙂
16:45:55FromDiscord<Varriount> If they don't share any file/subdirectory names
16:46:02Yardanicobtw, anyone has experience with wikipedia table editing?
16:46:21YardanicoI want to fix the version table in https://en.wikipedia.org/wiki/Nim_(programming_language), add last 1.0.8 release and mark it as LTS
16:46:33FromDiscord<Varriount> Yardanico: A tiny amount. It's reminiscent of markdown tables
16:47:02FromDiscord<Varriount> There should be a reference on Wikipedia
16:49:31FromDiscord<treeform> ok I fixed my thing
16:49:38FromDiscord<treeform> it cd to my folder after starting
16:50:03FromDiscord<treeform> I should make my thing quit with quit(0) after N seconds?
16:50:10FromDiscord<treeform> to use git bisect
16:50:18Yardanicowell yes
16:50:26Yardanico"Note that the script (my_script in the above example) should exit with code 0 if the current source code is good/old, and exit with a code between 1 and 127 (inclusive), except 125, if the current source code is bad/new."
16:52:53Yardanicohttps://git-scm.com/docs/git-bisect#_bisect_run
16:53:10FromDiscord<treeform> I think with the koch tmp trick I can manually bisect and get to ti faster
16:53:23Yardanico??
16:53:24FromDiscord<treeform> now that it does not take 10 minutes to switch to a commit
16:53:34Yardanicogit bisect run is the same as manual
16:53:36Yardanicoit's just more automated
16:53:46Yardanicobtw I usually build old nim first
16:53:47Yardanicobefore bisecting
16:53:50FromDiscord<treeform> but I don't know when to quit
16:54:00Yardanicobecause otherwise you can get all sorts of weird bootstrapping issues
16:54:07Yardanicoso I build csources and then start bisecting
16:54:29FromDiscord<treeform> Ok puzzle time,
16:54:33FromDiscord<treeform> 4301a3da9d333de88cf01cd952760716e8117bfa from choosnim works
16:54:36FromDiscord<treeform> 4301a3da9d333de88cf01cd952760716e8117bfa from github
16:54:37FromDiscord<treeform> does not
16:54:47Yardanicoas in?
16:55:00FromDiscord<treeform> I get `C:\Users\me\nimcache\earthsea_r\stdlib_io.nim.cpp(237): error C2664: 'BOOL SetHandleInformation(HANDLE,DWORD,DWORD)': cannot convert argument 1 from 'int' to 'HANDLE'` now
16:55:11Yardanicoyeah as I said
16:55:20Yardanicowell first of all it might be a vcc bug from an older nim version lol
16:55:26YardanicoI only tested on linux :)
16:55:38FromDiscord<treeform> I think I need to take a break
16:55:49FromDiscord<treeform> Maybe I should just not use --gc arc
16:55:53FromDiscord<treeform> just stick with refc it works well
16:56:02Yardanicojust wait until 1.4 :)
16:56:10Yardanicobut it would be nice if you would help with bug reports
16:56:23FromDiscord<treeform> Simple example works
16:56:24Yardanicodo you have the code open?
16:56:27FromDiscord<treeform> my complex thing does not
16:56:28Yardanicowhich triggers that bug
16:56:32Yardanicoor is it closed
16:56:37FromDiscord<treeform> nope its for company
16:56:40Yardanicooh
16:57:58FromDiscord<treeform> be back later
16:58:07FromDiscord<treeform> with more confusion!
16:59:22*superbia2 joined #nim
17:02:01*superbia1 quit (Ping timeout: 264 seconds)
17:02:57*abm quit (Read error: Connection reset by peer)
17:06:46ForumUpdaterBotNew thread by Adilh: How to get access to chunks of data downloaded from http server using httpclient, see https://forum.nim-lang.org/t/6641
17:21:18FromDiscord<Varriount> @treeform Handle should be the size of a pointer. I think there was an incorrect wrapping in system that treated it as 32 bit for a while though
17:21:58FromDiscord<Varriount> I recall approving and merging a PR that fixed the issue in system.nim
17:22:08Yardanicoyes, but he used git bisect
17:22:11Yardanicoolder commits
17:22:50FromDiscord<Recruit_main707> can you pass a for/while loop to a macro? (possibly as a pragma)
17:23:02Yardanicothere are for loop macros as an experimental feature
17:23:12Yardanicoallows a macro to fully rewrite the full loopo
17:23:18YardanicoI think they're in 1.2.x too, but not documented
17:23:20Yardanicodocumented in devel though
17:23:29Yardanicobut if you want to pass the whole loop, you of course can
17:23:33Yardanicomymacro: for x in ...: stuff
17:23:52FromDiscord<Recruit_main707> not as pragma righ?
17:23:55Yardanicono
17:24:39Yardanicohttps://nim-lang.github.io/Nim/manual_experimental.html#case-statement-macros-for-loop-macros
17:29:11FromDiscord<Recruit_main707> i would have liked that, i guess it will do
17:29:19Yardanicoit should work in latest 1.2.x too
17:29:20YardanicoI think
17:29:26Yardanicoit just wasn't documented there
17:35:26Zevvhey disruptek
17:36:40disrupteksup
17:36:53Zevvwas generics something that works yet?
17:37:01Zevvor was that just philosiphically speaking
17:37:23disruptekworks somewhere, not sure it's in master.
17:37:39Zevvah right
17:37:53Zevvwas trying http://ix.io/2tkp
17:37:53disruptekwhat are you trying to do, generically speaking?
17:38:10Zevvthat's the stash/iterator.nim, but then genericalized
17:38:19disruptekwhat happens?
17:38:52Zevvmost of the stuff is ok, but in the end a compiler error about undeclared T
17:39:00Zevvat a line where it does not make sense to me yet
17:39:10Zevvat the `proc counter[T]`
17:39:24Zevvxform looks pretty much ok
17:39:29disrupteki guess this isn't in head?
17:40:09Zevvnot yet, want me to check it in?
17:40:30disrupteki dl'd it. hmm, i don't think this could ever work.
17:40:35Zevvpushed, iteratorT.nim
17:40:49ZevvI think it's almost there
17:40:54disruptekuse : Iterator[T] syntax.
17:41:07disruptekit cannot "solve" the sigmatch without it.
17:41:25disruptekie. pragmas don't know about generics afaik.
17:41:35Zevvyou'd be surprised
17:41:40*Vladar joined #nim
17:41:43disrupteki guess so.
17:41:46Zevvxfrm repr looks just fine, anyway
17:42:53disruptekit might /look/ fine.
17:43:24disruptekmaybe this is a bug in cps that we can fix.
17:45:31disruptekare generics simple `bracketExpr`s? i don't even know.
17:45:47disruptekwhat does the chain demo produce?
17:45:58Zevvi don't know what that is
17:46:06disruptekit's in experiments.
17:46:28Zevvit says hello HELLO
17:46:33disruptekgenerics + concepts + experimental operators = chain cps
17:46:46Zevvoow
17:47:02Zevvright, that chain.nim
17:47:08disruptekit lets you mutate values with arbitrary fns.
17:47:46Zevvanyway, just trying stuff, nevermind me
17:48:16disruptekchain is something i hope you'll look at. i would ignore the rest of the codebase, honestly.
17:48:45disruptekvar c: Foo; var upper = "hello" -> c -> toUpperAscii; assert upper() == "HELLO"
17:48:58disruptekit's kind of impressive when you think about it.
17:56:59FromDiscord<kodkuce> nim has no webrtc lib?
17:57:28*endragor quit (Remote host closed the connection)
17:58:01*endragor joined #nim
17:59:34ZevvI do like the expressiveness, but its a total different use case for cps
18:00:25Zevvits very lamda
18:03:30*endragor quit (Ping timeout: 256 seconds)
18:04:56*audiofile quit (Quit: Default Quit Message)
18:07:14FromDiscord<kodkuce> does nim have some kind of events, like in c# i can tell one obj to listen to some even that some other obj trigers, can subscribe and unscribe
18:09:02FromDiscord<exelotl> Not in the stdlib afaik, but its easy enough to roll your own
18:09:23FromDiscord<exelotl> just make a seq[proc()]
18:09:53FromDiscord<kodkuce> hmm will try
18:10:29Zevveasy to implement and works nicely with closures
18:16:30euantorThere used to be an events library in the stdlib - you could take some inspiration from there: https://nim-lang.org/0.13.0/events.html
18:16:58Yardanicoyou can provide a newer "older" doc version :)
18:16:58Yardanicohttps://nim-lang.org/0.18.0/events.html
18:17:18Yardanicothat module is still available
18:17:27Yardanicoah no nvm
18:17:32YardanicoI thought it's in https://github.com/nim-lang/graveyard but it's not
18:23:27*kungtotte quit (Read error: Connection reset by peer)
18:24:27*kungtotte joined #nim
18:41:20disruptekZevv: did you figure anything out with generics?
18:41:33*sschwarzer joined #nim
18:42:07Zevvnope was out for a stroll in the park
18:43:30sschwarzerI have a question about Nim coding style. I have some `$` procs, as in https://hg.sr.ht/~sschwarzer/vppdiff/browse/src/vppdiff/umlmodel.nim?rev=tip#L41 , that meanwhile have additional parameters beyond the object to convert to a string. Is it common to have such "extended" `$` procs or should I rather rename these to something like `asString`?
18:43:51ZevvI do that, but haven't seen anyone else use it
18:44:15sschwarzerZevv: do extended `$` or use `asString`? :)
18:44:18Zevv$
18:44:27Yardanicosschwarzer: I think it's pretty rare
18:44:38Yardanicoand $ is a conventional op used by procs like echo to convert arguments to stringsf
18:44:43Yardanicoso I think it would be safer to rename it to something else
18:45:13Zevvyeah, but $ with additional args will not match for that
18:45:22Yardanicoyes
18:45:23Zevvso you're safe to define those and use them, if you like the style
18:45:45FromDiscord<Rika> unless all additional args have default
18:45:45sschwarzerYardanico: right, one consequence of the extra parameters is that I can no longer say `echo object`, but instead `echo `$`(object, extra_arg)`
18:46:34Zevvhttps://github.com/zevv/npeg/blob/master/src/npeg/common.nim#L265
18:46:37supakeenI think that's enough reason to use `asString`.
18:46:51Zevvoptional additional args is also handy sometimes
18:47:00supakeenPerhaps if they're optional. Yea, that.
18:47:07YardanicoZevv: optional is okay
18:47:12sschwarzerMy reasoning _for_ `$` is that it's the usual name of a proc that converts an object to a string. My reasoning _against_ `$` is that having additional parameters in it may be confusing.
18:47:16Zevvit's all ok. It's *my* code
18:47:22ZevvI call my procs whatever I like
18:47:58supakeenYea that's valid, the question was more about how common it is and I wouldn't expect it and be confused initially until I look up the signatures.
18:48:01Zevvsschwarzer: well, the stropping makes it tedious also. `$`(thing, param)
18:48:20sschwarzerZevv: yes, that's also one reason against :)
18:48:35ZevvI find none of those in the nim stdlib anyway
18:48:45sschwarzerYardanico: I have one optional/default argument, but I think I need the other.
18:49:27sschwarzerZevv: maybe because the objects in the stdlib are more "elementary" (half-serious)
18:49:33disrupteki wonder how useful an ast fuzzer could be.
18:50:17Zevvdisruptek: not sure how you would do that. You mix it up, if it compiles you don't know what behavior to check for. If it doesn't compile it's probably because the AST is invalid
18:50:33Zevvso the only thing you could test for is ICEs
18:50:56sschwarzerThe extra argument is a table that's used for lookups. I _could_ attach the table to the object to print, but this would require attaching the same table to every of these objects because the printing is a recursive algorithm (the object to print is a tree structure).
18:51:06ZevvI tried afl'ing nim source code once, but the amount of poop coming out quickly made me stop
18:51:24disruptekwell, i would fuzz removals of ast. the idea is to reduce code. part of timmy's required for dustmite.
18:51:26Yardanicoask @varriount
18:51:32YardanicoI think he's trying to fuzz the nim compiler
18:51:33sschwarzerZevv: What's "afl'ing"?
18:51:41disrupteki don't care about fuzzing code itself.
18:51:47Yardanicosschwarzer: https://github.com/google/AFL
18:51:51Yardanicohttps://en.wikipedia.org/wiki/American_fuzzy_lop_(fuzzer)
18:52:09disrupteki mean, i think fuzzy the compiler the way he is doing it is silly.
18:52:20Zevvdisruptek: https://blog.regehr.org/archives/1678
18:53:07Zevvthere's also a part 2 there
18:53:37sschwarzerYardanico: intriguing
18:55:01sschwarzerRegarding my original question, since there doesn't seem to be a "common" way to approach this, I'll probably go with `asString` (unless I get ideas to get rid of the arguments).
18:56:05sschwarzerOriginally the table was module-global, but potentially I want to run the same code from multiple threads where each thread needs its own lookup table (since different trees will be processed).
18:56:14sschwarzerThanks for your input.
18:56:17sschwarzer:-)
18:56:29Yardanicovariables can be threadvar
18:56:38Yardanicowhich means that for each thread the variable will be "unique"
18:56:49sschwarzerYardanico: right ... I'll think of it.
18:57:07sschwarzerYardanico: actually I use `threadvar`s in another place in the program :)
18:57:31sschwarzeror one threadvar, depending on how you count them. ;-)
18:58:06disruptekZevv: 50k loc to do ast transforms.
18:58:08disruptekholy shit.
18:58:29sschwarzerdisruptek: uh, oh
18:59:33Yardanicoyeah something like dustmite will be very useful
19:01:21Zevvdisruptek: well, it's also half a c compiler right
19:01:43disruptekofc. i'm just glad i don't have to do that.
19:01:49*tane joined #nim
19:03:05disrupteki'd be happy with reducing all c-codegen bugs, since those are relatively expensive.
19:03:20disruptekso basically, typed tests.
19:05:27disruptekwhat's interesting about typed input is that you can have an algorithm write equivalencies, optimizations, and tests.
19:07:00disrupteki mean, look at this issue i made.
19:07:04disruptek!issue author:disruptek
19:07:05disbothttps://github.com/nim-lang/Nim/issues/15160 -- 3exceptions codegen broken inside macros 7& 27 more...
19:07:32disruptekseems like something a program could not just find, but add lots of test cases for.
19:14:49*sschwarzer quit (Quit: leaving)
19:22:34*endragor joined #nim
19:27:05*endragor quit (Ping timeout: 240 seconds)
19:32:40FromDiscord<kodkuce> hmm, i am totaly lost i dont even know anymore whats point of events if evry proc is basicly a static function and objects are just data storages
19:32:51disruptekthere's no point.
19:34:06FromDiscord<kodkuce> i wanted to implement some tough it would help me clean up the code but now am bonkers i guess that heppends when you come form c#
19:37:23FromDiscord<kodkuce> hmm
19:41:58*narimiran quit (Ping timeout: 265 seconds)
19:46:14*vicfred_ joined #nim
19:48:42*vicfred quit (Ping timeout: 260 seconds)
19:51:35FromDiscord<kodkuce> i cant put in table key:string, value:seq[int] right?
19:51:39Yardanicoyes
19:58:19*waleee-cl joined #nim
19:58:29FromDiscord<Varriount> disruptek: You mentioned fuzzing?
19:58:36Yardanicohe did
20:00:49*rockcavera joined #nim
20:04:23*maier joined #nim
20:09:27*maier quit (Ping timeout: 256 seconds)
20:10:42*hyiltiz quit (Quit: hyiltiz)
20:14:31*Vladar quit (Quit: Leaving)
20:16:03*superbia2 is now known as superbia
20:25:37YardanicoAFL is a fun thing lol
20:25:51YardanicoIt found over 33 examples of math expressions which hang my mathexpr lib
20:25:56Yardanico(I have some while true loops)
20:26:00Yardanicoand it's easy to use it with nim
20:26:13Yardaniconim c --cc:clang --clang.exe="afl-clang" --clang.linkerexe="afl-clang" --opt:speed -o:here examples/fuzz.nim
20:26:35YardanicoI gave it 2+2*2 as the only input sample
20:26:38Yardanicohttps://i.imgur.com/QZkxvdM.png
20:27:40FromDiscord<Varriount> Yardanico: I used it on my AWS signing library, to try finding inputs that would break the signing functions (since they perform a lot of string manipulation)
20:27:48Yardaniconice
20:27:54Yardanicowell hanging for my lib is really bad, I've gotta to fix these
20:27:58*hyiltiz joined #nim
20:27:58*hyiltiz quit (Changing host)
20:27:58*hyiltiz joined #nim
20:28:33FromDiscord<Varriount> Yardanico: What does your library do when given `1/0`?
20:28:43Yardanicoinf
20:28:45Yardanicoit's really basic
20:28:52Yardanicojust some recursive-descent with in-tree evaluation
20:28:53Yardanicono AST
20:30:54ZevvYardanico: show me your cases
20:31:04Yardanico"r(..E."
20:31:06Yardanicolol
20:31:07Zevvhaha
20:31:11Zevvdude
20:31:17Yardanicothe first one it found was "r(2E."
20:31:29Yardanicoseems like some float parsing thing
20:31:36Yardanicooh yeah I think I know why LOL
20:32:40YardanicoI wasn't handling the case where parseFloat from parseutils returns 0
20:32:48Yardanicofixed that
20:32:49Yardanicotime to retest
20:34:17YardanicoI also expanded my samples, use most of the samples from my test suite
20:34:23Yardanicooh boy I guess I'll get tons of errors now
20:34:58Zevvlemme see what npeg makes of it :)
20:35:03Yardanicohohoho
20:37:25Yardanicothe reason you compile with afl-gcc or afl-clang is in order to give AFL info about coverage
20:37:32Yardanicoso it can fuzz to try to cover as much code as possible
20:39:14*NimBot joined #nim
20:44:29Zevv0 crashes, 0 hangs
20:44:39Yardanicoyeah after my fix I don't get any either
20:44:42Zevv:)
20:45:00Yardaniconeed to learn how to parallelize AFL though
20:45:00YardanicoI have 16 coures
20:45:04Yardanicocores
20:45:14Zevvyeah but that's kind of tricky iirc
20:45:24Yardanicoapparently not *that* hard
20:45:41Yardanicohttps://afl-1.readthedocs.io/en/latest/user_guide.html#single-system-parallelization
20:45:45Yardanicoyou just start one master process
20:45:47Yardanicoand secondary instances
20:47:11Zevvooh I got a hang
20:47:14Yardanicohohoho
20:47:21Yardanicobet it's some random nonsense
20:47:23Yardanicocare to share?
20:47:28*vicfred_ quit (Quit: Leaving)
20:47:33Yardanicoand what exactly are you testing?
20:47:38Yardanicoone of the parsers with npeg?
20:47:52Zevvarithmatic expression evaluator
20:47:56Yardanicooh
20:49:01Zevv4^7^26
20:49:18Yardanico3.757668132438133e+109
20:49:24Zevvyou bet :)
20:49:25Yardanicotested with my mathexpr :)
20:49:31Yardanicomaybe you don't support multiple ^s ?
20:49:49Zevvno i get an overflow but compiled nim with -d:danger so isn't handled
20:49:52Zevvjust stupid ints
20:49:59Yardanicooh you're doing integers
20:50:01Zevvpython doesn't chew it
20:50:05Yardanicomy lib is more dumb
20:50:07Yardanicoit's simple floats everywhere
20:50:15Zevvtry 4**7**26 in python
20:50:49Zevvyour answer is very wrong by the way
20:50:54Zevvdo you have proper precedence for ^?
20:51:06Yardanicowhy wrong?
20:51:32Yardanico2^3^4 is (2^3)^4 no ?\
20:51:32Zevvit's not (4^7)^26
20:51:35YardanicoI do it the same as https://github.com/codeplea/tinyexpr#compile-time-options
20:51:37Zevvbut 4^(7^26)
20:51:39*snowolf quit (Remote host closed the connection)
20:51:39*snowolf joined #nim
20:51:40*snowolf quit (Changing host)
20:51:40*snowolf joined #nim
20:51:41Zevv^ is wrong associative
20:51:41Yardanico"By default, TinyExpr does exponentiation from left to right. F"
20:51:57Zevvthat's just wrong :)
20:52:00YardanicoI can add a option to switch it line tinyexpr does
20:52:06YardanicoZevv: "This is by design. It's the way that spreadsheets do it (e.g. Excel, Google Sheets)."
20:52:12Zevvthat's just wrong
20:52:21Yardanicowhatever :P
20:52:24Zevvhehe
20:52:37Zevvit doesn't math
20:55:55Yardanicohttps://i.imgur.com/8ThVjIO.png with one master and 3 instances
20:56:04Yardanicothey sync from time to time
20:56:54Yardanicowait I wonder what'll happen if I use --debugger:native
21:01:16*vicfred joined #nim
21:06:57Yardanicowait
21:06:59Yardanicoit still found one hang
21:07:18Yardanico3 already
21:12:54*Zectbumo joined #nim
21:21:49*solitudesf quit (Ping timeout: 264 seconds)
21:48:11FromDiscord<dom96> what you fuzzing
21:48:39Yardanicojust my smol mathexpr lib
21:48:44Yardanicofound one stupid bug :)
21:48:47Yardanicothanks to fuzzing
21:57:12*tane quit (Quit: Leaving)
22:05:20*maier joined #nim
22:10:05*maier quit (Ping timeout: 240 seconds)
22:16:04disruptekhere's a great one... when false: if not n.isNil: t.renderTrace(n) -- i have to leave this as `when true:` or i get a codegen error.
22:16:12disruptekn is an exception symbol.
22:16:21disruptekbananas.
22:18:28*vicfred quit (Quit: Leaving)
22:37:32FromDiscord<Varriount> Is news.ycombinator.com down for anyone? Or have I been classified as a robot.
22:37:40disrupteki knew it.
22:37:51federico3it's up
22:38:24FromDiscord<Rika> varriount is a robot!
22:38:59FromDiscord<Varriount> Oh dear, I've been found out.
22:57:35disruptekis someone else going to build dustmite?
23:00:14*arecacea1 quit (Remote host closed the connection)
23:05:49*arecacea1 joined #nim
23:10:15Yardanicohm, I forgot, is there a good way to importc a C macro?
23:10:40Yardanicoe.g. if in C it's used as while(MACROCALL(ARG)){}
23:11:03Yardanicofor __AFL_LOOP
23:12:15*suchasurge quit (Quit: Ping timeout (120 seconds))
23:12:35*suchasurge joined #nim
23:15:23disruptekwhat's the current idiom to find out if i'm compiling to c++?
23:16:31disrupteki guess compilesettings is the new hotness?
23:22:49federico3a better c2nim would be welcome
23:23:27disrupteknimterop is that beast.
23:46:03*D_ quit (Ping timeout: 260 seconds)
23:48:07*D_ joined #nim
23:52:08*sekao joined #nim
23:52:10FromGitter<bung87> ```code paste, see link```
23:52:15Yardanico?
23:52:23FromDiscord<Elegant Beef> Is bung trolling?
23:52:28Yardanicono
23:52:33Yardanicoseems like the FromGitter bot is broken
23:52:44FromGitter<bung87> what ?
23:52:52FromDiscord<Elegant Beef> We didnt get a link from that
23:53:02Yardanico@bung87 https://i.imgur.com/FO1MUU0.png
23:53:06Yardanicobut he sent https://i.imgur.com/wcYgk2b.png
23:53:11FromGitter<bung87> oh, let me log in irc
23:53:17sekaois the compiler api in stable nim yet? when i do `import compiler/nimeval` i get `cannot open file: compiler/nimeval`
23:53:18Yardanico@bung87 that means it's already downloaded
23:53:23Yardanicoso I don't think you need to handle it
23:53:29*krux02_ joined #nim
23:53:48FromDiscord<Elegant Beef> did you `nimble install compiler` sekao?
23:53:58FromGitter<bung87> but it stop with ```Error: Unable to extract. Error was 'Cannot create a file when that file already exists.```
23:54:18FromDiscord<flywind> https://github.com/dom96/choosenim/pull/201
23:54:19disbotFix #199 - missing dlls
23:54:20*bung joined #nim
23:54:29sekaooh no i didn't, so it's a dependency in nimble! ok ill try that
23:54:40Yardanicosekao: well it's not really a dependency in nimble
23:54:54Yardanicoit's just that if you install nim from e.g. your distro, you won't have the source code for the compiler
23:55:35*blackbeard420 quit (Quit: ZNC 1.8.0 - https://znc.in)
23:55:53*blackbeard420 joined #nim
23:56:00sekaojust installed it but the error still happens. i'm on windows btw.
23:56:08Yardanicohow are you trying to run?
23:56:09Yardanicoyour app
23:56:13*krux02 quit (Ping timeout: 244 seconds)
23:56:28sekaoi use nimble. so nimble run appname
23:56:37Yardanicothen you need to specify compiler in nimble requirements as well
23:56:51Yardanicobecause nimble will only expose libraries which are specified in "requirements"
23:56:55FromGitter<bung87> ok let me run on devel
23:56:55Yardanicorequires "compiler"
23:57:31sekaoah that makes sense. thank you, it works now