00:00:23 | reactormonk | PStringTable doesn't have a $? |
00:01:29 | Araq | I think it has, but you need to import stringtabs explicitly |
00:02:04 | reactormonk | how do I say I want to do a put request instead of a post request? |
00:02:33 | dom96 | use ``request`` with httpMethod = httpPUT |
00:04:04 | reactormonk | Error: unhandled exception: Connection reset by peer [EOS] |
00:04:06 | reactormonk | -.- |
00:04:08 | reactormonk | dom96, works. |
00:04:54 | dom96 | I never tested httpPUT :P |
00:05:13 | reactormonk | is it any different from post? |
00:05:56 | dom96 | Except for the name? I would assume so. |
00:09:02 | reactormonk | dom96, well, I still get a connection reset by peer :-/ |
00:09:29 | reactormonk | and it doesn't even show up in the server log |
00:10:09 | dom96 | Create an issue on github then please. |
00:12:38 | * | io2 quit () |
00:13:38 | reactormonk | dom96, yup, post works. request doesn't. |
00:15:13 | * | dmac quit (Quit: Leaving.) |
00:15:28 | reactormonk | ooooh, forgot a \c\L after the content length header |
00:19:14 | reactormonk | somehow my decompress doesn't work reliably :-/ |
00:20:10 | reactormonk | didn't we have something to use zlib? |
00:21:15 | reactormonk | grabbed it. |
00:21:25 | Araq | good night guys |
00:22:15 | NimBot | Araq/Nimrod devel e1accd9 Araq [+1 ±9 -0]: better html generator for the tester; fixes some VM bugs |
00:22:15 | NimBot | Araq/Nimrod devel 1aa0b8c Araq [+2 ±11 -0]: Merge branch 'devel' of https://github.com/Araq/Nimrod into devel |
00:47:47 | fowl | merge devel into master plz |
00:50:25 | * | Demos joined #nimrod |
00:50:39 | Demos | can I forward declare a proc and then define it in a different file |
00:51:26 | reactormonk | how do I clear a seq from all elements? setLen to 0? |
00:56:38 | reactormonk | btw, what's the join called again? |
00:56:59 | reactormonk | ohhh, strutils. |
01:03:11 | reactormonk | dom96, can I make post async? |
01:07:56 | * | dymk joined #nimrod |
01:12:21 | dom96 | reactormonk: no |
01:12:32 | dom96 | reactormonk: To clear just set to @[] |
01:17:43 | dom96 | Demos: I don't think so |
01:17:49 | dom96 | Demos: What did you want to ask about babel btw? |
01:23:42 | reactormonk | Building babel/babel using c backend... |
01:23:44 | reactormonk | command line(1, 1) Error: invalid command line option: '--noBabelPath' |
01:23:50 | * | Demos quit (Ping timeout: 272 seconds) |
01:24:10 | reactormonk | sounds like a chicken-egg problem to me |
01:25:28 | dom96 | you need master not devel |
01:27:37 | reactormonk | duh |
01:28:33 | dom96 | 'night |
01:33:38 | reactormonk | wasn't there a switch to create a package? |
01:33:47 | * | brson quit (Quit: Lost terminal) |
01:34:11 | * | brson joined #nimrod |
01:35:51 | * | DAddYE quit (Remote host closed the connection) |
01:36:24 | * | DAddYE joined #nimrod |
01:40:50 | * | DAddYE quit (Ping timeout: 245 seconds) |
01:58:36 | * | vbtt quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
02:17:26 | * | dymk quit (Quit: This computer has gone to sleep) |
02:46:58 | * | DAddYE joined #nimrod |
02:48:02 | * | Xuehas joined #nimrod |
02:48:30 | * | Xuehas quit (Quit: Xuehas) |
02:49:17 | * | Xuehas joined #nimrod |
02:50:55 | * | Xuehas left #nimrod (#nimrod) |
02:52:06 | * | DAddYE quit (Ping timeout: 276 seconds) |
03:05:58 | * | DAddYE joined #nimrod |
03:08:08 | * | Demos joined #nimrod |
03:17:53 | * | Demos quit (Ping timeout: 252 seconds) |
03:22:45 | * | BitPuffin quit (Quit: WeeChat 0.4.2) |
03:30:24 | * | ehaliewicz quit (Remote host closed the connection) |
03:33:18 | * | dymk joined #nimrod |
03:53:38 | * | dymk quit (Quit: This computer has gone to sleep) |
04:05:49 | * | Demos joined #nimrod |
04:12:21 | * | dymk joined #nimrod |
04:29:08 | * | dymk quit (Quit: This computer has gone to sleep) |
04:42:18 | * | dymk joined #nimrod |
04:43:27 | * | dymk quit (Client Quit) |
04:46:22 | * | dymk joined #nimrod |
04:55:25 | * | dymk quit (Quit: This computer has gone to sleep) |
04:56:21 | * | dymk joined #nimrod |
04:58:16 | * | foxcub joined #nimrod |
04:59:37 | * | Demos quit (Read error: Operation timed out) |
05:01:02 | * | brson quit (Read error: Operation timed out) |
05:01:22 | * | DAddYE quit (Remote host closed the connection) |
05:01:26 | * | dymk quit (Quit: This computer has gone to sleep) |
05:03:48 | * | brson joined #nimrod |
05:11:54 | * | DAddYE joined #nimrod |
05:12:05 | * | DAddYE quit (Remote host closed the connection) |
05:12:11 | * | DAddYE joined #nimrod |
05:13:51 | foxcub | Is it possible to create a generic type with not only a type, but also, say, an integer parameter? |
05:14:03 | foxcub | So something like Vector[T,D], where D is an integer dimension? |
05:15:36 | * | DAddYE quit (Remote host closed the connection) |
05:16:03 | * | DAddYE joined #nimrod |
05:16:33 | * | dymk joined #nimrod |
05:18:12 | * | dymk quit (Client Quit) |
05:18:21 | * | dymk joined #nimrod |
05:19:59 | * | LordAndrew joined #nimrod |
05:20:08 | fowl | foxcub, you can use a range |
05:20:18 | fowl | foxcub, https://github.com/BitPuffin/linagl/blob/master/src/linagl/vector.nim |
05:20:35 | LordAndrew | Howdy there. |
05:20:37 | * | DAddYE quit (Ping timeout: 248 seconds) |
05:20:42 | fowl | hey |
05:20:51 | foxcub | Ah, I see |
05:21:16 | foxcub | So it's a workaround, but there is hope (according to the comment) that it can be done directly with an integer in the future? |
05:22:03 | fowl | that is planned |
05:22:25 | foxcub | Great. Thanks. |
05:22:55 | * | brson quit (Ping timeout: 245 seconds) |
05:24:49 | * | brson joined #nimrod |
05:41:19 | * | vbtt joined #nimrod |
05:44:55 | * | vbtt quit (Client Quit) |
05:57:45 | * | XAMPP joined #nimrod |
05:57:56 | * | XAMPP quit (Changing host) |
05:57:56 | * | XAMPP joined #nimrod |
06:08:08 | * | LordAndrew quit (Quit: Page closed) |
06:09:12 | * | dymk quit (Quit: This computer has gone to sleep) |
06:21:31 | * | foxcub quit (Quit: foxcub) |
06:25:24 | * | Demos joined #nimrod |
06:27:49 | * | dymk joined #nimrod |
06:50:03 | * | brson quit (Quit: leaving) |
06:57:09 | * | Demos quit (Ping timeout: 248 seconds) |
07:01:49 | * | DAddYE joined #nimrod |
07:02:17 | * | DAddYE quit (Remote host closed the connection) |
07:02:23 | * | DAddYE_ joined #nimrod |
07:05:22 | * | DAddYE_ quit (Client Quit) |
07:14:16 | * | dymk quit (Quit: This computer has gone to sleep) |
07:14:32 | * | dymk joined #nimrod |
07:15:09 | * | dymk quit (Client Quit) |
07:24:09 | * | dymk joined #nimrod |
08:27:49 | * | Araq_ joined #nimrod |
08:28:42 | * | odc joined #nimrod |
09:38:53 | * | CarpNet joined #nimrod |
09:39:35 | * | joebobjoe joined #nimrod |
09:39:42 | joebobjoe | Hey guys |
09:39:50 | joebobjoe | How does Nimrod compare in safety to Rust? |
09:40:00 | joebobjoe | I see you guys are adding dependent types? |
09:43:04 | fowl | what do you mean by safety? |
09:44:25 | * | Mordecai joined #nimrod |
09:44:48 | * | psquid quit (Ping timeout: 252 seconds) |
09:44:57 | joebobjoe | fowl: Data races, deadlocks, region analysis, buffer overflows, null pointers... |
10:08:21 | fowl | null pointers are possible, race conditions, deadlocks are always possible as a result of bad programming |
10:09:09 | fowl | nimrod has compile-time and runtime bounds checking to prevent buffer overflow, but you cant really stop someone whos determined to do this |
10:11:17 | joebobjoe | fowl: Hm. Does library code use something like Option? |
10:11:31 | joebobjoe | Or are there no forced null checks of any kind |
10:12:53 | * | Ycros joined #nimrod |
10:26:44 | fowl | joebobjoe, theres no option[t] in the std lib |
10:47:10 | * | joebobjoe quit (Read error: Connection reset by peer) |
10:50:06 | * | XAMPP quit (Ping timeout: 265 seconds) |
10:50:46 | * | noam quit (Read error: Connection reset by peer) |
10:53:30 | * | noam joined #nimrod |
11:03:03 | Araq_ | fowl: no, the new concurrency model I'm working on prevents deadlocks and data races ... |
11:03:31 | Araq_ | also you can annotate a pointer as "not nil" and then the compiler checks at compile time it can't be nil |
11:08:12 | Araq_ | but in general Nimrod focusses on expressivity, Rust on safety |
12:39:02 | * | isenmann quit (Quit: Leaving.) |
12:40:49 | * | XAMPP joined #nimrod |
13:40:20 | * | [1]Endy joined #nimrod |
14:11:30 | * | darkf quit (Quit: Leaving) |
14:15:52 | * | Mordecai quit (Quit: work) |
14:20:19 | * | Araq_ quit (Quit: ChatZilla 0.9.90.1 [Firefox 26.0/20131205075310]) |
14:50:36 | * | aftersha_ joined #nimrod |
14:53:21 | * | [2]Endy joined #nimrod |
14:57:23 | * | [1]Endy quit (Ping timeout: 272 seconds) |
14:57:39 | * | wan quit (Quit: leaving) |
15:01:27 | * | Fernandos joined #nimrod |
15:01:32 | Fernandos | hii |
15:02:47 | Fernandos | Just curious, I never understood why you need to cast in the first place. I'm not talking about php-like hidden-casts, but about an API for safe value extraction, conversion etc. |
15:03:23 | Fernandos | So, why do does Nimrod still rely on casts? |
15:07:57 | dom96 | My guess would be because inheritance kinda requires it. |
15:08:36 | dom96 | The unsafe cast on the other hand is required because of C's void pointer type. |
15:11:50 | Fernandos | Understandable, but a jquery like chained (a union struct in C) procedure (or is it called function in nimrod?) that allows gch.stackBottom.int.safe would be more useufl |
15:12:05 | Fernandos | Do you understand what I mean? |
15:12:40 | dom96 | Nimrod allows you to type cast like that. |
15:12:54 | Fernandos | huh?? really? |
15:13:10 | dom96 | var x = 5; x.float # for example |
15:13:22 | Fernandos | oh, that's cool! |
15:13:24 | dom96 | if that's what you mean |
15:14:30 | OrionPK | x.float == float(x) |
15:14:31 | Fernandos | indeed, but why is var a = cast [int](gch.stackBottom) even required then? |
15:15:44 | dom96 | That's the unsafe cast. With a safe cast the compiler ensures that you can cast that way, but with an unsafe one you are basically just forcing it to cast to whatever you tell it which could lead to problems. |
15:16:13 | dom96 | From the manual: "Type casts are a crude mechanism to interpret the bit pattern of an expression as if it would be of another type. Type casts are only needed for low-level programming and are inherently unsafe." |
15:16:13 | * | foxcub joined #nimrod |
15:16:32 | * | Fernandos quit (Disconnected by services) |
15:16:32 | * | Fernandos1 joined #nimrod |
15:16:44 | dom96 | hello foxcub |
15:16:57 | foxcub | hello dom96 |
15:17:03 | * | Fernandos1 is now known as Fernandos |
15:17:05 | * | Fernandos quit (Changing host) |
15:17:05 | * | Fernandos joined #nimrod |
15:17:12 | dom96 | In fact, i'm using an incorrect term for "safe cast". The manual calls them "type conversions". |
15:17:32 | Fernandos | So, why not a.int.unsafe instead of cast [int]? |
15:18:01 | dom96 | Because unsafe operations should be difficult to perform to discourage their use. |
15:18:20 | dom96 | So it's better to make them verbose as a deterrent against their usage |
15:18:32 | Fernandos | Why not just remove it then? I mean it's not called unsafe without a reason |
15:18:56 | Fernandos | .unsafe is more verbose, but shorter than cast [int] |
15:19:18 | Fernandos | I mean .int.unsafe |
15:19:38 | dom96 | Because sometimes you have to type cast, there is no way around it. |
15:19:40 | EXetoC | how can it be made safe if all you have is an untyped buffer? Nimrod is both a high and a low level wrapper |
15:19:57 | EXetoC | and casts are commonly performed in code that wraps C libs |
15:19:59 | Fernandos | you could remove the complicated cast [int] synthax and add a "use strict" attribute that talks to the compiler |
15:20:35 | EXetoC | s/wrapper/language |
15:20:40 | foxcub | Is there any kind of graph library for nimrod? |
15:20:41 | EXetoC | :E |
15:20:49 | Fernandos | foxcub: what do you mean? |
15:20:49 | * | aftersha_ quit (Quit: Computer has gone to sleep.) |
15:20:59 | foxcub | Graph processing. |
15:21:01 | Fernandos | graphdb or graph viewer? |
15:21:01 | dom96 | foxcub: Don't think so. I'm sure you could wrap some C lib though |
15:21:20 | dom96 | Fernandos: What's the point? |
15:21:38 | foxcub | dom96: are there good docs somewhere on writing wrappers? |
15:21:44 | Fernandos | dom96: curiosity and simpler logic |
15:22:20 | Fernandos | dom96: I have been eyeing nimrod for a while and didn't write in it yet, but am just watching this talk http://www.infoq.com/presentations/nimrod |
15:22:36 | Fernandos | and the cast was always something that annoyed me, because it's an ugly quirk |
15:23:09 | * | aftersha_ joined #nimrod |
15:23:25 | Fernandos | usually it's a sign of using the wrong datastructure |
15:23:44 | dom96 | foxcub: Not yet I don't think. Somebody should write some heh. But writing wrappers is easy, and you can use c2nim to help you. |
15:23:59 | Fernandos | and I like the recursive .function.function synthax |
15:24:13 | dom96 | foxcub: Take a look at some already made wrappers, best way to learn is from examples. |
15:24:17 | foxcub | dom96: what's the simplest example I could read to get started? |
15:24:44 | Fernandos | foxcub: I'm just watching this http://www.infoq.com/presentations/nimrod maybe could help you too |
15:24:56 | foxcub | Fernandos: thanks |
15:26:08 | dom96 | foxcub: Most wrappers are unfortunately quite big. |
15:26:29 | Fernandos | Is nimrod runtimeless?? |
15:27:15 | dom96 | foxcub: First thing that comes to mind is my opencv wrapper: https://github.com/dom96/nim-opencv |
15:27:31 | foxcub | dom96: thanks, although OpenCV is a monster. |
15:27:46 | Fernandos | ccv is smaller |
15:28:07 | dom96 | The basic idea is you use the dynlib, importc and cdecl pragmas |
15:28:30 | dom96 | But try running the .h files through c2nim: http://build.nimrod-lang.org/docs/c2nim.html |
15:28:49 | dom96 | May need to edit them a bit to get c2nim to understand them but it should make the process much easier. |
15:29:15 | foxcub | I guess the types are matched up in the obvious way? |
15:29:18 | foxcub | string to char*? |
15:29:26 | dom96 | char* is cstring |
15:29:33 | EXetoC | Fernandos: where does that cast appear? |
15:29:53 | foxcub | Ah, Ok, I need to do some reading. |
15:29:55 | foxcub | Thanks for the pointers. |
15:30:09 | Fernandos | EXetoC: in minute 1.0 on http://www.infoq.com/presentations/nimrod |
15:30:36 | foxcub | One more question. What about C++? Especially, if I have something header-only, using templates. Is there a good way to make it play nice with nimrod? |
15:31:03 | dom96 | Fernandos: Minute 1.0? |
15:31:10 | Fernandos | yes, of the video |
15:31:27 | Fernandos | the video and slides are synced |
15:31:45 | dom96 | You mean 1:00? |
15:31:53 | Fernandos | lol yeah |
15:31:59 | dom96 | There is no code at that time. |
15:32:09 | fowl | Fernandos, the nimrod runtime is just the GC |
15:32:12 | Fernandos | did 1.0 cause a floating pointer exception? :D |
15:32:53 | Fernandos | dom96: 1:10 then |
15:32:54 | EXetoC | "stackBottom: pointer". GC stuff is naturally very low level |
15:32:54 | dom96 | foxcub: c2nim supports C++ too, it's a bit harder to wrap C++ code though. Araq wants someone to try wrapping Qt though as he recently added C++ support to c2nim. |
15:33:10 | EXetoC | cast to int and you get the numerical value of the pointer |
15:33:26 | foxcub | dom96: got you, thanks. I'll take a look at c2nim |
15:34:12 | dom96 | Fernandos: It's a very low-level features which is why it's under the "systems programming language" bullet point in the slide. |
15:34:17 | dom96 | *feature |
15:35:55 | Fernandos | dom96: yup, I got that.. Just thought, hey why use cast [int] in the first place, when .int.unsafe could do the same and would me more expressive. |
15:36:21 | dom96 | Because making it expressive encourages it's use. |
15:36:29 | dom96 | Which is something we don't want to do. |
15:36:31 | EXetoC | aren't you special-casing the syntax then? |
15:36:43 | Fernandos | I can't judge that without stats. |
15:36:54 | dom96 | And that syntax would require making 'unsafe' a keyword |
15:37:11 | Fernandos | dom96: however I don't ask you to change the language, just question the use of casts like that in general. |
15:39:13 | EXetoC | dom96: I don't know if that's the reason, but I'm not sure if x.int.unsafe follows a logical structure |
15:39:40 | Fernandos | me neither, was just a pulled out of void :) |
15:39:54 | Fernandos | x.unsafe.int could also work |
15:40:36 | dom96 | Yeah, I agree with EXetoC |
15:40:58 | Fernandos | I don't know enough details about the implementation, but theoretically you coud also say. "use strict" which would enforse safe everywhere removing the need for unsafe |
15:41:38 | Fernandos | dom96: yeah you can name to something more logical, I am sure you know nimrod 100x better than me =) |
15:41:58 | Fernandos | do you know what I mean by use strict? |
15:42:24 | Fernandos | similar to javascript and html, where they use transitional ans strict to switch between standards and quirks mode. |
15:42:52 | * | aftersha_ quit (Quit: Computer has gone to sleep.) |
15:44:31 | dom96 | Yeah, isn't that a VB.NET thing? |
15:47:47 | * | TylerE quit (Ping timeout: 272 seconds) |
15:48:18 | foxcub | Is there a way to issue a compile-time error if a certain (generic) version of a procedure were to get called? |
15:48:41 | foxcub | So something like 'quit "override"' in the tutorial, but at compile time? |
15:49:55 | fowl | Fernandos, x.castTo(int) (implementation follows) |
15:50:13 | fowl | proc castTo* [B] (obj: B; A: typedesc): A = cast[A](obj) |
15:51:06 | Varriount | foxcub: by generic, you mean an actual generic, right? with the [] ? |
15:51:17 | foxcub | Varriount: yes |
15:51:34 | foxcub | Roughly, I want to have a generic procedure, but allow only its specializations to get called. |
15:51:51 | Varriount | foxcub: I think you might be able to try to compare the generic type with something in a static block. One moment |
15:52:12 | dom96 | I think there is an {.error: "msg here".} pragma |
15:52:16 | Varriount | foxcub: By the way, what version of nimrod are you using? 9.2, master, or devel? |
15:52:22 | foxcub | 0.9.2 |
15:52:36 | Varriount | foxcub: You should probably grab either master or devel. |
15:53:30 | Varriount | foxcub: The nimrod compile is pretty easily compiled, and even if you don't have the time, someone in here probably has a binary on-hand |
15:53:36 | foxcub | dom96: 0.9.2 tells me Error: invalid pragma: error: "override" |
15:53:46 | foxcub | Varriount: Ok |
15:53:49 | Varriount | (FYI, I host the Win32 and Win64 build bots) |
15:53:55 | fowl | foxcub, you could `when T is string: {.error: ..}` |
15:54:12 | Varriount | fowl: He would have to put it in a static block, right? |
15:54:18 | dom96 | no |
15:54:23 | foxcub | Varriount: actually, I have master handy |
15:54:28 | Varriount | Oh right, 'when' |
15:54:49 | foxcub | I don't want to be checking T at all |
15:55:03 | foxcub | I want it to fail for all T, except for the one where the procedure is already specialized |
15:55:12 | foxcub | So |
15:55:27 | foxcub | proc f[T](x: T): void = always fail at compile time |
15:55:34 | Varriount | foxcub: Maybe you want a typeclass? It also might help if we could see you code. |
15:55:34 | foxcub | proc f(x: string): void = do something |
15:55:41 | foxcub | proc f(x: int): void = do something else |
15:55:54 | fowl | foxcub, the simple answer is dont use a generic there.. |
15:56:12 | dom96 | foxcub: Why not just rely on the compile-time error the compiler will give you anyway? |
15:56:19 | dom96 | foxcub: Also, you don't need the ': void' |
15:56:54 | Varriount | foxcub: Again, it might help if we saw your code, or even psuedo-code of what you are trying to achieve. |
15:56:54 | foxcub | dom96: I wanted to provide a more elaborate error message, I guess. |
15:58:01 | foxcub | How would I provide a chunk of code here? |
15:58:35 | dom96 | https://gist.github.com/dom96/75825cdca7256291f5ed |
15:59:03 | dom96 | Something like that? |
15:59:25 | Varriount | foxcub: gist is your friend. :) |
15:59:59 | foxcub | dom96: that gives me: Error: invalid pragma: error: "My error" |
16:00:22 | foxcub | I've switched to master, I think. |
16:00:32 | foxcub | nimrod -v |
16:00:33 | foxcub | Nimrod Compiler Version 0.9.3 (2014-01-16) [MacOSX: amd64] |
16:00:34 | foxcub | Copyright (c) 2004-2013 by Andreas Rumpf |
16:01:40 | dom96 | hrm, guess I should've tested it heh |
16:01:52 | Varriount | foxcub: http://nimrod-lang.org/manual.html#error-pragma |
16:02:55 | dom96 | Odd that it doesn't work. |
16:03:22 | foxcub | Ok, putting just {.error.} as an annotation works. |
16:03:23 | dom96 | Although your error does get printed at runtime ;) |
16:03:44 | foxcub | But that doesn't give me a way to give an error message |
16:04:17 | foxcub | Perhaps, I shouldn't push it, and just stick to the compiler errors. |
16:04:24 | foxcub | Thanks for your help, everybody. |
16:04:45 | dom96 | {.error: "msg".} only seems to work at the top-level. |
16:05:51 | * | TylerE joined #nimrod |
16:06:29 | dom96 | Definitely something to ask Araq about. |
16:08:09 | Fernandos | fowl: is that already possible? |
16:08:48 | fowl | Fernandos, what? |
16:09:15 | fowl | foxcub, you can use static: quit "my error" in the meantime |
16:09:18 | Fernandos | the code you wrote to me |
16:09:27 | Fernandos | for casting |
16:09:27 | fowl | Fernandos, yes |
16:09:32 | Fernandos | cool |
16:10:23 | foxcub | fowl: is quit "my error" static? |
16:10:31 | foxcub | I thought it would only be triggered at run-time. |
16:10:45 | fowl | foxcub, it is inside a static: block |
16:12:30 | * | TylerE quit (Ping timeout: 245 seconds) |
16:13:22 | Varriount | Hrm. Anyone know if the vm supports importing already-compiled dynamic libraries? |
16:13:43 | foxcub | fowl: this is most strange to me, but I'll try it |
16:13:54 | Varriount | foxcub: btw, what editor are you using? |
16:14:10 | foxcub | Varriount: vim |
16:14:35 | Varriount | Mkay. I assume you have to vim plugin for nimrod? |
16:15:03 | foxcub | Varriount: I do |
16:16:04 | dom96 | Varriount: I think so. But you have to compile with -d:useFFI |
16:18:28 | dom96 | bbl |
16:20:28 | foxcub | Here's another question |
16:20:32 | foxcub | Now about importing from modules. |
16:20:56 | foxcub | Here's some simple code: https://gist.github.com/mrzv/8476229 |
16:21:15 | foxcub | In order for it to run I have to uncomment import archive in serialize.nim |
16:21:32 | foxcub | But I'd like it to work with any user-defined save(), load() operations anywhere down the line. |
16:21:52 | foxcub | Why do specific save() and load() have to imported into serialize.nim for them to work, and is there a way to avoid that? |
16:22:14 | Varriount | foxcub: What is 'archive'? Where is it located? |
16:22:26 | foxcub | There are three files in that gist. |
16:22:40 | foxcub | archive.nim starts at line 32. |
16:23:26 | Varriount | Ah. I see. Just so you know, gist allows you to paste multiple 'files' into separate boxes. |
16:24:08 | foxcub | Thanks, it's the first time I use gist. |
16:24:54 | discoloda | hmm, c2nim needs to be able to take stdin and emit to stdout so i can use it within vim |
16:25:52 | Varriount | foxcub: One moment, let me download and run this |
16:26:12 | foxcub | There was a mistake in the comment. |
16:26:19 | foxcub | import archive needs to be present for the code to run. |
16:26:21 | foxcub | It's fixed now. |
16:27:06 | fowl | foxcub, http://build.nimrod-lang.org/docs/manual.html#symbol-lookup-in-generics |
16:27:08 | Varriount | foxcub: So you want user pluggable functions? |
16:27:15 | foxcub | yeah |
16:28:01 | foxcub | I want the user to be able to provide save[TA,TMyType](a: TA, x: TMyType), and I want it to just work. |
16:28:32 | foxcub | I also want the user to be able to provide her own Archive implementations, by defining save/load for simple types, and I want the rest to just work. |
16:28:51 | Varriount | foxcub: All they should have to do then is to define the save/load proc for their type. |
16:29:03 | Varriount | And import your module. |
16:29:25 | Varriount | The only reason that wouldn't work is because of the generics. |
16:29:36 | Varriount | You want a fallback implementation, I assume? |
16:29:53 | fowl | or just read the section i linked to |
16:30:05 | fowl | if you want something to skim for: "mixin" |
16:30:30 | foxcub | I don't want a fallback implementation. |
16:30:42 | foxcub | I want errors when things aren't implemented. |
16:30:59 | foxcub | But there seems to be a limitation with modules. |
16:31:07 | fowl | no there doesnt |
16:31:17 | foxcub | Oh, sorry |
16:31:18 | fowl | or if there is, it isnt what youre describing |
16:31:20 | foxcub | I missed your comment. |
16:32:36 | foxcub | fowl: brilliant, I see what you mean. Thanks. |
16:32:40 | foxcub | Let me try it. |
16:33:10 | foxcub | And it works! Thanks, fowl |
16:33:46 | foxcub | Sooner or later I'll wrap my head around the subtleties of this language. |
16:34:18 | fowl | or just read through the manual |
16:34:21 | fowl | wink |
16:34:52 | foxcub | Yeah, that's the plan. I only stumbled on nimrod yesterday, so for now just wanted to play with it a little to get a feel for things. Manual is the next on the list. |
16:35:00 | fowl | there's cool stuff in it, like user-defined type classes http://build.nimrod-lang.org/docs/manual.html#user-defined-type-classes |
16:35:08 | * | Fernandos left #nimrod ("PRIVMSG #concrete5 :Not found a c5 dev yet?") |
16:35:48 | foxcub | Well, I'm in general finding the blend of C++ and Python irresistible. |
16:36:20 | foxcub | But yeah it seems there is a treasure trove of stuff there. I still need to figure out what it has for concurrency, but so far it's looking great. |
16:39:08 | Varriount | foxcub: I'm glad you like nimrod. Personally, I find it worthwhile, helping to promote a language that many would say is an underdog. |
16:40:06 | foxcub | Varriount: I'm sure it's just a matter of time. I suspect publicity is the issue. I'd never heard of it until yesterday. |
16:54:42 | dom96 | I think we reached a saturation point with people who frequent HN/Reddit. |
16:55:15 | dom96 | I was hoping for more people to arrive here while that talk was on the front page. |
17:02:57 | Varriount | dom96: I don't suppose you would happen to know if the new FFI interface somehow generates files? I'm getting a compiler error about an undefined symbol "STDCALL" in evalffi.nim |
17:03:15 | Varriount | When I try to bootstrap nimrod (devel branch_ |
17:03:17 | Varriount | *) |
17:03:30 | * | zahary_ quit (Read error: Connection reset by peer) |
17:03:48 | discoloda | Nimrod is interesting, where its basicly the language i wanted to make, with two exceptions: loose identifiers and uses '.' for the alternate function call syntax (mine used space) |
17:09:43 | * | wan joined #nimrod |
17:10:27 | dom96 | Varriount: I don't think so. |
17:20:32 | * | aftershave quit (Quit: Textual IRC Client: www.textualapp.com) |
17:21:40 | * | aftershave joined #nimrod |
17:21:51 | * | [2]Endy quit (Ping timeout: 252 seconds) |
17:29:34 | Araq | discoloda: what are "loose identifiers"? |
17:30:22 | Araq | hi foxcub welcome |
17:30:40 | foxcub | hi Araq thanks |
17:31:07 | * | vvbitt joined #nimrod |
17:31:35 | Araq | dom96: there is 'error' as a proc annotation which currently can't take a message, and then there is the error statement pragma |
17:31:56 | Araq | I'm sure it's documented and that you asked 10 times about it |
17:32:03 | Araq | :P |
17:32:44 | OrionPK | im guessing he means LoOosE vs loose vs loo_se |
17:33:26 | Araq | oh I see |
17:34:08 | vvbitt | Hello. There are a couple of unanswered questions on reddit. |
17:34:25 | Araq | hi vvbitt |
17:34:26 | dom96 | Araq: Is the error statement pragma documented separately from the 'error' as a proc annotation pragma? |
17:34:33 | * | vvbitt is now known as vbtt |
17:34:44 | foxcub | vbtt: where is the reddit discussion? |
17:35:01 | Araq | dom96: dunno, I think so |
17:35:31 | vbtt | http://www.reddit.com/r/programming/comments/1vdo3l/nimrod_a_new_approach_to_metaprogramming/ |
17:35:35 | discoloda | ThIs == t_h_i_s |
17:35:54 | dom96 | Araq: Next time i'll be sure to tell new users that you should not be disturbed with questions, would that be better? |
17:36:02 | foxcub | vbtt: thanks |
17:36:13 | Araq | dom96: what? |
17:36:58 | dom96 | Araq: Never mind :P |
17:38:12 | dom96 | There is nothing in the docs which says "The error statement pragma can only be used at the top-level" |
17:39:04 | dom96 | But I just found macros.error which should work. |
17:40:07 | Araq | no idea |
17:42:26 | * | DAddYE joined #nimrod |
17:44:27 | OrionPK | discoloda one of the nice things about allowing that is interop w/ C libraries |
17:45:10 | OrionPK | i.e. my_function_name == myFunctionName |
17:46:43 | * | DAddYE quit (Client Quit) |
17:51:16 | discoloda | OrionPK: i understand how it is convenient, it just feels a little wrong. you can 'rename' symbols of imported/exported functions with importc and exportc pragmas. |
18:05:08 | * | brson joined #nimrod |
18:05:20 | * | DAddYE joined #nimrod |
18:07:41 | Araq | vbtt: I replied |
18:08:25 | * | Demos joined #nimrod |
18:08:25 | * | brson quit (Client Quit) |
18:08:39 | * | brson joined #nimrod |
18:08:42 | Demos | oh dear macros are hard... |
18:08:53 | * | CarpNet quit (Quit: Leaving) |
18:09:07 | * | vbtt quit (Ping timeout: 246 seconds) |
18:09:29 | Demos | also I was reading the logs and aperently c2nim supports C++... how good is that support, I find that with plain C most headers do not translate |
18:10:11 | Araq | oh really? that's news to me |
18:10:11 | dom96 | Demos: What did you want to ask me about babel? |
18:10:37 | Araq | I thought c2nim can read the programmer's mind ... |
18:10:52 | Araq | seriously what's so hard to understand that yes, you need to touch the header |
18:11:06 | Araq | but no, that's not big deal and saves TONS of work |
18:11:20 | Demos | Araq: I understand that, but I mean I get no nimrod output at all. And sometimes the errors are cryptic at best |
18:11:53 | Demos | and dom96 I was going to ask how bable communicates its paths to the compiler |
18:12:07 | dom96 | Demos: --path |
18:12:10 | Araq | Demos: discoloda is using c2nim to translate quake 2 ... |
18:12:26 | Araq | and not its header files, but all of it |
18:12:44 | Demos | I used c2nim to translate libalpm, but I am pretty sure it would die in a fire if directed at d3d11.h |
18:13:18 | discoloda | well, all but a few things. like CPP funkyness. and it needs a lot of work on the Nimrod it emits |
18:13:21 | Demos | speaking of which, how does c2nim translate C++ virtual functions and such |
18:13:51 | Demos | dom96: so the compiler does not really "know" about babel |
18:14:18 | Araq | Demos: it translates C++ into nimrod code that uses "importcpp" |
18:14:26 | Demos | eeeeeewwwww |
18:14:55 | * | dymk quit (Quit: This computer has gone to sleep) |
18:14:59 | Araq | so "virtual" is not relevant |
18:15:33 | Araq | discoloda: please don't ruin my argument. c2nim kicks ass |
18:15:56 | Demos | right, I prefer to have nimrod headers that do not depend on having a cpp compiler handy on the path. But ofc you need a stable ABI, so real translation would only work with stuff like COM |
18:16:22 | discoloda | oh, yes. it does |
18:16:36 | Araq | the idea is to generate a dirty nimrod->c++ brigde which you can then build as a DLL |
18:16:50 | Araq | and then you can use a proper wrapper module in nimrod using dynlib |
18:17:26 | Araq | but that has not been tried for now since I lack the time |
18:18:11 | Demos | right, I guess that works, and it is probably best for stuff like Qt but COM has a defined binary interface |
18:18:25 | dom96 | Demos: Indeed. There is a thing called --babelPaths though. So it puts the latest version of any packages installed in ~/.babel/pkgs into your PATH. |
18:18:29 | * | dymk joined #nimrod |
18:18:30 | Araq | COM is windows only though |
18:19:04 | Araq | I wanted to support COM via disphelper but according to Varriount that's tough |
18:19:38 | Demos | I think the "proper" way would perhaps be to have a tool like c2nim that read idl files and generated nimrod |
18:20:04 | Araq | bbl |
18:20:27 | Demos | but for indivudial libraries (in particular stuff like D3D) that use COM "lite" just knowing the layout of the interfaces and vtables is probably fine |
18:21:38 | Demos | dom96: anyway I wrapped libalpm (the pacman library) and I will submit a pr "soon(tm)" |
18:22:30 | dom96 | cool |
18:23:08 | Demos | it would be super cool for bable to use it, but that is a lot of work |
18:31:52 | * | brson quit (Quit: leaving) |
18:32:09 | * | brson joined #nimrod |
18:32:21 | * | brson quit (Changing host) |
18:32:21 | * | brson joined #nimrod |
18:33:53 | dom96 | Demos: Yes, what advantages would that bring though? |
18:34:47 | Demos | well uninstallation for a start, rock solid dependencies, people using arch or possibly msys2 could just add the repo and get communication between their system package database and babel |
18:36:17 | dom96 | The only reason babel doesn't support uninstallation currently is because I haven't implemented it yet |
18:36:57 | Demos | fair. using libalpm would slightly complicate builds on OSX and windows |
18:37:11 | dom96 | yes |
18:38:19 | Demos | although not too much. the only stated dependency is libarchive and you may be able to avoid that if you just don't use the archive manipulation functions |
18:40:55 | Demos | also, for com I don't think disphelper is the way to go. Seems to me that for something like nimrod you really want to use the direct "call through function pointer" style for COM |
18:41:22 | dom96 | A dependency on libalpm is too a dependency. |
18:41:51 | Demos | true, could be static though, or something |
18:42:31 | Demos | I don't really think it is a good idea for babel, I just think it would be neat. I kinda wrote the binding at 2AM for no good reason.... |
18:42:59 | * | Eruquen joined #nimrod |
18:46:31 | OrionPK | demos, go back to visual studio :P |
18:46:41 | Demos | hehe |
18:47:11 | Demos | there are a few issues I am working on there, I want to get nimrod to generate the project file, like cmake does |
18:48:27 | * | DAddYE_ joined #nimrod |
18:48:46 | discoloda | hmm, can you add languages to cmake? like adding nimrod to it |
18:49:15 | Demos | I mean I could, but I dont really want to. Better to write some nimrod that generates the project and then just use nake or whatever to call it |
18:49:52 | Demos | nimrod does not really need a full on build system, we have the compiler |
18:50:41 | * | DAddYE_ quit (Remote host closed the connection) |
18:51:13 | * | DAddYE_ joined #nimrod |
18:51:52 | * | DAddYE quit (Read error: Connection reset by peer) |
18:57:08 | * | Demos quit (Read error: Operation timed out) |
18:58:35 | * | vbit joined #nimrod |
18:58:59 | * | vbit quit (Client Quit) |
18:59:27 | * | vbtt joined #nimrod |
19:03:11 | * | dymk quit (Quit: This computer has gone to sleep) |
19:10:52 | * | xtagon joined #nimrod |
19:11:57 | Araq | hi xtagon welcome |
19:14:47 | xtagon | Hey :) |
19:15:29 | foxcub | Is there any support for atomics in nimrod? For example, compare-and-swap? |
19:21:16 | Araq | look at lib/system/atomics.nim |
19:28:29 | foxcub | So atomicCompareExchangeN is what I'm after? |
19:31:34 | * | ddl_smurf quit (Quit: ddl_smurf) |
19:34:11 | Araq | not sure, ask MFLamer when he's around |
19:38:06 | xtagon | Since Nimrod compiles to C, is it safe to say you can theoretically use it anywhere you can use C, even embedded systems? |
19:38:38 | Araq | yes, we have a special --os:standalone mode for embedded systems |
19:38:45 | xtagon | Neat! |
19:38:58 | Araq | no gc then and no stdlib, but still runtime array bounds checking |
19:39:08 | Araq | and a much better syntax and type system |
19:39:14 | Araq | so still a win over C :P |
19:40:17 | xtagon | I like that you support many different C compilers |
19:41:32 | * | dymk joined #nimrod |
19:46:03 | * | dymk quit (Ping timeout: 252 seconds) |
19:51:49 | * | foxcub quit (Quit: foxcub) |
19:52:26 | * | dymk joined #nimrod |
20:02:36 | * | stollero joined #nimrod |
20:02:56 | stollero | Good evening |
20:03:30 | xtagon | Hello |
20:04:38 | Araq | hi stollero welcome |
20:05:15 | stollero | Quick question: Is it possible to map a sequence to variables like: var a, b, c, d = @[1, 2, 3, 4] |
20:08:28 | Araq | stollero: for now only with a macro |
20:08:49 | Araq | gradha had an implementation but he's not here right now |
20:10:12 | stollero | Alright, maybe there is another way. I'll explain what I want to do. I have a command line application with an input of 4 numbers seperated by space. |
20:10:19 | stollero | Reading is really easy with stdin.readLine.split.map(parseInt) |
20:10:41 | stollero | Then I have my sequence that led to my question |
20:12:07 | xtagon | I'm trying to build 0.9.2 on Linux AMD64 and get a build error during linking. Here's the last part of the output https://gist.github.com/anonymous/6a41fa5cacf7f8fea337 |
20:13:12 | stollero | xtagon: just build on Ubuntu 12.04 x64 without any issues |
20:13:25 | stollero | Araq: Thanks for your help, will take a look at the macros |
20:25:24 | xtagon | Araq, any idea why it won't compile for me? It's on Ubuntu 13.04 x86_64 |
20:27:25 | Araq | xtagon: use git head instead, ubuntu got rid of ansi c's lrint |
20:28:21 | xtagon | Araq, thanks |
20:29:38 | * | icebattle joined #nimrod |
20:29:58 | Araq | stollero: I'll put that macro into the stdlib, this question comes up quite often |
20:31:07 | stollero | Araq: Good idea :) |
20:43:34 | dom96 | Araq: Could you merge master into the devel branch? |
20:44:04 | Araq | dom96: will do it later, fixing unittest module for master |
20:44:20 | dom96 | ok |
20:44:23 | Araq | interestingly it turned out to be yet another stress test for vm2 ... |
20:45:29 | * | io2 joined #nimrod |
20:49:25 | * | dymk quit (Quit: This computer has gone to sleep) |
20:50:58 | * | Eruquen quit (Ping timeout: 245 seconds) |
20:54:17 | * | Eruquen joined #nimrod |
20:57:48 | * | Demos joined #nimrod |
21:00:39 | Varriount | OrionPK: Did you manage to get 'nimrod serve' to work with multiple files? |
21:02:33 | Demos | is there a way to dpecify a document type in any of the XML modules? |
21:02:37 | Demos | *specify |
21:02:52 | * | [1]Endy joined #nimrod |
21:03:30 | OrionPK | iirc i couldnt get nimrod serve to work at all |
21:04:08 | Varriount | OrionPK: Ok, then I must be running into the same thing you ran into |
21:04:22 | Varriount | I don't get any output. :/ |
21:04:23 | OrionPK | mm that stinks |
21:04:35 | OrionPK | I have some code in the plugin for nimrod serve, but it's disabled |
21:04:42 | OrionPK | because I couldnt get it to work |
21:04:45 | Varriount | Yeah, I saw |
21:09:15 | Demos | Yeah I could not get serve to do anything |
21:09:21 | Araq | you know ... we have like 4 people working with "idetools" but nobody working *on* idetools |
21:09:31 | Araq | that's the problem |
21:09:39 | Demos | spawning a process on every keystroke is "Not A Good Idea" |
21:10:35 | Varriount | Araq: Fine. I'll go get my machete and shotgun. But if I get eaten by wild procedures, I blame you. |
21:11:14 | stollero | PNimRode to String? |
21:11:31 | stollero | PNimRodeNode to String? |
21:11:44 | Varriount | stollero: AstToString, I think |
21:12:01 | Varriount | It's either in the system module, or the macros module |
21:12:20 | Araq | I think it's "repr" |
21:14:17 | * | DAddYE_ quit (Read error: Connection reset by peer) |
21:14:21 | stollero | repr did the trick |
21:14:59 | Demos | having idetools exposed vai a nimrod API would be pretty neat as well. Could run all that stuff in the same process as the editor |
21:15:10 | * | DAddYE joined #nimrod |
21:16:18 | xtagon | "Indentation is done with spaces only, tabulators are not allowed." - is there a good reason for this? I prefer tabs for indentation and spaces for formatting |
21:18:58 | Araq | Demos: only if your editor supports DLLs |
21:19:05 | stollero | Convert sequence to array? |
21:19:19 | Varriount | xtagon: I think the short answer is, because the width your editor defines for a 'tab' and the width other editors define for 'tabs' is going to be different |
21:19:35 | Varriount | Thus, any hope of formatting is lost |
21:19:40 | Demos | xtagon, alignment matters, not indentation. So if you were to accedently mix spaces and tabs code that looks valid would not be |
21:19:42 | Araq | stollero: not possible in general, as array must have a known size at compiletime |
21:19:44 | Varriount | xtagon: However, there is a workaround |
21:20:01 | stollero | xtagon: http://c2.com/cgi/wiki?TabsVersusSpaces |
21:20:27 | stollero | Can a string split return an array? |
21:20:35 | Demos | and yes, only if you can call dlls, but the idetools text interface can be implemented in terms of the nimrod API |
21:20:40 | stollero | Araq: Can a string split return an array? |
21:21:11 | Demos | stollero, not really... I mean how big should it be? |
21:21:31 | stollero | Demos: size of 4 |
21:22:06 | Varriount | xtagon: If you *really* want tabs, add this at the top of your file (no quotes) : "#! replace("\t", " ")" |
21:22:36 | Demos | what happens if you pass in a string with more than 4 parts? |
21:22:41 | Varriount | Er, I mean, ignore the outer quotes. |
21:22:48 | * | pafmaf left #nimrod (#nimrod) |
21:23:10 | xtagon | Varriount, thanks. I think I'll conform to the standard |
21:23:30 | xtagon | Every so often I get flak for using tabs in Ruby instead of two spaces :| |
21:24:09 | Araq | stollero: I think I can do it now, but I won't show it :P |
21:24:27 | stollero | Demos: I am using stdin.readLine.split - assume that is never greater than 4 |
21:24:30 | Varriount | xtagon: FYI, the snippet I posted is a source code filter that the nimrod compiler will evaluate, which replaces tabs with two spaces. |
21:24:51 | Araq | as it relies on a small hole in the macro evaluation system |
21:24:55 | Varriount | See: http://nimrod-lang.org/filters.html#replace-filter |
21:24:57 | xtagon | Varriount, but it has to be in every source file which uses tabs, correct? |
21:24:58 | stollero | Araq: Did you just implement it :)? |
21:25:04 | Varriount | xtagon: Yes. |
21:25:54 | Varriount | xtagon: Plus, if you plan to submit something like that to Araq, he'll get into a fit, and no-one wants to have that happen again. |
21:26:16 | Varriount | We still haven't gotten rid of the teddy bears from last time. |
21:26:19 | xtagon | So how many spaces should I use for indentation? |
21:26:24 | Varriount | xtagon: Two |
21:26:37 | stollero | (4) |
21:26:39 | stollero | :) |
21:26:58 | Araq | Varriount: "get into a fit"? what does that mean? |
21:27:37 | Varriount | Araq: To throw a tantrum. (and I was joking, just so you know) |
21:28:31 | Demos | are we talking about tabs or fixed length string processing here? |
21:28:39 | Araq | bah that never happens |
21:28:57 | Araq | I'm always in a good mood |
21:29:13 | Varriount | Araq: However, at least in the US, 'tantrum' is associated more with children and/or juvenile behavior, while 'fit' implies a less severe, adult version |
21:29:50 | Araq | now that's offensive :P |
21:29:55 | Araq | I'm still like a child |
21:30:33 | Varriount | Demos: Are you using idetools/serve as well? |
21:30:52 | Demos | well I would be, but I can't get serve to work |
21:31:10 | Demos | I wrote the code to invoke it and redirect output, but I can not do so vecause there /is/ no output |
21:31:12 | Araq | Demos: the trick is to use suggest etc. and not "serve" |
21:31:24 | Varriount | Demos: Maybe, between the two of us, we can get it back into some semblence of working |
21:31:49 | Demos | Araq, true, but then you end up starting a new process for EVERY suggestion |
21:32:03 | Demos | and Varriount I could not even find the actual code for idetools, just the code leading there |
21:32:16 | Demos | although I only looked for a little while |
21:32:52 | Varriount | Demos: I don't know about idetools, but the 'serve' code is enmeshed into the main program procedures |
21:32:59 | Demos | oh dear god |
21:33:37 | Demos | I really can not work on it this weekend, but maybe next week/weekend |
21:34:34 | Araq | Demos: yeah but that's still workable |
21:35:28 | Demos | Araq, sure. But getting it out of the main program flow is a good goal once we have it working |
21:35:49 | Demos | oh dear I think my mouse is dieing |
21:36:34 | OrionPK | give it a viking funeral |
21:37:09 | Demos | it is like 2 years old and cost a good amount of money |
21:37:17 | * | LordAndrew joined #nimrod |
21:37:20 | Demos | I should really stop buying razor products |
21:37:24 | OrionPK | :\ |
21:37:31 | Araq | hi LordAndrew welcome |
21:37:31 | OrionPK | yeah razor isnt known for quality |
21:37:51 | LordAndrew | Howdy! |
21:39:50 | * | [1]Endy quit (Ping timeout: 272 seconds) |
21:44:15 | * | vendethiel joined #nimrod |
21:44:41 | Demos | it could also be possible that my 30 year old mousepad is disintegrateing |
21:45:30 | Demos | well ok, actually only 19 years old |
21:46:35 | Varriount | Demos: I was mistaken. Only *bits* of the serve code is enmeshed in the main procedures. A large part of the processing is in compiler/service.nim |
21:47:06 | OrionPK | Varriount u gonna fix nimrod serve? |
21:47:21 | Varriount | OrionPK: Possibly. I promise nothing. |
21:47:53 | OrionPK | swear to me! |
21:48:20 | Varriount | Only if you can promise me A's in all my classes this semester. |
21:48:27 | Varriount | :3 |
21:48:29 | OrionPK | i promise |
21:48:59 | OrionPK | not promising i'll be able to keep that promise though |
21:50:20 | * | stollero quit (Quit: Verlassend) |
21:54:40 | * | dymk joined #nimrod |
21:56:51 | Araq | ping zahary |
22:04:24 | Araq | damn ... anybody still on master? |
22:04:53 | Varriount | Araq: I can switch to master. |
22:05:05 | Varriount | Why do you ask? |
22:05:21 | Araq | ok please check if tests\run\tunittest runs on master |
22:12:14 | Varriount | Araq: I'm not able to get nimrod to bootstrap back on to master. I get a gcc error |
22:12:41 | Araq | uh oh |
22:12:55 | Araq | so only devel can compile devel? |
22:13:19 | Varriount | Araq: No. Only master can compile master |
22:14:27 | Varriount | I was able to get master to compile devel today, about 3 hours ago |
22:14:39 | Araq | what's the error message? |
22:14:55 | Varriount | c:\64\nimrod\compiler\nimcache\compiler_ropes.c: In function 'compilerropesInit': |
22:14:55 | Varriount | c:\64\nimrod\compiler\nimcache\compiler_ropes.c:1622:50: error: 'r_393449' undeclared (first use in this function) |
22:14:55 | Varriount | asgnRefNoCycle((void**) &r_393458, ropef_125079(r_393449, LOC100001, 0)); |
22:16:22 | Araq | strange |
22:16:48 | Varriount | There's a faint possibility that it might be my build setup. |
22:17:13 | Varriount | Let me take down the builders, and see if that does anything |
22:18:37 | Araq | we really need versioning of the exes for koch/nimbuild |
22:19:37 | Araq | fucking unittest module makes my head explode |
22:19:56 | Varriount | Howso? |
22:20:54 | Araq | 3 nested templates with lazy lookup and override mechanisms should be forbidden |
22:21:51 | Varriount | Araq: Yeah. I can't bootstrap master using devel. I keep getting that rope error |
22:22:27 | Varriount | With parallelBuild set to 1, I get: |
22:22:30 | Varriount | c:\64\nimrod\compiler\ropes.nim: In function 'compilerropesInit': |
22:22:30 | Varriount | c:\64\nimrod\compiler\ropes.nim:289:123: error: 'r_393449' undeclared (first use in this function) |
22:22:30 | Varriount | var r {.global.} = r.ropef |
22:22:30 | Varriount | ^ |
22:22:30 | Varriount | c:\64\nimrod\compiler\ropes.nim:289:123: note: each undeclared identifier is reported only once for each function it appears |
22:23:08 | Varriount | Araq: I'll use a built version of master from the build farm archives |
22:23:26 | dom96 | omg. Why is git such a fail at line endings? |
22:24:11 | Varriount | Because stupid people using windows feel the need to change the default git line ending option? |
22:25:23 | Araq | Varriount: this makes no sense that code section is not even active |
22:25:28 | Araq | look at compiler/ropes.nim |
22:25:38 | Araq | there is a "when true" section |
22:26:24 | dom96 | Well I tried... |
22:26:31 | dom96 | Git is being too much of a bitch. |
22:27:37 | Varriount | dom96: How many versions of nimrod is the build farm archiving at the moment? |
22:27:50 | dom96 | Varriount: Probably quite a lot. |
22:27:51 | vbtt | can nimrod overload on the return type? |
22:27:59 | Araq | vbtt: no |
22:28:55 | xtagon | Silly noob question: why does echo($some_int) work but $some_int.echo does not? But stdin.readLine acts the same as readLine(stdin) |
22:29:24 | Demos | darn I crashed the compiler! |
22:29:29 | Araq | Varriount: I guess it's the static[string] that changed its semantics |
22:29:46 | Demos | I crashed GCC |
22:29:51 | Araq | xtagon: $a.b is parsed as $(a.b) and not as ($a).b |
22:30:06 | xtagon | Araq, ah, thanks! |
22:30:26 | Araq | you don't need the $ for echo |
22:30:32 | Varriount | Araq: Huh? |
22:30:42 | xtagon | The tutorial uses it |
22:31:44 | Varriount | Araq: Should I try wiping my local nimrod build, and bootstrapping it from csources? |
22:32:02 | Araq | Varriount: nah, it's fine |
22:32:33 | Varriount | Araq: So.. why isn't it working? What changed? |
22:33:03 | Araq | not sure but static[X] changed its meaning |
22:33:25 | Araq | er ... never mind |
22:33:34 | Varriount | ? |
22:33:36 | Araq | I am still looking at the devel version |
22:37:13 | Araq | Varriount: ah, master has a different version of ~ |
22:37:29 | Varriount | ~? |
22:37:38 | Araq | and it still uses 'expr[string]' which changed its semantics |
22:37:56 | Araq | ~ is the compile-time rope constructor, obviously |
22:38:06 | Araq | because it looks like a rope |
22:39:03 | Varriount | Araq: And you aren't afraid someone might miss that completely obvious and totally reasonable operator? |
22:39:32 | Araq | it's in the compiler not in the stdlib |
22:39:37 | Varriount | Oh. |
22:40:38 | Araq | and it's not my code but zahary's |
22:41:25 | vbtt | so ~"hello" is a rope? |
22:41:32 | Araq | and it starts to make some sense when you have 4K of rope handling code |
22:41:46 | Araq | vbtt: yes |
22:44:37 | vbtt | what do you mean *compile-time* rope operator? could this not have been a type TRope("hello") |
22:45:00 | vbtt | Is it used a lot in metaprogramming? |
22:48:30 | Araq | it's used in the compiler, it's not used "a lot", it's not in the stdlib |
22:51:52 | Araq | and "compile-time" means it triggers a compile-time context so the compiler must be able to evaluate the argument at compile time |
22:52:37 | vbtt | ok thanks. |
22:54:11 | vbtt | reading about the interfaces discussion and type classes. i think nimrod has made good design choices here. |
22:55:42 | Demos | yeah, I think most people miss the fact that "program to an interface" is a) impossible and b) does not mean "use OO style interfaces everywhere" |
22:56:11 | Varriount | Demos: It's not always their fault, Java is largely to blame. |
22:56:13 | vbtt | I just wish that function calls within typeclasses don't automatically treat values as types, rather require a ':' |
22:56:26 | vbtt | e.g. write(s, :string) instead of write(s, string) |
22:56:45 | Demos | Varriount, I blame the java/c++/simula style OOP (single dispatch) |
22:57:12 | Varriount | Hey Araq, want to hear of another python let-down? |
22:58:34 | Demos | I want to hear it :D |
22:58:50 | Araq | vbtt: the type/value unification is however quite advanced |
22:59:09 | Araq | in other words I'm not sure what a leading ':' would destroy when it comes to metaprogramming |
22:59:15 | Araq | perhaps nothing |
23:00:28 | Varriount | Well, a python enhancement proposal was accepted withing the last year for dynamic dispatch. The downside? The dispatch is based only on the type of the first argument in a procedure, whether the procedure be part of a class/object definition or not |
23:00:49 | vbtt | Since types often follow ':', I think a leading ':' greatly helps readability. |
23:00:58 | Demos | Varriount, python must have had single dispatch for a while right? |
23:01:10 | Demos | like regular OOP style virtual calls |
23:01:21 | Varriount | And due to python's explicit 'self' in object/class methods, this essentially makes the single dispatch useless when working with object methods |
23:01:36 | vbtt | Python has had single dispatch since almost forever. |
23:01:43 | Varriount | Demos: It's a registration dispatch mechanism |
23:01:44 | Demos | so how is this new thing different? |
23:02:08 | Varriount | It's meant to help things like the pickle module, where certain mechanisms have to be registered. |
23:02:13 | vbtt | which pep are you talking about? |
23:02:33 | Demos | I actually gotta go, see yall later |
23:02:41 | * | Demos quit (Quit: Leaving) |
23:02:41 | Varriount | vbtt: http://www.python.org/dev/peps/pep-0443/ |
23:03:23 | * | foxcub joined #nimrod |
23:03:31 | Varriount | Hello again foxcub |
23:03:36 | foxcub | Hi |
23:03:49 | foxcub | I have a very strange question. |
23:04:00 | foxcub | How can I convert a pointer to a ref? |
23:04:23 | Araq | you don't, you either start with a 'ref' or you use 'var' or 'ptr' |
23:04:30 | foxcub | (I realize this is a heresy.) |
23:04:43 | Araq | (nope, it's a common question) |
23:04:51 | vbtt | Varriount: yeah that makes sense - explicitly states 'single dispatch generic functions' |
23:04:56 | foxcub | What if I want to make an ugliest, unholiest cast? (That would also increment a reference count for the object.) |
23:05:35 | Varriount | foxcub: Have you looked at the gc inc ref and dec ref procs? |
23:05:37 | Araq | ensure that you have 2 words to fake the GC header then and it might work, foxcub |
23:05:57 | foxcub | But the mechanics of it? |
23:06:02 | foxcub | Say I have a pointer. |
23:06:22 | foxcub | Now I want a reference, or are you suggesting that I do a bit copy into the reference, but skip first two words? |
23:06:24 | Varriount | vbtt: I still dislike the fact that there are no allowances made for OO style programming |
23:07:08 | vbtt | Varriount: not sure what you mean? Python is very OO style. |
23:07:28 | * | psquid joined #nimrod |
23:07:28 | * | psquid quit (Changing host) |
23:07:28 | * | psquid joined #nimrod |
23:07:30 | Varriount | vbtt: That you can't use the single-dispatch generic function mechanisms with methods |
23:07:48 | Varriount | Without going around the restrictions set it place. |
23:08:26 | foxcub | Araq, alternatively, is there some kind of a void* type reference? Something I could store, and then extract, but assign to a reference to some higher level type? |
23:08:33 | Varriount | (Yes, I realize that you can simply delegate a method to an outside function) |
23:08:53 | Araq | foxcub: there is pointer but that's a untyped "ptr" |
23:09:27 | foxcub | Well, that's why I'm storing addresses as pointers, but now how to convert them back to refs? |
23:09:44 | Araq | you can use "ref tuple[]" for an "untyped ref". this requires casts but is memory safe ... I think |
23:10:03 | foxcub | Aha, can you give me a brief example? |
23:10:10 | Varriount | foxcub: What are you working on, exactly? |
23:10:18 | foxcub | Varriount: serialization |
23:10:30 | foxcub | The kind that tracks references correctly. |
23:10:59 | Varriount | foxcub: Has the marshal module been of any use at all? |
23:11:06 | foxcub | I don't need json. |
23:11:46 | Araq | foxcub: not sure what the example should contain |
23:12:02 | Araq | told you already everything i know |
23:12:18 | foxcub | Araq: I seriously doubt that. :-) |
23:12:59 | Varriount | foxcub: Maybe, but have you looked at the marshal source code? |
23:13:16 | Varriount | Actually, does the marshal module even handle reference tracking? |
23:13:41 | foxcub | Varriount: I have not. It's a good suggestion, I'll check it out. I'm not sure if it tracks references. I saw json, and I skipped it. |
23:14:19 | Araq | foxcub: ever heard of the Second Futamura Projection? |
23:14:55 | foxcub | No, what's that? |
23:15:53 | Araq | ok, so I didn't tell you everything I know :P |
23:16:27 | foxcub | ;-) |
23:16:48 | foxcub | Hm, when I say type TRef = ref tuple[] |
23:16:56 | foxcub | And then try to make a TTable[int, TRef] |
23:17:08 | foxcub | It complains. |
23:17:39 | Araq | ok, so it give it a dummy: int field |
23:17:54 | foxcub | It complains. |
23:17:57 | foxcub | Sorry |
23:18:01 | foxcub | Ignore the last comment. |
23:20:13 | foxcub | Araq: amazing! It works. |
23:20:32 | foxcub | So casts between references work fine? |
23:20:44 | foxcub | What does it do to reference counting? |
23:21:14 | Araq | nothing but the assignment still does the RC updates so it ends up being fine |
23:21:52 | foxcub | So it's safe, and I don't need to think about GC? That's excellent. |
23:21:57 | Araq | if it doesn't work come back and complain, some parts of the GC might not have been written with this in mind *cough* |
23:22:09 | foxcub | Araq: ;-) got you |
23:23:08 | Araq | in fact, you should add it to the testsuite please |
23:23:24 | foxcub | Actually, just casting to PObject and back works, so that's all I need. |
23:23:46 | Araq | yeah any "ref object" works I guess |
23:23:58 | foxcub | great |
23:30:03 | Varriount | Hm. I wonder if flexible declarative command line option parsing is possible |
23:30:54 | * | odc quit (Ping timeout: 252 seconds) |
23:40:09 | dom96 | Araq: What is ole2? |
23:40:44 | Araq | some COM stuff |
23:41:02 | Araq | fixed windows.nim already, but need to push it |
23:41:03 | dom96 | It's currently broken. |
23:41:45 | dom96 | oh, did you fix it? |
23:41:52 | dom96 | Did you change TGUID into a tuple? |
23:42:47 | * | foxcub quit (Quit: WeeChat 0.4.2) |
23:48:04 | Araq | no, should I? |
23:48:10 | Araq | I fixed windows.nim on devel |
23:48:15 | dom96 | Not necessarily. |
23:48:34 | dom96 | I just used the object constructor syntax for my use case. |
23:49:10 | dom96 | every single GUID in ole2 will need to be changed as it uses tuple construction syntax |
23:49:20 | Araq | huh? what? |
23:49:22 | * | dom96 isn't sure how it ever worked |
23:49:35 | * | Araq is not either |
23:49:44 | Araq | Varriount: did you change the windows stuff? |
23:49:51 | Araq | so ... I've got good news |
23:50:01 | Araq | unittest module works on devel again |
23:50:34 | Varriount | Araq: The only changed windows stuff is in my most recent pull request, that adds greater symlink support to os.nim |
23:50:48 | Araq | make that PR against devel please |
23:50:50 | Varriount | The pull request is on the devel branch |
23:50:57 | Araq | damn :P |
23:50:59 | Araq | you're quick |
23:51:38 | Araq | can you please start to work on something important? :P |
23:51:45 | Araq | like fixing idetools |
23:51:59 | Araq | that might even be easier than closure iterators |
23:52:17 | * | darkf joined #nimrod |
23:52:20 | Varriount | Araq: How is idetools broken? |
23:52:31 | Araq | the "serve" mode |
23:52:39 | Araq | according to everybody who tries it |
23:53:02 | Varriount | Funny thing about that, I think I found a workaround for the moment |
23:53:50 | Varriount | Araq: There's a 'reset' command when in serve mode. I don't know exactly what it does, but if used after every command sent to the serving compiler, things work. |
23:54:42 | dom96 | Perhaps that is how zahary intended it to be used from the beginning. |
23:54:43 | Varriount | You are right, of course. Fixing 'serve' is much easier than closure iterators. |
23:55:01 | dom96 | Varriount: Could you document 'serve'? |
23:55:23 | Varriount | dom96: http://build.nimrod-lang.org/docs/idetools.html#compiler-as-a-service-caas |
23:55:43 | dom96 | oh TIL |
23:56:02 | Varriount | Although, the fact that you have to specify a single source file offends me somewhat. |
23:56:25 | Varriount | Since most programmers tend to have multiple files open at any given time. |
23:56:44 | dom96 | It doesn't seem 'reset' is documented. |
23:56:53 | Varriount | Nope. |
23:57:29 | Araq | why has this been written by britney spears? |
23:57:39 | Araq | also wow I never read it ... |
23:58:27 | dom96 | because gradha |
23:59:25 | Araq | he should get some credit for his work |
23:59:44 | Varriount | Am I missing something? |
23:59:54 | dom96 | Also we should be professional :P |