00:02:03 | Varriount | onionhammer: Believe me, as soon as I have the time to look into it, I will. |
00:02:42 | * | jokra quit (Ping timeout: 246 seconds) |
00:03:25 | * | jokra joined #nim |
00:06:18 | * | Trustable quit (Quit: Leaving) |
00:08:27 | * | jokra quit (Ping timeout: 264 seconds) |
00:08:56 | Mat4 | ciao |
00:09:00 | * | Mat4 left #nim (#nim) |
00:12:23 | * | keyle joined #nim |
00:15:36 | joecodes | dom96: still having trouble with async jester. I try this: https://gist.github.com/anonymous/d3e68ca2e69ab1602479 and when I go to http://localhost:1234/s/100 it blocks all other requests |
00:16:04 | keyle | hi |
00:16:34 | dom96 | joecodes: db_mysql isn't async |
00:17:22 | joecodes | doh! ok. do you know if anyone is working on making one? or any other async db libraries? |
00:19:36 | Araq | joecodes: I think you need to use gokr's spawning server for now. |
00:19:39 | EXetoC | I wish I had time to make an async mongodb lib |
00:19:55 | dom96 | joecodes: I'm not aware of one. |
00:20:27 | dom96 | joecodes: Under normal usage the blocking version should be good enough. |
00:21:10 | EXetoC | I need to check again if the C lib supports non-blocking operations |
00:21:36 | EXetoC | it should imo |
00:21:56 | joecodes | ok, I will look for gokr's spawning server. i can't let mysql block for that long, also hopefully their is an async httpclient because will need to do some of that as well. |
00:23:07 | Araq | EXetoC: yeah if only OSes could execute other stuff when something blocks ... oh wait ... they can do that since the 60ies |
00:26:31 | dom96 | joecodes: Why would mysql block for 100 seconds under normal usage? |
00:26:46 | EXetoC | Araq: I'm referring to non-blocking calls (polling for completion) |
00:26:58 | EXetoC | seems like an essential thing to provide in a db lib |
00:27:14 | dom96 | EXetoC: It does support them. |
00:27:23 | Araq | EXetoC: I know what you're talking about |
00:27:24 | joecodes | it won't. but maybe sometimes 2 or 3 seconds, and don't want other clients blocked while it does the queries |
00:28:28 | EXetoC | dom96: the mongodb C lib? |
00:29:04 | dom96 | EXetoC: I bet it does. |
00:29:26 | Araq | EXetoC: but this hunt for everything async is childish |
00:30:08 | dom96 | Araq: What do you mean? |
00:33:14 | Araq | dom96: it's usually done by the people who don't have to care really. |
00:33:22 | * | yonson quit (Read error: Connection reset by peer) |
00:34:43 | * | Hakaslak quit (Quit: TODO: Generate 'Computer Sleep Quit Message') |
00:35:26 | EXetoC | dom96: I don't think so |
00:36:07 | joecodes | dom96: is this the spawn server you were talking about: http://goran.krampe.se/2014/10/25/nim-socketserver/ ? performance sounds awesome, could jester use that same technique? |
00:36:38 | dom96 | joecodes: I wasn't talking about it, Araq was. |
00:37:46 | Araq | joecodes: yes and that is not even optimized. it does a pretty expensive deepCopy for the sockets buffer. |
00:40:07 | dom96 | That code cheats a bit. It just reads the first line from the client. |
00:40:44 | joecodes | oh yeah :-). anyways, his numbers look great. i have to say, if i could find a programmer friendly webserver like jester that makes everything transparently async it would be a godsend. |
00:49:06 | * | gokr1 left #nim (#nim) |
00:50:47 | dom96 | joecodes: I think I will try to improve asynchttpserver by combining spawn and async together. |
00:51:36 | Araq | dom96: please start with a test so that we can officially support spawn with async |
00:52:09 | dom96 | I'd rather get NimBuild going first. |
00:52:18 | Araq | it's bad we tell people "er, you can use one or the other but we never tested both in combination" |
00:52:39 | Araq | ok ok, go ahead |
00:52:40 | dom96 | You can use threads and async. I tested that. |
00:52:51 | Araq | :O |
00:53:07 | dom96 | Perhaps that is how I should scale it to multiple cores anyway. |
00:53:12 | * | gokr quit (Quit: IRC for Sailfish 0.8) |
00:54:10 | dom96 | I don't think there is any way for this to work. |
00:54:37 | dom96 | Because we once again go back to the problem of callbacks being executed in different threads... |
00:56:10 | dom96 | I'll think about it some more. |
00:56:32 | Araq | you can pass a closure iterator to some other thread via spawn |
00:57:23 | joecodes | dom96: i wonder if spawn is the usual way to go? otherwise have to make sure code you are using is async? my use cases are like this normally: request -> make outbound soap request to another server -> parse response -> send to user. I'm guessing with spawn I don't need to worry about whether soap library is async or not... and when manager decides to give away 5000 starbuck cards you don't have to spin up a gazillion f |
00:57:35 | dom96 | I think it might just work. These callbacks shouldn't reference global variables anyway... maybe. |
00:59:20 | dom96 | joecodes: What happens when all your threads block? |
01:01:19 | joecodes | hair falls out? I wonder how many simultaneous can handle? for my case 1000 is sufficient. |
01:01:47 | dom96 | I don't know. I'm not sure how spawn works. |
01:02:10 | dom96 | Araq? |
01:03:02 | Araq | dom96: it creates new threads on demand but only up to 100 or something |
01:03:38 | dom96 | so if 100 get blocked you're basically screwed? |
01:05:01 | Araq | well the limit is 256, just checked. but yeah. |
01:05:59 | dom96 | If you want to handle 1K connections then you definitely need async. |
01:06:15 | ldlework | ekarlso-: did you get it? |
01:06:32 | Araq | dom96: that's a brave statement :-) |
01:08:49 | Araq | dom96: he could also set the thread limit to 100_000 ... 64bit Linux can handle that, I think |
01:09:29 | Araq | and reduce the stack size on creation perhaps |
01:10:08 | Araq | though the "heap per thread" is ... suboptimal for so many threads |
01:18:20 | * | Sergio965 joined #nim |
01:37:40 | * | enquora quit (Quit: enquora) |
01:39:02 | * | joecodes quit (Ping timeout: 245 seconds) |
01:44:43 | * | BitPuffin joined #nim |
01:59:56 | * | flaviu quit (Remote host closed the connection) |
02:00:10 | * | flaviu joined #nim |
02:01:55 | * | mwbrown joined #nim |
02:04:52 | * | VinceAddons quit (Read error: Connection reset by peer) |
02:24:47 | * | gmpreussner joined #nim |
02:25:13 | * | jefus_ joined #nim |
02:26:35 | * | mwbrown quit (Quit: Leaving) |
02:26:54 | * | BitPuffin quit (Ping timeout: 245 seconds) |
02:29:35 | * | jefus quit (Ping timeout: 272 seconds) |
02:39:03 | * | gmpreussner quit (Ping timeout: 244 seconds) |
02:39:10 | * | gmpreussner joined #nim |
02:47:39 | * | darkf joined #nim |
02:53:24 | * | girvo joined #nim |
02:53:28 | girvo | Hi all :) |
02:54:00 | girvo | quick q: i'm trying to compile a simple raytracer that I found in the forums, but it gives me "Error: undeclared identifier: 'Float'" |
02:54:06 | girvo | Code is here: https://gist.githubusercontent.com/AdrianV/5774141/raw/6c243c54f5c81389bbf6ad9f9c224afdb6019fec/raytracer.nim |
02:54:19 | girvo | I'm guessing its written for an older version of nim? I'm running the latest compiler, on OS X 10.10 |
02:55:30 | girvo | Oh, also, the title for the forum is still set as "Nimrod" instead of nim :3 |
02:55:49 | girvo | Specifically on the "Search Results" page |
02:58:33 | def- | girvo: float instead of Float |
02:58:37 | keyle | girvo: have you tried changing all mentions of float instead of Float |
02:58:48 | keyle | what he said. |
02:59:20 | EXetoC | and :%s/\<T[A-Z]//g |
03:00:22 | flaviu | :%s/T\([A-Z]\)/\1/g |
03:01:37 | EXetoC | or that, if you want to keep the other char :p |
03:02:39 | girvo | That's exactly what I did :) |
03:03:01 | girvo | Now I've just got to get these types passing, it seems he's using an array as a vector somewhere in here, going to have a crack at it |
03:03:10 | girvo | `template newVec3(x: float): TVec3 = [x,x,x] |
03:03:28 | girvo | Is called here, but errors: let eye = newVec3(0) |
03:03:39 | girvo | `Error: type mismatch: got (Array constructor[0..2, int]) but expected 'TVec3'` |
03:03:58 | EXetoC | yes, because those are ints |
03:04:31 | EXetoC | huh |
03:04:49 | EXetoC | I don't know what's going on |
03:05:20 | def- | so many case problems =/ |
03:05:50 | EXetoC | girvo: no modifications to newVec3? |
03:06:02 | EXetoC | try proc instead of templates. no need for a template either way |
03:06:06 | def- | EXetoC: i think that's a change in the compiler, i noticed that as well |
03:06:20 | def- | not sure if that is intentional |
03:07:09 | EXetoC | seems unlikely |
03:07:12 | def- | Like this it works, girvo: https://gist.github.com/def-/476f4f0190438a4d502d |
03:13:40 | * | gmpreussner quit (Ping timeout: 244 seconds) |
03:13:40 | * | gmpreussner_ joined #nim |
03:13:53 | * | vezzy quit (Ping timeout: 240 seconds) |
03:14:14 | * | quasinoxen joined #nim |
03:19:31 | * | dts|pokeball quit (Read error: Connection reset by peer) |
03:20:00 | * | dtscode joined #nim |
03:22:47 | * | Sergio965 quit (Quit: Bye! :)) |
03:26:22 | * | dtscode quit (Quit: ZNC - http://znc.in) |
03:26:47 | * | dtscode joined #nim |
03:28:06 | * | gmpreussner__ joined #nim |
03:28:39 | * | gmpreussner_ quit (Ping timeout: 244 seconds) |
03:29:16 | * | brson quit (Quit: leaving) |
03:32:19 | * | gmoore joined #nim |
03:34:38 | girvo | Is it possible to access SDL1 in nim? |
03:34:45 | girvo | 1.2 specfically |
03:37:32 | fowl | sdl package for nimble |
03:42:39 | * | EXetoC quit (Ping timeout: 264 seconds) |
03:43:00 | * | superfunc joined #nim |
03:51:25 | * | superfunc quit (Ping timeout: 246 seconds) |
03:57:54 | * | vendethiel quit (Ping timeout: 244 seconds) |
04:07:24 | * | gmpreussner__ quit (Ping timeout: 244 seconds) |
04:07:34 | * | gmpreussner__ joined #nim |
04:14:21 | dtscode | hey... how come when i do resp title("Teamspeak Info") in jester it doesnt show at the title? |
04:17:19 | keyle | url? |
04:17:40 | dtscode | ? |
04:17:54 | keyle | I meant show me the generated |
04:18:10 | dtscode | oh ok. hold on |
04:20:45 | * | superfunc joined #nim |
04:21:11 | keyle | I don't see title in the sources except for exception somehow |
04:22:47 | dtscode | http://dtscode.io/teamspeak3/info |
04:23:02 | dtscode | theres the generarted source |
04:25:53 | * | vezzy joined #nim |
04:26:13 | * | quasinoxen quit (Ping timeout: 265 seconds) |
04:26:13 | * | girvo quit (Ping timeout: 265 seconds) |
04:27:33 | * | vendethiel joined #nim |
04:34:02 | keyle | ok |
04:34:25 | keyle | looking at the source it doesn't even generate <html><body> |
04:34:42 | keyle | is there some sort of html template you can wrap around? |
04:34:58 | keyle | title should be part of <html><head> |
04:42:57 | dtscode | it doesnt have to be though |
04:46:00 | * | MattAitchison joined #nim |
04:49:55 | * | vendethiel quit (Ping timeout: 255 seconds) |
04:52:25 | * | ARCADIVS joined #nim |
04:52:31 | ldlework | Is there any reflection mechanism for iterating the procs that have a certain signature or anything like that? |
04:55:46 | * | superfunc quit (Quit: Page closed) |
04:58:52 | keyle | dtscode: no but it should |
04:59:02 | * | gmpreussner___ joined #nim |
04:59:04 | * | gmpreussner__ quit (Ping timeout: 244 seconds) |
05:05:51 | keyle | if jester was to ever pump out a title tag, it'd most likely be in the head tag |
05:06:13 | keyle | so if you don't have an html and head tag, that may very well be the problem |
05:06:37 | keyle | but as I said I couldn't see title in the jester repo (had a quick look only) |
05:09:35 | * | vendethiel joined #nim |
05:13:07 | * | keyle quit (Quit: leaving) |
05:24:03 | * | BitPuffin joined #nim |
05:28:31 | * | BitPuffin quit (Ping timeout: 244 seconds) |
05:29:00 | * | MattAitchison quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
05:30:15 | * | vendethiel quit (Ping timeout: 256 seconds) |
05:38:18 | * | MattAitchison joined #nim |
05:43:28 | * | vendethiel joined #nim |
05:45:42 | ldlework | Is there currently a bug where user-typeclass constraints on generic discriminators are not enforced? |
05:52:36 | * | MattAitchison quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
06:06:14 | * | vendethiel quit (Ping timeout: 244 seconds) |
06:10:04 | * | vendethiel joined #nim |
06:42:10 | * | VinceAddons joined #nim |
06:52:44 | * | vendethiel quit (Ping timeout: 244 seconds) |
06:54:51 | * | Demon_Fox joined #nim |
06:56:31 | * | vendethiel joined #nim |
07:02:18 | * | nimnoob joined #nim |
07:05:16 | * | keyle joined #nim |
07:05:37 | * | gmpreussner joined #nim |
07:05:39 | * | gmpreussner___ quit (Ping timeout: 244 seconds) |
07:11:27 | * | nimnoob quit (Ping timeout: 246 seconds) |
07:12:49 | * | Jesin quit (Quit: Leaving) |
07:13:34 | * | Jesin joined #nim |
07:17:19 | * | vendethiel quit (Ping timeout: 245 seconds) |
07:25:19 | * | nande quit (Remote host closed the connection) |
07:31:23 | * | HakanD joined #nim |
07:32:34 | * | gour joined #nim |
07:58:52 | * | gmpreussner quit (Ping timeout: 244 seconds) |
07:59:03 | * | gmpreussner joined #nim |
08:15:52 | * | gokr joined #nim |
08:17:05 | dtscode | keyle, i figured it out. take a look at the nim forum source. they use raw html with jester. kind of a RoR aproach it looks like |
08:17:30 | keyle | ok |
08:18:17 | dtscode | thanks for the help though |
08:30:15 | * | VinceAddons quit (Read error: Connection reset by peer) |
08:32:30 | * | vendethiel joined #nim |
08:33:01 | * | VinceAddons joined #nim |
08:33:41 | * | VinceAddons quit (Read error: Connection reset by peer) |
08:43:27 | * | HakanD quit (Quit: Be back later ...) |
08:48:47 | * | jsudlow quit (Ping timeout: 244 seconds) |
08:52:46 | * | jsudlow joined #nim |
09:03:58 | * | sillesta joined #nim |
09:05:58 | * | BlaXpirit joined #nim |
09:08:33 | * | Trustable joined #nim |
09:10:30 | * | Sphax joined #nim |
09:11:31 | * | jbe_ joined #nim |
09:12:27 | * | jbe_ quit (Client Quit) |
09:16:07 | * | jbe_ joined #nim |
09:16:16 | * | jbe_ quit (Client Quit) |
09:19:19 | dtscode | dom96, how does the nimforum code execute the .tmpl files? |
09:24:03 | Araq | dtscode: it doesn't. the compiler compiles them to Nim code. |
09:26:19 | dtscode | Araq, oh |
09:28:14 | dtscode | where are the vim/gedit syntax highlighting files? |
09:28:42 | dtscode | nvr mnd |
09:41:16 | sillesta | how do you 'echo "foo"' without a newline? |
09:42:15 | BlaXpirit | stdout.write |
09:42:16 | BlaXpirit | maybe |
09:42:35 | ekarlso- | Araq: looks like mysql has async c stuffs ? http://jan.kneschke.de/2008/9/9/async-mysql-queries-with-c-api/ |
09:42:39 | sillesta | thanks |
09:42:41 | ekarlso- | regarding the earlier discussion |
09:49:31 | * | HakanD joined #nim |
09:55:01 | ekarlso- | does nim have something for base64url ? |
09:56:31 | BlaXpirit | ekarlso-, elaborate |
09:56:35 | BlaXpirit | what does the "url" part change? |
09:56:44 | BlaXpirit | ...or i can google... |
09:57:34 | ekarlso- | http://en.wikipedia.org/wiki/Base64 < BlaXpirit base64url part there.. |
09:57:36 | * | gmpreussner_ joined #nim |
09:57:41 | BlaXpirit | well, ekarlso-, http://nim-lang.org/base64.html#decode,string |
09:57:42 | * | gmpreussner quit (Ping timeout: 244 seconds) |
09:57:48 | ekarlso- | basically url / filename safe stuff |
09:58:57 | BlaXpirit | ok the module is obviously barebones |
10:01:10 | BlaXpirit | ekarlso-, you just need to replace the characters |
10:02:04 | * | gmpreussner__ joined #nim |
10:02:21 | * | gmpreussner_ quit (Ping timeout: 244 seconds) |
10:02:50 | BlaXpirit | i really don't understand what that newline stuff is doing in base64 module |
10:03:10 | ekarlso- | maybe dom96 knows (: |
10:03:41 | BlaXpirit | i mean, i do know, but it's just poor design |
10:06:11 | BlaXpirit | omg, i still can't figure out which characters this module produces |
10:06:32 | BlaXpirit | A-Z a-z + = but what is the other one? |
10:07:11 | BlaXpirit | ok it's / |
10:08:14 | BlaXpirit | ekarlso-, |
10:08:18 | BlaXpirit | base64.encode(s).replace('+', '-').replace('/', '_') |
10:08:20 | BlaXpirit | sigh |
10:11:11 | ekarlso- | :D |
10:11:59 | BlaXpirit | and watch out for the idiotic newline functionality |
10:22:17 | * | ARCADIVS quit (Quit: ARCADIVS) |
10:28:32 | * | gmpreussner___ joined #nim |
10:29:13 | * | gmpreussner__ quit (Ping timeout: 244 seconds) |
10:33:06 | ekarlso- | :D |
10:34:55 | * | JinShil joined #nim |
10:46:16 | * | Etheco- joined #nim |
11:18:21 | * | gour_ joined #nim |
11:21:59 | * | gour quit (Ping timeout: 264 seconds) |
11:31:31 | * | HakanD quit (Read error: Connection reset by peer) |
11:41:10 | ekarlso- | so what does .final and pure mean ? |
11:43:25 | * | jlebrech joined #nim |
11:50:31 | Araq | ekarlso-: pretty much nothing anymore |
11:55:07 | ekarlso- | Araq: k |
11:55:11 | ekarlso- | Araq: proc HMAC_CTX_init*(ctx: ptr HMAC_CTX) = {.cdecl, importc.} |
11:55:16 | ekarlso- | shouldn't that be valid ? :/ |
11:55:29 | Araq | get rid of the '=' |
11:55:42 | ekarlso- | kewl :) |
12:19:34 | * | BlaXpirit_ joined #nim |
12:19:53 | BlaXpirit_ | how to check if a seq is nil? |
12:20:14 | BlaXpirit_ | oh |
12:20:16 | BlaXpirit_ | isNil |
12:20:18 | BlaXpirit_ | what a dummy |
12:21:02 | * | matkuki joined #nim |
12:22:36 | * | gour_ is now known as gour |
12:31:14 | * | jlebrech quit (Remote host closed the connection) |
12:35:06 | ekarlso- | BlaXpirit_: what you building in nim ? |
12:37:54 | BlaXpirit_ | ekarlso-, trying to port docopt now, previously https://github.com/search?q=user%3Ablaxpirit+nim |
12:38:11 | * | BlaXpirit_ quit (Quit: Quit Konversation) |
12:38:26 | ekarlso- | kewl! |
12:40:32 | * | zahary_ joined #nim |
12:40:47 | ekarlso- | got a fully working hmac binding at least :D |
12:48:45 | * | JinShil quit (Quit: Konversation terminated!) |
12:48:58 | ekarlso- | so what is the diff between cstring and cuchar ? |
12:50:30 | Araq | if you need to ask this question you should use cstring |
12:55:38 | ekarlso- | hmmm, what's a openssl ENGINE ? |
12:55:42 | ekarlso- | ref https://www.openssl.org/docs/crypto/hmac.html |
12:57:03 | * | gunn quit (Ping timeout: 264 seconds) |
13:00:56 | * | yonson joined #nim |
13:02:45 | BlaXpirit | how to get the name (string) of the type of a variable |
13:05:06 | BlaXpirit | "".type.name == "string" woot |
13:05:55 | ekarlso- | hmm, what type would map to a openssl engine ? :/ |
13:05:58 | ekarlso- | https://www.openssl.org/docs/crypto/engine.html |
13:08:10 | Araq | ekarlso-: an object |
13:08:25 | Araq | you can be 99% sure it's a struct in C |
13:13:26 | ekarlso- | Araq: how you init a object again :/ |
13:14:45 | Araq | Obj(memory: 12.oclock, until: noon) |
13:15:32 | ekarlso- | hmac.nim(109, 22) Error: object constructor needs an object type hmm |
13:24:02 | * | gunn joined #nim |
13:25:05 | * | gokr quit (Quit: Leaving.) |
13:27:01 | BlaXpirit | how to check if an object is of a type? |
13:27:09 | BlaXpirit | how to check if an object is of a type or its subclass? |
13:27:14 | Araq | BlaXpirit: 'of' operator |
13:27:28 | BlaXpirit | Araq, of operator does one of these (which one i'm not sure) |
13:27:32 | BlaXpirit | so how to do the other one? |
13:28:00 | BlaXpirit | I'm talking about ref objects |
13:28:15 | Araq | that doesn't matter. it's "of". |
13:28:29 | BlaXpirit | [:26:47] <BlaXpirit> Araq, of operator does one of these (which one i'm not sure) |
13:28:49 | Araq | if foo of SomeSubClass: |
13:29:04 | Araq | of is Java's instanceof |
13:29:08 | BlaXpirit | type B = ref object of A |
13:29:25 | BlaXpirit | var x: A = B() |
13:30:34 | BlaXpirit | both x of A and x of B are true |
13:30:53 | Araq | yes |
13:31:03 | Araq | like Java's instanceof. |
13:31:31 | BlaXpirit | Araq, so the question is, how to get an operation that returns true for B but false for A |
13:31:56 | Araq | x of B returns false if x is only an A. |
13:33:20 | BlaXpirit | uh oh. type(x) is A |
13:33:37 | BlaXpirit | well that probably makes sense, but is not useful to me |
13:34:10 | Araq | if x of B and not (x of C) |
13:35:08 | BlaXpirit | huh |
13:36:30 | BlaXpirit | it's funny how type(x) is A and type(x) is B are valid in both Nim and Python and both give opposite results |
13:37:05 | ekarlso- | Araq: any plans to support something like var foo = ""; foo as cstring ? |
13:37:24 | BlaXpirit | ekarlso-, what do you want? |
13:37:30 | BlaXpirit | there is an implicit conversion |
13:39:06 | Araq | yeah and you can also write foo.cstring |
13:39:23 | ekarlso- | ah |
13:39:45 | BlaXpirit | Araq, so how can I get the actual type of a ref object, not the type of the variable that contains it? |
13:40:25 | Araq | BlaXpirit: oh you can't. and even if you could, you couldn't do anything with it. |
13:40:35 | BlaXpirit | :| |
13:40:51 | BlaXpirit | that probably makes sense |
13:41:33 | ekarlso- | .eval "foo".len |
13:41:36 | Mimbus | ekarlso-: eval.nim(3, 5) Error: value of type 'int literal(3)' has to be discarded |
13:42:07 | Araq | oh god, not again. will Mimbus ever stop to be a shame of humanity? |
13:42:21 | ekarlso- | Araq: sorry ? :p |
13:42:55 | Araq | use the Mimbus in #nim-offtopic |
13:43:14 | ekarlso- | ah ok :) |
13:43:15 | BlaXpirit | Araq, am I really going to do this? https://bpaste.net/show/0b24c7abd6eb |
13:43:42 | ekarlso- | I like it that you can "".len.cint -,,- |
13:43:44 | * | BlaXpirit is trying to port a Python library without understanding it xD |
13:43:51 | Araq | BlaXpirit: yes. for now. |
13:44:09 | BlaXpirit | uh ok. thanks. |
13:45:26 | ekarlso- | should I add the hmac stuff to the wrappers or ? |
13:46:07 | BlaXpirit | what do you mean "add" and why do you need to do this? |
13:46:20 | ekarlso- | BlaXpirit: jwt uses it for hs256 |
13:47:37 | Araq | ekarlso-: don't put it on Nimble before somebody did a serious code review as you don't know what you're doing. no offense. |
13:47:59 | ekarlso- | Araq: ey, fine :) |
13:48:04 | ekarlso- | Araq: i'm just trying to learn :p |
13:50:41 | Araq | fun fact: cmd.exe can run .bat files with unix line endings. |
13:52:35 | * | jpoirier quit (Quit: Leaving) |
13:53:56 | ekarlso- | I hope all my stupid questions are weclome ;) |
13:55:26 | Araq | ekarlso-: sure. as long as you can handle my sarcasm. |
13:55:31 | ekarlso- | :P |
13:55:45 | * | VinceAddons joined #nim |
14:04:42 | * | seemsindie joined #nim |
14:04:56 | Araq | hi seemsindie welcome |
14:06:47 | Varriount | BlaXpirit: I've done that before... It makes finding bugs... interesting |
14:06:57 | BlaXpirit | Varriount, cheers |
14:07:40 | Varriount | Though, depending on the similarities between languages, not *too* hard to do. |
14:10:31 | * | BitPuffin joined #nim |
14:11:43 | BlaXpirit | flaviu, how is the progress on regex library? |
14:16:48 | * | keyle quit (Read error: Connection reset by peer) |
14:19:57 | matkuki | If i have an object 'MyObject = ref object' with 5 attributes, but I initialize it with 'myobject :MyObject = MyObject()', are the attributes left uninitialized? |
14:21:04 | BlaXpirit | everything is initialized to binary zero |
14:21:18 | matkuki | BlaXpirit: Thanks. |
14:25:20 | * | jefus__ joined #nim |
14:27:39 | * | Jesin quit (Quit: Leaving) |
14:28:57 | * | jefus_ quit (Ping timeout: 244 seconds) |
14:34:49 | * | johnsoft quit (Ping timeout: 256 seconds) |
14:43:14 | * | gokr joined #nim |
14:43:25 | * | gokr quit (Remote host closed the connection) |
14:43:50 | BlaXpirit | why am I getting expression re'...' cannot be called? |
14:44:38 | BlaXpirit | echo source.find_all(re"<\S*?>")[0] inside a proc |
14:44:39 | BlaXpirit | doesn't work |
14:46:39 | * | jokra joined #nim |
14:48:43 | * | Jesin joined #nim |
14:49:49 | * | MattAitchison joined #nim |
14:52:57 | * | Sphax quit (Quit: CYA!!) |
14:53:09 | BlaXpirit | Araq, please check this out. https://bpaste.net/show/773e655480a4 extremely minimal example as usual |
14:53:18 | BlaXpirit | looks like a bug |
14:54:05 | Araq | yup. workaround: re.re("a") |
14:54:32 | BlaXpirit | thanks, Araq. |
14:54:35 | BlaXpirit | should i report this? |
14:54:43 | BlaXpirit | and if so, please tell title |
14:55:10 | Araq | "re binding error in generic" |
14:59:40 | * | gokr joined #nim |
15:02:37 | * | gokr quit (Client Quit) |
15:04:08 | * | EXetoC joined #nim |
15:06:59 | * | atomic-hedgehog joined #nim |
15:17:25 | onionhammer | is that a library error or a compiler error? |
15:17:33 | ekarlso- | flaviu: around mr ? |
15:18:12 | * | gunn quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
15:19:34 | BlaXpirit | onionhammer, compiler error |
15:24:14 | * | gmpreussner___ quit (Ping timeout: 244 seconds) |
15:24:53 | ekarlso- | https://bpaste.net/show/89b5699e685b < why would I get Illegal storage access on #110 there ? |
15:24:55 | * | matkuki quit (Quit: ChatZilla 0.9.91.1 [Firefox 34.0.5/20141126041045]) |
15:26:09 | BlaXpirit | sigh |
15:26:30 | ekarlso- | BlaXpirit: was that sigh for me ? :p |
15:26:32 | BlaXpirit | at the very least try secret[0] instead of secret |
15:26:32 | * | MattAitchison quit (Quit: Textual IRC Client: www.textualapp.com) |
15:26:44 | BlaXpirit | but that's still bad |
15:27:16 | EXetoC | ekarlso-: you mean secret[0].addr? |
15:27:23 | ekarlso- | BlaXpirit: but if you do secret[0] it would be the first character of the string ? |
15:27:55 | BlaXpirit | i got a bit confused too |
15:28:05 | BlaXpirit | yeah, do addr(secret[0]) |
15:28:40 | EXetoC | a string is a length and then a capacity and then a pointer to the actual data or something like that |
15:29:35 | ekarlso- | but rly if you do secret[0] you're using the first character for the key... |
15:29:38 | ekarlso- | which is kinda sad |
15:29:51 | BlaXpirit | sad is what you're doing |
15:30:07 | BlaXpirit | it's probably supposed to be cstring, not pointer, anyway |
15:30:44 | ekarlso- | rly ? I guess I must be blind in that case... |
15:30:59 | ekarlso- | unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len, const unsigned char *d, int n, < that doesn't say cstring... |
15:31:25 | EXetoC | it's not just secret[0], it's secret[0].addr, so an address pointing to the first character |
15:32:08 | EXetoC | ekarlso-: you're right. not that it really matters as long as you shove a pointer in there |
15:32:33 | * | nimnoob joined #nim |
15:33:15 | BlaXpirit | doesn't say cstring but i'm pretty sure it would work :o |
15:33:21 | ekarlso- | sigh |
15:33:40 | BlaXpirit | addr(secret[0]) is the right way to do it |
15:34:12 | ekarlso- | noo..., that would mean if I have "secret" as my key for the signed message it would really get "s" as the key wouldn't it now ? |
15:34:22 | ekarlso- | unless i've smoked something |
15:34:51 | BlaXpirit | just do it |
15:34:59 | EXetoC | addr(secret[0]) means you can treat it as a cstring. the address will that of the first element |
15:35:17 | EXetoC | just as it is for a char*, and nim's strings are also zero-terminated |
15:35:54 | BlaXpirit | ekarlso-, and... please never use cast |
15:36:37 | EXetoC | so str[str.len] (str[str.high + 1]) should be \0 |
15:36:50 | BlaXpirit | well "never" is an exaggeration |
15:37:05 | ekarlso- | I still dont get it why you would pass a partial thing in vs the whole string |
15:37:18 | EXetoC | what partial string? |
15:37:43 | BlaXpirit | ekarlso-, you pass address of the first character |
15:37:44 | ekarlso- | addr(secret[0]) passes only the address of the first element of the string no ? |
15:37:58 | BlaXpirit | then it can keep reading the string by using pointer arithmetic blah blah |
15:38:06 | EXetoC | yes, and char* is essentially an address to the first char, so it's correct |
15:39:10 | ekarlso- | hmmms, that blows my mind kinda... |
15:39:35 | EXetoC | and a char* string is iterated through by incrementing until a \0 has been encountered: "if (ch[curIdx] == '\0') { /* ok this is the end of the string */ }" |
15:39:40 | * | MattAitchison joined #nim |
15:39:47 | * | Demos joined #nim |
15:40:12 | ekarlso- | man, ok I feel wacked -,,- |
15:40:30 | ekarlso- | so when you pass the secret[0].addr it reads the rest of the string from that address or ? |
15:40:35 | BlaXpirit | yes |
15:40:50 | ekarlso- | ok then it all kinda makes a bit more sense -,,- |
15:40:55 | BlaXpirit | i think secret[0].addr is a very confusing way to write it |
15:41:03 | * | jpoirier joined #nim |
15:41:10 | ekarlso- | BlaXpirit: well, openssl.nim has the same syntax |
15:41:12 | ekarlso- | :) |
15:41:15 | BlaXpirit | great example of dot notation abuse |
15:41:31 | BlaXpirit | i like addr(secret[0]) but whatever |
15:41:47 | ekarlso- | or just "addr secret[0]" |
15:42:17 | EXetoC | I disagree |
15:42:32 | EXetoC | ekarlso-: does it work? that syntax has some limitations, which I hope will be fixed, otherwise it'll just get in the way |
15:43:15 | ekarlso- | EXetoC: ya it works :p |
15:43:18 | ekarlso- | dot notation and the other one |
15:43:25 | BlaXpirit | skipping parentheses very rarely works out in Nim |
15:43:36 | ekarlso- | cast[ptr char](addr output2) < what's a better way for that ? |
15:43:55 | ekarlso- | destination is output2: array[32, uint8] |
15:44:25 | * | nimnoob quit (Remote host closed the connection) |
15:44:57 | BlaXpirit | ekarlso-, are you sure it's even needed? |
15:45:04 | BlaXpirit | i'd expect just `addr output1` to work |
15:45:26 | * | AMorpork left #nim ("Leaving") |
15:45:38 | BlaXpirit | the md: cstring part of HMAC is probably wrong |
15:45:55 | BlaXpirit | if it actually expect array of uint8 and not char* |
15:46:20 | ekarlso- | unsigned char *md < that's the c |
15:46:45 | BlaXpirit | unsigned char |
15:46:55 | ekarlso- | that's cstring in nim or ? |
15:47:01 | BlaXpirit | that's not char, so interpreting as cstring can be risky |
15:47:08 | BlaXpirit | unsigned char is nothing but uint8 |
15:47:39 | BlaXpirit | why dont u use c2nim? -_- |
15:47:52 | ekarlso- | BlaXpirit: flaviu tried, this is based on his stuff... |
15:48:06 | ekarlso- | but he didn't add the _init methods just the HMAC |
15:52:56 | ekarlso- | oh well, let it be then for now.. |
15:54:22 | ekarlso- | i'll let flaviu stab it since he knows it :p |
16:01:18 | * | gokr joined #nim |
16:02:00 | * | nimnoob joined #nim |
16:16:01 | * | nimnoob_ joined #nim |
16:16:01 | * | nimnoob quit (Read error: Connection reset by peer) |
16:16:15 | * | eigenlicht quit (Ping timeout: 264 seconds) |
16:30:52 | * | darkf quit (Quit: Leaving) |
16:31:47 | BlaXpirit | I have a seq[tuple[a,b,c]] |
16:31:47 | * | nimnoob_ quit (Read error: Connection reset by peer) |
16:32:10 | BlaXpirit | I want to find the tuple that has the smallest b |
16:32:37 | BlaXpirit | is there any idiom? |
16:32:39 | BlaXpirit | minimum by |
16:32:40 | BlaXpirit | etc |
16:33:42 | BlaXpirit | ah the idiom is < operator :| |
16:35:09 | BlaXpirit | really missing min-by e.g https://docs.python.org/2/library/functions.html#min http://www.preludels.com/#minimum-by |
16:35:20 | ekarlso- | BlaXpirit: u think I should continue hacking on it ? :p |
16:35:33 | BlaXpirit | :| |
16:36:22 | ekarlso- | BlaXpirit: that's motivating :p |
16:40:42 | * | jokra quit (Ping timeout: 244 seconds) |
16:41:49 | * | seemsindie quit (Ping timeout: 252 seconds) |
16:43:32 | * | eigenlicht joined #nim |
16:44:24 | Demos | BlaXpirit, you can define `<` in scope and pull out the minimum tuple |
16:44:37 | BlaXpirit | in scope, huh |
16:44:56 | BlaXpirit | that's a cool idea, i haven't considered this (and started thinking stdlib sux) |
16:45:20 | Demos | yeah, just define `<` right before calling something that uses it |
16:45:32 | Demos | and you do it in function scope, so nobody else sees it |
16:45:35 | BlaXpirit | can even do block: probably |
16:45:39 | Demos | yup! |
16:46:25 | BlaXpirit | thank you |
16:46:46 | Demos | no problem |
16:47:18 | * | nimnoob_ joined #nim |
16:55:10 | * | Demos quit (Ping timeout: 244 seconds) |
16:55:39 | * | BlaXpirit quit (Read error: Connection reset by peer) |
16:55:55 | * | BlaXpirit joined #nim |
16:59:02 | * | eigenlicht quit (Ping timeout: 245 seconds) |
16:59:27 | * | nimnoob_ quit (Ping timeout: 246 seconds) |
17:01:25 | ldlework | ekarlso-: hey did you get your timer demo working? |
17:01:41 | ekarlso- | ldlework: I fell asleep yesterday :p |
17:02:16 | ekarlso- | hmm, BlaXpirit apparantly one shouldn't be doing secret[0].addr twice -,,- |
17:02:29 | BlaXpirit | huh |
17:03:01 | ldlework | ekarlso-: happens. Let me know if you get it. |
17:04:02 | ekarlso- | BlaXpirit: I was doing secret[0].addr in both my HMAC and HMAC_Init_ex calls, it caused it to inv storage access |
17:04:10 | ekarlso- | vs declaring it as a var and passing it |
17:04:15 | * | jpoirier quit (Quit: Page closed) |
17:04:23 | BlaXpirit | i dunno man |
17:04:30 | BlaXpirit | this just needs investigation, needs time |
17:04:37 | BlaXpirit | i'm doing some tedious work of my own here |
17:04:47 | ekarlso- | BlaXpirit: :D |
17:04:56 | ekarlso- | BlaXpirit: hence why I should just continue hacking :P |
17:05:03 | ldlework | ekarlso-: whatcha workin on |
17:05:17 | ekarlso- | ldlework: hmac bindings for ossl |
17:05:23 | ekarlso- | and the jwt stuff |
17:05:35 | * | eigenlicht joined #nim |
17:14:56 | * | jokra joined #nim |
17:19:25 | * | eigenlicht quit (Ping timeout: 272 seconds) |
17:19:38 | EXetoC | ekarlso-: declaring what as a var? it's difficult to infer the semantics based on what you said |
17:20:00 | * | irrequietus joined #nim |
17:20:52 | ekarlso- | var s = "secret"; var sptr = addr s[0] then passing sptr vs calling addrs[0] twice |
17:22:48 | EXetoC | that appears to be identical |
17:23:00 | EXetoC | semantically |
17:23:15 | ekarlso- | EXetoC: well, the sPtr thing works, the other way gives a storage access error |
17:23:36 | ekarlso- | what's a good thing for unsigned char *md ? |
17:25:50 | EXetoC | might be a compiler bug, assuming that what you're saying is correct. show us the new code if you want to get to the bottom of it |
17:26:10 | EXetoC | ekarlso-: I think he told you. unsigned char is basically uint8 |
17:26:47 | ekarlso- | so instead of cast[ptr char](addr output1) u could do addr output1 ? |
17:26:49 | EXetoC | ekarlso-: what's the function name again? and what lib is it a part of? |
17:27:22 | ekarlso- | https://www.openssl.org/docs/crypto/hmac.html < HMAC and HMAC_Update |
17:27:28 | ekarlso- | rather HMAC_Final |
17:28:06 | EXetoC | ekarlso-: the cast will just make it a 'ptr char' rather than a 'ptr whatever'. it might or might not be needed |
17:28:31 | EXetoC | in order to satisfy the compiler that is. try without the cast |
17:29:04 | * | eigenlicht joined #nim |
17:29:42 | EXetoC | ekarlso-: yep, a uint8 sequence seems appropriate for that argument |
17:29:54 | BlaXpirit | sux that try block creates a scope :( |
17:30:53 | * | silven quit (Ping timeout: 240 seconds) |
17:31:01 | EXetoC | you could have such a parameter in a high level wrapper. it's recommended if you want to distribute it |
17:33:32 | ekarlso- | EXetoC: so md5 methods in openssl |
17:39:10 | ekarlso- | EXetoC: what parameter u mean ? |
17:40:29 | EXetoC | ekarlso-: the 'unsigned char' one |
17:43:09 | ekarlso- | EXetoC: funny that openssl.nim md5 methods use cstring for unsigned char* |
17:43:10 | BlaXpirit | [:46:27] <BlaXpirit> unsigned char is nothing but uint8 |
17:43:35 | ekarlso- | BlaXpirit: +1 for me being stupid :p |
17:46:12 | EXetoC | it might be for the sake of convenience |
17:47:27 | * | BitPuffin quit (Ping timeout: 276 seconds) |
17:49:37 | EXetoC | it just needs to be binary compatible, so as to not mess up the stack |
17:58:54 | BlaXpirit | why no seq &= |
18:01:27 | * | jpoirier joined #nim |
18:09:10 | * | joecodes joined #nim |
18:09:15 | EXetoC | I did ask that maybe a year ago. I think it was simply overlooked |
18:11:30 | EXetoC | it's surprising that so few have asked for it. I'll look into it |
18:11:38 | def- | should just be the same as add, right? |
18:11:51 | * | jokra quit (Ping timeout: 256 seconds) |
18:12:38 | EXetoC | that's true |
18:13:21 | def- | Hm, do we really need two procs with different names that do the same? |
18:13:51 | EXetoC | Araq: were we going to get rid of &= or something? |
18:14:39 | BlaXpirit | def-, what? |
18:14:41 | BlaXpirit | add is different |
18:14:44 | BlaXpirit | add adds one thing |
18:14:45 | BlaXpirit | ... |
18:14:54 | def- | BlaXpirit: works with an openarray as well |
18:14:55 | EXetoC | more assumptions |
18:14:57 | BlaXpirit | oh |
18:15:01 | BlaXpirit | ... |
18:15:07 | BlaXpirit | well i missed that |
18:15:13 | EXetoC | and bitterness I suppose :p |
18:15:23 | BlaXpirit | i blame docs |
18:15:37 | BlaXpirit | thx |
18:17:22 | BlaXpirit | oh god no please no |
18:17:36 | BlaXpirit | is all my today's work in vain |
18:18:24 | BlaXpirit | naaah false alarm (hopefully) |
18:25:44 | EXetoC | this http://nim-lang.org/system.html#add,seq[T],T or something else? |
18:26:31 | BlaXpirit | EXetoC, no, the reason I said [:16:41] is not because of missing &=, if that's what you mean |
18:27:06 | BlaXpirit | add works fine |
18:27:35 | EXetoC | you were then talking about 'add', but ok |
18:27:42 | * | sillesta quit (Ping timeout: 265 seconds) |
18:28:03 | * | Demon_Fox quit (Quit: Leaving) |
18:28:19 | BlaXpirit | if I were making this, i would remove "add(seq, seq)", same for strings, and leave just &= |
18:29:41 | EXetoC | I think we were talking about doing the opposite |
18:29:58 | BlaXpirit | wait a second |
18:30:02 | BlaXpirit | this is just horrible design |
18:30:06 | BlaXpirit | what if i have seq[seq |
18:30:10 | BlaXpirit | what's it gonna do |
18:30:11 | BlaXpirit | omg |
18:30:30 | BlaXpirit | have u thought about this? |
18:31:01 | BlaXpirit | if I want to add an item to a seq[seq then it's basically the same function signature as if i want to extend it with another seq[seq |
18:31:58 | BlaXpirit | no, i'm stupid |
18:33:11 | BlaXpirit | i mean, i will work just fine |
18:33:14 | BlaXpirit | but sure is confusing |
18:33:17 | BlaXpirit | it* |
18:35:51 | BlaXpirit | so... what exactly is the point of forbidding object of seq? |
18:36:01 | EXetoC | are you saying it's more or less confusing with either? |
18:36:03 | EXetoC | example? |
18:36:45 | EXetoC | .eval 1 |
18:36:48 | Mimbus | EXetoC: eval.nim(3, 0) Error: value of type 'int literal(1)' has to be discarded |
18:36:52 | BlaXpirit | https://bpaste.net/show/960ba3c25b90 |
18:37:01 | EXetoC | .eval type T = object; var x: seq[T] |
18:37:04 | Mimbus | EXetoC: <no output> |
18:37:17 | BlaXpirit | EXetoC, to check whether Mimbus is here, do Mim<TAB> |
18:37:25 | BlaXpirit | and just don't use Mimbus here |
18:37:47 | BlaXpirit | Аrаq doesnt want it here, it looks |
18:37:55 | BlaXpirit | just on -offtopic |
18:38:07 | EXetoC | I know he was complaining about excessive invocations, that's all |
18:38:49 | BlaXpirit | see 5 hours ago [:41:27] |
18:39:57 | BlaXpirit | so, people, what can you say about my example? |
18:40:11 | BlaXpirit | exactly the same invocations lead to different overload |
18:40:35 | BlaXpirit | python has |
18:40:57 | BlaXpirit | lst += [5] lst.append(5) lst += [5, 6] lst.extend([5, 6]) |
18:41:19 | BlaXpirit | (even though "There should be one-- and preferably only one --obvious way to do it.") |
18:41:51 | * | brson joined #nim |
18:42:30 | EXetoC | hopefully he was referring to testing code until it becomes correct |
18:42:46 | BlaXpirit | but it was just 1 invocation that day |
18:43:06 | BlaXpirit | whatever |
18:43:21 | EXetoC | Araq: were you? showing code and output here is very convenient |
18:43:38 | BlaXpirit | [:35:10] <BlaXpirit> so... what exactly is the point of forbidding object of seq? |
18:44:16 | EXetoC | what does that mean? seq[ObjectType]? |
18:44:23 | BlaXpirit | yes |
18:44:32 | EXetoC | we could add: "please test in #nim-offtopic and make sure it works there first" to the output in case of an error |
18:44:34 | EXetoC | BlaXpirit: it does work |
18:44:52 | BlaXpirit | no. inheritance only works with non-final objects |
18:45:35 | BlaXpirit | I can add functionality (bloat) to seq itself, but can't make a separate object with additional functionality |
18:45:46 | BlaXpirit | just why |
18:45:58 | BlaXpirit | final is only harmful |
18:46:14 | BlaXpirit | ah maybe it's implementation limitation |
18:47:15 | BlaXpirit | not gonna sweat it too much, just gonna add bloat to seq :> |
18:47:28 | EXetoC | it seems like a questionable thing to do. why not either introduce a distinct type or make it a field of a type? |
18:47:53 | EXetoC | such extensions seem fine |
18:48:18 | EXetoC | it's just yet another proc |
18:49:38 | EXetoC | it's like extending with a normal function in C++, just that it can look more pleasant at the call site |
18:52:33 | EXetoC | and it'll be located in another module, that's all, but it is up to the user to make code readable, and that's something the community has to work on |
18:54:41 | Varriount | Meep |
18:55:08 | BlaXpirit | what does that mean |
19:00:40 | EXetoC | meep meep... vroooom |
19:01:05 | EXetoC | some say "meeb meeb" instead, but it sounds like "meep meep" to me. beaker also says "meep", right? :p |
19:02:58 | BlaXpirit | okay |
19:03:12 | BlaXpirit | so I really want a subclass of seq |
19:05:08 | Varriount | BlaXpirit: Make a wrapper? |
19:05:21 | BlaXpirit | but I gotta redefine every single thing |
19:05:25 | EXetoC | having seq be a class that can be inherited from seems broken. what about the suggestions that I made? |
19:05:44 | Varriount | The problem is that seq has special voodoo magic |
19:05:47 | EXetoC | what's wrong with referencing the field? you can use a converter though |
19:05:55 | BlaXpirit | https://github.com/docopt/docopt/blob/6b06b5a7305153e9823cd0e6b32d8ff7d5762403/docopt.py#L282 |
19:06:12 | EXetoC | you seem to want to introduce implicit referencing, so it should be fine |
19:06:21 | BlaXpirit | apparently not only do i need additional functions, but also data |
19:06:40 | EXetoC | "converter toBar(o: Foo): Bar = o.somefield" |
19:07:04 | * | Ether-plays-4fun left #nim (#nim) |
19:07:17 | BlaXpirit | maybe converter...): var seq would do the trick |
19:12:19 | * | alexruf joined #nim |
19:12:26 | EXetoC | relying on dynamic dispatch in this case would be bad, and the procs would have to be converted to methods in order to allow for overriding. "proc add(o: ArrayLike, ...)" would be a nice static approach, but we don't yet have container traits (and bugs prevent us from creating decent such interfaces) |
19:20:03 | * | sillesta joined #nim |
19:21:46 | Varriount | Araq: Regarding the buildbot, is there anything test-wise that you want me to change? Is the directory layout of the test results ok? |
19:22:44 | * | gokr1 joined #nim |
19:22:53 | EXetoC | you might not have been referring to overriding though, but that's my opinion |
19:26:13 | * | gokr quit (Ping timeout: 245 seconds) |
19:46:38 | ekarlso- | flaviu: you around for some hmac love again ? |
19:46:59 | ekarlso- | EXetoC: u asked for the code earlier ? |
19:49:14 | * | lesshaste quit (Quit: Leaving) |
19:50:41 | EXetoC | ekarlso-: I wanted to get to the bottom of that pointer issue, since your solution appeared to be semantically identical. bbl |
19:51:55 | ekarlso- | EXetoC: https://bpaste.net/show/d093b04d1164 < what's what I have atm |
19:52:43 | ekarlso- | unsure of what i'm doing sadly wrong there |
19:53:59 | * | Demos joined #nim |
19:56:26 | ekarlso- | EXetoC: heh, I'm guessing u see probably a dousin things that's bad ;P |
20:00:20 | * | acidx left #nim (#nim) |
20:03:15 | BlaXpirit | .eval echo "abc"[0 .. -1] |
20:03:18 | Mimbus | BlaXpirit: abc |
20:03:27 | BlaXpirit | .eval echo "abc"[0 .. <0] |
20:03:30 | Mimbus | BlaXpirit: abc |
20:03:41 | BlaXpirit | this. this is horrible |
20:03:46 | BlaXpirit | I feel betrayed |
20:04:48 | * | t4nk190 joined #nim |
20:05:00 | BlaXpirit | inclusive right index is horrible. negative index is horrible. combined together they're the worst nightmare, they just plague the language |
20:06:09 | BlaXpirit | ffs, it is impossible to get an empty string slice at its begnning |
20:07:01 | EXetoC | what's wrong with closed intervals? |
20:07:06 | EXetoC | BlaXpirit: s[0 .. 0] |
20:07:08 | BlaXpirit | i just said it |
20:07:14 | BlaXpirit | EXetoC, that's the first character |
20:07:39 | BlaXpirit | please |
20:07:42 | EXetoC | proc `[]`*(s: string, x: Slice[int]): string |
20:07:47 | BlaXpirit | if i have an operation |
20:07:55 | BlaXpirit | "get first N characters of a string" |
20:08:05 | BlaXpirit | i write s[0 .. <n] |
20:08:09 | BlaXpirit | n == 0 |
20:08:16 | BlaXpirit | i get the whole f***g string |
20:08:21 | BlaXpirit | WHY |
20:09:00 | def- | BlaXpirit: [0 .. -1] |
20:09:10 | BlaXpirit | def-, are u serious -_- |
20:09:12 | EXetoC | I'm mostly concerned about the fact that it applies only to strings |
20:09:18 | BlaXpirit | [:02:35] <BlaXpirit> .eval echo "abc"[0 .. -1] |
20:09:38 | def- | yes, it's a bit weird |
20:09:44 | BlaXpirit | it's not a bit wierd |
20:09:45 | def- | I think Araq didn't like it either |
20:09:45 | Varriount | I like the inclusive indice parameters. Makes things easy to reason about. |
20:09:48 | BlaXpirit | it's idiotic |
20:10:02 | BlaXpirit | Varriount, i can just repeat [:04:19] <BlaXpirit> inclusive right index is horrible. negative index is horrible. combined together they're the worst nightmare, they just plague the language |
20:10:31 | Varriount | BlaXpirit: Well, negative index only applies to strings, afaik |
20:10:57 | BlaXpirit | this is where a horrible idea from pascal and a horrible idea from python clash in an incredibly damaging way |
20:11:00 | Varriount | Arrays can have actual negative indices, as they don't have to start at 0 |
20:11:15 | Araq | Varriount: it's the same for seqs |
20:11:31 | Varriount | Oh. |
20:11:46 | EXetoC | well, what's the argument against closed intervals? |
20:11:51 | Araq | BlaXpirit: so how do you do a[lowEnum .. highEnum] with you "exclusive" ranges? note that there is no highEnum+1. |
20:11:55 | BlaXpirit | EXetoC, -1 everywhere |
20:12:08 | BlaXpirit | .eval echo((@[1,2,3])[0 .. <0]) |
20:12:11 | Mimbus | BlaXpirit: @[1, 2, 3] |
20:12:12 | Araq | it's not a mistake in pascal |
20:12:19 | Araq | and it's no mistake in Nim either |
20:12:21 | EXetoC | BlaXpirit: so? |
20:12:40 | BlaXpirit | having to write -1 everywhere vs not having to write everywhere |
20:12:48 | EXetoC | s[0 .. s.high] |
20:12:49 | BlaXpirit | just that |
20:12:56 | EXetoC | or, s |
20:13:01 | BlaXpirit | s[0 .. <s.len] |
20:13:03 | Araq | nobody has to write -1 everywhere |
20:13:08 | Varriount | Araq: One might argue that you could make a special case for enums, but that would be inconsistant. |
20:13:13 | EXetoC | <s.len == s.high |
20:13:27 | Araq | Varriount: {'a'..'z'} means from a to z inclusively |
20:13:32 | BlaXpirit | look |
20:13:40 | Araq | it's not just enums. |
20:13:48 | Varriount | ;3 |
20:13:50 | BlaXpirit | i'm not gonna try to convince anyone to change inclusive indices |
20:14:06 | BlaXpirit | i just know that they're bad and it's yet another problem i will have to deal with |
20:14:09 | EXetoC | and a counter argument was provided |
20:14:18 | BlaXpirit | was not |
20:14:23 | EXetoC | it was |
20:14:32 | Varriount | BlaXpirit: Did you see what araq wrote? |
20:14:37 | Araq | BlaXpirit: you convinced me that -1 for "last element" might have been a bad idea. |
20:14:44 | BlaXpirit | I don't understand what Araq wrote |
20:15:10 | EXetoC | and it's only for strings |
20:15:22 | BlaXpirit | it's for everything but arrays rather |
20:15:24 | ekarlso- | EXetoC: did u see anything ? |
20:15:30 | EXetoC | ekarlso-: haven't looked |
20:15:43 | ekarlso- | fair enough |
20:16:28 | Demos | the kind of ranges you use in a language are pretty arbitrary, and nobody can make mistakes with nim's because they cause overflow --> crash if used incorrectly |
20:16:31 | Demos | not underflow |
20:16:51 | EXetoC | "for i in 0 .. s.high" seems fine. it might be unusual though, that's all, but plenty of things are either unusual or new altogether |
20:17:23 | Demos | doing something because C does it and that is what people are used to is not usually a great idea |
20:17:35 | BlaXpirit | Demos, sigh |
20:17:45 | BlaXpirit | Nim is doing it exclusively because Pascal does it |
20:17:53 | BlaXpirit | (how could i know though) |
20:17:58 | Araq | well I gave the reasoning behind the design choice. |
20:18:06 | Varriount | And because it makes sense in the context of enums and character literals. |
20:18:09 | Araq | you don't get it, but that's your problem. |
20:18:21 | Araq | it was not copied blindly from Pascal. |
20:18:35 | EXetoC | Araq knows his stuff :p |
20:18:38 | EXetoC | later! |
20:18:39 | Demos | personally, I find it more natural. It is like "the variable WILL get ALL of these values" |
20:18:47 | BlaXpirit | https://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html |
20:19:33 | BlaXpirit | how many items between a..b? |
20:19:35 | BlaXpirit | hmmmm |
20:19:40 | Varriount | BlaXpirit: That's why numbering should start at zero, not why inclusive indices cause disease. |
20:19:41 | BlaXpirit | a+b+1 |
20:19:44 | BlaXpirit | it's only logical |
20:19:54 | EXetoC | wasn't dijsktra for closed intervals though? |
20:20:06 | EXetoC | but I couldn't find that particular quote |
20:20:25 | Demos | also, it is a bit reasonable if overflow is UB |
20:20:29 | Demos | but in nim it is not |
20:20:59 | BlaXpirit | by the way, inclusive interval works out even worse with 0-based than with 1-based |
20:21:30 | ldlework | Just add a compiler flag :) |
20:21:33 | EXetoC | I've said that I'm fine with closed intervals, so I would like an actual argument |
20:21:35 | BlaXpirit | there is probably not a single language with this combination of properties |
20:21:42 | Varriount | BlaXpirit: But how would we do character literal ranges? |
20:21:43 | EXetoC | so be it |
20:21:48 | BlaXpirit | Varriount, what do you mean |
20:21:55 | BlaXpirit | ah, those ranges |
20:21:59 | ldlework | a - z |
20:22:06 | Varriount | BlaXpirit: {'a'..'z'} |
20:22:09 | EXetoC | you should only sacrifice so much in favor of average joe |
20:22:17 | BlaXpirit | they're a different thing, do whatever you want lol |
20:22:38 | ldlework | different thing? |
20:22:41 | BlaXpirit | it's just that there must be support for normal ranges |
20:22:44 | Varriount | Then we run into the "waah, you're not being consistant" complaint. |
20:22:57 | Demos | there is support for normal ranges, 0..<0 |
20:23:02 | BlaXpirit | Demos, |
20:23:03 | BlaXpirit | come on |
20:23:03 | Demos | erm 0..<10 |
20:23:12 | BlaXpirit | [:02:35] <BlaXpirit> .eval echo "abc"[0 .. -1] |
20:23:20 | BlaXpirit | .eval echo "abc"[0 .. <0] |
20:23:24 | Mimbus | BlaXpirit: abc |
20:23:27 | BlaXpirit | expected: "" |
20:23:29 | EXetoC | what does that have to do with it? |
20:23:36 | Demos | sorry I was on the bus at the time I think |
20:23:37 | BlaXpirit | normal ranges are NOT supported |
20:23:45 | BlaXpirit | this is NOT okay |
20:23:57 | * | gsingh93 joined #nim |
20:23:58 | BlaXpirit | by normal I mean left-inclusive right-non-inclusive |
20:24:05 | BlaXpirit | as almost all popular languages do |
20:24:53 | ldlework | my brain keeps flipping between agreeing and disagreeing |
20:24:54 | Demos | hm [0..-1] seems to work for me |
20:24:57 | BlaXpirit | unless negative indices are removed, cringes will happen over and over |
20:25:04 | * | t4nk190 quit (Ping timeout: 246 seconds) |
20:25:20 | BlaXpirit | obscure bugs and pointless conditionals will be unavoidable |
20:25:37 | EXetoC | yes if you don't know the language |
20:25:43 | BlaXpirit | goddammit, EXetoC |
20:25:52 | BlaXpirit | nobody of the people here expected that resul |
20:25:54 | BlaXpirit | t |
20:25:56 | Varriount | and verily, the heavens will rain down frogs and oysters |
20:26:09 | BlaXpirit | [:08:19] <def-> BlaXpirit: [0 .. -1] |
20:26:10 | Demos | what, what is wrong with the [0..-1] thing? |
20:26:19 | BlaXpirit | EXetoC, are you saying def- doesnt know the language? |
20:26:29 | Varriount | I do agree with the '-1' thing, not so much with the inclusive ranges being evil. |
20:26:33 | EXetoC | I have no idea |
20:26:41 | Demos | I got abc |
20:26:44 | ldlework | he has a non zero point |
20:26:44 | Demos | which seems reasonable |
20:26:55 | BlaXpirit | Varriount, inclusive ranges are not really evil, just very inconvenient more often than it is convenient |
20:27:20 | BlaXpirit | i am not trying to push a change to it in Nim |
20:27:35 | BlaXpirit | but I do insist that [0 .. <0] works properly |
20:27:37 | BlaXpirit | by any means |
20:28:20 | BlaXpirit | Demos, again, my point was |
20:28:39 | dom96 | .eval echo("abc"[0 .. -1]) |
20:28:42 | Mimbus | dom96: abc |
20:28:42 | dom96 | make perfect sense |
20:28:42 | BlaXpirit | [:07:06] <BlaXpirit> if i have an operation [:07:14] <BlaXpirit> "get first N characters of a string" [:07:24] <BlaXpirit> i write s[0 .. <n] [:07:28] <BlaXpirit> n == 0 [:07:35] <BlaXpirit> i get the whole f***g string |
20:28:55 | BlaXpirit | dom96, no, it doesn't |
20:29:12 | EXetoC | so this is about the semantics for `[]`?... |
20:29:13 | BlaXpirit | if i have a range from a bigger number to a smaller number, it must be empty |
20:29:36 | BlaXpirit | EXetoC, I can just repeat [:04:19] <BlaXpirit> inclusive right index is horrible. negative index is horrible. combined together they're the worst nightmare, they just plague the language |
20:29:37 | dom96 | No, if you have a negative number it restarts from the end of the string. |
20:29:45 | EXetoC | that's not an argument |
20:29:46 | BlaXpirit | dom96, ok, cool, but it shouldn't |
20:29:54 | BlaXpirit | [:07:06] <BlaXpirit> if i have an operation [:07:14] <BlaXpirit> "get first N characters of a string" [:07:24] <BlaXpirit> i write s[0 .. <n] [:07:28] <BlaXpirit> n == 0 [:07:35] <BlaXpirit> i get the whole f***g string |
20:29:56 | Demos | actually there may be a point here, but it may be about `<` |
20:30:15 | BlaXpirit | you think this never happens? |
20:30:29 | BlaXpirit | i bet there is at the very least one bug in standard library caused by this |
20:30:38 | EXetoC | again, it's about the semantics for `[]` then.. |
20:30:49 | dom96 | Although I think that echo("abc"[0 .. 0]) should give an empty string |
20:30:59 | BlaXpirit | dom96, uhh |
20:31:09 | BlaXpirit | great, you fell into the trap of inclusive intervals |
20:31:25 | BlaXpirit | thx for supporting my point |
20:32:05 | EXetoC | this is about `[]` more than anything surely |
20:32:16 | BlaXpirit | what is `[]` |
20:32:28 | EXetoC | proc `[]`*(s: string, x: Slice[int]): string |
20:32:44 | BlaXpirit | the concept is everywhere in the language |
20:32:57 | BlaXpirit | not just `[]` follows it |
20:33:03 | BlaXpirit | not just of string, at least |
20:33:11 | BlaXpirit | so just now, i was writing a function split by regex (because the one in standard library is useless in most cases) |
20:33:13 | BlaXpirit | i have start = 0 |
20:33:27 | BlaXpirit | and i find a match |
20:33:45 | BlaXpirit | so i return first substring, which is [start .. < match.left] |
20:34:14 | BlaXpirit | if the match is at the very beginning, what do we get? |
20:34:17 | BlaXpirit | no, no, not empty string |
20:34:18 | EXetoC | so it is about one instance of `[]`, and not some other aspect of the language or the lib |
20:34:20 | BlaXpirit | we get the whole string |
20:34:58 | BlaXpirit | EXetoC, [:11:27] <BlaXpirit> .eval echo((@[1,2,3])[0 .. <0]) |
20:35:11 | BlaXpirit | that is at the very least 1 more instance of it |
20:36:06 | EXetoC | anyway, I don't know if I care for these semantics, but my stance regarding closed intervals remains the same |
20:36:11 | EXetoC | BlaXpirit: yeah ok |
20:36:39 | BlaXpirit | EXetoC, please stop talking about closed intervals, as i said, i'm not gonna convince anyone to change it this late |
20:36:48 | flaviu | BlaXpirit: Pretty good, working on docs now |
20:36:54 | BlaXpirit | flaviu, :> |
20:36:58 | dom96 | I kind of wish that we just copied Python's intervals. |
20:36:59 | flaviu | ekarlso-: I'm around now. |
20:37:09 | BlaXpirit | dom96, yes, they work very well |
20:37:15 | dom96 | Will this be changed now? Doubtful. |
20:37:19 | flaviu | ekarlso-: You don't need the init methods. |
20:37:22 | BlaXpirit | left-inclusive, right-non-inclusive if someone isnt aware |
20:37:31 | flaviu | You can do everything with the HMAC method. |
20:37:38 | EXetoC | fine. your one *argument* was refuted though |
20:37:54 | flaviu | Except streaming, but that's not a major use case for you, I hope? |
20:37:59 | BlaXpirit | there were at least 3 arguments |
20:38:06 | BlaXpirit | -1, a+b+1, dijsktra |
20:38:15 | BlaXpirit | b-a+1 rather lol |
20:38:19 | Varriount | -_- |
20:38:47 | BlaXpirit | but now, let's think |
20:38:53 | flaviu | BlaXpirit: https://github.com/flaviut/hairy-nemesis |
20:39:05 | BlaXpirit | how can we make an operation "get a slice from the beginning of a string" actually work |
20:39:27 | BlaXpirit | right now it is: if n == 0: "" else s[0 .. <n] |
20:40:19 | BlaXpirit | of course, -1 will break it etc |
20:40:28 | ekarlso- | flaviu: how so ? ^ |
20:40:34 | BlaXpirit | maybe better if n > 0: s[0 .. <n] else: "" |
20:40:40 | EXetoC | is "s[0 .. max(0, <n)]" that bad? |
20:40:47 | flaviu | ekarlso-: https://gist.github.com/flaviut/3e0b5a52fe9395fcf5c5 |
20:40:47 | BlaXpirit | EXetoC, that DOES NOT WORK |
20:40:54 | BlaXpirit | EXetoC, you fell for it YET AGAIN |
20:41:02 | EXetoC | ??? |
20:41:04 | BlaXpirit | s[0..0] is the first character |
20:41:14 | EXetoC | it's a string containing only the first character, yes |
20:41:18 | ekarlso- | flaviu: yeah, that's fair enough, but EXetoC / BlaXpirit shot me earlier for the cast:.. |
20:41:22 | Varriount | EXetoC, BlaXpirit: Could you two please just drop it? Neither of you is going to convince the other. |
20:41:28 | EXetoC | ekarlso-: I didn't |
20:41:37 | ekarlso- | EXetoC: someone did :p |
20:41:38 | BlaXpirit | Varriount, there is nothing to convince |
20:41:42 | EXetoC | well, maybe redundant casts |
20:41:57 | BlaXpirit | Araq admitted it is not good, and if someone doesn't see a problem here, well, they have a problem |
20:42:21 | ekarlso- | flaviu: what's bad though with providing the init methods ? |
20:42:28 | EXetoC | s[0 .. 0] == "" & s[0], s[0 .. 1] == "" & s[0] & s[1] |
20:42:40 | flaviu | ekarlso-: It complicates the API and requires more headers to be wrapped |
20:42:42 | BlaXpirit | EXetoC, wat |
20:43:01 | BlaXpirit | https://bpaste.net/show/e2fdbf114faa beginning of my function |
20:43:04 | ekarlso- | flaviu: well I guess someone *might* need it and it's already done for md5... |
20:43:10 | BlaXpirit | barely started writing it, and there is already a bug |
20:43:26 | ekarlso- | flaviu: if you go to openssl.nim you can see md5_init etc |
20:44:05 | BlaXpirit | EXetoC, what the heck did you write there |
20:44:17 | BlaXpirit | oh, yes, it is correct |
20:44:23 | BlaXpirit | but what does it even mean? |
20:44:45 | BlaXpirit | maybe you just illustrated the problem |
20:44:52 | EXetoC | ok let's see |
20:45:09 | EXetoC | so you want s[0 .. 0] to be the empty string? and if so, for the sake of familiarity with semantics in certain other languages? |
20:45:23 | ekarlso- | flaviu: if you go to openssl.nim you can see md5_init etc |
20:45:28 | BlaXpirit | I want s[0 .. <0] to be the empty string |
20:45:29 | ekarlso- | meh, wrong arrow up sorry |
20:45:47 | BlaXpirit | i do not care if .. itself is changed, because i'm simply going to avoid it as unviable |
20:46:22 | BlaXpirit | nim does not provide a straightforward way to get a slice from the beginning of a string to some index |
20:46:41 | Varriount | :< |
20:46:44 | BlaXpirit | because there is no way to get an empty string i you start from the left side |
20:47:02 | ekarlso- | flaviu: I dont get it though why my example doesn't work |
20:47:26 | flaviu | ekarlso-: I have no idea what you're talking about. The interface is adequate, the problem is that the result doesn't match the c result, which doesn't match the bouncy castle result. |
20:48:31 | ekarlso- | flaviu: https://bpaste.net/show/ee36777d5b00 < illegal storage access #111 |
20:48:44 | BlaXpirit | oh guys guess what |
20:48:52 | EXetoC | BlaXpirit: it's just one tiny aspect though, but I will think about this and get back to you a little later |
20:49:31 | BlaXpirit | https://github.com/Araq/Nim/blob/master/lib/impure/re.nim "-1" appears 37 times, "+1" appears 12 times |
20:49:42 | BlaXpirit | guess how different it would be with correctly made ranges |
20:50:06 | BlaXpirit | EXetoC, it is not tiny |
20:50:13 | * | atomic-hedgehog quit (Quit: Lost terminal) |
20:50:19 | EXetoC | do you *often* need the shortcut that you're talking about? I'm asking because I don't write that much real-world code myself |
20:50:31 | EXetoC | and I guess I don't work with strings in this way that much |
20:50:34 | BlaXpirit | EXetoC, which shortcurt |
20:50:43 | BlaXpirit | EXetoC, you're being ridiculous here |
20:51:16 | Varriount | BlaXpirit: Well, you might argue that the impure 're' module is unfair, since your translating ranges. |
20:51:19 | EXetoC | -myself |
20:51:34 | ekarlso- | flaviu: now this is something I totally dont understand.. why does the example work when I say import the "future" module ? |
20:51:42 | BlaXpirit | if I write s[0 .. <n] where n is never negative, I don't expect it to return the whole string when n is 0 |
20:51:53 | BlaXpirit | don't you get it that it's a huge source of bugs |
20:52:07 | ekarlso- | I feel it's uberweird, if I do just "import future" above isMainModule it runs fine.. |
20:52:17 | EXetoC | BlaXpirit: well, it's not always a shortcut. surely s[0 .. 0] as it is now is considered a shortcut to some people, who just happen to want only the first character then |
20:52:18 | ekarlso- | if not it goes splat |
20:53:04 | EXetoC | BlaXpirit: I think you are conflating different issues, "shortcuts" and what have you, at times |
20:53:12 | BlaXpirit | wat |
20:53:20 | BlaXpirit | where do you see a shortcut |
20:53:34 | BlaXpirit | what else do you expect me to write |
20:54:02 | * | t4nk709 joined #nim |
20:54:02 | BlaXpirit | EXetoC, is this idiomatic code for you? if n > 0: s[0 .. <n] else: "" |
20:55:05 | BlaXpirit | a tedious option to solve this is to actually make ".. <" a thing |
20:55:22 | BlaXpirit | but then it would need to be a different type of range anyway |
20:55:28 | BlaXpirit | aaand double implementations for everything |
20:55:36 | flaviu | ekarlso-: Because you don't know the size of HMAC_CTX |
20:55:36 | t4nk709 | What is the meaning of a prefixed P? |
20:55:37 | EXetoC | and for people who are just fine with the fact that s[0 .. 0] happens to return a string containing the first character? it's entirely situational |
20:55:50 | * | nande joined #nim |
20:55:57 | BlaXpirit | EXetoC, it is not situational, it happens all the time!!!!! |
20:56:03 | BlaXpirit | get first N characters of a string |
20:56:19 | BlaXpirit | you can't get first N characters of a string in Nim |
20:56:21 | BlaXpirit | just think of this |
20:56:33 | flaviu | ekarlso-: You're passing a pointer to a object of size zero. If it access addr+1, it segfaults. |
20:57:04 | flaviu | ekarlso-: Like I said, it's a lot more complicated if you want to use those functions. It's not easy. |
20:57:11 | EXetoC | "you can't" is very misleading. you just want it to be so with a specific kind of syntax |
20:57:26 | BlaXpirit | EXetoC, no, you don't understand |
20:57:41 | BlaXpirit | people are simply going to write s[0 .. <n] without a fkin clue |
20:57:57 | BlaXpirit | as def- and others kindly demonstrated |
20:58:03 | flaviu | EXetoC: It's bit me while writing my regex library |
20:58:07 | * | t4nk969 joined #nim |
20:58:10 | ldlework | I have to agree with BlaXpirit I think |
20:58:29 | ldlework | I don't think we should do non-mainstream conventions "just cuz" |
20:58:44 | ldlework | Which seems to be literally the only defense so far, I've heard. |
20:58:44 | flaviu | There's a reason that nearly every language uses exclusive upper bounds. |
20:59:15 | ldlework | "I get by, why don't you" should be our last justification for anything. |
20:59:43 | * | t4nk709 quit (Ping timeout: 246 seconds) |
21:00:45 | Triplefox | It's consistent with array definition syntax, however in that case you can define a single length number |
21:00:48 | * | Demos quit (Ping timeout: 245 seconds) |
21:00:56 | ekarlso- | flaviu: how u fix that issue then if I can ask u |
21:01:08 | EXetoC | please discuss this on the forum |
21:01:10 | * | vendethiel quit (Quit: q+) |
21:01:22 | BlaXpirit | forum is 20th century |
21:01:32 | Varriount | O_o |
21:01:33 | flaviu | ekarlso-: Like I keep saying, the easiest solution is to just use the HMAC function. |
21:01:41 | BlaXpirit | this conversation we just had would've taken a few weeks on forums |
21:01:55 | ekarlso- | flaviu: still my curious ass is wondering ;P |
21:02:00 | ldlework | Yeah but at least in a few weeks after that we would remember having it :) |
21:02:26 | BlaXpirit | especially such bare bones forum |
21:02:41 | * | superfunc joined #nim |
21:02:42 | BlaXpirit | you have to remember every post you made and check if someone wrote back |
21:02:44 | BlaXpirit | srsly |
21:03:01 | ldlework | BlaXpirit: its an effort to self-dogfood |
21:03:08 | ldlework | Lets give efforts such as that some leeway |
21:03:08 | * | UberLambda joined #nim |
21:03:15 | ldlework | Its pretty admirable. |
21:03:17 | flaviu | ekarlso-: Probably include the structure definition in the nim file. Another possibility is to create a dummy array[uint8, sizeof(HMAC_CTX)] as a field. |
21:03:28 | BlaXpirit | well if i wanted to reimplement the wheel, i'd make it at least remotely round |
21:03:46 | Varriount | Versus here, where |
21:03:48 | flaviu | But that'll break as soon as they change the structure definition. |
21:03:50 | ldlework | BlaXpirit: you're losing my support :) |
21:03:53 | UberLambda | Is there any interest in adding tagged unions to the language? |
21:04:08 | Varriount | UberLambda: Huh? |
21:04:13 | EXetoC | flaviu: what are those reasons? and could you please give me a link to an article that covers this |
21:04:25 | UberLambda | Varriount: Rust's enums |
21:04:36 | Varriount | UberLambda: You've looked at variant objects, right? |
21:04:49 | Varriount | UberLambda: I haven't used Rust. |
21:04:50 | UberLambda | I think that's another name for them |
21:05:02 | dom96 | UberLambda: Are you familiar with object variants? |
21:05:02 | BlaXpirit | UberLambda, i think nim has something like that |
21:05:06 | BlaXpirit | just that you can't match them |
21:05:09 | UberLambda | They're basically enums that can hold values and get stored as a union + id pair |
21:05:21 | UberLambda | dom96: are these an actual nim feature? |
21:05:21 | BlaXpirit | people are talking about object variants **in nim** |
21:05:23 | dom96 | Object variants will get you what you want. I think we need some syntax sugar for them though. |
21:05:24 | ekarlso- | flaviu: oh, wait a min |
21:05:30 | dom96 | UberLambda: yes |
21:05:41 | UberLambda | dom96: checking them out now |
21:06:45 | BlaXpirit | so people |
21:06:47 | ldlework | Can anyone confirm or deny that if I use a user-defined type class as a descriminator constraint, Nim will just ignore it? |
21:06:48 | UberLambda | They're a bit low-level though |
21:07:22 | BlaXpirit | yup.. |
21:07:35 | BlaXpirit | but think of what you can't do with convenience functions! |
21:07:39 | BlaXpirit | (not much actually lol) |
21:07:57 | ldlework | plz? |
21:08:14 | UberLambda | I think I just got too used to pattern matching |
21:08:14 | BlaXpirit | ldlework, it's hard to understand, just make a small example and report bug |
21:08:38 | BlaXpirit | UberLambda, i am quite sure it is possible to make ad hoc pattern matching with macros |
21:08:38 | ldlework | foo[T: Bar], Nim lets me discriminate against non Bar implementing types. |
21:08:45 | ldlework | but if I do |
21:08:58 | ldlework | foo[T: tuple] Nim applies the constraint correctly and raises an error |
21:09:03 | superfunc | UberLambda: you still can pattern match |
21:09:07 | ldlework | I'm assuming this is what is meant by "User type classes don't work." |
21:09:08 | superfunc | in a sense |
21:09:29 | ldlework | UberLambda: +1 to pattern matching in Nim |
21:09:45 | BlaXpirit | onionhammer, pls write a macro :p |
21:09:46 | flaviu | EXetoC: I hate quora as much as anyone, but http://www.quora.com/Why-are-Python-ranges-half-open-exclusive-instead-of-closed-inclusive?share=1 is pretty good. |
21:10:03 | BlaXpirit | flaviu, mmmm so good |
21:10:07 | UberLambda | superfunc: also with tuples? |
21:10:34 | * | t4nk969 quit (Ping timeout: 246 seconds) |
21:10:40 | UberLambda | The tutorial seems to do just that now that I see it |
21:10:49 | BlaXpirit | EVERYONE MUST READ THAT LINK |
21:11:01 | ldlework | BlaXpirit: Just learn Nim better. |
21:11:04 | ldlework | :) |
21:11:10 | BlaXpirit | if n > 0: s[0 .. <n] else: "" |
21:11:16 | BlaXpirit | gud programr |
21:11:44 | BlaXpirit | for reference, Python: |
21:11:47 | BlaXpirit | s[:n] |
21:11:55 | BlaXpirit | for same result |
21:11:56 | ekarlso- | flaviu: meh, harder then it looked then ;P |
21:12:08 | ekarlso- | flaviu: what you meant with the dummy thing though ? |
21:12:38 | flaviu | literally add a field `dummy: array[thesizeofthisthing, uint8]` |
21:13:00 | flaviu | You won't be using it, but it'll tell the compiler to use up that much memory for the type. |
21:13:06 | ekarlso- | rofl, what's the use of that ;P |
21:13:08 | ekarlso- | ah |
21:13:54 | UberLambda | Is mark and sweep disabled by default? |
21:14:02 | UberLambda | In the GC |
21:14:53 | * | vendethiel joined #nim |
21:15:20 | ldlework | UberLambda: http://nim-lang.org/gc.html |
21:16:07 | UberLambda | Idlework: found it, but I don't understand if GC_enableMarkAndSweep is called by the runtime by default |
21:16:45 | ldlework | UberLambda: I would assume so |
21:17:18 | flaviu | ekarlso-: Anyway, I used some test vectors from RFC 2202, and everything looks good. |
21:17:18 | UberLambda | Is the performance worse? |
21:17:36 | EXetoC | ldlework: those are not user-defined |
21:17:36 | ldlework | UberLambda: I dont know too much about it, sorry. |
21:17:48 | ldlework | EXetoC: sorry? |
21:17:50 | EXetoC | ok maybe they are, but the traits construct has a confusing name |
21:17:52 | UberLambda | Idlework: no problem, thanks BTW |
21:17:56 | ekarlso- | flaviu: wanna help on that init stuff ? ;p |
21:18:11 | EXetoC | ldlework: *user-defined* type classes are powered by the 'generic' keyword |
21:18:25 | ldlework | EXetoC: I know that tuple is not user defined |
21:18:30 | ldlework | EXetoC: "Foo" clearly is. |
21:18:44 | ldlework | type Foo = generic t ... |
21:18:57 | ldlework | Oh in my example I called it Bar |
21:19:02 | ldlework | type Bar = generic t ... |
21:19:02 | EXetoC | nevermind then |
21:19:09 | EXetoC | it was broken for me with 'var' parameters |
21:19:21 | ldlework | Nim doesn't seem to enforce user-defined descriminator constraints |
21:19:22 | flaviu | ekarlso-: I'm not sure what you're referring to. |
21:19:29 | EXetoC | I wouldn't bother tbh. it'll be fixed some time after 1.0 I assume, and before 2.0 |
21:19:35 | ldlework | EXetoC: lol |
21:19:44 | ekarlso- | HMAC_init and all that ;) |
21:19:58 | EXetoC | flaviu: will read. hopefully the bdfl will voice his opinion in a more detailed fashion |
21:20:09 | ldlework | EXetoC: the only point behind descriminator constraints is so that you get an error at the point of descrimination rather at the point where Nim tries to access some field or proc that the descriminator type doesn't support right? |
21:20:30 | ldlework | Which I assume happens far far earlier in the compilation? |
21:20:43 | flaviu | ekarlso-: Don't do work that isn't required. YAGNI |
21:20:44 | ldlework | Is that why they are low priority because they don't prevent you from writing anything? |
21:20:59 | ekarlso- | flaviu: .. |
21:21:00 | ekarlso- | :P |
21:21:15 | ldlework | EXetoC: sorry if you don't know, I'm just curious |
21:21:27 | ekarlso- | flaviu: i'll let go with using HMAC for now -,,- |
21:22:19 | * | BlaXpirit_ joined #nim |
21:22:20 | EXetoC | ldlework: and for better reflection I guess |
21:22:39 | ldlework | EXetoC: but the reason I brought up is true, you think? |
21:22:42 | * | UberLambda quit (Quit: Leaving the Matrix) |
21:22:46 | EXetoC | and of course better reasoning |
21:22:51 | ldlework | EXetoC: right |
21:22:59 | EXetoC | ldlework: yes, and the error message would be more obvious |
21:23:08 | ldlework | EXetoC: the error message is absolutely terrible |
21:23:17 | ldlework | hehe, when you violate descriminator constraints |
21:23:37 | ldlework | I only knew what the error meant because I was literally trying to violate the constraint to see what the error would be |
21:23:50 | ldlework | like passing a non-tuple to a tuple constraint |
21:24:23 | ldlework | I guess that's something I could open an issue for |
21:24:40 | ekarlso- | flaviu: anyways, thnx so much for helping, i've actually got a working jwt thnx to u and can post it tmrw for packages. |
21:24:52 | ekarlso- | flaviu: so user auth is actually working properly |
21:24:55 | Varriount | Gah. The IDETools code is... interesting |
21:25:01 | flaviu | ekarlso-: Ok, sounds good! |
21:28:32 | BlaXpirit_ | Araq, are you going to consider removing negative indices? I don't see any other way to work around this that doesn't require a different slice type etc. |
21:29:10 | superfunc | ldlework: is the link for your metaprogramming article dead? |
21:29:50 | ldlework | superfunc: yeah :( |
21:29:58 | ldlework | my DO instance got pwned |
21:30:10 | ldlework | if anyone has any experience cleaning up pwned linux environments... let me know |
21:30:35 | Varriount | ldlework: 'sudo rm -rf /' should fix it |
21:30:48 | ldlework | hehe but that would destroy the blog too! |
21:30:49 | Varriount | For a given value of 'fix' |
21:31:13 | flaviu | ldlework: Can you set it up without a domain? |
21:31:29 | flaviu | Best idea is to use scp to get the files out and create a new image. |
21:32:34 | ekarlso- | blog, just use pelican and have source in github :P |
21:33:24 | * | tinAndi joined #nim |
21:35:26 | ldlework | flaviu: they disabled the networking |
21:35:32 | ldlework | because it was being used for outbound ddos |
21:35:38 | ldlework | that's what makes it difficult to get the data out |
21:35:58 | flaviu | I'm not familiar with DO, but can't you download the disk image then? |
21:36:46 | flaviu | ldlework: Also, you should disable root login and only allow ssh with certificates. |
21:37:04 | ldlework | flaviu: indeed |
21:39:10 | ekarlso- | root login be the devil |
21:40:13 | * | BlaXpirit_ quit (Quit: Quit Konversation) |
21:45:32 | dom96 | ldlework: Any ideas how it got pwned? |
21:46:07 | gokr1 | BlaXpirit: I tried adding a first proc for seq (taking an argument n) and stumbled at exactly these issues. Had to add -1 of course, but also the lesser obvious special case for n == 0. |
21:49:50 | Varriount | gokr1: So you too thing that inclusive indices are bad? |
21:50:26 | gokr1 | I honestly haven't thought that much about it since I have lived in Smalltalk for the last 20 years ;) |
21:50:53 | gokr1 | I just note that I too got tripped up by it. |
21:50:55 | EXetoC | that's a long time |
21:51:02 | BlaXpirit | dtscode, can Mimbus handle infinite loop? |
21:51:13 | Varriount | BlaXpirit: It times out after a minute. |
21:51:23 | BlaXpirit | literally minute? |
21:51:33 | BlaXpirit | i guess/hope not |
21:51:47 | Varriount | BlaXpirit: What other kind of minute would I be talking about? |
21:51:53 | BlaXpirit | minute is too long :s |
21:52:02 | Varriount | I don't think I've come across a metaphorical minute. |
21:52:09 | BlaXpirit | well i have |
21:52:14 | BlaXpirit | "give me a minute" they say |
21:52:23 | BlaXpirit | and you have too for sure |
21:53:07 | BlaXpirit | .eval import re; echo "Hello, World!".replace(re"\b", "*") |
21:53:17 | EXetoC | I've gotten pissed for no reason then when people show up after minutes |
21:54:10 | Mimbus | BlaXpirit: <no output> |
21:54:45 | BlaXpirit | .python import re; re.sub(r"\b", "*", "Hello, World") |
21:54:49 | BlaXpirit | BlaXpirit: '*Hello*, *World*' |
21:54:52 | BlaXpirit | lel |
21:55:12 | BlaXpirit | flaviu, this should be interesting to you |
21:55:32 | BlaXpirit | this might be caused by inclusive intervals |
21:55:39 | BlaXpirit | or just 0-size increment more likely |
21:55:49 | * | gour quit (Remote host closed the connection) |
21:56:01 | flaviu | BlaXpirit: What just happened? |
21:56:07 | BlaXpirit | infinite loop in nim |
21:56:09 | BlaXpirit | works in pytho |
21:56:12 | flaviu | ah, I know. |
21:57:00 | flaviu | related https://github.com/Araq/Nim/issues/1933, https://github.com/flaviut/hairy-nemesis#why |
21:57:02 | BlaXpirit | try that on your lib too :p |
21:57:09 | flaviu | I don't have sub yet. |
21:57:23 | BlaXpirit | whatever |
21:57:31 | BlaXpirit | try it later then |
21:57:35 | flaviu | but my findAll is correctly implemented, so it should be nearly trivial to implement. |
21:57:37 | BlaXpirit | or try it on wherever you have a loop |
21:58:36 | BlaXpirit | .eval import re; echo "Hello, World!".findall(re"\b") |
21:58:36 | flaviu | https://github.com/flaviut/hairy-nemesis/blob/master/src/nre.nim#L402 |
21:58:41 | Mimbus | BlaXpirit: out of memory |
21:58:47 | BlaXpirit | good stuff |
21:58:50 | flaviu | yep |
21:58:51 | BlaXpirit | really good stuff, Araq |
21:59:06 | ekarlso- | can u do a named capturing group to table or stringtable? |
21:59:08 | BlaXpirit | this isn't even some contrived example |
21:59:16 | flaviu | .eval import re; "foo".findall(re"") |
21:59:19 | Mimbus | flaviu: eval.nim(4, 5) Error: value of type 'seq[string]' has to be discarded |
21:59:24 | flaviu | .eval import re; echo "foo".findall(re"") |
21:59:28 | Mimbus | flaviu: out of memory |
21:59:53 | BlaXpirit | flaviu, Araq wasn't convinced by that, maybe he will by this new thing |
22:00:13 | Varriount | Isn't the 're' library powered by pcre? |
22:00:16 | EXetoC | just make sure that this is the cause |
22:00:35 | flaviu | Varriount: Yes, but pcre doesn't implement the replacement and findall. |
22:00:35 | BlaXpirit | Varriount, it sure is |
22:00:42 | BlaXpirit | pcre is good |
22:01:20 | flaviu | Varriount: The problem is that nim doesn't deal with a zero-length match correctly. |
22:01:36 | dom96 | BlaXpirit: Submit a bug report on Github for this please. |
22:01:43 | flaviu | It keeps trying to find the next match, never incriminating the index |
22:01:50 | flaviu | dom96: https://github.com/Araq/Nim/issues/1933 |
22:02:07 | BlaXpirit | "edge cases" |
22:02:29 | BlaXpirit | today's topic |
22:04:49 | * | superfunc quit (Ping timeout: 246 seconds) |
22:07:34 | Varriount | BlaXpirit: To satisfy the need for partially inclusive ranges, we could define new range operators, `...` |
22:07:42 | EXetoC | could you validate your assumption regarding re? |
22:07:51 | flaviu | EXetoC: Me? |
22:08:08 | Varriount | We can't change current ranges without massively breaking current programs. |
22:08:31 | flaviu | Varriount: I doubt any program relies on getting stuck in an infinite loop :P |
22:08:39 | flaviu | EXetoC: https://github.com/Araq/Nim/blob/master/lib/impure/re.nim#L230 |
22:08:40 | EXetoC | flaviu: no. did you make a claim? |
22:08:45 | EXetoC | ok |
22:08:59 | EXetoC | it is indeed very late to consider such changes |
22:09:02 | flaviu | EXetoC: Yes, that the problem with the re module is in findall. |
22:09:12 | Varriount | flaviu: Huh? I don't follow your statement. Where did I state that a program relies on getting stuck in an infinite loop? |
22:09:21 | EXetoC | maybe if we all did spend a huge amount of time on it |
22:09:33 | flaviu | Varriount: Sorry, I thought you were referring to the re.findAll bug. |
22:09:34 | dom96 | flaviu: Varriount is talking about changing ranges not split(). |
22:09:38 | flaviu | Oh. |
22:09:52 | flaviu | Anyway, if anyone wants to fix re, the correct implementation is here: https://github.com/flaviut/hairy-nemesis/blob/master/src/nre.nim#L344-L355 |
22:10:20 | Varriount | A very crude operators is 'proc `...`[T, R](a, b: T): R = result = a..(<b)' |
22:10:51 | BlaXpirit | Varriount, amazing |
22:10:54 | flaviu | Varriount: Again, that's insufficent. |
22:10:57 | Varriount | Of course, this doesn't fix the problem with strings and sequences accepting negative indices. |
22:11:04 | BlaXpirit | now i can write if n > 0: s[0 ... n] else: "" |
22:11:09 | BlaXpirit | instead of if n > 0: s[0 .. <n] else: "" |
22:11:11 | BlaXpirit | gj |
22:11:26 | Varriount | BlaXpirit: Are you being sarcastic? I can't tell. |
22:11:29 | BlaXpirit | i am |
22:11:44 | Varriount | :< |
22:11:54 | EXetoC | as always. please do less of it |
22:12:15 | dom96 | flaviu: Maybe you should create a PR for that issue? |
22:12:27 | BlaXpirit | dom96, i think the existing re library is beyond fixing |
22:12:30 | flaviu | dom96: I don't care enough, I wrote my own library. |
22:12:36 | * | Sergio96_ joined #nim |
22:13:13 | Varriount | BlaXpirit: I'm just trying to help. I'm sorry if I offended you earlier. |
22:13:34 | dom96 | Of course. Why make what everyone uses better when you can just write something completely different and then not even contribute it back into the ecosystem. |
22:13:37 | BlaXpirit | i just hope people don't get too offended by what i do |
22:13:53 | BlaXpirit | dom96, come on... |
22:14:09 | flaviu | dom96: please don't say that, I contribute everything possible back |
22:14:09 | BlaXpirit | you know stdlib is not good |
22:14:10 | Varriount | dom96: I'll fix it when I get home. Hopefully it's a simple fix. |
22:14:10 | flaviu | https://github.com/flaviut/hairy-nemesis |
22:14:28 | BlaXpirit | everyone should just switch to new library and be happy |
22:14:58 | BlaXpirit | but yeah, maybe these small direct bugfixes are indeed important |
22:15:45 | dom96 | Wait. So you're saying that we shouldn't use the stdlib at all because it's not good? |
22:15:46 | EXetoC | BlaXpirit: not so much offended as annoyed by the apparent aggression |
22:15:55 | dom96 | And we also shouldn't bother to improve it? |
22:16:19 | BlaXpirit | in some parts, yes |
22:17:23 | flaviu | dom96: See D. They had two stdlibs for a while, and came out better for it. |
22:17:35 | dom96 | flaviu: They most certainly did not. |
22:17:38 | Triplefox | Write a "2" and deprecate, optparse already did that |
22:17:48 | BlaXpirit | optparse :D |
22:18:28 | BlaXpirit | parseopt* probably |
22:18:46 | EXetoC | dom96: I hope most people care about the ecosystem |
22:18:52 | Triplefox | Yeah one of those :/ |
22:18:54 | BlaXpirit | parseopt2 is still almost useless -_- |
22:19:13 | BlaXpirit | btw i was writing docopt this whole day |
22:19:19 | BlaXpirit | until the bugs got to me |
22:20:29 | EXetoC | dom96: just do lib<number> if necessary, deprecate the old lib, and then eventually migrate, but that'll hopefully be a rare occurrence |
22:21:15 | BlaXpirit | EXetoC, I actually hope that to be a frequent occurence |
22:21:56 | EXetoC | it might not be so bad. just output some notice upon the use of the deprecated lib |
22:21:57 | BlaXpirit | not frequent changes to one lib |
22:22:08 | BlaXpirit | but many libs need reworking :s |
22:22:14 | dom96 | I would like to see RFCs on Github describing what you would like to see improved. |
22:22:28 | dom96 | Then once Araq agrees for you to make those improvements. |
22:22:53 | * | tinAndi quit (Quit: ChatZilla 0.9.91.1 [Firefox 35.0/20150108202552]) |
22:25:51 | BlaXpirit | dom96, ah yeah |
22:25:58 | BlaXpirit | i remember how it was with "random" library |
22:26:10 | BlaXpirit | still sitting there in the dust |
22:26:39 | dom96 | oh? |
22:26:45 | BlaXpirit | i didn't write an "RFC" though |
22:26:57 | dom96 | what did you do? |
22:27:06 | BlaXpirit | but i don't think it's nearly ready to be included in stdlib |
22:27:20 | BlaXpirit | and stdlib inclusion is like a death sentence for a library anywa |
22:27:21 | BlaXpirit | y |
22:27:44 | BlaXpirit | dom96, but at the very least, i reported a ton of bugs with the current random() function, and i didnt see any change |
22:28:01 | EXetoC | manpower |
22:28:08 | dom96 | You expect Araq to fix all 400 open issues at once? |
22:28:13 | ekarlso- | get nimble working with a package index like crates.io in rust and u can have lots of libs outside of nimble itself.. |
22:28:41 | BlaXpirit | i almost think there should be almost no standard library |
22:28:48 | flaviu | ^^ |
22:28:58 | flaviu | I've been thinking very similar thoughts. |
22:29:06 | BlaXpirit | but nah, that's too dangerous for backwards compatibility |
22:29:16 | BlaXpirit | libs can even get totally removed from github and everyone's screwed |
22:29:43 | BlaXpirit | even pull requests for nim are often ignored |
22:30:20 | BlaXpirit | (yes, i changed topic again) |
22:30:28 | ldlework | I mean |
22:30:34 | flaviu | My main criticism is that nim tries to do too much. |
22:30:34 | ldlework | oops I was scrolled up |
22:30:43 | ldlework | (I like negative indicies) |
22:30:56 | ldlework | flaviu: please don't turn Nim into Go :( |
22:31:13 | flaviu | Manpower is an issue, yet it's critical that all the infrastructure be written in nim? |
22:31:29 | BlaXpirit | ^this x1000 |
22:31:30 | flaviu | Don't use a CSS preprocessor unless it's written in nim? |
22:31:52 | ldlework | :up-vote: |
22:32:12 | Triplefox | Would there be a conflict if the python slice syntax were bolted on the existing one |
22:32:37 | BlaXpirit | Triplefox, you woke up? |
22:32:41 | ldlework | Triplefox: I'm confounded why we don't just exactly copy what Python does in every instance it makes sense to |
22:32:57 | BlaXpirit | not sure if it's sarcastic, but in case it's not, i agree |
22:33:02 | BlaXpirit | too late tho |
22:33:08 | ldlework | Like for the "We could do anything here, what should we do, people like Python, so lets just do that" |
22:33:14 | ldlework | would takes us reallly reallly far |
22:33:23 | Triplefox | the existing is fine for certain things...so keep it |
22:33:38 | BlaXpirit | Triplefox, we can't not keep it |
22:33:44 | BlaXpirit | can't break almost every single program |
22:33:54 | BlaXpirit | but that is not my point anyway -_- |
22:34:19 | ldlework | Should we be able to take nim source, compile it to ast, automatically transform it and spit out the modified source? |
22:34:33 | ldlework | gofmt style? |
22:34:35 | BlaXpirit | ldlework, isn't that exactly what macros do |
22:34:42 | ldlework | BlaXpirit: they don't produce source code do they? |
22:34:48 | BlaXpirit | pretty sure they do |
22:34:54 | BlaXpirit | mm maybe not |
22:34:57 | BlaXpirit | i'm not sure |
22:35:11 | EXetoC | ldlework: nimfix will serve that purpose apparently |
22:35:11 | flaviu | ldlework: nimfix pretty |
22:35:16 | EXetoC | or will, but I don't know how well |
22:35:24 | ldlework | So like |
22:35:25 | EXetoC | atm that is |
22:35:31 | ldlework | if we were going to do this thing were |
22:35:33 | flaviu | It used to be in the compiler, apparently it it got moved out. |
22:35:34 | ldlework | before 1.0 |
22:35:48 | ldlework | we break all the languages really ... uncomfortable abrasive edges |
22:36:06 | ldlework | would we be able to largely automate small syntax changes like this? |
22:36:13 | ldlework | maybe I'm dreaming |
22:36:25 | ldlework | but didn't even Python have 2to3 |
22:36:56 | ldlework | think about the Nim our children will write |
22:37:03 | ldlework | Please wont SOMEBODY think of the children? |
22:37:07 | ekarlso- | aha |
22:37:09 | ekarlso- | haha |
22:38:23 | BlaXpirit | :D |
22:38:26 | EXetoC | it doesn't matter how good or bad the forum is, discussing some things on IRC is simply not ideal |
22:38:40 | EXetoC | (not to self also) |
22:39:21 | BlaXpirit | modern forums should be closer to chats than to 20th century forums |
22:39:37 | BlaXpirit | gitter almost got it right |
22:39:44 | dom96 | Lies, we obviously need a mailing list. |
22:39:59 | Triplefox | Where is our printed newsletter |
22:40:00 | flaviu | dom96: I'd suggest google groups, but that's incredibly terrible. |
22:40:04 | ldlework | We need a proposal system. |
22:40:16 | BlaXpirit | github issues duh |
22:40:24 | BlaXpirit | what's the point if they're going to be ignored anyway |
22:40:35 | EXetoC | forever? |
22:40:45 | ldlework | I wish I could contribute to the language directly |
22:40:45 | EXetoC | more pessimism |
22:40:48 | ldlework | garrr |
22:40:48 | * | gsingh93 quit (Ping timeout: 245 seconds) |
22:40:56 | flaviu | Btw, how do I install nimfix? |
22:40:58 | BlaXpirit | pessimism is nice |
22:41:01 | flaviu | it's not in Nimble |
22:41:07 | BlaXpirit | you're either correct or pleasantly surprised |
22:41:12 | ekarlso- | if anyone wants to checkout packages tmrw and flame me please ping me . |
22:41:19 | Triplefox | This comes up with every language community. Nobody is happy with just one medium so we have to allow overlap |
22:41:34 | ldlework | Triplefox: with regards to what |
22:50:07 | Araq | flaviu [22:31:13] Manpower is an issue, yet it's critical that all the infrastructure be written in nim? |
22:50:23 | Araq | again this argument? |
22:50:36 | Araq | so how many PRs did you submit for Varriount's buildbot? |
22:51:03 | * | alphawaffle joined #nim |
22:52:10 | * | gokr1 quit (*.net *.split) |
22:52:11 | * | Etheco quit (*.net *.split) |
22:52:11 | * | biscarch quit (*.net *.split) |
22:52:11 | * | Mimbus quit (*.net *.split) |
22:52:12 | * | RushPL quit (*.net *.split) |
22:52:13 | * | Varriount quit (*.net *.split) |
22:52:14 | * | hguux_ quit (*.net *.split) |
22:52:14 | * | adam| quit (*.net *.split) |
22:52:14 | * | MyMind quit (*.net *.split) |
22:52:16 | * | dymk quit (*.net *.split) |
22:52:17 | * | iivvoo quit (*.net *.split) |
22:52:17 | * | TylerE quit (*.net *.split) |
22:52:18 | * | EastByte_ quit (*.net *.split) |
22:52:18 | * | no_name quit (*.net *.split) |
22:52:18 | * | CARAM__ quit (*.net *.split) |
22:52:19 | * | novist quit (*.net *.split) |
22:52:19 | * | x4nt quit (*.net *.split) |
22:52:20 | * | Amrykid quit (*.net *.split) |
22:52:20 | * | xAndy quit (*.net *.split) |
22:52:21 | * | Triplefox quit (*.net *.split) |
22:52:21 | * | akyte quit (*.net *.split) |
22:52:21 | * | SplinterOfChaos quit (*.net *.split) |
22:52:22 | * | [CBR]Unspoken quit (*.net *.split) |
22:52:23 | * | dom96 quit (*.net *.split) |
22:52:23 | * | comex quit (*.net *.split) |
22:52:24 | * | fold quit (*.net *.split) |
22:52:25 | * | renesac quit (*.net *.split) |
22:52:25 | * | eigenlicht quit (*.net *.split) |
22:52:25 | * | Trustable quit (*.net *.split) |
22:52:25 | * | flaviu quit (*.net *.split) |
22:52:26 | * | endou______ quit (*.net *.split) |
22:52:26 | * | clone1018 quit (*.net *.split) |
22:52:26 | * | [dee] quit (*.net *.split) |
22:52:26 | * | profan quit (*.net *.split) |
22:52:27 | * | Grauwolf quit (*.net *.split) |
22:52:28 | * | KoFish quit (*.net *.split) |
22:52:29 | * | sillesta quit (*.net *.split) |
22:52:29 | * | skyfex quit (*.net *.split) |
22:52:30 | * | saml quit (*.net *.split) |
22:52:30 | * | valberg quit (*.net *.split) |
22:52:30 | * | vegai quit (*.net *.split) |
22:52:30 | * | jez0990 quit (*.net *.split) |
22:52:31 | * | def- quit (*.net *.split) |
22:52:31 | * | delian66 quit (*.net *.split) |
22:52:31 | * | dv- quit (*.net *.split) |
22:52:32 | * | vendethiel quit (*.net *.split) |
22:52:32 | * | VinceAddons quit (*.net *.split) |
22:52:32 | * | Boscop quit (*.net *.split) |
22:52:32 | * | kniteli quit (*.net *.split) |
22:52:33 | * | onionhammer quit (*.net *.split) |
22:52:33 | * | zielmicha quit (*.net *.split) |
22:52:33 | * | reloc0 quit (*.net *.split) |
22:52:34 | * | nande quit (*.net *.split) |
22:52:34 | * | Jesin quit (*.net *.split) |
22:52:34 | * | zahary_ quit (*.net *.split) |
22:52:34 | * | gmoore quit (*.net *.split) |
22:52:34 | * | dtscode quit (*.net *.split) |
22:52:35 | * | Sergio96_ quit (*.net *.split) |
22:52:35 | * | BlaXpirit quit (*.net *.split) |
22:52:35 | * | MajorTennis quit (*.net *.split) |
22:52:36 | * | clone1018_ quit (*.net *.split) |
22:52:36 | * | JStoker quit (*.net *.split) |
22:52:37 | * | irrequietus quit (*.net *.split) |
22:52:39 | * | jsudlow quit (*.net *.split) |
22:52:39 | * | vezzy quit (*.net *.split) |
22:52:40 | * | lyro quit (*.net *.split) |
22:52:40 | * | phI||Ip quit (*.net *.split) |
22:52:41 | * | skroll3 quit (*.net *.split) |
22:52:41 | * | ekarlso- quit (*.net *.split) |
22:52:41 | * | betawaffle quit (*.net *.split) |
22:52:42 | * | wtw quit (*.net *.split) |
22:52:42 | * | flan3002 quit (*.net *.split) |
22:52:42 | * | flyx quit (*.net *.split) |
22:52:42 | * | ldlework quit (*.net *.split) |
22:52:42 | * | Trixar_za quit (*.net *.split) |
22:52:43 | * | alexruf quit (*.net *.split) |
22:52:43 | * | brson quit (*.net *.split) |
22:52:43 | * | Etheco- quit (*.net *.split) |
22:52:44 | * | fowl quit (*.net *.split) |
22:52:44 | * | joebo quit (*.net *.split) |
22:52:46 | * | jpoirier quit (*.net *.split) |
22:52:47 | * | EXetoC quit (*.net *.split) |
22:52:47 | * | yonson quit (*.net *.split) |
22:52:48 | * | MightyJoe quit (*.net *.split) |
22:52:48 | * | ramnes quit (*.net *.split) |
22:52:48 | * | alphawaffle is now known as betawaffle |
22:53:05 | * | Etheco joined #nim |
22:53:34 | * | Amrykid2 joined #nim |
22:53:34 | * | phI||Ip_ joined #nim |
22:53:34 | * | founders joined #nim |
22:53:34 | * | Triplefox_ joined #nim |
22:53:34 | * | quasinoxen joined #nim |
22:53:34 | * | biscarch_ joined #nim |
22:53:34 | * | gsingh93 joined #nim |
22:53:34 | * | Sergio96_ joined #nim |
22:53:34 | * | vendethiel joined #nim |
22:53:34 | * | nande joined #nim |
22:53:34 | * | sillesta joined #nim |
22:53:34 | * | alexruf joined #nim |
22:53:34 | * | brson joined #nim |
22:53:34 | * | eigenlicht joined #nim |
22:53:34 | * | irrequietus joined #nim |
22:53:34 | * | BlaXpirit joined #nim |
22:53:34 | * | Jesin joined #nim |
22:53:34 | * | VinceAddons joined #nim |
22:53:34 | * | zahary_ joined #nim |
22:53:34 | * | Etheco- joined #nim |
22:53:34 | * | Trustable joined #nim |
22:53:34 | * | gmoore joined #nim |
22:53:34 | * | dtscode joined #nim |
22:53:34 | * | flaviu joined #nim |
22:53:34 | * | Boscop joined #nim |
22:53:34 | * | skyfex joined #nim |
22:53:34 | * | SplinterOfChaos joined #nim |
22:53:34 | * | endou______ joined #nim |
22:53:34 | * | dymk joined #nim |
22:53:34 | * | MajorTennis joined #nim |
22:53:34 | * | iivvoo joined #nim |
22:53:34 | * | TylerE joined #nim |
22:53:34 | * | hguux_ joined #nim |
22:53:34 | * | EastByte_ joined #nim |
22:53:34 | * | no_name joined #nim |
22:53:34 | * | CARAM__ joined #nim |
22:53:34 | * | wtw joined #nim |
22:53:34 | * | ldlework joined #nim |
22:53:34 | * | flan3002 joined #nim |
22:53:34 | * | flyx joined #nim |
22:53:34 | * | kniteli joined #nim |
22:53:34 | * | renesac joined #nim |
22:53:34 | * | Triplefox joined #nim |
22:53:34 | * | akyte joined #nim |
22:53:34 | * | Amrykid joined #nim |
22:53:34 | * | xAndy joined #nim |
22:53:34 | * | x4nt joined #nim |
22:53:34 | * | novist joined #nim |
22:53:34 | * | comex joined #nim |
22:53:34 | * | fold joined #nim |
22:53:34 | * | dom96 joined #nim |
22:53:34 | * | [CBR]Unspoken joined #nim |
22:53:34 | * | reloc0 joined #nim |
22:53:34 | * | zielmicha joined #nim |
22:53:34 | * | onionhammer joined #nim |
22:53:34 | * | clone1018_ joined #nim |
22:53:34 | * | profan joined #nim |
22:53:34 | * | clone1018 joined #nim |
22:53:34 | * | Grauwolf joined #nim |
22:53:34 | * | [dee] joined #nim |
22:53:34 | * | KoFish joined #nim |
22:53:34 | * | adam joined #nim |
22:53:34 | * | dv- joined #nim |
22:53:34 | * | delian66 joined #nim |
22:53:34 | * | def- joined #nim |
22:53:34 | * | jez0990 joined #nim |
22:53:34 | * | valberg joined #nim |
22:53:34 | * | vegai joined #nim |
22:53:34 | * | saml joined #nim |
22:53:34 | * | JStoker joined #nim |
22:53:34 | * | MyMind joined #nim |
22:53:34 | * | Trixar_za joined #nim |
22:53:34 | * | fowl joined #nim |
22:53:34 | * | joebo joined #nim |
22:53:38 | * | adam is now known as Guest51690 |
22:53:38 | * | novist` joined #nim |
22:53:52 | * | ldleworker joined #nim |
22:54:03 | * | dymk quit (*.net *.split) |
22:54:04 | * | iivvoo quit (*.net *.split) |
22:54:04 | * | TylerE quit (*.net *.split) |
22:54:05 | * | EastByte_ quit (*.net *.split) |
22:54:05 | * | no_name quit (*.net *.split) |
22:54:05 | * | CARAM__ quit (*.net *.split) |
22:54:06 | * | novist quit (*.net *.split) |
22:54:06 | * | x4nt quit (*.net *.split) |
22:54:07 | * | Amrykid quit (*.net *.split) |
22:54:07 | * | xAndy quit (*.net *.split) |
22:54:08 | * | Triplefox quit (*.net *.split) |
22:54:08 | * | akyte quit (*.net *.split) |
22:54:23 | * | jpoirier joined #nim |
22:54:23 | * | EXetoC joined #nim |
22:54:23 | * | yonson joined #nim |
22:54:23 | * | MightyJoe joined #nim |
22:54:23 | * | ramnes joined #nim |
22:54:27 | * | xandy joined #nim |
22:54:37 | * | ldlework quit (*.net *.split) |
22:54:37 | * | Trixar_za quit (*.net *.split) |
22:54:46 | * | vendethiel quit (Remote host closed the connection) |
22:54:49 | * | vendethiel- joined #nim |
23:05:50 | * | NimBot joined #nim |
23:06:08 | * | no_name joined #nim |
23:06:22 | * | comex joined #nim |
23:06:22 | * | Zuchto joined #nim |
23:06:47 | * | phI||Ip joined #nim |
23:06:49 | * | fold joined #nim |
23:06:57 | * | eigenlicht joined #nim |
23:07:56 | * | phI||Ip_ quit (*.net *.split) |
23:07:56 | * | quasinoxen quit (*.net *.split) |
23:07:57 | * | VinceAddons quit (*.net *.split) |
23:07:57 | * | Boscop quit (*.net *.split) |
23:07:57 | * | kniteli quit (*.net *.split) |
23:07:57 | * | onionhammer quit (*.net *.split) |
23:07:57 | * | zielmicha quit (*.net *.split) |
23:07:57 | * | reloc0 quit (*.net *.split) |
23:07:59 | * | CARAM__ quit (Max SendQ exceeded) |
23:08:16 | * | onionhammer joined #nim |
23:08:19 | sillesta | netsplit? |
23:08:45 | * | reloc0 joined #nim |
23:09:05 | * | jsudlow joined #nim |
23:09:16 | * | zielmicha joined #nim |
23:09:23 | * | profan joined #nim |
23:09:29 | * | betawaffle joined #nim |
23:09:45 | * | zielmicha is now known as Guest67437 |
23:10:04 | * | TylerE quit (Ping timeout: 244 seconds) |
23:10:30 | * | Roin joined #nim |
23:10:36 | * | jsudlow quit (Client Quit) |
23:10:41 | Triplefox | Freenode is falling over... |
23:10:45 | * | jsudlow joined #nim |
23:11:06 | dom96 | Somebody is DDOS'ing them |
23:11:08 | * | nande quit (Ping timeout: 246 seconds) |
23:12:03 | * | TylerE joined #nim |
23:12:45 | * | lyro joined #nim |
23:12:45 | * | stonecolddevin joined #nim |
23:12:45 | * | joebo joined #nim |
23:12:45 | * | 7YUAAFJOH joined #nim |
23:12:45 | * | MattAitchison joined #nim |
23:12:45 | * | milosn joined #nim |
23:12:45 | * | ramnes joined #nim |
23:12:45 | * | MightyJoe joined #nim |
23:12:45 | * | yonson joined #nim |
23:12:45 | * | EXetoC joined #nim |
23:12:45 | * | jpoirier joined #nim |
23:12:45 | * | Boscop_ joined #nim |
23:12:45 | * | fowlmouth joined #nim |
23:12:45 | * | Fusion_Gaming joined #nim |
23:12:45 | * | x4nt joined #nim |
23:12:45 | * | brson joined #nim |
23:12:45 | * | Etheco joined #nim |
23:12:45 | * | flaviu joined #nim |
23:12:45 | * | wan joined #nim |
23:13:28 | * | trevorriles joined #nim |
23:13:41 | * | Araq joined #nim |
23:13:41 | * | kniteli joined #nim |
23:13:46 | * | CARAM__ joined #nim |
23:14:16 | * | Varriount joined #nim |
23:14:27 | * | xAndy joined #nim |
23:14:30 | * | Trixar_za joined #nim |
23:14:50 | * | wan is now known as Guest70720 |
23:14:50 | * | flaviu is now known as Guest27733 |
23:16:14 | * | nande joined #nim |
23:22:52 | * | nande quit (Ping timeout: 240 seconds) |
23:24:13 | * | nande joined #nim |
23:24:57 | * | sillesta quit (Ping timeout: 265 seconds) |
23:26:08 | BlaXpirit_ | just look at this horrible code |
23:26:23 | BlaXpirit_ | https://bpaste.net/show/7ccec556932a |
23:26:51 | BlaXpirit_ | THREE TIMES i needed a conditional because of those negative indices |
23:27:26 | Guest27733 | BlaXpirit_: Personal fork? |
23:27:39 | * | keyle joined #nim |
23:27:42 | keyle | hi |
23:27:48 | BlaXpirit_ | i've been doing nothing but making libraries |
23:28:06 | * | Guest27733 quit (Read error: Connection reset by peer) |
23:28:20 | * | flaviu_ joined #nim |
23:29:15 | * | TylerE quit (Changing host) |
23:29:15 | * | TylerE joined #nim |
23:29:39 | * | flaviu_ is now known as flaviu |
23:30:22 | fowlmouth | BlaXpirit_, i dont think it has to be this complicated but idk.. i can't really tell whats going on here |
23:30:52 | BlaXpirit_ | fowlmouth, have u seen my bug argument earlier today? |
23:31:16 | * | CARAM__ quit (Changing host) |
23:31:16 | * | CARAM__ joined #nim |
23:32:06 | fowlmouth | no but BlaXpirit_ multiple yields arent wise for an inline iterator |
23:33:05 | BlaXpirit_ | there is no other way |
23:33:43 | * | johnsoft joined #nim |
23:34:11 | BlaXpirit_ | :| |
23:34:28 | ldlework | why isn't that wise |
23:34:41 | BlaXpirit_ | fowlmouth, tell me how to get first N characters of a string |
23:35:11 | BlaXpirit_ | (this is a test for you, not something I don't know) |
23:35:31 | BlaXpirit_ | don't forget about corner cases |
23:35:52 | fowlmouth | ldlework, the code inside the for loop is placed at the yield |
23:35:52 | ekarlso | flaviu: did u get the q on decoding ? |
23:36:13 | BlaXpirit_ | well i mean you can't get first 5 characters of a 3-char string, but the other corner case :| |
23:36:52 | * | VinceAddons joined #nim |
23:37:13 | fowlmouth | BlaXpirit_, uh str[0.. <N]? |
23:37:14 | flaviu | ekarlso: nope, I can't find it in the logs either. Can you post it again? |
23:37:23 | flaviu | fowlmouth: N == 0 |
23:37:23 | EXetoC | you should add "with a slice operation" |
23:37:25 | BlaXpirit_ | flaviu, yay, typical |
23:37:26 | * | gunn joined #nim |
23:37:32 | ekarlso | flaviu: just pondering on how to decode a hs256 |
23:37:36 | BlaXpirit_ | so the problem is, when N==0, it returns the whole string |
23:37:44 | BlaXpirit_ | first 0 characters is "", not the whole string |
23:37:50 | fowlmouth | ok |
23:38:05 | fowlmouth | so str[0.. max(0,<N)] |
23:38:05 | BlaXpirit_ | and that's what i've been ranting about |
23:38:12 | def- | BlaXpirit_: use substr instead? |
23:38:13 | BlaXpirit_ | fowlmouth, HAHA YOU FELL FOR IT AGAIN |
23:38:16 | EXetoC | fold: not allowed apparently |
23:38:19 | EXetoC | fowlmouth: |
23:38:23 | EXetoC | >.> |
23:38:28 | BlaXpirit_ | fowlmouth, n==0 then it gets 1 character |
23:38:31 | * | johnsoft quit (Client Quit) |
23:38:43 | fowlmouth | oh i see BlaXpirit_ |
23:38:44 | flaviu | ekarlso: Please read the specification. https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#page-12 |
23:38:47 | EXetoC | but of course it doesn't account for the first 0 chars |
23:38:51 | fowlmouth | BlaXpirit_, i thought you could also do str[start, len] in nim? |
23:38:55 | flaviu | ekarlso: Base64url |
23:38:56 | BlaXpirit_ | fowlmouth, i dunno |
23:39:07 | BlaXpirit_ | def-, substr? let's see |
23:39:10 | fowlmouth | well try that please i'm pretty sure it works |
23:39:23 | EXetoC | fowlmouth: no |
23:40:04 | flaviu | .eval "foo".substr(0, -1) |
23:40:07 | fowlmouth | .eval "hi"[0,1].echo |
23:40:08 | * | Jesin quit (Quit: Leaving) |
23:40:37 | * | Mimbus joined #nim |
23:40:41 | flaviu | .eval "foo".substr(0, -1) |
23:40:44 | Mimbus | flaviu: eval.nim(3, 5) Error: value of type 'string' has to be discarded |
23:40:45 | EXetoC | it seems the bot doesn't reconnect automatically |
23:40:51 | * | johnsoft joined #nim |
23:41:11 | BlaXpirit_ | def-, substr works indeed! |
23:41:19 | BlaXpirit_ | now what about seqs? |
23:41:38 | def- | BlaXpirit_: write your own sub proc with the behaviour you want at corner cases |
23:41:40 | BlaXpirit_ | flaviu, substr is that thing you said |
23:41:49 | BlaXpirit_ | def-, oh, write my own proc... sure |
23:42:10 | BlaXpirit_ | flaviu, sorry, i keep pinging you instead of fowlmouth |
23:42:24 | fowlmouth | i said nothinga bout substr |
23:42:44 | BlaXpirit_ | fowlmouth, "hi"[0, 1] is hi.substr(0, 1) |
23:43:25 | BlaXpirit_ | wait, no, it isnt |
23:43:44 | BlaXpirit_ | it's exactly what i wanted - [] without negative indices |
23:44:08 | * | Jesin joined #nim |
23:45:30 | BlaXpirit_ | "[] considered harmful" |
23:46:53 | * | [dee]_ is now known as [dee] |
23:47:10 | flaviu | BlaXpirit_: I'm pretty sure substr(0, -1) works only be accident. |
23:47:32 | flaviu | https://github.com/Araq/Nim/blob/5979d35ab2052b467e89ade90a7b3a47a50e2a28/lib/system/sysstr.nim#L52-L61 |
23:48:47 | BlaXpirit_ | flaviu, ? |
23:49:03 | BlaXpirit_ | all seems in order. what accident? |
23:49:39 | BlaXpirit_ | it never does len-index |
23:51:21 | flaviu | The documentation makes no mention of it, substr(0, -2) is undefined behavior, I think. |
23:53:19 | BlaXpirit_ | to that i can agree |
23:54:09 | BlaXpirit_ | but then again, documentation doesn't mention a lot :p |
23:56:02 | fowlmouth | well it sounds useful |
23:56:26 | fowlmouth | i thought thats how most substr()s work |
23:57:04 | flaviu | fowlmouth: for most substrings, "foo".substring(0, 0) == "" |
23:57:11 | BlaXpirit_ | most substrs work with non-inclusive... |
23:57:18 | BlaXpirit_ | or specify length |
23:57:20 | Araq | so make a PR and document it |
23:57:36 | BlaXpirit_ | but that would go against language convention |
23:57:44 | BlaXpirit_ | oh you mean documentation |
23:57:46 | BlaXpirit_ | nvm |
23:57:50 | fowlmouth | o_O |
23:58:38 | Triplefox | i am looking at sequence slices now...do we have an equivalent to substr |
23:58:49 | BlaXpirit_ | i guess not but we can look |
23:59:25 | Araq | s[0 .. find(s, '.')] # whole string when no s has no dot at all |
23:59:54 | Araq | you act lke the current behaviour is always undesirable, but it's not |