<< 19-06-2014 >>

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:11Skrylarmeep
04:37:36VarriountHi Skrylar
04:37:52VarriountSkrylar: I'm trying to use your unicode library. :P
04:40:01Skrylaroh dear
04:40:05Skrylardid it work or explode violently
04:40:45VarriountWell...
04:41:20VarriountI'm trying to do a simple decoding-encoding test, and it doesn't seem to be working properly.
04:42:11VarriountSkrylar: https://gist.github.com/Varriount/b416c67863dfc681b600
04:43:22VarriountSkrylar: 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:28Skrylarlet me check it in a few minutes; gotta run up to the computer that has that set up
04:44:58SkrylarVarriount: there should be a method to iterate graphemes unless i forgot to port that
04:45:53VarriountSkrylar: There is, but there's no simple method to encode them back.
04:46:43Skrylari never needed to do that, lol
04:46:48Skrylari'll check it in a moment
04:47:38VarriountSkrylar: 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:52Skrylarok, i'm at a computer proper now
04:59:06SkrylarVarriount: 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:57VarriountSkrylar: I was playing around.
05:01:30VarriountSkrylar: I had in mind a procedure to echo a decoded UTF string
05:03:07Skrylarah
05:03:32SkrylarI'm not sure what good that would do, but i'll check this gist and see if i bugged something up
05:11:40SkrylarVarriount: works for me
05:12:59VarriountSkrylar: You're sure? I get the wrong characters (Although admittedly, it may be the Command Prompt's fault)
05:13:34SkrylarVarriount: make sure your local file is saved as unicode, then pipe the output to a file and open in sublime
05:13:45VarriountOh, fixed it.
05:14:11VarriountApparenlty the 'Code Page' that the command prompt was using was set incorrectly.
05:14:23Skrylaryeah, the windows terminal is derpy
05:14:33Skrylareven a lot of xterms are derpy
05:17:53VarriountSkrylar: 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:30Skrylaroriginally thats what i wrote that code in C for
05:18:43Skrylari also have part of a gap buffer module thats supposed to be unicode aware
05:19:12Skrylarthe 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:01VarriountSkrylar: Do the findSplit procedures take into account grapheme clusters, or just individual codepoints?
05:22:20Skrylari think there's one for both
05:22:50*Skrylar checks
05:23:17SkrylarYep, graphemes
05:23:30Skrylarthat methods specifically for asking "where can i cut this string in two, starting at X"
05:23:34Skrylar(without mangling it)
05:23:42VarriountOk, great.
05:23:53SkrylarI could probably make that a little more clean in the nimdoc
05:25:12VarriountSkrylar: 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:46SkrylarVarriount: have you read the 'masterpasswordapp' algorithm?
05:25:52Skrylarthey just pipe the text through scrypt
05:26:02Skrylarone thing to note is that i don't think i ported over the unicode normalization
05:26:08VarriountNo, I haven't.
05:26:16Skrylarthat's something one usually wants, since there are like 3 ways of encoding the same letter
05:26:35VarriountSkrylar: I don't think what I'm doing is considered encryption. It's really just string mangling.
05:26:51Skrylarhttp://masterpasswordapp.com/algorithm.html here's one way to do it
05:27:01Skrylarscrypt is a one-way trapdoor function for passwords
05:27:08VarriountEg: "The Happy Brown Cow" turns into something along the lines of "t3Hybrwncw"
05:30:22VarriountSkrylar: 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:31Skrylarthere's this weird wisdom that i don't know if someone has phrased it well but
06:24:33Skrylarbasically
06:24:44Skrylarhow a novice will look at the end goal of something, and then try to take the most direct path
06:25:00Skrylarbut then in later stages, like, art
06:25:16Skrylarthe 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:48keebushello gentlemen
08:19:01def-hi keebus
08:20:45keebusI 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:51keebusThank you
08:25:06def-keebus: I think so, but I'm not the most knowledgeable guy about Nimrod
08:34:41reactormonklet me see
08:39:03reactormonkkeebus, the relevant line seems to be lib/system/excpt.nim:216
08:39:51reactormonkwhere the excHandler is a safe point of what I would say is a try clause
08:41:04keebusyes, 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:22reactormonklet me follow a bit more
08:42:57reactormonkkeebus, I don't see anything else
08:43:13keebusI'll have to run a quick test and see what happens
08:43:23keebusthen study the generated C output
08:44:09reactormonkuse -d:release, make generated code more readable
08:44:29keebusthank yu
08:44:32keebusyou*
08:54:10keebusreactormonk: sorry to bother you, one last question. Does nimrod support destructors?
08:57:05reactormonkkeebus, I think there has been discussion on that
08:57:13reactormonkkeebus, btw, what did you find?
08:57:25keebuswell I need to be able to write a destructor
08:57:30keebusotherwise my whole question does not stand :)
08:57:44keebusthe point is that when an exception is thrown
08:57:55reactormonkkeebus, https://github.com/Araq/Nimrod/issues/408
08:58:39keebusnew(result, finalizer)?
08:58:42reactormonkso you have the {.destruct.} pragma, but it's not guaranteed to work
08:58:45reactormonkyeah
08:58:53reactormonkhttps://github.com/Araq/Nimrod/search?q=destructor&ref=cmdform&type=Issues
08:59:19keebusI can see there are a few problems
09:00:03reactormonkwhat's your use case?
09:00:40keebussay I want to create an object that prints "HELLO" when constructed and "WORLD" when destructed
09:00:45keebus(destroyed)
09:00:59keebuspoint is: I want to allocate this object on the stack as a local variable
09:02:19keebusthen 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:29keebusagain, just like C++
09:06:57reactormonktry it
09:14:43keebusok
09:14:44keebusall done
09:14:56keebusalright, it does call the destructors
09:15:25keebusthe implementation though looks a bit naive
09:16:24keebusit's just issuing the call and checking some error code with an 'if'
09:16:47keebusthe "exception" propagation is basically "if (some exception occurred) { return }"
09:17:03keebusthe cost is that each function call comes with a hidden if-else statement
09:17:29keebusunfortunately C does not provide the fast zero-cost exception mechanism C++ offers
09:17:51keebusthank you anyway
09:17:56*Matthias247 joined #nimrod
09:26:34Skrylarno exception system is ever truly zero cost
09:26:36Skrylar:(
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:03dom96keebus: you can compile to C++ to get its fast exception mechanism.
10:32:20*saml_ joined #nimrod
10:38:12reactormonkdom96, how come C++ has faster exceptions than C?
10:38:19*saml_ quit (Ping timeout: 240 seconds)
10:38:34dom96reactormonk: C doesn't have native exceptions
10:39:00reactormonkin the end C is native too, isn't it?
10:39:05dom96I don't know about the reasons why the C++ exceptions cannot be emulated in C
10:39:23dom96yeah, but by native I mean the language spec includes them
10:46:07*saml_ joined #nimrod
10:46:11keebusSkrylar: compiling to C++ means you need to use the C++ compiler rather than plain C which is several times slower.
10:46:25keebussorry I meant dom96:
10:47:05dom96indeed. It's not ideal. Do you have any suggestions about how to speed up the exception handling in the C target?
10:47:25keebusSkrylar: 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:43keebuswell the funny thing is that apparently gcc supports building the .eh_frame data structure for C
10:48:49keebus(for c++ interop)
10:48:56keebusjust calling gcc -fexceptions
10:49:15keebusthe less funny thing is that apparently there's no way to use this extra data generated by the compiler from the application :(
10:49:37keebusI've been hitting my head and googling hard
10:49:45keebusto know if this is possible
10:50:21keebusdom96: you're right, there's no real reason why C++ exceptions cant be emulated in C *efficiently*.
10:50:35keebusbut apparently it's not that trivial
10:51:04reactormonkkeebus, .eh_frame ?
10:51:43reactormonkkeebus, 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:06keebusthe 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:32reactormonkkeebus, so you want an implicit try/catch block?
11:04:59keebuswhat do you mean by implicit?
11:05:13reactormonkkeebus, try/finally, to be correct.
11:05:17keebusyes
11:05:31keebusbut again, efficiently :)
11:06:14reactormonkyou're gonna cross that piece of code anyway, either you're returning or you're jumping over it
11:06:30keebusthat is fine
11:06:44keebusthe problem is doing this bunch of work ONLY when an exception is thrown
11:06:58reactormonkyou could attach it to the current safe point
11:06:59keebusand keeping the overhead over normal execution as minimal as possible
11:07:04keebusthat's costly
11:07:22reactormonkwhat would be efficient?
11:07:50keebuswell truly efficient would be no code at all injected in your function and based on compile time tables only (the .eh_frame)
11:08:01keebusthat's what C++ does...
11:08:14keebuswe can't do that, at least, i have no idea of how to do that in plain C
11:08:43reactormonkgive me a benchmark where c++ is faster before we start theorycrafting.
11:08:47keebuswhat we should strive for is having the smallest code injection for exc handling possible
11:09:22keebusno need for it, just search zero-cost exception versus SJLJ
11:09:56keebusthe disassembly of a C++ function does not contain any instructions generated by the compiler to handle exceptions
11:10:03keebuszero
11:10:32keebusthe hard work is only done when you throw an exception.
11:10:37reactormonkmake 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:05reactormonk... editing excpt.nim would include kicking the exception logic.
11:11:17keebusnimrod uses setjmp to handle exception reactormonk , ive been using this technique for a long time there is no magic behind it
11:11:44reactormonkkeebus, yes, I'm not questioning your logic. I just wanna see how much you could gain with zero-cost exceptions.
11:12:10reactormonkjust "emulate" them by kicking the logic out
11:12:27keebusfair enough, knowing "how slower" it is is a legit question rather than "if it is slower". :)
11:12:59reactormonkthere might even be a flag for this
11:14:18reactormonkhaven't found one
11:15:02reactormonkkeebus, 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:05reactormonkif it's 30% for the function call itself, it's a good thing. With 5% of the function call cost, well.
11:16:48reactormonkAnd 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:49Araqkeebus: 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:14VarriountMeep
13:16:13*gkoller quit (Quit: gkoller)
13:16:37*gkoller joined #nimrod
13:17:01*keebus quit (Quit: Page closed)
13:25:02Skrylarmeep
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:14flaviuHmm, it seems there are no indentation tokens
15:44:11Araqhmm, it seems this is very well covered in the manual
15:45:51Araqhow 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:31flaviuI 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:10superfuncsup everyone
16:16:10*hoverbear joined #nimrod
16:20:42dom96hey superfunc
16:20:52superfunchow did the final exams turn out?
16:24:10dom96Well I think. I won't get the results until August though.
16:25:35superfuncright 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:17dom96superfunc: What kinds of improvements do you have in mind?
16:28:26flyxare there some more infos about macros than what's written in the manual?
16:28:38flyxit isn't very much
16:28:51dom96superfunc: I'm just curious, all improvements are of course welcome.
16:29:19dom96superfunc: A thing to keep in mind though is that filwit is working on improving the docs too, look-wise.
16:29:42dom96flyx: http://build.nimrod-lang.org/docs/macros.html
16:29:53dom96flyx: https://nimrod-by-example.github.io/oop_macro/
16:30:08dom96flyx: http://build.nimrod-lang.org/docs/tut2.html#macros
16:30:31superfuncThat's good, I'm more concerned with content. First, everything in the libraries shouls contain a plausible example.
16:31:26superfuncNext, 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:42superfuncI 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:04dom96indeed. And you should contribute to flaviu's nimrod-by-example
16:36:03superfuncThat 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:29superfuncMost people learn much better from something like nim-by-example.
16:38:23flyxdom96: thanks. is there a way to define variables that are only available at compile time, in macros?
16:41:04superfuncflaviu: Are you ok with your nimrod-by-example being featured on the reddit page?
16:41:04dom96flyx: What's the use case? Hygiene? If so you can use macros.genSym for that.
16:41:26dom96superfunc: perhaps we should add more examples before redditing it
16:42:24superfuncI meant as a link on the sidebar
16:42:36superfuncrather than a featured post
16:43:23flyxdom96: 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:30flaviusuperfunc: I'd rather you not do that yet, since its pretty empty right now.
17:08:20flaviuBecaues I'm sure someone will see it and post it to r/programming, which I don't want to happen yet
17:09:32superfuncthat's fair enough
17:10:34*BitPuffin quit (Ping timeout: 244 seconds)
17:11:35superfuncOne 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:14superfuncit was the enums page
17:17:22*nahamu joined #nimrod
17:18:08nahamuHi, I was building Nimrod on a Solaris variant (SmartOS) and ran into two issues:
17:19:03nahamuI 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:49nahamu1) 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:28nahamu2) 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:57nahamuI couldn't find known issues on github... Should I open a pull request for #1 and a ticket for #2?
17:21:56nahamu0) I had to use the oldest commit in c-sources in order to bootstrap myself. The newest one failed for me...
17:25:08dom96hello 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:01flaviusuperfunc: 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:26nahamudom96: if you have any ideas of where to look in the code to fix #2, any pointers would be appreciated.
17:38:04nahamuI'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:45nahamuI'm assuming #0 would be fixed by a regeneration of the c-sources after I've fixed #1 and #2.
17:39:14dom96nahamu: could you gist the output of koch?
17:39:41superfuncflaviu: No worries. If I knew a darn thing about web programming I'd help with that
17:43:04nahamudom96: 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:38dom96nahamu: both I guess. I'm not entirely sure what happens so all output would be helpful.
17:44:59nahamuwill do, one moment
17:45:00dom96Perhaps 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:09nahamuhttp://us-east.manta.joyent.com/nahamu/public/nimrod/koch-run1 and http://us-east.manta.joyent.com/nahamu/public/nimrod/koch-run2
17:48:54flyxhm. can I declare an alias for a type without defining a new type?
17:49:04flyxlike, a short name for a complex TTable instance?
17:49:47flaviuflyx: type MyTableType = TTable[Foo[Foobulator, Barinator], string]
17:50:03flyxflaviu: that doesn't work, it declares a new type
17:50:12flyxflaviu: I cannot use initTable with that one
17:54:10dom96nahamu: 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:25dom96nahamu: hrm, although maybe the compiler uses execCmd to execute gcc
17:56:01dom96nahamu: That seems more likely. In that case you will have to delve into its implementation.
17:57:17superfunchas anyone ever thought about adding a match statement into the language?
17:57:43superfuncAlthough I'm sure it could be done with a macro
17:58:00dom96yes, I started writing a macro but I hit a bug in the compiler.
17:58:31superfuncAh, so once that gets cleared up, it may make it in?
18:00:37dom96That's up to Araq.
18:00:54JehanIIsuperfunc: The bigger question is: What does a match statement buy you in Nimrod?
18:00:55superfuncIts probably the one syntactic thing I miss from Ocaml lol
18:01:16*nande joined #nimrod
18:01:33superfuncThe only thing I could argue it buys you is clarity
18:01:43superfuncThough case statements are pretty clear as is
18:02:06JehanIIYeah, that's pretty much it.
18:02:20flaviuWhat 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:30flaviuTo specify that I only want a variant with a certain type for a given function
18:03:46superfuncagreed. I hit a snag with that myself
18:05:48*shevy joined #nimrod
18:05:51JehanIIflaviu: That could be made part of the case statement, too.
18:06:37JehanIIThe benefit of match vs. case is more about how much object deconstruction buys you.
18:06:46*Stefan joined #nimrod
18:06:57flaviu`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:03JehanIIflaviu: 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:02flaviuYep, that's pretty much what I was thinking
18:14:01JehanIIflaviu: 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:08superfuncCouldn't you say a switch/case does the same thing?
18:15:25*nande quit (Remote host closed the connection)
18:16:14JehanIIsuperfunc: 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:51Stefanquit
18:17:55flaviuJehan_: Not necessarily. For a list, a:b isn't implementation dependent, it is abstraction dependent, as it should be.
18:18:03superfuncYes, if you are using it to destructure something
18:18:14*Stefan left #nimrod (#nimrod)
18:18:18Jehan_Let's say I do the following in OCaml: type t = A of int | B of float * int
18:18:21superfuncBut if you use it at the same level people are using a switch construct, I don't think it hurts
18:18:45Jehan_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:12Jehan_Worse, if I have B of int * int instead, then I may overlook the two parameters being mixed up.
18:19:22superfuncMaybe we're thinking of it in two different contexts. I was thinking of matching on values, not types.
18:19:56flaviuJehan_: What is A*B called?
18:20:10Jehan_flaviu: Que?
18:20:24flaviuint*int
18:20:37flaviufloat * int, etc
18:21:17Jehan_What do you mean by "is … called"?
18:21:33flaviuIs there a term I can google to explain that syntax?
18:22:11Jehan_That's an algebraic data type, where the A variant is an int and the B variant is a pair (float, int)
18:22:57flaviuOh, `*` is just a fancy way of saying pair
18:23:35superfuncYeah, just google product type and sum types for that stuff
18:24:56superfuncBoth fall under the category of alg. data types
18:25:09flaviuI tried "ocaml multiply types", but it turned up nothing
18:25:53Jehan_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:54flaviuBut on the other hand, there isn't any better way to deal with tree-like structures than match.
18:27:10Jehan_There isn't?
18:27:25Jehan_Try match with a B-tree. :)
18:28:21superfunchttp://ocaml.org/learn/tutorials/data_types_and_matching.html#Variantsqualifiedunionsandenums
18:28:23Jehan_Fundamentally, match is a typecase statement with a let on each branch for the constituent elements.
18:28:30superfuncyou may find that useful flaviu
18:29:13flaviuI got it, thanks anyway
18:29:24superfuncB-trees were the bain of my existence one semester long ago
18:30:45*nande joined #nimrod
18:38:57Jehan_Oh my god, the US Supreme Court ruled 9:0 against software patents.
18:40:14Jehan_I'd break out the champagne, except that I can't stand alcohol.
18:40:35flyxhm. 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:24flaviuflyx: Can you post your code? It works for me
18:44:23flyxflaviu: just figured it out. when I call "macroName:", I get the error, when I call "macroName foo:", it works
18:44:32flyxbut that should be the head, not the body. why does it cause a segfault when displaying the body?
18:44:52flyxis a statement macro required to have contents after the macro name besides its children?
18:48:09EXetoCJehan_: no more of those? win
18:48:15flaviuflyx: Seems to be macro weirdness, when head is missing, the body moves into head's spot
18:48:42flaviuflyx: ie `echo treeRepr(head)` prints body's contents
18:49:16superfuncyay common sense prevails one time
18:49:59flyxflaviu: um, okay o.O
18:50:11flyxflaviu: is there a way to check that inside the macro?
18:51:15EXetoCcheck what?
18:51:41Jehan_EXetoC: Doesn't mean "no more of those", but it made it a LOT harder to secure patentability for one.
18:51:54EXetoCrepr is useful when debugging nodes
18:51:56EXetoCright
18:52:33Jehan_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:01Jehan_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:18flaviuflyx: 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:12flyxflaviu: hm okay thanks
19:07:28superfuncIs there a way to forward args to GCC?
19:08:06Araqsuperfunc: --passC and --passL
19:08:21superfuncAraq: Thanks :)
19:09:25flaviusuperfunc: 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:33Jehan_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:35Jehan_ assigning to 'NCSTRING' (aka 'char *') from incompatible type
19:15:35Jehan_ 'const char *'
19:15:35Jehan_ LOC18 = gai_strerror(gairesult_157608);
19:15:35Jehan_ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19:16:50superfuncflaviu: my bad, I just wasn't seeing it at first
19:17:34Jehan_Can be made to compile with "--passC:-Dconst=", but that's probably a less than ideal solution.
19:21:04flaviusuperfunc: Not a problem, just pointing to that page in case you hadn't found it.
19:27:04superfuncHmm, 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:50flaviusuperfunc: I've updated the enums page and would appreciate feedback
19:28:51superfuncsure, lemme go take a look
19:31:55*EXetoC joined #nimrod
19:32:19superfuncflaviu: I think that is much cleaner
19:32:43superfuncIt reads a bit more naturally to me, to read-code, then read an explanation
19:33:22Jehan_flaviu: The last sentence of the paragraph after the first piece of code seems incomplete?
19:34:22flyxhm 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:24flyxcan I use PNimrodNode only in macros?
19:34:56flaviuJehan_: Thanks, fixed
19:35:27Jehan_I think I'd like a {.pure.} pragma for imports as well as for enums.
19:35:37Jehan_Rather than having to do `from foo import nil`.
19:35:47Jehan_It's strangely non-orthogonal.
19:36:51flaviuOr maybe turn things around: `from a import *`, `import a`
19:37:10flaviu`import a` would require qualification
19:37:23Jehan_flaviu: That would break too much existing code.
19:37:43EXetoCthe former would end up everywhere though
19:37:52Jehan_Generally, I don't have a problem with the default. Python doesn't do it by default because it's dynamically typed.
19:37:52superfuncflaviu: 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:12Jehan_In Nimrod, if you have ambiguities as a result, you get a compile time error, so usually less of a problem.
19:38:29Jehan_But sometimes it's nice not to pollute the main namespace.
19:38:31flaviuJehan_: Skip 1.0, go straight to 2.0 :P
19:39:07Jehan_flaviu: You mean to get all the benefits of the Python 2->3 transition at once? :)
19:39:11flaviusuperfunc: I'm not sure what you mean
19:39:44Jehan_flaviu: I think Haskell does this pretty much right.
19:39:53flaviuBut isn't one of the features of the Nimrod AST source-to-source translations? Tooling would be almost trivial to implement.
19:39:58superfuncflaviu: the value for Blue is left-aligned, I just thought it would be cleaner to have it align with Red
19:40:09Jehan_import vs. import qualified
19:41:44*shodan45 joined #nimrod
19:53:05superfuncOk, I got it to statically build in everything outside of some linux essentials like libc
19:57:46flaviusuperfunc: 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:16Jehan_flaviu: Your `result` section should probably initialized `result` with 1 for the `**` example.
20:02:23Jehan_initialize*
20:03:46flaviuThanks, fixed
20:05:01flyxflaviu: hm, the proper thing to do the macro parameter handling seems to use openarray[stmt]
20:05:43flyxbut 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:49dom96flyx: macro foo(x: openarray[stmt], body: stmt) may work
20:09:09flyxdom96: will try that
20:09:44dom96hrm.
20:15:37EXetoCsrc/glib2.nim:77: guint16* = int16
20:16:48EXetoCbug 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:22nahamudom96: is it just me or is "waitForSingleObject" only defined under Windows...?
20:46:47dom96nahamu: possibly
20:47:13nahamuwaitForExit appears to be implemented using it.
20:47:19nahamuthat might explain my issue.
20:48:34nahamunevermind, I was probably looking at the wrong definition in the other file
20:48:38nahamuignore 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:30DemosAnyone know if the OpenGL package provides a way to check if an extension is supported?
21:33:12flyxDemos: the basic way - glGetIntegerv with GL_NUM_EXTENSIONS, followed by looping over them with glGetString and GL_EXTENSIONS - should work
21:33:13flyx*glGetStringi
21:34:00flyxit would probably be wise to stuff them into a TSet once and use that for all tests.
21:34:19Demosright, 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:48DemosI was just wondering if OpenGL.nim had variables that it set up for each extension
21:36:55flyxI'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:59flyxthe platform-specific APIs are usually just for getting the function pointers to certain OpenGL functions
21:39:39*Johz quit (Quit: Leaving)
21:39:55flyxyou can of course use that and check if it returns nil. but it would be very platform-dependent
21:42:14flyxOpenGL just isn't very modern
21:42:31flyxno 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:14Skrylaruh
22:17:21Skrylarmust be an old opengl then
22:17:38Skrylarthey've had the fully shader pipeline for a while
22:18:22Skrylarthe only thing more 'modern' than the GL3.1 Core and GL4 versions are the prototype interfaces for raw hardware access
22:20:06Skrylarbut 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:19Araqh Dingba welcome
23:05:42Dingbahi
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:24shodan45I used to love pascal when I was a kid
23:19:08Skrylari still like pascal
23:19:16Skrylarnimrod 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:03Araqgood night
23:24:52*darkf joined #nimrod
23:30:16Dingbaso nimrod is awesome right?
23:31:33Dingbawhats the best editor for nimrod right now?
23:32:05reactormonkDingba, there's aporia for nimrod, I'm tinkering on nimrod-mode for emacs, zahary has a vim plugin for it
23:34:15Dingbai'll try aporia..so many build steps
23:41:25Dingbaaporia says that I should find a pcre.dll in nimrod repo under the "dist" directory, but there is no "dist" directory
23:41:48Dingbanot does my nimrod have a pcre.dll anywhere, although it does have a pcre.nim
23:42:36Dingbaa binary download of aporia would probably be a good idea--
23:46:57OrionPKDingba right now sublimetext is the best editor for nimrod
23:47:00OrionPKusing the NimLime plugin
23:47:09OrionPKhttps://github.com/Varriount/NimLime
23:49:04flaviuDingba: How about kate? Although it looks like crap on Windows IIRC
23:52:19Dingbaya i'm on windows :0, never tried kate before
23:52:30DingbaI got sublime
23:53:02Dingbanot sure if I properly activated NimLime, it seems to do some syntax hightlighting but not really anything else?
23:54:45DingbaLike when i do this
23:54:52Dingbavar DudeBro = "wtf" import math math.d
23:55:07Dingbait brings up DudeBro and "wtf" as possible options
23:55:07*superfunc quit (Read error: Connection reset by peer)
23:55:09Dingbawhich makes no sense..
23:55:24Dingbaand doesn't show anything from math i think
23:55:55flaviuDingba: Yeah, smart autocompletion is not a feature of anything but aporia.
23:56:55Dingbaso i need to get aporia working :0 gotcha
23:57:23flaviuIt 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:12EXetoCnimrod.vim uses idetools
23:59:46flaviuEXetoC: Really? I haven't been able to set it up to autocomplete well.