00:09:18 | dom96 | Happy new year everybody in the UK :) |
00:11:50 | ldlework | BlaXpirit: there are non-zero benefits to putting all the types in a single file |
00:12:04 | BlaXpirit | ... |
00:12:06 | ldlework | BlaXpirit: nothing substantial to make me like it |
00:12:15 | ldlework | but it is kind of nice to see all the types at once.. |
00:12:42 | ldlework | BlaXpirit: I mean other than defeating the recursive types thing :P |
00:16:21 | BlaXpirit | dom96, do you think a list of valid licenses for nimble could be useful? |
00:16:42 | dom96 | BlaXpirit: yeah |
00:16:48 | BlaXpirit | I don't see any library licensed under zlib/libpng and I'm not entirely sure what to write in license: "" |
00:17:15 | BlaXpirit | dom96, i'm not suggesting that I make it :p but i could look into it |
00:18:04 | BlaXpirit | this is cool: http://spdx.org/licenses/ |
00:18:58 | * | Varriount|Remote quit (Ping timeout: 246 seconds) |
00:19:19 | * | z1y joined #nim |
00:19:30 | BlaXpirit | but some packages already are different from it |
00:20:06 | BlaXpirit | I'm mentioning that site because Rust apparently limits licenses to this list in its package/whatever manager |
00:20:47 | BlaXpirit | what use is that thing in .json if you can't categorize by license etc |
00:25:30 | ldlework | putting all the types in one file means everything is public too :( |
00:26:05 | BlaXpirit | ldlework, who cares |
00:26:15 | ldlework | ... |
00:36:00 | * | JStoker quit (*.net *.split) |
00:36:28 | * | JStoker joined #nim |
00:42:49 | * | Demon_Fox joined #nim |
00:43:53 | BlaXpirit | I don't understand how to import packages if they are not in the current directory. I've tried literally adding to PATH but it didn't help |
00:44:16 | Araq | --path ? |
00:44:35 | BlaXpirit | aaand it worked immediately. thank you. |
00:44:55 | jsudlow | \0/ |
00:45:05 | BlaXpirit | it's so hard for me to find info without stackoverflow first result instant answer :p |
00:46:59 | def- | BlaXpirit: post all your questions to stackoverflow to help future learners of Nim? |
00:47:44 | BlaXpirit | i dunno |
00:49:46 | * | skyfex quit (Quit: (null)) |
00:50:40 | * | gokr joined #nim |
00:52:19 | * | BlaXpirit quit (Quit: Quit Konversation) |
00:54:20 | * | gokr_ quit (Ping timeout: 250 seconds) |
00:56:22 | * | z1y quit (Ping timeout: 255 seconds) |
01:00:53 | * | gsingh93 quit (Quit: Connection closed for inactivity) |
01:02:40 | * | skyfex joined #nim |
01:06:57 | * | Jesin quit (Quit: Leaving) |
01:16:00 | * | BitPuffin quit (Ping timeout: 250 seconds) |
01:18:29 | ldlework | It would be neat if you could store int slices as consts |
01:19:13 | Araq | planned feature |
01:19:18 | ldlework | neat |
01:19:23 | Araq | not even hard to do |
01:19:45 | * | Jesin joined #nim |
01:22:12 | * | Varriount|Remote joined #nim |
01:31:24 | Varriount|Remote | There, force builds are finally fixed... |
01:35:47 | Demon_Fox | Just wondering, because it is annoying |
01:35:54 | Demon_Fox | How come nim does not use automake tools? |
01:36:08 | * | gokr quit (Remote host closed the connection) |
01:36:16 | Demon_Fox | autobuild, my bad |
01:36:21 | * | gokr joined #nim |
01:40:49 | Varriount|Remote | Demon_Fox: Uh... what? |
01:42:01 | Varriount|Remote | Demon_Fox: Do you mean continuous integration? Or something that rebuilds files on modification? Or do you mean http://wiki.secondlife.com/wiki/Autobuild ? |
01:44:03 | Demon_Fox | I mean like a makefile |
01:44:27 | Varriount|Remote | Demon_Fox: We don't need one? |
01:45:46 | Varriount|Remote | Demon_Fox: If you want to build Nim from source, you just checkout the source code repo, then checkout the csources repo, and then run one of the script files to bootstrap Nim. |
01:46:03 | Varriount|Remote | Then you compile koch, and bootstrap again. |
01:49:25 | Varriount|Remote | Demon_Fox: Nim doesn't have any dependencies, other than a working C/C++ compiler |
01:50:54 | Demon_Fox | I get it now |
01:51:07 | Demon_Fox | It was to keep the dependencies low |
01:53:57 | ldlework | Is there a way to echo the type of a name? |
01:54:30 | def- | ldlework: yes |
01:55:14 | def- | .eval import typetraits; name(type(12)) |
01:55:17 | Mimbus | def-: eval.nim(4, 5) Error: invalid indentation |
01:55:22 | Demon_Fox | By the way |
01:55:22 | def- | .eval import typetraits;name(type(12)) |
01:55:25 | Mimbus | def-: eval.nim(4, 0) Error: value of type 'string' has to be discarded |
01:55:31 | def- | .eval import typetraits;echo name(type(12)) |
01:55:35 | Mimbus | def-: 0.004321813583374023sec: int |
01:55:41 | Demon_Fox | How many more mile stones do we need to cross to get to the next version? |
01:55:47 | ldlework | bleh this sucks |
01:55:56 | ldlework | I have a type |
01:56:00 | ldlework | with a field of type A |
01:56:07 | ldlework | which I set to a subclass |
01:56:09 | ldlework | type B |
01:56:17 | ldlework | and my methods are getting sent an A |
01:56:20 | ldlework | which I have to cast to B |
01:56:34 | ldlework | I don't like this, but this is probably inherent to statically typed languages? |
01:56:36 | def- | you're using method instead of proc? |
01:56:40 | ldlework | yes |
01:56:45 | ldlework | oh wait |
01:57:04 | ldlework | yeah it still get's send the base type |
01:57:13 | def- | I'd like to see the code |
01:57:16 | Varriount|Remote | ldlework: Care to give us an example? |
01:57:25 | ldlework | let me explain better first |
01:57:35 | ldlework | I have a type Foo, which has a field bar of type Bar |
01:57:44 | ldlework | I create a foo, but give it a SubBar |
01:57:52 | ldlework | When I call Foo.doSomething |
01:58:06 | ldlework | and it does self.bar |
01:58:09 | ldlework | it gets a Bar |
01:58:20 | Varriount|Remote | ldlework: Is 'Bar' a reference type, or a value type? |
01:58:36 | ldlework | well, all the types are value types, but all fields are ref types |
01:58:46 | EXetoC | the type of a name or the name of a type? :p |
01:59:06 | ldlework | all types are declared as '= object' |
01:59:09 | ldlework | all fields are ref T |
01:59:47 | ldlework | err |
01:59:51 | ldlework | '= object of RootObj' |
01:59:54 | ldlework | sorry |
02:00:16 | ldlework | let me try to come up with a minimal example |
02:00:17 | Varriount|Remote | ldlework: Hm, I don't suppose you could post a code sample? |
02:01:07 | Varriount|Remote | ldlework: You just need to be careful that, somewhere along the line, your SubBar isn't being implicitly downcast such that the extra data is being cut off. |
02:01:55 | ldlework | I mean, the field is defined as the base type, so that's probably likely isn't it? |
02:09:30 | ldlework | Varriount|Remote: https://gist.github.com/8d4fd16e63c00dce744e |
02:09:37 | ldlework | if you run this, this is the issue I'm running into |
02:09:49 | ldlework | If you try to cast, by commenting the current echos, and uncommenting the others |
02:09:54 | ldlework | you get a different error |
02:10:13 | ldlework | sorry |
02:10:16 | ldlework | I typed proc instead of method |
02:10:21 | ldlework | https://gist.github.com/c712c5228e214fe6c6b1 |
02:10:23 | ldlework | same error though |
02:12:05 | def- | that looks expected to me |
02:12:28 | def- | why don't you just do "bar: ref Bar" and "baz: ref Baz"? |
02:12:35 | ldlework | should it know that |
02:12:39 | ldlework | f.bar is a Bar and not a Child? |
02:12:58 | def- | I don't think the compiler can assume that, you could just set f.bar to any other Child subtype |
02:13:06 | ldlework | I see |
02:13:13 | ldlework | fuck |
02:13:23 | ldlework | its so hard to divorce myself from duck type assumptions |
02:13:29 | ldlework | like, it is legitimately hard |
02:13:39 | def- | but you could have a printer method for Child, Bar and Baz |
02:13:56 | def- | then you can call the printer and since it's a method the correct one gets called automatically |
02:14:00 | ldlework | the problem is that since it interprets it as a child |
02:14:08 | ldlework | it Bar has no clue about Baz, ec |
02:14:24 | ldlework | it sees Baz as a child |
02:14:30 | ldlework | and therefore would print the wrong thing |
02:14:42 | def- | no, should work, let me try |
02:14:51 | Varriount|Remote | ldlework: This is what I thought you were trying to explain: https://gist.github.com/Varriount/3d473d742e88b78009b0 |
02:15:17 | def- | Yeah, I would have done it exactly as Varriount|Remote did |
02:15:26 | * | gokr quit (Remote host closed the connection) |
02:15:34 | Varriount|Remote | And that works. |
02:15:48 | ldlework | they are not doing the same thing def- |
02:16:05 | Varriount|Remote | Actually, I was surprised that the pointer dereference didn't mess method dispatch up. |
02:16:19 | ldlework | they're not the same thing tho |
02:16:57 | ldlework | in mine, the problem is that when calling a method on the child, all parent fields are interpreted as the base type as shown in the definition |
02:17:04 | ldlework | but I understand why it does that now, thanks |
02:17:33 | ldlework | oh |
02:17:41 | ldlework | my problem is even more annoying |
02:18:34 | Varriount|Remote | ldlework: Your code confuses me. >_< |
02:18:39 | def- | ldlework: here's how your code works: https://gist.github.com/def-/e9fb834da751f1eac9e8 |
02:19:03 | flaviu | sorry about the Mimbus number nonsense, it's a temporary change to show how long compilation takes. |
02:19:13 | ldlework | def-: I understand, it can only call the lowest common interface |
02:19:15 | def- | flaviu: np, first time I tried mimbus out |
02:20:03 | def- | flaviu: an online compiler would be nice too, is anyone working on that? |
02:20:20 | Varriount|Remote | ldlework, def-: You don't even have to have the methods take references, as long as you dereference the field inside the method call. |
02:20:22 | def- | people love to try out a language interactively without installing anything |
02:20:38 | def- | Varriount|Remote: yeah, true |
02:20:53 | flaviu | def-: Looks like ideone supports it, although their interface isn't too glamorous. |
02:20:55 | Varriount|Remote | def-: The hard thing about that would be abuse... It's easy to curtail bad behavior on an irc channel |
02:21:04 | Varriount|Remote | Much less so on a website. |
02:21:20 | flaviu | Varriount|Remote: Nah, it's a solved problem |
02:21:28 | Varriount|Remote | flaviu: Oh? |
02:21:30 | def- | I'm more thinking about something that you can use to make fun Nim tutorials |
02:21:39 | flaviu | linux containers for sandboxing and a bit of rate limiting. |
02:21:51 | def- | flaviu: what about infinite loops in the compiler? |
02:21:58 | Varriount|Remote | def-: I know, lets compile the compiler to javascript. |
02:22:14 | flaviu | def-: Like rust's rust-by-example? |
02:22:15 | def- | Varriount|Remote: yes, that would be interesting |
02:22:18 | def- | flaviu: exactly |
02:22:25 | flaviu | def-: Look at this: |
02:22:26 | flaviu | .eval while true; discard |
02:22:28 | Mimbus | flaviu: eval.nim(4, 8) Error: ':' expected |
02:22:39 | Varriount|Remote | def-: I don't actually know if that would work though... |
02:22:45 | flaviu | .eval while true:; discard |
02:23:01 | Varriount|Remote | ? |
02:23:20 | Varriount|Remote | .eval echo("I'm still here") |
02:23:26 | flaviu | It'll time out in a minute, I couldn't easily make it shorter. |
02:23:42 | def- | yeah, stuff like this, coming from many ip addresses at the same time |
02:23:48 | Mimbus | flaviu: <no output> |
02:23:51 | Mimbus | Varriount|Remote: 0.004374027252197266sec: I'm still here |
02:23:59 | Varriount|Remote | flaviu: What about remotely stopping a job? |
02:24:09 | def- | Maybe I'm just used to this stuff from the gaming community, but I expect a lot of abuse |
02:24:15 | flaviu | remotely stopping a job? |
02:24:44 | Varriount|Remote | flaviu: Stopping the currently executing eval |
02:24:56 | flaviu | Varriount|Remote: reading from stdout is blocking |
02:25:20 | Varriount|Remote | flaviu: Not with threads...? |
02:25:26 | flaviu | def-: I keep abuse in mind at all times. There are solutions available for it all though. |
02:25:29 | Varriount|Remote | Or if you use non-blocking IO |
02:25:49 | ldlework | Okay this is my actual type relationships: https://gist.github.com/e674661ee967548d0c5c |
02:26:00 | ldlework | You can see how the base classes might be implemented in a library |
02:26:07 | ldlework | and you're implementing all the concrete stuff |
02:26:08 | flaviu | Varriount|Remote: Here is the code: def-: I keep abuse in mind at all times. There are solutions available for it all though. |
02:26:12 | flaviu | oops |
02:26:13 | ldlework | you're going to have to cast all over the place |
02:26:17 | flaviu | Varriount|Remote: https://gist.github.com/8251221aa23dde7385ba |
02:27:51 | flaviu | def-: see http://www.ucw.cz/moe/isolate.1.html |
02:28:12 | Varriount|Remote | ldlework: That looks like a problem with method dispatch.. |
02:28:46 | ldlework | Varriount|Remote: I think it is because parent is defined as BaseParent |
02:28:52 | Varriount|Remote | ldlework: You might consider using dispatch tables as well, although that also requires casts... |
02:29:20 | ldlework | and the compiler can't upgrade any reference to .parent to a Parent |
02:29:35 | ldlework | so any use of .parent gives you a BaseParent that has no a or b fields |
02:29:38 | ldlework | this sucks |
02:29:46 | ldlework | for me |
02:29:50 | ldlework | because its how I model stuff |
02:29:51 | Varriount|Remote | Oh wait. Isn't it not doing what you expect because echo() doesn't look at the actual type info? |
02:30:03 | ldlework | no |
02:30:13 | ldlework | its because the parent field is declared as BaseParent |
02:30:13 | Varriount|Remote | echo does static dispatch, not dynamic dispatch. |
02:30:48 | ldlework | that isn't the reason |
02:30:58 | ldlework | https://gist.github.com/70f748b19eed5bafa32c |
02:31:00 | ldlework | same error |
02:31:20 | ldlework | its because the compiler does not upgrade any use of .parent |
02:31:26 | ldlework | to a Parent type from a BaseParent type |
02:31:27 | fowlmouth | ldlework, because it cant |
02:31:41 | ldlework | right I think I understand that |
02:32:22 | Varriount|Remote | Oh, yes, I see now. |
02:32:24 | ldlework | fowlmouth: in this situation, BaseParent is my Scene class, Parent is an actual Scene subclass in my game, and A and B are two different entities in the scene |
02:33:02 | ldlework | It seems you just cannot use the pattern where you organize a few things that talk to each other under a parent type, or at least in the ways I've tried |
02:33:20 | ldlework | when using inheritance |
02:33:21 | Varriount|Remote | Hm... Would C++ be able to do any better? |
02:33:26 | ldlework | I have no idea |
02:33:46 | ldlework | I don't want to change Nim, but in Python this would work perfectly |
02:33:59 | ldlework | So I have to evolve my own design sensibilities |
02:34:01 | Varriount|Remote | ldlework: You could always interface with python... |
02:34:02 | ldlework | but that is so painful |
02:35:23 | ldlework | What I wish |
02:35:33 | ldlework | is that I could redefine parent on the sub class maybe? |
02:35:45 | ldlework | so instead of casting everywhere |
02:36:06 | ldlework | I just inform the compiler, "so yeah, all .parent fields on this subclass are actually Parent not BaseParent" |
02:37:12 | fowlmouth | ldlework, parent:Parent doesnt work? |
02:37:20 | ldlework | huh? |
02:37:36 | ldlework | let val = self.parent.b.b_val |
02:37:39 | ldlework | is the line |
02:38:53 | ldlework | fowlmouth: in the subclass? no |
02:38:56 | ldlework | it says redefinition |
02:39:20 | ldlework | let val = (ref Parent)(self.parent).b.b_val |
02:39:23 | ldlework | fixes it |
02:39:24 | ldlework | but ew |
02:40:15 | ldlework | I wonder if I defined my BaseChild.parent to be a typeclass..? |
02:40:33 | ldlework | hmm no |
02:41:27 | * | brson_ quit (Quit: leaving) |
02:45:31 | ldlework | I guess this is what event systems are for |
02:45:46 | ldlework | so instead of calling methods directly on other stuff I send it a message |
02:46:00 | * | ldlework cries a little and goes off to drink |
02:46:04 | ldlework | happy new year everyone |
02:46:38 | * | z1y joined #nim |
02:51:35 | fowlmouth | ldlework, i got it working |
02:51:43 | ldlework | whatwhat |
02:52:41 | fowlmouth | https://gist.github.com/fowlmouth/74f52167f0e71ae81a42 |
02:53:31 | ldlework | heh |
02:53:37 | ldlework | I don't exactly see what you changed |
02:54:13 | Varriount|Remote | ldlework: Hm, I don't remember nim having (type)(value) casting syntax... or is that conversion syntax? |
02:54:34 | ldlework | no idea what the difference between casting and conversion is |
02:54:47 | fowlmouth | Varriount|Remote, thats conversion |
02:54:57 | def- | conversion is type safe, casting is just interpreting the bits as a new type (totally unsafe) |
02:55:00 | fowlmouth | ldlework, conversion does a runtime type check |
02:55:08 | fowlmouth | in your case |
02:55:15 | ldlework | fowlmouth: it looks like you solved it for the old version |
02:55:18 | fowlmouth | if its int(0.1) obv there is no runtime type check |
02:55:26 | ldlework | the problem lies in Foo having a base class |
02:55:26 | Varriount|Remote | fowlmouth: What did you change? |
02:55:34 | ldlework | Varriount|Remote: he solved the old version |
02:55:37 | ldlework | with no BaseParent |
02:55:45 | ldlework | dunno if the solution applies to that as well |
02:56:37 | ldlework | fowlmouth: https://gist.github.com/anonymous/e674661ee967548d0c5c |
02:57:15 | ldlework | in this case the .parent field points/is declared to be a reference to the BaseParent |
02:57:21 | ldlework | it is Parent that gets the a/b fields |
02:57:42 | fowlmouth | you understand why that doesnt work right |
02:58:00 | ldlework | fowlmouth: yeah I just explained it |
02:58:07 | ldlework | the parent field is defined as BaseParent |
02:58:18 | ldlework | so when you are in a ChildA or ChildB and you do .parent |
02:58:25 | ldlework | that is a BaseParent and has no .a or .b |
02:58:38 | ldlework | so from ChildA you can never reach ChildB, unless you convert .parent to a Parent |
02:58:50 | jsudlow | happy new year germany! |
02:59:36 | ldlework | so in our game subsystems |
02:59:45 | ldlework | we're going to need to figure out a different way for them to communicate |
02:59:56 | fowlmouth | ldlework, ok that example is easy to fix |
03:00:07 | ldlework | fowlmouth: with a conversion? |
03:00:18 | ldlework | (ref Parent)(self.parent).b ? |
03:00:19 | fowlmouth | ldlework, you change line 8 to parent: ref Parent like i suggested 30 minutes ago |
03:00:40 | ldlework | fowlmouth: uh |
03:00:49 | ldlework | yes in this trivial example they are all defined together |
03:01:01 | ldlework | I said earlier imagine the base classes are in a library |
03:01:05 | ldlework | and you are implementing the subclasses |
03:01:10 | fowlmouth | ldlework, oh christ |
03:01:26 | fowlmouth | you're still on about the module limits |
03:01:40 | ldlework | are you serious? |
03:01:45 | ldlework | how is this about module limits? |
03:01:52 | fowlmouth | since that is the test case why dont you take the .a/.b fields out |
03:02:02 | ldlework | dude |
03:02:13 | ldlework | is this language supposed to have no libraries I don't get your point at all |
03:02:36 | fowlmouth | ldlework, well your design needs work if you want to do it this way |
03:02:41 | ldlework | is your answer to vendorize libs? |
03:02:46 | ldlework | fowlmouth: I've already admitted that |
03:02:54 | jpoirier | is there any difference between cast[bool](100) and bool(100)? |
03:03:00 | ldlework | I mentioned in python this would have worked fine |
03:03:06 | ldlework | and that I have to change the way I think about things |
03:03:21 | * | darkf_ joined #nim |
03:04:31 | Varriount|Remote | jpoirier: In the end, no. |
03:05:10 | Varriount|Remote | jpoirier: However, bool(100) will check that the type can actually be sensibly converted to a bool, whereas cast[bool](100) won't. |
03:05:35 | Varriount|Remote | Actually, wait, yes, the two will differ. The cast will work, the conversion will error. |
03:05:37 | * | skyfex quit (Quit: (null)) |
03:06:45 | Varriount|Remote | ldlework: Have you looked at entity and component architectures? |
03:06:53 | ldlework | Varriount|Remote: very much so |
03:07:09 | ldlework | I am sort of implementing that without a generalized database implementation |
03:07:17 | jpoirier | Varriount|Remote: k, thanks |
03:07:48 | ldlework | where multiple game systems use game structures directly instead of having logic wrapped up in game structurs and having them talk to each other |
03:07:58 | * | darkf_ is now known as darkf |
03:08:06 | ldlework | I think I just need to externalize the state out of the systems themselves |
03:11:54 | Varriount|Remote | ldlework: If it helps, think about this as a challenge. |
03:12:23 | Varriount|Remote | And yes, I do understand the frustration that a duck-shaped hole leaves. :< |
03:13:19 | Varriount|Remote | You just have to... let it go. http://www.youtube.com/watch?v=moSFlvxnbgk |
03:13:52 | jsudlow | beat it ldlework https://www.youtube.com/watch?v=Ym0hZG-zNOk |
03:14:10 | EXetoC | something wrong with duck shapes? |
03:27:16 | flaviu | .eval bool(100) |
03:27:19 | Mimbus | flaviu: eval.nim(3, 4) Error: value of type 'bool' has to be discarded |
03:27:26 | flaviu | .eval echo bool(100) |
03:27:29 | Mimbus | flaviu: eval.nim(3, 9) Error: conversion from int literal(100) to bool is invalid |
03:27:35 | flaviu | .eval cast[bool](100) |
03:27:38 | Mimbus | flaviu: eval.nim(3, 0) Error: value of type 'bool' has to be discarded |
03:27:38 | flaviu | .eval echo cast[bool](100) |
03:27:41 | Mimbus | flaviu: 0.004118919372558594sec: true |
03:30:47 | Varriount|Remote | .eval echo(cast[string](cast[int]("Hello world"))) |
03:30:50 | Mimbus | Varriount|Remote: 0.004240989685058594sec: Hello world |
03:31:03 | Varriount|Remote | Interesting. |
03:31:16 | Varriount|Remote | .eval echo(cast[string](cast[int]("Hello world"[2]))) |
03:31:19 | Mimbus | Varriount|Remote: 0.006471157073974609sec: SIGSEGV: Illegal storage access. (Attempt to read from nil?) |
03:31:41 | Varriount|Remote | .eval echo(cast[char](cast[int]("Hello world"[2]))) |
03:31:45 | Mimbus | Varriount|Remote: 0.004175901412963867sec: l |
03:33:11 | Varriount|Remote | Hm. I should probably get started on installer generation... |
03:33:42 | Varriount|Remote | You know, someday we should really abandon inno and nsis, and just make our own installer. |
03:34:17 | Varriount|Remote | It might be NIH, but dependancies really suck, and nsis scripting is... weird. |
03:34:21 | EXetoC | why so little precision? |
03:35:04 | Varriount|Remote | EXetoC: ? |
03:35:33 | EXetoC | jk. cya |
03:36:15 | flaviu | EXetoC: Because it's just temporary |
03:36:20 | flaviu | so I don't really care about polish |
03:41:45 | ldlework | jsudlow: updated and pushed |
03:41:52 | ldlework | I'm off to a party |
03:41:54 | ldlework | o/ |
03:42:10 | jsudlow | ldlework: aweomse I"ll review it enjoy the party happy new year |
03:43:16 | Triplefox | cube drawing performance tests...still using glBegin and displaylists https://vine.co/v/OwFDpVb1itp |
03:43:56 | * | vbtt joined #nim |
03:47:42 | Triplefox | going to move on to the buffers and shaders approach now so that i can drive up the counts for dynamic cubes... |
03:49:13 | flaviu | Triplefox: The encoding on that video is pretty bad |
03:50:05 | Triplefox | it's a cell phone camera held up to the display...the vine aesthetic |
03:50:19 | flaviu | oh. |
03:50:25 | * | flaviu left #nim (#nim) |
03:50:54 | * | flaviu joined #nim |
03:50:56 | flaviu | oops |
03:50:59 | Triplefox | on some material it works well, this time it was kind of blah |
03:52:43 | Triplefox | i'm happy with how nim interacts with a c-style api, anyway...it's not perfectly seamless but i don't feel like i'm losing anything |
03:54:13 | * | Varriount|Remote quit (Ping timeout: 246 seconds) |
03:57:51 | * | Demos joined #nim |
03:58:06 | * | saml_ joined #nim |
04:03:58 | * | BitPuffin joined #nim |
04:04:28 | * | vbtt quit (Ping timeout: 255 seconds) |
04:12:52 | * | brson joined #nim |
04:39:46 | def- | Hm, this doesn't look updated: http://nim-lang.org/trmacros.html |
04:45:14 | * | kapil__ joined #nim |
04:47:30 | * | MyMind joined #nim |
04:52:04 | * | Sembei quit (Ping timeout: 264 seconds) |
04:52:37 | * | ARCADIVS joined #nim |
05:05:27 | * | BitPuffin quit (Ping timeout: 244 seconds) |
05:16:59 | * | vbtt joined #nim |
05:35:43 | * | z1y quit (Quit: Leaving.) |
05:51:18 | * | saml_ quit (Remote host closed the connection) |
06:04:05 | * | dts|pokeball joined #nim |
06:13:17 | * | vbtt quit (Ping timeout: 240 seconds) |
06:20:08 | * | BillsPC joined #nim |
06:27:53 | * | BillsPC quit (Remote host closed the connection) |
06:29:28 | * | BillsPC joined #nim |
06:39:26 | * | vbtt joined #nim |
06:59:58 | * | vbtt quit (Ping timeout: 255 seconds) |
07:14:35 | * | gour joined #nim |
07:56:47 | * | Demos quit (Ping timeout: 244 seconds) |
08:02:04 | * | BitPuffin joined #nim |
08:06:55 | * | BitPuffin quit (Ping timeout: 256 seconds) |
08:07:25 | * | vbtt joined #nim |
08:22:05 | * | nullmove joined #nim |
08:24:24 | * | darkf_ joined #nim |
08:24:27 | * | darkf_ quit (Changing host) |
08:24:28 | * | darkf_ joined #nim |
08:25:43 | * | darkf quit (Ping timeout: 244 seconds) |
08:31:19 | * | vbtt quit (Ping timeout: 255 seconds) |
08:33:52 | * | Demon_Fox quit (Quit: Leaving) |
08:36:53 | * | darkf_ is now known as darkf |
08:43:45 | * | brson quit (Quit: leaving) |
08:55:37 | * | nullmove quit (Ping timeout: 255 seconds) |
08:56:26 | * | nullmove joined #nim |
09:15:06 | * | BlaXpirit joined #nim |
09:23:12 | * | gour quit (Remote host closed the connection) |
09:53:42 | * | tgkokk joined #nim |
10:00:01 | BlaXpirit | this is not really important, but i wonder what is the best way to make an alias for a function |
10:00:21 | BlaXpirit | e.g. setCharacterSize `characterSize=` |
10:01:03 | dts|pokeball | let foo = someFunc # BlaXpirit ? |
10:01:13 | BlaXpirit | dts|pokeball, i don't think that's how it works |
10:01:30 | dts|pokeball | well considering ive done that before... |
10:02:03 | BlaXpirit | dts|pokeball, first of all, there can be multiple versions/methods |
10:02:20 | dts|pokeball | .eval proc foo()=echo 1;let bar = foo;bar() |
10:02:24 | Mimbus | dts|pokeball: 0.007239818572998047sec: 1 |
10:02:43 | BlaXpirit | but it seems to work somehow wtf |
10:02:54 | dts|pokeball | because as i tried to tell you, that is how it works... |
10:03:01 | dts|pokeball | functions are first class like in python |
10:03:28 | BlaXpirit | proc foo()=echo 1;proc foo(a:int)=echo a;let bar=foo;bar() |
10:03:33 | BlaXpirit | .eval proc foo()=echo 1;proc foo(a:int)=echo a;let bar=foo;bar() |
10:03:36 | Mimbus | BlaXpirit: eval.nim(5, 4) Error: invalid type: 'None' |
10:03:40 | BlaXpirit | okay |
10:03:56 | BlaXpirit | .eval proc foo()=echo 1;proc foo(a:int)=echo a;let bar=foo;bar(5) |
10:03:59 | Mimbus | BlaXpirit: eval.nim(5, 4) Error: invalid type: 'None' |
10:04:05 | BlaXpirit | so there, dts|pokeball |
10:04:29 | dts|pokeball | hmmmm |
10:04:30 | BlaXpirit | .eval proc foo(a:int)=echo a;let bar=foo;bar(5) |
10:04:33 | Mimbus | BlaXpirit: 0.004065036773681641sec: 5 |
10:04:47 | dts|pokeball | does nim have bind? |
10:04:59 | BlaXpirit | considering "bind" is a keyword, probably :p |
10:05:14 | dts|pokeball | probably not the same bind im thinking of |
10:05:16 | BlaXpirit | but i think it's a completely different thing |
10:05:22 | dts|pokeball | im thinking of c++'s bind |
10:05:42 | dts|pokeball | hold on, whats the type of proc? |
10:05:46 | BlaXpirit | oh man, livescript is so amazing in that regard |
10:06:02 | BlaXpirit | func _, 1, _ # bind 2 argument |
10:13:01 | novist | why echo $cpuTime() results in "coro.nim(66, 5) Error: type mismatch: got (proc (varargs[expr]){.gcsafe, locks: 0.}, float)"? I would expect it to print float value converted to string. No clue whats going on here.. |
10:13:35 | BlaXpirit | novist, which module? |
10:13:58 | * | gour joined #nim |
10:14:04 | novist | cpuTime() comes from times module if you mean that |
10:14:10 | BlaXpirit | gawd it's impossiblt to google such things |
10:14:56 | novist | i noticed quite some compiler errors are rather cryptic. its not immediately clear what error means |
10:15:20 | BlaXpirit | novist, ok, something is wrong for sure |
10:15:28 | dv- | why the $? just do echo cpuTime() |
10:15:48 | dv- | or echo($cpuTime()) |
10:16:08 | novist | hmm yeah w/o $ it works. second one doesnt work still, tried |
10:16:15 | novist | but with $ it should still work no? |
10:16:21 | BlaXpirit | yes |
10:16:24 | BlaXpirit | what's up with $ |
10:16:25 | dv- | the second works for me |
10:17:00 | * | tgkokk quit (Ping timeout: 244 seconds) |
10:17:02 | novist | err actually indeed it does. guess i got confused by all the random things i try to get it working hehe |
10:17:22 | BlaXpirit | .eval var t0: float = cpuTime();echo $t0 |
10:17:25 | Mimbus | BlaXpirit: eval.nim(3, 16) Error: undeclared identifier: 'cpuTime' |
10:17:34 | novist | btw same error happens if i do var t = cpuTime(); echo $t |
10:17:36 | BlaXpirit | .eval import times;var t0: float = cpuTime();echo $t0 |
10:17:36 | ekarlso- | dom96: around ? |
10:17:39 | Mimbus | BlaXpirit: eval.nim(5, 5) Error: type mismatch: got (proc (varargs[expr]){.locks: 0.}, float) |
10:17:42 | novist | Mimbus import times |
10:18:13 | dv- | when you do echo $cpuTime() it seems to think you're passing the cpuTime proc to echo instead of cpuTime()'s return value? |
10:18:34 | novist | thats how it looks yes |
10:18:46 | dv- | it's weird like that sometimes |
10:19:21 | BlaXpirit | guys |
10:19:28 | BlaXpirit | var t0: float |
10:19:41 | BlaXpirit | i'm doing echo $t0 |
10:19:49 | BlaXpirit | it's definitely something horribly bad |
10:20:21 | dts|pokeball | because i think its trying to convert the function itself to a string, not the return value |
10:20:23 | dts|pokeball | Mimbus doesnt have anything imported |
10:20:25 | dts|pokeball | .eval proc foo: int = result = 42;echo $foo() |
10:20:28 | Mimbus | dts|pokeball: eval.nim(4, 5) Error: type mismatch: got (proc (varargs[expr]){.locks: 0.}, int) |
10:20:29 | novist | so didnt i just score in another compiler bug..? two bugs in two days. ill get smug if i get one more hoho |
10:20:46 | novist | weird thing is that t0 is actually float |
10:20:57 | novist | and echo t0 would work just fine |
10:21:03 | BlaXpirit | .eval var t: float;echo $t0 |
10:21:06 | Mimbus | BlaXpirit: eval.nim(4, 6) Error: undeclared identifier: 't0' |
10:21:07 | novist | but $ makes it misbehave, but echo() fixes it |
10:21:08 | BlaXpirit | .eval var t: float;echo $t |
10:21:11 | Mimbus | BlaXpirit: eval.nim(4, 5) Error: type mismatch: got (proc (varargs[expr]){.locks: 0.}, float) |
10:21:17 | BlaXpirit | there, minimal example |
10:21:18 | dts|pokeball | see, as i said, $ has higher precedence, so $some_proc() shouldnt work |
10:21:24 | BlaXpirit | but it's probably just lack of parentheses |
10:21:35 | BlaXpirit | dts|pokeball, do you not see what i wrote |
10:21:36 | nullmove | yeah echo($t0) works |
10:21:57 | * | tgkokk` joined #nim |
10:22:13 | novist | err.. are you guys sayng in echo $t operator $ acts on echo? |
10:22:13 | * | tgkokk` is now known as tgkokk |
10:22:20 | dts|pokeball | no |
10:22:30 | BlaXpirit | ok the error is obvious now |
10:22:33 | BlaXpirit | echo $ t |
10:22:34 | novist | then whats happening? i dont get it |
10:22:37 | BlaXpirit | no binary operator |
10:22:38 | BlaXpirit | yay |
10:23:31 | dts|pokeball | .eval var t: float = 1.0;echo $t |
10:23:33 | Mimbus | dts|pokeball: eval.nim(4, 5) Error: type mismatch: got (proc (varargs[expr]){.locks: 0.}, float) |
10:23:36 | novist | proc (varargs[expr]){.gcsafe, locks: 0.} looks much like definition of echo bw |
10:23:43 | BlaXpirit | dts|pokeball, that's what i wrote a few minutes ago -_- |
10:23:52 | dts|pokeball | BlaXpirit, no its not |
10:24:04 | novist | wait a moment, Mimbus is fucking bot? and i was talking to him. omg.. |
10:24:07 | BlaXpirit | 1.0 instead of 0.0 value |
10:24:20 | dts|pokeball | you never wrote 0.0 |
10:24:28 | BlaXpirit | but it's implied |
10:24:39 | dts|pokeball | implied isnt always neccesarry a good thing |
10:24:46 | dts|pokeball | it can cause bugs |
10:25:03 | dts|pokeball | and you arent neccesary always guaranteed it to be implied |
10:25:17 | BlaXpirit | yes, you are |
10:25:23 | dts|pokeball | no |
10:25:36 | BlaXpirit | {.push noInit.} or what |
10:25:41 | dts|pokeball | im pretty sure if its decided to be taken out, it will be taken out |
10:25:50 | BlaXpirit | it will not be taken out |
10:25:56 | dts|pokeball | says who? |
10:26:03 | dts|pokeball | its a terrible feature |
10:26:21 | BlaXpirit | no |
10:26:25 | dts|pokeball | yes |
10:26:53 | BlaXpirit | in any case, if someone missed, this whole thing was not a bug |
10:27:02 | BlaXpirit | [:22:34] <BlaXpirit> echo $ t |
10:27:19 | novist | could you explain what actually happens here? why $ ruins things? |
10:27:32 | BlaXpirit | no binary $ operator defined |
10:28:05 | * | gour quit (Remote host closed the connection) |
10:28:14 | novist | there is operator $ that works on float. i dont get it why it breaks right here but works with () |
10:28:32 | BlaXpirit | `$`(echo, t) |
10:28:34 | novist | unless its works much like * would in a * b |
10:28:35 | BlaXpirit | don't you get it |
10:28:40 | BlaXpirit | yes, exactly |
10:29:03 | novist | right.. thats totally not what one would expect. i see now |
10:29:23 | BlaXpirit | there are languages where this no-parentheses things works much better |
10:29:39 | BlaXpirit | main problem here is arbitrary operators |
10:29:59 | BlaXpirit | significant whitespace could help though |
10:30:51 | * | nullmove quit (Ping timeout: 256 seconds) |
10:31:00 | BlaXpirit | welp, even #! strongSpaces doesn't help in this case |
10:31:02 | BlaXpirit | too bad |
10:31:09 | novist | echo is simple proc too? |
10:31:38 | novist | in other langs stuff with no parentheses usually is keyword |
10:31:58 | BlaXpirit | you can call any procedure like tha |
10:32:05 | BlaXpirit | (limitations apply) |
10:33:21 | novist | that kind of freedom is pretty cool. bites in the ass sometimes though |
10:33:43 | novist | i read on wiki of 2014 GSOC. did anyone take wrapping Qt? |
10:33:58 | BlaXpirit | someone wrapped QML |
10:33:59 | BlaXpirit | ... |
10:34:11 | BlaXpirit | i couldn't care less about it |
10:34:18 | novist | im not sure what that means. saw on forum and thought to myself "wtf is this shit?" :D |
10:34:29 | BlaXpirit | but looks like i will have to, because large parts of Qt are basically abandoned |
10:34:30 | dts|pokeball | hmmm good catch BlaXpirit |
10:34:53 | novist | maybe it could be automated by reusing some other projects |
10:35:12 | BlaXpirit | novist, i've gone quite far in autogenerating source code |
10:35:20 | BlaXpirit | but that's not what baffles me |
10:35:39 | novist | what is it then? |
10:35:47 | BlaXpirit | the whole proprocessing/macro thing |
10:35:56 | BlaXpirit | extensive usage of advanced c++ features |
10:36:00 | * | irrequietus joined #nim |
10:36:14 | BlaXpirit | qt is one of the hardest libraries to wrap |
10:36:16 | BlaXpirit | for sure |
10:36:17 | novist | Q_OBJECT/signals/slots? |
10:36:21 | BlaXpirit | yeah |
10:36:24 | BlaXpirit | it's all a big hack |
10:36:58 | novist | yeah.. that may warrant a custom nim compiler additions just to emit these |
10:37:13 | dts|pokeball | flaviu, tomorrow when i push v1 i will have your .give thing, except modified |
10:38:16 | novist | anyhow once there is anything to test consider you have a tester. i would gladly attempt to migrate my one app to nim. its in python now. and not exactly tiny so should be good testcase |
10:38:43 | * | jefus__ joined #nim |
10:42:54 | * | jefus_ quit (Ping timeout: 265 seconds) |
10:43:00 | novist | dts|pokeball btw now testing my coroutines thing with onlySafeCode = false - it still is not correct. printed k value gets confused and after a bit app crashes. there may be more to it than shallowCopy() problem |
10:43:46 | novist | https://paste2box.com/6/#/FZnWGQ/WoNIrbUckq1IrhXr3EtIN_37c244H8rgHHW3Vu2ORNE/SgugPXVV.py with output https://paste2box.com/6/#/FJnWGQ/VXyNs93fPr5i8qX-Lj7tL_MMHgVg6ZZMu_Gy3EIVMDE/STqlcjYq.txt |
10:44:14 | novist | notice "a1 7" printed lots, out of place |
10:47:43 | * | gour joined #nim |
11:04:24 | * | Matthias247 joined #nim |
11:09:40 | * | Varriount|Mobile joined #nim |
11:13:42 | Varriount|Mobile | .eval proc foo (s: string {.byCopy.}): string = return repr(s);var s = "Hello";echo(repr(s), " ", foo(s)) |
11:13:44 | Mimbus | Varriount|Mobile: eval.nim(3, 22) Error: ')' expected |
11:14:42 | Varriount|Mobile | .eval proc foo(s: string {.byCopy.}): string = return repr(s);var s = "Hello";echo(repr(s), " ", foo(s)) |
11:14:44 | Mimbus | Varriount|Mobile: eval.nim(3, 21) Error: ')' expected |
11:15:41 | BlaXpirit | well this is weird |
11:15:59 | Varriount|Mobile | .eval proc foo (s: {.byCopy.} string): string = return repr(s);var s = "Hello";echo(repr(s), " ", foo(s)) |
11:16:02 | Mimbus | Varriount|Mobile: eval.nim(3, 15) Error: expression expected, but found '{.' |
11:16:43 | BlaXpirit | check this out though |
11:16:47 | BlaXpirit | .eval proc test(a: var int) = echo a;proc test(a: int) = echo a;test 5 |
11:16:50 | Mimbus | BlaXpirit: eval.nim(5, 0) Error: ambiguous call; both eval.test(a: var int) and eval.test(a: int) match for: (int literal(5)) |
11:16:52 | BlaXpirit | .eval proc test(a: var int) = echo a;test 5 |
11:16:55 | Mimbus | BlaXpirit: eval.nim(4, 5) Error: for a 'var' type a variable needs to be passed |
11:17:26 | BlaXpirit | looks quite nasty to me |
11:17:35 | BlaXpirit | prevents me from doing awesome things |
11:19:15 | BlaXpirit | no, this is seriously a huge problem for me |
11:19:24 | BlaXpirit | i just realized :( |
11:19:40 | Varriount|Mobile | BlaXpirit: You could try fixing it in the compiler. |
11:19:47 | dv- | var n = 5; test n? |
11:20:04 | BlaXpirit | dv-, i get it but i want both a var-version and a non-var version |
11:20:14 | Varriount|Mobile | It's probably a 3 line fix. The challenge is finding the right 3 lines |
11:20:28 | BlaXpirit | i'm definitely not going for it |
11:20:36 | Varriount|Mobile | :< |
11:20:44 | BlaXpirit | if i wanna release a library, i'm not gonna go telling people "edit your compiler to run it" |
11:21:01 | BlaXpirit | in any case, i wrote an issue on github |
11:21:04 | * | fractalb joined #nim |
11:21:24 | Varriount|Mobile | Anyway, I could have sworn there was a way to add pragmas to arguments |
11:23:52 | Varriount|Mobile | .eval type valString {.byCopy.} = string;proc foo(s: valString): string = return repr(s);var s = "Hello";echo(repr(s), " ", foo(s)) |
11:23:55 | Mimbus | Varriount|Mobile: 0.004104852676391602sec: 0x7fcbb136e050"Hello" 0x7fcbb136e050"Hello" |
11:24:48 | BlaXpirit | hey, by the way, maybe you guys have any ideas to make that one a template or something |
11:25:09 | Varriount|Mobile | (Varriount|Mobile) .eval type valString {.byCopy.} = string;proc foo(a: valString): string = return repr(a);var s = "Hello";echo(repr(s), " ", foo(s)) |
11:25:12 | BlaXpirit | maybe then non-var would work or somethin |
11:25:22 | Varriount|Mobile | BlaXpirit: Huh? |
11:25:41 | Varriount|Mobile | .eval type valString {.byCopy.} = string;proc foo(a: valString): string = return repr(a);var s = "Hello";echo(repr(s), " ", foo(s)) |
11:25:44 | Mimbus | Varriount|Mobile: 0.003957986831665039sec: 0x7f97c9c3b050"Hello" 0x7f97c9c3b050"Hello" |
11:26:01 | BlaXpirit | Varriount|Mobile, I'm looking for any workarounds to have 2 versions of functions |
11:26:07 | ekarlso- | hmmm |
11:26:10 | BlaXpirit | 1 with var, 1 with non-var argument |
11:26:35 | dom96 | ekarlso-: sup? |
11:26:59 | Varriount|Mobile | .eval type valString {.byCopy.} = object of string;proc foo(a: valString): string = return repr(a);var s = "Hello";echo(repr(s), " ", foo(s)) |
11:27:02 | Mimbus | Varriount|Mobile: eval.nim(3, 35) Error: inheritance only works with non-final objects |
11:27:27 | * | vbtt joined #nim |
11:27:33 | BlaXpirit | or maybe... how can I guarantee that an argument gets passed to a function by reference |
11:27:37 | ekarlso- | your json example the other day |
11:28:06 | * | fractalb quit (Quit: Page closed) |
11:28:07 | ekarlso- | %{"method": %"git"} < how can I use smth like that in building up the json from a seq of stuff ? |
11:28:09 | BlaXpirit | (like var, but without using var, because i don't need to modify the argument) |
11:28:10 | ekarlso- | lemme post the code.. |
11:28:41 | ekarlso- | http://pastebin.com/XP9pxik3 < dom96 |
11:28:49 | ekarlso- | I wanna make a response out of the pkgs |
11:31:05 | Varriount|Mobile | (Varriount|Mobile) .eval type valString {.byCopy.} = object;proc foo(a: valString): string = return addr(a).toString;var s: object;echo(addr(s), " ", foo(s)) |
11:31:23 | Varriount|Mobile | .eval type valString {.byCopy.} = object;proc foo(a: valString): string = return addr(a).toString;var s: object;echo(addr(s), " ", foo(s)) |
11:31:26 | Mimbus | Varriount|Mobile: eval.nim(4, 47) Error: undeclared identifier: 'toString' |
11:31:37 | * | vbtt quit (Ping timeout: 240 seconds) |
11:32:18 | Varriount|Mobile | .eval type valString {.byCopy.} = object;proc foo(a: valString): pointer = return addr(a);var s: object;echo(addr(s), " ", foo(s)) |
11:32:21 | Mimbus | Varriount|Mobile: eval.nim(4, 41) Error: expression has no address |
11:33:48 | Varriount|Mobile | (Varriount|Mobile) .eval type valString {.byCopy.} = object;proc foo(a: valString): pointer = return repr(a);var s: object;echo(addr(s), " ", foo(s)) |
11:34:02 | Varriount|Mobile | .eval type valString {.byCopy.} = object;proc foo(a: valString): pointer = return repr(a);var s: object;echo(addr(s), " ", foo(s)) |
11:34:05 | Mimbus | Varriount|Mobile: eval.nim(4, 45) Error: type mismatch: got (string) but expected 'pointer' |
11:34:23 | dom96 | ekarlso-: var jArr = newJArray(); jArr.add(%{"method": %"git", ...}) |
11:34:46 | ekarlso- | ah |
11:35:35 | Varriount|Mobile | .eval type valString {.byCopy.} = object;proc foo(a: valString): string = return repr(a);var s: object;echo(addr(s), " ", foo(s)) |
11:35:38 | Mimbus | Varriount|Mobile: Error: internal error: GetUniqueType |
11:36:00 | ekarlso- | dom96: -,,- |
11:36:13 | Varriount|Mobile | .eval type valString {.byCopy.} = object; a: int;proc foo(a: valString): string = return repr(a);var s: object;echo(addr(s), " ", foo(s)) |
11:36:16 | Mimbus | Varriount|Mobile: Error: internal error: GetUniqueType |
11:36:27 | Varriount|Mobile | I give up |
11:37:18 | ekarlso- | dom96: what does the %{} mean ? |
11:37:45 | dom96 | ekarlso-: It constructs JSON |
11:38:03 | dom96 | it creates a JObject node out of that |
11:38:36 | * | Varriount|Mobile quit (Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )) |
11:38:42 | * | jux quit (Ping timeout: 250 seconds) |
11:50:23 | * | tgkokk quit (Read error: Connection reset by peer) |
11:59:23 | ekarlso- | dom96: how u do the "resp" method then ? |
11:59:39 | ekarlso- | resp jsArr, "application/json" ? |
11:59:43 | dom96 | resp $jsArr |
12:03:06 | ekarlso- | resp jsArr, "application/json" ? |
12:03:09 | ekarlso- | ehm, wrong place |
12:03:15 | ekarlso- | resp $pkg_array, "application/json" |
12:03:23 | ekarlso- | I did that and now wrong nr of args on that line : |
12:05:50 | Araq | resp($jsArr) ? |
12:06:22 | Araq | Varriount_: there are no pragmas for parameters (yet) |
12:06:34 | ekarlso- | ah k |
12:07:37 | ekarlso- | hmm, %{"name": pkg.name} not possible ? |
12:07:50 | def- | %pkg.name maybe |
12:09:05 | ekarlso- | ya def- :P |
12:09:16 | Araq | ekarlso-: dunno what happened to the JSON macro. it's definitely possible in theory |
12:09:36 | ekarlso- | but what the, now it's saying my resp line is on wrong indentation |
12:20:27 | novist | ekarlso- wrong indentation error can happen if you mess up line before |
12:25:10 | ekarlso- | http://pastebin.com/bNMSTZaM < novist |
12:25:14 | ekarlso- | I dont see the wrongfulness there |
12:25:40 | BlaXpirit | Araq, tell me about that workaround please |
12:27:27 | Araq | BlaXpirit: proc foo(x: (var int){lvalue}) |
12:27:32 | Araq | proc foo(x: int) |
12:27:40 | novist | ekarlso- i see some empty lines contain 5 spaces while indentation is 4 spaces. maybe thats the culprit? |
12:28:00 | novist | or maybe its just copying from pastebin |
12:28:25 | BlaXpirit | thank you |
12:29:18 | * | flaviu left #nim (#nim) |
12:29:29 | * | flaviu joined #nim |
12:29:43 | BlaXpirit | Araq, doesn't seem to compile though :o (0.10.1) |
12:29:51 | ekarlso- | I dont get this thing... |
12:30:08 | ekarlso- | doesn't have a meaning to it :| |
12:30:13 | BlaXpirit | Araq, sorry, it works |
12:31:07 | BlaXpirit | .eval proc foo (s: (string){byCopy}): string = return repr(s);var s = "Hello";echo(repr(s), " ", foo(s)) |
12:31:10 | Mimbus | BlaXpirit: eval.nim(3, 22) Error: illformed AST: byCopy |
12:32:02 | BlaXpirit | Varriount_, is this what you were looking for? |
12:32:07 | * | Ven joined #nim |
12:32:19 | ekarlso- | Araq: u get it why ? :( |
12:32:58 | novist | ekarlso- maybe you forgot return statement on ln 41? |
12:33:16 | ekarlso- | novist: ehhh, should u need a return ? |
12:33:25 | ekarlso- | vs resp |
12:33:50 | novist | well you resp is obviously a call, but what is then string next to it? must put it somewhere i guess |
12:33:56 | novist | idk how web lib works, im very new to nim too |
12:34:08 | novist | but that statement does not quite make sense to me |
12:34:33 | novist | oh resp($pkg_array, "application/json") worked |
12:35:21 | ekarlso- | dang, u right! |
12:35:25 | * | Ven quit (Client Quit) |
12:37:24 | BlaXpirit | wow |
12:37:37 | BlaXpirit | so i've just been fighting the weirdest SIGSEGV i've ever seen |
12:37:48 | BlaXpirit | removing one part of the code fixed it |
12:37:59 | BlaXpirit | removing other unrelated part of code fixed it |
12:38:06 | BlaXpirit | removing import unicode fixed it |
12:38:08 | BlaXpirit | T_T |
12:39:24 | * | ARCADIVS quit (Quit: ARCADIVS) |
12:40:05 | def- | BlaXpirit: what was the result? |
12:40:13 | BlaXpirit | def-, what do you mean? |
12:40:26 | def- | did you find out why it segfaulted like that? |
12:40:28 | BlaXpirit | no |
12:40:37 | BlaXpirit | import unicode still consistently crashes it |
12:40:56 | BlaXpirit | well it's probably something i'm doing wrong, i have a bunch of ptrs |
12:41:11 | BlaXpirit | i bet it's just a coincidence. not importing unicode aligned the memory differently |
12:43:03 | * | gokr_ joined #nim |
12:44:33 | Araq | BlaXpirit: yup, if you don't have memory safety, spooky action from a distance is the result |
12:47:25 | * | gokr_ quit (Ping timeout: 256 seconds) |
13:03:33 | * | BitPuffin joined #nim |
13:05:14 | def- | https://www.reddit.com/r/programming/comments/2r06ej/what_is_special_about_nim/ |
13:05:17 | def- | https://news.ycombinator.com/item?id=8822816 |
13:10:42 | EXetoC | BlaXpirit: wanna try to use aur/nim-git? |
13:10:48 | BlaXpirit | EXetoC, sure |
13:11:39 | dom96 | def-: Upvoted. |
13:12:00 | dom96 | For everybody else who wants to upvote go to https://news.ycombinator.com/newest and upvote from there. |
13:12:17 | dom96 | HN won't like it if lots of people upvote by going directly to the link |
13:18:49 | * | nullmove joined #nim |
13:18:58 | BlaXpirit | cool cool |
13:19:32 | * | vbtt joined #nim |
13:21:18 | flaviu | dom96: Asking people to vote might not be looked kindly upon by hacker news and reddit. |
13:22:14 | EXetoC | maybe just say "here's a new article" then |
13:22:56 | flaviu | yep, it's best not to mention votes at all. |
13:25:10 | * | vbtt quit (Ping timeout: 255 seconds) |
13:27:17 | * | yeye123 joined #nim |
13:35:37 | * | Ven joined #nim |
13:43:41 | * | Trustable joined #nim |
13:45:03 | novist | what kind of grammar is specified there? http://nim-lang.org/manual.html#grammar |
13:45:34 | novist | im trying to put simple intellij plugin and it requires bnf grammar. im totally clueless about grammars and parsing though :| |
13:48:48 | def- | Woo, top post on HN! |
13:50:27 | ekarlso- | dom96: what does it mean when jester goes 502 on a POST route ? |
13:50:44 | dom96 | ekarlso-: no 'resp'? |
13:51:31 | ekarlso- | dom96: http://pastebin.com/55TnFmdk |
13:51:34 | ekarlso- | there's a resp there :/ |
13:52:06 | ekarlso- | <html xmlns="Jester">http://www.w3.org/1999/xhtml"><head><title>Jester route exception</title></head><body><h1>An error has occured in one of your routes.</h1><p><b>Detail: </b>input(1, 0) Error: { expected</p></body></html> |
13:52:24 | dom96 | oh, there you go. |
13:52:29 | dom96 | That's the reason. |
13:52:32 | dom96 | Your route crashed. |
13:52:43 | ekarlso- | ye, but why ? :/ |
13:53:23 | ekarlso- | the json i'm sending is valid.. |
13:55:05 | ekarlso- | dom96: ? |
13:55:16 | nullmove | def-, great post :) |
13:55:28 | dom96 | ekarlso-: echo(@"payload") |
13:55:31 | def- | nullmove: thanks! |
13:55:33 | dom96 | and see if it is valid |
13:56:18 | ekarlso- | whaaa |
13:56:21 | ekarlso- | it's all blank :/ |
13:57:25 | ekarlso- | what does payload refer to ? |
13:58:11 | ekarlso- | obviously not.. |
13:59:09 | * | lipoxin joined #nim |
14:01:08 | ekarlso- | dom96: any clues ? |
14:01:48 | * | lipoxin quit (Client Quit) |
14:02:38 | Araq | novist: I'll explain the details later. it's not EBNF and cannot be. |
14:02:46 | Araq | gotta go, see you later |
14:02:59 | novist | okie.. |
14:03:33 | novist | hopefully there will be a reasonable way to make intellij understand it |
14:04:16 | dom96 | ekarlso-: How are you POST-ing to it? |
14:04:36 | ekarlso- | dom96: postman in chrome... |
14:05:13 | ekarlso- | doesn't exactly give any useful info on why it failed... |
14:05:15 | ekarlso- | just that it failed :| |
14:06:08 | dom96 | ekarlso-: Try echo($request.formData) and echo($request.params) |
14:08:12 | ekarlso- | nothing there either dom96 ... |
14:08:17 | ekarlso- | it's all empty |
14:09:50 | ekarlso- | dom96: {:} they are l ike that |
14:11:02 | dom96 | hm |
14:11:06 | ekarlso- | dom96: why would it be empty ? |
14:11:27 | dom96 | Try using a <form> like here: https://github.com/dom96/jester/blob/master/tests/alltest.nim#L66 |
14:11:42 | ekarlso- | but why the crap would u use a form vs json? |
14:14:45 | ekarlso- | meh, i'll give up for now ... |
14:18:38 | ekarlso- | libraries still seems to lack stuff like delete / put etc |
14:18:44 | ekarlso- | i'll try when it works:P |
14:19:16 | dom96 | It's likely that you're POSTing wrong. |
14:19:29 | dom96 | Not that jester doesn't work. |
14:19:56 | ekarlso- | i'm trying to post some json.. |
14:19:58 | ekarlso- | nothing wrong in that |
14:21:25 | * | wmealing joined #nim |
14:22:03 | * | skyfex joined #nim |
14:22:19 | dom96 | ekarlso-: Try: curl -d 'payload={"repository":{"url":"http://github.com/username/reponame"}}' http://localhost:5000 |
14:23:35 | ekarlso- | eh, wy the payload= ? |
14:23:44 | dom96 | Because that's required |
14:23:49 | wmealing | nimble seems to be.. the package tool, what is the generally accepted.. make-like tool ? |
14:23:52 | dom96 | Because you can have multiple params |
14:24:54 | dom96 | wmealing: There is nake (https://github.com/fowlmouth/nake). There isn't really a need for make-like tools for Nim though because the compiler resolves all module dependencies. |
14:24:59 | ekarlso- | dom96: so |
14:25:07 | dom96 | wmealing: What do you want to use a make-like tool for? |
14:25:13 | ekarlso- | you're not posting a json dict but a form or ? |
14:25:14 | * | rpag joined #nim |
14:25:29 | ekarlso- | curl -H "Content-Type: application/json" -d "{}" should be valid too ... |
14:25:31 | wmealing | dom96: building complex things.. |
14:25:34 | dom96 | ekarlso-: You're posting a string, what you do with that string is up to your app. |
14:25:37 | * | rpag quit (Remote host closed the connection) |
14:25:41 | wmealing | if 'nim' binary does all i need, then.. thats ok |
14:25:54 | wmealing | i see things like "nim c -r src/nimble install" |
14:26:15 | dom96 | ekarlso-: oh. You might be right. echo(request.body) |
14:26:49 | dom96 | wmealing: What complex things? |
14:26:56 | wmealing | i dont know, i'm not writing it yet. |
14:27:08 | ekarlso- | dom96: yeah it's there.. |
14:27:23 | wmealing | i must be making no sense. |
14:27:40 | ekarlso- | yay |
14:27:46 | wmealing | sorry to bother. |
14:27:47 | * | wmealing left #nim (#nim) |
14:27:50 | dom96 | ekarlso-: sorry, didn't get what you meant the first time. |
14:27:51 | ekarlso- | so parseJson($request.body) then |
14:28:01 | dom96 | yes |
14:28:22 | dom96 | no wmealing! |
14:29:06 | ekarlso- | dom96: that was way better :P |
14:29:38 | dom96 | Everything should generally be somewhere in the request object. |
14:29:51 | dom96 | https://github.com/dom96/jester#request-object |
14:30:27 | dom96 | def-: nice. Already at the top :) |
14:35:45 | def- | dom96: any idea why Jester could have a 200 ms delay on each request? |
14:35:48 | * | tgkokk joined #nim |
14:36:48 | dom96 | def-: blocking IO somewhere? When does it happen? |
14:36:48 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:36:56 | dom96 | def-: With a simple hello world? |
14:36:59 | def- | dom96: yes |
14:37:09 | def- | someone is asking by mail, i can't reproduce |
14:37:21 | dom96 | by mail? |
14:37:24 | def- | email* |
14:37:35 | dom96 | oh because you gave your email on your blog post |
14:37:43 | dom96 | windows only maybe? |
14:37:50 | dom96 | Can you CC me the email? |
14:37:55 | def- | sure |
14:37:56 | dom96 | dom[at]picheta.me |
14:38:31 | def- | sent |
14:41:33 | dom96 | thx |
14:43:38 | dom96 | replied, cc'd you too. |
14:55:56 | * | wrl joined #nim |
14:59:42 | ekarlso- | dom96: when u gonna add delet / Put / patch ? |
15:00:43 | dom96 | dunno |
15:00:46 | dom96 | It's not really necessary |
15:01:35 | wrl | hey, so here's a question. i write real-time audio software, and the primary constraint is that, in one particular thread (the real-time audio thread), the execution must be deterministic and must not block. is this a constraint to which i could adhere when writing in nim? |
15:01:45 | wrl | i am particularly leery of garbage collection |
15:04:23 | * | vbtt joined #nim |
15:05:29 | novist | wrl there is --gc:none for disabling it so if it gives you trouble it can be disabled |
15:06:11 | wrl | novist: will that prevent me from using much of the stdlib? |
15:06:30 | def- | wrl: yes, strings and seqs for example |
15:06:52 | wrl | hm hm hm. |
15:06:52 | novist | that i dont know. you also might want to see realtime support section here http://nim-lang.org/gc.html |
15:07:47 | wrl | if i compile with --gc:none, does that mean i can omit NimMain() calls as well? |
15:08:08 | * | FreezerburnV joined #nim |
15:10:01 | * | vbtt quit (Ping timeout: 255 seconds) |
15:10:39 | novist | i would suggest putting minimal possible testcase and seeing if it gives you trouble. disabling gc should probably be last thing you want to do |
15:11:14 | wrl | word, ok. |
15:11:26 | dom96 | The GC should adhere to your constraints. |
15:11:40 | dom96 | You can also disable it and run it whenever you wish. |
15:25:29 | * | akyte joined #nim |
15:26:47 | akyte | So about nim's current garbage collector. From my readings it looks to only be slack-based. What if I don't know how long my collections should go? |
15:27:03 | akyte | Why not tax-and-spend? |
15:28:39 | EXetoC | what about the real-time GC? |
15:28:44 | * | gokr_ joined #nim |
15:30:05 | akyte | The soft real-time GC was the one I was talking about |
15:31:24 | akyte | Although it looks like you only use the tracing GC as a cycle collector. |
15:31:29 | * | darkf quit (Quit: Leaving) |
15:32:14 | * | Ven joined #nim |
15:37:29 | * | tgkokk quit (Quit: Textual IRC Client: www.textualapp.com) |
15:39:56 | * | saml_ joined #nim |
15:43:34 | ekarlso- | dom96: u mean it's not necassary with PUT / PATCH / DELETE for REST apis f ex ? |
15:44:52 | dom96 | it's not necessary because you can POST to /packages/delete or /packages/upload |
15:46:34 | * | gokr joined #nim |
15:49:19 | * | gokr_ quit (Ping timeout: 256 seconds) |
15:49:34 | * | loz joined #nim |
15:54:22 | * | gokr1 joined #nim |
15:54:59 | akyte | Ah, api design arguments *drinks coffee* |
16:01:04 | Araq | wrl: the GC is *per thread*. threads that don't allocate don't invoke their GCs |
16:01:32 | * | kapil__ quit (Quit: Connection closed for inactivity) |
16:01:43 | Araq | and threads which do have full control via the realtime extensions, the .acyclic pragma etc |
16:02:48 | Araq | --gc:none deactivates the GC on a global level and is really your very last option |
16:03:11 | Araq | and many argue the language becomes unusable with it. I beg to differ, but that's another discussion. |
16:03:22 | Araq | see you later |
16:05:17 | * | gour quit (Remote host closed the connection) |
16:08:31 | * | gour joined #nim |
16:08:51 | akyte | If I were to use gc:none, how would I manually manage memory? |
16:10:43 | EXetoC | akyte: with alloc, createU, alloc0, create, realloc, resize, dealloc, free etc |
16:19:33 | * | ethycol joined #nim |
16:21:10 | * | Matthias247 quit (Read error: Connection reset by peer) |
16:21:15 | * | VinceAddons joined #nim |
16:21:32 | akyte | I imagine I could use memmap through the ffi for demand paging? |
16:22:57 | * | Matthias247 joined #nim |
16:23:25 | flaviu | sure, why not |
16:28:51 | * | tane joined #nim |
16:33:40 | ekarlso- | uh, that' seems weird dom96 vs rest principals... |
16:44:42 | * | kniteli quit (Remote host closed the connection) |
16:45:37 | * | StefanSalewski joined #nim |
16:48:12 | StefanSalewski | Hello. I wonder if something like "import libmodule(enable_deprectaed = true)" is already supported? Have not seen it in the manual. |
16:48:20 | ekarlso- | how in json can I get the actual value vs JsonNode ? |
16:48:47 | ekarlso- | I do like i.name = js["foo"] where name is string but it borks |
16:49:59 | EXetoC | StefanSalewski: per-module deprecation notices? |
16:51:06 | EXetoC | right, you can chose to error on uses of deprecated symbols, right? but I don't know of a way to achieve this |
16:52:05 | StefanSalewski | EXetoC: That was an example. General parameters for imported modules, which we can query by when statement in that module. deprecated enabling is one use case. |
16:53:53 | StefanSalewski | I really think I have seen something like that years ago, maybe in Oberon or Modula variants.. I think that would be really useful. |
16:55:40 | * | yeye123 quit (Quit: Leaving) |
16:58:07 | BlaXpirit | EXetoC, damn, i forgot that i started building nim. it built successfully |
16:59:29 | BlaXpirit | EXetoC, works well. thank you. |
17:00:08 | BlaXpirit | EXetoC, but why didn't you continue from the old package?? |
17:00:48 | * | tgkokk joined #nim |
17:02:27 | dom96 | ekarlso-: depends on the type of the JsonNode |
17:02:48 | dom96 | http://nim-lang.org/json.html#JsonNodeObj |
17:04:43 | nullmove | Is RawFlowVar renamed to FlowVarBase? |
17:07:06 | * | jefus_ joined #nim |
17:07:14 | ekarlso- | hmms |
17:07:17 | ekarlso- | can't I do proc pkg_to_jobject(pkg: Package): JObject = ? |
17:08:36 | flaviu | "Nim on Nails" |
17:09:47 | MyMind | nim 10.2 isn't on homebrew ? |
17:10:55 | * | jefus__ quit (Ping timeout: 256 seconds) |
17:14:16 | dom96 | ekarlso-: no. You need to use JsonNode. |
17:16:45 | ekarlso- | dom96: I do that now, but packages.nim(50, 41) Error: type mismatch: got (proc (Package): JsonNode{.gcsafe, locks: 0.}, Package) |
17:17:23 | dom96 | how are you calling it? |
17:17:37 | ekarlso- | pkg_to_jobject $pkg |
17:18:09 | ekarlso- | hmmm, what is the diff in proc $foo vs proc($foo) ? |
17:19:30 | * | StefanSalewski quit () |
17:19:58 | * | rpag joined #nim |
17:20:07 | * | rpag quit (Remote host closed the connection) |
17:21:00 | dom96 | I'm not sure what's happening but just use the parens. |
17:24:11 | EXetoC | BlaXpirit: ok |
17:24:19 | * | atticusalien joined #nim |
17:24:30 | EXetoC | continue how? a name change seemed like a good idea, and it'll only happen once |
17:27:30 | * | akyte is now known as someguy |
17:29:23 | * | atticusalien quit (Read error: Connection reset by peer) |
17:30:05 | def- | Hm, wouldn't it be nice to have the documentations of all nim libraries up somewhere online? |
17:33:36 | * | fungos joined #nim |
17:34:03 | * | MrOrdinaire joined #nim |
17:34:17 | * | fungos quit (Remote host closed the connection) |
17:35:12 | dom96 | def-: it would be. ekarlso- should make his packages website do that :) |
17:37:14 | def- | where is that website? |
17:37:38 | dom96 | he's just started work on it |
17:39:43 | nullmove | shouldn't this work? https://gist.github.com/anonymous/36184715bab25a701588 |
17:40:38 | def- | dom96: ok, then I can remove that from my todo list already |
17:41:38 | ekarlso- | dom96: it would be awesome if u could add DELETE / PUT / PATCH |
17:42:51 | * | Shoozza joined #nim |
17:42:55 | EXetoC | just make an official feature request |
17:43:29 | onionhammer | happy new year ;) |
17:44:15 | dom96 | ekarlso-: But why? |
17:45:14 | * | tgkokk quit (Ping timeout: 245 seconds) |
17:45:30 | ekarlso- | dom96: because REST apps etc use that ... |
17:45:40 | ekarlso- | and for a "web" ish library it's typical to have :P |
17:46:10 | * | someguy is now known as akyte |
17:46:57 | dom96 | Why does it have to be REST? |
17:47:17 | * | jsudlow quit (Remote host closed the connection) |
17:47:30 | dom96 | I will add it, but it might take some time. |
17:47:38 | dom96 | You may wanna make the API non-REST for now. |
17:50:44 | * | jsudlow joined #nim |
17:52:39 | dom96 | or you can have a go at implementing DELETE/PUT/PATCH yourself :) |
17:53:24 | dom96 | nullmove: what results are you getting? |
17:58:06 | MrOrdinaire | does anyone have plans to put Nim on http://benchmarksgame.alioth.debian.org/? |
17:58:39 | nullmove | dom96, on ubuntu with 0.10.2, each threads are running one after another |
17:59:12 | nullmove | so, sleepsort 5 8 7 outputs 5, 8, 7 in the same order |
17:59:27 | nullmove | on windows though it worked as expected |
18:00:27 | ekarlso- | |
18:01:01 | ekarlso- | dom96: I just figured since u are the one maintaining the web lib :P |
18:01:25 | dom96 | ekarlso-: I maintain many things :P |
18:01:27 | ekarlso- | so, if a objects field is not initialized or so |
18:01:33 | ekarlso- | how can one check that ? |
18:04:19 | flaviu | ekarlso-: If it's 0, then it may or may not be initialized |
18:04:36 | flaviu | if it's != 0, then it's initialized. |
18:06:03 | * | flaviu quit (Read error: Connection reset by peer) |
18:06:03 | * | Mimbus quit (Read error: Connection reset by peer) |
18:06:48 | * | Mimbus joined #nim |
18:07:20 | * | FreezerburnV quit (Quit: FreezerburnV) |
18:08:26 | * | flaviu joined #nim |
18:10:41 | * | MrOrdinaire quit () |
18:12:18 | MyMind | how do I debug nim programs? |
18:13:55 | flaviu | MyMind: gdb works, although some identifiers are mangled |
18:14:09 | flaviu | --embedSrc --linedir:on --debugInfo |
18:14:32 | flaviu | well, `--embedSrc` doesn't do anything useful in this case |
18:14:33 | MyMind | ah |
18:18:26 | MyMind | lldb works as well? |
18:18:48 | MyMind | osx doesn't come with gdb anymore |
18:19:50 | MyMind | it looks like |
18:19:52 | MyMind | nvm |
18:19:54 | MyMind | :D |
18:20:03 | * | Demos joined #nim |
18:20:04 | * | gokr1 quit (Quit: Leaving.) |
18:20:13 | dom96 | nullmove: bug report then please |
18:20:27 | BlaXpirit | EXetoC, there is a comment under nimrod-random |
18:21:10 | BlaXpirit | waoejg |
18:21:12 | BlaXpirit | i mean |
18:21:19 | BlaXpirit | EXetoC, there is a comment under nimrod-git |
18:28:04 | * | cir0x joined #nim |
18:30:48 | * | cir0x1 joined #nim |
18:31:43 | * | gokr1 joined #nim |
18:31:45 | * | fold joined #nim |
18:33:44 | * | cir0x quit (Ping timeout: 264 seconds) |
18:38:40 | * | cir0x1 quit (Quit: Leaving.) |
18:39:49 | * | cir0x joined #nim |
18:43:03 | * | repax joined #nim |
18:57:06 | * | saml_ quit (Quit: Leaving) |
18:58:03 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:00:22 | * | alexruf joined #nim |
19:01:29 | * | Ven joined #nim |
19:03:26 | alexruf | Hi, just wanted to ask is somebody knows if there is a Mac homebrew formula for nim 0.10.2. Just found an old one for nimrod. |
19:06:42 | repax | alexruf, I recommend that you use the current devel branch version instead |
19:07:00 | repax | alexruf, from github |
19:07:47 | alexruf | development branch because it's changing mich stuff at the moment ? |
19:08:26 | repax | no, I have not had any problems with things changing too much under devel |
19:08:45 | repax | I just like to keep up with the latest |
19:09:40 | repax | homebrew is generally a mess imho, lagging behind all projects |
19:09:42 | alexruf | thats fine, just want to use homebrew for installation on my mac because its easier to keept things up to date |
19:10:27 | alexruf | hmm depends. most formulas are up to date |
19:10:49 | * | adelq joined #nim |
19:11:03 | repax | perhaps so. It was a while ago since I last used it |
19:12:17 | * | superfunc joined #nim |
19:12:57 | alexruf | i guess the maintainer of the nimrod formula didn't recognice that it was renamed to nim |
19:14:41 | * | Forty-3 joined #nim |
19:15:04 | adelq | Happy New Year everyone! |
19:15:09 | Forty-3 | I like to use tabs for indentation; is it possible to create a macro which converts tabs to spaces before compilation? |
19:15:13 | * | Varriount|Mobile joined #nim |
19:15:19 | Varriount|Mobile | Meep:-) |
19:15:57 | gokr1 | alexruf: http://forum.nimrod-lang.org/t/675 |
19:17:00 | repax | Forty-3, configure your editor to insert spaces for tabs |
19:17:21 | alexruf | gokr1: thanks alot |
19:17:24 | Forty-3 | I do not want to do that as it would pollute existing codebases |
19:17:36 | BlaXpirit | flaviu, do you maybe know how to diagnose segmentation fault? |
19:18:34 | flaviu | BlaXpirit: -fsanitize |
19:18:40 | flaviu | also, try running it in gdb |
19:18:50 | flaviu | there you can run `bt` and get a stack trace |
19:19:13 | BlaXpirit | flaviu, is there a typo in that flag? |
19:19:32 | flaviu | no, but it's incomplete and also meant for clang |
19:19:39 | flaviu | --passC:-fsanitize=address |
19:19:43 | BlaXpirit | oh. |
19:19:45 | adelq | I'm trying to write tests for my library, but the import isn't working as expected - I'm getting the following error trace: http://pastebin.com/jr9TK47Q |
19:19:46 | * | dts|pokeball quit (Ping timeout: 250 seconds) |
19:19:47 | flaviu | if you set up your compiler as clang only |
19:19:52 | jh32 | happy new year |
19:19:59 | Forty-3 | is it possible to have an implicit conversion of tabs to spaces? |
19:20:14 | repax | Forty-3, the tab character is forbidden |
19:20:17 | Forty-3 | I know |
19:20:25 | Forty-3 | which is wh I want to replace it with spaces |
19:20:31 | flaviu | Forty-3: Try patching the parser |
19:20:54 | Forty-3 | flaviu: that means having to re-merge every time I want to update |
19:21:11 | flaviu | it's not really that much work though |
19:21:23 | repax | create a personal preprocessor |
19:21:29 | flaviu | The grammer is pretty stable, so conflicts shouldn't happen much |
19:21:29 | BlaXpirit | Forty-3, an option is, obviously, to run it through something before compilation |
19:21:36 | BlaXpirit | basicallt what repax said |
19:21:50 | Forty-3 | BlaXpirit: yes, but I was wondering if I could do it in nim |
19:21:54 | dom96 | Forty-3: Can't you configure your editor to only use spaces for Nim files? |
19:24:35 | flaviu | Forty-3: https://gist.github.com/flaviut/c8760418076826d82613 |
19:24:54 | flaviu | I haven't actually tested it, but it should work |
19:24:57 | Forty-3 | flaviu: thanks |
19:25:40 | Varriount|Mobile | Forty-3: You can use a source filter to convert tabs to spaces... |
19:25:43 | BlaXpirit | flaviu, so I ran it in GDB and saw name of the proc where SIGSEGV happened |
19:25:48 | BlaXpirit | (i'm interfacing C code btw) |
19:25:59 | BlaXpirit | but I'm afraid the cause is somewhere else |
19:26:07 | Forty-3 | Varriount: what do you mean by that? |
19:26:16 | BlaXpirit | because the code runs fine multiple times until i do a completely unrelated action |
19:26:20 | flaviu | BlaXpirit: Was it a null pointer, or was it a use-after-free? |
19:26:47 | BlaXpirit | flaviu, I don't know |
19:27:14 | flaviu | -fsanitize=address can help you track down use-after-free problems |
19:27:17 | Varriount|Mobile | Forty-3: Add '#! replace("\t", " ")' to the top of your file |
19:27:23 | * | tgkokk joined #nim |
19:27:29 | * | Forty-3 quit (Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/) |
19:27:32 | BlaXpirit | Varriount|Mobile, :o |
19:27:53 | * | Forty-3 joined #nim |
19:27:59 | Forty-3 | stupid terminal >.> |
19:28:16 | Varriount|Mobile | Forty-3: Add '#! replace("\t", " ")' to the top of your file |
19:28:23 | Forty-3 | Varriount: thanks, that works :D |
19:29:29 | Varriount|Mobile | Forty-3: Just don't let hard-core nimsters see you use that, else an angry honey badger will be shipped to you |
19:29:36 | Forty-3 | >.> |
19:30:41 | dom96 | Varriount|Mobile: cool, didn't know source code filters were that flexible. |
19:30:54 | Varriount|Mobile | Also, it replaces all tabstops in the module, not just ones used for indentation |
19:32:06 | Varriount|Mobile | dom96: Have you seen the new HN article for Nim? |
19:32:16 | dom96 | Varriount|Mobile: yeah |
19:32:52 | dom96 | Will 2015 be the year of Nim? :O |
19:33:00 | Varriount|Mobile | Someone actually posted a comment questioning why Wikipedia wouldn't allow Nim an article. |
19:33:32 | Varriount|Mobile | It brought a tear to my eye |
19:34:15 | superfunc | Happy new year everyone |
19:35:09 | dom96 | Varriount|Mobile: I'm really tempted to write an article about this. |
19:35:40 | Varriount|Mobile | dom96: Doooo eeeet |
19:35:48 | dom96 | "On Wikipedia and its shitty notability rules" |
19:35:56 | BlaXpirit | flaviu, I see SIGSEGV: Illegal storage access. removing the code called out by gdb makes the problem appear in the next line of code. also, removing unrelated parts of code fixes problems in other places. |
19:36:17 | flaviu | dom96: Don't. |
19:36:24 | dom96 | flaviu: why? |
19:36:25 | BlaXpirit | any directions with clang? google gives nothing, as usual |
19:36:27 | flaviu | That's rude and makes you, not wikipedia look bad. |
19:36:34 | Varriount|Mobile | BlaXpirit: Sounds like memory corruption |
19:36:54 | dom96 | flaviu: I would probably use a nicer title. |
19:36:56 | superfunc | It is silly, because I've seen some really obscure languages there, like idris |
19:37:04 | dom96 | superfunc: indeed |
19:37:19 | BlaXpirit | so... why don't you recreate the page? |
19:37:29 | superfunc | Our community is equally active and just as large, I know because I'm doing dependent type research now lol |
19:37:34 | dom96 | superfunc: of course WP doesn't consider that a valid argument https://en.wikipedia.org/wiki/Wikipedia:Other_stuff_exists |
19:37:54 | dom96 | BlaXpirit: Because it'll get rejected again |
19:38:03 | flaviu | BlaXpirit: Because they'll get tired of reremoving it and just lock the page. |
19:38:15 | dom96 | We have no reliable non-primary sources. |
19:38:19 | superfunc | If we can get an article written about nim somewhere outside the blogosphere, that might do it |
19:38:28 | flaviu | And then any further arguments as to why it should be kept become even harder |
19:38:37 | repax | drdobbs? |
19:38:45 | Varriount|Mobile | dom96: Although I note that page says that it isn't a Wikipedia policy |
19:38:47 | superfunc | Just closed their doors |
19:38:59 | * | adelq quit (Quit: Page closed) |
19:39:01 | dom96 | repax: That was written by Araq so it's primary. |
19:39:15 | flaviu | BlaXpirit: Looks like --cc:clang might work |
19:39:16 | dom96 | Even though I doubt Dr Dobbs would publish false content. |
19:39:27 | * | tgkokk quit (Ping timeout: 245 seconds) |
19:40:24 | BlaXpirit | flaviu, now it fails immediately... which is nice, i suppose :p |
19:40:28 | * | cir0x quit (Quit: Leaving.) |
19:40:41 | flaviu | BlaXpirit: Can you elaborate on the failure? |
19:40:54 | BlaXpirit | "Error: execution of an external program failed; rerun with --parallelBuild:1 to see the error message" |
19:40:56 | superfunc | Best chance would be to talk to people who wrote prominent articles on D |
19:41:05 | flaviu | BlaXpirit: do that, see what happens |
19:41:16 | superfunc | I think there was one in wired, or something equivalent |
19:41:18 | BlaXpirit | oh sh: clang: command not found xD |
19:41:33 | * | aaaa joined #nim |
19:41:45 | dom96 | superfunc: perhaps we should email wired asking them to do a piece on Nim |
19:42:22 | superfunc | I'd be happy to send some emails out tonight |
19:42:57 | dom96 | do it |
19:43:12 | BlaXpirit | :o it fails in exactly the same way with clang |
19:43:29 | flaviu | BlaXpirit: Yes, that's why you need to try some fsanitize flags |
19:43:36 | * | gokr1 quit (Quit: Leaving.) |
19:44:17 | BlaXpirit | ok NOW it doesn't run and gives a ton of messages. |
19:45:07 | BlaXpirit | full terminal buffer of messages |
19:45:49 | BlaXpirit | almost all "undefined refence" «__asan_report_store8» and others |
19:46:10 | flaviu | try another fsanitize flag, it looks like that one requires runtime support |
19:46:32 | flaviu | I can't figure out how to get that on arch linux without spending hours compiling clang. |
19:52:36 | BlaXpirit | all the flags i try give me some random __asan __ubsan stuff |
19:53:12 | * | tani joined #nim |
19:53:26 | flaviu | try installing llvm-libs, I dunno |
19:53:45 | BlaXpirit | present |
19:55:29 | flaviu | I don't know where the problem is, sorry. |
19:56:26 | BlaXpirit | ok, thank you |
19:57:02 | * | tane quit (Ping timeout: 250 seconds) |
19:58:54 | BlaXpirit | daaamn |
19:58:58 | BlaXpirit | what if i have the wrong bool |
19:59:12 | BlaXpirit | nah |
20:00:04 | * | nullmove quit (Quit: Leaving) |
20:00:45 | * | soler_ joined #nim |
20:00:48 | * | Jesin quit (Quit: Leaving) |
20:01:24 | * | Varriount|Mobile quit (Read error: Connection reset by peer) |
20:01:40 | * | Varriount|Mobile joined #nim |
20:02:12 | * | soler_ quit (Client Quit) |
20:02:38 | * | BlaXpirit_ joined #nim |
20:02:38 | * | Varriount|Mobile quit (Read error: Connection reset by peer) |
20:02:46 | * | Var|Mobile joined #nim |
20:03:37 | * | tgkokk joined #nim |
20:04:36 | * | tani is now known as tane |
20:04:48 | reactormonk | def-, nice post |
20:04:57 | * | Jesin joined #nim |
20:05:59 | * | BlaXpirit quit (Ping timeout: 265 seconds) |
20:06:04 | def- | reactormonk: thanks! |
20:07:46 | * | gsingh93 joined #nim |
20:08:32 | BlaXpirit_ | so i'm pretty sure it was typedef int sfBool; |
20:09:30 | BlaXpirit_ | yeah, for sure |
20:10:05 | * | dts|pokeball joined #nim |
20:10:37 | BlaXpirit_ | this other guy whom I don't wanna ping too much used bool instead of cint, but only in places where it's "safe", and I didn't notice that in other places it is not allowed |
20:10:52 | * | willwillson joined #nim |
20:13:37 | * | nullmove joined #nim |
20:14:18 | * | BillsPC quit (Remote host closed the connection) |
20:15:41 | * | don_alfredo joined #nim |
20:16:24 | * | brson joined #nim |
20:16:35 | Forty-3 | I am confused as to what https://github.com/Araq/Nim/issues/557 does |
20:17:19 | BlaXpirit_ | Forty-3, anonymous function |
20:17:39 | BlaXpirit_ | .eval type Bool32 = distinct cint;converter toBool(x: Bool32): bool = return x != 0;var a = Bool32(1);if a: echo 'ok' |
20:17:43 | Mimbus | BlaXpirit_: eval.nim(4, 45) Error: type mismatch: got (Bool32, int literal(0)) |
20:17:43 | * | Mimbus quit (Excess Flood) |
20:17:44 | Forty-3 | when I do something like var x = (proc() = echo("hello!")) x() it compiles fine |
20:17:49 | * | Mimbus joined #nim |
20:17:56 | don_alfredo | Greetings Nimsters. I've been reading the tutorial and could not find a way of invoking a varargs proc with, say, a seq or an array – all examples out there were calling such procs with an explicit list of params like (1, 2, 3) |
20:17:59 | Forty-3 | but when I try to do type(x), the compiler errors |
20:18:24 | BlaXpirit_ | .eval type Bool32 = distinct cint;converter toBool(x: Bool32): bool = return cint(x) != 0;var a = Bool32(1);if a: echo 'ok' |
20:18:27 | Mimbus | BlaXpirit_: eval.nim(6, 13) Error: missing final ' for character literal |
20:18:32 | BlaXpirit_ | .eval type Bool32 = distinct cint;converter toBool(x: Bool32): bool = return cint(x) != 0;var a = Bool32(1);if a: echo "ok" |
20:18:36 | Mimbus | BlaXpirit_: 0.00407099723815918sec: ok |
20:18:40 | BlaXpirit_ | woooot |
20:18:58 | dom96 | don_alfredo: I don't think you can specify a seq or array for a varargs type. |
20:19:09 | dom96 | don_alfredo: Perhaps openarray is what you're looking for? |
20:19:58 | don_alfredo | dom96: perhaps, though the tutorial mentions it super briefly |
20:20:34 | dts|pokeball | flaviu, do you still need the timing thing on? |
20:20:52 | don_alfredo | dom96: what I am looking for is an equivalent of this Python: some_func(args*) |
20:21:03 | Forty-3 | also: what exactly does proc() do? |
20:21:08 | dom96 | don_alfredo: Try replacing 'varargs' with 'openarray'. |
20:21:40 | don_alfredo | dom96: okay, I'll try, thx |
20:21:47 | dts|pokeball | Forty-3, it looks llike it creates an instance of a procedure |
20:21:52 | dts|pokeball | like int() |
20:22:44 | Forty-3 | what does it return, though? |
20:22:49 | dom96 | don_alfredo: That said, this works for me: https://gist.github.com/dom96/1c2832e4b1f060503868 |
20:22:54 | dom96 | don_alfredo: Isn't that what you want? |
20:23:00 | Forty-3 | nimrod errors when I try to do echo(type(proc())) |
20:23:20 | BlaXpirit_ | Forty-3, what is that supposed to be anyway |
20:23:28 | BlaXpirit_ | Forty-3, proc is definition of a procedure!! |
20:23:36 | EXetoC | the type should end up in the error message though |
20:23:40 | Forty-3 | then why does it have ()? |
20:23:44 | don_alfredo | dom96: ha! this is rather cool |
20:23:47 | BlaXpirit_ | because it's proc expression |
20:24:06 | don_alfredo | dom96: I didn't expect the compiler to be this smart |
20:24:37 | dom96 | don_alfredo: hehe :) |
20:24:45 | dom96 | don_alfredo: In the case of openarray the last line won't work. |
20:24:55 | Forty-3 | what makes it different from a proc w/o parens? |
20:25:12 | BlaXpirit_ | proc x() = echo "hello" |
20:25:16 | BlaXpirit_ | do you understand this? |
20:25:32 | EXetoC | BlaXpirit_: which comment? (on nimrod-git) |
20:25:40 | EXetoC | or for |
20:25:44 | BlaXpirit_ | the most recent one :o |
20:25:58 | BlaXpirit_ | well u wrote 2 after it |
20:26:07 | BlaXpirit_ | by demizer |
20:26:41 | BlaXpirit_ | .eval (proc() = echo "hello")() |
20:26:44 | Mimbus | BlaXpirit_: 0.004066944122314453sec: hello |
20:26:49 | BlaXpirit_ | kewl |
20:26:54 | Forty-3 | BlaXpirit_: so proc x() = dostuff() is equivlant to var x = (proc() = dostuff())? |
20:27:00 | BlaXpirit_ | Forty-3, almost |
20:27:05 | BlaXpirit_ | i'm not sure actually |
20:27:24 | BlaXpirit_ | first of all, it's probably enforced to be closure function and whatnot |
20:27:35 | EXetoC | oh |
20:27:45 | dts|pokeball | BlaXpirit_, remember you were asking about the best way to alias a function last night? |
20:28:01 | nullmove | dom96, how do I install old nimrod compilers? |
20:28:01 | BlaXpirit_ | dts|pokeball, you told me this, but it didn't work for multimethods |
20:28:03 | BlaXpirit_ | so? |
20:28:11 | dts|pokeball | BlaXpirit_, i may have just figured it out |
20:28:28 | BlaXpirit_ | i've already decided against having aliases |
20:28:28 | * | vbtt joined #nim |
20:28:32 | BlaXpirit_ | but if it's good, i may reconsider |
20:28:44 | BlaXpirit_ | ahh square brackets? |
20:28:44 | Forty-3 | nullmove: have you tried cloning from git and checking out an old tag/branch? |
20:29:40 | dom96 | ^^ |
20:29:43 | nullmove | Forty-3, but how do I bootstrap it? |
20:29:53 | * | yglukhov__ joined #nim |
20:29:55 | dts|pokeball | .eval proc foo()=echo 1;proc foo(bar: int)=echo bar;let baz: proc(int)=foo;baz(3) |
20:29:57 | dom96 | oh yeah, that may be problematic. |
20:29:58 | Mimbus | dts|pokeball: eval.nim(5, 14) Error: ':' expected |
20:30:03 | Forty-3 | http://nim-lang.org/download.html#installation-from-github |
20:30:05 | dts|pokeball | hrmm |
20:30:07 | dts|pokeball | oops |
20:30:18 | dts|pokeball | .eval proc foo()=echo 1;proc foo(bar: int)=echo bar;let baz: proc(int) = foo;baz(3) |
20:30:21 | Mimbus | dts|pokeball: eval.nim(5, 14) Error: ':' expected |
20:30:22 | dom96 | Because the old C sources are not available. |
20:30:27 | Forty-3 | except you would replace master with whatever you wanted |
20:30:32 | Forty-3 | well |
20:30:41 | Forty-3 | you'd do what it said |
20:30:46 | Forty-3 | and then check out an old tag |
20:30:49 | dom96 | nullmove: Why do you want an older Nimrod compiler? |
20:30:52 | Forty-3 | before compiling |
20:31:00 | * | vbtt_ joined #nim |
20:31:01 | nullmove | Forty-3, but old csources are no longer available |
20:31:08 | Forty-3 | they're on git |
20:31:16 | dom96 | Forty-3: Not the old ones. |
20:31:26 | Forty-3 | ah, well I don't know then |
20:31:26 | dom96 | only the ones that compile 0.10.2 |
20:31:38 | nullmove | dom96, need to revive some old stuffs |
20:31:56 | dom96 | nullmove: Which version do you need? |
20:32:24 | nullmove | 0.9.6 would be fine |
20:32:40 | * | vbtt quit (Ping timeout: 255 seconds) |
20:32:54 | dom96 | nullmove: http://nim-lang.org/download/nimrod_0.9.6.zip |
20:33:35 | nullmove | dom96, it's the csources? |
20:35:05 | dts|pokeball | nullmove, the install instructions on the site are for 0.9.6 csources |
20:35:56 | * | gour quit (Remote host closed the connection) |
20:35:58 | dom96 | nullmove: It's everything. |
20:36:06 | nullmove | dts|pokeball, yes but the csources for 0.9.6 are no longer in github |
20:37:07 | dts|pokeball | nullmove, i know. but they are on the site... |
20:37:17 | * | vbtt_ quit (Ping timeout: 240 seconds) |
20:37:22 | * | founders_ joined #nim |
20:38:07 | founders_ | hi guys, Nim seems like a very nice language, congtatulations. :) Would love to see proper RAII and can GC be disabled altogether? (I work with hard-realtime systems) |
20:39:11 | * | founders_ is now known as RushPL |
20:39:15 | dom96 | hello RushPL :) |
20:39:25 | dom96 | The gc can be disabled via --gc:none |
20:39:33 | dts|pokeball | founders_, as i have had to learn the hard way, you gotta read the docs first before asking here ;) that being said, yes you can disable gc (as dom96 just said) |
20:39:53 | dts|pokeball | can nim have raii? |
20:40:21 | dom96 | dts|pokeball: If you're just curious if the language is for you then you don't have to. |
20:40:37 | dts|pokeball | dom96, oh :( so its still just me |
20:40:41 | RushPL | thanks dom96, dts|pokeball: for example in D you can disable GC as well but none of the standard libs will work - is it the case here as well? |
20:40:43 | nullmove | thanks, dom96 |
20:40:44 | dom96 | RushPL: Have you tried the GC's real-time mode yet? |
20:40:48 | flaviu | dts|pokeball: nope |
20:41:02 | dom96 | RushPL: It would be interesting to see what you think of it. |
20:41:14 | dts|pokeball | flaviu, ? |
20:41:29 | flaviu | dts|pokeball: my response to your question a while ago |
20:41:33 | dts|pokeball | ah |
20:41:40 | flaviu | is the bot done? |
20:41:56 | RushPL | dom96: not yet, I learnt of nim 2 hours ago so I just started |
20:42:17 | dom96 | RushPL: Please do check it out, it might fit your needs: http://nim-lang.org/gc.html |
20:42:32 | RushPL | thank you |
20:42:49 | BlaXpirit_ | dts|pokeball, so what were you saying? |
20:42:57 | dts|pokeball | flaviu, almost. i just want to get this fucking sandbox working before v1 |
20:43:04 | * | FreezerburnV joined #nim |
20:43:06 | * | Mimbus quit (Read error: Connection reset by peer) |
20:43:09 | dts|pokeball | imma check out a new release though |
20:43:12 | * | Mimbus joined #nim |
20:43:17 | dts|pokeball | BlaXpirit_, ignore me. i spoke too soon |
20:43:20 | BlaXpirit_ | ok |
20:43:34 | ekarlso- | the csources thing |
20:43:39 | dts|pokeball | i thought i would be able to declare the signature of the proc as the type and assign the function that way |
20:43:39 | ekarlso- | is that generated daily or smth? |
20:44:03 | flaviu | ekarlso-: it's regenerated whenever it stops working |
20:44:16 | flaviu | most compiler changes are minor enough that it can still bootstrap |
20:44:34 | dts|pokeball | what exactly are the csources? |
20:45:59 | BlaXpirit_ | are there namespaces in Nim? |
20:46:06 | BlaXpirit_ | so I can have Color.Black etc |
20:46:08 | RushPL | dom96: I am concerned of GC's binary size. For example if I am targetting microcontrollers that have only 16KBs of flash memory, wasting 4KBs for GC is too much. |
20:46:10 | EXetoC | the sources used for bootstrapping, as the compiler is written in the target language |
20:47:00 | RushPL | perhaps LTO would cut out GC if it is not used, not sure how is it set up |
20:47:04 | dts|pokeball | BlaXpirit_, uhh you can do types and/or wrap it in a module |
20:47:15 | BlaXpirit_ | module is not cool |
20:47:19 | BlaXpirit_ | what do you mean by "types"? |
20:47:39 | dom96 | RushPL: Unfortunately when you disable the GC you won't really be able to use much of the stdlib. |
20:47:40 | EXetoC | RushPL: why not just --gc:none then? |
20:47:46 | dts|pokeball | BlaXpirit_, enums rather |
20:48:05 | BlaXpirit_ | Color is an object |
20:48:10 | BlaXpirit_ | what can I do with an enum then? |
20:48:23 | RushPL | EXetoC: I barely started with nim so I am just considering possibilities, perhaps it's fine |
20:48:48 | dts|pokeball | im probably not the best person to answer, but here it goes |
20:49:16 | EXetoC | it would be cool, but barely useful |
20:49:19 | * | tgkokk quit (Ping timeout: 255 seconds) |
20:49:52 | dts|pokeball | you have an object that takes the value of an enum, and then you can do TheEnumType.Value |
20:50:08 | * | tgkokk joined #nim |
20:50:50 | * | Sphax joined #nim |
20:51:28 | * | don_alfredo quit (Quit: Page closed) |
20:52:39 | BlaXpirit_ | dts|pokeball, I have this, by the way: https://bpaste.net/show/ef3982c68eeb |
20:53:37 | * | Sphax quit (Client Quit) |
20:53:59 | * | yglukhov__ quit (Quit: Be back later ...) |
20:55:21 | dts|pokeball | hmmm, yeah lie i said im probably not the best person to answer |
20:55:28 | * | Sphax joined #nim |
20:55:28 | * | Sphax quit (Client Quit) |
21:01:56 | Forty-3 | how do I make something an ordinal? |
21:02:25 | Forty-3 | is it enough to define an ord(:type)? |
21:04:52 | def- | Ordinals are the predefined integers and enums without holes: http://nim-lang.org/manual.html#ordinal-types |
21:05:05 | def- | so you can define your own enum and it's an ordinal automatically |
21:06:01 | def- | You can make your own user defined Ord type class if you really want it: http://nim-lang.org/manual.html#user-defined-type-classes |
21:06:05 | Forty-3 | what if I have an object composed of two enums |
21:06:39 | def- | Forty-3: not going to work with the built-in ordinals, i think |
21:07:54 | MyMind | maybe is a silly question but if nim can compile to js that means I can write node apps with nim? |
21:08:55 | * | repax quit (Quit: repax) |
21:09:11 | def- | MyMind: i think so, try nim js -d:nodejs hello.nim |
21:10:04 | Forty-3 | def-: what does the 'is' operator do? |
21:10:46 | def- | MyMind: then you can run node nimcache/hello.js |
21:11:08 | MyMind | undeclared readLine says |
21:11:37 | def- | Yeah, not everything implemented for the js backend |
21:12:43 | MyMind | what is implemented ? |
21:14:18 | MyMind | I just started reading docs and I'm astonished |
21:14:20 | def- | I don't know |
21:14:28 | MyMind | it's really awesome |
21:15:08 | dom96 | MyMind: We mostly focused on getting it working in the browser. |
21:15:23 | * | nullmove quit (Ping timeout: 272 seconds) |
21:15:26 | dom96 | MyMind: Here is a script that's in production https://github.com/Araq/Nim/blob/devel/web/nimblepkglist.nim |
21:15:35 | MyMind | yeah I guess readline has no much sense |
21:15:45 | dom96 | indeed |
21:16:30 | Forty-3 | def-: I am confused by the examples you gave. Do you have some code which uses these types? |
21:17:31 | * | BillsPC joined #nim |
21:17:37 | * | yglukhov__ joined #nim |
21:17:57 | def- | Forty-3: i gave examples? |
21:18:05 | Forty-3 | http://nim-lang.org/manual.html#user-defined-type-classes |
21:18:18 | Shoozza | Anyone who got nim to work with MSYS2? I'm getting _wfopen ld errors |
21:19:19 | def- | Forty-3: only this one: https://github.com/def-/nim-unsorted/blob/master/typeclass.nim |
21:20:13 | def- | Forty-3: to make your object a Comparable in the example from the manual, all you need to do is implement proc `<`(x,y: MyObject): bool = ... |
21:20:20 | MyMind | what editor/IDE you use for Nim? |
21:20:42 | def- | MyMind: there is support for many: https://github.com/Araq/Nim/wiki/Editor-Support |
21:20:44 | Forty-3 | so comparable is like an interface |
21:20:56 | Var|Mobile | Shoozza: Msys2? |
21:20:57 | dymk | Hello |
21:21:16 | Forty-3 | where you garuntee that you have implemented x < y |
21:21:26 | MyMind | I'm trying with nimlime |
21:21:27 | Shoozza | valberg, http://sourceforge.net/projects/msys2/ |
21:21:44 | dymk | I read the article "what's special about Nim", and I thought that generally term rewriting macros were considered bad practice because of how hard they are to verify as correct? |
21:22:12 | Shoozza | * Var|Mobile |
21:22:17 | dymk | I forget where/whom I heard that from, but it was in some sort of list about the more "experimental" features of the language |
21:22:17 | * | FreezerburnV quit (Quit: FreezerburnV) |
21:22:27 | Var|Mobile | dymk: Well, they should generally only be used when needed |
21:22:28 | flaviu | dymk: but library authors are especially smart, so they can use them ;) |
21:23:14 | dymk | And then the examples given in the language for optimizing boolean logic, surely the underlying C compiler can perform those exact transformations |
21:23:17 | Forty-3 | def-: do you have an example of imperative types? |
21:23:39 | BlaXpirit_ | I have template defDraw(name: expr). how can I make it work the same but accept unexisting identifiers as its argument? |
21:23:51 | * | irrequietus quit () |
21:23:52 | dts|pokeball | flaviu, ive checked out a new release of moe. what was i supposed to run now? |
21:24:04 | Forty-3 | dymk: yes, but that's missing the point; he's simply using trivial code to demonstrate the capabilities of the language |
21:24:05 | Var|Mobile | Shoozza: I think Demos uses Msys2... I myself use Mingw-w64 and regular Msys |
21:24:13 | dymk | Forty-3, alright, that makes sense |
21:24:24 | Demos | I use msys2, or just the microsoft stack |
21:24:30 | Demos | like MSVC and such |
21:24:54 | flaviu | dts|pokeball: make it a setuid executable that is owned by root |
21:25:08 | def- | dymk: these term rewriting templates may be more interesting: https://github.com/def-/nim-bigints/blob/master/src/bigints.nim |
21:25:34 | BlaXpirit_ | wait, i'm stupid, nevermind |
21:25:41 | def- | dymk: i use them to prevent allocations with bigints whenever possible |
21:25:52 | dts|pokeball | chmod ug+s run/bin/isolate; chown root run/bin/isolate; chgrp root run/bin/isolate |
21:25:53 | dts|pokeball | ? |
21:26:17 | Shoozza | Var|Mobile, did you have to change something in the cfg file to make it use mingw-w64-gcc? |
21:26:25 | flaviu | dts|pokeball: I guess |
21:26:25 | def- | Forty-3: Not sure, I think the "for value in c: type(value) is T" is imperative? |
21:27:21 | dymk | def-, now that is really cool, thanks for the link |
21:27:32 | * | no_name joined #nim |
21:27:40 | * | tane quit (Quit: Verlassend) |
21:27:45 | * | nullmove joined #nim |
21:28:06 | def- | dymk: I totally forgot that I wrote those, should update my post^^ |
21:28:15 | Var|Mobile | Shoozza: As opposed to what? I make sure that I only have one compiler in my path environment at any one time |
21:28:29 | no_name | hey all, newbie nim user here, trying to get started on a 64bit win8.1 box, installed the nim installer and hello world is failing to compile out of the box |
21:28:57 | Var|Mobile | no_name: What errors are you getting? |
21:29:39 | no_name | C:\Nim\lib/nimbase.h:385:13: error: size of array 'assert_numbits' is negative |
21:30:47 | no_name | google says my compiler is 32-bit? http://forum.nimrod-lang.org/t/602 but I'm using the built-in compiler that was loaded with the installer |
21:31:09 | Shoozza | Var|Mobile, thanks i changed my path and it uses Mingw-w64's compiler instead the one from MSYS2 and it compiles now ;) |
21:31:18 | Var|Mobile | no_name: Gah, I thought we had uploaded the new installer |
21:31:51 | no_name | thats partly why I came here to let you know. with the recent blog posts, you're likely to get a bunch of folks like me |
21:32:01 | * | alexruf quit (Ping timeout: 265 seconds) |
21:32:20 | no_name | do I just need to tweak an environment path? |
21:32:47 | * | alexruf joined #nim |
21:32:58 | dymk | Is the compiler a good source of idomatic Nim code? |
21:33:06 | dymk | or should I treat it like Rust's compiler? |
21:33:54 | flaviu | I hope it's not considered idomatic... |
21:34:46 | alexruf | oh man there are too man programming languages popping up. to hard to choose one. |
21:35:05 | BlaXpirit_ | alexruf, don't worry, i've checked out them all |
21:35:12 | BlaXpirit_ | and this one is my final choice |
21:35:17 | * | vbtt joined #nim |
21:35:35 | alexruf | great, will there be an article about your research ? |
21:35:40 | BlaXpirit_ | no |
21:35:48 | BlaXpirit_ | what am i supposed to write there |
21:35:54 | BlaXpirit_ | this one sux, this other one is 2hard4me |
21:36:19 | BlaXpirit_ | there are probably existing rants about every language anyway |
21:36:20 | dom96 | dymk: The compiler was translated from Pascal at one point in time so perhaps not. Take a look at Nimble instead. |
21:36:21 | * | Mat4 joined #nim |
21:36:26 | Mat4 | hi all |
21:36:34 | dymk | dom96, thanks, noted |
21:36:36 | alexruf | whats your favourite at the moment? i am strugling between go, rust and nim |
21:37:02 | BlaXpirit_ | alexruf, i've already told you. |
21:37:13 | dymk | alexruf, you didn't ask me, but out of the "non-mainstream" languages that I know, I program in D a lot |
21:37:23 | BlaXpirit_ | I didn't actually read any tutorial on Go, I saw how bad it is in one glance |
21:37:29 | dymk | but right now i'm evaluating nim because i don't like the stagnation in the community |
21:37:41 | BlaXpirit_ | Rust is indeed 2hard4me and its advantages don't outweigh its verbosity |
21:37:44 | wan | alexruf: spend a week with each, then make a decision |
21:38:17 | dom96 | wow, we're so close to 100 users in here! |
21:38:22 | dymk | BlaXpirit_, i don't think rust is that bad, once you get past the verbosity |
21:38:31 | BlaXpirit_ | I didn't say it's bad |
21:38:34 | alexruf | jup Go was too limited for me... lack of generics and stuff like thos |
21:38:36 | alexruf | this |
21:38:41 | dymk | it's the heavyweight nature of the compiler that gives me the heebie jeebies |
21:38:56 | wan | dom96: if we keep having one article every two days on HN, it should grow exponentially from there |
21:39:03 | flaviu | dom96: that excuse doesn't work on my favorite file: https://github.com/Araq/Nim/blob/devel/compiler/vm.nim |
21:39:05 | Mat4 | Go is somewhat more readable than C in my opinion (that's an advantage) |
21:39:27 | dom96 | wan: Let's post onionhammer article next :) |
21:39:32 | BlaXpirit_ | we're not comparing to C |
21:39:37 | BlaXpirit_ | C is the new assembler |
21:40:04 | * | filcuc joined #nim |
21:40:10 | Mat4 | assembler sounds good |
21:40:11 | * | Nimbus joined #nim |
21:40:16 | dts|pokeball | eval echo 1 |
21:40:16 | Nimbus | dts|pokeball: Must be started as root |
21:40:17 | dymk | pft javascript is the new assembler, obviously ;) |
21:40:20 | filcuc | hi all |
21:40:21 | dts|pokeball | fml |
21:40:25 | BlaXpirit_ | (...as new as a 43 year old language can be) |
21:40:35 | dymk | hi filcuc |
21:40:46 | Mat4 | hello filcuc |
21:40:52 | * | Nimbus quit (Remote host closed the connection) |
21:41:09 | * | Nimbus joined #nim |
21:41:19 | * | Nimbus quit (Remote host closed the connection) |
21:41:33 | BlaXpirit_ | NIMROD IS AMAZING OMFG |
21:41:38 | no_name | Var|Mobile: so should I re-download the installer, or is there a simple work-around? |
21:41:39 | BlaXpirit_ | the simplicity of ffi |
21:41:40 | BlaXpirit_ | omg |
21:41:44 | BlaXpirit_ | it's so good |
21:41:45 | flaviu | Besides having to write 3 lines of error handling for every logic line, C is pretty nice |
21:41:46 | * | Nimbus joined #nim |
21:41:47 | alexruf | the main point is that it's not all about the language... the community is an very important factor. |
21:41:53 | no_name | yeah, the ffi stuff is really awesome IMHO |
21:42:11 | dymk | alexruf, preach brutha |
21:42:13 | no_name | once I get going, I'm seriously considering contributing to libraries and whatnot |
21:42:17 | BlaXpirit_ | 2 days of binge coding, and i finally get it all |
21:42:18 | * | Nimbus quit (Remote host closed the connection) |
21:42:31 | flaviu | BlaXpirit_: There's another sort of coding? |
21:42:31 | Mat4 | BlaXpirit_: C is for sure way more limited than any assembler language I know (however assembler languages tend not to be platform independent in some degree) |
21:42:37 | dom96 | no_name: awesome |
21:42:42 | BlaXpirit_ | bye bye, C and C++. hello, Nim |
21:42:42 | * | Nimbus joined #nim |
21:42:43 | ekarlso- | how u mean dom96 with docs on the packages site ? |
21:43:10 | dom96 | ekarlso-: Clone each Nimble package, execute nim doc2 on each file, make those files accessible via your website. |
21:43:30 | no_name | I'm a python guy who has been messing with haskell and Go over the last to years. Nim appears to solve a lot of the pain points I've had with those other two |
21:43:31 | EXetoC | BlaXpirit_: yay |
21:44:10 | ekarlso- | dom96: o["description"] = %pkg.description < when trying to assing from a string that is 0 |
21:44:24 | dts|pokeball | how do i add command line options to a .nim.cfg file again? |
21:44:32 | dts|pokeball | is it just option: value? |
21:44:51 | dom96 | --opt:val |
21:44:53 | dom96 | or |
21:44:55 | dom96 | opt = val |
21:45:01 | alexruf | how does the development of nim work? who make the decitions where the development does? |
21:45:05 | dom96 | ekarlso-: i'm not sure what you mean? |
21:45:11 | dts|pokeball | --opt:val in a .cfg file dom96 ? |
21:45:17 | dom96 | yeah |
21:45:26 | dts|pokeball | huh. ty |
21:45:28 | flaviu | alexruf: Araq does |
21:45:29 | dom96 | alexruf: Our BDFL, Araq. |
21:45:43 | * | vbtt quit (Ping timeout: 244 seconds) |
21:45:54 | alexruf | so it's kinda one man show? |
21:46:05 | ekarlso- | dom96: I try to do o["description"] = pkg.description but then on that line it goes: o["description"] = %pkg.description if pkg.description else "" |
21:46:06 | flaviu | Mostly. |
21:46:11 | ekarlso- | ehm SIGSEGV: Illegal storage access. (Try to compile with -d:useSysAssert -d:useGcAssert for details.) |
21:46:27 | alexruf | the linus torvalds of nim? |
21:46:30 | dom96 | ekarlso-: o or pkg is nil? |
21:46:48 | ekarlso- | dom96: hmm, how to work around it ? |
21:47:10 | dom96 | alexruf: It's not exactly a one man show. There is a hefty amount of contributors by now. |
21:47:11 | flaviu | Other people contribute to libraries and such, but Araq is the one who does most the compiler changes. |
21:47:47 | dom96 | Also, Araq does discuss design decisions with everyone and takes everybody's input. |
21:47:49 | dts|pokeball | alexruf, essentially. he kind of doles out responsibilities to key people, like dom and Varriount_ |
21:47:59 | alexruf | hmm don't know if i like that. nothing agains Araq... but what if he makes the wrong decisions? |
21:48:12 | dts|pokeball | whose to say its the wrong one? |
21:48:13 | flaviu | alexruf: It's open source. Fork it. |
21:48:32 | alexruf | forking ist not the answer |
21:48:34 | ekarlso- | hmm, dom96 what's the way to set json null or so in nim ? |
21:48:43 | def- | alexruf: I've seen Araq implement decisions which he personally doesn't prefer |
21:48:54 | ekarlso- | hmm, dom96 what's the way to set json null or so in nim ? |
21:48:58 | ekarlso- | ehm, wrong win |
21:49:15 | dts|pokeball | and just because you dont like the thing alexruf doesnt mean he made the wrong choice |
21:49:54 | dom96 | ekarlso-: http://nim-lang.org/json.html#newJNull, |
21:50:07 | dom96 | alexruf: Somebody needs to make the decisions. |
21:50:08 | alexruf | dts|pokeball: yes but i think if a OS project grows, it's always good to involve the community in key decisions |
21:50:23 | dom96 | alexruf: Like I said, the community is involved. |
21:51:04 | alexruf | thats good to hear... would be bad if nim someday end in an situation like python 2 vs. 3 |
21:51:18 | dts|pokeball | python 2 vs 3 needed to happen |
21:52:18 | dts|pokeball | and anyways, python is OS as well |
21:52:23 | ekarlso- | same as perl... |
21:52:30 | ekarlso- | new versions never seemed to happen ? |
21:53:12 | alexruf | yes but the 2 vs. 3 discussion splitts the python community |
21:53:47 | dts|pokeball | youre going to have that with literally almost anything |
21:53:58 | dom96 | alexruf: Such breaking changes are far more serious for interpreted languages than compiled ones though. |
21:54:11 | * | sjiitr joined #nim |
21:54:15 | dts|pokeball | ##c is split on c11 and c99 |
21:54:22 | dom96 | If something like that were to happen to Nim then the problems wouldn't be as severe. |
21:55:17 | ekarlso- | hmm, what's the optimal way to loop over a seq and execute a function for each element ? |
21:55:26 | flaviu | Why would it be more serious for an interpreted language? |
21:55:26 | ekarlso- | I was thinking something like a py list compreh but |
21:56:14 | * | Varriount|Remote joined #nim |
21:56:15 | * | gokr quit (Remote host closed the connection) |
21:56:20 | alexruf | since breaking language changes have impact on the ecosystem arround the language it would also have the same impact to compiled langues |
21:56:34 | nullmove | someone with macro skilz should write on it next |
21:56:45 | nullmove | maybe something like this: https://danielkeep.github.io/quick-intro-to-macros.html |
21:57:00 | dymk | Is the implicit "result" variable something people use commonly? It seems like something that'd generally make execution flow hard to follow |
21:57:14 | * | Boscop_ joined #nim |
21:57:16 | Varriount|Remote | dymk: Actually, yes it's used commonly |
21:57:20 | * | superfunc quit (Quit: Connection closed for inactivity) |
21:57:28 | alexruf | dom96: and like somebody already sayed "if you don't like it- fork" |
21:57:33 | dymk | interesting |
21:57:35 | Varriount|Remote | dymk: And no, it doesn't tend to make things harder to follow |
21:58:35 | Varriount|Remote | dymk: It's convenient, especially for procedures which construct their results. `return` is only used when it's control-flow properties are needed. |
21:58:50 | * | vbtt joined #nim |
21:58:56 | flaviu | `result` is like an imperative fold. |
21:58:58 | dymk | What's the value of "result" upon its first access? |
21:59:23 | * | Nimbus quit (Remote host closed the connection) |
21:59:28 | BlaXpirit_ | 0 |
21:59:33 | flaviu | whatever the default intialization for that type is |
21:59:37 | ekarlso- | Hmm, I was wondering about the pkg thing dom96 |
21:59:37 | * | jez0990_ joined #nim |
21:59:40 | * | MightyJoe joined #nim |
21:59:49 | dymk | flaviu, ah alright |
21:59:54 | flaviu | Which tends to be nil or 0 |
22:00:00 | Triplefox | I didn't even know there was a named "result" |
22:00:09 | Varriount|Remote | Triplefox: The more you know! |
22:00:11 | * | Boscop quit (Ping timeout: 244 seconds) |
22:00:20 | * | Nimbus joined #nim |
22:00:33 | ekarlso- | current setup uses packages.json uses a URL towards where it is |
22:00:34 | nullmove | aaand we crossed 100 active users :) |
22:00:45 | dom96 | nullmove: wooh |
22:00:51 | Varriount|Remote | flaviu: Can Mimbus be pm'd with commands? |
22:01:05 | ekarlso- | but I was wondering if change the url maybe to like a "releases" maybe or smth |
22:01:14 | flaviu | Varriount|Remote: Nope |
22:01:14 | ekarlso- | so that u could say publish a release tarball or smth? |
22:01:16 | Varriount|Remote | .eval echo "Hello Everyone" |
22:01:19 | flaviu | but ask dts|pokeball |
22:01:19 | Mimbus | Varriount|Remote: Hello Everyone |
22:01:41 | flaviu | Varriount|Remote: Try going in #nim-offtopic if you want to chat with mimbus without spamming |
22:01:41 | MyMind | is getting closer to Julia ... 110 vs 101 |
22:02:05 | dymk | we even beat #volt's 9! |
22:03:29 | dts|pokeball | Varriount|Remote, uh he should |
22:03:36 | * | qwebirc559939 joined #nim |
22:03:37 | dts|pokeball | ive never tested it though |
22:03:48 | * | willwillson_ joined #nim |
22:04:12 | * | Nimbus quit (Remote host closed the connection) |
22:04:25 | qwebirc559939 | Hm |
22:04:29 | * | Varriount|Remote quit (Disconnected by services) |
22:04:36 | * | Boscop__ joined #nim |
22:04:38 | * | qwebirc559939 is now known as Varriount|Remote |
22:04:43 | * | Nimbus joined #nim |
22:04:45 | dom96 | hello qwebirc559939 |
22:04:58 | Varriount|Remote | dom96: It's meee!! |
22:05:18 | dom96 | oh it's varriount |
22:05:20 | nullmove | lol |
22:05:36 | Varriount|Remote | dom96: That's all I get? An 'Oh'? |
22:05:53 | * | Var|Mobile quit (Ping timeout: 256 seconds) |
22:05:54 | * | jez0990 quit (Ping timeout: 256 seconds) |
22:05:54 | * | cyraxjoe quit (Ping timeout: 256 seconds) |
22:05:55 | * | willwillson quit (Ping timeout: 264 seconds) |
22:05:55 | * | FreezerburnV joined #nim |
22:05:55 | Varriount|Remote | I feel unloved. ;p |
22:06:10 | dts|pokeball | you should |
22:06:14 | dom96 | yaaaaayyy it's varriount |
22:06:39 | no_name | hrms.. so I installed mingw-64, and I'm having troubles getting nim to play nice |
22:07:02 | * | Boscop_ quit (Ping timeout: 250 seconds) |
22:07:04 | no_name | I think my previous problem was I have a bunch of 32-bin mingw's in my PATH due to haskell being installed on this box |
22:07:18 | dom96 | Varriount|Remote: I love you |
22:07:25 | Varriount|Remote | dom96: Aww. |
22:07:45 | flaviu | .give Varriount|Remote a hug |
22:07:47 | Mimbus | Varriount|Remote: eval.nim(3, 0) Error: undeclared identifier: 'a' |
22:07:56 | flaviu | .give Varriount|Remote echo("a hug") |
22:07:59 | Mimbus | Varriount|Remote: a hug |
22:08:16 | * | Boscop joined #nim |
22:08:16 | * | Boscop quit (Changing host) |
22:08:16 | * | Boscop joined #nim |
22:08:22 | Varriount|Remote | no_name: Here's what I generally do: I have two batch files, one that sets up a 32-bit environment, and one that sets up a 64-bit environment |
22:09:04 | no_name | Varriount|Remote: I've been modifying start.bat to do just that |
22:09:08 | * | tgkokk quit (Ping timeout: 264 seconds) |
22:09:33 | no_name | Varriount|Remote: now gcc in the 64-bit mingw is telling me gcc.exe: error: CreateProcess: No such file or directory |
22:09:49 | Varriount|Remote | O_o |
22:10:14 | Varriount|Remote | no_name: That's odd... |
22:10:25 | no_name | I only get that if I copy/paste the gcc commandline that failed at verbosity:4 from nim c, nim c just says "Error: unhandled exception: The system cannot find the file specified" |
22:10:50 | * | Boscop__ quit (Ping timeout: 244 seconds) |
22:11:13 | no_name | not sure if I selected the right mingw-64 variant in the installer |
22:11:21 | * | tgkokk joined #nim |
22:11:29 | Varriount|Remote | no_name: Which installer? The Nim installer? |
22:11:38 | no_name | I picked x86_64-4.9.2-posix-seh-rt_v3-rev1 |
22:11:51 | no_name | Varriount|Remote: no the ming64 installer |
22:12:01 | Varriount|Remote | no_name: If you need interactive help, we could use teamviewer |
22:12:10 | no_name | ok |
22:13:37 | * | vbtt quit (Ping timeout: 244 seconds) |
22:15:28 | * | Nimbus quit (Remote host closed the connection) |
22:16:03 | * | Nimbus joined #nim |
22:21:18 | * | FreezerburnV quit (Quit: FreezerburnV) |
22:23:40 | dymk | Does nim have a compile time evan? |
22:23:42 | dymk | *eval |
22:24:02 | dymk | e.g. const x = eval("1 + 2") |
22:24:11 | dymk | a-la D's mixin |
22:25:00 | ekarlso- | will Nim have support for /* */ for docs ? |
22:25:20 | dts|pokeball | dymk, no clue, but you can kind of do what i do with nimbus i guess |
22:25:59 | dymk | dts|pokeball, I ask because it's basically required to port https://github.com/dymk/temple to nim |
22:26:18 | Varriount|Remote | ekarlso-: No. |
22:26:27 | ekarlso- | Varriount|Remote: why not ? :/ |
22:26:37 | dymk | perhaps I could get away with writing the generated template to a file, as nim has those compile-time file I/O stuff |
22:26:52 | no_name | ekarlso-: because it's not interpretted |
22:27:00 | ekarlso- | kk |
22:27:05 | Varriount|Remote | ekarlso-: Mainly because we already have doc-comments (##), and those kind of comments complicate parsing. |
22:27:16 | ekarlso- | rust |
22:27:20 | ekarlso- | does have it but -,,- |
22:28:21 | nullmove | dymk, not familiar with D but you can use parseStmt and parseExpr from macros module to construct the AST of valid nim statement/expression for further use |
22:28:34 | dymk | nullmove, that's perfect |
22:29:11 | EXetoC | Varriount|Remote: and the proposed changes on github? I don't know if they are also for doc comments |
22:29:57 | EXetoC | https://github.com/Araq/Nim/issues/1535 |
22:32:22 | * | tgkokk quit (Ping timeout: 245 seconds) |
22:32:25 | dymk | i have a few notes for the tutorial |
22:32:44 | dymk | It throws *so much* new syntax at you, along with a bunch of built-in datatypes that nim supports |
22:33:11 | dymk | i'd suggest introducing the datatypes that'd be more familiar to new users, such as objects and enums, and going over value vs reference passing |
22:33:56 | dymk | then later on introducing sets, sequences, subtype ranges, etc |
22:34:25 | Varriount|Remote | dymk: Well, technically speaking, it's more like 'value vs reference assignment' |
22:34:50 | dymk | Varriount|Remote, how do you mean? |
22:35:03 | Varriount|Remote | Since, unless you use the `byCopy` pragma, all procedure arguments greater than x bytes are passed via pointer |
22:35:08 | EXetoC | this http://nim-by-example.github.io/ needs to go in the topic, which no one reads, but still :p |
22:35:21 | ldlework | hehe |
22:35:40 | dymk | Varriount|Remote, hm, is it easy to tell for any variable what's being passed by ref and what's being passed by value? |
22:35:57 | ldlework | heh |
22:35:59 | dymk | like what if I want to use some large struct passed in as an argument as a temporary variable later |
22:36:24 | dymk | but it was actually passed via ref, and thus is modifying the data in a higher stack frame |
22:37:23 | Varriount|Remote | dymk: Ref tyes are passed via ref. Object types whose size is greater than that of a pointer are passed via ref. `Var` parameters are passed via ref. Everything else is passed via value. |
22:37:30 | * | alexruf quit (Quit: Textual IRC Client: www.textualapp.com) |
22:37:32 | ekarlso- | nimble -y install -d:useSysAssert -d:useGcAssert < isn't it like that ? |
22:37:45 | Varriount|Remote | dymk: Keep in mind that arguments can't be modified unless they are var types |
22:38:01 | dymk | So objects can be passed via ref or value, depending on the arch they're compiled on? |
22:38:08 | Forty-3 | is there a better way to initialize base_deck in this example: http://ur1.ca/jamu2 |
22:38:54 | EXetoC | dymk: yes |
22:38:54 | * | jefus__ joined #nim |
22:39:14 | dymk | hm |
22:39:30 | * | vbtt joined #nim |
22:39:43 | ekarlso- | dom96: is there a good way to ensure that all keys are passed ? |
22:40:04 | dom96 | ekarlso-: keys? |
22:40:19 | dymk | I guess that's not an issue if arguments can't be changed |
22:40:20 | EXetoC | dymk: which does reduce the mental overhead somewhat |
22:40:37 | ekarlso- | dom96: like {"name": "foo"} u want to check that "name" is there and is string |
22:40:40 | Varriount|Remote | Forty-3: You could use sequence comprehensions to simplify the new_deck procedure. |
22:41:01 | dom96 | ekarlso-: Please look at the documentation: http://nim-lang.org/json.html |
22:41:07 | dom96 | ekarlso-: It's got all the functions you need. |
22:41:13 | dom96 | ekarlso-: What you want in this case is hasKey. |
22:41:36 | Varriount|Remote | Forty-3: http://nim-lang.org/future.html |
22:41:58 | flaviu | Forty-3: `Card = object of TObject` is not a good idea. If you place that inside a seq[TObject], you'll get the fields chopped off. You probably want to use `Card = object` instead |
22:42:17 | * | jefus_ quit (Ping timeout: 240 seconds) |
22:42:26 | flaviu | Or maybe `Card = ref object of TObject`, although you don't really need allocation here. |
22:42:34 | Forty-3 | flaviu: I saw that in the tutorial >.> |
22:42:51 | RushPL | what's the blessed way to spawn processes in nim? is there some convenience library with async goodies? |
22:43:35 | * | vbtt quit (Ping timeout: 244 seconds) |
22:43:43 | Varriount|Remote | RushPL: The osproc module |
22:44:01 | ekarlso- | dom96: does jester support static file serving ? |
22:44:12 | dom96 | ekarlso-: yes |
22:44:15 | RushPL | cheers, all right I see the doc http://nim-lang.org/osproc.html |
22:44:21 | dom96 | ekarlso-: look at jesters readme |
22:44:29 | Forty-3 | Varriount: thanks, that looks like what I'm looking for |
22:44:44 | nullmove | Varriount|Remote, the manual mentions of type RawFlowVar but I can't find it in threadpool |
22:45:03 | nullmove | did it got renamed to FlowVarBase? |
22:45:04 | dom96 | flaviu: I don't think that will happen. |
22:45:16 | Varriount|Remote | nullmove: Um, what is your statement in reference to? |
22:45:59 | nullmove | in the first example here: http://nim-lang.org/manual.html#spawn-statement |
22:46:05 | flaviu | .give dom96 type T = object of TObject; a: int;let x: TObject = T( a : 2 );echo x.a |
22:46:08 | Mimbus | dom96: eval.nim(6, 6) Error: undeclared identifier: 'a' |
22:46:12 | nullmove | sorry second example |
22:46:30 | nullmove | var responses = newSeq[RawFlowVar](3) |
22:46:38 | flaviu | .give dom96 type T = object of TObject; asd: int;let x: TObject = T( asd : 2 );echo T(x).asd |
22:46:38 | nullmove | what is RawFlowVar? |
22:46:41 | Mimbus | dom96: 0 |
22:46:51 | flaviu | dom96: looks like it just did happen |
22:47:01 | Varriount|Remote | nullmove: Let me look in threadpool.nim |
22:47:03 | flaviu | Forty-3: Thanks, the tutorial is wrong in this case then. |
22:47:34 | Forty-3 | http://nim-lang.org/tut2.html is what I was looking at |
22:47:39 | Varriount|Remote | nullmove: Does 'FlowVar' work? |
22:47:53 | dom96 | flaviu: I'd say that it might be a bug then |
22:48:01 | flaviu | dom96: It's not |
22:48:11 | flaviu | how would that be a bug? |
22:48:36 | ekarlso- | nimble -y install -d:useSysAssert -d:useGcAssert < isn't it like that ? |
22:48:45 | def- | ekarlso-: what are you trying to do? |
22:48:53 | flaviu | You're telling the compiler to make room for n bytes, and then you're telling it to assign n+8 bytes. It's obviously your fault. |
22:49:13 | ekarlso- | def-: I get some error in between that tells me to turn on that.. |
22:49:17 | dom96 | flaviu: I get an invalid conversion error at runtime |
22:49:31 | def- | ekarlso-: sorry, i didn't follow. what are you trying to do? |
22:50:30 | dymk | are the "traced" references the docs refer to only traced in that they're on the GC heap, and GC tracked? |
22:51:13 | flaviu | dom96: Looks like I should update mimbus's compiler then |
22:51:41 | BlaXpirit_ | "mimbus" is such a tease |
22:51:44 | BlaXpirit_ | like... |
22:51:57 | BlaXpirit_ | "nimbus" "nim..." but no, you have to name it "mimbus" |
22:52:07 | flaviu | although it gives me a random value with -d:release |
22:52:16 | * | Mat4 left #nim (#nim) |
22:52:20 | flaviu | BlaXpirit_: Yep, dts|pokeball is the one making Nimbus |
22:52:30 | flaviu | I don't want conflicts with names |
22:52:38 | BlaXpirit_ | aha............ |
22:55:34 | Varriount|Remote | flaviu: What is Mimbus vs. Nimbus ? |
22:56:10 | flaviu | Nimbus is the bot that dts|pokeball is creating, Mimbus is the fork that I'm administering temporary. |
22:56:33 | Varriount|Remote | dymk: Yes. |
22:57:03 | Varriount|Remote | Brb, getting foods |
22:57:22 | nullmove | Varriount|Remote, it might but I don't it's relevant |
22:58:30 | nullmove | RawFlowVar produces Error: undeclared identifier so it's no longer there |
22:59:27 | nullmove | it's probably renamed to FlowVarBase now |
22:59:48 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:01:13 | * | filcuc quit (Quit: Konversation terminated!) |
23:01:54 | Forty-3 | ok, so I updated the code I was working on, but not it fails with "deck.nim(23, 52) Error: constant expression expected": http://ur1.ca/jan60 |
23:02:00 | Forty-3 | *now |
23:04:27 | * | vbtt joined #nim |
23:04:55 | Varriount|Remote | Just so you all know, the style guide for Nim is located at https://github.com/Araq/Nim/wiki/NEP-1-:-Style-Guide-for-Nimrod-Code |
23:06:56 | * | Forty-3 has no style |
23:07:04 | Varriount|Remote | :< |
23:07:18 | * | Forty-3 also never has to work with others on code |
23:07:30 | Forty-3 | which may be a contributing factor |
23:07:40 | * | uyppp joined #nim |
23:07:42 | * | nullmove quit (Ping timeout: 250 seconds) |
23:07:51 | Varriount|Remote | Hello uyppp |
23:08:01 | uyppp | hey |
23:08:54 | * | vbtt quit (Ping timeout: 244 seconds) |
23:09:33 | fowlmouth | /topic |
23:10:26 | ekarlso- | so, bootstrap, foundation or angular material ? |
23:10:34 | Varriount|Remote | ekarlso-: Huh? |
23:10:46 | ekarlso- | for nim packages site.. |
23:11:28 | fowlmouth | ? |
23:11:44 | Forty-3 | so does anyone know why http://ur1.ca/jan60 fails to compile? |
23:12:38 | fowlmouth | Forty-3, did the compiler crash or do you have an error |
23:13:28 | Forty-3 | eck.nim(23, 52) Error: constant expression expected |
23:13:35 | Varriount|Remote | Forty-3: Looking into it.. |
23:14:01 | ekarlso- | what js preprocessor does people use ? |
23:15:08 | ekarlso- | ehm, nvm |
23:15:18 | def- | Forty-3: you can use "let" instead of "const" |
23:16:01 | Forty-3 | def-: does that also force compile time evaluation? |
23:16:20 | def- | I think list comprehensions don't work at compile time, maybe I can fix it |
23:17:16 | Forty-3 | hm, that was the main reason I was using them |
23:17:25 | Varriount|Remote | def-: Yeah, the C compiler throws an error when I move the list comprehension into a procedure. |
23:18:06 | * | BlaXpirit_ quit (Quit: Quit Konversation) |
23:18:09 | Forty-3 | is there a way to see intermediate code after macros/templates are evaluated but before the code is compiled to c? |
23:18:42 | Varriount|Remote | Forty-3: Not really. macros and templates aren't expanded in a single pass, they are expanded and run as they are encountered. |
23:19:03 | Varriount|Remote | Forty-3: Though, thinking about it, you might be able to use something from the macros modules |
23:19:11 | fowlmouth | Forty-3, at the end of my macros i usually put when defined(debug): echo(repr(result)) |
23:19:35 | fowlmouth | that way when you compile with -d:debug it prints the generated code at compile time |
23:21:43 | Varriount|Remote | Forty-3: echo(repr(getAst(expression))) should do it at runtime |
23:22:12 | Varriount|Remote | You'll need to import the macros module though. |
23:22:47 | Forty-3 | "deck.nim(25, 19) Error: 'lc[Card(suit: s, value: v) | (s <- CardSuits, v <- CardValues), Card]' is no macro or template" |
23:23:20 | flaviu | ekarlso-: something simple seems to be typical |
23:23:31 | flaviu | the docs use http://cobyism.com/gridism/ |
23:24:06 | ldlework | fowlmouth: that's pretty cool |
23:24:32 | Varriount|Remote | That's... odd. |
23:25:24 | Varriount|Remote | Forty-3: Frankly, I think the original way is just as good. the list comprehension mechanism is in the future module for a reason. |
23:25:57 | Forty-3 | Varriount: it just seems weird to define a function and use it exactly once |
23:26:18 | Forty-3 | like it should be in a static block or something |
23:26:28 | def- | make it a compile time proc? |
23:26:30 | Varriount|Remote | Forty-3: *shrug* |
23:26:45 | * | Demos_ joined #nim |
23:28:02 | * | yglukhov__ quit (Quit: Be back later ...) |
23:29:58 | * | Demos quit (Ping timeout: 255 seconds) |
23:31:24 | ldlework | Am I right in thinking that there's no real way to do dynamic field binding in Nim |
23:31:28 | ldlework | What I mean by that is |
23:31:43 | ldlework | Being able to handle when some field on some struct is assigned to, having some handler that gets run |
23:31:54 | ldlework | because `=` is not overridable? |
23:32:05 | * | yglukhov__ joined #nim |
23:32:56 | fowlmouth | ldlework, the trick is to define accessors |
23:33:05 | ldlework | oh interesting |
23:33:24 | jpoirier | Is there any documentation (or code) about starting the compiler as a service (--server.type:TYPE)? |
23:33:25 | fowlmouth | ldlework, 'foo' is not a field on Bar, its a property |
23:33:57 | fowlmouth | ldlework, so you define `foo` and `foo=` for Bar to retrieve that info |
23:34:06 | ldlework | fowlmouth: that's cool thanks |
23:35:05 | fowlmouth | ldlework, you might be able to use that for your issue from yesterday, call the parent field `p`, have parent(somechild) do the type conversion to Parent |
23:35:51 | ldlework | fowlmouth: perhaps. I just dropped the base class an implemented the parent field on the leaf types directly |
23:35:54 | ldlework | sort of how you suggested |
23:36:22 | * | yglukhov__ quit (Ping timeout: 240 seconds) |
23:36:23 | ldlework | (we were not actually using the inheritance for anything at that point so why fight the type system for no reason) |
23:37:06 | fowlmouth | ok cool |
23:39:37 | def- | Can't figure out how to make list comprehensions work when assigning consts. procsvar don't seem to work with consts |
23:39:43 | def- | .eval const foo = proc bar(): int = 8 |
23:39:46 | Mimbus | def-: eval.nim(3, 12) Error: internal error: cannot generate VM code for proc |
23:39:55 | def- | .eval const foo = proc: int = 8 |
23:39:58 | Mimbus | def-: eval.nim(3, 12) Error: constant expression expected |
23:40:54 | Forty-3 | how do I run something once at run time? |
23:41:38 | * | tinAndi joined #nim |
23:42:10 | fowlmouth | def-, it needs to output code directly like a template that has a bunch of statements and ends with an expression |
23:42:28 | fowlmouth | and then it may work |
23:42:34 | fowlmouth | .eval const x = @[1,2,3] |
23:42:37 | Mimbus | fowlmouth: <no output> |
23:42:50 | fowlmouth | .eval const x = @[1,2,3]; x[0].echo |
23:42:53 | Mimbus | fowlmouth: eval.nim(4, 2) Error: invalid indentation |
23:45:34 | def- | fowlmouth: I don't get how. You can try and make foo a const here: https://gist.github.com/def-/6b2723d799165ad0e429 |
23:45:59 | def- | fowlmouth: and you can only change the stuff after "const foo = " |
23:53:29 | * | MrBlaise joined #nim |
23:53:53 | fowlmouth | def-, something like this, but im not sure a macro can generate a template https://gist.github.com/fowlmouth/09102ee53a95ebd2ec9a |
23:54:16 | def- | fowlmouth: especially not before the "const foo = " |
23:54:28 | def- | Or can I insert a global proc somehow? |
23:55:16 | fowlmouth | def-, maybe (template ....)() works |
23:55:46 | fowlmouth | there is a way to do this i forget how |
23:56:19 | def- | nope, anonymous template doesn't work |
23:57:07 | fowlmouth | bbl |
23:58:46 | * | loz quit (Ping timeout: 255 seconds) |