00:16:12 | GitDisc | <treeform> Any one run into the "Except? File descriptor not registered." runtime print error before? |
00:17:35 | GitDisc | <treeform> its coming from asyncdispatch.nim |
00:20:21 | * | ipjk quit (Quit: Leaving) |
00:21:51 | FromGitter | <zacharycarter> would love ppl's thoughts - https://imgur.com/a/TWG1d |
00:22:05 | FromGitter | <zacharycarter> @Varriount esp yours <# |
00:23:50 | FromGitter | <Gooseus> @Varriount heyo, ya, wanted to see what your experience was with working on an aws sdk, assuming the rumor was true |
00:27:00 | FromGitter | <Gooseus> I've been working on a s3 download/upload tool and been spending most the time working through the the signaturev4 signing stuff |
00:28:39 | FromGitter | <Gooseus> I saw there is a signature_v4 module in here - https://github.com/aidansteele/aws_sdk.nim but I didn't test it and thought the exercise would be good for me to get more familiar with the language |
00:30:04 | * | dhalinar2 quit (Quit: Konversation terminated!) |
00:30:26 | FromGitter | <Gooseus> one thing I was curious about was how much curating and attention is being paid to the nimble ⏎ ecosystem and how it's organized/structured? |
00:30:31 | FromGitter | <Varriount> @Gooseus If you can get it working, that would be great |
00:30:50 | FromGitter | <Varriount> Nimble is mainly curated by @dom96 |
00:31:25 | FromGitter | <Gooseus> for instance, if I got the signaturev4 implementation working well, would that be a good standalone module? Or would that be too minor for a module and should be included as an exported function of an AWS module? |
00:32:33 | FromGitter | <Gooseus> would an AWS module be a full package with an interface to every service, or would each service be best as their own standalone module that includes a separate generalized aws-core module that implements the aws client / request signing? |
00:33:20 | FromGitter | <Gooseus> @Varriount what did you do with regards to aws? were you involved in that aws_sdk.nim project? |
00:37:52 | FromGitter | <Varriount> @Gooseus No, I had a different project |
00:38:52 | FromGitter | <Varriount> The progress I made mainly centered around using Nim's macro system to generate the API data types from a JSON file. |
00:51:34 | FromGitter | <Varriount> @Gooseus The problem is that the AWS API uses both XML and JSON for different services, and among those there are 2 different ways to send parameters. |
00:51:55 | FromGitter | <Varriount> Which means one has to implement a generic way to send 4 different HTTP requests. |
00:55:29 | FromGitter | <Gooseus> yeah, it'd be quite a task to try and implement the full AWS SDK... I was thinking of applying an 80/20 rule to that where I imagine the 80% of AWS SDK traffic involves S3 |
00:58:10 | FromGitter | <Gooseus> also was thinking that releasing a separate module that was just an AWSClient that didn't care so much about the xml/json format for each service and just signed the request and sent it over |
00:59:01 | FromGitter | <Gooseus> focus on making that good and useful for people to build service-specific modules on top of |
01:00:30 | FromGitter | <Varriount> S3 is also a... special service, as far as the API goes. |
01:00:47 | FromGitter | <Varriount> That being said, if we can implement one service, that would be great. |
01:01:04 | FromGitter | <Gooseus> but small, composable modules is sort of a node thing that I'm used to... not sure that's really the nim model, one complaint in the node community is over just how many NPM modules are just one liners and how there are like different modules that do the same stupid thing poorly |
01:01:30 | FromGitter | <Varriount> @Gooseus I looked into wrapping the C++ AWS library once, however it uses Boost and a ton of templates. |
01:01:53 | FromGitter | <Gooseus> yeah, I was seeing that the S3 sigv4 has it's own page and there are some service specific caveats |
01:02:02 | FromGitter | <Varriount> Nim is (relatively) good at wrapping C++, but the thought of dealing with all those templates was daunting. |
01:02:22 | FromGitter | <Gooseus> yeah, I wouldn't even know where to start on that end |
01:03:16 | FromGitter | <Gooseus> I was thinking it'd be cool to see how an Nim AWS SDK compiled to JS would compare with the official JS AWS SDK |
01:04:21 | FromGitter | <Varriount> It might be slower, since many procedures built into the javascript VM wouldn't be utilized. |
01:04:46 | FromGitter | <Varriount> @Gooseus Hm, I could have sworn that I had a public repo with my AWS code on it. |
01:05:08 | FromGitter | <Varriount> Ah, here it is: https://gist.github.com/Varriount/9e84c48baa4fd5ea22558031bfab3554 |
01:06:49 | FromGitter | <Varriount> There are 3 files in that gist. The first is a translation of the Python signing example (which somehow is broken), the second and third are files that generate API types based on a JSON file describing the API. |
01:06:58 | FromGitter | <Gooseus> nice @Varriount , I'll take a look and reference this as I move along... and yeah, that makes sense from a performance point of view, I haven't looked at any js that has been compiled from nim yet |
01:07:02 | darkn0de | Varriount, very cool, fokring now |
01:13:58 | FromGitter | <Varriount> @Gooseus , darkn0de: You'll need a JSON file describing the API |
01:14:48 | FromGitter | <Varriount> https://gist.github.com/Varriount/32bd7343010de3ca66f47dde2995b188 |
01:15:14 | FromGitter | <Varriount> The schema.nim code isn't perfect - it still chokes on some of the input data |
01:16:13 | darkn0de | really awesome |
01:16:48 | darkn0de | nice work!! |
01:17:07 | FromGitter | <Varriount> Still, it shows that Nim makes it possible to ingest such data, then create an entire API off of it. |
01:17:34 | FromGitter | <Varriount> First though, we need a core API that's able to make basic requests when given the raw data. |
01:28:09 | darkn0de | agreed |
01:33:32 | FromGitter | <Gooseus> ok... so this would take in any JSON description of a REST API at compile time and generate a rest client with all the appropriate methods? |
01:33:54 | FromGitter | <Gooseus> kind of like swagger? |
01:36:05 | * | vivus quit (Quit: Leaving) |
01:38:09 | FromGitter | <Gooseus> cause, if so, that's definitely pretty damn awesome... I mean, assuming there is an API description in this format for all their services then yeah a full aws sdk doesn't seem as far off as I was thinking |
01:42:19 | FromGitter | <Varriount> @Gooseus Theoretically, yes |
01:43:52 | captainkraft | Is there some sort of font rendering library available in Nim? |
01:43:54 | FromGitter | <Varriount> @Gooseus As I said, if we could have a core procedure that takes input data (say, an endpoint, data encoding type, parameters, etc) then we would be about 50% there. |
01:44:45 | FromGitter | <Varriount> @Gooseus The AWS SDK for Python, Boto3, generates all its API types and procedures at runtime. |
01:45:49 | FromGitter | <Varriount> Unfortunately I don't have much time to do anything until the summer. I have University classes. |
01:58:02 | captainkraft | Oh, SDL comes with the ttf lib. |
02:03:48 | FromGitter | <Varriount> captainkraft: What are you a working on? |
02:15:00 | FromGitter | <Gooseus> @Varriount cool cool, I dig it... let me see how this s3 thing turns out, I could be down to make an attempt, <darkn0de> you working on something similar for aws? |
02:16:10 | FromGitter | <Varriount> @Gooseus I would work on getting the v3 authentication to work first. |
02:18:15 | FromGitter | <Gooseus> v4? that's what I'm doing now... don't feel like I'm too far off |
02:18:52 | captainkraft | Varriount: a debugger |
02:19:27 | FromGitter | <Varriount> @Gooseus Sorry, I meant v4 |
02:20:42 | FromGitter | <Gooseus> would an aws_signature_v4 module be welcome in the nimble ecosystem @dom96 ? if I separated it out with tests and whatnot? |
02:21:37 | watzon | Is there a list of internal libraries that are ok to use with JS compileation |
02:21:41 | watzon | compilation* |
02:23:22 | * | vlad1777d quit (Ping timeout: 260 seconds) |
02:25:45 | FromGitter | <Varriount> watzon: Anything that doesn't interface with C. :3 |
02:31:38 | watzon | I noticed that some libraries like httpclient don't work because they depend on the os module which kinda sucks |
02:32:26 | watzon | I like the way haxe handles compiling to other languages, but I hate their Http implementation |
02:37:31 | * | dddddd quit (Remote host closed the connection) |
02:54:14 | watzon | So I'm working on wrapping the entire GitHub API into a nim package |
02:54:14 | watzon | https://github.com/watzon/github-api-nim |
02:54:32 | GitDisc | <awr> hm, you can define custom setters with proc`foo=`(bar: Baz) |
02:54:54 | GitDisc | <awr> is it possible to do something like proc `foo+=`(bar: Baz) |
02:55:17 | GitDisc | <awr> to overload other reassigning operators |
03:02:43 | FromGitter | <Varriount> I would like something like Python's "requests" module, but for Nim |
03:03:31 | FromGitter | <Varriount> awr: Try `proc \`+=\`...` |
03:08:34 | FromGitter | <Varriount> @Gooseus It wouldn't hurt to put the aws_signature_v4 code in a single module, though I would just bundle it with the general library. |
03:12:00 | * | Snircle quit (Ping timeout: 246 seconds) |
03:15:37 | * | koranza quit (Quit: Connection closed for inactivity) |
03:21:33 | GitDisc | <awr> i'm trying to do overload `+=` for a specific field |
03:21:55 | GitDisc | <awr> well not a field exactly, but an imitation of one |
03:34:14 | FromGitter | <Varriount> procedures are bound to types, |
03:34:17 | FromGitter | <Varriount> not fields |
03:38:17 | * | nchambers joined #nim |
03:45:38 | GitDisc | <awr> now that i think about it, it might be possible to do a term-rewriter to do it, but it's more trouble than it's worth |
03:46:19 | GitDisc | <awr> writing bar.foo = bar.foo + x instead of bar.foo += x isn't *that* bad |
03:51:05 | * | Jesin quit (Quit: Leaving) |
03:51:31 | watzon | @Varriount something like Python's requests module would be great |
03:52:43 | FromGitter | <Varriount> watzon: I said that almost an hour ago. :3 |
03:53:03 | watzon | Yeah lol, I had to eat dinner :p |
03:55:35 | FromGitter | <Varriount> We have a very basic http request library, emphasis on basic |
03:55:46 | FromGitter | <Varriount> Perhaps something modeled on Go? |
04:03:55 | watzon | Are you thinking for the standard library? |
04:06:01 | * | craigger quit (Ping timeout: 240 seconds) |
04:07:13 | GitDisc | <awr> i used the nim http library once for a really simple thing and i couldn't get it to work, don't really remember why though |
04:07:37 | * | craigger joined #nim |
04:07:52 | GitDisc | <awr> instead i just fixed this other person's perl script, and eugh, perl |
04:09:25 | GitDisc | <awr> don't really understand why anyone uses perl anymore |
04:09:58 | GitDisc | <awr> i like using nim for small scripts though |
04:11:47 | * | Mooo_ joined #nim |
04:12:03 | Mooo_ | guys how can i get the maximum possible value of an uint64 ? |
04:12:33 | GitDisc | <awr> uint64.max? |
04:12:36 | GitDisc | <awr> i mean |
04:12:39 | GitDisc | <awr> uint64.high |
04:12:54 | Mooo_ | let me try |
04:13:55 | Mooo_ | it says invalid argument for high |
04:14:26 | GitDisc | <awr> hmm that's very strange |
04:14:33 | GitDisc | <awr> it works for int64 but not uint64 |
04:14:56 | Mooo_ | yea, that is true |
04:15:05 | Mooo_ | someone hates unsigned ints |
04:15:33 | Mooo_ | then i can't get the max value? |
04:15:35 | GitDisc | <awr> yeah nim used to require `import unsigned` |
04:17:02 | Mooo_ | okay well |
04:17:37 | Mooo_ | but i want to do network programming |
04:18:17 | * | Mooo_ quit (Remote host closed the connection) |
04:18:50 | GitDisc | <awr> you can do uh |
04:19:11 | GitDisc | <awr> i think let maximum = not 0'u64 |
04:21:01 | GitDisc | <awr> or let maximum = 0'u64 - 1 |
04:21:06 | GitDisc | <awr> whichever looks cleaner to you |
04:25:17 | FromGitter | <gogolxdong> how to set jester listenning port |
04:26:28 | FromGitter | <Gooseus> @Varriount one thing I noticed real quick going through you sigv4 code is ``` amzdate = format(t, "yyyymmdd'T'hhmmss'Z'")``` you're using the minutes formatting code for the month section and the 12-hour hour formatting for the hour which I think needs to be 24 |
04:27:06 | FromGitter | <Varriount> Woods |
04:27:12 | FromGitter | <Varriount> *woops |
04:30:10 | FromGitter | <gogolxdong> Port:5001 and Port:Port(5001) is nnkStmtListExpr while here expected a node of kind nnkStmtList |
04:31:44 | FromGitter | <Gooseus> yeah, I'm messing with the test suite that AWS provides and can't seem to get the signature coming out right even though the string to sign looks perfect and the previous hashes come out right... I'm wondering if it's a problem calculating the signing key, both our code does the hmac_sha256 and converts to string before putting it back into the the next hash, not sure if that would create a problem |
04:39:13 | * | libman quit (Quit: Connection closed for inactivity) |
04:43:01 | FromGitter | <Gooseus> @Varriount did you ever test this hmac implementation? I assume you're using this one - https://github.com/OpenSystemsLab/hmac.nim |
04:44:15 | * | craigger quit (Ping timeout: 248 seconds) |
04:44:22 | FromGitter | <Varriount> Well, I tested that it compiled. I didn't test that it produced correct results |
04:46:09 | * | craigger joined #nim |
04:46:33 | * | salewski joined #nim |
04:48:21 | salewski | Converting some code from Ruby: t0 = (mx * hx + my * hy).fdiv(mx ** 2 + my ** 2) |
04:48:54 | salewski | ** is square, do we have something in Nim for that? From |
04:49:06 | salewski | https://github.com/nim-lang/Nim/blob/master/lib/pure/basic2d.nim#L374 |
04:49:26 | salewski | it seems that there is no sqr()? That is sad. |
04:50:22 | salewski | And what can we do for the fdiv -- in the brackets that seems to be integer expressions. |
04:50:35 | * | GaveUp quit (Ping timeout: 240 seconds) |
04:50:45 | salewski | Do we have to write ().float / ().float? |
04:52:02 | salewski | t0 = (mx * hx + my * hy).float / (mx * mv + my * my).float |
04:53:34 | FromGitter | <Varriount> @Gooseus Any other questions? |
04:55:32 | * | salewski quit (Quit: WeeChat 1.9.1) |
04:57:43 | FromGitter | <Gooseus> @Varriount nope, I just replaced it with this implementation - https://github.com/aidansteele/sph and got the same results |
05:00:16 | FromGitter | <Varriount> @Gooseus Hm. Perhaps the Python version of the code could be compared? The output of each step could be compared to see where deviation occurs. |
05:03:35 | * | GaveUp joined #nim |
05:10:07 | FromGitter | <Gooseus> yeah, I was doing that a little bit with the node sdk |
05:13:55 | FromGitter | <Gooseus> oh snap, I'm an idiot and pretty sure I got the easiest test suite example working... |
05:14:51 | FromGitter | <Gooseus> I was using `s3` for the service and the example just had `service`... somehow I missed that difference in the scope even though I was staring at for 5 min straight |
05:22:43 | FromGitter | <gogolxdong> what should a nnkStmtList node be like? |
05:51:30 | * | Vladar joined #nim |
05:51:41 | * | miran_ joined #nim |
05:53:39 | watzon | Ok here's an interesting question. I have a proc that takes a type `T` and I want to check if `T` is a `seq`. If it is a `seq` I need to get the type of `seq`, or the T in `seq[T]` |
05:53:45 | watzon | Is that possible? |
05:56:55 | watzon | It's these types of questions that keep me awake at night |
05:58:58 | FromGitter | <Varriount> watzon: When in doubt, comb through the manual. |
05:59:12 | watzon | Oh I'm looking lol |
05:59:29 | FromGitter | <Varriount> If you can wait, I'll do some digging and find an answer in the morning, however I bed to get to bed. |
05:59:46 | watzon | But I don't even know what to look for really. Right now I'm just searching the index for `: typedesc` |
06:00:35 | * | craigger quit (Ping timeout: 240 seconds) |
06:00:57 | FromGitter | <Gooseus> I'm new here but maybe genericHead in https://nim-lang.org/docs/typetraits.html |
06:01:09 | FromGitter | <Varriount> Watson: Are you sure overloading might not work? |
06:01:33 | FromGitter | <Gooseus> what are you trying to do? |
06:02:01 | * | craigger joined #nim |
06:02:21 | watzon | Gooseus that looks like the opposite of what I need, but so close |
06:02:34 | FromGitter | <Gooseus> cause I think that the genericHead will take an instantiated type and return the generic type, so maybe a case on that across the expected types? |
06:02:36 | watzon | I want to be able to take `seq[int]` and get `int` |
06:02:57 | watzon | genericHead will take `seq[int]` and return `seq` |
06:03:20 | FromGitter | <Gooseus> I think it'll take @[1,2,3] and return seq[int] |
06:06:28 | * | craigger quit (Ping timeout: 240 seconds) |
06:07:14 | * | craigger joined #nim |
06:07:39 | watzon | Yeah I just want the int part. I hope there's some way to do this |
06:07:41 | * | salewski joined #nim |
06:07:43 | FromGitter | <Gooseus> ok, right, I was reading that all wrong... I get the feeling if there was something in the stdlib it'd be in that module though |
06:08:57 | watzon | Is dom96 on? I feel like if anyone would know it would be him |
06:09:42 | salewski | Indeed we have ^ for ** and now even / for proc `/`*(x, y: int): float |
06:09:46 | * | salewski quit (Client Quit) |
06:10:24 | FromGitter | <mratsim> @watzon I raised a feature request for a genericTail |
06:10:48 | watzon | Why thank you mratsim |
06:11:07 | watzon | I'll have to look at the source and see if I can get a PR in |
06:11:13 | FromGitter | <mratsim> https://github.com/nim-lang/Nim/issues/6454 |
06:11:46 | FromGitter | <mratsim> it’s compiler magic but you can use that instead: https://github.com/mratsim/Arraymancer/blob/master/src/private/ast_utils.nim#L42 |
06:11:57 | FromGitter | <gogolxdong> What should jester settings macros to be ,like setting listening port? |
06:11:59 | FromGitter | <mratsim> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59f2ce2fd6c36fca31a12f37] |
06:15:35 | watzon | Thanks for that workaround mratsim, I'll test it out in a bit. Really the only reason I need it is because of https://github.com/nim-lang/Nim/issues/6604 |
06:16:35 | * | miran_ quit (Ping timeout: 240 seconds) |
06:21:27 | * | darkn0de quit (Ping timeout: 240 seconds) |
06:21:58 | * | gokr joined #nim |
06:22:36 | * | PMunch joined #nim |
06:25:34 | GitDisc | <treeform> hmm seems like when i send 272k of data down a socket at once, it throws an exception and closes. |
06:25:49 | GitDisc | <treeform> not sure how to debug this, async dispatch stack traces are hard to read |
06:27:09 | FromGitter | <gogolxdong> Would anyone shed some light on how to use jester settings macro? |
06:38:20 | * | nsf joined #nim |
06:39:16 | PMunch | gogolxdong what's the problem? |
06:42:00 | PMunch | It's nothing more complicated than "settings:" followed by the name and a value for any of the fields in the Settings object found here https://github.com/dom96/jester/blob/master/jester.nim#L24 |
06:42:26 | PMunch | Look here for example: https://github.com/dom96/jester/blob/master/tests/alltest.nim#L5 |
06:42:41 | PMunch | @gogolxdong ^ |
06:42:50 | PMunch | Is gitter highlighting still not implemented? |
06:43:15 | PMunch | treeform, what exception? |
06:44:55 | FromGitter | <gogolxdong> @PMunch thanks anyway, I put it after route: section |
06:47:43 | PMunch | Ah yeah, the route macro outputs a statement "jester.serve(matcher, settings)" so any settings below there won't be applied |
06:48:46 | FromGitter | <gogolxdong> :) |
06:49:55 | PMunch | dom96, maybe you should close this: https://github.com/dom96/jester/issues/43 |
06:57:50 | * | Arrrr joined #nim |
06:57:50 | * | Arrrr quit (Changing host) |
06:57:50 | * | Arrrr joined #nim |
06:59:32 | * | Andris_zbx joined #nim |
07:00:20 | * | ibutra joined #nim |
07:00:54 | GitDisc | <treeform> PMunch, no exception the stocket just closes (which throws exception) |
07:01:53 | GitDisc | <treeform> Error: unhandled exception: socket closed |
07:02:25 | GitDisc | <treeform> like it can't send that much data at once? it seems to be around 20k |
07:02:47 | gokr | watzon: There? |
07:03:33 | watzon | I'm here. What's up? |
07:04:37 | PMunch | treeform, do you have a minimal example? |
07:04:39 | gokr | I just played with that listRepos thing |
07:05:07 | watzon | gokr: yeah? |
07:05:12 | gokr | And you know, it works just fine if... well, give me 1 sec to verify a thing. |
07:05:48 | * | yglukhov joined #nim |
07:05:59 | gokr | But one thing I noted - if you write it like "var n = parseJson(res.body)" and then "result = n.to(seq[Repository])" - it seems to work just fine. |
07:06:56 | watzon | gokr: really now? I'll have yo try that |
07:09:36 | GitDisc | <treeform> PMunch, I do not, i get the error at exaclty 32766 bytes which is 2^15 - 2 |
07:09:49 | watzon | I'm still trying to figure out the best way to handle that anyway. I'd like to return an object that represents the data structure rather than returning the response object, but I need each and every method to be able to return either the requested object type (say Repository), or one of a few error types |
07:12:43 | * | Viktor_ joined #nim |
07:12:47 | PMunch | treeform, could you create a minimal example? This sounds pretty serious if it is indeed a bug |
07:15:12 | gokr | watzon: Anyway, this seems to work: https://gist.github.com/gokr/577b3afe5d814580cbdfc3d00338cbfd |
07:15:51 | gokr | watzon: But... funny enough the JSON has a lint issue, not sure why that is. |
07:16:27 | gokr | Regarding why it hung - I did note there are two "to", one in marshal and one in json - not sure if that's pertinent. |
07:19:24 | watzon | Hmm interesting. I'll have to try it again |
07:20:15 | gokr | Oh, forget that JSON linting problem. |
07:20:50 | gokr | You had a loop there - but you can just do "echo(%*repos)". Then it produces a proper JSON array of course. |
07:20:54 | * | claudiuinberlin joined #nim |
07:21:19 | * | ibutra quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
07:21:41 | GitDisc | <treeform> PMunch small example works, some thing in this websocket library is not working |
07:22:16 | watzon | gokr: this is why I'm here. You learn all kinds of good things |
07:28:28 | PMunch | treeform, I meant small example as in small code. It could have a large data file to send of course |
07:28:30 | GitDisc | <treeform> PMunch smallest example: https://gist.github.com/treeform/b0ab6b7e3803a5f8dda3b54b944f1c83 |
07:29:47 | GitDisc | <treeform> breaking it into multiple writes also does not help |
07:31:21 | PMunch | treeform, and how are you reading from that socket? |
07:31:40 | GitDisc | <treeform> verifyWebsocketRequest reads from it |
07:31:49 | GitDisc | <treeform> and the http server reads from it too |
07:32:08 | GitDisc | <treeform> oh with Chrome |
07:32:13 | PMunch | Ah |
07:33:00 | PMunch | Hmm, I just get "sending\nsent" when I do that |
07:33:06 | PMunch | Doesn't crash for me.. |
07:33:48 | PMunch | Tried with 50_000 as well, works fine |
07:34:19 | GitDisc | <treeform> well it closes the socket |
07:35:07 | gokr | watzon: There is obviously something wrong with the "to" macro, but not sure what. |
07:35:11 | gokr | I am no macro expert. |
07:35:46 | * | floppydh joined #nim |
07:35:59 | PMunch | treeform, it does the exact same thing for with 32767 as it does with 50000 here. So I'm not sure what the issue is |
07:36:08 | watzon | gokr: nor am I haha. So I'm not likely to be the one to fix it |
07:37:16 | GitDisc | <treeform> Do you get the frame in Chrome? |
07:37:30 | GitDisc | <treeform> both of them the 50k and the smaller one? |
07:37:56 | PMunch | Hold on |
07:38:36 | PMunch | Well, I just get a ERR_INVALID_HTTP_RESPONSE in chrome |
07:38:44 | PMunch | When I point it at localhost:8080 |
07:40:37 | GitDisc | <treeform> http://jsfiddle.net/j5c7or3w/ |
07:41:01 | GitDisc | <treeform> i get a bunch of aaaa when it smaller then 32767 |
07:41:50 | GitDisc | <treeform> run it again you should see a ton of aaaaa |
07:41:56 | GitDisc | <treeform> inthe js console |
07:42:35 | * | Arrrr quit (Ping timeout: 258 seconds) |
07:43:37 | GitDisc | <treeform> did you see a bunch of aaaa? |
07:43:46 | GitDisc | <treeform> I made it send 1 byte smaller |
07:44:08 | PMunch | Hmm, indeed |
07:44:18 | PMunch | I don't get anything when it's larger than 32767 |
07:44:24 | GitDisc | <treeform> yep |
07:44:33 | GitDisc | <treeform> i read on ws frames and they can be as big as you want |
07:44:47 | GitDisc | <treeform> I tried to write a chunker and that seems not to work |
07:45:09 | GitDisc | <treeform> i also tried sending it as multiple writes |
07:45:12 | GitDisc | <treeform> also does not work |
07:47:00 | PMunch | aah |
07:47:24 | GitDisc | <treeform> gist update |
07:47:25 | GitDisc | <treeform> https://gist.github.com/treeform/b0ab6b7e3803a5f8dda3b54b944f1c83 |
07:47:32 | GitDisc | <treeform> did you find some thing? |
07:47:34 | PMunch | If I copy the line "await req.client.send" twice it sends two packets |
07:47:50 | GitDisc | <treeform> yeah |
07:47:54 | GitDisc | <treeform> got to break the packet up |
07:48:48 | GitDisc | <treeform> brb |
07:50:18 | gokr | watzon: It seems, although I got a bit lost in the macro code, that the macro doesn't check properly that the passed in NimNode in fact can be an unevaluated expression, and not a variable. |
07:51:06 | PMunch | dom96, I'm looking through the route macro in Jester and was wondering if it would be a big loss to not have the outsideStmts thing? |
07:51:10 | * | yglukhov quit () |
07:51:28 | PMunch | As I understand it it's just to allow you to have code between your routes that would get moved outside the matching proc |
07:52:11 | * | Andris_zbx left #nim ("Leaving") |
07:53:41 | PMunch | I've pulled the creation of the matching proc out of the routes macro and created a separate matcher macro that it calls instead. That way you can define matchers with the same syntax and have the ability to run multiple matchers |
08:02:05 | GitDisc | <treeform> PMunch, did you find anything with the websocket thing? |
08:02:15 | PMunch | Not really |
08:02:55 | GitDisc | <treeform> i am going to bed, i can open a bug on the ws lib, but it has not been updated in a long time |
08:03:23 | GitDisc | <treeform> not sure what to do |
08:04:18 | PMunch | Yeah, report it and see what happens |
08:04:48 | * | ARCADIVS joined #nim |
08:07:25 | FromGitter | <alehander42> are there any magic vars in nim e.g. name of current function ? |
08:09:49 | FromGitter | <dom96> @zacharycarter Looks super awesome. I wonder if you could model Nim's crown? :) |
08:10:32 | euantor | @alehander42: In Nim we use `instantiationInfo`: https://nim-lang.org/docs/system.html#instantiationInfo, |
08:10:57 | euantor | THough that doesn't give function name |
08:12:12 | FromGitter | <dom96> I'm seeing some people saying that Nim's httpclient module could be improved or that they had trouble with it, please report issues for this otherwise we have no idea what needs to be improved |
08:12:55 | FromGitter | <dom96> I think @awr, @Gooseus and @Varriount mentioned this to some extent :) |
08:13:41 | euantor | I used to find the fact that the async client returned the full body in a string odd, but that's been fixed since then :) |
08:14:08 | PMunch | dom96, did you see my questions about Jester? |
08:17:15 | * | adeohluwa joined #nim |
08:21:43 | FromGitter | <alehander42> @ euantor thank you, useful! |
08:25:49 | FromGitter | <dom96> @Gooseus almost everything (malicious code is not, but that's really the only thing) is welcome in the Nimble ecosystem |
08:26:54 | FromGitter | <dom96> @PMunch just saw it, no idea :) |
08:30:42 | * | Tanger joined #nim |
08:31:25 | Tanger | dom96, Hey mate, just picked up Nim in Action. Real good read! |
08:33:43 | FromGitter | <dom96> @Tanger Thanks for picking it up, glad you like it :) |
08:35:39 | * | Ven joined #nim |
08:36:03 | * | Ven is now known as Guest275 |
08:39:38 | * | darkn0de joined #nim |
08:42:08 | * | Guest275 is now known as Ven`` |
08:47:53 | * | yglukhov joined #nim |
08:48:54 | PMunch | dom96, so would you mind if I removed it to support having multiple matchers? |
08:53:33 | livcd | somehow i wish nim in action would be MEAP |
08:56:05 | * | Ven`` quit (Ping timeout: 240 seconds) |
08:58:56 | * | couven92 joined #nim |
09:00:17 | * | vqrs joined #nim |
09:01:22 | * | fredrik92 joined #nim |
09:04:31 | * | couven92 quit (Ping timeout: 248 seconds) |
09:04:36 | * | fredrik92 is now known as couven92 |
09:04:45 | livcd | oh can anyone confirm that code in Nim in Action is readable on kindle ? |
09:05:19 | * | zolk3ri joined #nim |
09:06:35 | * | dddddd joined #nim |
09:11:06 | watzon | Anyone else feel like Response.status should be an enum or at least just the integer representation of the status? "200 OK" feels kind of redundant and isn't as easy to use inside of a case statement |
09:12:44 | Araq | yup, enums are better |
09:13:49 | * | Ven joined #nim |
09:14:12 | * | Ven is now known as Guest35603 |
09:16:22 | watzon | Even just an int would be better than a string |
09:16:34 | watzon | And a bit easier to implement probably |
09:16:44 | watzon | But enums would be ideal |
09:16:53 | * | Arrrr joined #nim |
09:16:53 | * | Arrrr quit (Changing host) |
09:16:53 | * | Arrrr joined #nim |
09:17:22 | euantor | yeah, the string value seemed odd to me last time I looked at it |
09:18:12 | euantor | You can do `response.code()` to get an enum value of the status though |
09:19:31 | watzon | Well that's good to know |
09:40:11 | * | Guest35603 quit (Ping timeout: 255 seconds) |
09:42:47 | * | tdc joined #nim |
09:46:20 | * | Ven_ joined #nim |
09:49:37 | * | Arrrr quit (Ping timeout: 260 seconds) |
09:50:07 | PMunch | Jester is in need of some cleaning up |
09:52:09 | dom96 | PMunch: feel free to create more PRs :) |
09:52:17 | dom96 | I'll try to review yours today |
09:53:08 | PMunch | I'm actually about to create a new one :) |
09:53:24 | dom96 | Yeah, we have an enum for HttpCode. The string is available for backwards compatibility and as a nice side effect it means that codes which are not in the enum are supported :) |
09:54:06 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:54:47 | PMunch | Yeah I just saw that. There are quite a bit of other things though. E.g. replacing all stmt and expr with typed and untyped |
09:55:22 | * | gangstacat quit (Read error: Connection reset by peer) |
09:58:17 | * | claudiuinberlin joined #nim |
09:58:18 | * | gangstacat joined #nim |
09:58:55 | Araq | yeah give jester some love please |
10:03:37 | watzon | dom96: yeah now that I know that `code()` exists I'm much more ok with the strings |
10:04:56 | PMunch | https://github.com/dom96/jester/pull/128 |
10:05:05 | watzon | Nim doesn't have decorators right? |
10:05:16 | PMunch | There, now Jester has a way to create multiple route blocks |
10:05:55 | PMunch | I might have a go at cleaning up Jester later today, making the code-base a little more up to par with how Nim code looks nowadays. |
10:06:07 | * | gangstacat quit (Remote host closed the connection) |
10:08:05 | * | Ven_ quit (Ping timeout: 240 seconds) |
10:09:21 | * | Ven joined #nim |
10:09:44 | * | Ven is now known as Guest10069 |
10:11:52 | * | gangstacat joined #nim |
10:11:56 | * | ipjk joined #nim |
10:17:23 | GitDisc | <GooRoo> @watzon unfortunately seems like no decorators, however, they can be replaced by marcos I guess |
10:21:34 | Araq | @deco def foo |
10:21:35 | Araq | is |
10:21:42 | Araq | proc foo {.deco.} |
10:23:56 | GitDisc | <GooRoo> not as beautiful as in Python in my opinion, but definitely acceptable |
10:25:43 | watzon | Kinda forgot about pragmas |
10:25:55 | watzon | I have no clue how to make one lol |
10:26:18 | FromGitter | <mratsim> I find decorators ugly though .... |
10:26:43 | watzon | mratsim personally I like them |
10:26:46 | * | Guest10069 quit (Ping timeout: 264 seconds) |
10:27:41 | GitDisc | <GooRoo> I like that decorators are put before funtion definition and each one is on its own line |
10:28:10 | GitDisc | <GooRoo> it is just a little bit more readable |
10:28:16 | GitDisc | <GooRoo> perhaps… |
10:30:46 | FromGitter | <mratsim> But multiple decorators for the same function is so-so. + When you grep a function you don't know if a decorator is applied and if you grep a decorator you don't know which function it applies to |
10:33:39 | GitDisc | <GooRoo> I have my own opinion regarding this, but usually not many people think the same way: |
10:33:39 | GitDisc | <GooRoo> it's a tool problem `grep` is too old, it works with plain text and knows nothing about your code structure |
10:34:10 | GitDisc | <GooRoo> 1/5th of 21st century is almost passed and we still rely on plain text for code |
10:36:52 | watzon | I agree there. I don't really care about what grep understands |
10:37:04 | * | Ven_ joined #nim |
10:37:09 | watzon | I rarely use it unless I'm grepping help text or something |
10:37:54 | GitDisc | <GooRoo> I believe that at some point programmers end up with something like mbeddr https://vimeo.com/78341172 |
10:38:13 | GitDisc | <GooRoo> it's implemented using JetBrains MPS. Just take a look if you didn't have a chance before |
10:39:06 | dom96 | Araq: This is currently on top of HN, sounds like something you could recreate in karax https://news.ycombinator.com/item?id=15566873 |
10:40:06 | * | elrood joined #nim |
10:40:43 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
10:41:21 | FromGitter | <zacharycarter> thanks dom96! I might be able to |
10:41:31 | dom96 | zacharycarter: that would be awesome :D |
10:41:55 | FromGitter | <zacharycarter> I'll give it a shot after I finish this up |
10:44:21 | Araq | dom96, alright next livestream will be karax+ormin |
10:44:54 | dom96 | cool |
10:50:46 | * | voiceftp quit (Remote host closed the connection) |
10:51:03 | * | voiceftp joined #nim |
10:53:43 | * | vqrs quit (Read error: Connection reset by peer) |
10:55:54 | * | tdc quit (Read error: Connection reset by peer) |
10:56:53 | * | tdc joined #nim |
11:00:19 | * | vqrs joined #nim |
11:00:32 | ipjk | Araq: strawpoll-clone? |
11:02:34 | * | Snircle joined #nim |
11:03:19 | Araq | dunno, maybe |
11:09:13 | FromGitter | <gokr> @dom96 Regarding redoing that todo-list thing in Nim/karax - which part in Nim would do the websocket stuff? Is that the stuff from Onionhammer? |
11:10:32 | * | Arrrr joined #nim |
11:10:32 | * | Arrrr quit (Changing host) |
11:10:32 | * | Arrrr joined #nim |
11:13:41 | * | pyloor quit (Quit: Leaving) |
11:34:37 | FromGitter | <gokr> @GooRoo "plain text for code"... yeah. Smalltalk FTW! :) |
11:36:37 | * | adeohluwa quit (Quit: Connection closed for inactivity) |
11:40:09 | * | claudiuinberlin joined #nim |
11:41:19 | * | Ven_ quit (Ping timeout: 248 seconds) |
11:54:41 | FromGitter | <mratsim> Unit testing / Integration testing discussion on HN going wrong: https://news.ycombinator.com/item?id=15567415 |
12:01:28 | PMunch | mratsim, didn't you hear unit testing is a conspiracy by the church of scientology? |
12:07:32 | Arrrr | i woudln't be surprised |
12:15:50 | dom96 | TDD always reminds me of this little competition a company in Uni had |
12:15:57 | dom96 | They said the first one to complete it would win an Apple Watch |
12:16:14 | dom96 | I won third place for some unknown reason and got an iPad mini instead |
12:16:15 | dom96 | sad times |
12:16:21 | dom96 | (even though I finished first) |
12:19:18 | * | PMunch_ joined #nim |
12:21:51 | * | PMunch quit (Ping timeout: 248 seconds) |
12:34:29 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:38:02 | * | gokr quit (Ping timeout: 255 seconds) |
12:41:02 | * | claudiuinberlin joined #nim |
12:48:22 | * | vlad1777d joined #nim |
12:53:54 | FromGitter | <mratsim> @Pmunch lol =} |
13:15:10 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:17:15 | * | claudiuinberlin joined #nim |
13:20:41 | FromGitter | <mratsim> Btw this is a very interesting post on how DarkShikari became the x264 and video encoding guy in the whole world even though he was still in college: https://news.ycombinator.com/item?id=320102 (x264 is used by ffmpeg, VLC, and hundreds of video products) |
13:21:04 | * | Arrrr quit (Quit: Leaving.) |
13:29:49 | subsetpark | I thought unit testing was the one true church, and static typing was a conspiracy by stupid, lazy programmers |
13:30:17 | * | PMunch__ joined #nim |
13:30:35 | * | PMunch__ is now known as PMunch |
13:33:02 | * | PMunch_ quit (Ping timeout: 252 seconds) |
14:00:18 | * | miran quit (Quit: Page closed) |
14:03:39 | * | PMunch quit (Quit: Leaving) |
14:05:38 | * | Arrrr joined #nim |
14:05:38 | * | Arrrr quit (Changing host) |
14:05:38 | * | Arrrr joined #nim |
14:05:45 | * | Jesin joined #nim |
14:07:00 | dom96 | ooh, sshfs is pretty awesome |
14:08:37 | ipjk | What's the age for college? |
14:12:10 | * | arecaceae quit (Remote host closed the connection) |
14:12:28 | * | arecaceae joined #nim |
14:22:24 | floppydh | it would be cool if, when getting a typemismatch on a proc with a very long argument list, it would show among the procs it suggests which fields match and which don't |
14:22:57 | floppydh | because theres only one proc and I seem to call it wrong, but theres like 10 arguments and it's really tiresome to find the ones that dont match, also requiring you to know which one would implicitly be converted and which dont |
14:28:57 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:31:04 | GitDisc | <GooRoo> @floppydh please submit this as an issue on GitHub |
14:31:20 | GitDisc | <GooRoo> 'cause I would also like to have such a feature |
14:31:36 | Araq | no |
14:31:42 | Araq | it's already an issue |
14:31:49 | Araq | and somebody is working on it, I think |
14:32:22 | floppydh | that's good to hear |
14:34:25 | * | gokr joined #nim |
14:36:10 | floppydh | https://github.com/nim-lang/Nim/issues/1761 ? |
14:37:00 | GitDisc | <GooRoo> the best error messages I've ever seen so far are in Elm I guess |
14:37:12 | GitDisc | <GooRoo> example: https://pbs.twimg.com/media/CiuJyriXAAEiZnd.jpg |
14:37:19 | Araq | yup |
14:39:09 | Araq | Elm lacks meta programming and overloading, it's not hard to give good error messages when you have a simpler language |
14:40:10 | Araq | plus you didn't show how the error message looks like when you have a mismatch in a call with 10 arguments |
14:41:10 | GitDisc | <GooRoo> @Araq, http://elm-lang.org/assets/blog/error-messages/0.16/big-record.png |
14:41:45 | GitDisc | <GooRoo> just googled it |
14:42:15 | Araq | that's not a call with 10 arguments but close enough |
14:42:28 | * | miran_ joined #nim |
14:42:45 | GitDisc | <GooRoo> right, not exactly the same |
14:43:27 | GitDisc | <GooRoo> But I don't use Elm, just know that they have pretty error messages |
14:44:04 | Araq | yeah I know |
14:45:48 | GitDisc | <GooRoo> I was amazed when I first saw it (especially when recalled some error messages from Boost.Spirit in my mind) |
14:46:49 | Araq | clang has good error messages too and so does Rust. |
14:47:46 | GitDisc | <GooRoo> probably not so "bookish" and user-friendly, but acceptable, yes |
14:48:16 | GitDisc | <GooRoo> well, I'm fine with current Nim's error messages in most cases |
14:49:11 | GitDisc | <GooRoo> but there is always something that can be improved. And in this case it worths a try |
14:49:18 | Araq | I'm tired of this "error message is bad" bullshit |
14:49:27 | Araq | so go ahead and improve it |
14:49:33 | Araq | I'm sure it's easy |
14:49:55 | Araq | I mean |
14:49:56 | floppydh | well error messages are hard no |
14:50:12 | Araq | the only reason Nim's are bad is because Araq doesn't know Elm |
14:50:18 | floppydh | :D |
14:51:01 | GitDisc | <GooRoo> yep, everything is Araq's fault |
14:51:13 | ipjk | I wouldn't call rusts error messages good, it's better than it used to be though. |
14:51:30 | Araq | yes, exactly, it's my "fault" |
14:51:59 | Araq | not a conscious design tradeoff when I went after a more powerful language |
14:52:30 | GitDisc | <GooRoo> Any fulltime positions available? I'd like to be a Senior Error Messages Improver |
14:53:29 | Araq | well this issue has a bounty ;-) |
14:54:00 | ipjk | Didn't gcc lack colored output just a few years back? |
14:54:19 | floppydh | ye |
14:54:20 | * | chemist69 joined #nim |
14:54:27 | GitDisc | <treeform> Hey Araq, I am struggling with this issue where I can't send more then 32768 bytes of data via async socket. https://gist.github.com/treeform/b0ab6b7e3803a5f8dda3b54b944f1c83 Maybe you can thing of some thing to try? |
14:55:06 | ipjk | Most of the time when I get an error from a compiler, I look at it as a vauge hint, as some can be so incorrect |
14:55:14 | GitDisc | <GooRoo> @Araq, wow, 12$! I'm on it! |
14:55:34 | GitDisc | <GooRoo> Does gcc have colored output now? |
14:56:07 | Araq | treeform: could be an OS limitation? |
14:56:23 | GitDisc | <treeform> nodejs can do it? |
14:56:39 | GitDisc | <treeform> its normal ubutu box |
14:56:45 | * | Vladar quit (Quit: Leaving) |
14:56:53 | Araq | yes, I mean, we might need to split it into chunks for the OS |
14:57:00 | Araq | and nodejs already does that |
14:57:03 | GitDisc | <treeform> yeah I tried that. does not work |
14:57:10 | ipjk | GooRoo: they added it after clang |
14:57:27 | Araq | but I am not a sockets expert |
14:57:33 | Araq | dom96, ping |
15:00:27 | GitDisc | <GooRoo> @ipjk cool, didn't know |
15:07:42 | GitDisc | <treeform> Araq, here is an example were I do multiple writes, they don't work: https://gist.github.com/treeform/ed31201722a3e426dd41e58f5322d89d |
15:10:31 | * | Viktor_ quit (Quit: Viktor_) |
15:11:58 | floppydh | I can't pass nil as argument for a "var X" no ? |
15:12:01 | dom96 | treeform: maybe you should try a raw socket to reproduce this |
15:12:07 | dom96 | I wouldn't be surprised if websocket package is at fault here |
15:14:09 | GitDisc | <treeform> agreed |
15:15:08 | GitDisc | <treeform> hopefully I can fix this ws lib |
15:15:56 | floppydh | I need to pass nil to a proc as a parameter that is of type "var Foo", Manual doesn't specifically say that "Var parameters" can't take nil, but they don't - any pointers ? :/ |
15:16:09 | floppydh | pun not intended |
15:16:21 | ipjk | Just curious, why do you have to pass nil? |
15:16:24 | Araq | you can't pass nil to a var T |
15:16:31 | floppydh | ipjk: it's a c interface thing |
15:16:36 | floppydh | Araq: thanks |
15:16:54 | Araq | you need patch the C interface, maybe introduce an overload that takes 'ptr' |
15:17:35 | floppydh | sure, np |
15:18:14 | ipjk | Ah, there are some weird uses of nil in c |
15:18:36 | ipjk | Isn't like, blahtime(NULL) a thing? |
15:19:36 | Araq | we have times.nim |
15:20:04 | ipjk | I'm refering to c |
15:20:19 | ipjk | That it's rather weird |
15:20:27 | floppydh | ipjk: what's weird |
15:20:49 | ipjk | floppydh: why not use, like an enum for time()? |
15:20:59 | ipjk | floppydh: time(currentTime)? |
15:21:15 | ipjk | floppydh: makes more sense than time(NULL) |
15:21:29 | floppydh | not really |
15:21:55 | ipjk | Are you really going to argue about null making more sense than currentTime? |
15:22:21 | FromGitter | <data-man> @Araq https://github.com/nim-lang/Nim/pull/6600#issuecomment-339998832 |
15:22:29 | floppydh | are you really going to argue that usage of NULL in C APIs is "weird"? |
15:23:08 | Araq | hi data-man, tried to get your new tinyC to compile and failed :-) |
15:23:11 | ipjk | As a parameter, yes. |
15:23:20 | Araq | you need to boot with -d:tinyC |
15:23:28 | floppydh | ipjk: so you're going to make an enum which as a value is NULL? |
15:23:33 | Araq | the tests don't cover tinyc |
15:23:46 | ipjk | ofcourse not, it'd be 0 |
15:24:44 | Araq | btw #define NULL 0 is possible iirc |
15:24:44 | ipjk | if c had immutable's I'd just make it a public variable |
15:25:30 | ipjk | or just currentTime() |
15:25:54 | ipjk | null in a parameter just makes no sense to me. |
15:26:43 | floppydh | how so, it's often used for optional arguments |
15:29:04 | FromGitter | <data-man> @Araq Hmm, "nim -v" show to me: "active boot switches: -d:release -d:tinyc" |
15:29:06 | ipjk | how often something's used doesn't mean is right |
15:29:47 | floppydh | but it usually means there's more to it then just everyone being weird |
15:30:48 | ipjk | If c was just a few years old, yes. But things have changed over all those years, and the style. |
15:31:10 | floppydh | depends where you dwelve |
15:31:32 | ipjk | Check out the winapi and cry. |
15:31:53 | floppydh | I'm actually trying to wrap parts of WINAPI atm :) |
15:32:06 | ipjk | And it's absoulutely horrid. |
15:32:12 | floppydh | hard to say |
15:32:22 | floppydh | needs some getting used to like everything |
15:32:56 | * | floppydh quit (Quit: WeeChat 1.9.1) |
15:34:14 | ipjk | How old is the winapi, 25y? |
15:37:23 | couven92 | some parts are, yes |
15:38:05 | * | ARCADIVS quit (Ping timeout: 240 seconds) |
15:38:30 | * | nchambers left #nim (#nim) |
15:39:50 | * | gokr quit (Ping timeout: 258 seconds) |
15:42:52 | * | Trustable joined #nim |
15:46:52 | * | claudiuinberlin joined #nim |
15:47:15 | Araq | data-man: your PR also misses i386-link.c etc |
15:55:16 | * | ARCADIVS joined #nim |
15:59:25 | FromGitter | <data-man> @Araq: Sorry, I'm newibe to git. Pushed. |
16:01:34 | Araq | so ... are you on Linux? |
16:01:50 | FromGitter | <data-man> Yes |
16:02:26 | FromGitter | <data-man> ArchLinux |
16:03:24 | GitDisc | <awr> which part of winapi? |
16:03:53 | FromGitter | <alehander42> I'd also love to help with the error messages if I get better with the compiler, I remember Araq has written that in some cases having very informative error messages would complicate in a bad way the compiler code, but I still think there should be some way to have the cake and eat it here (to separate more involved easy-errors mode handling logic in a separate module without polluting the main codebase) |
16:04:43 | GitDisc | <awr> i've noticed there's little parts here and there that are absent from oldwinapi |
16:04:50 | FromGitter | <alehander42> are there any real examples of error handling situations that would add a lot of complication ? |
16:05:10 | GitDisc | <awr> for example, SYSTEM_POWER_STATUS is defined |
16:05:29 | GitDisc | <awr> actually wait nvm |
16:05:43 | GitDisc | <awr> GetSystemPowerStatus is defined... |
16:05:47 | GitDisc | <awr> which one was i thinking of |
16:07:19 | GitDisc | <awr> i remember there were a few instances of a type being defined in oldwinapi while the only function associated with that type wasn't |
16:07:30 | GitDisc | <awr> but i can't seem to find them now |
16:11:54 | * | Viktor joined #nim |
16:23:25 | GitDisc | <treeform> wow after like 5 hours of debuggin I found a problem |
16:23:34 | GitDisc | <treeform> proc ntohl*(x: uint32): uint32 = I need one for 64 bits |
16:24:02 | GitDisc | <treeform> the websocket module used 32 bit one when they needed to use 64 bit one |
16:24:07 | GitDisc | <treeform> but 64 bit one does not exist |
16:24:40 | GitDisc | <treeform> https://github.com/nim-lang/Nim/blob/master/lib/pure/nativesockets.nim#L250 |
16:25:23 | FromGitter | <data-man> @Araq: My current task is to make the Nim compiler able to produce executable files without an external C compiler. |
16:25:46 | FromGitter | <Yardanico> how? |
16:26:36 | * | PMunch joined #nim |
16:28:05 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
16:28:53 | FromGitter | <data-man> With fully integrated TinyC |
16:29:12 | FromGitter | <Yardanico> what's the point? |
16:29:15 | * | Vladar joined #nim |
16:31:24 | FromGitter | <data-man> This is the fastest C compiler |
16:31:27 | * | zolk3ri quit (Ping timeout: 248 seconds) |
16:31:56 | FromGitter | <Yardanico> I know, aaand what's the point? :) |
16:32:30 | FromGitter | <data-man> Faster compilation :) |
16:32:43 | GitDisc | <treeform> faster compilation could be good |
16:32:59 | FromGitter | <dom96> Treeform: nice. Thanks for investigating :) |
16:33:00 | GitDisc | <treeform> then you use some ting like VC to do relase builds |
16:33:17 | GitDisc | <treeform> dom96, thanks, still not done yet |
16:33:37 | GitDisc | <awr> if you want faster compilation maybe try using zapcc as c compiler |
16:34:10 | FromGitter | <Yardanico> is it faster at compiling C than TCC? |
16:34:15 | GitDisc | <awr> i've never used it but it's a fork of clang |
16:34:26 | GitDisc | <awr> that's supposedly focused on faster compilation |
16:34:33 | FromGitter | <Yardanico> well it's for C++ |
16:34:37 | FromGitter | <Yardanico> and nim's main target is C |
16:35:02 | FromGitter | <Yardanico> (zapcc is a C++ compiler, well it should support C too) |
16:35:07 | FromGitter | <Yardanico> but IDK if it's faster than tcc |
16:35:13 | * | Arrrr quit (Ping timeout: 248 seconds) |
16:36:16 | FromGitter | <Yardanico> " ⏎ The optimizer is not disabled, few global optimizations are. The speedup is mostly the result of not having to reparse the headers, reinstantiate and codegen the generated templated code rather than skip minor opts. " |
16:36:33 | FromGitter | <Yardanico> so it precompiled all C headers |
16:36:37 | FromGitter | <Yardanico> which isn't very useful for Nim |
16:36:58 | FromGitter | <Yardanico> ah, and also: it's a closed-source(!) fork of clang |
16:37:49 | FromGitter | <Yardanico> "Zapcc uses in-memory compilation cache in client-server architecture, remembering all compilation information between runs. ‘zapcc’ is the client while ‘zapccs’ is the server. Each zapcc run will reuse an existing server, or if none available will start a new one." |
16:38:12 | FromGitter | <Yardanico> and the main one: "Will Zapcc accelerate C projects as well? No." |
16:38:31 | * | Jesin quit (Quit: Leaving) |
16:38:56 | GitDisc | <GooRoo> Can I encounter some problems if I use C++ as a target language for Nim compilation? |
16:39:24 | GitDisc | <awr> i have in the past |
16:39:49 | GitDisc | <awr> at least when i tried to use MSVC++ |
16:39:54 | FromGitter | <Yardanico> GooRoo: yes |
16:40:00 | GitDisc | <GooRoo> shi~~~ |
16:40:01 | GitDisc | <treeform> yes, all fixed. ws library did not follow the spec |
16:40:04 | FromGitter | <Yardanico> for example SLL doesn't work with C++ target and clang |
16:40:07 | FromGitter | <Yardanico> *SSL |
16:40:36 | GitDisc | <GooRoo> thanks for the information, guys |
16:40:40 | FromGitter | <Yardanico> @GooRoo you can check here: https://github.com/nim-lang/Nim/issues?q=is%3Aissue+is%3Aopen+label%3A%22C%2B%2B+codegen%22 |
16:40:42 | * | Arrrr joined #nim |
16:40:42 | * | Arrrr quit (Changing host) |
16:40:42 | * | Arrrr joined #nim |
16:41:45 | GitDisc | <GooRoo> I see |
16:42:02 | GitDisc | <GooRoo> okay then, it's time to switch my settings back to C |
16:44:39 | * | Jesin joined #nim |
16:45:23 | FromGitter | <Yardanico> why do you want C++ btw? |
16:47:03 | GitDisc | <awr> does using nim cpp with the c++ exceptions turned off return code that could be accepted by a plain C compiler? |
16:47:21 | GitDisc | <awr> or does nim cpp use operator new and delete and other c++ things |
16:48:09 | GitDisc | <awr> (pretend that we're not using any fancy bindings to c++ libraries) |
16:48:54 | FromGitter | <Yardanico> it uses C++ exceptions |
16:49:08 | FromGitter | <Yardanico> so now, nim's generated cpp code can't be compiled by a C compiler |
16:49:13 | GitDisc | <GooRoo> @Yardanico because I like C++ and do not like C. In fact, I don't care much which language Nim is compiled to unless it works. |
16:49:27 | FromGitter | <Yardanico> just use C then |
16:49:34 | FromGitter | <Yardanico> you wouldn't have any benefits with C++ |
16:49:50 | GitDisc | <GooRoo> Yep, got it |
16:49:52 | FromGitter | <Yardanico> (as nim target backend) |
16:50:00 | FromGitter | <Yardanico> unless you need to use some large C++ library |
16:50:07 | GitDisc | <awr> there's a compiler option to turn cpp exceptions off while using nim cpp |
16:50:56 | GitDisc | <awr> i don't actually want to use nim cpp for anything, but it piqued my curiosity |
16:51:09 | Araq | we need to use 'nim cpp' way more often |
16:51:18 | Araq | much faster exceptions |
16:51:30 | Araq | and better backend typechecking |
16:52:15 | couven92 | Araq, as I understand using the winapi on Windows to get exception handling isn't even that difficult to pull off in C either |
16:52:40 | couven92 | I know a guy who did for fun, complaining that getting exceptions in Linux is way much harder |
16:53:51 | GitDisc | <GooRoo> /me switching back to C++ backend |
16:54:08 | GitDisc | <GooRoo> Dumb Discord |
16:54:21 | PMunch | Oh couven92, I was wondering something about Windows. You ever done DLL loading? |
16:54:32 | couven92 | yup |
16:54:42 | couven92 | fire away |
16:54:43 | FromGitter | <Yardanico> Araq: but these exceptions can'be catched from Nim side |
16:54:46 | FromGitter | <Yardanico> AFAIK |
16:56:00 | Araq | couven92, that's about win32 which uses the slow model |
16:56:16 | Araq | win64 is the "zero cost" exception model I'm after |
16:56:20 | couven92 | Araq probably |
16:56:23 | Araq | *uses |
16:56:56 | GitDisc | <awr> structured exception handling |
16:57:17 | PMunch | I've got a system that works great on Linux. I compile my binary with the GCC flag `-rdynamic` which makes sure that symbols are added to the file. Then I load a DLL (or rather a .so) which has symbols that are not defined. When it is loaded the symbols are fetched from the global symbols table and it's able to use functions from the main binary. This means that the DLL only needs to compile in the symbols it actually uses which keeps the size down. But on |
16:57:17 | PMunch | Windows this doesn't work and I haven't figured out how to properly do this |
16:58:47 | couven92 | PMunch, that's usually what statically linked libraries do, they make function shunts that are filled with proper addresses at runtime |
16:59:18 | * | ARCADIVS quit (Quit: ARCADIVS) |
16:59:44 | PMunch | Yeah, but that requires recompilation |
17:00:03 | couven92 | But if you want to do that manually, you use GetFunctionAddress (or sth. like that) which takes the a library handle and a function name as a string and returns the function pointer to the appropriate function |
17:00:21 | PMunch | https://stackoverflow.com/a/17083153, that's pretty much what I'm doing now |
17:01:05 | couven92 | yeah, exactly as you do in Windows, the kernel functiosn just have different names |
17:01:21 | couven92 | and that is actually the code that lies in statically linked libraries |
17:02:30 | couven92 | PMunch, https://msdn.microsoft.com/en-us/library/ms683212(v=vs.140).aspx |
17:02:42 | PMunch | Not quite, look at the lib.c file. It just defined exported_callback and then calls it without actually having an implementation for it. The main.c file includes the implementation which is made available to the dynlib when it's loaded |
17:02:54 | GitDisc | <awr> do dynlibs in the nix world have any weird restrictions on what you can or cannot do in the entry point |
17:03:07 | GitDisc | <awr> because windows has this https://msdn.microsoft.com/en-us/library/windows/desktop/dn633971(v=vs.85).aspx#general_best_practices |
17:03:24 | PMunch | couven92, yeah that's the other way around. So a main program finding a function in a dll to call |
17:03:45 | couven92 | yeah that's what you want, isn't it |
17:03:47 | GitDisc | <awr> which is why i do --nomain on windows and call NimMain() manually |
17:03:49 | PMunch | Look at the second and third answer in that stack exchange |
17:04:10 | FromGitter | <data-man> New release imgui |
17:04:26 | PMunch | No, I want to do it the other way round. The main program implements functions and the dll makes calls to these functions |
17:05:09 | couven92 | I don't understand the problem. Just send a function pointer from your main program then, don't even need any extra code for that |
17:07:38 | PMunch | couven92, ah there are two problems with that. First I have 80-90 functions. Sure I could wrap them in a structure of some kind but that only hides the real problem. Any way that includes passing pointers or structures will require the dll to know of all the functions the main program exposes. With the method I use for Linux the so file only needs to know of the few functions it uses as the main program only makes the symbols available. |
17:07:51 | PMunch | This means a much smaller size |
17:08:35 | couven92 | I don't get the problem... But the trick with the GetFunctionProc works the other way round as well! |
17:08:42 | PMunch | I could of course create my own symbols table, and pass a pointer to the table and include functions to read the table in each DLL, I was just wondering if there was a native way of doing this for Windows |
17:09:18 | couven92 | You just pass the HINSTANCE handle of your main program to the library and then the library can discover everything it wants on its own |
17:09:19 | PMunch | Oh I can GetFunctionProc from a DLL to get a function implemented in the main executable? |
17:09:27 | PMunch | Aah |
17:09:32 | couven92 | Sure, of course you can! |
17:09:54 | PMunch | Hmm, that still means I have to manually do it though. It's not automatic.. |
17:09:56 | PMunch | Oh well |
17:10:28 | couven92 | Even on Linux libraries and executable are not that different, they're both have executable headers with import and export tables, anyone can do lookups in those! |
17:11:13 | PMunch | Yes, but you can also just define symbols that the dynamic library will automatically resolve when it's loaded |
17:11:24 | PMunch | So you don't have to do anything special to get them |
17:11:28 | GitDisc | <awr> https://msdn.microsoft.com/en-us/library/z4zxe9k8.aspx |
17:11:36 | PMunch | With a file like this: https://github.com/PMunch/min/blob/dynloading/dynamic/mindyn.nim#L112 |
17:11:52 | PMunch | You can create a dynamic library like this: https://github.com/PMunch/min/blob/dynloading/dynamic/dynamicadd.nim |
17:12:02 | GitDisc | <awr> i'm interpreting this as MSDN saying that exes don't have export tables |
17:12:27 | GitDisc | <awr> which i'm not sure is completely true |
17:13:03 | PMunch | When compiled with -d:release it will simply compile away all the symbols it doesn't need, and only keep those it actually needs. When the DLL is loaded it will find these symbols in the global symbols table define by the main executable and will be able to call the procedures |
17:14:22 | couven92 | awr, sure exes have export tables, you just normally don't put anything in those! |
17:14:41 | GitDisc | <awr> you can export variables at the very least, i know that for a fact |
17:15:19 | couven92 | awr, on Windows there is absolutely NOTHING different between a dll and exe. That is a fact |
17:15:41 | couven92 | Dlls even got entry points! (That don't do anything) |
17:15:45 | GitDisc | <awr> i know that |
17:16:01 | GitDisc | <awr> DllMain() has a number of restrictions though on what you can do in it |
17:16:09 | GitDisc | <awr> i linked it earlier |
17:17:28 | couven92 | sure, but that comes just from the fact that they don't get access to the preinitiialzed runtime environment the Windows process loader makes for a normal executable, arguments, the a clear main thread, and all those main entry point stuff |
17:18:22 | couven92 | There is nothing actually stopping you from doing all that stuff and treat a dll as a regular program, and vice-versa |
17:18:28 | GitDisc | <awr> can you straight up just call LoadLibrary on an EXE then? |
17:18:35 | couven92 | Sure you can |
17:19:07 | GitDisc | <awr> that's interesting |
17:19:21 | * | claudiuinberlin joined #nim |
17:19:30 | couven92 | But as you pointed out, in most cases the export table is empty, so you won't actually be able to do much with an exe loaded as a library |
17:20:14 | couven92 | If you however instruct the linker to export symbols, then you will be able to GetProcAddress anything in the exe as well |
17:21:16 | couven92 | Note that the main function (or rather the entry point) is special, and is placed in its own field in the executable header, but normally is NOT in the export table |
17:21:55 | PMunch | Can you tell the linker to export all symbols? |
17:22:02 | PMunch | Or do you have to specify one by one? |
17:22:15 | couven92 | depends on the linker |
17:22:22 | FromGitter | <data-man> @PMunch: See http://www.dyncall.org and http://hg.dyncall.org/pub/dyncall/dyncall/file/ ⏎ It's awesome. |
17:23:20 | couven92 | In Nim you only have to do {.exportc.} or sth. like that and you instruct the linker to export it depending on what compiler backend you use |
17:23:23 | GitDisc | <awr> PMunch: are you doing this in nim or c |
17:23:31 | PMunch | Nim of course :) |
17:23:44 | GitDisc | <awr> you can do {.push exportc, dllexport.} and {.pop.} around the functions you want exported |
17:23:44 | couven92 | (e.g. the ominous `__declspec(dllexport)` marker used in VCC) |
17:24:13 | GitDisc | <awr> not dllexport |
17:24:19 | GitDisc | <awr> sry |
17:24:25 | GitDisc | <awr> i think the pragma is dynlib |
17:24:43 | PMunch | https://github.com/h3rald/min/pull/8/files |
17:24:44 | couven92 | awr nope, dynlib is for import only! |
17:24:48 | PMunch | This is what I'm doing by the way |
17:24:53 | FromGitter | <mratsim> @Araq C++ exceptions are fixed?https://github.com/nim-lang/Nim/issues/6512 |
17:24:56 | couven92 | {.exportc.} will suffice |
17:25:51 | GitDisc | <awr> https://nim-lang.org/docs/manual.html#foreign-function-interface-dynlib-pragma-for-export |
17:25:51 | couven92 | Oh! yeah, be sure to specify a calling convention when exporting! That is kinda important! |
17:26:18 | couven92 | awr, oh, sorry, my mistake |
17:28:46 | * | MyMind joined #nim |
17:30:02 | GitDisc | <awr> {.push.} is weird |
17:30:05 | * | Sembei quit (Ping timeout: 240 seconds) |
17:30:16 | GitDisc | <awr> i've tried to use it to apply pragmas to a bunch of types but they never applied |
17:30:55 | GitDisc | <awr> it works for function decls though |
17:30:57 | GitDisc | <awr> and vars |
17:32:08 | couven92 | I like to do a macro that applies the pragmas for me, instead of using {.push.} |
17:32:17 | couven92 | in my mind that is safer :P |
17:32:27 | PMunch | You also have the pragma pragma |
17:32:32 | miran_ | i'm using re module and trying to match some subgroups. is there a better way than this? |
17:32:37 | miran_ | var matches: array[7, string]; discard line.match(pattern, matches) |
17:33:06 | PMunch | https://nim-lang.org/docs/manual.html#pragmas-pragma-pragma |
17:34:57 | GitDisc | <awr> "pragmas-pragma-pragma" |
17:35:03 | GitDisc | <awr> That's a little rendudant |
17:35:20 | couven92 | PMunch, yes that is nice, but you still have to apply the pragma on every proc |
17:35:55 | PMunch | Oh yeah, I though that's what you was doing with the macro |
17:36:31 | couven92 | nope, i recuse through an entire ast block and put everything I want annotated in it :P |
17:36:50 | PMunch | Hmm, is there a way to call getAst on a NimNode |
17:36:50 | couven92 | that way I can annotate several hundred symbols all in one go! :D |
17:37:09 | PMunch | If I find a template in my AST tree |
17:37:17 | couven92 | PMunch, yes so? |
17:37:28 | PMunch | Huh? |
17:43:17 | * | Arrrr quit (Ping timeout: 260 seconds) |
17:45:26 | PMunch | couven92, do you know how to call a NimNode with getAst? |
17:45:50 | * | miran_ quit (Ping timeout: 255 seconds) |
17:46:04 | couven92 | huh? elaborate? and why would you do that, and most importantly: what the hell is getAst? |
17:46:45 | PMunch | Oh sorry, I though you were commenting on my last question :P |
17:47:20 | PMunch | Well, I have a macro that looks at some AST. When it finds a template I would like to evaluate it and get the AST it has |
17:47:27 | PMunch | So I can look at that AST as well |
17:49:52 | couven92 | PMunch, my usual pragma looks like this: https://github.com/couven92/nim-windowssdk/blob/master/src/windowssdk/ansiwide.nim |
17:50:07 | FromGitter | <data-man> Does anyone have any experience of writing Nim compiler plugins? |
17:50:21 | PMunch | couven92, I've moved on to a completely different subject :P |
17:50:24 | * | tdc quit (Read error: Connection reset by peer) |
17:50:47 | FromGitter | <Yardanico> @data-man probably @Araq :P |
17:51:30 | * | tdc joined #nim |
17:51:57 | FromGitter | <data-man> Of course excluding him :) |
17:52:14 | FromGitter | <Yardanico> why you don't ask him directly? |
17:52:21 | FromGitter | <Yardanico> he knows everything about nim compiler :P |
17:52:40 | FromGitter | <Yardanico> there are not many compiler plugins: https://github.com/nim-lang/Nim/tree/devel/compiler/plugins |
17:53:22 | FromGitter | <data-man> I'm sure that he has so many more important tasks |
17:53:45 | FromGitter | <Yardanico> ask on the forum |
17:53:45 | FromGitter | <Yardanico> he'll answer when he has free time :) |
17:54:33 | FromGitter | <Yardanico> @data-man btw, where did you find Nim ? :) |
17:55:40 | FromGitter | <mratsim> I hate C++ with its extra long build time to just to fail right during linking |
17:55:41 | FromGitter | <data-man> A new live stream should be about the compiler plugins! :) |
17:56:49 | FromGitter | <Yardanico> it'll probably be about karax & ormin |
17:57:36 | FromGitter | <data-man> @Yardanico: I do not remember where, maybe in Google :) |
17:58:31 | * | miran_ joined #nim |
18:06:30 | FromGitter | <data-man> A few years ago I was looking for a better replacement for C++. ⏎ Tried the Nim, but eventually chose D. ⏎ Now I'm back to nim. :) |
18:15:34 | GitDisc | <treeform> Yardanico, https://github.com/Araq/ormin looks pretty cool I did not see that before |
18:15:58 | GitDisc | <treeform> this is the one I found https://github.com/nanoant/nim-orm |
18:16:34 | GitDisc | <treeform> it only seems to support the were clause |
18:27:22 | * | nsf quit (Quit: WeeChat 1.9) |
18:37:06 | * | JappleAck joined #nim |
18:56:24 | Araq | btw I uploaded the new video to youtube |
18:56:42 | Araq | still waiting for you guys to send me a better mic ;-) |
19:01:03 | * | Vladar quit (Remote host closed the connection) |
19:20:50 | FromGitter | <mratsim> “Google Summer of Code, mentor: Araq, task: find a better mic" |
19:26:49 | FromGitter | <data-man> Autumn or winter closer :) |
19:42:52 | Araq | data-man: if tinyc works for you, I'll merge it but it sucks it doesn't work on Windows |
19:43:03 | Araq | but I don't remember if it ever worked on windows |
19:48:32 | * | Jesin quit (Quit: Leaving) |
19:48:36 | * | nsf joined #nim |
19:52:39 | FromGitter | <Yardanico> Araq: your opinion on https://github.com/nim-lang/Nim/issues/6618 ? |
19:53:29 | FromGitter | <data-man> @Araq: No, tinyc doesn't work on Linux as expected. I will continue to work on this. |
19:54:25 | Araq | ok |
19:54:39 | FromGitter | <data-man> After merging :) |
19:59:57 | * | dddddd quit (Ping timeout: 240 seconds) |
20:01:36 | * | dddddd joined #nim |
20:03:38 | FromGitter | <data-man> Wow! https://github.com/jangko/nimJIT ⏎ Very interesting, like the xbyak. |
20:06:41 | * | JappleAck quit (Quit: Leaving) |
20:12:42 | FromGitter | <data-man> @Araq: What tools do you use to debug the compiler? I found this: https://github.com/petermora/nimTracelog |
20:13:13 | FromGitter | <mratsim> @data-man JIT in 1000 lines? is that a code golf? xD |
20:14:11 | * | yglukhov quit (Read error: Connection reset by peer) |
20:14:17 | GitDisc | <treeform> probably not a full jit |
20:14:47 | * | yglukhov joined #nim |
20:14:56 | * | miran_ quit (Quit: Leaving) |
20:15:13 | FromGitter | <data-man> Yes, it looks like the author abandoned the project :( |
20:21:04 | FromGitter | <Yardanico> well he just made a PoC |
20:21:09 | FromGitter | <Yardanico> maybe he didn't want to create a full JIT |
20:21:45 | PMunch | There should be a pragma for macros and templates that evaluates them before passing the AST to a macro |
20:21:49 | GitDisc | <treeform> why do we need a jit? I would find straight x86 code generation cool, but I guess that would work for a jit too... |
20:22:58 | Araq | data-man: I use 'koch temp' plus writeStackTrace, if cond: echo n |
20:25:50 | * | gokr joined #nim |
20:34:14 | * | rauss quit (Read error: Connection reset by peer) |
20:34:49 | FromGitter | <data-man> @Araq: Thanks! |
20:35:30 | Araq | you can watch me debug the compiler on youtube lol |
20:38:00 | * | rauss joined #nim |
20:39:01 | FromGitter | <data-man> I'm now downloading all your videos using youtube-dl :) ⏎ There are only 4 of them? |
20:39:35 | couven92 | more to come in the future :) |
20:41:27 | FromGitter | <data-man> @Araq: In which video are you talking about debugging the compiler? |
20:41:39 | Araq | "random bugfixing" |
20:43:25 | FromGitter | <data-man> Thanks, before going to bed I'll take a look. Probably, after watching, I will not sleep at all. :) |
20:43:35 | GitDisc | <treeform> link to youtube video? |
20:43:59 | FromGitter | <data-man> https://www.youtube.com/watch?v=E2qlDKm_WzE |
20:44:20 | GitDisc | <treeform> thanks! |
20:58:02 | FromGitter | <data-man> Also, see Dominik's channel: https://www.youtube.com/user/d0m96 |
21:00:08 | * | nsf quit (Quit: WeeChat 1.9) |
21:00:48 | FromGitter | <stisa> uh, float32 comparisons with float literals are interesting https://play.nim-lang.org/?gist=857d0d9bd1d41ac1fc167d755432f1c1 , I'm guessing the compiler optimizes the second `echo` to `echo true` ? |
21:09:18 | * | tdc quit (Ping timeout: 246 seconds) |
21:10:57 | * | cspar_ joined #nim |
21:13:52 | * | cspar quit (Ping timeout: 260 seconds) |
21:17:59 | * | Viktor quit (Quit: Viktor) |
21:26:10 | FromGitter | <data-man> https://github.com/alehander42/roswell looks promising |
21:26:29 | FromGitter | <Gooseus> oh man, finally got a successful s3 download using this sigv4 I've been messing with for a day or |
21:32:42 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
21:45:32 | Araq | http://cr.yp.to/antiforgery/cachetiming-20050414.pdf |
21:56:13 | PMunch | Gooseus, yeah the s3 signing thing is insane.. |
21:56:41 | PMunch | Had to implement it once, in Action Script.. |
21:59:42 | * | voiceftp quit (Remote host closed the connection) |
22:00:00 | * | voiceftp joined #nim |
22:00:07 | FromGitter | <data-man> It would be nice to add mbedtls support to Nim. Curl can use this library. |
22:07:52 | PMunch | https://nim-lang.org/docs/manual.html#pragmas-immediate-pragma |
22:08:04 | PMunch | Hmm, the link here points to something which isn't it the manual any longer |
22:11:16 | * | voiceftp quit (Remote host closed the connection) |
22:11:45 | * | voiceftp joined #nim |
22:13:19 | * | PMunch quit (Quit: leaving) |
22:17:01 | * | zolk3ri joined #nim |
22:18:24 | FromGitter | <Varriount> @Gooseus Yay! |
22:18:35 | FromGitter | <Varriount> What was wrong with the original code? |
22:19:59 | * | Trustable quit (Remote host closed the connection) |
22:22:45 | FromGitter | <Gooseus> <PMunch> yeah, I did it a long time ago and it was the v2 and was slightly less of a pain in the ass |
22:24:19 | FromGitter | <Gooseus> @Varriount I mostly used your code for reference, but what was wrong with mine was just being dumb with my patterns... I was adding the headers for the request to the client.headers and then processing the client.headers.table to get the canonical header string and sending the request off |
22:25:13 | FromGitter | <Gooseus> problem was that the the Host header I was adding was being added directly by the HttpClient and then my Host header was being added as extraHeaders |
22:25:34 | FromGitter | <Gooseus> I don't know how AWS processed that, but having two host headers is 403 Forbidden |
22:28:38 | FromGitter | <Gooseus> actually, don't know if how i described it was how it was happening... but I finally found it by writing a low level node server to output the raw request it was receiving |
22:29:54 | FromGitter | <Gooseus> the node http module doesn't expose the raw request and the req.headers is a dictionary that would just copy over the same key if there were two |
22:33:25 | FromGitter | <Gooseus> I'm trying to formalize a couple of these AWS test suite examples they have with the sign_aws4.nim module... or maybe aws4sig.nim... is there a naming convention for modules? |
22:38:41 | * | NimBot joined #nim |
22:41:50 | Araq | aws4sig seems better |
23:14:09 | * | couven92 quit (Quit: Client Disconnecting) |
23:15:15 | * | elrood quit (Quit: Leaving) |
23:15:20 | * | nsf joined #nim |
23:15:57 | dom96 | I tend to avoid underscores for module when possible |
23:16:58 | dom96 | *module names |
23:21:52 | Araq | good news, looks like 'no nil' for strings and seqs will come for v0.18 |
23:31:24 | * | yglukhov quit (Remote host closed the connection) |
23:31:59 | * | yglukhov joined #nim |
23:37:37 | * | yglukhov quit (Ping timeout: 248 seconds) |