00:01:23 | * | Trustable quit (Quit: Leaving) |
00:17:08 | * | xenagi joined #nimrod |
00:25:25 | * | nande quit (Read error: Connection reset by peer) |
00:31:23 | * | BitPuffin joined #nimrod |
00:32:15 | * | nande joined #nimrod |
00:41:05 | * | BitPuffin quit (Ping timeout: 272 seconds) |
01:08:19 | * | brson quit (Ping timeout: 272 seconds) |
01:19:00 | * | q66 quit (Quit: Leaving) |
01:29:12 | * | hoverbear joined #nimrod |
01:43:26 | * | Joe_knock quit (Quit: Leaving) |
01:52:49 | * | kemet joined #nimrod |
01:54:17 | * | kemet quit (Client Quit) |
01:59:58 | * | saml_ joined #nimrod |
02:24:24 | * | OrionPK quit (Remote host closed the connection) |
02:24:41 | * | OrionPK joined #nimrod |
02:25:39 | * | OrionPK quit (Remote host closed the connection) |
02:25:52 | * | OrionPK joined #nimrod |
02:30:39 | * | OrionPK quit (Remote host closed the connection) |
02:30:52 | * | OrionPK joined #nimrod |
02:36:29 | * | sdw left #nimrod (#nimrod) |
03:02:20 | * | sdw joined #nimrod |
03:04:47 | * | saml_ quit (Ping timeout: 245 seconds) |
03:37:33 | * | flaviu quit (Ping timeout: 240 seconds) |
03:56:59 | * | xenagi quit (Quit: Leaving) |
03:59:31 | * | TylerE quit (Ping timeout: 252 seconds) |
04:02:20 | * | TylerE joined #nimrod |
04:02:29 | * | CARAM_ quit (Ping timeout: 272 seconds) |
04:05:22 | * | CARAM_ joined #nimrod |
04:37:11 | Skrylar | meep |
04:37:36 | Varriount | Hi Skrylar |
04:37:52 | Varriount | Skrylar: I'm trying to use your unicode library. :P |
04:40:01 | Skrylar | oh dear |
04:40:05 | Skrylar | did it work or explode violently |
04:40:45 | Varriount | Well... |
04:41:20 | Varriount | I'm trying to do a simple decoding-encoding test, and it doesn't seem to be working properly. |
04:42:11 | Varriount | Skrylar: https://gist.github.com/Varriount/b416c67863dfc681b600 |
04:43:22 | Varriount | Skrylar: Is there a procedure to simply decode a utf8 string into it's graphemes, and then encode the graphemes back into a string? |
04:44:28 | Skrylar | let me check it in a few minutes; gotta run up to the computer that has that set up |
04:44:58 | Skrylar | Varriount: there should be a method to iterate graphemes unless i forgot to port that |
04:45:53 | Varriount | Skrylar: There is, but there's no simple method to encode them back. |
04:46:43 | Skrylar | i never needed to do that, lol |
04:46:48 | Skrylar | i'll check it in a moment |
04:47:38 | Varriount | Skrylar: I'm going to see if I can make some procedures that are a bit more... friendly to those who don't fully understand unicode. |
04:58:52 | Skrylar | ok, i'm at a computer proper now |
04:59:06 | Skrylar | Varriount: what was it you were actually trying to do, or were you playing around? |
04:59:30 | * | nande quit (Remote host closed the connection) |
05:00:57 | Varriount | Skrylar: I was playing around. |
05:01:30 | Varriount | Skrylar: I had in mind a procedure to echo a decoded UTF string |
05:03:07 | Skrylar | ah |
05:03:32 | Skrylar | I'm not sure what good that would do, but i'll check this gist and see if i bugged something up |
05:11:40 | Skrylar | Varriount: works for me |
05:12:59 | Varriount | Skrylar: You're sure? I get the wrong characters (Although admittedly, it may be the Command Prompt's fault) |
05:13:34 | Skrylar | Varriount: make sure your local file is saved as unicode, then pipe the output to a file and open in sublime |
05:13:45 | Varriount | Oh, fixed it. |
05:14:11 | Varriount | Apparenlty the 'Code Page' that the command prompt was using was set incorrectly. |
05:14:23 | Skrylar | yeah, the windows terminal is derpy |
05:14:33 | Skrylar | even a lot of xterms are derpy |
05:17:53 | Varriount | Skrylar: I was just thinking, it would be nice to have a string-like type that worked well with unicode (even if performance is degraded a bit) |
05:18:30 | Skrylar | originally thats what i wrote that code in C for |
05:18:43 | Skrylar | i also have part of a gap buffer module thats supposed to be unicode aware |
05:19:12 | Skrylar | the biggest thing with unicode is that everything is now O(n) instead of O(1), and you have to verify that string splitting only happens across grapheme borders |
05:22:01 | Varriount | Skrylar: Do the findSplit procedures take into account grapheme clusters, or just individual codepoints? |
05:22:20 | Skrylar | i think there's one for both |
05:22:50 | * | Skrylar checks |
05:23:17 | Skrylar | Yep, graphemes |
05:23:30 | Skrylar | that methods specifically for asking "where can i cut this string in two, starting at X" |
05:23:34 | Skrylar | (without mangling it) |
05:23:42 | Varriount | Ok, great. |
05:23:53 | Skrylar | I could probably make that a little more clean in the nimdoc |
05:25:12 | Varriount | Skrylar: If you didn't read already, I'm planning to make a small tool which turns phrases into passwords. Since I'm going to be doing a lot of string manipulation, I'd like to make sure that I get things right, unicode wise. |
05:25:46 | Skrylar | Varriount: have you read the 'masterpasswordapp' algorithm? |
05:25:52 | Skrylar | they just pipe the text through scrypt |
05:26:02 | Skrylar | one thing to note is that i don't think i ported over the unicode normalization |
05:26:08 | Varriount | No, I haven't. |
05:26:16 | Skrylar | that's something one usually wants, since there are like 3 ways of encoding the same letter |
05:26:35 | Varriount | Skrylar: I don't think what I'm doing is considered encryption. It's really just string mangling. |
05:26:51 | Skrylar | http://masterpasswordapp.com/algorithm.html here's one way to do it |
05:27:01 | Skrylar | scrypt is a one-way trapdoor function for passwords |
05:27:08 | Varriount | Eg: "The Happy Brown Cow" turns into something along the lines of "t3Hybrwncw" |
05:30:22 | Varriount | Skrylar: Hm, that looks like one solution. It might be better than my method (though that doesn't mean I'm going to not write a program to do things my way) |
05:44:28 | * | foochain joined #nimrod |
06:09:32 | * | foochain quit (Quit: Leaving.) |
06:21:35 | * | Varriount|Mobile quit (Remote host closed the connection) |
06:21:37 | * | hoverbear quit () |
06:22:03 | * | Varriount|Mobile joined #nimrod |
06:24:31 | Skrylar | there's this weird wisdom that i don't know if someone has phrased it well but |
06:24:33 | Skrylar | basically |
06:24:44 | Skrylar | how a novice will look at the end goal of something, and then try to take the most direct path |
06:25:00 | Skrylar | but then in later stages, like, art |
06:25:16 | Skrylar | the novice will try to hand paint every weave of a cloth. the pro will just slap a weave map on to a flat plane |
06:43:48 | * | Varriount|Mobile quit (Remote host closed the connection) |
06:45:21 | * | Varriount|Mobile joined #nimrod |
06:55:13 | * | Varriount|Mobile quit (Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )) |
06:56:10 | * | gkoller joined #nimrod |
07:11:52 | * | foochain joined #nimrod |
07:12:57 | * | foochain left #nimrod (#nimrod) |
07:21:05 | * | jpoirier_ joined #nimrod |
07:22:50 | * | jez0990 joined #nimrod |
07:23:26 | * | silven_ joined #nimrod |
07:25:16 | * | tumak_ joined #nimrod |
07:27:53 | * | jpoirier quit (Read error: Connection reset by peer) |
07:27:54 | * | jez0990_ quit (Quit: No Ping reply in 180 seconds.) |
07:27:54 | * | silven quit (Quit: No Ping reply in 180 seconds.) |
07:27:54 | * | reloc0 quit (Ping timeout: 252 seconds) |
07:27:55 | * | comex quit (Ping timeout: 252 seconds) |
07:27:55 | * | tumak quit (Ping timeout: 252 seconds) |
07:28:13 | * | reloc0 joined #nimrod |
07:28:55 | * | comex joined #nimrod |
07:29:56 | * | kunev quit (Ping timeout: 240 seconds) |
07:58:09 | * | jpoirier_ quit (Quit: Bye!) |
08:05:02 | * | kunev joined #nimrod |
08:18:43 | * | keebus joined #nimrod |
08:18:48 | keebus | hello gentlemen |
08:19:01 | def- | hi keebus |
08:20:45 | keebus | I would like to ask you a question. How does nimrod play with exceptions and stack unwinding? When you throw an exception does nimrod unwind the stack until the catch block destroying stack allocated objects? (like in C++) |
08:20:51 | keebus | Thank you |
08:25:06 | def- | keebus: I think so, but I'm not the most knowledgeable guy about Nimrod |
08:34:41 | reactormonk | let me see |
08:39:03 | reactormonk | keebus, the relevant line seems to be lib/system/excpt.nim:216 |
08:39:51 | reactormonk | where the excHandler is a safe point of what I would say is a try clause |
08:41:04 | keebus | yes, I noticed this, but longjumping to a previous frame on the stack doesnt happen by unwinding the stack but only by overwriting the various cpu registers |
08:41:22 | reactormonk | let me follow a bit more |
08:42:57 | reactormonk | keebus, I don't see anything else |
08:43:13 | keebus | I'll have to run a quick test and see what happens |
08:43:23 | keebus | then study the generated C output |
08:44:09 | reactormonk | use -d:release, make generated code more readable |
08:44:29 | keebus | thank yu |
08:44:32 | keebus | you* |
08:54:10 | keebus | reactormonk: sorry to bother you, one last question. Does nimrod support destructors? |
08:57:05 | reactormonk | keebus, I think there has been discussion on that |
08:57:13 | reactormonk | keebus, btw, what did you find? |
08:57:25 | keebus | well I need to be able to write a destructor |
08:57:30 | keebus | otherwise my whole question does not stand :) |
08:57:44 | keebus | the point is that when an exception is thrown |
08:57:55 | reactormonk | keebus, https://github.com/Araq/Nimrod/issues/408 |
08:58:39 | keebus | new(result, finalizer)? |
08:58:42 | reactormonk | so you have the {.destruct.} pragma, but it's not guaranteed to work |
08:58:45 | reactormonk | yeah |
08:58:53 | reactormonk | https://github.com/Araq/Nimrod/search?q=destructor&ref=cmdform&type=Issues |
08:59:19 | keebus | I can see there are a few problems |
09:00:03 | reactormonk | what's your use case? |
09:00:40 | keebus | say I want to create an object that prints "HELLO" when constructed and "WORLD" when destructed |
09:00:45 | keebus | (destroyed) |
09:00:59 | keebus | point is: I want to allocate this object on the stack as a local variable |
09:02:19 | keebus | then some function i'm calling throws an exception, ok it's longjumping to the appropriate "catch" block on the stack, but I still want my destructor to be called. |
09:02:29 | keebus | again, just like C++ |
09:06:57 | reactormonk | try it |
09:14:43 | keebus | ok |
09:14:44 | keebus | all done |
09:14:56 | keebus | alright, it does call the destructors |
09:15:25 | keebus | the implementation though looks a bit naive |
09:16:24 | keebus | it's just issuing the call and checking some error code with an 'if' |
09:16:47 | keebus | the "exception" propagation is basically "if (some exception occurred) { return }" |
09:17:03 | keebus | the cost is that each function call comes with a hidden if-else statement |
09:17:29 | keebus | unfortunately C does not provide the fast zero-cost exception mechanism C++ offers |
09:17:51 | keebus | thank you anyway |
09:17:56 | * | Matthias247 joined #nimrod |
09:26:34 | Skrylar | no exception system is ever truly zero cost |
09:26:36 | Skrylar | :( |
09:42:17 | * | BitPuffin joined #nimrod |
09:52:26 | * | untitaker quit (Ping timeout: 240 seconds) |
09:52:42 | * | untitaker_ joined #nimrod |
09:53:02 | * | silven_ is now known as silven |
10:07:11 | * | foochain joined #nimrod |
10:07:29 | * | foochain left #nimrod (#nimrod) |
10:14:03 | dom96 | keebus: you can compile to C++ to get its fast exception mechanism. |
10:32:20 | * | saml_ joined #nimrod |
10:38:12 | reactormonk | dom96, how come C++ has faster exceptions than C? |
10:38:19 | * | saml_ quit (Ping timeout: 240 seconds) |
10:38:34 | dom96 | reactormonk: C doesn't have native exceptions |
10:39:00 | reactormonk | in the end C is native too, isn't it? |
10:39:05 | dom96 | I don't know about the reasons why the C++ exceptions cannot be emulated in C |
10:39:23 | dom96 | yeah, but by native I mean the language spec includes them |
10:46:07 | * | saml_ joined #nimrod |
10:46:11 | keebus | Skrylar: compiling to C++ means you need to use the C++ compiler rather than plain C which is several times slower. |
10:46:25 | keebus | sorry I meant dom96: |
10:47:05 | dom96 | indeed. It's not ideal. Do you have any suggestions about how to speed up the exception handling in the C target? |
10:47:25 | keebus | Skrylar: the way exceptions are implemented in C++ are zero-cost because they introduce absolutely zero overhead when the program does not throw, which is what you want as exceptions should model "Exceptional" cases, not simple program flow (java makes me puke) |
10:48:43 | keebus | well the funny thing is that apparently gcc supports building the .eh_frame data structure for C |
10:48:49 | keebus | (for c++ interop) |
10:48:56 | keebus | just calling gcc -fexceptions |
10:49:15 | keebus | the less funny thing is that apparently there's no way to use this extra data generated by the compiler from the application :( |
10:49:37 | keebus | I've been hitting my head and googling hard |
10:49:45 | keebus | to know if this is possible |
10:50:21 | keebus | dom96: you're right, there's no real reason why C++ exceptions cant be emulated in C *efficiently*. |
10:50:35 | keebus | but apparently it's not that trivial |
10:51:04 | reactormonk | keebus, .eh_frame ? |
10:51:43 | reactormonk | keebus, the nimrod guru is not here, I'm more from the interpreted territory so I don't know the lowlevels too well |
10:51:47 | * | Trustable joined #nimrod |
10:52:06 | keebus | the problem with setjump / longjump is that you restore the execution to a given point on the stack, ignoring all frames between the function that issued the setjump and the function that called longjump, effectively preventing any local variable destruction |
11:04:32 | reactormonk | keebus, so you want an implicit try/catch block? |
11:04:59 | keebus | what do you mean by implicit? |
11:05:13 | reactormonk | keebus, try/finally, to be correct. |
11:05:17 | keebus | yes |
11:05:31 | keebus | but again, efficiently :) |
11:06:14 | reactormonk | you're gonna cross that piece of code anyway, either you're returning or you're jumping over it |
11:06:30 | keebus | that is fine |
11:06:44 | keebus | the problem is doing this bunch of work ONLY when an exception is thrown |
11:06:58 | reactormonk | you could attach it to the current safe point |
11:06:59 | keebus | and keeping the overhead over normal execution as minimal as possible |
11:07:04 | keebus | that's costly |
11:07:22 | reactormonk | what would be efficient? |
11:07:50 | keebus | well truly efficient would be no code at all injected in your function and based on compile time tables only (the .eh_frame) |
11:08:01 | keebus | that's what C++ does... |
11:08:14 | keebus | we can't do that, at least, i have no idea of how to do that in plain C |
11:08:43 | reactormonk | give me a benchmark where c++ is faster before we start theorycrafting. |
11:08:47 | keebus | what we should strive for is having the smallest code injection for exc handling possible |
11:09:22 | keebus | no need for it, just search zero-cost exception versus SJLJ |
11:09:56 | keebus | the disassembly of a C++ function does not contain any instructions generated by the compiler to handle exceptions |
11:10:03 | keebus | zero |
11:10:32 | keebus | the hard work is only done when you throw an exception. |
11:10:37 | reactormonk | make yourself a benchmark, try it with the default nimrod compiler, edit excpt.nim, run your code again with ./koch temp -r c <file> |
11:11:05 | reactormonk | ... editing excpt.nim would include kicking the exception logic. |
11:11:17 | keebus | nimrod uses setjmp to handle exception reactormonk , ive been using this technique for a long time there is no magic behind it |
11:11:44 | reactormonk | keebus, yes, I'm not questioning your logic. I just wanna see how much you could gain with zero-cost exceptions. |
11:12:10 | reactormonk | just "emulate" them by kicking the logic out |
11:12:27 | keebus | fair enough, knowing "how slower" it is is a legit question rather than "if it is slower". :) |
11:12:59 | reactormonk | there might even be a flag for this |
11:14:18 | reactormonk | haven't found one |
11:15:02 | reactormonk | keebus, I assume you're correct that it's slower this way. But it's important to know how much speed it will give nimrod compared to other stuff we could be doing instead. |
11:16:05 | reactormonk | if it's 30% for the function call itself, it's a good thing. With 5% of the function call cost, well. |
11:16:48 | reactormonk | And I honestly don't know how complicated it would be to implement zero-cost exceptions |
11:18:27 | * | Matthias247 quit (Read error: Connection reset by peer) |
11:42:49 | Araq | keebus: the c++ target uses C++'s zero cost exception handling, the C target uses longjmp |
12:19:26 | * | untitaker_ quit (Ping timeout: 240 seconds) |
12:25:10 | * | saml_ quit (Quit: Leaving) |
12:25:53 | * | untitaker joined #nimrod |
12:30:22 | * | flaviu joined #nimrod |
12:49:06 | * | kunev quit (Quit: leaving) |
12:50:50 | * | darkf quit (Quit: Leaving) |
13:06:23 | * | kunev joined #nimrod |
13:14:14 | Varriount | Meep |
13:16:13 | * | gkoller quit (Quit: gkoller) |
13:16:37 | * | gkoller joined #nimrod |
13:17:01 | * | keebus quit (Quit: Page closed) |
13:25:02 | Skrylar | meep |
13:36:17 | * | OrionPK quit (Remote host closed the connection) |
13:36:34 | * | OrionPK joined #nimrod |
13:37:25 | * | OrionPK quit (Remote host closed the connection) |
13:58:07 | * | gkoller quit (Ping timeout: 276 seconds) |
14:47:52 | * | Jehan_ joined #nimrod |
15:10:25 | * | hoverbear joined #nimrod |
15:11:18 | * | hoverbear quit (Client Quit) |
15:12:33 | * | BitPuffin quit (Ping timeout: 240 seconds) |
15:34:32 | * | Matthias247 joined #nimrod |
15:39:06 | * | exirctest joined #nimrod |
15:41:33 | * | kunev quit (Quit: leaving) |
15:43:14 | flaviu | Hmm, it seems there are no indentation tokens |
15:44:11 | Araq | hmm, it seems this is very well covered in the manual |
15:45:51 | Araq | how it's done has took 3 iterations btw, so yes, I'm sure it's the right way to do it |
15:46:09 | * | superfunc joined #nimrod |
15:51:31 | flaviu | I wasn't trying to get you to do anything, I was just curious. I didn't notice that section in the manual, thanks. |
15:51:32 | * | superfunc quit (Quit: leaving) |
15:51:47 | * | superfunc joined #nimrod |
16:09:19 | * | nande joined #nimrod |
16:14:10 | superfunc | sup everyone |
16:16:10 | * | hoverbear joined #nimrod |
16:20:42 | dom96 | hey superfunc |
16:20:52 | superfunc | how did the final exams turn out? |
16:24:10 | dom96 | Well I think. I won't get the results until August though. |
16:25:35 | superfunc | right on. I've been thinking of taking on the task of improving nimrod's documentation, if no one minds. I know we're not at 1.0 yet, but I think it could really help with adoption |
16:28:17 | dom96 | superfunc: What kinds of improvements do you have in mind? |
16:28:26 | flyx | are there some more infos about macros than what's written in the manual? |
16:28:38 | flyx | it isn't very much |
16:28:51 | dom96 | superfunc: I'm just curious, all improvements are of course welcome. |
16:29:19 | dom96 | superfunc: A thing to keep in mind though is that filwit is working on improving the docs too, look-wise. |
16:29:42 | dom96 | flyx: http://build.nimrod-lang.org/docs/macros.html |
16:29:53 | dom96 | flyx: https://nimrod-by-example.github.io/oop_macro/ |
16:30:08 | dom96 | flyx: http://build.nimrod-lang.org/docs/tut2.html#macros |
16:30:31 | superfunc | That's good, I'm more concerned with content. First, everything in the libraries shouls contain a plausible example. |
16:31:26 | superfunc | Next, I'd like to go ahead and write something in the style of rust-by-example to really help people get going with general programming tasks. |
16:32:42 | superfunc | I would like to see the auto generated documentation look more like that of the main page, meaning better syntax highlighting, cleaner design, etc.( I assume that is the direction filwit is going ) |
16:33:04 | dom96 | indeed. And you should contribute to flaviu's nimrod-by-example |
16:36:03 | superfunc | That is awesome. It illustrates something that we should better address, which is giving people a clear direction of where to go. As of now, each basically points to the stdlib docs and the manual |
16:36:29 | superfunc | Most people learn much better from something like nim-by-example. |
16:38:23 | flyx | dom96: thanks. is there a way to define variables that are only available at compile time, in macros? |
16:41:04 | superfunc | flaviu: Are you ok with your nimrod-by-example being featured on the reddit page? |
16:41:04 | dom96 | flyx: What's the use case? Hygiene? If so you can use macros.genSym for that. |
16:41:26 | dom96 | superfunc: perhaps we should add more examples before redditing it |
16:42:24 | superfunc | I meant as a link on the sidebar |
16:42:36 | superfunc | rather than a featured post |
16:43:23 | flyx | dom96: I'm not sure yet, I'm just gathering information |
16:45:09 | * | JehanII joined #nimrod |
16:45:09 | * | Jehan_ quit (Read error: Connection reset by peer) |
16:45:52 | * | EXetoC joined #nimrod |
16:52:12 | * | BitPuffin joined #nimrod |
16:54:15 | * | brson joined #nimrod |
16:55:56 | * | kunev joined #nimrod |
16:59:34 | * | q66 joined #nimrod |
17:02:01 | * | Matthias247 quit (Quit: Matthias247) |
17:06:31 | * | xtagon joined #nimrod |
17:07:30 | flaviu | superfunc: I'd rather you not do that yet, since its pretty empty right now. |
17:08:20 | flaviu | Becaues I'm sure someone will see it and post it to r/programming, which I don't want to happen yet |
17:09:32 | superfunc | that's fair enough |
17:10:34 | * | BitPuffin quit (Ping timeout: 244 seconds) |
17:11:35 | superfunc | One aesthetic comment, it may be beneficial to have a side bar along the code for general comments. One of the examples I was looking through got a bit 'loud' |
17:12:14 | superfunc | it was the enums page |
17:17:22 | * | nahamu joined #nimrod |
17:18:08 | nahamu | Hi, I was building Nimrod on a Solaris variant (SmartOS) and ran into two issues: |
17:19:03 | nahamu | I only use illumos variants, so I don't know about Solaris 11 or beyond, but this should apply to Solaris 10 as well. |
17:19:08 | * | Matthias247 joined #nimrod |
17:19:49 | nahamu | 1) illumos, like MacOS doesn't have execvpe so I had to add "or defined(solaris)" in two places in lib/pure/osproc.nim to get nimrod to compile |
17:20:28 | nahamu | 2) when I run koch, it appears to fail to wait for background gcc processes to complete, so the invocation of koch initially fails, but if I wait until the background compilation is done and run it again, it succeeds. |
17:20:57 | nahamu | I couldn't find known issues on github... Should I open a pull request for #1 and a ticket for #2? |
17:21:56 | nahamu | 0) I had to use the oldest commit in c-sources in order to bootstrap myself. The newest one failed for me... |
17:25:08 | dom96 | hello nahamu! Yes, open a pull request please. You can open a ticket for #2 as well and for #0, but keep in mind that we have limited resources and that fixing Solaris may take some time. It would certainly be preferable if you could make PRs for #0 and #2 as well. |
17:25:46 | * | zahary joined #nimrod |
17:31:01 | flaviu | superfunc: Thanks for the feedback, a comment sidebar would require more css than I'm willing to do, but I think I can get it to be more manageable in other ways. |
17:37:26 | nahamu | dom96: if you have any ideas of where to look in the code to fix #2, any pointers would be appreciated. |
17:38:04 | nahamu | I'm currently not certain if the bug would be in koch.nim or in lib/pure/osproc.nim in a spot I didn't look, or what. |
17:38:45 | nahamu | I'm assuming #0 would be fixed by a regeneration of the c-sources after I've fixed #1 and #2. |
17:39:14 | dom96 | nahamu: could you gist the output of koch? |
17:39:41 | superfunc | flaviu: No worries. If I knew a darn thing about web programming I'd help with that |
17:43:04 | nahamu | dom96: sure, the first run when it fails to wait for the background gcc processes or the second run when it succeeds, or both? |
17:43:38 | dom96 | nahamu: both I guess. I'm not entirely sure what happens so all output would be helpful. |
17:44:59 | nahamu | will do, one moment |
17:45:00 | dom96 | Perhaps the best way to debug this would be to write a little test app which uses osproc.startProcess |
17:45:32 | * | Jesin joined #nimrod |
17:47:07 | * | nande quit (Remote host closed the connection) |
17:47:55 | * | BitPuffin joined #nimrod |
17:48:09 | nahamu | http://us-east.manta.joyent.com/nahamu/public/nimrod/koch-run1 and http://us-east.manta.joyent.com/nahamu/public/nimrod/koch-run2 |
17:48:54 | flyx | hm. can I declare an alias for a type without defining a new type? |
17:49:04 | flyx | like, a short name for a complex TTable instance? |
17:49:47 | flaviu | flyx: type MyTableType = TTable[Foo[Foobulator, Barinator], string] |
17:50:03 | flyx | flaviu: that doesn't work, it declares a new type |
17:50:12 | flyx | flaviu: I cannot use initTable with that one |
17:54:10 | dom96 | nahamu: My guess is that waitForExit is broken. Best way to check is to write a little app which uses startProcess to execute some process and to call waitForExit on it. |
17:55:25 | dom96 | nahamu: hrm, although maybe the compiler uses execCmd to execute gcc |
17:56:01 | dom96 | nahamu: That seems more likely. In that case you will have to delve into its implementation. |
17:57:17 | superfunc | has anyone ever thought about adding a match statement into the language? |
17:57:43 | superfunc | Although I'm sure it could be done with a macro |
17:58:00 | dom96 | yes, I started writing a macro but I hit a bug in the compiler. |
17:58:31 | superfunc | Ah, so once that gets cleared up, it may make it in? |
18:00:37 | dom96 | That's up to Araq. |
18:00:54 | JehanII | superfunc: The bigger question is: What does a match statement buy you in Nimrod? |
18:00:55 | superfunc | Its probably the one syntactic thing I miss from Ocaml lol |
18:01:16 | * | nande joined #nimrod |
18:01:33 | superfunc | The only thing I could argue it buys you is clarity |
18:01:43 | superfunc | Though case statements are pretty clear as is |
18:02:06 | JehanII | Yeah, that's pretty much it. |
18:02:20 | flaviu | What I'd like is to be able to get some type safety with object variants. |
18:03:03 | * | nande quit (Remote host closed the connection) |
18:03:30 | flaviu | To specify that I only want a variant with a certain type for a given function |
18:03:46 | superfunc | agreed. I hit a snag with that myself |
18:05:48 | * | shevy joined #nimrod |
18:05:51 | JehanII | flaviu: That could be made part of the case statement, too. |
18:06:37 | JehanII | The benefit of match vs. case is more about how much object deconstruction buys you. |
18:06:46 | * | Stefan joined #nimrod |
18:06:57 | flaviu | `of somekind: # the value is known to be of type somekind`? |
18:08:35 | * | exirctest quit (*.net *.split) |
18:08:38 | * | Matthias247 quit (*.net *.split) |
18:08:38 | * | xtagon quit (*.net *.split) |
18:08:38 | * | EXetoC quit (*.net *.split) |
18:08:38 | * | hoverbear quit (*.net *.split) |
18:08:39 | * | silven quit (*.net *.split) |
18:08:39 | * | springbok quit (*.net *.split) |
18:08:40 | * | Skrylar quit (*.net *.split) |
18:08:40 | * | Varriount quit (*.net *.split) |
18:08:40 | * | def- quit (*.net *.split) |
18:08:41 | * | gsingh93_ quit (*.net *.split) |
18:08:42 | * | clone1018 quit (*.net *.split) |
18:08:45 | * | betawaffle quit (*.net *.split) |
18:08:52 | * | nande joined #nimrod |
18:10:03 | JehanII | flaviu: Think of Sather's typecase statement. |
18:10:46 | * | Matthias247 joined #nimrod |
18:10:46 | * | xtagon joined #nimrod |
18:10:46 | * | EXetoC joined #nimrod |
18:10:46 | * | hoverbear joined #nimrod |
18:10:46 | * | exirctest joined #nimrod |
18:10:46 | * | silven joined #nimrod |
18:10:46 | * | springbok joined #nimrod |
18:10:46 | * | gsingh93_ joined #nimrod |
18:10:46 | * | Skrylar joined #nimrod |
18:10:46 | * | Varriount joined #nimrod |
18:10:46 | * | def- joined #nimrod |
18:10:46 | * | clone1018 joined #nimrod |
18:10:46 | * | betawaffle joined #nimrod |
18:12:02 | flaviu | Yep, that's pretty much what I was thinking |
18:14:01 | JehanII | flaviu: One thing I don't particularly like about match is that it encourages implementation-dependent code. |
18:14:51 | * | exirctest quit (*.net *.split) |
18:14:54 | * | Matthias247 quit (*.net *.split) |
18:14:54 | * | xtagon quit (*.net *.split) |
18:14:54 | * | EXetoC quit (*.net *.split) |
18:14:54 | * | hoverbear quit (*.net *.split) |
18:14:55 | * | silven quit (*.net *.split) |
18:14:55 | * | springbok quit (*.net *.split) |
18:14:56 | * | Skrylar quit (*.net *.split) |
18:14:56 | * | Varriount quit (*.net *.split) |
18:14:56 | * | def- quit (*.net *.split) |
18:14:58 | * | gsingh93_ quit (*.net *.split) |
18:14:58 | * | clone1018 quit (*.net *.split) |
18:15:01 | * | betawaffle quit (*.net *.split) |
18:15:08 | superfunc | Couldn't you say a switch/case does the same thing? |
18:15:25 | * | nande quit (Remote host closed the connection) |
18:16:14 | JehanII | superfunc: Not to the same degree, because a typecase statement doesn't depend on how the data structure is laid out. |
18:16:18 | * | Matthias247 joined #nimrod |
18:16:18 | * | xtagon joined #nimrod |
18:16:18 | * | EXetoC joined #nimrod |
18:16:18 | * | hoverbear joined #nimrod |
18:16:18 | * | exirctest joined #nimrod |
18:16:18 | * | silven joined #nimrod |
18:16:18 | * | springbok joined #nimrod |
18:16:18 | * | gsingh93_ joined #nimrod |
18:16:18 | * | Skrylar joined #nimrod |
18:16:18 | * | Varriount joined #nimrod |
18:16:18 | * | def- joined #nimrod |
18:16:18 | * | clone1018 joined #nimrod |
18:16:18 | * | betawaffle joined #nimrod |
18:16:31 | * | JehanII is now known as Jehan_ |
18:17:35 | * | exirctest quit (Write error: Broken pipe) |
18:17:51 | Stefan | quit |
18:17:55 | flaviu | Jehan_: Not necessarily. For a list, a:b isn't implementation dependent, it is abstraction dependent, as it should be. |
18:18:03 | superfunc | Yes, if you are using it to destructure something |
18:18:14 | * | Stefan left #nimrod (#nimrod) |
18:18:18 | Jehan_ | Let's say I do the following in OCaml: type t = A of int | B of float * int |
18:18:21 | superfunc | But if you use it at the same level people are using a switch construct, I don't think it hurts |
18:18:45 | Jehan_ | And at some point I decide to switch the two parameters of B around: Suddenly I need to rewrite every single match statement to account for that. |
18:19:12 | Jehan_ | Worse, if I have B of int * int instead, then I may overlook the two parameters being mixed up. |
18:19:22 | superfunc | Maybe we're thinking of it in two different contexts. I was thinking of matching on values, not types. |
18:19:56 | flaviu | Jehan_: What is A*B called? |
18:20:10 | Jehan_ | flaviu: Que? |
18:20:24 | flaviu | int*int |
18:20:37 | flaviu | float * int, etc |
18:21:17 | Jehan_ | What do you mean by "is … called"? |
18:21:33 | flaviu | Is there a term I can google to explain that syntax? |
18:22:11 | Jehan_ | That's an algebraic data type, where the A variant is an int and the B variant is a pair (float, int) |
18:22:57 | flaviu | Oh, `*` is just a fancy way of saying pair |
18:23:35 | superfunc | Yeah, just google product type and sum types for that stuff |
18:24:56 | superfunc | Both fall under the category of alg. data types |
18:25:09 | flaviu | I tried "ocaml multiply types", but it turned up nothing |
18:25:53 | Jehan_ | But basically, you have no way to abstract over the internals of A or B unless you encapsulate them in an object. At which point, match becomes a more verbose way of doing a typecase. |
18:26:54 | flaviu | But on the other hand, there isn't any better way to deal with tree-like structures than match. |
18:27:10 | Jehan_ | There isn't? |
18:27:25 | Jehan_ | Try match with a B-tree. :) |
18:28:21 | superfunc | http://ocaml.org/learn/tutorials/data_types_and_matching.html#Variantsqualifiedunionsandenums |
18:28:23 | Jehan_ | Fundamentally, match is a typecase statement with a let on each branch for the constituent elements. |
18:28:30 | superfunc | you may find that useful flaviu |
18:29:13 | flaviu | I got it, thanks anyway |
18:29:24 | superfunc | B-trees were the bain of my existence one semester long ago |
18:30:45 | * | nande joined #nimrod |
18:38:57 | Jehan_ | Oh my god, the US Supreme Court ruled 9:0 against software patents. |
18:40:14 | Jehan_ | I'd break out the champagne, except that I can't stand alcohol. |
18:40:35 | flyx | hm. I followed the oop macro example https://nimrod-by-example.github.io/oop_macro/ , but when I try to call treeRepr(body), I get a SIGSEGV |
18:41:51 | * | eigenlicht quit (Ping timeout: 264 seconds) |
18:43:24 | flaviu | flyx: Can you post your code? It works for me |
18:44:23 | flyx | flaviu: just figured it out. when I call "macroName:", I get the error, when I call "macroName foo:", it works |
18:44:32 | flyx | but that should be the head, not the body. why does it cause a segfault when displaying the body? |
18:44:52 | flyx | is a statement macro required to have contents after the macro name besides its children? |
18:48:09 | EXetoC | Jehan_: no more of those? win |
18:48:15 | flaviu | flyx: Seems to be macro weirdness, when head is missing, the body moves into head's spot |
18:48:42 | flaviu | flyx: ie `echo treeRepr(head)` prints body's contents |
18:49:16 | superfunc | yay common sense prevails one time |
18:49:59 | flyx | flaviu: um, okay o.O |
18:50:11 | flyx | flaviu: is there a way to check that inside the macro? |
18:51:15 | EXetoC | check what? |
18:51:41 | Jehan_ | EXetoC: Doesn't mean "no more of those", but it made it a LOT harder to secure patentability for one. |
18:51:54 | EXetoC | repr is useful when debugging nodes |
18:51:56 | EXetoC | right |
18:52:33 | Jehan_ | EXetoC: The main constraint seems to be that algorithms on generic computers (i.e. that don't exploit or improve specific hardware-related properties) fall outside patent protection. |
18:53:01 | Jehan_ | One just has to be careful: On paper, a similar constraint exists in the EU, but that has been eroded over time. |
18:53:44 | * | eigenlicht joined #nimrod |
18:54:18 | flaviu | flyx: Best I can think of is verifying that head is either a) just an ident, or b) infix `of` with two idents |
19:03:21 | * | EXetoC quit (Quit: WeeChat 0.4.3) |
19:04:12 | flyx | flaviu: hm okay thanks |
19:07:28 | superfunc | Is there a way to forward args to GCC? |
19:08:06 | Araq | superfunc: --passC and --passL |
19:08:21 | superfunc | Araq: Thanks :) |
19:09:25 | flaviu | superfunc: Also, the docs on the compiler command-line are good: http://nimrod-lang.org/nimrodc.html |
19:13:56 | * | vendethiel quit (Read error: Connection reset by peer) |
19:14:33 | Jehan_ | It looks as though the C++ backend has a problem with imported functions of type "const char *". Probably other const pointers, too. |
19:14:37 | * | vendethiel joined #nimrod |
19:15:35 | Jehan_ | assigning to 'NCSTRING' (aka 'char *') from incompatible type |
19:15:35 | Jehan_ | 'const char *' |
19:15:35 | Jehan_ | LOC18 = gai_strerror(gairesult_157608); |
19:15:35 | Jehan_ | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
19:16:50 | superfunc | flaviu: my bad, I just wasn't seeing it at first |
19:17:34 | Jehan_ | Can be made to compile with "--passC:-Dconst=", but that's probably a less than ideal solution. |
19:21:04 | flaviu | superfunc: Not a problem, just pointing to that page in case you hadn't found it. |
19:27:04 | superfunc | Hmm, I'm trying to force SDL to statically link, and the flags seem to be correct, but when I check with "$file myexe" it still lists it as dynamically linked |
19:27:50 | flaviu | superfunc: I've updated the enums page and would appreciate feedback |
19:28:51 | superfunc | sure, lemme go take a look |
19:31:55 | * | EXetoC joined #nimrod |
19:32:19 | superfunc | flaviu: I think that is much cleaner |
19:32:43 | superfunc | It reads a bit more naturally to me, to read-code, then read an explanation |
19:33:22 | Jehan_ | flaviu: The last sentence of the paragraph after the first piece of code seems incomplete? |
19:34:22 | flyx | hm I should be able to call procs from inside macros, right? but if I pass a PNimrodNode to a proc and then try to iterate over children, I get "Error: cannot generate code for '[]'" |
19:34:24 | flyx | can I use PNimrodNode only in macros? |
19:34:56 | flaviu | Jehan_: Thanks, fixed |
19:35:27 | Jehan_ | I think I'd like a {.pure.} pragma for imports as well as for enums. |
19:35:37 | Jehan_ | Rather than having to do `from foo import nil`. |
19:35:47 | Jehan_ | It's strangely non-orthogonal. |
19:36:51 | flaviu | Or maybe turn things around: `from a import *`, `import a` |
19:37:10 | flaviu | `import a` would require qualification |
19:37:23 | Jehan_ | flaviu: That would break too much existing code. |
19:37:43 | EXetoC | the former would end up everywhere though |
19:37:52 | Jehan_ | Generally, I don't have a problem with the default. Python doesn't do it by default because it's dynamically typed. |
19:37:52 | superfunc | flaviu: slight thing, might be worth tabbing the third member of the first enum over to line up(I know, I'm _that_ guy) |
19:38:12 | Jehan_ | In Nimrod, if you have ambiguities as a result, you get a compile time error, so usually less of a problem. |
19:38:29 | Jehan_ | But sometimes it's nice not to pollute the main namespace. |
19:38:31 | flaviu | Jehan_: Skip 1.0, go straight to 2.0 :P |
19:39:07 | Jehan_ | flaviu: You mean to get all the benefits of the Python 2->3 transition at once? :) |
19:39:11 | flaviu | superfunc: I'm not sure what you mean |
19:39:44 | Jehan_ | flaviu: I think Haskell does this pretty much right. |
19:39:53 | flaviu | But isn't one of the features of the Nimrod AST source-to-source translations? Tooling would be almost trivial to implement. |
19:39:58 | superfunc | flaviu: the value for Blue is left-aligned, I just thought it would be cleaner to have it align with Red |
19:40:09 | Jehan_ | import vs. import qualified |
19:41:44 | * | shodan45 joined #nimrod |
19:53:05 | superfunc | Ok, I got it to statically build in everything outside of some linux essentials like libc |
19:57:46 | flaviu | superfunc: That's actually the text wrap, there isn't an easy way to fix it. I'll keep it in mind though, maybe I'll fix it later. |
19:57:55 | * | superfunc quit (Ping timeout: 240 seconds) |
20:02:16 | Jehan_ | flaviu: Your `result` section should probably initialized `result` with 1 for the `**` example. |
20:02:23 | Jehan_ | initialize* |
20:03:46 | flaviu | Thanks, fixed |
20:05:01 | flyx | flaviu: hm, the proper thing to do the macro parameter handling seems to use openarray[stmt] |
20:05:43 | flyx | but it doesn't seem like I can differentiate between a parameter that was passed as body and one that was passt inline that way |
20:08:49 | dom96 | flyx: macro foo(x: openarray[stmt], body: stmt) may work |
20:09:09 | flyx | dom96: will try that |
20:09:44 | dom96 | hrm. |
20:15:37 | EXetoC | src/glib2.nim:77: guint16* = int16 |
20:16:48 | EXetoC | bug I guess, even though it's repeated a couple of times |
20:27:55 | * | kunev quit (Ping timeout: 240 seconds) |
20:32:41 | * | Johz joined #nimrod |
20:32:41 | * | Matthias247_ joined #nimrod |
20:35:27 | * | Matthias247 quit (Ping timeout: 240 seconds) |
20:42:05 | * | askatasuna joined #nimrod |
20:46:22 | nahamu | dom96: is it just me or is "waitForSingleObject" only defined under Windows...? |
20:46:47 | dom96 | nahamu: possibly |
20:47:13 | nahamu | waitForExit appears to be implemented using it. |
20:47:19 | nahamu | that might explain my issue. |
20:48:34 | nahamu | nevermind, I was probably looking at the wrong definition in the other file |
20:48:38 | nahamu | ignore that. |
20:53:54 | * | shevy left #nimrod ("I'll be back ... maybe") |
21:08:12 | * | Demos joined #nimrod |
21:08:31 | * | EXetoC quit (Read error: No route to host) |
21:12:30 | Demos | Anyone know if the OpenGL package provides a way to check if an extension is supported? |
21:33:12 | flyx | Demos: the basic way - glGetIntegerv with GL_NUM_EXTENSIONS, followed by looping over them with glGetString and GL_EXTENSIONS - should work |
21:33:13 | flyx | *glGetStringi |
21:34:00 | flyx | it would probably be wise to stuff them into a TSet once and use that for all tests. |
21:34:19 | Demos | right, although I thought the "modern" way was to use that to get a platform specific extension to check for extensions so you can get the ARB extension to check for extensions, or something like that. That would be a very GL way to do things I think |
21:34:48 | Demos | I was just wondering if OpenGL.nim had variables that it set up for each extension |
21:36:55 | flyx | I'm not sure if it does. didn' t do much with it yet. |
21:37:19 | * | JehanII joined #nimrod |
21:38:20 | * | dLog quit (Read error: Connection reset by peer) |
21:38:32 | * | Jehan_ quit (Ping timeout: 245 seconds) |
21:38:38 | * | dLog joined #nimrod |
21:38:59 | flyx | the platform-specific APIs are usually just for getting the function pointers to certain OpenGL functions |
21:39:39 | * | Johz quit (Quit: Leaving) |
21:39:55 | flyx | you can of course use that and check if it returns nil. but it would be very platform-dependent |
21:42:14 | flyx | OpenGL just isn't very modern |
21:42:31 | flyx | no wonder hardware vendors have started to develop their own APIs |
21:43:41 | * | EXetoC joined #nimrod |
21:46:08 | * | OrionPK joined #nimrod |
21:46:11 | * | OrionPK quit (Remote host closed the connection) |
21:47:33 | * | OrionPK joined #nimrod |
22:01:41 | * | foo_ joined #nimrod |
22:08:35 | * | foo_ quit (Quit: leaving) |
22:09:01 | * | superfunc joined #nimrod |
22:10:35 | * | Jehan_ joined #nimrod |
22:10:36 | * | Jehan_ quit (Client Quit) |
22:12:49 | * | JehanII quit (Ping timeout: 244 seconds) |
22:13:21 | * | BitPuffin quit (Ping timeout: 255 seconds) |
22:16:23 | * | Trustable quit (Quit: Leaving) |
22:17:14 | Skrylar | uh |
22:17:21 | Skrylar | must be an old opengl then |
22:17:38 | Skrylar | they've had the fully shader pipeline for a while |
22:18:22 | Skrylar | the only thing more 'modern' than the GL3.1 Core and GL4 versions are the prototype interfaces for raw hardware access |
22:20:06 | Skrylar | but nobody is going to code directly to those anyway, they're for things like that one project (I think it was named 'gallum' something) that wanted to unify DX/GL APIs with hardware calls to break the whole vendor lockdown thing |
22:22:48 | * | Matthias247_ quit (Read error: Connection reset by peer) |
22:33:29 | * | Demos quit (Ping timeout: 244 seconds) |
23:05:08 | * | Dingba joined #nimrod |
23:05:19 | Araq | h Dingba welcome |
23:05:42 | Dingba | hi |
23:08:47 | * | superfunc quit (Read error: Connection reset by peer) |
23:12:02 | * | superfunc joined #nimrod |
23:15:34 | * | shodan45 was just toying with Lazarus/Free Pascal :D |
23:16:24 | shodan45 | I used to love pascal when I was a kid |
23:19:08 | Skrylar | i still like pascal |
23:19:16 | Skrylar | nimrod is pascal enough that i am happy |
23:23:06 | * | hoverbear quit () |
23:23:18 | * | hoverbear joined #nimrod |
23:23:24 | * | hoverbear quit (Client Quit) |
23:24:03 | Araq | good night |
23:24:52 | * | darkf joined #nimrod |
23:30:16 | Dingba | so nimrod is awesome right? |
23:31:33 | Dingba | whats the best editor for nimrod right now? |
23:32:05 | reactormonk | Dingba, there's aporia for nimrod, I'm tinkering on nimrod-mode for emacs, zahary has a vim plugin for it |
23:34:15 | Dingba | i'll try aporia..so many build steps |
23:41:25 | Dingba | aporia says that I should find a pcre.dll in nimrod repo under the "dist" directory, but there is no "dist" directory |
23:41:48 | Dingba | not does my nimrod have a pcre.dll anywhere, although it does have a pcre.nim |
23:42:36 | Dingba | a binary download of aporia would probably be a good idea-- |
23:46:57 | OrionPK | Dingba right now sublimetext is the best editor for nimrod |
23:47:00 | OrionPK | using the NimLime plugin |
23:47:09 | OrionPK | https://github.com/Varriount/NimLime |
23:49:04 | flaviu | Dingba: How about kate? Although it looks like crap on Windows IIRC |
23:52:19 | Dingba | ya i'm on windows :0, never tried kate before |
23:52:30 | Dingba | I got sublime |
23:53:02 | Dingba | not sure if I properly activated NimLime, it seems to do some syntax hightlighting but not really anything else? |
23:54:45 | Dingba | Like when i do this |
23:54:52 | Dingba | var DudeBro = "wtf" import math math.d |
23:55:07 | Dingba | it brings up DudeBro and "wtf" as possible options |
23:55:07 | * | superfunc quit (Read error: Connection reset by peer) |
23:55:09 | Dingba | which makes no sense.. |
23:55:24 | Dingba | and doesn't show anything from math i think |
23:55:55 | flaviu | Dingba: Yeah, smart autocompletion is not a feature of anything but aporia. |
23:56:55 | Dingba | so i need to get aporia working :0 gotcha |
23:57:23 | flaviu | It is part of the compiler though, so it should be possible to add it to anything, but Compiler As A Service does not work ATM unless something has changed recently, so the autocomplete performance isn't too good. |
23:59:12 | EXetoC | nimrod.vim uses idetools |
23:59:46 | flaviu | EXetoC: Really? I haven't been able to set it up to autocomplete well. |