00:22:33 | * | superfunc joined #nimrod |
00:34:46 | flaviu | Araq: If you aren't asleep yet, consider how bignums would interact with the rules you're implementing. If they are to fit into your new type system, then you'd need a way of describing them to it. Same thing could be done with the current magics |
00:46:14 | * | Matthias247 quit (Read error: Connection reset by peer) |
00:59:18 | * | superfunc quit (Ping timeout: 240 seconds) |
00:59:28 | * | DAddYE_ quit (Remote host closed the connection) |
00:59:55 | * | DAddYE joined #nimrod |
01:00:45 | flaviu | https://www.artima.com/forums/flat.jsp?forum=106&thread=171028&start=0&msRange=90 |
01:04:44 | * | DAddYE quit (Ping timeout: 265 seconds) |
01:13:16 | flaviu | With the modifications to the language I was talking about, I think its possible to implement dependent without even touching the compiler! |
01:16:40 | flaviu | If `if` was implemented as a library function |
01:19:12 | flaviu | `parseFloat` doesn't take into consideration the oddities of floating point, it isn't very accurate :/ |
01:19:46 | flaviu | 1.08293520532202032 -> 1.0829352053220205, correct answer wold be 1.0829352053220205 |
01:21:38 | flaviu | Copy-pasted wrong, correct answer should be 1.0829352053220203 |
01:30:29 | * | DAddYE joined #nimrod |
01:34:34 | * | DAddYE quit (Ping timeout: 240 seconds) |
01:47:17 | * | q66 quit (Quit: Leaving) |
02:01:31 | * | bjz quit (Ping timeout: 250 seconds) |
02:06:11 | * | superfunc joined #nimrod |
02:22:55 | * | Skrylar joined #nimrod |
02:25:15 | milosn | it works. |
02:25:18 | * | superfunc quit (Ping timeout: 240 seconds) |
02:25:19 | milosn | http://pastie.org/9164177 |
02:25:20 | milosn | :D |
02:25:31 | milosn | now i can sleep ... its alive. |
02:25:32 | milosn | :D |
02:26:20 | milosn | its alive! its alive! |
02:26:58 | milosn | Araq: you are gonna hate me so much more than i thought you would the previous night ... but oh well |
02:31:22 | * | DAddYE joined #nimrod |
02:35:30 | * | DAddYE quit (Ping timeout: 240 seconds) |
02:38:29 | milosn | hmmm |
02:38:33 | milosn | well this was fun |
02:47:10 | * | bjz joined #nimrod |
02:55:42 | reactormonk | milosn, we need MOAR |
03:03:24 | renesac | http://programmers.stackexchange.com/questions/238661/which-low-level-programming-language-is-most-similar-to-python |
03:07:16 | reactormonk | renesac, go write something witty for nimrod and be downvoted ^^ |
03:14:09 | renesac | that will be potentially dom96 |
03:14:41 | renesac | I'm just dropping the link here in case somebody can write a good answer there |
03:15:06 | flaviu | renesac: I'll have a go at it before going to bed |
03:28:22 | Varriount | flaviu, renesac: As will I |
03:32:08 | * | DAddYE joined #nimrod |
03:36:19 | * | DAddYE quit (Ping timeout: 240 seconds) |
03:48:57 | * | superfunc joined #nimrod |
03:51:08 | * | nicolastarzia quit (Quit: Leaving) |
04:01:46 | * | DAddYE joined #nimrod |
04:12:59 | * | Kelet quit (Quit: Lost terminal) |
04:39:25 | * | flaviu quit (Remote host closed the connection) |
04:39:42 | reactormonk | user60561 come on |
05:00:45 | Varriount | reactormonk: ? |
05:12:01 | reactormonk | make a real™ nick |
05:32:08 | njoejoe | milosn: that dirtyorm looks handy. |
06:06:58 | * | noam quit (Quit: Leaving) |
06:10:30 | * | oxful__ joined #nimrod |
06:14:05 | * | oxful_ quit (Ping timeout: 264 seconds) |
06:28:57 | * | seertaak joined #nimrod |
06:30:27 | seertaak | are nimrod identifiers case-sensitive? saw a post by araq on forum about removing case-insensitivity, and making correct style for variables camelCase, and types PascalCase. is this the current state of the art? |
06:39:48 | * | seertaak quit (Ping timeout: 240 seconds) |
07:27:47 | * | boydgreenfield quit (Quit: boydgreenfield) |
07:43:18 | * | zahary1 joined #nimrod |
07:43:49 | * | zahary quit (Read error: Connection reset by peer) |
08:16:52 | * | DAddYE quit (Remote host closed the connection) |
08:17:19 | * | DAddYE joined #nimrod |
08:21:30 | * | DAddYE quit (Ping timeout: 240 seconds) |
09:00:48 | * | kunev joined #nimrod |
09:31:22 | * | io2 joined #nimrod |
09:58:51 | * | vendethiel quit (Read error: Connection reset by peer) |
10:00:47 | * | Matthias247 joined #nimrod |
10:02:11 | * | vendethiel joined #nimrod |
10:03:43 | * | BitPuffin quit (Read error: Connection reset by peer) |
10:23:48 | * | superfunc quit (Ping timeout: 240 seconds) |
11:18:31 | milosn | njoejoe: yeah |
11:19:14 | milosn | usefull, but there is a reason why its called "dirty" ... its dirty in python, and in nimrod? ill upload source to bitbucket when i clean it up |
11:19:23 | milosn | ... its just plain dirty :) |
11:20:38 | milosn | hmmm looks like db_mysql runs all connections in auto-commit mode, i cant find switch to disable it |
11:21:21 | milosn | for large/bulk inserts you need beginTrans()/commitTrans()/rollbackTrans() thingies |
11:28:55 | * | Trimsty joined #nimrod |
11:33:31 | * | Trimsty quit (Client Quit) |
11:35:50 | * | BitPuffin joined #nimrod |
12:35:31 | * | q66 joined #nimrod |
12:35:31 | * | q66 quit (Changing host) |
12:35:31 | * | q66 joined #nimrod |
12:56:45 | * | darkf quit (Quit: Leaving) |
13:11:38 | * | kunev quit (Quit: Lost terminal) |
13:14:25 | * | enurlyx joined #nimrod |
13:21:25 | Skrylar | i still sometimes wish we had a cross between ecco pro and tinderbox when i plan things to write in nimrod >< |
13:41:10 | * | flaviu joined #nimrod |
13:42:13 | enurlyx | Is it possible to disable assignment for a object? |
13:42:21 | enurlyx | var x = createFoo() |
13:42:26 | enurlyx | x = y # error |
13:43:26 | flaviu | enurlyx: I don't think so yet |
13:44:08 | flaviu | http://build.nimrod-lang.org/docs/manual.html#tuples-and-object-types , " Overloading of the assignment operator for objects is not possible, but this will change in future versions of the compiler." |
13:44:40 | enurlyx | The problem is, when there exists a destructor and a user copys the value, then the destructor is called twice and frees a resource twice |
13:45:03 | enurlyx | So i want to force him to use clone. |
13:45:13 | enurlyx | Nice if it can be done in the future :) |
13:47:06 | * | Jehan_ joined #nimrod |
13:48:40 | EXetoC | so two copies are made. the language could prevent that |
13:50:14 | enurlyx | EXetoC do you mean i should use a ref type instead? |
13:53:29 | EXetoC | now maybe, but it could work correctly for value types |
13:54:12 | EXetoC | but there might be some problems associated with the lack of immutable var's (lhs parameter for `=`) |
13:55:33 | EXetoC | maybe inline would do the trick |
13:56:41 | * | eigenlicht quit (Ping timeout: 252 seconds) |
14:03:19 | * | Jehan_ quit (Quit: Leaving) |
14:07:43 | * | psquid_ left #nimrod ("WeeChat 0.4.3") |
14:29:04 | * | Trimsty joined #nimrod |
14:34:27 | * | Trimsty quit (Quit: Trimsty) |
14:48:10 | flaviu | I wish koch had daemon mode |
14:53:04 | fowl | koch possess victim |
15:14:53 | * | flaviu quit (Remote host closed the connection) |
15:16:50 | EXetoC | for persisting what? |
15:32:46 | * | flaviu joined #nimrod |
15:57:19 | * | eigenlicht joined #nimrod |
16:00:00 | Varriount | God. Whoever set the precedent for null terminated strings needs to be hit over the head with something hard. |
16:04:13 | * | untitaker quit (Ping timeout: 265 seconds) |
16:09:18 | * | untitaker joined #nimrod |
16:16:25 | EXetoC | they had good reasons back then |
16:19:31 | EXetoC | http://stackoverflow.com/a/2221340/3477721 |
16:22:53 | * | kunev joined #nimrod |
16:44:32 | * | boydgreenfield joined #nimrod |
16:45:25 | * | flaviu quit (Ping timeout: 276 seconds) |
17:04:17 | renesac | EXetoC, saving a byte per string was not really a good reason |
17:05:34 | njoejoe | Skrylar: ecco pro as in the PIM? |
17:10:34 | * | Jesin quit (Quit: Leaving) |
17:11:21 | Varriount | EXetoC: I can only imagine how much better the world would be if we had Pascal strings instead (with the length prepended) |
17:12:14 | Varriount | Of course, the problem you have then is, what size should the length be? 32 bits? 64 bits? Larger/Smaller? |
17:13:32 | renesac | you could have different types of strings, one of each size |
17:13:39 | renesac | string8, string16, etc |
17:13:40 | * | Varriount briefly imagines a world of "string16", "string32", and "string64" |
17:14:03 | renesac | much better than a world of \0 ended strings |
17:14:04 | renesac | :P |
17:14:32 | Varriount | Maybe more type hassle, but at least you don't have quite as many overflows due to missing nul terminators. |
17:14:47 | renesac | or due to spuriou |
17:14:53 | renesac | spurious null terminators |
17:15:05 | * | boydgreenfield quit (Quit: boydgreenfield) |
17:15:28 | renesac | one could use string functions in binary data w/o fear |
17:16:02 | renesac | well, you always have to fear if your function depends on the existence of a \0... |
17:16:11 | renesac | at the end of the string |
17:17:09 | Varriount | Another idea is to have a pointer which points to the end of the string. |
17:17:40 | Varriount | Although, that's not as simple to serialize. |
18:05:43 | renesac | in D, a string is a memory region pointed by a pointer + lenght |
18:10:57 | * | Jesin joined #nimrod |
18:14:46 | Matthias247 | Varriount: that would be same or even more expensive than a 32bit size field :) |
18:14:47 | EXetoC | fowl, packed + variant seems to work |
18:19:28 | EXetoC | renesac, not even in the 70s? |
18:19:34 | EXetoC | but whatever. it's still here, and it sucks |
18:22:38 | * | flaviu joined #nimrod |
18:23:45 | EXetoC | flaviu, what would benefit from daemonization? |
18:24:23 | flaviu | EXetoC: Make a change, it automatically recompiles so you can test the change immediately |
18:30:06 | EXetoC | ok I guess you save 1-2 key presses |
18:30:30 | flaviu | If it was supported by the compiler too, I'd also save ~20 seconds. |
18:31:24 | flaviu | Since the compiler would only have to parse the modified files |
18:31:57 | EXetoC | it doesn't just look at the timestamp when booting? |
18:32:30 | EXetoC | anyway, I think zahary uses a faster method for the common case |
18:32:49 | flaviu | Has he documented it anywhere? |
18:33:22 | EXetoC | dunno |
18:34:28 | flaviu | zahary1: ping |
18:35:59 | EXetoC | well, does it not compare the timestamps? though you still need to compile big parts of the dependency tree in many cases |
18:36:39 | * | Jesin quit (Quit: Leaving) |
18:39:19 | flaviu | I don't know, I haven't looked a those parts |
18:40:56 | flaviu | But I don't think it stores the dependency graph anywhere |
18:44:21 | * | Jesin joined #nimrod |
18:45:51 | Trixar_za | *coff* http://trixarian.net/SHODAN.ogg *coff* - Found a copy of the original Wikipedia clip I got years ago |
18:47:00 | * | boydgreenfield joined #nimrod |
18:53:51 | EXetoC | flaviu, I guess not. 20 seconds for parsing? |
18:55:55 | * | kunev quit (Quit: leaving) |
18:56:33 | flaviu | EXetoC: Well, for total compilation. I just compiled it without any changes, it took 20.28 seconds at 90% CPU. Most the time was spent in samacrossanity |
18:56:57 | * | superfunc joined #nimrod |
19:00:21 | Araq | flaviu: what? semmacrosanity is a bottleneck now? |
19:00:40 | flaviu | No, compiling semmacrosanity.nim takes a while |
19:00:56 | flaviu | ~3s/20s for me |
19:01:59 | Araq | unlikely |
19:02:04 | Araq | look at the module |
19:02:18 | Araq | it doesn't even do many template instantiations |
19:02:40 | Araq | it might trigger an expensive GC run though |
19:02:48 | flaviu | oh, its cgen |
19:02:59 | flaviu | it hints the module name after compiling it |
19:03:17 | Araq | hmm quite possible |
19:16:51 | EXetoC | fowl, or maybe not. getting some wrong values, and I don't know why |
19:17:51 | EXetoC | the size is the same as the C struct |
19:18:38 | fowl | EXetoC, you have to figure out the size of the event type |
19:19:24 | EXetoC | well, I'm working on the mongodb interface atm |
19:22:01 | EXetoC | just trying to figure out if it'll work if the kind field comes first |
19:29:45 | EXetoC | I'm just being stupid again. of course there already exists a kind field if you have a variant |
20:19:05 | * | io2 quit (Remote host closed the connection) |
20:19:29 | * | io2 joined #nimrod |
20:20:22 | * | Jesin quit (Quit: Leaving) |
20:39:02 | flaviu | Araq: Have you read my comments from last night after you went to bed? |
20:39:15 | Araq | sure |
20:39:40 | Araq | so you want 'semantics: lessEqual' instead of 'magic: LeInt' |
20:39:53 | Araq | so bignums work too with these rules |
20:40:33 | flaviu | Araq: Sort of, but even more powerful |
20:40:37 | flaviu | http://goto.ucsd.edu/~rjhala/liquid/haskell/blog/blog/2013/01/01/refinement-types-101.lhs/ |
20:41:28 | flaviu | Something like that, but with the syntax pragma based instead of whatever that library does |
20:44:34 | flaviu | But that's probably too complicated, so the `semantics: lessEqual` would also suffice |
21:04:03 | * | xenagi joined #nimrod |
21:06:34 | uggedal | can an inner proc close over arguments to its parent proc? |
21:07:52 | * | Jesin joined #nimrod |
21:08:33 | Araq | uggedal: yes but only 1 level deep for now |
21:10:43 | * | Skrylar quit (Ping timeout: 250 seconds) |
21:14:08 | uggedal | hmm, I must be doing something wrong: http://sprunge.us/jLfO |
21:14:18 | uggedal | source here: https://github.com/uggedal/depict |
21:14:46 | uggedal | more specifically, here: https://github.com/uggedal/depict/blob/master/mortar.nim#L34 |
21:14:54 | * | Johz joined #nimrod |
21:21:49 | dom96 | looks like a compiler bug |
21:22:29 | dom96 | unfortunately :( |
21:24:34 | uggedal | ok, I'm open to other ways of wrapping the async http handler with my own object that does not trigger the bug :) |
21:25:43 | dom96 | uggedal: Try: var mDummy = m |
21:25:57 | dom96 | and see if you can then use 'mDummy' in the body of 'wrapper' |
21:27:44 | uggedal | Error: internal error: expr: var not init dummy |
21:31:58 | dom96 | hrm, that's me out of ideas. Araq? |
21:32:36 | uggedal | or I could use a global... |
21:32:54 | Araq | well 'async' itself produces an inner iterator, so you're closing over 2 levels, like I said |
21:33:08 | uggedal | Araq: ah, I see |
21:33:15 | dom96 | That's true. |
21:33:38 | dom96 | That makes things problematic... |
21:35:18 | Araq | uggedal: I'm afraid for now you need to use a global |
21:35:30 | dom96 | Araq: Is getting support for more than 1 level very difficult? |
21:35:46 | Araq | the code for it exists but doesn't work |
21:36:00 | Araq | so I don't think so |
21:36:50 | dom96 | Is there any hope of me fixing it? |
21:39:43 | Araq | you can surely try |
21:40:02 | dom96 | hah, well you'll be away anyway right? |
21:40:10 | dom96 | when are you leaving exactly? |
21:40:48 | Araq | I already left |
21:40:56 | Araq | but it turns out ... I have internet here :P |
21:41:21 | dom96 | I see. |
21:41:32 | dom96 | So much for getting work done lol |
21:49:04 | * | io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist) |
21:51:13 | * | enurlyx quit (Quit: Nettalk6 - www.ntalk.de) |
21:58:53 | EXetoC | can %(x, y) be called such that the arguments aren't treated as a single tuple? |
22:01:57 | EXetoC | maybe it's only going to be possible with the upcoming parsing system |
22:03:19 | dom96 | proc `%`(x, y) ? |
22:03:29 | EXetoC | yes |
22:03:37 | dom96 | oh but then you need the ` when calling too |
22:05:34 | EXetoC | now anyway. I'll just make it a tuple |
22:08:45 | Araq | `%`(x, y) is x % y |
22:08:45 | Araq | with the backticks |
22:29:13 | flaviu | reactormonk: I'm user60561, but I don't have any ideas for a clever nick. |
22:37:28 | * | Skrylar joined #nimrod |
22:38:52 | EXetoC | Araq, yeah fair limitation |
22:43:55 | flaviu | Say I had a pointer to location `A`, would the garbage collector free `A` if I also had a pointer to `A+4`? I can't think of a way it'd know that, so I'm leaning towards thinking that it would. |
22:45:26 | flaviu | Also, what is the memory layout of a seq? len: int32, body: ref T? |
22:45:40 | Araq | flaviu: sure, it would. unless this pointer happens to be on the stack, but that's an implementation detail |
22:45:57 | EXetoC | see system.seqtopointer or something |
22:46:41 | Araq | flaviu: len, cap: int, data: ptr T |
22:46:44 | * | noam joined #nimrod |
23:08:07 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:08:15 | Varriount | Araq: I thought that you weren't going to be here. :3 |
23:08:51 | Araq | Varriount: well the connection is pretty bad :P |
23:10:18 | Varriount | Araq: I have a procedure that is like $ for widestring, but uses a given length instead of looking for a null terminator. It's copied from widestr.nim . Should I keep the procedure there, and what should I name it? |
23:10:42 | Araq | why didn't you export it instead? |
23:10:58 | Varriount | What do you mean? |
23:11:15 | Araq | give it a * in widestrs.nim |
23:11:33 | Varriount | That's what I'm currently doing. |
23:12:00 | Araq | well what's its name? $ ? |
23:12:17 | Araq | what's the name you like it to have? |
23:12:33 | Varriount | Yeah. Currently it's using a distinct WideStr type. |
23:12:46 | Varriount | as the 'string' argument. |
23:14:19 | Araq | so .. er ... what's your question again? |
23:14:46 | Varriount | Should I keep it in widestr.nim? |
23:15:01 | Araq | sure why not |
23:16:01 | flaviu | Varriount: I'd say to put it in strutils, and make the widestr equivalent delegate to the strutils version |
23:16:31 | Araq | flaviu: that totally ignores its dependencies |
23:19:36 | Varriount | flaviu: Ineffecient. The WideStr version uses the null terminator as a signal to stop looping. If I were to delegate that to this new procedure, WideStr would have to be looped through twice, once to find the null terminator, and a second time to do the translation from WideStr to Str |
23:21:32 | flaviu | Varriount: There isn't any difference between a widestr and a string except I assume that the widestr has a null terminator of 2 bytes |
23:22:03 | Araq | widestr = utf-16, string = utf-8 |
23:22:20 | Varriount | Yeah, I know that. |
23:22:53 | flaviu | `$`(str: widestr, len: int) = `$`(cstring(str), len*2) |
23:23:39 | Varriount | flaviu: You want me to put this new procedure, which converts a non-null-terminated WideStr to a str, and then you want me to make the procedure which converts a null-terminated WideStr to Str delegate processing to the new procedure? |
23:23:48 | * | superfunc quit (Ping timeout: 240 seconds) |
23:24:11 | flaviu | Varriount: Sorry, I thought that widestrs are null-terminated, the same way stings are |
23:24:28 | Varriount | flaviu: Sometimes they are, sometimes they aren't. |
23:25:01 | Araq | and they have 2 byte characters as opposed to 1 byte characters |
23:25:02 | Varriount | In this particular case, I'm given a length, and a pointer to a section of memory that contains the non-null-terminated string. |
23:25:29 | Varriount | flaviu: See http://msdn.microsoft.com/en-us/library/windows/desktop/aa364391(v=vs.85).aspx |
23:26:22 | flaviu | Araq: That part isn't really important, memory doesn't have a data type. all that has to be done is len*2 |
23:28:37 | Araq | there is a difference between \0 and \0\0 and len("ä") * 2 != len(wideStr("ä")) |
23:28:49 | * | brson joined #nimrod |
23:31:15 | * | darkf joined #nimrod |
23:32:32 | flaviu | Araq: In that case, technically there isn't since "ä" == 228. But I'm not thinking about unicode at all. len(wideStr("ā")) == len("\u01\u01") |
23:33:37 | Araq | flaviu: "ä" in utf-8 takes up 2 bytes, 2 * 2 == 4, "ä" in utf-16 takes up 2 bytes |
23:33:41 | Varriount | Hm. What should a non-null-terminated WideStr type be called? |
23:34:00 | Varriount | WideBuffer? WideCharBuffer? |
23:35:02 | Araq | "ä" == 228 is perhaps Windows Ansi characterset |
23:36:53 | Araq | Varriount: what's wrong with the current name? |
23:37:48 | Varriount | Araq: It implies that the string is null terminated. |
23:37:59 | flaviu | Araq: You're right about len("ä") == 2, but unicode is irrelevent here. All I care about right now are the raw bytes. wideStr("ä") == [0x00u8, 0xE4u8] == [0x00E4u16] |
23:38:01 | Varriount | Also, the new procedure would clash with an already existing procedure. |
23:38:49 | Varriount | Hm. "Cannot evaluate sizeof because type is not defined completely" |
23:41:02 | Araq | flaviu: not sure what you're really after but you simply can't use C's strlen for wide strings |
23:43:38 | Varriount | Oh goody. I can't just use a distinct WideStr type because it's a 'ref' type, and the memory I'm type-ifying is a raw section of wide characters |
23:43:56 | flaviu | Araq: I'm also confused, so I'll end my end of the conversation here in the interest of time since it isn't really that important |
23:44:52 | Araq | flaviu: very good, we all should do this more often. :-) |
23:45:59 | Varriount | Skrylar: I don't suppose you could integrate your unicode stuff into the stdlib? |
23:59:13 | Skrylar | Varriount: i could |