00:00:26 | Araq | proc foo(x: cstring) {.importc: "FooA".} # generated by macro |
00:00:26 | Araq | proc foo(x: WideCstring) {.importc: "FooW".} # generated by macro |
00:00:53 | Araq | proc `$?`(x: string): WideCString | cstring # you get the idea |
00:01:07 | Araq | foo($?"hi") # depends on setting |
00:01:22 | Araq | foo(newWideCString"hi") # call W version |
00:01:35 | Araq | foo(cstring"hi") # call A version |
00:01:45 | * | dmac joined #nimrod |
00:02:15 | Araq | it's the best solution I can come up with and eventually you will agree :P |
00:03:13 | Varriount | Araq: Yeah, I see. I just thought that it might be better to just provide a version of the proc that calls '$?' for you. :/ |
00:05:24 | Varriount | Also, I already have the entire macro made. |
00:05:45 | Araq | fine then have 3 |
00:12:58 | Varriount | Sorry if I made you angry. I'll use your solution since, looking at it, it allows one to intermingle string types in a single procedure. |
00:16:00 | Araq | no, you didn't make me angry |
00:16:15 | Araq | it's fine to keep what already works |
00:16:36 | * | foxcub quit (Quit: foxcub) |
00:33:22 | Varriount | Anyone know if the tester runs the standard library modules? I know that at least some of them have unit tests for their exported api's |
00:36:00 | Araq | the tester should now do that, have a look |
00:36:08 | Araq | the old tester doesn't |
00:37:09 | Varriount | Oh goodie! *hugs testament.nim* |
00:43:51 | * | odc quit (Ping timeout: 252 seconds) |
01:17:28 | * | foxcub joined #nimrod |
01:18:01 | foxcub | Suppose I have proc f[T](x: T) |
01:18:08 | foxcub | Then I define proc f(x: int) |
01:18:24 | foxcub | And now I'd like to call f[T] from f. Is there a way to do that? |
01:19:01 | * | jcrubino quit (Ping timeout: 248 seconds) |
01:24:08 | Varriount | foxcub: Explicit generic instantiation? |
01:24:21 | foxcub | Yes. |
01:25:47 | Varriount | foxcub: That was my guess. Use explicit generic type parameters. "f[T](varOfTypeT)" |
01:26:05 | foxcub | varOfType is still int. |
01:26:09 | foxcub | That's the sort of the catch. |
01:26:19 | foxcub | I want to do some preprocessing on x, but then I want to call the generic function. |
01:26:36 | Varriount | foxcub: That's why you put the [T] |
01:26:42 | foxcub | Or more accurately I want to overload it, but then still call it for the heavy lifting. |
01:26:47 | foxcub | That doesn't seem to work. |
01:27:05 | foxcub | Oh, my bad. |
01:27:09 | foxcub | It actually does. |
01:27:10 | foxcub | Magic. |
01:27:20 | foxcub | Except. |
01:27:27 | foxcub | Hm, let me check something. |
01:27:39 | LordAndrew | Should I specify the type for a variable I don't immediately set? |
01:28:05 | Varriount | LordAndrew: I believe you *have* to specify a type. |
01:28:23 | Varriount | That is, you have to if you plan to set it to something later. |
01:32:40 | foxcub | Varriount: well, I'm getting a segfault during compilation on the more complicated version of my question. |
01:32:47 | foxcub | I guess it's time to try to boil it down. |
01:49:44 | Varriount | foxcub: Have you looked at methods? |
01:50:04 | foxcub | I saw them, but dismissed them as some analog of virtual functions. |
01:50:11 | foxcub | Are they something else? |
01:51:00 | Varriount | Yes, they are virtual functions, but they provide a mechanism for run-time overriding of procedure overloading, iirc. Maybe they can be of some use? |
01:52:16 | foxcub | In my case, all these decisions ought to be made at compile time. |
01:52:24 | foxcub | The problem is not with having different types. |
01:52:47 | foxcub | The problem with calling something more general from something more specific. (As in both generic procedures match, but one is a better match.) |
01:52:56 | foxcub | I think there is a bug in compiler with a symbol lookup. |
01:53:14 | foxcub | I get segfault during compilation where there shouldn't be one. I just need to find a decent workaround. |
01:53:26 | Varriount | Maybe you can change the symbols to have different identifiers, and unify them with a template somehow? |
01:53:51 | Varriount | Or use them as qualified identifiers? |
01:54:30 | foxcub | The trouble, roughly, seems to be that if a name is defined in module B (that imports module A and overloads the name from there), you can't look it up in A without a segfault. |
01:54:32 | foxcub | Something like that. |
01:55:17 | Varriount | foxcub: Not even by using an explicit name, eg, moduleA.foo? |
01:55:24 | foxcub | Nope |
01:55:28 | foxcub | That gives a segfault. |
01:55:36 | foxcub | It might be subtler than that. |
01:55:41 | foxcub | I'm not quite done "boiling." |
01:55:41 | Varriount | foxcub: There is one other way I can think of. |
01:55:49 | foxcub | Shoot. |
01:55:55 | Varriount | Use an include statemet |
01:55:59 | Varriount | *statement |
01:56:18 | Varriount | It's the equivalent of a C include directive |
01:57:02 | foxcub | Well, the module I'm trying to use is tables, provided with nimrod. Something tells me I shouldn't be just including it. |
01:58:57 | Varriount | foxcub: What OS are you running? |
01:59:18 | foxcub | Mac. My example with modules A and B is too simple. It works there. |
01:59:26 | foxcub | I need to figure out how exactly it breaks. |
02:00:08 | Varriount | foxcub: If you want, you could recompile the compiler with debug information. Then, when is segfaults, you should be able to get some internal information back |
02:00:26 | Varriount | It might not be very useful to you, but I'm interested in seeing what's breaking. |
02:00:57 | Varriount | 'koch boot --debuginfo --linedir:on' |
02:02:24 | Varriount | foxcub: You could also try using procedures with typedef parameters, instead of generic parameters. |
02:02:35 | foxcub | Explain the last bit. |
02:02:44 | foxcub | I might try adding debugging information to the compiler, but not tonight. |
02:03:08 | Varriount | Generic Proc -> proc foo[T](x: T): T = ... |
02:03:38 | Varriount | Proc with typedef params -> proc foo(T: typedef, x:T): T = ... |
02:04:08 | * | xenagi joined #nimrod |
02:04:45 | Varriount | The downside to using typedef params is that you can't explicitly instanciate the procedure at one point in the code, and use at another point (like for closures) |
02:04:48 | Varriount | Hi xenagi |
02:05:34 | foxcub | I see. |
02:05:55 | foxcub | Yeah, this seems more complicated than what I need. |
02:06:07 | foxcub | But thanks for the pointers. |
02:06:18 | xenagi | hi |
02:08:11 | Varriount | foxcub: I should thank you, you're giving the nimrod compiler's generic handling code a real stress test. |
02:08:24 | foxcub | ;-) |
02:20:30 | foxcub | Varriount: Here's the simplest example that segfaults the compiler for me: https://gist.github.com/mrzv/8513889 |
02:23:24 | Varriount | foxcub: In case you're interested, here's the compiler stack trace -> https://gist.github.com/Varriount/8513914 |
02:24:39 | foxcub | Yeah, I'm guessing one of the developers will enjoy it more than me. :-) |
02:25:24 | Varriount | foxcub: Essentially, if you look at the bottom, you can tell that it's the procedure overload calculation code that's acting up. |
02:26:14 | foxcub | Varriount: I guess that concurs with the logic. |
02:29:51 | Varriount | The hardest part about trying to fix a bug in the compiler is that it's really hard to get a good picture of what's going on. :/ |
02:32:43 | foxcub | Well, with a small example, it should be doable. |
02:33:19 | Varriount | foxcub: By the way, did you know that, in addition to an integrated debugger and profiler (which don't work on the compiler code), nimrod also supports gdb? |
02:33:51 | Varriount | I mention this because it's one of the only sane ways to debug the compiler. |
02:33:57 | foxcub | I did not, but given that it generates C code, that's to be expected, no? |
02:34:28 | foxcub | Yeah, I haven't got to serious debugging yet. (And I hope I don't have to.) |
02:34:41 | Varriount | foxcub: I rarely do (the compiler is an exception) |
02:34:46 | foxcub | Hm, perhaps, I file a bug with the above gist. |
02:34:54 | Varriount | foxcub: Can't hurt |
02:35:18 | Varriount | foxcub: Unfortunately, I don't know how quickly it will be fixed. Again, the dev team is quite small. |
02:35:41 | foxcub | For now, I just need a good workaround. But it will be good to have it on the stack anyway. |
02:35:55 | Varriount | I'll see if it's something within my abilities to fix. Hopefully it is. |
02:36:22 | Varriount | Working with the compiler internals is akin to stepping into a room full of spinning gears and machinery. |
02:38:08 | foxcub | Varriount: thanks, and good luck. |
02:38:18 | foxcub | Time for me to go. Have a good night. |
02:38:23 | Varriount | You too. |
02:38:32 | foxcub | Oh, BTW, I've filed the bug. |
02:38:46 | foxcub | https://github.com/Araq/Nimrod/issues/827 |
02:38:59 | foxcub | For reference, in case you fix it. |
02:39:01 | foxcub | Good night. |
02:40:02 | * | foxcub quit (Quit: foxcub) |
02:50:38 | * | dmac quit (Ping timeout: 252 seconds) |
03:01:11 | wat_ | hey guys I looked at the ide for nimrod, but it looked like I would have had to figure out how to compile it instead of an installer being available, is that the case? |
03:01:54 | Varriount | wat_: No, there's a pre-packaged (at least, for windows) I don't know about linux |
03:02:11 | wat_ | oh nice, I will look again |
03:02:47 | Varriount | wat_: There's also support for some other editors, such as sublime text and emacs. |
03:02:51 | Varriount | *vim |
03:03:40 | wat_ | yeah I tried to get gvim highlighting working but it's been a few years |
03:05:55 | wat_ | the git site makes it look like I need to install a bunch of modules like gtk separately. Is there a straight installer that will work without dependencies? |
03:07:01 | Varriount | wat_: One moment, lemme find it. It's on the forums somewhere. |
03:07:16 | wat_ | thanks! |
03:07:26 | xtagon | wat_, I just installed the vim support files. Only thing I had to do was make sure vim was compiled with --enable-pythoninterp |
03:08:35 | wat_ | I installed from an installer, so I don't know how it was compiled. I just copied the .vim file into the syntax directory, although that didn't work |
03:08:46 | wat_ | I didn't put a lot into it |
03:10:19 | Varriount | wat_: http://forum.nimrod-lang.org/t/131/2 |
03:10:48 | Varriount | Look for Araq's post with the download links |
03:10:56 | Varriount | Hopefully they're still active |
03:11:37 | xtagon | wat_, the best way to do it is with pathogen. Instructions are here https://github.com/zah/nimrod.vim |
03:12:03 | xtagon | wat_, the reason dropping it into the syntax folder didn't work is because it uses more than just syntax files |
03:12:16 | * | EXetoC quit (Quit: WeeChat 0.4.2) |
03:12:25 | Varriount | Gah. I hate the fact that I can't understand what the compiler does, except in vque terms. |
03:12:37 | Varriount | Makes me feel useless. :( |
03:12:40 | wat_ | cool thanks for your help |
03:12:58 | Varriount | *compiler code does |
03:17:59 | Varriount | xtagon: How's your working coming along? |
03:18:34 | xtagon | Varriount, been doing other things. I'm just tinkering with nimrod in spare moments |
03:18:45 | Varriount | I understand. |
03:19:34 | xtagon | Question: if I import a module and only use one or two procs (or types, or whatever) will the compiled executable ignore everything else in the module that I don't need? |
03:19:50 | Varriount | xtagon: Yep. |
03:19:56 | xtagon | Awesome |
03:20:13 | Varriount | Nimrod has automatic dead code elimination (except for methods) |
03:21:38 | xtagon | That's the terminology I was looking for |
03:23:09 | xtagon | Okay, so I wrote a type for holding version numbers in a tuple[major, minor, patch: int, special: string] -- I want to take it a step further and only allow natural numbers, and validate the string for allowed characters. |
03:23:27 | xtagon | I tried changing int to natural, but then I don't know how to instantiate it with int literals |
03:23:38 | Varriount | xtagon: Like you normally would |
03:23:41 | Varriount | I think |
03:24:16 | xtagon | If I change int to natural, I get Error: type mismatch: got (tuple[int, int, int, string]) but expected 'SemVer' |
03:24:32 | xtagon | SemVer is the type name |
03:24:44 | Varriount | xtagon: May I see your code? |
03:24:48 | xtagon | Yes, one sec |
03:25:53 | xtagon | Varriount, https://gist.github.com/xtagon/167f358d8c0abc20d07f |
03:27:08 | xtagon | If you change natural to int, it will compile. |
03:33:07 | Varriount | xtagon: Odd. |
03:38:39 | Varriount | xtagon: I think it has something to do with the fact that 'natural' is a range type, while int isn't. |
03:39:00 | Varriount | Araq has complained about range types before. |
03:39:40 | Varriount | xtagon: It might also be that tuple conversion is strict. |
03:40:00 | Varriount | If you wrap each number in natural(), then it works. |
03:40:46 | xtagon | What I want is for it to validate the numbers so they are not negative, and validate the string so it only contains certain characters. Maybe a tuple isn't what I want? |
03:41:16 | * | Xuehas joined #nimrod |
03:43:01 | Varriount | Hello Xuehas |
03:43:11 | Xuehas | Hello what's happening |
03:44:23 | Varriount | Not much. I'm trying to find out why Araq and zahary1 can debug the compiler, and I can't, while also helping xtagon with intereseting stuff. |
03:44:48 | Xuehas | The compiler? What compilrr |
03:45:10 | Varriount | The nimrod compiler. |
03:46:32 | Xuehas | I thought there were more than one Nimrod compiler |
03:46:43 | Xuehas | you mean the one which is officially supported? |
03:47:06 | Varriount | Eh.. there's only one. It has multiple backends..? |
03:47:57 | Xuehas | Mkay |
03:48:23 | Varriount | xtagon: Could you file a bug report? |
03:48:57 | Varriount | This may or may not be by design, I don't know |
03:49:50 | * | skappa joined #nimrod |
03:50:13 | * | Demos joined #nimrod |
03:51:48 | Varriount | Hi Demos |
03:51:53 | Demos | Hi! |
03:52:09 | Varriount | Demos: You got my memo? |
03:52:12 | Demos | yeah |
03:52:22 | Demos | I have not tried it yet, I was doing a game jam |
03:52:42 | Varriount | According to zahary1, it's only a workaround, since it pretty much clears the entire state of the compiler. |
03:52:48 | Demos | I actually managed to hit 4+min builds on a project we made in 48 hours |
03:53:02 | Varriount | What was it written in? |
03:53:02 | Demos | Varriount, so hardly better than spawning a new process each time |
03:53:16 | Varriount | Demos: But better nonetheless. |
03:53:17 | Demos | C++ with cinder(http://libcinder.org/) |
03:53:32 | Demos | cinder includes pretty much ALL of boost in each header |
03:53:46 | Demos | and we were compileing with VS 2012 which is not a very fast compiler |
03:53:56 | Demos | we tried clang on a mac but there were bugs in cinder for mac |
03:54:07 | xtagon | Varriount, https://github.com/Araq/Nimrod/issues/828 |
03:54:22 | Varriount | xtagon: Thanks. Sorry for the disapointment. |
03:54:28 | xtagon | Varriount, no problem :) |
03:54:53 | xtagon | Demos, compiling ALL of boost takes forever... |
03:54:56 | Demos | seriously, CoD is selling kill streaks |
03:55:03 | Demos | xtagon, well it was just includeing all the headers |
03:55:09 | xtagon | Ah |
03:55:12 | Demos | the binary distribution included the libraries |
03:55:43 | Varriount | I used boost(along with a ram disk) to benchmark file deletion implementions in nimrod. |
03:55:52 | Demos | hehe |
03:56:02 | Demos | boost is so useless... I mean honestly |
03:56:21 | Demos | like filesystem and datetime are OK but depend on a huge amount of stuff |
03:56:24 | Varriount | Actually, I could only use part of boost, since it was too big to fit entirely into memory. |
03:56:40 | LordAndrew | Hrg. I am terrible at coming up with stuff to make. :| I want to learn more Nimrod but I dunno what to make. |
03:56:49 | Demos | bindings |
03:56:52 | Demos | all the bindings |
03:57:03 | Varriount | LordAndrew: Or improve a standard library module |
03:57:25 | Demos | xmltree could use a way to change the document type and encodeing |
03:57:25 | LordAndrew | I don't think I'm a skilled enough programmer to be making those sort of changes. :P |
03:57:28 | Varriount | Find gaps. Are there procedures which take chars, that should also be able to take strings? |
03:57:54 | Varriount | LordAndrew: Many parts of the stdlib are quite simple. |
03:58:15 | xtagon | LordAndrew, what would be cool is a Nimrod version of Rack (for Ruby) or WSGI (for Python) |
03:58:36 | xtagon | LordAndrew, basically a layer in between web applications and web servers so that you can use any server to serve any app |
03:59:16 | xtagon | I feel like Nimrod would be absolutely fantastic for web development, if it had more than some sinatra clones :) |
03:59:27 | Varriount | LordAndrew: Or you could do what I do, and look at python's stdlib, and find what nimrod lacks. |
03:59:51 | Varriount | For example, itertools. |
04:00:34 | Demos | speaking of iterators, nimrod needs a way to write an algorithem that is generic over any datastructure and in particular any subrange of any data structure |
04:00:51 | Demos | like we can use first class iterators but if they don't get inlined you are screwed |
04:01:10 | Varriount | Demos: explain. |
04:02:08 | Varriount | xtagon: The thing limiting nimrod right now, in terms of server/web development, is the lack of a solid asyncio lib (the current asyncio.nim doesn't count) |
04:02:47 | Demos | like if I have a sorting function I could have it take a parameter that is the container and call items, but then you need to sort the WHOLE container. And if you have an algorithm that needs to think about positions in the data structure you need to use indices, which are not ideal |
04:03:22 | * | xilo joined #nimrod |
04:03:29 | Varriount | Hello xilo |
04:03:30 | xtagon | Varriount, I don't have much experience with async IO, or I would love to help with that |
04:04:49 | Varriount | xtagon: dom96 is currently working on something -> https://github.com/Araq/Nimrod/blob/newasync/lib/pure/selectors.nim |
04:05:07 | Varriount | "Currently" being a quite broad amount of time. |
04:05:51 | wat_ | so a constructor has to initialize all variables of an object, and a new functions like newMyObject could initialize a reference, but is there a convention to do contructors for an object that will end up on the stack? |
04:07:36 | Varriount | wat_: https://github.com/Araq/Nimrod/blob/devel/doc/apis.txt |
04:08:28 | wat_ | perfect thanks |
04:08:45 | Varriount | On a side note, is today some sort of day for nicknames starting with 'x'? |
04:09:30 | wat_ | the first two tutorials I found to be really good. To get people started quick, lots of short tutorials and an easy installing ide environment are pretty big deals |
04:10:09 | Varriount | wat_: Feel free to write more tutorials. |
04:10:52 | wat_ | true true, if I get to the point where I know more than the very basics that might be a good idea to contribute |
04:11:03 | LordAndrew | Hmm. I was fiddling with a dice rolling thing but the random function's weird. I'm used to random() accepting a low and high argument and returning something between those (or low or high). |
04:11:26 | Demos | wat_, usually people write something like proc initMyObject(): MyObject = ... or initMyObject(var o: MyOvbject) = ... |
04:11:31 | LordAndrew | but i don't know how the heck you randomly generate numbers at all. or else I'd right my own. |
04:11:40 | wat_ | has anyone taken a look at clay? nimrod seems similar in some ways |
04:11:49 | Varriount | LordAndrew: Funny you should mention that. |
04:12:17 | wat_ | so init for object creation on stack, new for heap objects? |
04:12:37 | Varriount | wat_: We don't typically discern between the two. |
04:12:52 | Varriount | new for references, init for objects |
04:13:06 | Varriount | LordAndrew: A small but useful addition to winlean.nim would be Window's random number generator. |
04:13:19 | wat_ | random numbers and psuedo random numbers are not easy to make without patterns showing up and perform well, but boost's mersenne twister does a good job |
04:13:21 | Demos | wat_ or just a function that takes a var |
04:13:23 | Demos | for both |
04:13:45 | wat_ | so the difference becomes overloading returning a variable or returning a reference? |
04:13:58 | Demos | I think we should copy c++11's <random> stuff with some nimrod snytax niceness |
04:14:04 | * | skappa quit (Remote host closed the connection) |
04:14:04 | * | dankern quit (Remote host closed the connection) |
04:14:14 | Demos | wat_ you are not really overloading anything |
04:15:27 | Varriount | Just whether it returns a reference (ref) or an object |
04:16:24 | Varriount | LordAndrew: http://msdn.microsoft.com/en-us/library/aa379942(v=vs.85).aspx |
04:16:50 | Varriount | The service provider can be retrieved by a simple api call |
04:17:15 | * | jdp_ joined #nimrod |
04:18:00 | LordAndrew | random() apparently calls C's rand() function internally? |
04:18:07 | Varriount | LordAndrew: Yes. |
04:19:25 | Varriount | The branches on github also have a mersenne twister implementation, but I don't think either is cryptographically secure. |
04:20:21 | Varriount | Hi jdp_ |
04:20:24 | Demos | yeah, but the mt is much more random than rand() |
04:20:37 | * | jdp_ quit (Client Quit) |
04:20:45 | Varriount | Bye jdp_ |
04:21:17 | Varriount | Demos: But not random enough! http://xkcd.com/1210/ |
04:22:40 | Demos | tehehe |
04:28:39 | wat_ | mersenne twister in my high dimensional monte carlo sampling tests were impressively random. C rand() had obvious patterns |
04:30:40 | * | dmac` joined #nimrod |
04:33:09 | Demos | mts are almost totally random afaik |
04:33:21 | Demos | with the proper seed values ofc |
04:33:44 | Varriount | mts? |
04:33:55 | Demos | mersenne twisters |
04:33:56 | Demos | sorry |
04:44:50 | Varriount | Demos: Do you know of any bugs regarding iterators and break statements? |
04:45:23 | Demos | no, do they exist? |
04:45:56 | Varriount | Demos: I'm implementing a new split() proc for string, which takes a string as a seperator |
04:46:12 | Varriount | The proc is an iterator |
04:46:14 | Demos | I am sure I saw that around somewhere |
04:46:16 | Demos | oh |
04:46:27 | Demos | there is totally a split proc that takes a string |
04:46:32 | Demos | strutils or os I think |
04:46:37 | Demos | probably strutils |
04:46:40 | Varriount | Demos: Nope. not in strutils |
04:46:49 | Varriount | And why would it be in os? |
04:47:11 | Demos | no idea |
04:47:14 | Demos | there is a join function |
04:47:17 | Varriount | Demos: There's one in re.nim, but that depends on pcre.dll |
04:47:19 | Demos | that takes a string seperator |
04:47:45 | Varriount | in my test, I have a limit variable that limits how many times the iterator can run. If I use it, I get a compiler error about break statements |
04:48:38 | Demos | no idea. the compiler transforms the iterator into a while statement, is the error still around if you do the transformation yourself? |
04:49:38 | Varriount | Lemme check. Here's the two pieces of code: https://gist.github.com/Varriount/8514991 |
04:50:43 | Demos | I am not going to actually run any code right now. I have been coding nonstop for the past 48h sans sleep |
04:50:55 | Demos | well I got sleep, I was not coding while I was sleeping |
04:51:00 | Demos | that I know of. |
04:51:20 | Varriount | I understand. I get "internal error: no loop to break" |
04:51:30 | Varriount | Demos: Sleep-Coding? |
05:02:05 | * | Xuehas quit (Ping timeout: 252 seconds) |
05:02:43 | * | LordAndrew quit (Quit: Page closed) |
05:02:52 | * | xilo quit (Read error: Connection reset by peer) |
05:41:47 | Varriount | zahary1: I think I just found an excellent use for typeclasses |
05:57:22 | renesac | "Error: type mismatch: got (seq[typedesc[int]]) but expected 'seq[int]'" |
05:57:28 | renesac | the line pointed: "result = newseq[int](max)" |
05:58:40 | renesac | I don't know what I'm doing wrong here, but maybe I'm just too sleepy |
05:59:29 | * | renesac is now known as renesac|Away |
06:01:41 | * | xenagi quit (Quit: Leaving) |
06:12:57 | xtagon | Can you write Nimrod wrappers for C++ libraries, or only C? |
06:18:42 | * | brson joined #nimrod |
06:22:55 | Demos | both, C is "cleaner" |
06:23:23 | Demos | c2nim can use emit to do a dirty wrapper than make nimrod functions that call into it |
06:23:29 | * | dmac` quit (Ping timeout: 252 seconds) |
06:23:33 | Demos | not sure how well it works though |
06:38:46 | * | wat_ quit (Quit: Page closed) |
06:49:04 | * | xtagon quit (Quit: Leaving) |
07:24:59 | * | Demos quit (Read error: Connection reset by peer) |
07:32:15 | * | Demos joined #nimrod |
07:34:34 | * | isenmann joined #nimrod |
07:39:19 | Demos | what do I do if I want to put the quasi-quote operator in a """""" literal? |
07:54:43 | Demos | https://gist.github.com/barcharcraz/8516498 is segfaulting the compiler |
07:56:52 | * | brson quit (Quit: leaving) |
08:06:25 | * | odc joined #nimrod |
08:06:53 | * | Demos quit (Ping timeout: 252 seconds) |
08:08:27 | * | Araq_ joined #nimrod |
09:33:04 | * | CarpNet joined #nimrod |
09:53:37 | * | radsoc joined #nimrod |
10:04:04 | * | faassen joined #nimrod |
10:07:37 | * | faassen left #nimrod (#nimrod) |
10:23:52 | * | faassen joined #nimrod |
10:48:26 | * | Araq_ quit (Quit: ChatZilla 0.9.90.1 [Firefox 26.0/20131205075310]) |
12:00:59 | * | ddl_smurf quit (Quit: ddl_smurf) |
12:19:35 | * | EXetoC joined #nimrod |
13:07:27 | * | [1]Endy joined #nimrod |
13:23:52 | * | Kooda joined #nimrod |
13:32:51 | NimBot | Araq/Nimrod devel 27b6967 Zahary Karadjov [+0 ±1 -0]: fix the segfault in #827 |
13:33:27 | * | darkf quit (Quit: Leaving) |
13:40:08 | * | Trixar_za quit (Ping timeout: 245 seconds) |
13:42:48 | * | Trixar_za joined #nimrod |
14:24:10 | * | [2]Endy joined #nimrod |
14:27:57 | * | [1]Endy quit (Ping timeout: 272 seconds) |
14:55:04 | * | BitPuffin joined #nimrod |
15:55:06 | OrionPK | ok, someone tell me why i'm dumb |
15:55:06 | OrionPK | https://gist.github.com/onionhammer/8522655 |
16:11:57 | OrionPK | no takers? |
16:12:21 | dom96 | Works for me? |
16:18:31 | OrionPK | really |
16:18:34 | OrionPK | what OS? |
16:18:39 | dom96 | Windows |
16:18:41 | OrionPK | whats your output? |
16:18:50 | dom96 | "12: hello world!" |
16:19:59 | OrionPK | I added a comment w/ the desired output |
16:20:03 | OrionPK | https://gist.github.com/onionhammer/8522655 |
16:22:22 | discoloda | i get your desired output |
16:24:25 | OrionPK | OS? |
16:24:32 | Kooda | Same here. |
16:24:33 | dom96 | hrm, interesting. |
16:24:40 | OrionPK | I get a bunch of garbage :\ |
16:25:12 | OrionPK | updated w/ my output |
16:25:17 | dom96 | OrionPK: Same, Aporia didn't print the garbage though so I didn't notice. |
16:25:29 | OrionPK | yeah |
16:25:30 | Kooda | :o |
16:26:17 | discoloda | Linux |
16:26:20 | OrionPK | well, i'm sure araq will know what's up and i probably did something wrong :) |
16:26:21 | dom96 | The problem is the calling convention |
16:26:30 | dom96 | add 'cdecl' to putBack |
16:26:35 | dom96 | and then it works |
16:26:36 | OrionPK | mmk |
16:26:49 | OrionPK | ahh! |
16:26:54 | OrionPK | that's perfect, thanks dom |
16:26:59 | dom96 | np :) |
16:27:02 | Kooda | What is cdecl exactly? |
16:27:12 | OrionPK | exportc isn't good enough :P |
16:27:22 | discoloda | a function call convension |
16:27:31 | dom96 | "The cdecl convention means that a procedure shall use the same convention as the C compiler." |
16:28:17 | OrionPK | good grief |
16:28:21 | * | BitPuffin quit (Ping timeout: 248 seconds) |
16:28:24 | OrionPK | glad that's resolved ;D |
16:29:05 | OrionPK | I'm writing a high level http server wrapper w/ libuv |
16:29:25 | dom96 | cool |
16:30:08 | OrionPK | it'll have to do until your asyncio stuff is done :P |
16:32:39 | dom96 | If only Windows would cooperate... |
16:33:43 | OrionPK | libuv has IOCP support for windows |
16:47:58 | * | BitPuffin joined #nimrod |
16:50:44 | BitPuffin | Araq: has any of the new concurrency stuff been implemented yet? |
16:50:51 | BitPuffin | I'm gonna code like crazy tonight and it would be nice if I could write things the correct way |
16:50:57 | BitPuffin | even if it doesn't do everything yet |
16:51:07 | BitPuffin | like saying the shared stuff or whatever it was again |
16:51:30 | dom96 | BitPuffin: Dude, you wanna play Dota? |
16:51:45 | BitPuffin | dom96: no |
16:51:49 | BitPuffin | dom96: well I do |
16:51:54 | BitPuffin | dom96: but you know, work :D |
16:52:03 | dom96 | hehe, i'm kidding anyway. |
16:52:13 | BitPuffin | don't joke about dota 2. |
16:52:23 | dom96 | TF2 is where it's at |
16:53:25 | BitPuffin | nop |
16:53:30 | BitPuffin | anyway brb |
16:58:11 | * | BitPuffin quit (Ping timeout: 252 seconds) |
17:01:08 | * | ringil joined #nimrod |
17:04:40 | * | Demos joined #nimrod |
17:08:21 | * | snippy quit (Ping timeout: 248 seconds) |
17:09:57 | * | ringil quit (Ping timeout: 248 seconds) |
17:24:30 | * | brson joined #nimrod |
18:13:51 | * | CarpNet quit (Quit: Leaving) |
18:14:24 | * | BitPuffin joined #nimrod |
18:17:06 | Araq | ping zahary1 |
18:17:27 | BitPuffin | back |
18:17:35 | BitPuffin | Araq: what's the answer to my question :D |
18:17:57 | Araq | BitPuffin: nothing has been implemented yet, I have a working prototype for 'spawn' though |
18:18:08 | BitPuffin | Araq: ah, so keywords haven't been added yet? |
18:18:26 | Araq | "shared" has been a keyword since 0.9.2 iirc |
18:18:30 | BitPuffin | ah |
18:18:33 | BitPuffin | well what about lock: |
18:19:09 | Araq | lock is only a macro anyway |
18:20:22 | BitPuffin | is it implemented? |
18:20:27 | * | DAddYE joined #nimrod |
18:22:13 | Araq | no |
18:22:19 | Araq | hi DAddYE |
18:22:33 | BitPuffin | too bad |
18:22:38 | BitPuffin | gonna use old concurrency or something then |
18:22:43 | BitPuffin | which is fine |
18:22:48 | BitPuffin | I might migrate later on |
18:23:56 | Demos | Hey Araq, I noticed you mentioned on reddit that dependent types were in the works for Nimrod... is this true? since when? is this just a "that would be neat sometime thing" or do we know it is possible and feasable to implement them? |
18:24:04 | dom96 | BitPuffin: template lock(lock: expr, body: stmt): stmt = Acquire(lock); body; Release(lock) |
18:24:19 | dom96 | well, probably a good idea not to name the param 'lock' also heh |
18:24:58 | dom96 | BitPuffin: Anyway, use that and then you can migrate easily to the new locks. |
18:25:41 | Araq | Demos: we have the basics for the technology, an inference engine, but proper dependent typing won't come before 2.0 |
18:26:37 | Demos | yeah, that is what I figured. dependent types in a "useful" langauge seems to be something of a research problem :D |
18:27:53 | Araq | dunno, at least proving array bounds at compile time is entirely feasible and might even come soon after 1.0 is out |
18:28:27 | BitPuffin | dom96: I think we should have something like that in place so that people can use it until it's officially implemented. And put like a big warning that "this is all it does blabla, stay tuned for more safety blabla" |
18:29:17 | dom96 | BitPuffin: I think we should make it a requirement for anyone suggesting trivial things like this to implement said things and create a PR :P |
18:29:25 | BitPuffin | dom96: shh |
18:29:27 | BitPuffin | I'm busy |
18:32:35 | * | OrionPK quit (Remote host closed the connection) |
18:33:13 | * | OrionPK joined #nimrod |
18:37:39 | dom96 | BitPuffin: Playing dota? :P |
18:37:43 | Araq | BitPuffin: my blog post also implicitly describes how the current concurrency model works :P |
18:39:46 | * | brson quit (Quit: leaving) |
18:40:05 | BitPuffin | Araq: :) |
18:40:08 | BitPuffin | dom96: no xD |
18:40:12 | BitPuffin | dom96: I'm at a hackathon thingy |
18:40:19 | BitPuffin | socializing |
18:40:21 | dom96 | BitPuffin: ooh |
18:40:21 | BitPuffin | ...on irc? :) |
18:40:23 | * | brson joined #nimrod |
18:40:30 | dom96 | BitPuffin: Sounds like fun. |
18:40:33 | BitPuffin | yaman |
18:40:39 | BitPuffin | EXetoC: THE GLFW BINDING IS BROKEN |
18:40:44 | BitPuffin | EXetoC: RAAAAAHHH!! |
18:40:51 | dom96 | BitPuffin: So you're being a nice nimrod programmer and coding in nimrod at the hackathon:? |
18:41:06 | BitPuffin | dom96: hell yeah |
18:41:06 | EXetoC | BitPuffin: I'll test it. Haven't used it in some time |
18:41:12 | BitPuffin | EXetoC: no it's just that |
18:41:14 | dom96 | BitPuffin: good boy |
18:41:18 | BitPuffin | it should be libglfw.dylib on mac |
18:41:21 | dom96 | BitPuffin: I am proud :') |
18:41:21 | BitPuffin | not glfw.dylib |
18:41:23 | BitPuffin | fix that nao |
18:41:27 | BitPuffin | dom96: :'D |
18:42:22 | Araq | I think it should be liblibglfw.dyliblib so people know it's a lib |
18:42:51 | Araq | and not a porn video |
18:43:01 | EXetoC | c(:)-< |
18:43:04 | BitPuffin | xD |
18:43:18 | dom96 | haha |
18:43:25 | BitPuffin | Araq: you a funny guy sometimes |
18:43:27 | BitPuffin | Araq: good dragon |
18:43:35 | BitPuffin | EXetoC: ARE YOU FIXING IT OR WHAT |
18:44:11 | dom96 | I think Araq needs a Nimrod T-shirt with "BDFL a.k.a "The Dragon"" written under the Nimrod logo. |
18:44:25 | EXetoC | BitPuffin: maybe |
18:44:44 | EXetoC | BitPuffin: NOW! |
18:46:21 | EXetoC | I get a segfault when compiling any of the examples |
18:47:26 | Demos | which examples? |
18:47:30 | Demos | glfw ones? |
18:47:52 | EXetoC | yes. will build nimrod without -d:release and try again |
18:49:45 | EXetoC | o "Error: unhandled exception: not (TOpcode(uint32(c.code[start]) and 0x000000FF'u32) == opcEof) [EAssertionFailed]" |
18:50:04 | EXetoC | vm.nim stuffs |
18:50:17 | Araq | uh oh s o its my fault |
18:54:12 | EXetoC | BitPuffin: is it usable now? using the devel branch? |
18:55:26 | * | BitPuffin quit (Ping timeout: 264 seconds) |
18:55:34 | * | io2 joined #nimrod |
18:56:51 | EXetoC | it's glfw.nim. I'll report it soon |
19:01:56 | * | brson quit (Ping timeout: 252 seconds) |
19:05:32 | * | brson joined #nimrod |
19:06:21 | * | Mat3 joined #nimrod |
19:06:27 | Mat3 | G'Day |
19:07:05 | dom96 | hi Mat3 |
19:08:10 | NimBot | Araq/Nimrod devel a4e9a50 Araq [+2 ±2 -1]: command syntax is allowed in expressions |
19:08:10 | NimBot | Araq/Nimrod devel ac7f6e3 Araq [+0 ±3 -0]: updated grammar.txt |
19:08:10 | NimBot | Araq/Nimrod devel 80bfb62 Araq [+4 ±4 -3]: parser support anon iterators |
19:08:10 | NimBot | Araq/Nimrod devel 0da5eb4 Araq [+0 ±1 -0]: Merge branch 'devel' of https://github.com/Araq/Nimrod into devel |
19:09:00 | Mat3 | hi dom96 |
19:09:17 | dom96 | Araq: btw should 'echo(let x = 5; x)' work? |
19:09:25 | Mat3 | hi Araq |
19:09:56 | * | shodan45 joined #nimrod |
19:10:04 | Mat3 | hi shodan45 |
19:10:55 | Araq | dom96: nope, but echo((let x = 5; x)) should |
19:11:22 | Araq | shodan45: you're number 60! wooohooo |
19:11:38 | dom96 | Araq: interesting. |
19:11:54 | dom96 | Araq: Why is that required? |
19:12:16 | EXetoC | I tried something like that but must've used the wrong syntax. it works now |
19:12:18 | shodan45 | Araq: \o/ |
19:12:31 | EXetoC | now I can limit the scope some more; without additional templates anyway |
19:13:02 | shodan45 | Araq: your german accent is fun :) |
19:13:41 | EXetoC | or blocks |
19:14:51 | Araq | dom96: echo ( <-- ( part of the call, (;) <-- syntactic construct |
19:15:25 | Araq | shodan45: er ... thank you |
19:16:16 | shodan45 | Araq: I haven't had time to play with nimrod lately, so commenting on your accent is all I can do ;) |
19:16:57 | Araq | just idle in here please I like your nick |
19:17:05 | shodan45 | Araq: :D |
19:17:25 | * | BitPuffin joined #nimrod |
19:17:53 | * | shodan45 <3 system shock |
19:18:42 | shodan45 | I tried to like bioshock, but.... ehh, I dunno, maybe it's not "deep" enough? |
19:18:58 | shodan45 | I haven't tried bioshock infinite yet, though |
19:19:02 | BitPuffin | Araq: http://www.youtube.com/watch?v=lbOtyWTRZ_g |
19:19:16 | Mat3 | hi bitPuffin |
19:19:21 | BitPuffin | heyo Mat3 |
19:19:31 | EXetoC | dom96: haven't gotten any file descriptor errors yet? it's when polling with asyncio I think |
19:19:43 | dom96 | EXetoC: nope |
19:21:37 | shodan45 | I found llvmpy the other day.... might be fun to write a nimrod compiler in python |
19:21:48 | EXetoC | what do I need to do to add keep-alive support to httpclient? just re-use the socket? |
19:22:20 | Araq | shodan45: bioshock 1 is good, 2 is playable and bioshock infinite is ... meh |
19:22:28 | EXetoC | and maybe bother to check if http 1.0 is used |
19:22:49 | dom96 | EXetoC: Possibly async support for httpclient. |
19:22:51 | Araq | shodan45: it's more fun to program a compiler in nimrod ;-) |
19:23:10 | dom96 | EXetoC: The API needs some adjustments: an HttpClient object which stores the state of the connection. |
19:23:22 | EXetoC | yes |
19:24:42 | BitPuffin | EXetoC: so many bindings that need to be updated xD |
19:24:57 | EXetoC | ok |
19:25:58 | shodan45 | Araq: maybe, but saying "I wrote a compiler for Nimrod... in Python" sounds crazier |
19:27:36 | shodan45 | llvmpy makes writing a compiler look fairly easy |
19:28:03 | shodan45 | of course, llvm takes care of the hard parts :) |
19:29:43 | EXetoC | BitPuffin: does it run now? |
19:29:56 | EXetoC | I get a segfault on devel |
19:32:55 | * | BitPuffin quit (Ping timeout: 260 seconds) |
19:34:31 | Varriount | Araq: Are we allowed to use type classes when adding to the stdlib yet? |
19:34:40 | Mat3 | shodan45: LLVM is not so easy because of its SSA oriented IL, its only looks so at first sight |
19:34:51 | Araq | Varriount: depends on what you mean by "type classes" |
19:36:40 | * | Mat3 is now known as Mat3-coding |
19:36:54 | Varriount | Araq: This -> https://gist.github.com/Varriount/8527495 |
19:37:18 | * | PortableEXetoC joined #nimrod |
19:37:36 | Varriount | I noticed last night that you can't use strutils.split with a sequence (yes, I know it's not as efficient as using a set) |
19:38:14 | dom96 | What does that type class actually check? |
19:39:48 | Varriount | dom96: If the type has a contains proc that accepts a char, and returns bool |
19:40:07 | Araq | c.contains(char) is char # typo? |
19:40:10 | Varriount | Yeah |
19:40:15 | Varriount | I updated the gist |
19:40:26 | dom96 | ahh, that makes more sense :P |
19:40:50 | zahary1 | that probably should be called CharSet |
19:40:53 | * | zahary1 is now known as zahary |
19:41:02 | Araq | Varriount: what's the point? people can't learn nimrod's set? |
19:41:22 | Varriount | Araq: Is there any builtin to transform a seq to a set? |
19:41:52 | Araq | it's rather trivial to do this transformation but no |
19:42:03 | Araq | what's the use case? |
19:42:17 | Araq | I simply start with a set in the first place |
19:42:51 | Araq | also strings support contains |
19:43:03 | Araq | and then split(s: string, sep: string) is ambiguous |
19:43:23 | dom96 | ooh 61. New record. |
19:43:45 | Araq | when sep == ";;" I expect ;; to be the separator and not that it's transformed into {';'} |
19:44:14 | Varriount | Araq: Ah, I see. |
19:45:10 | Araq | dom96: EXetoC is listed twice, so it doesn't count |
19:45:21 | dom96 | Araq: shhhh. It does. |
19:45:31 | * | nsfokina quit (Remote host closed the connection) |
19:45:35 | Varriount | Well, on a side note, split(s, sep: char) and split(s, sep:set[char]) display disparate behavior |
19:47:02 | PortableEXetoC | Yeah it does |
19:47:03 | zahary | Varriount: the mimic types features I plan to introduce offers a more lightweight alternative to explicit type classes and it will be able to settle such disputes. |
19:47:20 | Varriount | Yay! |
19:47:48 | Araq | zahary: yeah, I'm excited to see this feature too :-) |
19:47:53 | zahary | there is always tension when one wants to make a library more generic. people rightfully complain that this erodes the quality of the error messages and so on. |
19:49:15 | Araq | mimic types and my planned "append" pragma will make Nimrod the king of strings :-) |
19:49:36 | Varriount | Araq: Sounds like a good motto |
19:50:04 | Varriount | "Nimrod - The king of strings" |
19:50:24 | Araq | "Nimrod - tanga party on!" |
19:50:47 | Varriount | Heh. There's a huge discussion on python-idea mailing list about tail-call-optimization . Of course, I don't doubt that, in the end, the idea will be shot down for being too "radical" |
19:50:50 | * | xtagon joined #nimrod |
19:50:56 | dom96 | 62! |
19:51:06 | Araq | xtagon: new record! |
19:51:21 | * | Varriount hands xtagon a cookie |
19:51:25 | xtagon | Record? |
19:52:02 | Araq | xtagon: yes and it's your fault |
19:52:16 | xtagon | Oh no, what did I do now... |
19:53:28 | Araq | dom96: "User record: 62" is so poor ... lol |
19:53:58 | dom96 | Araq: Have a better idea? It's the best way to remember. |
19:54:30 | Araq | yeah, too bad local files haven't been invented yet |
19:54:57 | xtagon | Man, that's a great idea. Local files. It would be a game changer |
19:55:06 | Varriount | Araq: https://gist.github.com/Varriount/8527795 |
19:55:16 | Varriount | Is this intended behavior? |
19:55:57 | Araq | yes |
19:56:10 | Araq | most common for sets is that you pass whitespace |
19:56:13 | * | valentinv joined #nimrod |
19:56:26 | Araq | most common for char is that you pass ';' aka CSV data |
19:56:28 | * | PortableEXetoC2 joined #nimrod |
19:56:35 | Araq | hi valentinv welcome |
19:56:40 | dom96 | PortableEXetoC2: Now that's cheating :P |
19:56:56 | Varriount | dom96: 63 |
19:57:14 | PortableEXetoC2 | Nice |
19:57:15 | Araq | dom96: 62 is correct now |
19:57:23 | dom96 | Araq: 63 |
19:57:25 | PortableEXetoC2 | Damn connection |
19:57:29 | * | PortableEXetoC quit (Read error: Connection reset by peer) |
19:57:40 | * | PortableEXetoC2 quit (Client Quit) |
19:58:22 | dom96 | There. |
19:59:40 | Varriount | dom96: Over in #nimbuild, we have some interesting joinings. Look at the addresses |
19:59:52 | dom96 | Varriount: Yeah, that happened before. |
20:00:15 | Varriount | Any idea as to the reason? |
20:00:15 | dom96 | valentinv is perhaps related? |
20:00:27 | dom96 | Amrykid once said that they are spam bots. |
20:00:39 | dom96 | But they don't seem to be spamming much. |
20:00:43 | dom96 | It's probably the NSA. |
20:01:13 | Amrykid | ##botmonitoring |
20:01:29 | Amrykid | and also #freenode |
20:01:46 | Amrykid | stay informed. stay safe. *hides* |
20:02:40 | dom96 | Amrykid: cheers |
20:02:54 | Amrykid | ^ |
20:05:21 | xtagon | I just realized Nimrod would be perfect for code that needs to be heavily obfuscated when compiled |
20:05:49 | xtagon | Just write a bunch of arbitrary macros that perform the intended effect, but more complicated |
20:06:00 | xtagon | And then disable as many optimizations as you can |
20:06:07 | Varriount | :p |
20:06:43 | xtagon | Since macros can be evaluated at compile time, you could even make it so that each new build is obfuscated differently |
20:06:48 | xtagon | Reverse engineering would be a PITA |
20:08:27 | * | psquid quit (Ping timeout: 252 seconds) |
20:08:58 | * | psquid joined #nimrod |
20:08:59 | * | psquid quit (Changing host) |
20:08:59 | * | psquid joined #nimrod |
20:09:26 | Varriount | Hi psquid |
20:11:20 | psquid | ahoy hoy |
20:15:55 | * | uliashke quit (Ping timeout: 272 seconds) |
20:20:39 | * | tdc joined #nimrod |
20:21:26 | Mat3-coding | xtagon: You know the C obfuscated source-code contest (unbeatable) ? |
20:22:07 | xtagon | Mat3-coding, yeah I've heard of it |
20:24:19 | xtagon | Mat3-coding, the difference is if you do all the obfuscating with macros, your source code can look normal and your binary can be obfuscated |
20:25:38 | Mat3-coding | I think you can get to the same result with ordinary C macros (plus some GCC related extensions probably) |
20:26:27 | * | io2 quit (Ping timeout: 252 seconds) |
20:29:28 | Mat3-coding | '#define begin {' + '#define end }' + '#define proc(x) void ##x' -> Welcome to the Algol 68 world :-> *lol* |
20:29:45 | Mat3-coding | (the last one is preprocessor dependent) |
20:32:14 | xtagon | Yes that's true |
20:33:10 | xtagon | I wonder if anyone's made any quines with Nimrod |
20:34:36 | * | Mat3-coding is now known as Mat3 |
20:35:55 | * | brson quit (Ping timeout: 272 seconds) |
20:49:00 | Araq | argh |
20:49:51 | * | [2]Endy quit (Ping timeout: 260 seconds) |
20:49:54 | Araq | there is a data structure called adaptive packed memory array ... but I can't find any real world implementation ... |
20:50:25 | Varriount | Just research papers? |
20:50:33 | Mat3 | Araq: I've found the reason for these obscure memory leak. In some sircumstances GCC compiled corrupt code in existence of unitialized, not accessed structure variables |
20:51:07 | Mat3 | (version 4.8.1) |
20:52:15 | Araq | Varriount: yes |
20:52:20 | Araq | Mat3: interesting |
20:53:19 | * | io2 joined #nimrod |
20:53:37 | Mat3 | by the way: What means adaptive in these context ? |
20:54:03 | * | oleglyabin quit (Ping timeout: 260 seconds) |
20:54:34 | Mat3 | I think of packed integer arrays for SIMD processing |
20:55:37 | Mat3 | hi io2 |
20:55:56 | io2 | howdy Mat3 |
20:56:01 | io2 | :) |
21:00:18 | * | foxcub joined #nimrod |
21:00:44 | Araq | Mat3: A packed memory array (hereinafter called PMA) is a an array of records stored in order, with some gaps to allow for efficient updates. |
21:01:55 | Mat3 | strange |
21:05:00 | Araq | it's exactly the data structure that I want to try |
21:05:15 | Varriount | So.. an array with gaps? |
21:05:20 | Araq | and should be easy to implement but I want to copy&paste |
21:06:25 | * | ddl_smurf joined #nimrod |
21:08:35 | xtagon | Is unittest broken on devel? When I run a basic check 1 == 1 suite, I get Error: internal error: (filename: compiler/vmgen.nim, line: 197) |
21:09:49 | Mat3 | you should use a random generator for precalculating gap sizes |
21:09:57 | Mat3 | get some sleep, ciao |
21:10:03 | xtagon | Bye Mat3 |
21:10:27 | * | Mat3 quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
21:10:28 | Varriount | xtagon: Make sure to recompile koch and the tester executables, as well as nimrod |
21:10:56 | xtagon | Varriount, how do I do that? I don't know what koch is |
21:11:26 | Varriount | xtagon: koch is the configuration and bootstrapping executable that comes with nimrod |
21:11:44 | Varriount | it should be in the root nimrod directory |
21:11:48 | xtagon | Okay |
21:12:09 | Varriount | 'nimrod c --run koch boot --linedir:on --debuginfo' |
21:12:19 | Varriount | 'nimrod c --run koch.nim boot --linedir:on --debuginfo' |
21:13:11 | Varriount | That'll recompile koch, and then tell it to recompile the nimrod compiler in debug mode (slightly slower, but you get stack traces when the compiler segfaults.) |
21:13:16 | Araq | nah, nobody needs linedir or debuginfo :P |
21:13:31 | Araq | debuggin the compiler is not that hard :P |
21:13:50 | Varriount | Araq: Says you. I can't even manage to fix the simple bugs. :/ |
21:15:01 | Araq | they are not simple, Varriount so don't worry |
21:17:09 | xtagon | Okay, I recompiled everything. Now what is the way to run a test suite? nimrod c -r mytest.nim gives me that error |
21:17:24 | xtagon | Do I need to run it with koch? |
21:18:22 | * | tdc quit (Quit: Leaving) |
21:18:44 | Varriount | xtagon: to run the nimrod test suite, use 'koch tests' followed by './tests/testament/tester.exe html' (omit the exe if on linux) |
21:20:00 | Araq | xtagon: unittest works for me, but I didn't try check 1 == 1 ;-) |
21:20:34 | xtagon | Araq, I was just trying to get the minimal code necessary to run as a test |
21:20:57 | xtagon | The nimrod test suite is running :) |
21:21:52 | Varriount | xtagon: The suite will take a while to finish. It has quite a lot of tests |
21:21:59 | xtagon | That is fine |
21:22:29 | xtagon | So in my own projects, should I run the tests with 'koch tests'? |
21:22:51 | discoloda | how do i return a new iterator from a proc? i get "expression expected, but found 'keyword iterator'" |
21:23:18 | Varriount | xtagon: No. You should probably just run a main executable under debug mode. |
21:24:11 | Araq | discoloda: I'm implementing this feature right now ... |
21:24:22 | discoloda | ah, cool |
21:26:07 | Varriount | Araq: I don't suppose the feature also comes with fixed closure iterators? |
21:26:19 | Varriount | *wishfulthinking* |
21:27:53 | Araq | Varriount: it comes with fixed closure iterators, that's the whole point |
21:27:59 | Varriount | :D |
21:28:04 | Araq | anon iterators are just some syntactic sugar |
21:28:11 | * | Varriount jumps for joy |
21:28:55 | Araq | xtagon: check out tests/templates/utemplates for how to use unittest.nim |
21:29:34 | xtagon | Araq, awesome thanks |
21:30:13 | discoloda | it will help with my port of quake 2, doing it iteratively instead of one shot with c2nim. of course still using c2nim. its just not ready for a one shot translation of this scale |
21:31:03 | Araq | discoloda: how do first class iterators help with that? |
21:31:50 | xtagon | I ran the suite, and I ran ./tests/testament/tester html, now where is the generated HTML I should view? |
21:32:06 | Varriount | xtagon: In the root directory |
21:32:22 | Araq | run ./tests/testament/tester --print html |
21:33:28 | xtagon | Sure enough, tunit.nim examples C compile internal error: (filename: compiler/vmgen.nim, line: 197) reNimrodcCrash |
21:33:36 | xtagon | Thats in testresults.html |
21:33:57 | discoloda | there a few "iterators", like find files, find entities within a range etc.. im keeping the original functions for now but still want to port them to nimrod. having state in a closure iterator will do it |
21:36:59 | Araq | xtagon: oh well ... I'm still fighting with the test suite |
21:45:14 | * | io2 quit (Ping timeout: 264 seconds) |
21:49:30 | renesac|Away | "Error: type mismatch: got (int, uint8) |
21:49:31 | renesac|Away | but expected one of: |
21:49:31 | renesac|Away | system.+=(x: var T, y: T) |
21:49:31 | renesac|Away | system.+=(x: var T, y: T)" |
21:49:37 | * | renesac|Away is now known as renesac |
21:49:56 | renesac | I really can't add those two types (I imported unsigned by the way) |
21:50:02 | renesac | ? |
21:50:55 | renesac | I know I can append .int, but it shouldn't be necessary here |
21:51:11 | Araq | *shrug* |
21:51:35 | Araq | I am tired of fixing my language to accomodate for your integer type zoos |
21:51:41 | Varriount | renesac: How should they be added? |
21:52:26 | Varriount | Should it be a raw add, merely treating the uint as an int without data conversion? |
21:52:45 | renesac | "widening type conversion are implicit" |
21:53:01 | renesac | just upcast it implicitly to int |
21:53:02 | * | foxcub quit (Quit: foxcub) |
21:53:32 | * | kidrefkir quit (K-Lined) |
21:53:33 | Varriount | Also, int is an ordinal, uint is not, iirc |
21:53:44 | Araq | uint8 is though, Varriount |
21:53:55 | Araq | and for the record renesac is right and it's a bug |
21:54:08 | Varriount | Oh. *shrug* sorry. |
21:54:21 | * | odc quit (Ping timeout: 252 seconds) |
21:55:04 | * | valentinv quit (K-Lined) |
21:56:07 | * | radsoc quit (Ping timeout: 260 seconds) |
21:59:45 | * | io2 joined #nimrod |
22:02:40 | * | brson joined #nimrod |
22:05:32 | * | brson quit (Client Quit) |
22:10:38 | Araq | xtagon: examples/tunit.nim compiles for me ... |
22:11:07 | Araq | there seems to be a bug with 'raise' in the new vm but apart from that it works |
22:12:28 | xtagon | testresults.html shows a few other modules with the same error (same line number) |
22:13:24 | Araq | check: 1 == 1 also works |
22:13:57 | Araq | my bet is your compiler ain't up to date |
22:14:06 | Araq | I fixed unittests recently |
22:14:13 | xtagon | tunit.nim, tunittests.nim, tdumpast.nim, ttypedesc1, tobject.nim, thashes.nim, tmath.nim all have this error |
22:14:18 | * | rndbit quit (Ping timeout: 245 seconds) |
22:14:53 | renesac | I'm also having this error: https://gist.github.com/ReneSac/8c2a4f992baede3e03ca |
22:15:09 | renesac | I'm trying to use 'seq' as a type class in the second proc |
22:15:59 | * | rndbit joined #nimrod |
22:16:25 | zahary | renesac: is this the devel branch? |
22:16:27 | EXetoC | you don't want it to be generic? |
22:16:41 | EXetoC | oh it's supposed to be possible? |
22:16:50 | EXetoC | implicit generic param? |
22:16:54 | renesac | It is the binary I downloaded yesterday from the nimbuild |
22:16:55 | zahary | yes |
22:17:16 | renesac | Nimrod Compiler Version 0.9.3 (2014-01-13) [Linux: i386] |
22:18:36 | zahary | I fixed a similar problem in the devel branch recently and your code works for me |
22:18:53 | zahary | probably the binary on nimbuild is derived from the master branch |
22:18:54 | renesac | oh, ok |
22:19:19 | renesac | fast moving language |
22:19:22 | renesac | ^^" |
22:21:40 | EXetoC | zahary: me? |
22:22:16 | zahary | what about you :) |
22:23:03 | EXetoC | I don't know who you answered |
22:23:25 | zahary | the "yes" was about your "implicit generic param?" question |
22:23:36 | EXetoC | ok |
22:24:18 | renesac | http://build.nimrod-lang.org/docs/manual.html#type-classes_toc <-- it is described there |
22:24:31 | Araq | fyi, I found this: https://github.com/reddragon/packed-memory-array/blob/master/impl2.cpp |
22:25:16 | renesac | I wonder why there isn't a "number" type class |
22:25:26 | EXetoC | see system.nim |
22:25:48 | EXetoC | or the documentation for it. there are a couple of type classes there |
22:26:01 | EXetoC | zahary: I thought we were getting something like set[T] where T is first declared here |
22:26:08 | EXetoC | but I guess additional shortcuts don't hurt |
22:26:48 | xtagon | Araq, I pulled the latest devel and recompiled again. Still getting the crashes in the test results |
22:26:57 | * | foxcub joined #nimrod |
22:26:59 | renesac | oh, TNumber, ok |
22:27:40 | Araq | xtagon: your new executable is not in path or something |
22:27:48 | renesac | the type classes table will be huge... |
22:28:30 | Araq | renesac: what makes you think so? |
22:28:53 | renesac | the start of the system.nim |
22:29:11 | xtagon | Araq, derp, that's probably it. |
22:29:35 | EXetoC | renesac: what about it? |
22:30:14 | renesac | at least 5 type classes that should be added to the table, and I'm not sure about other modules |
22:31:25 | Araq | zahary: I'm quite sure the array of function pointers will be faster than the 'case' if you duplicate the dispatching logic table[typ.kind](a, b) |
22:32:06 | Araq | but surely it's a micro optimization and quite some work of refactoring |
22:33:14 | zahary | are we talking about methods? |
22:33:37 | Araq | no, C-style array of function pointers |
22:33:56 | zahary | but what is the context? why are bringing that up? |
22:34:08 | Araq | sigmatch.nim needs to get faster |
22:34:27 | Araq | or rather: If you touch every line in sigmatch anyway, you might as well optimize it |
22:34:34 | zahary | ah, I see |
22:37:49 | xtagon | Araq, good news, I no longer get the vmgen error. Now I just get nil deprecation errors :) |
22:38:15 | Araq | xtagon: the definition of progress ;-) |
22:39:06 | Araq | oh btw I added tests/parser/tcommand_as_expr.nim |
22:39:17 | xtagon | Almost ever module crashes with: 'nil' statement is deprecated; use an empty 'discard' statement instead [NilStmt] |
22:39:39 | Araq | xtagon: the tester is stupid and takes a warning for a crash |
22:40:50 | Araq | zahary: let x = foo 7.foo, foo(1, foo 8) now parses :-) |
22:41:08 | Araq | let x = foo 7.foo, foo(1, foo 8 ) |
22:41:13 | xtagon | Araq, well, I can run unit tests now! :D |
22:42:49 | Araq | there 2 more things I want to do with parser/grammar |
22:43:10 | Araq | 1) change the comment handling |
22:43:25 | Araq | 2) operator precedence based on spaces |
22:43:36 | EXetoC | <3 |
22:43:49 | zahary | nice, does it go all the way to coffeescript? foo bar baz()? |
22:44:15 | Araq | yeah |
22:44:41 | Araq | I wanted to disallow that first but then I thought, "meh it's still easy enough" |
22:45:03 | zahary | yeah, it becomes idiomatic after some use |
22:45:38 | EXetoC | extended command syntax? |
22:46:14 | Araq | for (1) I plan to make the lexer really ignore # comments so they can be everywhere and only ## comments are part of the grammar |
22:46:52 | Araq | and get rid of the comment field in the AST, instead where ## comments are valid, an empty node is provided, if necessary |
22:47:02 | Araq | ... = enum |
22:47:11 | Araq | a ## comment here |
22:47:29 | Araq | becomes nkEnumField(a, nkComment"comment here") |
22:47:44 | Araq | but this changes the AST and so might break some macros |
22:48:03 | Araq | also empty statements like |
22:48:12 | Araq | # only a comment, no nil, no discard |
22:48:30 | Araq | are not valid anymore then, since the lexer doesn't pass it to the parser |
22:48:33 | discoloda | for "let x = foo 7.foo, foo(1, foo 8)" is x the value of "foo(1, foo 8)" (, seperates expressions, takes the last)? |
22:48:56 | zahary | I don't have strong opinions about comments - I only guess that they are not very newbie friendly |
22:49:14 | reactormonk | Araq, for blub blub\n# this loop initiates doomsday\nsome code <- doesn't work anymore? |
22:49:35 | Araq | reactormonk: that continues to work |
22:50:23 | OrionPK | Varriount goto symbol support |
22:50:27 | OrionPK | plz |
22:51:35 | Araq | zahary: well we have to accept reality, "nimrod pretty" carefully doesn't do any reformating of your code, so the "comments are part of the ast for easier reformating" design doesn't work |
22:51:59 | Araq | and so comments can be done more traditionally |
22:53:04 | Araq | discoloda: x is the value of the whole expression |
22:58:34 | * | zahary quit (Quit: Leaving.) |
23:02:07 | * | io2 quit (Ping timeout: 272 seconds) |
23:03:51 | dom96 | Araq: oh dear, that may break quite a bit of code. |
23:05:22 | Varriount | dom96: Howso? |
23:05:32 | reactormonk | Araq, good |
23:05:43 | dom96 | Because I like using a comment instead of 'nil' :P |
23:06:02 | Varriount | >:| |
23:06:45 | Araq | dom96: well we'll have a deprecation path, as usual |
23:07:08 | Araq | and as usual your code will continue to not give a fuck about deprecation warnings ... :P |
23:07:21 | dom96 | Great :P |
23:07:47 | Araq | but hey the compiler itself uses a deprecated module |
23:07:51 | * | BitPuffin joined #nimrod |
23:07:51 | OrionPK | lol |
23:08:02 | OrionPK | is there a 'break on deprecated' option? |
23:08:11 | OrionPK | or break on warnings |
23:08:12 | OrionPK | more generally |
23:08:16 | Araq | nope |
23:08:25 | Araq | what's the point? |
23:08:44 | xtagon | Araq, one of the things I like about # being part of the AST is that theoretically you could write tools to modify a part of the source file and leave the rest intact (e.g. change a constant in a config file) |
23:08:45 | OrionPK | to get you to pay attention |
23:09:23 | Araq | xtagon: there are better ways to do this and they are not any harder either |
23:09:43 | xtagon | Araq, what's the ideal way to do it? |
23:10:04 | EXetoC | I think I've only been bothered about the inability to uncomment certain things |
23:10:12 | Araq | track line,col information like we do and update in the original file, xtagon |
23:10:27 | Araq | so that whitespace etc. is kept |
23:10:43 | xtagon | Ah, so you can get line/col info from any AST object? |
23:10:46 | Araq | EXetoC: yeah but we all have |
23:10:52 | Araq | xtagon: that is correct |
23:10:56 | xtagon | Neat |
23:12:21 | Araq | OrionPK: every warning that nimrod produces deserves your attention |
23:14:24 | Araq | er ... does anybody remember how I named the "spaces determine precedence" feature? |
23:14:40 | Araq | I had a marketing compatible name for it |
23:14:58 | Araq | {.saneSpaces: on.} ? |
23:16:27 | * | faassen left #nimrod (#nimrod) |
23:18:08 | Varriount | Araq: Found the logs |
23:18:17 | Varriount | Araq: http://build.nimrod-lang.org/irclogs/18-12-2013.html |
23:18:46 | Varriount | ctrl+f "spaces" |
23:21:31 | Araq | Varriount: thanks |
23:21:35 | Araq | strongSpaces is it |
23:21:58 | Varriount | Aww. Not saggySpaces? :3 (just joking) |
23:22:51 | xtagon | How can spaces determine precedence? Sounds interesting |
23:23:02 | Varriount | xtagon: Operator precedence |
23:23:27 | xtagon | Varriount, right, but what do spaces have to do with it? |
23:23:48 | Araq | xtagon: x+1 * 4 == (x+1) * 4 when strongSpaces:on |
23:24:13 | xtagon | Araq, ohhh, that's cool. |
23:24:20 | Araq | it'll be experimental but I'll always turn it on for my code because I know it works :P |
23:26:19 | Demos | does x + 1 * 4 also equal (x+1)*4? |
23:26:39 | Araq | yes |
23:26:59 | Araq | but x + 1 * 4 stays x + (1 * 4) |
23:27:30 | Demos | right, what about operators with higher precidence and user defined operators, like $i + 2 |
23:27:48 | Araq | well user defined operators are the point of this feature |
23:28:24 | Araq | you can't define a good precedence table for these and you don't want to go Haskell's route because that makes the grammar context sensitive |
23:28:57 | Varriount | ^ Or rather, even more context sensitive |
23:29:23 | Araq | Varriount: depends on your defintion, but have a look at compiler/parser.nim |
23:29:36 | Araq | it doesn't use any kind of symbol table |
23:31:54 | OrionPK | riight araq |
23:32:00 | OrionPK | like when I use block name: |
23:32:05 | OrionPK | and "name" is unused |
23:33:07 | Araq | so? thats not done in the parser |
23:33:43 | Araq | good night |
23:44:13 | * | darkf joined #nimrod |
23:46:03 | Varriount | Hi darkf |
23:47:55 | darkf | hello |