00:00:15 | Jehan_ | ... problem is not … |
00:00:20 | Jehan_ | I clearly cannot type, either. :) |
00:00:28 | Jehan_ | Ugh, 2 am. |
00:00:48 | Jehan_ | And again, you really need to talk to Araq about this, not me. :) |
00:01:08 | Jehan_ | In the end, I'm just an opinionated guy who doesn't have any more influence on the design of Nim than you. :) |
00:01:59 | filwit | they _are_ named constructors, really.. except they don't allow different return types, true.. but you can always used named constructors for that.. I also want to note, in the sake of fairness, there is a way to use named constructors with generics _almost_ as well as obj constructor syntax.. that is: new(t:type Foo, ...) |
00:03:15 | filwit | so you still need to know the name of the constructor you're calling 'new'.. but at least you could enforce a more generic overloading specification instead of adhock naming |
00:04:31 | filwit | (this is essentially why I do in my Nim code today).. though I still think overloadable object constructors wins here, by a small margin (you don't have to know the name of the constructor, just the params) |
00:06:48 | filwit | what** I do... jesus brain, get it together |
00:07:18 | filwit | anyways, i'll let you sleep if it's 2am your time :) |
00:07:24 | Jehan_ | The problem with overloading for object constructors is that it's not what overloading is for. |
00:07:43 | Jehan_ | overloading is for functions that do essentially the same thing for different types. |
00:07:54 | Jehan_ | print(x: string) vs. print(x: int), for example. |
00:08:16 | Jehan_ | Constructors can do vastly different things. |
00:08:20 | filwit | not always, eg: print(f:File, s:string) vs print(f:File, i:int) |
00:08:42 | filwit | should be 'var File' |
00:09:18 | Jehan_ | filwit: Not sure that's any different from my example in principle? They're still doing the same thing. |
00:09:20 | ddsaaaaaaaaf | i dont see why we need new constructors |
00:09:32 | ddsaaaaaaaaf | the current system is perfect |
00:09:47 | ddsaaaaaaaaf | just missing the pragma for uninstanciable outside of the module |
00:09:55 | ddsaaaaaaaaf | with the base constructor |
00:10:17 | filwit | yes that is Jehan_'s proposed solution |
00:10:26 | filwit | mine is almost the same but slightly different |
00:10:57 | filwit | I feel it has more benefits than just locking Obj Constructors from outside the module, that is what we're debating about |
00:11:41 | renesac | filwit: in your proposal, what would calling the constructor in the module itself do? |
00:12:20 | Jehan_ | If you want to see what kind of constructor I could agree to, see my "make" macro. |
00:12:29 | filwit | it would do the same thing in every module: implicitly invoke the 'create' proc (either before or after allocation, depending on a pragma) if it exists |
00:12:36 | filwit | renesac ^ |
00:13:06 | Jehan_ | I'm still not sure that it would be a good idea, but it'd beat overloading-based constructors or exposing internal ones. |
00:14:10 | renesac | ok, your proposal eliminates the current object constructor |
00:14:14 | filwit | Jehan_: I'll take a look, but I'm planning on making overloadable constructors soon (I've already done this, but it was done by allowing types/procs to have the same name, and came with other problems, and needs to be redone) |
00:14:21 | renesac | even the create() proc don't need to call it |
00:14:23 | ddsaaaaaaaaf | this is madness |
00:14:46 | Jehan_ | Well, good luck. :) I'm off to bed. :) |
00:15:12 | * | Jehan_ quit (Quit: Leaving) |
00:15:18 | filwit | Jehan_: when i have more to see, I hope to get your feedback then after you try it out a bit (not that you can't invision my solution.. just it might be better for everyone to be able to play around with a working solution to get a handle one what exactly I'm proposing) |
00:15:56 | filwit | Jehan_: good night |
00:17:38 | filwit | renesac: I'm unaware of othere's proposals to the solution.. so far I've only really heard "don't allow object constructors outside the module.. or ones marked with a special pragma" which I feel my solution is superior too, but am open to argument of course (though i've been talking about this for a little while tonight, and need to move on soon) |
00:18:17 | renesac | I'm not suggesting anything new |
00:18:26 | renesac | I was only trying to understand your proposal |
00:18:29 | filwit | renesac: here's a gist of the problems my solution is trying to fix: https://gist.github.com/PhilipWitte/0ca58b9655a6f3fd8ff0 |
00:18:42 | renesac | yep, I read it |
00:19:11 | renesac | your proposal eliminates the current object constructor, even the create() proc don't neeed to call it |
00:19:34 | ddsaaaaaaaaf | the thing is this isnt a 0 cost abstraction your proposing |
00:19:36 | renesac | and you re-use the same syntax to call the create proc for the given type |
00:19:57 | ddsaaaaaaaaf | the current constructor cost nothing |
00:20:07 | filwit | i'm not sure exactly what you mean by "eliminates the current object constructor" renesac.. if anything, my solution extends it's functionality a bit.. I'm not sure I'm reading that correctly |
00:20:17 | renesac | that is what I understood |
00:20:20 | * | flaviu quit (Remote host closed the connection) |
00:20:33 | filwit | ddsaaaaaaaf: my solution is zero overhead |
00:20:41 | * | flaviu joined #nim |
00:20:57 | renesac | I can't call FileStream(path: x, json: y) anywhere now |
00:20:59 | renesac | right? |
00:21:10 | renesac | the original one |
00:21:15 | renesac | that just writes the fields |
00:21:29 | filwit | yes, because that doesn't properly setup a FileStream (it would cause errors only caught at runtime) |
00:21:56 | filwit | sorry, brb |
00:22:35 | renesac | ok, maybe it is not eliminated |
00:23:00 | renesac | if you don't define the "create" proc, then the current object constructor is called? |
00:23:15 | ddsaaaaaaaaf | that would be way too much obfuscation imo |
00:23:33 | renesac | obfuscation? |
00:24:06 | ddsaaaaaaaaf | i mean you have to know if the type implements a constructor to know if you are allowed to call the standard constructor witouth worrying about errors |
00:24:13 | ddsaaaaaaaaf | with his proposal |
00:24:41 | renesac | ddsaaaaaaaaf: from what I understood, you can always call the standard constructor |
00:24:50 | renesac | and it will do the right thing |
00:25:09 | renesac | or rather, you can always use the standard constructor syntax |
00:25:10 | ddsaaaaaaaaf | how so |
00:25:15 | renesac | but it may call the create proc |
00:25:20 | ddsaaaaaaaaf | yeh |
00:25:25 | renesac | if such a proc is defined |
00:25:59 | ddsaaaaaaaaf | so you never know if its a simple constructor or something with complex logic inside of it |
00:26:18 | renesac | ddsaaaaaaaaf: well, just look at the code of the module |
00:26:23 | renesac | but yeah, you don't |
00:26:34 | * | filwit quit (Ping timeout: 256 seconds) |
00:26:40 | ddsaaaaaaaaf | yeh u have to look for every constructor, you cant read the code easy now |
00:26:59 | renesac | on the other hand, if there is a change in the module that requires a complicated constructor |
00:27:04 | ddsaaaaaaaaf | currently you know what the constructor does... gives you a type with values in it |
00:27:05 | renesac | now that change can be made transparently |
00:27:40 | renesac | currently, I don't think you can do such migration w/o deprecating the whole type |
00:27:49 | ddsaaaaaaaaf | yes but now you dont know if the underlying data matches the constructor |
00:27:57 | renesac | so the best practice is to always avoid the default constructor |
00:28:08 | ldlework | +1 |
00:28:24 | ddsaaaaaaaaf | and it works fine |
00:28:26 | * | filwit joined #nim |
00:28:27 | * | brson quit (Quit: leaving) |
00:28:36 | renesac | ddsaaaaaaaaf: from the syntax in the filwit gist, you know |
00:28:51 | renesac | see the create proc |
00:28:56 | filwit | k back, sorry what did i miss? |
00:29:07 | renesac | look at the log |
00:29:13 | filwit | yeah getting there |
00:29:15 | * | vikaton joined #nim |
00:30:11 | ddsaaaaaaaaf | imo just call create or some named constructor if you need validation |
00:30:20 | ddsaaaaaaaaf | no need for a special overloading or whatever |
00:30:42 | ddsaaaaaaaaf | the current system is clear and theres never any confusion |
00:31:24 | renesac | I agree that the current system is less magic, and that is good |
00:31:36 | ddsaaaaaaaaf | just use the current standard with ini and new |
00:31:39 | ddsaaaaaaaaf | init* |
00:31:45 | renesac | but you also can't change your mind after you decide to use the normal constructor |
00:32:03 | filwit | the current destructor system uses no more magic than the constructor system i'm proposing |
00:32:04 | ddsaaaaaaaaf | if you think you need validation or invalid states dont use it |
00:32:06 | renesac | as the interface for your module |
00:32:24 | ddsaaaaaaaaf | just pragma the default constructor with .noinit. |
00:32:25 | ddsaaaaaaaaf | or whatever |
00:32:27 | ddsaaaaaaaaf | i mean the type |
00:32:43 | ddsaaaaaaaaf | that way you always have to call a named constructor and voila! |
00:33:21 | renesac | I'm not sure if I like the constructor syntax at all, actually |
00:33:38 | filwit | this isn't better than my solution, where we get to keep Object Constructor syntax as a unaversal and expected way to construct Objects (including both ref and non-ref ones) |
00:33:39 | renesac | I would preffer a normal proc with named parameters |
00:33:55 | filwit | renesac: that isn't as good for generic code |
00:34:05 | renesac | like FileStream(path = x, json = blah) |
00:35:04 | filwit | er.. actually i don't know what you're in favor of.. by "it's not as good for generic code" I mean "named procedures as constructors" like 'initPerson' |
00:35:08 | renesac | filwit: well, what I'm saying is that I don't like the current way |
00:35:24 | filwit | renesac: yeah just realized that's what you meant, sorry |
00:35:49 | ddsaaaaaaaaf | i like the current way |
00:36:12 | renesac | but it would break backwards compatibility to make constructors acccept '=' instead of ":" |
00:36:27 | renesac | ddsaaaaaaaaf: I was talking about "=" vs ":" now |
00:36:37 | ddsaaaaaaaaf | o |
00:36:38 | ddsaaaaaaaaf | ok |
00:36:38 | filwit | not really, thought this certainly would be a breaking change |
00:36:39 | renesac | the special syntax constructors have |
00:36:42 | filwit | though* |
00:36:43 | renesac | I'm not sure why |
00:37:01 | filwit | currently T(x = y) is invalid, so it's not sued anywhere |
00:37:03 | ddsaaaaaaaaf | imo i like it, you know its a constructor and all it does is set memory |
00:37:07 | ddsaaaaaaaaf | doesnt do anything else |
00:37:10 | filwit | so nothing would break there.. |
00:37:33 | filwit | ddsaaaaaaf: have you see how destructors work? |
00:37:41 | ddsaaaaaaaaf | so if you just use T() you know all your memory is inizialized as empty |
00:37:52 | ddsaaaaaaaaf | new(T,finalizer) |
00:37:57 | ddsaaaaaaaaf | thats how they work |
00:38:01 | ddsaaaaaaaaf | the rest might be removed |
00:38:06 | ddsaaaaaaaaf | from what ive seen |
00:38:10 | filwit | except empty memory is often invalid |
00:38:11 | ddsaaaaaaaaf | its setting per instance |
00:38:25 | filwit | this is the entire problem we're trying to fix |
00:38:34 | ldlework | I think I'd agree with ddsaaaaaaaaf if you got a 'zeroed' object. |
00:38:46 | ddsaaaaaaaaf | no overhead |
00:38:47 | ldlework | whatever that is |
00:38:50 | ddsaaaaaaaaf | no checks nothing |
00:39:08 | ddsaaaaaaaaf | if you dont want to expose it dont, as i said with a pragma |
00:39:11 | filwit | ddsaaaaaf: my system has no overhead either |
00:39:28 | renesac | ^ |
00:39:33 | ddsaaaaaaaaf | you might introduce some |
00:39:34 | ddsaaaaaaaaf | at anytime |
00:39:43 | ddsaaaaaaaaf | if im outside of your module |
00:39:44 | ddsaaaaaaaaf | i dont know |
00:39:47 | ddsaaaaaaaaf | and i cant enforce it |
00:39:53 | filwit | and my system could use a {.noAlloc.} pragma to overload the allocation process as well, which is very useful for memory pools, etc |
00:40:29 | filwit | but that's not a point in it's favor i suppose (named constructors can do that too) |
00:41:49 | filwit | but I can do that "transparently", eg, the end user always has a universal way to "create" a type, eg: T().. it may fail (at compile-time) and say he needs to provide the correct parameters, but it's still a universal syntax pattern every user knows exactly how to use, and the name implies the return type, so you know at-a-glance what you're getting |
00:41:50 | renesac | ddsaaaaaaaaf: you are against the possibility of introducing overhead silently, you think it should break your compilation to warn you, right? |
00:43:02 | filwit | plus, and I've said this a few times, 'newPerson()' is not as good for generic code as 'Person()' |
00:43:31 | filwit | since often libs will be un-idiomatic and use 'makePerson()' or something, while in my system they cannot |
00:43:35 | renesac | filwit: the equivalent wouldn't be 'new Person()' ? |
00:44:43 | filwit | renesac: not sure exactly what you're asking, but you could use 'proc new(t:type Person)' as a slightly better way to use named procs in generic code (overload by typedesc).. but it's still not as ideal as tying the constructor to the type-name directly |
00:45:31 | renesac | how do you differentiate between newPerson() and initPerson()? |
00:45:39 | ddsaaaaaaaaf | i like to think of object first and foremost as structs, not some crazy oop monsters |
00:45:50 | ddsaaaaaaaaf | and i want them to act as such |
00:46:54 | renesac | the best thing about C is that you can usually see quite well what every line you write will translate in assembly |
00:47:13 | renesac | of course, functions can do arbitray things, but except by that |
00:47:32 | * | TEttinger joined #nim |
00:47:36 | filwit | renesac: that's not necessarily a good thing in all cases, and often not the case in existing Nim code (eg, procs vs template calls are identical) |
00:47:49 | ddsaaaaaaaaf | the current constructors matches the memory layout 1:1 |
00:47:56 | filwit | so does mine! |
00:48:16 | filwit | these aren't arguments against my system.. it's not some OOP monster |
00:48:30 | ddsaaaaaaaaf | its a proc you can do whatever you want to do it in |
00:48:38 | ddsaaaaaaaaf | look |
00:49:02 | ldlework | ddsaaaaaaaaf: why do you want non-initialized instances of your types? |
00:49:20 | filwit | the only caveat I can see with it is if you did "from lib import T and something" (where it 'create' proc doesn't get imported, so in that module not "proper" way to construct a T is found on T() ) |
00:49:20 | ddsaaaaaaaaf | i dont want uninitialized instance |
00:49:22 | renesac | ddsaaaaaaaaf: you haven't answered my question |
00:49:26 | ddsaaaaaaaaf | i want to be able to get one if i want |
00:49:27 | renesac | ddsaaaaaaaaf: you are against the possibility of introducing overhead silently, you think it should break your compilation to warn you, right? |
00:49:58 | ldlework | ddsaaaaaaaaf: I'm just wondering what some potential usecases might be |
00:50:39 | renesac | because you were defending the right of the library writer forbid you from getting one, using a pragma |
00:50:45 | ddsaaaaaaaaf | yes |
00:51:10 | ddsaaaaaaaaf | i want to know what gets initialized |
00:51:15 | filwit | ddsaaaaaaf: you should be forced to go out-of-your way (eg, use cast[]()) to get an "empty" object when the API wants you to use properly constructed ones.. my solution just makes those situations feel very similar to the cases you can just use object constructors to make empty objects (eg, there's not 'create' proc declared) |
00:51:16 | ddsaaaaaaaaf | not some magic |
00:51:22 | ldlework | ddsaaaaaaaaf: so wont you have to look at some function in the module? |
00:51:25 | ldlework | the named constructor? |
00:51:34 | ldlework | how's that different really? |
00:51:36 | ldlework | day to day. |
00:52:14 | ddsaaaaaaaaf | with the new system you dont know if you have to look |
00:52:20 | ddsaaaaaaaaf | with the current system you know what happens |
00:52:38 | ddsaaaaaaaaf | the new system could add +1 to your X param if it wanted to |
00:52:43 | ldlework | you know to look, when you care |
00:52:45 | ddsaaaaaaaaf | or whatever it wants |
00:53:04 | ldlework | ddsaaaaaaaaf: so could a named constructor |
00:53:06 | ddsaaaaaaaaf | youd always have to look |
00:53:09 | ddsaaaaaaaaf | yes |
00:53:12 | ddsaaaaaaaaf | thats what im saying |
00:53:21 | filwit | my solution makes leaves object constructors as a "useful default" (much like vars in Nim) where if you don't define a 'create' proc, objects can still be created with T(), and they're 'deafulted'.. but i just give you the ability to override that behavior if your API needs it.. without _much_ mental overhead from the programmer using your API |
00:53:24 | ldlework | it seems in the point you're making, they are equivalent |
00:53:25 | ddsaaaaaaaaf | if you use a named constructor you know you can get special initialization |
00:53:28 | ldlework | but I'm probbly just confused |
00:53:31 | ddsaaaaaaaaf | no they arent |
00:53:44 | ddsaaaaaaaaf | you couldnt diferenciate between pure memory allocation |
00:53:47 | ddsaaaaaaaaf | and initialization |
00:53:50 | ldlework | ddsaaaaaaaaf: for all intents and purposes of what I have to know, when I have to know it, and so on |
00:54:16 | ddsaaaaaaaaf | your constructor could fetch something from a database or whatever |
00:54:23 | ldlework | As a nim programmer I will end up using named constructors or object constructors all over the play |
00:54:24 | ddsaaaaaaaaf | or never initialize something |
00:54:26 | ldlework | and in both cases |
00:54:31 | ldlework | they will do stuff I don't know about |
00:54:32 | ddsaaaaaaaaf | yes |
00:54:33 | ldlework | until I go look |
00:54:35 | ddsaaaaaaaaf | but you arent forced to |
00:54:39 | ddsaaaaaaaaf | and its explicit |
00:54:57 | ldlework | ddsaaaaaaaaf: I'm forced to by right of I'm using library code written with types that have constructors provided for me |
00:55:00 | ldlework | and until I go look |
00:55:03 | ldlework | at either |
00:55:05 | ldlework | I wont know |
00:55:14 | ldlework | the case where I just want an uninitialized instance is rare |
00:55:16 | renesac | I can see the value of what ddsaaaaaaaaf is saying, but I also like the standardization from filwit approach |
00:55:20 | renesac | it is a trade-off |
00:55:29 | ldlework | the convienence far outweighs this very miniscule advantage |
00:55:36 | ddsaaaaaaaaf | what convenence |
00:55:46 | ddsaaaaaaaaf | to not have to look for the named constructor? |
00:55:46 | ldlework | of knowing how to instantiate a type no matter what |
00:55:53 | ddsaaaaaaaaf | lol |
00:55:55 | filwit | ddsaaaaaaaaf: the main point of this argument is you _dont_ want to be able to easily create 'empty' objects with T().. you want the compiler (at compile-time) to tell you you need to constructor something through a specific procedure (or, in the case of my proposal, with a specific set of parameters) |
00:56:38 | ddsaaaaaaaaf | dont export your basic type constructor with a pragma if you dont want to expose it |
00:56:46 | ddsaaaaaaaaf | dont magically do it |
00:56:56 | filwit | ddsaaaaaaaaf: you can still see exactly where 'empty' objects are created in the code cause it'll look something like "newBlank(T, ...)" |
00:56:59 | ddsaaaaaaaaf | by do it i mean initialize |
00:57:35 | filwit | ddsaaaaaaaaf: yes, that's one solution, but my solution accomplishes that same benefit, but also has some other pros.. |
00:57:43 | ldlework | It just seems hardly magical |
00:57:51 | ddsaaaaaaaaf | lol sure |
00:57:53 | ldlework | Couldn't there be a way to get some allocation for a type |
00:58:03 | ddsaaaaaaaaf | yes there is |
00:58:03 | filwit | it's less magical that what is already being done with destructors! |
00:58:05 | ddsaaaaaaaaf | T() |
00:58:12 | ldlework | so in the rare cases you needed an allocated but uninitialized form of the type |
00:58:14 | ddsaaaaaaaaf | i dont use destructor |
00:58:19 | ddsaaaaaaaaf | i use finalizers per instance |
00:58:20 | renesac | well, I do favour the abstraction side more, but I would be fine with the current system + pragma too |
00:58:39 | ldlework | no one likes the golang makeAThing |
00:58:44 | ddsaaaaaaaaf | new(T, finalizer) is more versatile |
00:58:53 | ddsaaaaaaaaf | than a destructor imo |
00:58:59 | ddsaaaaaaaaf | per type |
00:59:05 | renesac | though I think the constructor should be hidden by default from other modules, but backwards compatibility... |
00:59:20 | filwit | okay, but I'm just saying "magic" isn't exactly a "oh no, it's so confusing compared to the rest of Nim" argument |
00:59:47 | ddsaaaaaaaaf | im not sure destructor are to stay |
00:59:51 | ddsaaaaaaaaf | if i read it correctly |
01:00:05 | filwit | they may not, not sure of the situation there |
01:00:06 | ddsaaaaaaaaf | and i prefer the new(T,finalizer) as i said |
01:00:16 | ddsaaaaaaaaf | its explicit etc |
01:00:16 | filwit | either way, implicitly invoking a proc is hardly magical |
01:00:34 | ddsaaaaaaaaf | explicit is better |
01:00:56 | filwit | not necessarily, as i've stated before, not with generic code |
01:01:03 | filwit | and not even with user code |
01:01:46 | filwit | often, it's better to know exactly what syntax to use to "create an object".. you can't do that with 'newPerson" always.. at least, you can't _know_ that's correct.. you have to look at the libary you're using |
01:02:57 | filwit | my system makes it so you know exactly what syntax to create an object, universally. The exact implementation of that is what needs a bit more control.. but at the end of the day, to make user-code easy to read and write, I think T() wins |
01:03:00 | ddsaaaaaaaaf | you still have to look at it anyway to know what constructor there is |
01:03:04 | ddsaaaaaaaaf | with what params |
01:03:04 | ddsaaaaaaaaf | etc |
01:03:18 | filwit | not if the params are listed in the compiler error message |
01:03:22 | filwit | which is my plan |
01:03:41 | filwit | so it says, You can't call T() with empty params, here's what you can use: T(path:string), etc |
01:04:15 | ddsaaaaaaaaf | you could still do the same with pragmas |
01:04:20 | ddsaaaaaaaaf | .constructor. |
01:04:22 | ddsaaaaaaaaf | does nothing |
01:04:24 | filwit | the alternative is: you can't use T().. lookup some function in the module that could construct the type you want.. sure it could list all procs that return a T, but that could get noisy fast |
01:04:48 | filwit | i'm not sure how markign a proc as .constructor. is better than what I'm suggesting |
01:05:02 | filwit | and it's still not better for generic code |
01:05:08 | ddsaaaaaaaaf | yours do something, mine would just to mark it as such |
01:05:12 | ddsaaaaaaaaf | yours would call it |
01:05:40 | ddsaaaaaaaaf | anyway |
01:05:41 | filwit | well, to avoid confusion, what exactly do you mean by "mark it with .constructor.?" |
01:06:07 | ddsaaaaaaaaf | that wouldnt replace the default type constructor we have now |
01:06:25 | ddsaaaaaaaaf | it would do nothing but work in conjunction with .noinstantiate. or something on the type |
01:06:26 | * | Demon_Fox joined #nim |
01:06:37 | ddsaaaaaaaaf | to help with error messages |
01:06:46 | filwit | so basically exactly what I'm saying, only with a pragma vs a proc name to distinguish constructor functionality? |
01:07:12 | ddsaaaaaaaaf | i mean exactly as we have now |
01:07:30 | ddsaaaaaaaaf | but with a .noinstantiate. on the type to not export the default constructor |
01:07:45 | filwit | btw, I was always planning on doing "proc create(f:var Foo) {.noAlloc.}" as a way for the constructor to not defaultly allocate/empty and object (leaving the 'create' to handle that) |
01:07:48 | ddsaaaaaaaaf | the .constructor. is just to help to find the constructors |
01:08:29 | filwit | okay.. but why do it that way? it's just as confusing and no one will mark their procs as .constructor. half the time |
01:08:50 | ddsaaaaaaaaf | i dont see why we need to introduce any new contruction magic |
01:09:14 | ddsaaaaaaaaf | the current system just need a way to not expose the default constructor and thats it |
01:09:19 | filwit | calling it 'magic' is just a way to demonize the system.. it's pros stand as they are |
01:09:34 | ddsaaaaaaaaf | its pros are for the library makers |
01:09:37 | ddsaaaaaaaaf | not for the users |
01:09:46 | filwit | no, i disagree |
01:10:11 | filwit | like i've said, having a universal way to construct and object is better for both user-code and generic user code.. do you have an argument against that? |
01:10:20 | ddsaaaaaaaaf | we have a universal way |
01:10:25 | ddsaaaaaaaaf | T(xxxx) |
01:10:56 | ddsaaaaaaaaf | if you need state vericiation or something else you can to it in a name constructor |
01:11:09 | ddsaaaaaaaaf | named* |
01:11:14 | ddsaaaaaaaaf | verification* |
01:11:23 | filwit | almost always you need this.. T() as it stands today is only useful for the most basic of types |
01:11:39 | ddsaaaaaaaaf | as most types are |
01:11:56 | ddsaaaaaaaaf | and should be |
01:12:22 | filwit | and generic code often needs a way to construct and validate at type, universally.. if you do validation through a named proc, you have the same problem (the validation proc name can be different with each type) |
01:12:28 | ldlework | ddsaaaaaaaaf: what are some of your favorite languages? |
01:12:56 | ddsaaaaaaaaf | too many |
01:13:11 | ldlework | what have you been writing lately? |
01:13:22 | ddsaaaaaaaaf | haskell |
01:13:28 | ddsaaaaaaaaf | and c |
01:13:30 | ddsaaaaaaaaf | and nim |
01:13:37 | ddsaaaaaaaaf | php |
01:13:38 | ddsaaaaaaaaf | javascript |
01:13:42 | ddsaaaaaaaaf | lol |
01:13:54 | ddsaaaaaaaaf | i write in those on a daily basis |
01:14:30 | ldlework | alright |
01:16:29 | ddsaaaaaaaaf | and im not a fan of oop |
01:16:42 | * | Jesin quit (Quit: Leaving) |
01:21:41 | ddsaaaaaaaaf | i just dont see why we need to fix something that isnt broken, the current system is explicit and flexible, the only thing needed is a way to hide the default type constructor if need be. |
01:21:50 | ddsaaaaaaaaf | and on that, im going to bed |
01:23:24 | * | xificurC quit (Remote host closed the connection) |
01:25:15 | filwit | just because something works, doesn't mean it can't be improved. The pros for my solution I feel outweigh the cons, and offer more than just limiting Object Constructor syntax in general (which i feel is an attractive syntax in general, and useful for generic code). The current solution _is_ broken, and we're discussing possible solution. And on that note, good night and thanks for you input. I also need to eat some dinner now, so bbl. |
01:25:59 | ddsaaaaaaaaf | and i feel the cons outweigght the pro |
01:26:44 | filwit | i'll be making a pros/cons list between the two solutions soon, will look forward to hearing your input on that list when I have it |
01:27:02 | filwit | anyways, really do need to eat now. later |
01:27:05 | * | xificurC_ joined #nim |
01:27:06 | ddsaaaaaaaaf | later |
01:30:08 | * | gsingh93 quit (Ping timeout: 265 seconds) |
01:38:37 | ddsaaaaaaaaf | and i dont see how that would work with ADTs |
01:39:21 | ddsaaaaaaaaf | i prefer to encode most validation into the type system like in haskell, and if you really need a complex constructor name it |
01:42:27 | * | Jesin joined #nim |
01:51:43 | * | dddddd quit (Ping timeout: 255 seconds) |
01:54:36 | dtscode | can someone point me to the irc module page? i cant seem to find it |
01:55:19 | * | BitPuffin|osx quit (Ping timeout: 255 seconds) |
02:11:51 | * | darkf joined #nim |
02:20:15 | onionhammer | Varriount noice ;) |
02:29:21 | * | gsingh93 joined #nim |
02:30:26 | notfowl | dtscode: nimble package irc |
02:30:36 | dtscode | thanks |
02:30:48 | * | dalarmmst joined #nim |
02:30:55 | dtscode | now i just need to find a good way to extract links from a string... |
02:37:28 | * | dalarmmst quit (Ping timeout: 256 seconds) |
02:49:16 | * | ddl_smurf quit (Quit: ddl_smurf) |
03:11:40 | reactormonk | dtscode, pretty sure there's a regex for that somewhere |
03:12:42 | dtscode | reactormonk: im staying away from regexs. i found a cheap solution |
03:14:33 | dtscode | (cheap as in "that was a cheap trick", not cheap as in resource wise) |
03:16:52 | * | pigmej quit (Ping timeout: 272 seconds) |
03:17:49 | * | profan quit (Ping timeout: 264 seconds) |
03:23:28 | * | pigmej joined #nim |
03:33:27 | * | vikaton quit (Quit: Connection closed for inactivity) |
03:40:14 | Xe | in nim, if I have a cstring, how do I get that to be a string? |
03:47:11 | dtscode | does anyone have a good example of using httpclient to send data over post? |
03:48:11 | dtscode | actually nmd. ill use the curl lib |
03:49:38 | dtscode | actually nmd i need to use http client |
03:58:27 | notfowl | $ xe |
03:58:36 | Xe | derp |
04:01:43 | * | endragor joined #nim |
04:05:52 | * | gsingh93 quit (Ping timeout: 244 seconds) |
04:07:58 | * | endragor quit (Remote host closed the connection) |
04:08:55 | dtscode | http://forum.nim-lang.org/t/1216/1#7518 |
04:09:02 | dtscode | if anyone is interested |
04:10:03 | Quora | dtscode: you probably want to use the syncronous IRC implementation |
04:10:26 | dtscode | Quora: eh |
04:11:37 | Quora | https://github.com/nim-lang/irc/blob/master/src/irc.nim#L464-L475 |
04:11:52 | Quora | what you are doing looks like it is in the use case for the synchronous implementation :P |
04:12:25 | dtscode | Quora: thats not the issue though |
04:13:10 | * | filwit quit (Quit: Leaving) |
04:14:54 | * | endragor joined #nim |
04:15:54 | * | endragor quit (Remote host closed the connection) |
04:23:52 | * | endragor joined #nim |
04:26:12 | * | dalarmmst joined #nim |
04:39:29 | * | wepy joined #nim |
04:39:31 | wepy | oi |
04:39:44 | wepy | when you build nim from source.. |
04:39:51 | wepy | after ./kock boot -d:release |
04:40:01 | wepy | what do you do/where is the compiler? |
04:40:35 | * | dalarmmst quit (Ping timeout: 256 seconds) |
04:50:24 | ddsaaaaaaaaf | in the bin dir probably |
04:51:11 | ddsaaaaaaaaf | add the bin dir to your path and voila , i guess |
04:52:36 | wepy | what was the point of the koch -d:release step.. bin/nim was already there? |
04:53:04 | wepy | btw, is nim any good for CGI? |
04:58:38 | * | gsingh93 joined #nim |
05:17:28 | wepy | can you compile a static nim binary? |
05:19:07 | wepy | nm got it |
05:19:09 | * | wepy quit (Quit: leaving) |
05:33:19 | * | dalarmmst joined #nim |
05:43:19 | * | gsingh93 quit (Ping timeout: 272 seconds) |
05:49:09 | * | zahary1 quit (Ping timeout: 256 seconds) |
05:50:52 | * | zahary joined #nim |
05:55:28 | transfuturist | >./kock |
05:55:30 | transfuturist | kek |
06:06:58 | * | yglukhov___ joined #nim |
06:07:05 | * | Kingsquee quit (Read error: Connection reset by peer) |
06:07:17 | * | pigmej quit (Ping timeout: 256 seconds) |
06:07:27 | * | Kingsquee joined #nim |
06:09:46 | * | pigmej joined #nim |
06:11:16 | * | yglukhov___ quit (Ping timeout: 240 seconds) |
06:27:18 | * | BlaXpirit joined #nim |
06:27:28 | * | davidhq joined #nim |
06:30:08 | * | bjz joined #nim |
06:33:22 | * | yglukhov___ joined #nim |
06:38:01 | * | yglukhov___ quit (Ping timeout: 265 seconds) |
06:40:01 | * | JoshuaT joined #nim |
06:40:39 | * | JoshuaT quit (Max SendQ exceeded) |
06:42:06 | * | JoshuaT joined #nim |
06:48:10 | * | Andris_zbx joined #nim |
06:57:54 | * | milosn quit (Ping timeout: 264 seconds) |
06:58:19 | * | milosn joined #nim |
07:03:59 | * | transfuturist quit (Ping timeout: 245 seconds) |
07:04:45 | * | endragor_ joined #nim |
07:04:48 | * | JoshuaT quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
07:08:40 | * | endragor quit (Ping timeout: 272 seconds) |
07:11:49 | * | OnwardEuler quit (Read error: Connection reset by peer) |
07:12:22 | * | Ven joined #nim |
07:13:06 | * | gokr_ joined #nim |
07:16:16 | * | endragor_ quit (Remote host closed the connection) |
07:18:46 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
07:24:55 | * | d3m1gd joined #nim |
07:28:30 | * | bjz quit (Read error: Connection reset by peer) |
07:29:13 | * | bjz joined #nim |
07:29:22 | * | yglukhov___ joined #nim |
07:30:02 | * | Ven joined #nim |
07:31:12 | * | Trustable joined #nim |
07:41:08 | * | xificurC_ quit (Quit: WeeChat 1.1.1) |
07:41:29 | * | xificurC joined #nim |
07:47:24 | * | davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
07:48:50 | * | davidhq joined #nim |
07:51:04 | * | Ven quit (Ping timeout: 245 seconds) |
07:56:29 | * | miraculix joined #nim |
07:59:49 | * | ddl_smurf joined #nim |
08:00:49 | * | coffeepot joined #nim |
08:01:48 | * | datanoise quit (Ping timeout: 276 seconds) |
08:04:52 | * | endragor joined #nim |
08:24:46 | * | Ven joined #nim |
08:26:29 | * | gokr_ quit (Ping timeout: 245 seconds) |
08:27:39 | * | gokr_ joined #nim |
08:29:21 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
08:37:22 | * | Ven quit (Read error: Connection reset by peer) |
08:42:39 | * | BlaXpirit quit (Quit: Quit Konversation) |
08:42:40 | * | gokr_ quit (Read error: Connection reset by peer) |
08:48:48 | * | Ven joined #nim |
08:53:04 | * | davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
08:57:53 | * | filwit joined #nim |
08:58:05 | * | datanoise joined #nim |
09:03:38 | * | filwit quit (Quit: Leaving) |
09:06:43 | * | miraculix quit (Remote host closed the connection) |
09:06:57 | * | bjz joined #nim |
09:14:32 | * | OnO joined #nim |
09:16:36 | * | d3m1gd quit (Ping timeout: 272 seconds) |
09:16:50 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:19:34 | * | Ven joined #nim |
09:20:55 | * | bjz quit (Ping timeout: 252 seconds) |
09:22:14 | * | wan quit (Quit: WeeChat 1.1.1) |
09:23:12 | * | datanoise quit (Ping timeout: 256 seconds) |
09:28:44 | * | filwit joined #nim |
09:29:43 | * | d3m1gd joined #nim |
09:37:30 | * | Ven quit (Ping timeout: 272 seconds) |
09:43:25 | dom96 | Quora: dtscode: nope, he needs async IRC. |
09:43:59 | dtscode | dom96: i figured. thanks |
09:49:25 | * | Ven joined #nim |
09:49:34 | def- | dtscode: I did use this to rename all mentions of Nimrod to Nim on Rosetta Code, maybe it helps: https://github.com/def-/nim-unsorted/blob/master/rcrename.nim |
09:50:05 | dtscode | thanks def-. Ill have to take a look in the morning. |
09:50:16 | * | bjz joined #nim |
10:06:03 | * | davidhq joined #nim |
10:10:41 | * | TEttinger quit (Ping timeout: 265 seconds) |
10:28:50 | * | filwit quit (Remote host closed the connection) |
10:44:38 | * | Ven quit (Read error: Connection reset by peer) |
10:45:45 | * | Ven joined #nim |
10:45:46 | * | dddddd joined #nim |
10:46:38 | * | don1731 joined #nim |
10:46:44 | * | don1731 left #nim (#nim) |
10:50:52 | * | OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
10:51:58 | * | Ven quit (Read error: Connection reset by peer) |
10:55:56 | * | Kingsquee quit (Quit: Konversation terminated!) |
10:58:42 | * | Ven joined #nim |
11:09:36 | * | bluenote joined #nim |
11:11:13 | * | repax quit (Read error: Connection reset by peer) |
11:23:27 | * | cvi joined #nim |
11:25:57 | * | ingsoc joined #nim |
11:52:30 | * | cvi quit (Ping timeout: 264 seconds) |
11:59:17 | * | cvi joined #nim |
12:03:20 | * | datanoise joined #nim |
12:03:34 | * | cvi quit (Ping timeout: 245 seconds) |
12:05:24 | * | cvi joined #nim |
12:08:15 | * | datanoise quit (Ping timeout: 256 seconds) |
12:19:05 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:23:33 | * | Ven joined #nim |
12:25:46 | * | milosn quit (Quit: leaving) |
12:54:08 | * | Strikecarl joined #nim |
12:55:19 | Strikecarl | Guys, i made a Fibonacci sequence, anything i can improve? http://pastebin.com/raw.php?i=ibZRqHsU |
12:56:05 | Strikecarl | Shortening it atm. as 'sum' is unnecesary |
12:57:36 | * | xet7 joined #nim |
12:59:06 | * | vikaton joined #nim |
13:04:34 | * | davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
13:06:14 | pigmej | Strikecarl: you can countUp instead of this while |
13:06:16 | pigmej | then one line less |
13:06:36 | Strikecarl | with a 'for' loop? |
13:06:44 | pigmej | reactormonk: I *should* have time this week for epc + company ;/ |
13:06:48 | pigmej | Strikecarl: yup |
13:10:02 | Strikecarl | uh |
13:10:03 | Strikecarl | "'sum' cannot be passed to a procvar" |
13:10:15 | Strikecarl | replaced the while stuff with for times in countup(1, x): |
13:14:35 | Strikecarl | http://pastebin.com/raw.php?i=1fMLZ3xS error = "'sum' cannot be passed to a procvar" |
13:18:52 | * | gokr_ joined #nim |
13:21:49 | * | BlaXpirit joined #nim |
13:30:31 | * | BitPuffin joined #nim |
13:31:50 | * | bjz quit (Excess Flood) |
13:32:28 | * | bjz joined #nim |
13:35:03 | * | gokr_ quit (Remote host closed the connection) |
13:35:42 | * | gokr_ joined #nim |
13:36:19 | * | Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
13:38:18 | * | Strikecarl joined #nim |
13:46:43 | * | datanoise joined #nim |
13:47:32 | reactormonk | pigmej, got it kinda working, but nimsuggest is still bugged. https://github.com/Araq/Nim/issues/2694 |
13:49:40 | reactormonk | put the code here: https://github.com/reactormonk/nim-mode/tree/epc |
13:51:59 | pigmej | reactormonk: yeah I had similar problems, I asked Araq what's the main file in nimsuggest |
13:52:06 | pigmej | and he had no clue |
13:52:10 | pigmej | ;d |
13:52:46 | pigmej | reactormonk: afair when I played with it the bests results were with empty main file |
13:53:26 | * | gokr_ quit (Quit: IRC for Sailfish 0.9) |
13:53:28 | reactormonk | pigmej, so got an idea what to put in there for the compiler? |
13:54:28 | * | darkf quit (Quit: Leaving) |
13:54:59 | pigmej | no idea at all |
13:55:21 | pigmej | aporia puts 'opened file' as main file |
13:55:38 | reactormonk | hrm |
13:55:42 | pigmej | (afair the first one where completion were triggered) |
13:56:03 | reactormonk | I try to use the main project file |
13:58:11 | reactormonk | pigmej, the auto-identation is currently kinda broken - if you want you poke the compiler to give you the expected identation |
13:59:15 | pigmej | autoindent in emacs rarely works ;p |
13:59:51 | reactormonk | that's why I wanted to poke the compiler for it |
14:00:42 | * | endragor_ joined #nim |
14:00:59 | pigmej | ah |
14:01:54 | * | endragor quit (Ping timeout: 276 seconds) |
14:03:38 | * | the9to5 joined #nim |
14:03:57 | reactormonk | I would say you could tinker something with the lexer... wanna try it? |
14:04:47 | pigmej | what has indenter to do with company ? |
14:05:45 | pigmej | I mean, aren't those 2 separate things / |
14:05:46 | pigmej | ? |
14:06:48 | reactormonk | yup, separate. But I already have the company part kinda running :-) |
14:06:51 | pigmej | reactormonk: hmm, have you checked aporia ? |
14:07:01 | pigmej | that autocomplete in aporia ? |
14:07:08 | pigmej | mabye there are some undocummented hacks;D |
14:07:14 | pigmej | maybe* |
14:07:29 | reactormonk | lemme see |
14:09:31 | * | ddl_smurf quit (Quit: ddl_smurf) |
14:11:28 | reactormonk | pigmej, I only see projectFile, I dunno which one that actually is |
14:12:44 | pigmej | toggle completion |
14:14:27 | reactormonk | huh? |
14:14:54 | pigmej | have you opened aporia ? |
14:15:37 | pigmej | some recent version ? then enable that completion in options and hmm ctrl + tab or something it will spawn nimsuggest automaticaly, with AFAIR opened file as projectFile |
14:16:01 | pigmej | and as I checked, it was not stopping giving some suggestions |
14:16:16 | pigmej | so I suppose (maybe wrongly?) that there is some hack / workaround or something ;/ |
14:16:35 | reactormonk | can't compile it, can't find glib2 |
14:16:53 | pigmej | what distro? |
14:17:05 | reactormonk | yeah, it works for the current file. Does it also work inside the compiler? |
14:17:10 | pigmej | hmm |
14:17:18 | reactormonk | aporia.nim(11, 8) Error: cannot open 'glib2' |
14:17:18 | pigmej | what do you mean inside compiler? |
14:17:33 | pigmej | in compiler path? |
14:17:40 | reactormonk | inside the nim compiler. |
14:17:49 | reactormonk | 0 core/glib2 2.44.0-1 [installed] |
14:18:15 | pigmej | I don't have nim compiler on this computer, but I can check in the evening, because I don't remember ;) |
14:18:44 | pigmej | reactormonk: it's trunk aporia ? |
14:19:01 | reactormonk | yup |
14:19:12 | reactormonk | pigmej, just clone it |
14:19:32 | pigmej | I don't have nim compille at all ;/ |
14:20:22 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:20:30 | pigmej | also last time when I tried to clone from github it took 2hours |
14:20:55 | reactormonk | yeah, we fixed that |
14:21:06 | * | Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
14:21:17 | reactormonk | just open a file inside the compiler with aporia |
14:21:38 | pigmej | oh finally github works |
14:25:10 | pigmej | reactormonk: compiling nim |
14:27:50 | * | JoshuaT joined #nim |
14:28:21 | reactormonk | pigmej, no real need for that, just need to see if autocomplete insiside the compiler source works |
14:31:20 | pigmej | reactormonk: I don't have nim at all there |
14:31:27 | reactormonk | hm. |
14:31:29 | reactormonk | ok. |
14:31:36 | pigmej | but It just compiled :) |
14:31:37 | pigmej | so |
14:34:05 | reactormonk | can you reproduce my issue? |
14:34:39 | pigmej | installing aporia;) |
14:36:20 | * | Ven joined #nim |
14:36:40 | pigmej | ok what file should I open |
14:37:09 | * | MyMind joined #nim |
14:37:15 | reactormonk | not suggest.nim |
14:37:23 | reactormonk | let's say compiler/ast.nim |
14:37:29 | * | Ven quit (Read error: Connection reset by peer) |
14:38:50 | reactormonk | just add a random string somwhere in a proc "foo".<autocomplete> |
14:39:41 | reactormonk | ... and hit complete a few times |
14:39:54 | pigmej | compiling nimsuggest ... |
14:41:30 | pigmej | alwyas works |
14:41:32 | pigmej | always* |
14:41:46 | pigmej | tested like 10 times |
14:41:52 | pigmej | suggest is spawned like: Nim/bin/nimsuggest --port:6000 /tmp/aporia/suggest/ast.nim |
14:42:02 | reactormonk | yargh |
14:42:11 | reactormonk | does it work in nim.nim too? |
14:42:19 | * | cvi quit (Quit: leaving) |
14:42:38 | pigmej | nope |
14:42:43 | pigmej | second complete crashes |
14:42:57 | pigmej | but on ast it's fine |
14:43:16 | reactormonk | hum. I would like it to work on nim.nim |
14:43:26 | pigmej | ;d |
14:43:28 | reactormonk | mind testing a few other files? also suggest.nim, because that one's included? |
14:44:25 | pigmej | hmm |
14:44:31 | pigmej | it seems that it works always on opened fine |
14:44:34 | pigmej | never on other |
14:44:57 | * | Ven joined #nim |
14:45:09 | reactormonk | so it does work on nim.nim? |
14:45:40 | reactormonk | ... if you restart aporia |
14:46:29 | pigmej | yes |
14:46:36 | pigmej | ONLY if it's the opened file |
14:46:57 | reactormonk | well, fuck |
14:47:03 | pigmej | I mean, it works for nim.nim ONLY if that was the file where the completion was triggered at first |
14:47:09 | pigmej | quite sucky ;/ |
14:47:22 | reactormonk | so I need one completion process per buffer? each of those wants like 200MB |
14:47:45 | reactormonk | even ensime wants less than that |
14:47:54 | pigmej | when I talked with Araq like month ago |
14:48:04 | pigmej | he said that nimsuggest SHOULD be able to handle one completion per project |
14:48:31 | reactormonk | it apparently doesn't |
14:48:36 | pigmej | yeah |
14:49:02 | pigmej | weird |
14:50:29 | * | miraculix joined #nim |
14:52:37 | pigmej | reactormonk: one completor per buffer sounds very strsange |
14:53:56 | reactormonk | yup |
14:55:41 | * | arnetheduck quit (Ping timeout: 252 seconds) |
14:58:41 | reactormonk | wanna go dig for it? |
14:58:54 | pigmej | writing reproduce steps with aporia in your issue |
14:59:25 | * | miraculix quit (Remote host closed the connection) |
15:00:28 | reactormonk | https://github.com/Araq/Nim/issues/2694 |
15:00:35 | * | davidhq joined #nim |
15:00:39 | reactormonk | it's a nimsuggest issue, not aporia |
15:01:44 | pigmej | yaeh |
15:01:54 | pigmej | but aporia uses nimsuggest with 'recommended' way |
15:02:05 | pigmej | and Araq said if it not works +> check with aporia |
15:02:42 | * | TEttinger joined #nim |
15:03:24 | synthmeat | anyone likes any color variant of the following as nim logo? https://www.dropbox.com/s/n1sikkkwz9254gm/Screenshot%202015-05-12%2017.02.24.png?dl=0 |
15:04:07 | r-ku | whatever that is its weird |
15:04:22 | reactormonk | pigmej, hm, ok. |
15:04:54 | reactormonk | synthmeat, a new logo? |
15:04:55 | synthmeat | r-ku: yeah, have about 20 variants around to flesh out, this is the first |
15:05:17 | synthmeat | reactormonk: i'm no way associated with the design of anything nim, just playing with it |
15:05:31 | synthmeat | the name is interesting for logotype play |
15:06:15 | reactormonk | synthmeat, ah, feel free to keep going, we have our share of haters here, just ignore them |
15:06:28 | * | Andris_zbx quit (Remote host closed the connection) |
15:06:43 | synthmeat | reactormonk: oh, i don't mind at all. plenty of feedback to parse out of haters too |
15:06:54 | reactormonk | synthmeat, for colors, maybe go with one or two from http://nim-lang.org/ ? |
15:06:55 | synthmeat | i don't like it much either, it's too playful in shape and color |
15:07:43 | reactormonk | the orange or the blue... just call it brand recognition :-) |
15:08:29 | synthmeat | you mean, like python? :) |
15:09:19 | reactormonk | yup... didn't even see the similarity of the colors |
15:10:35 | * | ddl_smurf joined #nim |
15:11:38 | * | the9to5 quit () |
15:14:29 | reactormonk | pigmej, ah neat, thanks |
15:15:43 | synthmeat | what programming language has the best logo, in your oppinion? |
15:15:59 | synthmeat | i like haskell's very much |
15:16:31 | synthmeat | python is pretty fine too |
15:17:36 | reactormonk | I'd have to pull that one out of my arse, let's see... |
15:18:05 | reactormonk | http://progopedia.com/static/upload_img/2011/02/16/logo.png ^^ |
15:18:13 | synthmeat | :D |
15:19:02 | reactormonk | ruby's is pretty obvious, but haskell has style |
15:20:20 | * | endragor_ quit (Remote host closed the connection) |
15:23:59 | * | ddl_smurf quit (Quit: ddl_smurf) |
15:35:50 | coffeepot | hey guys, got a quick question. What's going on with the following fragment - it seems like the & concatenator cuts off the next string to be concatenated? |
15:35:52 | coffeepot | var |
15:35:52 | coffeepot | s1: string = "hello" |
15:35:52 | coffeepot | s2: string = "" |
15:35:52 | coffeepot | s2="\0\0\0\0\0" |
15:35:52 | coffeepot | echo s1 & s2 & "end" |
15:36:03 | pigmej | synthmeat: elixir have quite cool logo too |
15:36:16 | pigmej | http://upload.wikimedia.org/wikipedia/en/a/a4/Elixir_programming_language_logo.png |
15:36:29 | synthmeat | yup, that looks cool too |
15:36:39 | coffeepot | btw my output is "hello" where I'm expecting "helloend", nim 0.11.2 |
15:37:21 | coffeepot | echo s1,s2,"end" outputs "helloend" as expected |
15:38:35 | coffeepot | I guess it's just adding the zeros to signify string termination and then adding the "end" doesn't get displayed 'cos the string is terminated? |
15:39:53 | * | endragor joined #nim |
15:40:05 | coffeepot | I guess this is something obvious. I kind of expected "\0" to act like an empty string |
15:41:47 | bluenote | coffeepot: afair this is just he behavior of echo |
15:41:55 | BlaXpirit | yeah.. |
15:42:03 | BlaXpirit | or stdout |
15:42:06 | bluenote | what do you get for (s1 & s2 & end).len |
15:42:14 | BlaXpirit | ^this |
15:42:30 | coffeepot | hmm good pt |
15:42:38 | bluenote | Nim actually stores the lenght separately, and I guess your string is okay, but echo stops at '\0' |
15:43:22 | coffeepot | well if you do var s3 = s1 & s2 the length == 6 |
15:43:25 | * | ddl_smurf joined #nim |
15:43:29 | * | JoshuaT quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
15:43:51 | coffeepot | var s3 = s1 & s2; echo s3 == "hello" |
15:44:27 | coffeepot | so it seems as though & with '\0' cuts the string |
15:45:30 | coffeepot | hmm does look like it's just echo, var s3 = s1 & s2 & "end" has a length of 9 |
15:45:59 | coffeepot | repr(s3) now gives "hello\0end" |
15:46:36 | bluenote | exactly |
15:46:52 | bluenote | BlaXpirit: Another improvement I'm thinking of regarding optionals: |
15:47:34 | bluenote | it would be great of my getOrElse and getOr would not take actual values but expr instead |
15:47:39 | * | endragor quit (Remote host closed the connection) |
15:47:42 | BlaXpirit | i was gonna reply on github |
15:47:51 | BlaXpirit | but then got distracted midway :| |
15:48:05 | bluenote | i.e., if creating a "default" is costly we would only compute it in case it is necessary |
15:48:13 | * | endragor joined #nim |
15:48:22 | BlaXpirit | don't get it |
15:49:06 | bluenote | opt.getOrElse(<compute default value here>) |
15:49:15 | * | OnO joined #nim |
15:49:29 | * | OnO quit (Client Quit) |
15:49:34 | bluenote | if getOrElse is a regular proc, we would compute the default even if we will not use it (opt has a value) |
15:50:10 | BlaXpirit | i think that was said by fowl |
15:50:26 | bluenote | we could use a closure, i.e. default: proc (): B but this is ugly |
15:50:41 | bluenote | a template taking a `default: expr` would be great |
15:50:46 | BlaXpirit | just a template........... right |
15:51:37 | bluenote | not sure if this has any drawbacks though |
15:51:54 | bluenote | if the template does not work we could at least overload by the above closure approach |
15:52:09 | BlaXpirit | no :| |
15:52:31 | bluenote | you think template should work? |
15:52:50 | BlaXpirit | yes |
15:52:59 | bluenote | awesome |
15:53:08 | BlaXpirit | and no, the name getOrElse is ugly :| |
15:53:20 | reactormonk | BlaXpirit, comes from scala, got any other idea? |
15:53:22 | BlaXpirit | I don't want people to hate me when they use that lib |
15:53:22 | bluenote | yes, I admit that |
15:53:54 | BlaXpirit | the good old idea is to name it `get` |
15:54:39 | bluenote | but do you see the point why it would be important to see difference between a.getOr(b) = still optional, and a.getOrElse(b) = definitely a concrete value here |
15:54:58 | * | milosn joined #nim |
15:55:10 | BlaXpirit | i don't think a.getOr(b) = still optional, is useful |
15:55:11 | bluenote | when chaining many `get` its just not clear where a default is injected |
15:55:21 | BlaXpirit | how often would you do that?? |
15:56:05 | bluenote | when using the full power of chaining optional computations this is pretty common I think |
15:57:15 | BlaXpirit | this is not haskell |
15:57:25 | BlaXpirit | optionals are gonna be rare as heck |
15:57:31 | bluenote | hm, I think it is very useful to look at (a get b) and tell whether I have somethin to work with, or not -- such a fundamental difference |
15:58:05 | bluenote | not necessarily |
15:58:25 | bluenote | Haskell/Scala users trying Nim |
15:58:30 | * | milosn quit (Client Quit) |
15:58:34 | * | milosn_ joined #nim |
15:59:04 | * | Ven quit (Ping timeout: 255 seconds) |
16:00:23 | * | ddl_smurf quit (Quit: ddl_smurf) |
16:02:15 | Senketsu | so, i wanted to try openArray but if i make var x: openArray[string] compiler throws Error: invalid type: 'openarray[string]' , am i missing something ? |
16:02:40 | bluenote | openArray is for proc parameters only |
16:02:40 | Senketsu | and it bugs me it reports it with low case 'a' |
16:02:45 | Senketsu | ooh |
16:02:48 | reactormonk | Senketsu, yeah, an openarray is just varargs |
16:03:05 | Senketsu | welp, had a feeling it would be like that |
16:03:15 | bluenote | use either array[0..fixedSize, string] or seq[string] for dynamic size -- both can be passed where openArray is required |
16:03:29 | Senketsu | aight thanks |
16:03:34 | reactormonk | Senketsu, your goal? |
16:03:52 | * | milosn_ is now known as milosn |
16:03:54 | Senketsu | nothing really, wanted to jsut try |
16:04:50 | BlaXpirit | just don't use openarray |
16:05:03 | BlaXpirit | it should be made obsolete |
16:05:11 | BlaXpirit | bleh, i'm going too far |
16:05:23 | BlaXpirit | sometimes there is no easy way to avoid it for now |
16:05:48 | * | ddl_smurf joined #nim |
16:06:50 | bluenote | BleXpirit: Regarding the benefit of differentiating the gets, maybe an example: |
16:07:37 | Senketsu | nah i'm the seq[] lover anyway, didnt have a use for openarrays so far, just wanted to try |
16:07:55 | bluenote | in Scala, when I see long chaning of optionals like `val x = a getOr b getOr c getOrElse d` I immediately know that I have a value |
16:09:06 | bluenote | also I can see that (a getOrElse b get c) either does not make sense (because we have injected a default at b) or calls a member c on this result |
16:09:25 | bluenote | if I only see getOr, I also know that my result is still optional |
16:09:57 | bluenote | with only one "get" all this information is lost |
16:10:02 | BlaXpirit | ok but this is rare |
16:10:10 | * | JoshuaT joined #nim |
16:10:23 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
16:10:31 | BlaXpirit | chains are not worth considering. |
16:10:40 | bluenote | no, not in functional programming |
16:10:48 | * | JoshuaT quit (Max SendQ exceeded) |
16:10:54 | * | coffeepot joined #nim |
16:11:23 | bluenote | and since optionals should address the needs of functional programmers, it would make sense to follow such common patterns |
16:11:25 | * | JoshuaT joined #nim |
16:11:57 | BlaXpirit | no |
16:12:27 | BlaXpirit | the only purpose is to avoid multiple incompatible reimplementations |
16:12:28 | bluenote | the whole point of the option monad is the chain optional results in the first place |
16:12:31 | BlaXpirit | we have like 5 of them now |
16:12:38 | * | coffeepot quit (Client Quit) |
16:12:47 | BlaXpirit | the whole point is to have optional return values in functions |
16:13:00 | bluenote | but then it should be done right |
16:13:05 | BlaXpirit | instead of nil or -1 or tuple-with-bool |
16:13:16 | BlaXpirit | it should be done simply |
16:13:42 | bluenote | having two gets will not kill simplicity |
16:14:02 | BlaXpirit | then make such a function in your own code |
16:14:24 | BlaXpirit | compatibility, which is the main point, will be accomplished |
16:14:35 | BlaXpirit | bloat it with whatever you want in your code. |
16:14:43 | BlaXpirit | (sorry if i seem rude, i'm always like that) |
16:14:44 | * | ddl_smurf quit (Quit: ddl_smurf) |
16:14:58 | bluenote | well, there is no standard yet |
16:15:24 | bluenote | this would be the time to make it right, and also the reason why I think this is worth arguing |
16:17:35 | * | profan joined #nim |
16:27:24 | * | endragor quit (Remote host closed the connection) |
16:28:35 | * | ddl_smurf joined #nim |
16:29:53 | reactormonk | I think the main part about functional programmers would be to stick the whole stdlib into concepts |
16:30:29 | BlaXpirit | more like sane programmers |
16:32:22 | * | ddl_smurf quit (Client Quit) |
16:41:47 | * | ddl_smurf joined #nim |
16:42:14 | * | the9to5 joined #nim |
16:43:34 | * | yglukhov___ quit (Ping timeout: 245 seconds) |
16:45:02 | renesac | http://forum.nim-lang.org/t/1211 <-- table operations returning optionals would solve this issue? |
16:46:25 | BlaXpirit | not really |
16:46:42 | BlaXpirit | i wouldn't want to use tables that return optionals by default |
16:46:49 | BlaXpirit | python's design should just be copied |
16:47:09 | BlaXpirit | [] should throw |
16:47:13 | BlaXpirit | raise* |
16:47:57 | renesac | I was never 100% happy with python way to handle dicts |
16:48:18 | * | dalarmmst quit (Ping timeout: 276 seconds) |
16:48:20 | renesac | but them, I never used a table that returns optionals to know how annoying it is |
16:48:24 | renesac | *then |
16:49:26 | BlaXpirit | well, with the awesome `?=` template it would potentially be even better than normal |
16:50:22 | renesac | what would be the equivalent in python? |
16:50:24 | * | ddl_smurf quit (Quit: ddl_smurf) |
16:50:27 | renesac | an if statement? |
16:50:37 | BlaXpirit | no equivalent to `?=` |
16:50:51 | BlaXpirit | closest is exception |
16:51:36 | reactormonk | BlaXpirit, nope, I don't like throws. they are expensive. optionals are cheaper. |
16:51:54 | BlaXpirit | if value ?= table[key]: a(value) else: b try: value = table[key] except: b else: a(value) |
16:52:09 | BlaXpirit | (right side is python) |
16:53:20 | BlaXpirit | aaand it should be except KeyError |
16:53:49 | * | ddl_smurf joined #nim |
16:54:06 | BlaXpirit | heck, if the `?=` template is embraced, then maybe one could reimplement it for their type to avoid optionals overhead |
16:54:39 | renesac | how so? |
16:54:44 | renesac | for tables? |
16:54:51 | BlaXpirit | tables are an example |
16:55:20 | renesac | I don't see how ?= would work w/o tables returning an option |
16:55:36 | * | ddl_smurf quit (Client Quit) |
16:55:42 | BlaXpirit | problem is, Arаq would never let optionals too deep into the standard library |
16:56:00 | BlaXpirit | this talk is pointless |
16:56:47 | * | mal`` quit (Ping timeout: 248 seconds) |
16:57:09 | * | mal`` joined #nim |
16:57:38 | renesac | I dunno |
16:58:10 | renesac | it also could be an additional function, like 'table.optGet(key)' |
16:58:22 | renesac | for it to return an optional |
16:58:32 | BlaXpirit | man, i still cringe from uglyCase every time |
16:58:47 | * | JoshuaT quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
16:59:32 | renesac | heh, I like it for functions, but not really for variables |
16:59:53 | renesac | what I cringe is constants looking like types |
17:00:31 | renesac | ALL_CAPS isn't pretty either... |
17:00:45 | * | dalarmmst joined #nim |
17:01:12 | renesac | but returning to the conversation, I don't understood what you meant by reimplementing ?= |
17:01:53 | BlaXpirit | specifying |
17:02:03 | renesac | what is there to specify? |
17:02:19 | * | TEttinger quit (*.net *.split) |
17:02:20 | * | MyMind quit (*.net *.split) |
17:02:20 | * | Jesin quit (*.net *.split) |
17:02:20 | * | no_name quit (*.net *.split) |
17:02:20 | * | federico3 quit (*.net *.split) |
17:02:20 | * | heinrich5991 quit (*.net *.split) |
17:02:26 | BlaXpirit | let me think, my thoughts are jumbled |
17:03:02 | * | heinrich5991 joined #nim |
17:03:10 | * | federico3 joined #nim |
17:03:11 | * | MyMind joined #nim |
17:04:38 | * | gsingh93 joined #nim |
17:04:39 | renesac | hide a try/except block behind ?= in case of tables? |
17:05:01 | * | thotypous quit (Quit: WeeChat 1.1.1) |
17:05:03 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
17:05:13 | renesac | I'm not sure how efficient is it |
17:06:43 | * | TEttinger joined #nim |
17:07:34 | BlaXpirit | i dunno... term rewriting template for ?=(expr, table[T]) that would bypass the creation of optional |
17:07:53 | BlaXpirit | i dunno... term rewriting template for ?=(expr, [](table[T], T)) that would bypass the creation of optional |
17:08:27 | * | no_name joined #nim |
17:08:28 | renesac | does that second syntax work? |
17:08:50 | BlaXpirit | not literally this syntax |
17:08:55 | BlaXpirit | or maybe this wouldn't work at all |
17:08:56 | * | brson joined #nim |
17:09:28 | BlaXpirit | how do i know, there is no information on term rewriting things |
17:10:42 | BlaXpirit | which reminds me something i wanted to try |
17:12:10 | renesac | and it changes the semantics of the table[key], as it usually would throw if there was no key |
17:12:26 | BlaXpirit | renesac, it does not throw |
17:12:30 | renesac | I think it would be too much magic |
17:12:37 | BlaXpirit | you don't understand |
17:12:52 | BlaXpirit | i'm just hypothesising what could be if table[key] returned optional |
17:13:21 | reactormonk | BlaXpirit, why no optionals in the stdlib? Sounds good to me |
17:13:22 | renesac | oh, indeed |
17:13:42 | BlaXpirit | reactormonk, 1. backwards compatibility 2. political reasons |
17:14:13 | BlaXpirit | good in all other aspects, sure |
17:14:21 | renesac | table.optGet() or table.getOpt() would not break backwards compatibility |
17:14:35 | BlaXpirit | sure |
17:14:48 | renesac | but not too nice to write |
17:15:16 | renesac | well, away |
17:15:41 | reactormonk | we need return type overloading ;-) |
17:17:31 | reactormonk | BlaXpirit, could you somehow engineer a converter such that options are transparent but deprecate said converter? |
17:18:06 | BlaXpirit | i dont care. |
17:19:32 | * | davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
17:19:34 | BlaXpirit | well that was kinda harsh :| |
17:19:43 | BlaXpirit | i'm tired and distracted |
17:28:09 | * | gsingh93 quit (Ping timeout: 240 seconds) |
17:37:16 | * | bluenote quit (Ping timeout: 246 seconds) |
17:39:25 | * | yglukhov___ joined #nim |
17:42:10 | * | yglukhov___ quit (Client Quit) |
17:51:28 | * | vikaton quit () |
17:56:04 | * | vendethiel joined #nim |
18:04:59 | * | bluenote joined #nim |
18:15:39 | * | davidhq joined #nim |
18:17:48 | * | OnO joined #nim |
18:18:01 | * | banister joined #nim |
18:22:38 | * | BlaXpirit quit (Remote host closed the connection) |
18:24:31 | * | BlaXpirit joined #nim |
18:27:07 | * | JoshuaT joined #nim |
18:27:12 | * | yglukhov___ joined #nim |
18:28:39 | * | milosn quit (Read error: Connection reset by peer) |
18:29:13 | * | jholland joined #nim |
18:30:52 | * | otirc joined #nim |
18:34:21 | * | milosn joined #nim |
18:35:36 | * | otirc left #nim ("WeeChat 1.0.1") |
18:40:04 | * | fizzbooze joined #nim |
18:42:05 | * | filcuc joined #nim |
18:47:24 | * | fizzbooze quit (Ping timeout: 252 seconds) |
18:48:03 | * | the9to5 quit () |
18:51:01 | * | buupisaway is now known as buup |
18:56:06 | * | filcuc quit (Ping timeout: 272 seconds) |
18:57:20 | BlaXpirit | no matter how many times i try term rewriting macros, they never work |
18:57:33 | BlaXpirit | compiles fine, sure |
18:57:36 | BlaXpirit | but no effect, ever |
18:57:50 | BlaXpirit | the only thing that works is the example in manual |
18:57:55 | BlaXpirit | the only piece of information on it |
19:04:20 | BlaXpirit | does it require at least one constant or what |
19:04:41 | BlaXpirit | canonMul indicates otherwise |
19:06:05 | * | strcmp1 joined #nim |
19:08:09 | * | BitPuffin quit (Ping timeout: 256 seconds) |
19:08:56 | * | Jehan_ joined #nim |
19:13:11 | def- | BlaXpirit: I use them in my bigints module, they seem to work for me: https://github.com/def-/nim-bigints/blob/master/src/bigints.nim |
19:13:40 | BlaXpirit | well these are trivial |
19:18:13 | BlaXpirit | template optDivMod*{w = y div z; x = y mod z}(w,x,y,z: BigInt) = |
19:18:23 | BlaXpirit | ok this sure looks interesting but i have no idea |
19:18:46 | BlaXpirit | probably just a sequence of 2 statements |
19:18:55 | BlaXpirit | just detects a |
19:22:36 | * | Perelandric joined #nim |
19:26:07 | BlaXpirit | ok so why doesn't this work? https://bpaste.net/show/193da406c037 |
19:27:19 | BlaXpirit | tried with `[]` `..` etc |
19:28:13 | def- | Weird, a bug? |
19:28:59 | BlaXpirit | well sure, it's probably a bug that barely anything works |
19:30:45 | BlaXpirit | also tried optFind{find(`[]`(s, a), sub)}(s, sub: string, a: Slice[int]) |
19:36:41 | * | grncdr joined #nim |
19:37:53 | * | BlaXpirit_ joined #nim |
19:42:51 | synthmeat | how about this for a logo? out of 30 variants today, i like this the best https://www.dropbox.com/s/0knw3guzss7dmgb/2015-05-12%2021.39.39.jpg?dl=0 |
19:43:33 | synthmeat | colors are variable, as long as the middle one (on "I") is stronger |
19:44:16 | * | the9to5 joined #nim |
19:44:55 | synthmeat | (and it's just a sketch, obviously) |
19:46:41 | Jehan_ | Doesn't Nim already have a logo? |
19:46:46 | * | grncdr quit (Ping timeout: 272 seconds) |
19:47:02 | flaviu | That looks great, but Nim does have a logo already. |
19:47:13 | * | the9to5 quit (Client Quit) |
19:47:16 | flaviu | https://github.com/nim-lang/assets/tree/master/Art |
19:47:35 | synthmeat | i know it does, i'm just playing |
19:49:27 | * | RegisterOn left #nim (#nim) |
19:49:28 | synthmeat | "NIM" word is pretty interesting typographically, is all |
19:51:16 | renesac | I don't like the I not slanted the same way as the other letters |
19:51:44 | renesac | the idea is interesting, but don't looks good for me |
19:51:52 | synthmeat | renesac: good catch, tbh |
19:51:52 | renesac | just my 2 cents |
19:55:31 | * | the9to5 joined #nim |
19:57:33 | synthmeat | renesac: i'll do a version with slanted "I" for ya and call it a day :) |
19:58:36 | * | dddddd quit (Ping timeout: 244 seconds) |
20:02:09 | * | MyMind quit (Ping timeout: 240 seconds) |
20:03:18 | * | xender joined #nim |
20:04:05 | flaviu | synthmeat: I really like your color choice btw. |
20:04:22 | xender | Hi. Is Nim compiler available as a library, usable as JIT? |
20:04:23 | synthmeat | flaviu: it's the only colors i have :D |
20:05:19 | * | bluenote quit (Ping timeout: 246 seconds) |
20:05:30 | * | the9to5 quit () |
20:06:06 | flyx | how do I properly use "not nil"? I get the error "cannot prove [var] is not nil" at a place where it cannot be nil |
20:06:45 | reactormonk | xender, not really. You could use the nim vm, but it's rather limited. |
20:07:34 | xender | reactormonk: Hm, I'm quite new to Nim. So there is a VM too? |
20:07:50 | reactormonk | xender, yup, for the macros |
20:07:59 | flaviu | a.pomf.se/jschqj.svg a.pomf.se/ztafet.svg |
20:08:01 | xender | reactormonk: I've read that it's compilable to C and JavaScript, is it right too? |
20:08:47 | flaviu | Actually, that second link is wrong. Give me a few moments of fix it. |
20:09:11 | reactormonk | xender, it compiles to C and javascript |
20:09:20 | flaviu | a.pomf.se/ksxltj.svg fixed |
20:09:39 | BlaXpirit_ | so i guess that's that, nobody knows about term rewriting macros |
20:09:59 | * | ddl_smurf joined #nim |
20:10:20 | xender | reactormonk: I see. So no luck with JIT-ing, even with Clang/LLVM to handle C JIT? |
20:10:51 | flaviu | xender: Why do you want JIT? |
20:11:05 | dtscode | nim doesn't jit? |
20:11:11 | BlaXpirit_ | -_- |
20:11:26 | reactormonk | xender, you could JIT the generated C code but I don't see why you would |
20:11:28 | synthmeat | reactormonk: i think you were *spot on*... |
20:11:29 | dtscode | Oh wait... Sorry... Was thinking of a different language :3 |
20:12:03 | synthmeat | logo with slanted "I" - https://www.dropbox.com/s/2z7c6cu34cpll00/2015-05-12%2022.09.37.jpg?dl=0 |
20:12:10 | * | dddddd joined #nim |
20:12:32 | renesac | humm, yeah, that is better |
20:12:39 | flaviu | Hmm, that's not what I was thinking, but it looks better than what I came up with: http://a.pomf.se/xzzhpz.svg |
20:13:03 | renesac | flaviu: in your version the N is strange |
20:13:09 | BlaXpirit_ | ok i'm done -_- |
20:13:19 | flaviu | It sort of looks like http://www.scala-lang.org/resources/img/smooth-spiral.png |
20:13:21 | synthmeat | flaviu: ah, you did the slant on other side. cool |
20:13:22 | renesac | BlaXpirit: I think only Araq knows about it |
20:13:43 | * | BlaXpirit_ quit (Quit: Quit Konversation) |
20:13:56 | synthmeat | renesac: i like the three stripes in the middle now. it's less boring than the original one! |
20:14:16 | xender | reactormonk, flaviu: just got a crazy idea about writing Python with Nim fragments (for speedups), but without separate pre-compilation step and wanted to look around whether such a thing would be feasible at all. |
20:14:36 | synthmeat | renesac: not only that, but i think this might even work in monochrome now |
20:14:37 | reactormonk | xender, nim-borg for python integration |
20:15:03 | reactormonk | xender, and nim compiles fast. So there's something. |
20:15:22 | renesac | synthmeat: yeah, and it would be cool 3D printed too, or sculpted with metal, whatever |
20:15:23 | renesac | XD |
20:15:37 | synthmeat | :) |
20:16:00 | flaviu | xender: Interesting. You could create an executable for each function, and use the same sort of strategies as AFL to speed up execution. |
20:16:01 | synthmeat | renesac: yeah, but mono is kinda important for cheap printed stuffs, dunno :) |
20:16:30 | flaviu | You should also be able to do a shared lib and mess around with the linker to interface it with python. |
20:17:00 | flaviu | But you definitely don't need JIT in the "fast initial compile, optimize later" sense of the word. |
20:18:17 | renesac | I can't find that new interpreter for nim, that uses the compiler + tcc |
20:18:17 | xender | reactormonk: Also, my first crazy idea was a bit different. Do you maybe know PyPy? They've made a limited retrosection-based Python-to-C compiler, called RPython. The strageness lies in that the Python code to be compiled is analyzed in Python runtime using retrospection features, so that existing Python interpreter handles the parsing. I was thinking if it would be feasible to compile Python to Nim in a |
20:18:19 | xender | similar way. |
20:19:04 | renesac | xender: cython is what you want, probably |
20:19:15 | renesac | but see nimborg |
20:20:09 | xender | flaviu: Executable per function would have a hell of overhead, but I was thinking about compiling to a shared library, yeah. |
20:20:20 | renesac | and someone was to write a blog post on how to create python functions with nim |
20:20:31 | flaviu | xender: Not with AFL's strategies :) |
20:20:34 | xender | renesac: Cython doesn't compile to JS. ;) |
20:20:48 | flaviu | but 5000 execs/sec isn't too good, yeah. |
20:20:59 | renesac | right, not even with emscripten? |
20:21:40 | renesac | well, you basically can create python libs in the same way you create them using C |
20:22:27 | renesac | but then I don't know how JS enters in this conversation |
20:22:50 | xender | renesac: Hm, I don't know TBH. But I have somehow bad feeling about Emscriptening the Cythoned code. Well, it still depends on CPython internals and standard library. Some of it is actually ported to Emscripten (Empythoned project), but it becomes a sandwich of transpilation. |
20:23:11 | renesac | heh |
20:24:26 | xender | Come to think of it, how does JS backed of Nim behave? It compiles to something like asm.js, tried to stay higher-level, or maybe it uses Emscripten too? |
20:24:58 | * | Matthias247 joined #nim |
20:25:31 | xender | flaviu: I'm trying to search, but no success. What are those AFL strategies you've mentioned? |
20:25:58 | renesac | I don't know actually, but you can also use emscripten with the nim's C backend |
20:25:59 | renesac | http://hookrace.net/blog/porting-nes-go-nim/ |
20:26:29 | flaviu | xender: http://lcamtuf.blogspot.com/2014/10/fuzzing-binaries-without-execve.html |
20:26:36 | flaviu | Horrible hack :) |
20:27:36 | xender | Oh, lcamtuf :) |
20:27:58 | xender | He's somehow famous on Polish scene. Heh. |
20:29:45 | * | dalarmmst quit (Ping timeout: 256 seconds) |
20:30:10 | * | Kingsquee joined #nim |
20:30:45 | * | davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
20:33:09 | xender | flaviu: Heh, that hack is cute indeed, but still, I'd just compile to shared library. Very interesting link, thank you. ^ ^ |
20:34:55 | gokr | xender: I am actually playing with a "transpiler" toy right now - from Squeak (Smalltalk) to Nim. |
20:35:19 | * | filcuc joined #nim |
20:35:22 | xender | gokr: Hm, interesting. Do you have any experiences to share? |
20:35:46 | gokr | Yeah, but ... Smalltalk is different, so it may be hard to compare. |
20:35:52 | xender | Unfortunately, I don't know Smalltalk, but any advice would be nice. |
20:36:08 | gokr | But the general idea was to reuse most of the existing compilation pipeline in Smalltalk. |
20:36:34 | gokr | So in Squeak you have a Scanner, Parser, Compiler, bunch of AST nodes etc etc. All in Smalltalk. |
20:36:46 | * | filwit joined #nim |
20:37:10 | gokr | What I am doing is that I am making a visitor basically over the AST nodes of the compiled Smalltalk methods. |
20:37:18 | * | redwyn joined #nim |
20:37:25 | gokr | And generating Nim source code. |
20:37:49 | xender | Mhm. Anything interesting about the generation phase itself? |
20:38:11 | gokr | At the moment - since Smalltalk is dynamically typed like Python - I am using an object variant trying to work as a universal "type". |
20:38:18 | * | fizzbooze joined #nim |
20:38:33 | xender | Mhm |
20:38:52 | gokr | What I am hoping to achieve (apart from having fun) is enough of a transpiler that I can actually transpile the compiler classes themselves. |
20:39:00 | gokr | And thus bootstrapping a Smalltalk compiler in Nim. |
20:39:43 | xender | :) |
20:40:06 | gokr | I have a bunch of "prior art" though, and Smalltalk is "smaller" than Python. |
20:40:54 | xender | By smaller you mean the core of the langueage or the standard library? |
20:41:10 | gokr | Core language. Very small. |
20:41:15 | gokr | 5 keywords. |
20:41:17 | xender | Mhm |
20:41:25 | xender | Oh, that's interesting |
20:41:39 | gokr | The AST is very small and the grammar fits on a postcard |
20:41:55 | renesac | xender: try to guess what those keywords are |
20:41:56 | renesac | XD |
20:41:57 | gokr | For a "wow" take a look at http://devblog.avdi.org/2015/05/11/in-which-i-make-you-hate-ruby-in-7-minutes/ |
20:42:08 | gokr | (sorry for the blurb) |
20:43:54 | xender | renesac: I guess it would be "class", some kwyword for defining functions/methods and basic data types? But I have no idea really. |
20:45:00 | gokr | The 5 keywords are hard to guess. |
20:45:50 | gokr | They are "nil, true, false, super, self". And oh, I always forget - they are actually 6 - "thisContext" too. |
20:46:28 | gokr | Funny enough all 6 are references to "known objects". |
20:46:44 | Jehan_ | Class definitions are actually method calls in Smalltalk. |
20:47:20 | Jehan_ | E.g.: Object subclass: #Foo. |
20:49:21 | gokr | Yeah, the quick video there shows that and much more. |
20:49:50 | * | gokr crawls back under his Smalltalk stone... |
20:51:04 | xender | What is that magic at 5:48? |
20:51:50 | * | redwyn quit (Quit: leaving) |
20:52:13 | xender | Does it just make a text search through examples, or somehow explores the space of "what function would take the first given expression and return the second one"? |
20:52:26 | xender | Or is it something entirely different? |
20:52:51 | gokr | It does a brute force "test" of a known set of methods |
20:53:12 | gokr | So yes, the second description you made is correct. |
20:54:08 | * | buup is now known as buupisaway |
20:54:11 | gokr | So from this list of known methods - it selects out those that take one argument (in this case), and in fact, here we know the type of the receiver (a String duh) so the set of methods to run is smaller. |
20:54:50 | gokr | I haven't looked at the code in detail, but its quite effective when it comes to simpler stuff like String, Collections and so on |
20:54:51 | * | buupisaway is now known as buup |
20:54:59 | xender | Interesting |
20:58:27 | gmpreussner|work | gokr: thx for the link :) |
20:59:35 | gokr | Hehe, well... I just think Smalltalk (just as Lisp and Forth) is something every programmer should have seen once at least. |
21:00:14 | gokr | Steve Jobs did, and look where that went. ;) |
21:00:16 | gmpreussner|work | i usually only stumble upon Smalltalk when reading ancient books on compiler design |
21:00:25 | gmpreussner|work | maybe i'll spend some more time with it |
21:00:41 | gokr | If you want, just holler and I can give some hints on what to look at. |
21:00:45 | gmpreussner|work | seems interesting from an IDE usability point of view |
21:00:50 | gokr | Ooooh, yeah. |
21:00:58 | gmpreussner|work | *holler* |
21:01:00 | gmpreussner|work | ^_^ |
21:01:11 | gokr | We can go private |
21:01:27 | * | OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
21:04:17 | xender | Hm, his second video is interesting too |
21:04:23 | xender | https://www.youtube.com/watch?v=Cy-dbodBEDI |
21:06:51 | xender | gokr: Hm, what's the deal with Forth? I've just seen Smalltalk and I have a friend who writes Elisp, so I kinda know what's it about, but I don't know yet what's so special about Forth. I only know that it's stack-based... |
21:07:49 | gokr | Yeah, I saw that video too - and I know all about what he is doing since I am a long time Squeaker/Pharo guy. |
21:09:04 | gokr | Forth is stack based yes, a so called "concatenative" language. It was an eye opener for me when I was like 12 years old. |
21:12:22 | xender | Concatenative? |
21:14:02 | * | vendethiel quit (Quit: q+) |
21:22:33 | * | fizzbooze quit (Ping timeout: 240 seconds) |
21:30:37 | gokr | xender: https://en.wikipedia.org/wiki/Concatenative_programming_language |
21:31:45 | xender | gokr: Hm, interesting |
21:33:24 | gokr | xender: For a trip on that stuff: http://factorcode.org |
21:40:05 | * | gokr quit (Read error: Connection reset by peer) |
21:40:58 | * | gokr joined #nim |
21:48:29 | * | filcuc quit (Quit: Konversation terminated!) |
21:49:28 | * | filcuc joined #nim |
21:49:40 | * | filcuc quit (Client Quit) |
21:51:01 | * | Jesin joined #nim |
21:56:33 | * | yglukhov___ quit (Quit: Be back later ...) |
22:02:38 | Varriount | onionhammer: Still working on the release of NimLime, it appears I lost some local changes I made. |
22:04:32 | Varriount | onionhammer: Also, take a look at this - https://github.com/cryzed/Sublime-Text-3-Pulse-Plugin |
22:05:11 | Varriount | dom96: Is there a nimble command to list packages currently installed on the system? |
22:05:20 | onionhammer | ol |
22:05:26 | onionhammer | varriount pulse? |
22:08:05 | * | notfowl- joined #nim |
22:08:44 | Jehan_ | Varriount: nimble list --installed |
22:09:30 | Jehan_ | That pulse thing looks like a usability nightmare. |
22:10:22 | Varriount | Jehan_: Thanks. |
22:10:59 | * | notfowl quit (Excess Flood) |
22:11:00 | dom96 | Varriount: I think there is a flag you can pass to 'list' |
22:11:18 | * | buup is now known as buupisaway |
22:15:35 | * | Matthias247 quit (Read error: Connection reset by peer) |
22:16:08 | cryzed | Jehan_, onionhammer: It was just a little experiment to become more familiar with the ST3 API back then. Varriount mentioned possibly using a quick pulse (once) as a visual indication for a notification, such as the finishing of a long-running process |
22:16:33 | Jehan_ | Ah, I see. |
22:16:36 | cryzed | I don't really have it running non-stop, however cool that might make me look |
22:16:40 | cryzed | ;) |
22:30:46 | * | Trustable quit (Remote host closed the connection) |
22:37:03 | * | ingsoc quit (Quit: Leaving.) |
22:53:03 | onionhammer | ;) |
22:54:30 | * | BitPuffin|osx joined #nim |
22:54:35 | onionhammer | cryzed varriount can we add actual visual studio style intellisense yet? :) |
22:54:38 | onionhammer | with nimsuggest |
22:54:54 | * | milosn quit (Ping timeout: 246 seconds) |
22:56:24 | * | BlaXpirit quit (Quit: Quit Konversation) |
23:06:01 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
23:09:49 | * | thotypous joined #nim |
23:10:00 | cryzed | there are themeable tooltips |
23:10:01 | cryzed | so yes |
23:10:04 | cryzed | with a bit of work it can be done |
23:10:15 | cryzed | ping onionhammer |
23:11:56 | * | thotypous quit (Client Quit) |
23:12:11 | * | thotypous joined #nim |
23:15:31 | * | kor joined #nim |
23:15:39 | kor | hello |
23:15:54 | kor | can someone please kick me from this channel? |
23:16:06 | Xe | why? |
23:16:17 | kor | i need to see what it looks like from the client side |
23:16:20 | kor | research purposes |
23:16:39 | kor | can someone please kick or ban me? |
23:16:41 | Xe | :kicker!user@host KICK #channel kor :reason |
23:16:48 | Xe | there |
23:17:08 | kor | i'm still here |
23:17:50 | kor | Xe: can you kick me off this channel? |
23:17:55 | * | Jehan_ quit (Quit: Leaving) |
23:18:00 | Xe | no, see PM |
23:23:38 | * | kor left #nim (#nim) |
23:24:34 | * | Jesin quit (Quit: Leaving) |
23:26:26 | * | Jesin joined #nim |
23:49:02 | * | flaviu quit (Read error: Connection reset by peer) |
23:50:04 | * | brson quit (Quit: leaving) |
23:57:47 | * | flaviu joined #nim |