00:03:19 | BlaXpirit | filwit, https://gist.github.com/BlaXpirit/7e111f588177d763497e |
00:04:30 | filwit | there we go. |
00:14:57 | * | TEttinger joined #nim |
00:16:02 | * | tmku quit (Ping timeout: 272 seconds) |
00:19:22 | * | brson quit (Ping timeout: 244 seconds) |
00:21:56 | * | anthony_ joined #nim |
00:23:09 | * | tmku joined #nim |
00:31:15 | * | HakanD___ quit (Quit: Be back later ...) |
00:39:53 | * | EXetoC quit (Ping timeout: 246 seconds) |
00:41:05 | * | BlaXpirit quit (Quit: Quit Konversation) |
00:45:00 | * | gsingh93 joined #nim |
00:45:01 | * | gsingh93_ joined #nim |
00:58:36 | * | fowlmouth quit (Ping timeout: 240 seconds) |
01:11:52 | * | pregressive quit (Remote host closed the connection) |
01:27:04 | * | fowl joined #nim |
01:34:29 | * | akiradeveloper joined #nim |
01:41:19 | dhasenan | In the unittest module, what is 'suite' for? It doesn't seem to affect the output. |
01:41:42 | dhasenan | Or at least, the suite name doesn't show up in the output. |
01:45:34 | MagusOTB | what does "invalid type" mean? |
01:46:26 | def- | MagusOTB: have an example where you get that? |
01:46:59 | MagusOTB | one sec |
01:49:28 | MagusOTB | http://pastebin.com/KU3BQHmz |
01:49:38 | flaviu | dhasenan: It doesn't do anything, but that doesn't mean it'll continue to do nothing. |
01:50:11 | MagusOTB | I'm guessing I'm doing something wrong with the 'WindowPtr' bit, but I'm not sure what. |
01:50:23 | flaviu | It might be used to create JUnit XML in the future. |
01:52:36 | def- | MagusOTB: `var int` makes no sense. When it's a var object, every field is mutable, otherwise none |
01:53:37 | MagusOTB | ah. duh. |
01:54:16 | MagusOTB | in the program I extracted that from, the error was on a line very far from that |
01:54:41 | def- | yes, it's a bit weird that the error only happens when you use the object |
01:54:54 | def- | You could report that the error line should be fixed |
01:55:04 | def- | as a github issue |
01:56:01 | * | itsmeront quit (Ping timeout: 246 seconds) |
01:57:39 | MagusOTB | the smaller version looks like it does it right though |
02:01:24 | * | anthony_ quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
02:04:20 | * | anthony joined #nim |
02:04:44 | * | anthony is now known as Guest44126 |
02:25:50 | * | akiradeveloper quit (Remote host closed the connection) |
02:30:04 | * | darkf joined #nim |
02:32:42 | a5i | Where is BlaXpirit?! |
02:34:00 | * | endragor joined #nim |
02:37:21 | reactormonk | a5i, ruby was my first language and I'm with nim now :-) |
02:38:53 | a5i | reactormonk: it could have been your first, but I love Ruby :P |
02:39:00 | a5i | JavaScript was my first |
02:39:18 | reactormonk | a5i, first major one. I've messed with VB and JS before |
02:41:05 | reactormonk | pigmej, ping |
02:41:43 | reactormonk | pigmej, how would you make the data interchange format for epc? alist style or just a list to save space? |
02:44:13 | a5i | I like both Nim and Crystal |
02:44:28 | reactormonk | I could a) rewrite suggest.nim b) just reparse the output... |
02:44:44 | a5i | Elegant, Fast, and many nice features |
02:45:08 | a5i | at the end of the day, I love Ruby syntax :P |
02:45:16 | a5i | most of it anyway |
02:49:30 | * | bjz joined #nim |
02:49:48 | onionhammer | crystal would be great without all those 'end's :) |
02:55:05 | * | jholland quit (Quit: Connection closed for inactivity) |
02:56:20 | * | BitPuffin|osx quit (Ping timeout: 265 seconds) |
03:03:52 | * | Guest44126 quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
03:08:34 | * | johnsoft quit (Ping timeout: 245 seconds) |
03:10:17 | * | saml_ quit (Quit: Leaving) |
03:19:57 | * | johnsoft joined #nim |
03:26:21 | * | akiradeveloper joined #nim |
03:31:01 | * | akiradeveloper quit (Ping timeout: 248 seconds) |
03:31:51 | * | HakanD___ joined #nim |
03:33:39 | * | akiradeveloper joined #nim |
03:36:04 | * | HakanD___ quit (Ping timeout: 245 seconds) |
03:49:02 | * | Kingsquee joined #nim |
04:15:08 | * | gsingh93 quit (Ping timeout: 250 seconds) |
04:25:01 | * | gsingh93 joined #nim |
04:27:59 | * | gsingh93_ quit (Ping timeout: 256 seconds) |
04:29:33 | MagusOTB | how do I instantiate a var object? |
04:30:28 | * | gsingh93 quit (Ping timeout: 244 seconds) |
04:33:57 | Varriount | MagusOTB: Uh, what? |
04:34:24 | MagusOTB | so earlier I tried to make an object with a mutable field, and I guess it needs to be a var object |
04:34:36 | Varriount | MagusOTB: 'var x: objectType'? |
04:34:50 | Varriount | Or do you mean |
04:35:14 | Varriount | 'proc foo(p: var objecttype) = ... |
04:35:38 | MagusOTB | is 'var object' not a thing? |
04:36:32 | Varriount | What do you mean? It exists in proc parameters, but it isn't a real type. |
04:36:55 | MagusOTB | I don't think I know what I mean, sec. I'm pbad at this. |
04:36:55 | cazov | like type TObj = var object Property : Int or w/e |
04:37:02 | MagusOTB | yeah that ^^ |
04:37:09 | Varriount | You can't do that. |
04:37:33 | MagusOTB | can I make a constructor that has a return value that defaults to var type |
04:37:43 | Varriount | MagusOTB: Could you just show me your code? |
04:37:50 | MagusOTB | I wan to be able to say 'var a = newThing()' and have a come out to be var thing instead of thing |
04:38:04 | MagusOTB | one sec |
04:39:24 | MagusOTB | http://pastebin.com/VWG6EsUx |
04:39:37 | MagusOTB | I want a to be a var thing, not an immutable thing, is that the right way to do it? |
04:40:03 | Varriount | Uh, no. |
04:40:10 | MagusOTB | I don't think I understand how storage classes work in this language :| |
04:40:25 | Varriount | MagusOTB: What programming language are you coming from? |
04:40:50 | MagusOTB | C |
04:41:00 | MagusOTB | alsoa a fair amount of python and javascript |
04:41:01 | MagusOTB | but mostly C |
04:43:27 | fowl | MagusOTB, var thing = Thing() # now you can get its address and mutate it; let thing = Thing() # now this isnt possible |
04:44:21 | Varriount | MagusOTB: https://gist.github.com/anonymous/b9d4b2c72474eec3f6ea |
04:46:25 | Varriount | MagusOTB: An object is pretty much equivalent to a C struct |
04:47:02 | cazov | does returning an object cause a copy? |
04:47:12 | Varriount | In this case, no. |
04:47:34 | Varriount | Nor does passing an object type as an argument to a procedure |
04:48:02 | Varriount | However an object type will be copied when assigned. |
04:51:50 | cazov | ok. that makes sense. thanks :] |
04:55:21 | Varriount | cazov, MagusOTB: https://gist.github.com/Varriount/5ce47935b973dfe44004 |
04:56:25 | Varriount | Adding 'var' to a parameter type essentially tells Nim 'make the implicit pointer passed for this type mutable' |
04:57:13 | Varriount | (As, again, Nim passes most things by reference/pointer behind the scenes) |
04:57:31 | MagusOTB | ah |
04:57:32 | MagusOTB | neat |
04:57:34 | cazov | ahh ok |
04:58:22 | MagusOTB | newTypeName is the canonical way to construct things, right? |
04:58:53 | Varriount | MagusOTB: For reference types, I think. For object types, it's 'initTypeName'. |
04:59:04 | Varriount | Although, I might have those switched around. |
05:00:19 | Varriount | MagusOTB: Whenever I read your nick, I think of MantisBT (Bug tracker software) |
05:00:35 | MagusOTB | ha |
05:00:36 | MagusOTB | I've seen that |
05:01:02 | MagusOTB | that's a new one though :) |
05:01:52 | MagusOTB | so the difference between a mutable and nonmutable type is per-instance and the difference between a reference and object type is per type? |
05:02:36 | MagusOTB | err... not nomutable type, nonmutable... identifier? |
05:02:56 | Varriount | MagusOTB: Pretty much, although you can augment already existing types with 'ref' when declaring a variable type |
05:03:15 | Varriount | var obj: ref ObjectType |
05:04:35 | MagusOTB | yeah... how do you declear a whole type to be ref? |
05:05:05 | Varriount | type RefType = ref object |
05:05:20 | MagusOTB | ok, I think that's where I got 'var object' |
05:05:28 | Varriount | (Or ref ObjType, or ref RefType) |
05:06:04 | MagusOTB | so 'var' and 'ref' are orthogonal |
05:07:24 | MagusOTB | thanks for the help, I successfully summoned a red cube, so imma head out. |
05:07:37 | * | MagusOTB quit (Quit: leaving) |
05:07:54 | * | fowl quit (Quit: Leaving) |
05:09:11 | * | filwit quit (Quit: Leaving) |
05:09:40 | * | fowl joined #nim |
05:13:38 | * | ChrisMAN quit (Ping timeout: 250 seconds) |
05:19:30 | * | buMPnet quit (Read error: Connection reset by peer) |
05:20:57 | * | buMPnet joined #nim |
05:45:35 | * | transfuturist joined #nim |
05:46:28 | transfuturist | Araq: Have you considered adding a top-of-file pragma to set compiler options directly in the source? |
05:46:47 | transfuturist | it would be more convenient than separate config files |
05:47:00 | * | gsingh93 joined #nim |
06:01:37 | * | gsingh93_ joined #nim |
06:15:16 | * | gsingh931 joined #nim |
06:18:41 | * | gsingh93 quit (Ping timeout: 276 seconds) |
06:19:31 | * | akiradeveloper quit (Remote host closed the connection) |
06:35:29 | * | gsingh931 quit (Ping timeout: 246 seconds) |
06:35:35 | * | gsingh93_ quit (Ping timeout: 276 seconds) |
06:39:24 | reactormonk | transfuturist, nah, compiler options are supposed to be global. |
06:39:41 | reactormonk | so as soon as you start including said file your compiler options to wush |
06:41:46 | * | Kingsquee quit (Remote host closed the connection) |
06:42:11 | * | Kingsquee joined #nim |
06:48:31 | * | Ven joined #nim |
06:53:06 | transfuturist | ah |
06:56:25 | pigmej | reactormonk: pong |
06:56:33 | pigmej | (I'm in central europe timezone :P) |
06:56:41 | reactormonk | yeah, gotta go sleep soon |
06:56:52 | pigmej | the problem with nimsuggest is that it works as a program not as a library |
06:57:43 | pigmej | about parsing... tbh I would copy nimsuggest :D |
06:57:48 | pigmej | and rewrite parsing part |
06:57:50 | reactormonk | yeah, I can hack epc in. I assume we only wanna go via stdin? |
06:57:59 | pigmej | reactormonk: not at all |
06:58:09 | pigmej | epc expects tcp communication on random port |
06:58:15 | pigmej | which is then printend on stdout at first |
06:59:10 | pigmej | so it's more like classical request/response with tcp |
06:59:21 | reactormonk | so epc talks via server |
06:59:31 | pigmej | yeah |
06:59:44 | reactormonk | can do |
07:00:06 | pigmej | but the serevr part seems to be quite easy (the epc compatible server) |
07:00:23 | reactormonk | how does the passing of the port work? |
07:00:34 | pigmej | it just prints port on stdout |
07:00:38 | pigmej | after process is started |
07:01:18 | pigmej | I could probably take care of this part on thursday from 7PM CEST. |
07:01:20 | pigmej | if so. |
07:02:16 | * | bluenote quit (Ping timeout: 246 seconds) |
07:02:59 | reactormonk | from what I see use writelnHook to accumulate the data and then create the sexp, then send it according to epc |
07:03:30 | pigmej | it's like request response |
07:03:46 | pigmej | just like classic rpc :) just emacs / elisp on client side |
07:03:54 | pigmej | and epc manages the processes also. |
07:04:19 | pigmej | (epc:controller) |
07:04:32 | * | transfuturist quit (Ping timeout: 272 seconds) |
07:04:35 | reactormonk | so yeah copy serve, parse the msglines (ugly, but best way), package into epc, code the starting sequence, code the rpc part |
07:04:56 | reactormonk | aka an action proc for epc |
07:05:02 | pigmej | yup |
07:05:15 | reactormonk | and methods. Can hardcode if you want. |
07:05:20 | pigmej | probably we don't even need the discovery |
07:05:26 | * | endragor_ joined #nim |
07:05:27 | pigmej | if you have time, then please so :) |
07:05:40 | pigmej | if not I could handle that probably :D |
07:06:03 | pigmej | the protocol is not that hard from what I know |
07:08:56 | * | endragor quit (Ping timeout: 240 seconds) |
07:12:34 | pigmej | reactormonk: I think when we will have /working/ version, then we can show it to araq and he will decide what to do with nimsuggest ? |
07:13:01 | reactormonk | pigmej, no idea. Gotta go do some contract work starting tomorrow and roadtripping meanwhile. |
07:13:41 | pigmej | hmm |
07:14:29 | pigmej | S-expressions are working ? |
07:15:43 | reactormonk | should according to my asserts |
07:17:25 | pigmej | then probably I should have all what I need :) (I suppose) |
07:20:03 | * | akiradeveloper joined #nim |
07:23:15 | * | endragor_ quit (Remote host closed the connection) |
07:24:43 | * | akiradeveloper quit (Ping timeout: 255 seconds) |
07:25:02 | * | milosn quit (Read error: Connection reset by peer) |
07:25:49 | * | milosn joined #nim |
07:27:59 | * | BlaXpirit joined #nim |
07:28:36 | * | vendethiel quit (Ping timeout: 256 seconds) |
07:29:02 | * | vendethiel joined #nim |
07:31:41 | * | akiradeveloper joined #nim |
07:46:12 | * | HakanD___ joined #nim |
07:46:53 | * | dtscode is now known as charmander |
07:47:03 | * | HakanD____ joined #nim |
07:47:11 | * | charmander is now known as squirtle |
07:48:23 | * | akiradeveloper quit (Remote host closed the connection) |
07:50:51 | * | HakanD___ quit (Ping timeout: 256 seconds) |
07:52:03 | * | HakanD____ is now known as HakanD |
08:05:49 | * | coffeepot joined #nim |
08:13:42 | * | akiradeveloper joined #nim |
08:18:02 | * | gokr_ quit (Quit: IRC for Sailfish 0.9) |
08:21:03 | * | bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
08:26:55 | * | Trustable joined #nim |
08:47:09 | * | Arrrr joined #nim |
08:48:33 | Arrrr | .eval echo "Hello Nimrod" |
08:48:36 | Mimbus | Arrrr: Hello Nimrod |
08:49:17 | repax | Ahoy, the pyrate has arrived! |
08:50:14 | coffeepot | Good morning Arrrr |
08:50:52 | Triplefox | .eval echo "Yarrrr" |
08:50:53 | Mimbus | Triplefox: Yarrrr |
08:50:57 | Triplefox | :3 |
08:51:03 | Arrrr | hello nimroders |
09:00:39 | fowl | morning all |
09:00:48 | * | OnO joined #nim |
09:00:54 | coffeepot | good morning fowl :) |
09:02:09 | fowl | i'm pretty close to having interfaces working |
09:02:56 | coffeepot | fowl: i discovered your repo last night, fowltek. Some really nice examples in there - though a bit out of date with the current compiler. |
09:03:29 | fowl | i have too much code to maintain :/ |
09:03:36 | * | milosn quit (Ping timeout: 240 seconds) |
09:04:20 | coffeepot | the neural networks one doesn't need any changes, might use it for something - just need to think what :D |
09:05:17 | coffeepot | some really great stuff though - I've enjoyed reading through your code for inspiration on my gaming related things |
09:05:27 | * | Arrrrr joined #nim |
09:05:49 | * | Arrrr quit (Ping timeout: 246 seconds) |
09:05:55 | fowl | cool :) |
09:06:38 | coffeepot | I wonder, would it be worth including things like quadtrees into a standard tree variation library? |
09:06:57 | Arrrrr | fowl: are interfaces going to work like go's ? |
09:07:29 | Arrrrr | Or have any special quality. |
09:09:52 | * | endragor joined #nim |
09:10:03 | fowl | pretty much the same thing |
09:11:14 | fowl | except anything cool in go is hard coded in the compiler |
09:11:35 | fowl | i wrote a macro so that "import_repo github.com/user/package" works for ex |
09:11:37 | coffeepot | aren't go interfaces kind of used as generics, compared to something more akin to code contracts? |
09:11:57 | BlaXpirit | fowl, O_o |
09:12:03 | BlaXpirit | where is it |
09:12:07 | fowl | in my gists |
09:12:12 | * | Kingsquee is now known as Kingsqueebrushie |
09:12:32 | Arrrrr | https://gist.github.com/fowlmouth/ac51baef7956af1ebdf8 |
09:13:12 | fowl | coffeepot, they are but go doesnt have true generics, because interface is used as a generic container, functions aren't instantiated, instead of objects are downclassed |
09:13:20 | Arrrrr | "except anything cool in go is hard coded in the compiler" you mean that is hardcoded in go or in nim |
09:13:47 | Arrrrr | i suppose the later |
09:14:48 | fowl | yea |
09:14:55 | coffeepot | the gist looks very interesting - is refoptional something built into nim now? |
09:15:22 | BlaXpirit | https://gist.github.com/BlaXpirit/7e4a445f5c64ef658d2d "Nimception" |
09:16:06 | coffeepot | BlaXpirit: lol! |
09:16:40 | fowl | coffeepot, no its defined there |
09:16:46 | Arrrrr | why the interface is defined as Drawable but used as IDrawable? is that a typo or actually how will be used? |
09:17:06 | fowl | Arrrrr, Drawable can't be instantiated, its a generic constraint |
09:18:14 | coffeepot | derp, just seen the def for RefOptional :D |
09:18:32 | coffeepot | I must need more coffee |
09:19:00 | coffeepot | that is really cool |
09:19:38 | Arrrrr | so where the 'I' comes, is generated by macros or the like? |
09:20:41 | coffeepot | IDrawable* = object of Interface, you could always define it as DrawableConcept and Drawable* = object of Interface I guess |
09:21:13 | fowl | Arrrrr, if a Drawable type is guaranteed to be able to call draw(obj) then IDrawable can be generated that captures that draw function for some type |
09:21:55 | fowl | coffeepot, i'll probably make it DrawableInstance |
09:22:18 | coffeepot | yeah that sounds better than what i said :) |
09:23:38 | Arrrrr | fowl you are a genius |
09:23:58 | fowl | nah |
09:24:28 | fowl | concepts are cool though because unlike an abstract base class, you can fulfill a behavior way after a type is defined |
09:24:30 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:25:28 | coffeepot | this is pretty cool, so seq[IDrawable] effectively means we can stuff unrelated objects into one seq as long as they implement the interface calls? |
09:26:36 | Arrrrr | and seems like, unlike java, you dont have to write explicitly "implements drawable". |
09:26:52 | coffeepot | doesn't that make seq into a heterogeneous storage type? |
09:27:02 | coffeepot | or allow it to be rather |
09:27:59 | coffeepot | i think they are all inherited in this case though |
09:29:53 | fowl | ah in the end Interface won't be a base type |
09:30:26 | fowl | theres no need for it to be |
09:30:53 | coffeepot | so this would allow seq to take unrelated classes? |
09:31:03 | fowl | yea |
09:31:16 | coffeepot | :) nice |
09:31:21 | fowl | coffeepot, theres an example on line 176 |
09:33:35 | coffeepot | what is this doing? new(result) do (x:Obj1): |
09:33:35 | coffeepot | echo "Freeing ", x[] |
09:33:52 | coffeepot | not familiar with do in nim |
09:34:01 | Arrrrr | i was about to ask that |
09:34:16 | fowl | do passes a function |
09:34:31 | * | Pokon quit (Ping timeout: 246 seconds) |
09:34:35 | fowl | here its set as the finalizer when that ref is freed |
09:35:30 | coffeepot | wow so I can pass a destructor by going new(mytype) do(x: mytype): <destructor>? |
09:36:14 | fowl | new(instance) but yes |
09:36:38 | coffeepot | that's very interesting, if slightly unintuitive syntax to me |
09:37:13 | fowl | generally you would call the func free and invoke it like new(result, free) |
09:38:07 | Arrrrr | It is necessary to do a (i assume) casting here? https://gist.github.com/fowlmouth/ac51baef7956af1ebdf8#file-gistfile1-nim-L178-L180 |
09:38:25 | coffeepot | huh has that been in nim for a while? The forum thread on constructors made me think destuctors were only under consideration |
09:39:24 | fowl | Arrrrr, thats not casting, its `as` operator, ln 132 |
09:40:06 | Arrrrr | ah, it transform a concept to an interface? |
09:40:51 | coffeepot | also, out of interest, why is GCfullcollect required using your interface technique? Does converting to an IDrawable bump the reference count or make temporary references that need cleaning up? |
09:41:17 | fowl | Arrrrr, yesp |
09:41:44 | BlaXpirit | templating language in 45 lines of code |
09:41:47 | BlaXpirit | that's pretty good |
09:42:25 | BlaXpirit | https://github.com/BlaXpirit/nimception |
09:42:52 | fowl | coffeepot, because i wanted to make sure it was gc safe, it does keep a reference, and since IDrawable can be optionally a ref/ptr/value you have to call destroy() to clean it up if you think it may keep a reference |
09:43:49 | fowl | destroy() also deallocs if it is a ptr |
09:44:54 | coffeepot | I really like the idea of interfaces as code contracts for objects, but I must say they were a nightmare in Delphi for the reference bumping. If I recall correctly checking if an object was an interface bumped and de-bumped the ref counter |
09:45:38 | fowl | checking if T is Drawable happens at compile time |
09:46:04 | coffeepot | mind you it was only really a problem when using interfaces with ref counted objects - caused them to be unexpectedly freed if you weren't careful. Don't think that'll be the same issue in nim |
09:46:10 | coffeepot | fowl: ah nice! :) |
09:47:01 | Arrrrr | Man, the power of interfaces in compile time. |
09:47:21 | fowl | `as` takes Drawable and typedesc[IDrawable] so if it doesnt error then draw(obj) must be fine |
09:48:22 | coffeepot | this is really sweet |
09:49:14 | Arrrrr | Yes, after this is finished someone should write a blog post of this. |
09:50:37 | coffeepot | I'm thinking BlaXpirit nimception might make a good blog post too, 45 line templating is pretty impressive |
09:51:29 | coffeepot | I really need to set up a github account and start contributing some stuff |
09:51:59 | BlaXpirit | what i want to do here is to make an actual replacement for nim templates which is better |
09:52:18 | BlaXpirit | but yeah, 45 line templating language was a nice byproduct |
09:53:00 | coffeepot | BlaXpirit: nice :) If these things are provided as easy to use libraries it would really help things like webdev, etc too |
09:53:37 | BlaXpirit | there was this already https://github.com/onionhammer/nim-templates |
09:53:44 | BlaXpirit | it's probably better, just much more code |
09:54:11 | coffeepot | there's so many cool libs in nim I have trouble keeping track of them all! |
09:55:45 | coffeepot | looked into gokr urho3d nim conversion today. With what you've done, fowl, on physics and quadtrees already I'm kind of a bit spoiled for choice for gaming related code! |
09:56:44 | gokr | Note that Urhonimo is mainly the work of Araq :) |
09:57:02 | gokr | I guess you checked the samples? |
09:57:30 | coffeepot | oh, well credit where it's due! It looks very interesting |
09:57:42 | coffeepot | yes the samples are what drew me to be honest |
09:57:52 | coffeepot | nothing like examples to learn how a library works |
09:58:06 | gokr | Note that we simply ported some of the Urho samples, so they are a bit "C++-ish" in style. |
09:58:54 | gokr | But yeah, it's a full blown game engine and we are already using it extensively in our next version of our client. |
09:59:46 | coffeepot | :D using in a commercial concept is a great sign that it's working well and performant |
10:00:07 | gokr | You can search youtube for Urho3D and you will find quite a lot. |
10:00:26 | coffeepot | I noticed there was some C in here https://github.com/3dicc/Urhonimo/blob/master/examples/character.nim not quite sure how the emit works here |
10:00:45 | gokr | Yeah, that's a bit ugly - Araq wants to fix that. |
10:01:19 | coffeepot | is this required? Seemed like the classes were defined below again in nim |
10:01:34 | gokr | I am uncertain about it, ask Araq. |
10:02:58 | * | HakanD quit (Quit: Be back later ...) |
10:03:21 | * | milosn joined #nim |
10:17:04 | * | milosn quit (Ping timeout: 255 seconds) |
10:28:33 | * | milosn joined #nim |
10:29:04 | * | Ven joined #nim |
10:39:17 | fowl | gokr, i'm sure that ATTRIBUTE() stuff could be importc'd |
10:40:35 | flaviu | BlaXpirit: Nice! That looks useful! |
10:41:18 | * | milosn quit (Read error: Connection reset by peer) |
10:41:59 | * | milosn joined #nim |
10:43:36 | * | Kingsqueebrushie quit (Quit: Konversation terminated!) |
10:44:26 | * | milosn quit (Read error: Connection reset by peer) |
10:44:55 | * | milosn joined #nim |
10:46:30 | * | bluenote joined #nim |
10:47:01 | bluenote | How can I post code on the forum? Is it markdown syntax, i.e., 4 space indentation? |
10:47:12 | dom96 | ```nim ... ``` |
10:47:25 | bluenote | thanks! |
10:47:47 | dom96 | or it might be ```nimrod still |
10:48:00 | bluenote | this also works for multiline blocks? |
10:48:33 | dom96 | yes |
10:52:20 | * | TEttinger quit (Ping timeout: 252 seconds) |
11:00:50 | * | akiradeveloper quit (Remote host closed the connection) |
11:04:38 | * | milosn quit (Ping timeout: 246 seconds) |
11:09:12 | * | EXetoC joined #nim |
11:09:25 | * | untitaker quit (Ping timeout: 264 seconds) |
11:14:32 | * | untitaker joined #nim |
11:17:04 | * | milosn joined #nim |
11:25:01 | * | HakanD joined #nim |
11:27:51 | * | BlaXpirit quit (Quit: Quit Konversation) |
11:40:37 | * | milosn quit (Read error: Connection reset by peer) |
11:41:42 | * | milosn joined #nim |
11:43:31 | * | akiradeveloper joined #nim |
11:48:02 | a5i | Dang it |
11:48:10 | a5i | I keep missing blax :( |
11:50:29 | Arrrrr | yay https://github.com/Araq/Nim/blob/13a5ecda320ada29f19432df805dfc4538f8e103/tests/parser/ttupleunpack.nim |
12:00:17 | * | milosn quit (Ping timeout: 250 seconds) |
12:12:50 | * | milosn joined #nim |
12:33:14 | * | xcombelle joined #nim |
12:37:40 | * | milosn quit (Ping timeout: 272 seconds) |
12:39:46 | * | akiradeveloper quit () |
12:50:55 | * | pafmaf joined #nim |
12:51:34 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:54:39 | * | milosn joined #nim |
12:56:07 | * | mpthrapp joined #nim |
13:16:58 | Arrrrr | why procCall wasn't called super, which is shorter (even though it is *more* than super)? |
13:21:50 | Araq | Arrrrr: because it has nothing to do with 'super'. |
13:22:35 | Araq | it works quite different. it means "Ignore dynamic binding here, trust overloading resolution" |
13:22:52 | Araq | "in other words, treat it like a proc call" |
13:23:16 | * | xet7 quit (Ping timeout: 240 seconds) |
13:24:37 | Arrrrr | Yes you are right. Well. |
13:28:56 | Arrrrr | Then, in order to use it as super, you actually have to know what is the super class of a given parameter. |
13:29:10 | * | xet7 joined #nim |
13:34:49 | * | ^aurora^_ joined #nim |
13:42:15 | novist | a fine day to complain \o/ Araq nim needs to either have 1-based arrays + inclusive intervals or 0-based arrays + non-inclusive intervals. Or kittens will die.. (oh not this again i know..) |
13:43:18 | Araq | or: you learn the very basics of math. |
13:44:08 | Araq | in math sums from 0 to N-1 are common and mathematicians can deal with it. |
13:45:32 | novist | now we have to deal with lots of n+1 / n-1 gotchas for no good reason |
13:46:22 | novist | let me quote you: "Nim's design focuses on efficiency, expressiveness, elegance (in the order of priority).". There is really nothing efficient, expressive and most importantly elegant about this |
13:47:13 | pigmej | what is the discussion about? |
13:47:25 | Arrrrr | something about cats |
13:47:27 | Araq | it surely is elegant. Intervals have inclusive bounds, exclusive bounds don't work. |
13:47:29 | novist | i know change like this sucks a lot.. but its similar to python3 thing. you know how smooth is transition. nim has the same situation. |
13:47:43 | Araq | exclusive bounds do not work! |
13:47:44 | * | milosn quit (Ping timeout: 245 seconds) |
13:47:48 | novist | well then 1-based arrays/strings would solve the problem |
13:48:14 | novist | arrays we can make so, strings - not. confusing to mix them then |
13:48:41 | pigmej | novist: what is the case ? examples ? |
13:49:00 | novist | although idk what does not work with non-inclusive, in say python there is no such gotchas to deal with |
13:49:28 | novist | pigmej: for i in 0..length-1 stuff |
13:49:38 | Araq | python is full of gotchas when you're used to inclusive upper bounds |
13:49:54 | Arrrrr | cant be done with 0..<length? |
13:49:55 | novist | like what? |
13:50:05 | HakanD | agreed that inclusive bounds is better, but 0-based arrays surely leads to n+1/n-1 problems, mostly because of how people are used to do stuff in other languages |
13:50:29 | Araq | range(1, 3) vs range(N) |
13:51:11 | pigmej | Araq: in python right side is always exclusive |
13:51:11 | Araq | Arrrrr: of course it can, novist just likes to argue |
13:51:14 | novist | cant see anything wrong with range, works just the same |
13:51:29 | novist | HakanD: whats the right way? |
13:51:30 | * | OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
13:51:44 | pigmej | Araq: in python it's (inclusive, exclusive) afair always |
13:51:57 | Araq | counting from 1 to 2 with range(1, 3) surely counts as a gotcha |
13:51:59 | pigmej | while range defaults to 0,N if only one argument given |
13:52:05 | * | nimm2 joined #nim |
13:52:08 | HakanD | there's no right or wrong way imho, just preference, or habits |
13:52:14 | pigmej | HakanD: +1 |
13:52:23 | novist | what gotcha if its non-inclusive? |
13:52:26 | pigmej | novist: imagine if you wish to create numbers 1 to 100 |
13:52:29 | Araq | HakanD: then you simply ignore every discussion here |
13:52:30 | novist | 1 included, 3 not included |
13:52:47 | HakanD | (: |
13:52:55 | novist | HakanD: should there not be one obvious right way to do things? |
13:52:56 | pigmej | it's just matter of preference / useage |
13:53:01 | pigmej | usage* |
13:53:12 | Araq | HakanD: how do you count up to high(someEnum) when there is no high+1's element |
13:53:12 | pigmej | novist: in python to create 1 to 100, you need range(1, 101) |
13:53:31 | Arrrrr | in before optional colons |
13:53:33 | pigmej | while in nim just 1..100 |
13:53:56 | novist | pigmej: see that works great when stuff is 1-based |
13:53:58 | * | milosn joined #nim |
13:54:12 | pigmej | novist: not |
13:54:21 | Araq | novist: you're right that starting from 1 works better, but *shrug* .. < is a thing in Nim. |
13:54:35 | pigmej | I'm also from python world, but ... I get used to that;D |
13:55:12 | Araq | Python has no enums and not even characters and is weakly typed so there is always high+1 :P |
13:57:37 | * | nimm2 left #nim (#nim) |
13:57:44 | * | milosn quit (Read error: Connection reset by peer) |
13:57:58 | Araq | and in C &a[N] has to be a valid address but it's not dereference-able. Very "elegant" indeed. |
13:58:57 | * | banister joined #nim |
13:58:57 | novist | in c loops usually have condition i < N, again 0-based + non-inclusive range |
13:58:59 | * | milosn joined #nim |
13:59:22 | Araq | in C you write '<', in Nim you write '.. <'. get over it. |
13:59:56 | * | BlaXpirit joined #nim |
14:00:29 | * | Jehan_ joined #nim |
14:01:22 | Araq | also, it does compose substr(s, i, <N) and is explicit. It simply is elegant, but you don't see it. :P |
14:02:07 | Arrrrr | i wouldnt not arge against a ... proc but it is true <N has more advantages |
14:02:22 | * | milosn quit (Read error: Connection reset by peer) |
14:03:21 | coffeepot | wait are we discussing whether to make things like arrays and seq's count from 1, so myseq[0] is invalid? Or am I just going crazy |
14:03:38 | Arrrrr | both |
14:04:02 | * | milosn joined #nim |
14:04:15 | Jehan_ | Hmm. Am I odd in that I generally just write N-1 instead of <N? |
14:04:47 | novist | i think its easy to miss < or -1 at times |
14:05:12 | coffeepot | python's slices have nice elegance to them in their indexing but i find it strange to even discuss indexing from 1, what advantage would that give? |
14:05:27 | novist | lack of </-1 stuff |
14:05:41 | novist | i dont like indexing from 1 either, believe me |
14:05:47 | novist | but i dont like </-1 more :) |
14:05:49 | coffeepot | but then you have to make sure it starts from 1 so isn't this just moving the problem over? |
14:06:16 | novist | then there is no problem |
14:06:46 | novist | hell even ability to define 1-based string would make me shut up. if it could at least be implicitly converted to/from standard string |
14:07:11 | novist | and possibly others thinking like me would have harder time arguing against </-1 |
14:07:12 | Arrrrr | what's the matter with strings? |
14:07:12 | coffeepot | but what happens when you access the zero index in a string then? |
14:07:30 | Jehan_ | coffeepot: Out of bounds error. |
14:07:44 | Jehan_ | Same as when you access something greater than the length of the string. |
14:07:53 | novist | oh also seqs are 0-based w/ no way to change? |
14:08:13 | Jehan_ | novist: Correct. |
14:08:23 | * | OnO joined #nim |
14:08:31 | Jehan_ | Well, you can write a wrapper type around seq that does 1-based indexing. |
14:08:31 | coffeepot | what's the advantage then of indexing from 0 when the same "problem" occurs at the other end of the array? |
14:08:49 | coffeepot | or use iterators? |
14:09:00 | coffeepot | no indexing necessary :D |
14:09:08 | novist | coffeepot: with 1-based string of length 10 you can loop over it with 1..10, what problem on what end? |
14:09:14 | * | OnO quit (Client Quit) |
14:09:23 | Jehan_ | coffeepot: There are plenty of algorithms that require random access, not sequential access. |
14:10:29 | Jehan_ | That said, 0-based vs. 1-based indexing is something where neither is always better. Both alternatives result in situations where they're better than the other (and obviously, also some where they're worse than the other). |
14:11:09 | EXetoC | 1-based indexing in a low level language? |
14:11:16 | * | pregressive joined #nim |
14:11:35 | Jehan_ | EXetoC: even there. |
14:11:38 | coffeepot | what languages actually use 1 based indexing? Aside from pascal for strings |
14:11:41 | * | saml joined #nim |
14:11:50 | Arrrrr | visual basic |
14:11:55 | gokr | Smalltalk |
14:12:00 | novist | ones aimed at scientific community too |
14:12:17 | coffeepot | fair enough, was just curious have never encountered it! |
14:12:27 | Jehan_ | Assume you have a Pascal-like string type. One byte encoding the length, the rest are the actual strings. |
14:13:02 | Jehan_ | This allows for a more efficient encoding of s[i], and you can encode "not found" results with 0. |
14:13:15 | BlaXpirit | 1-based indexing is bad. inclusive upper bounds are bad. 0-based indexing with inclusive upper bounds is the worst. it's not getting changed. gotta move on. |
14:13:22 | Jehan_ | s/encoding of/code generation for/ |
14:13:46 | novist | oh hey BlaXpirit o/ |
14:13:49 | Arrrrr | So, in nim you have to get used to use low/high procs if you dont want to get crazy |
14:14:04 | Jehan_ | BlaXpirit: I'm not in favor for it (or anything else) being changed, but to claim that 1-based indexing is generally bad is ignorant. |
14:14:12 | BlaXpirit | nope, it's bad |
14:14:15 | BlaXpirit | just bad |
14:14:53 | gokr | Thing is - if the language is "high level" enough I can't see it being a problem generally. In Smalltalk it has never been considered a problem - because you don't always fiddle around with indexing. |
14:15:09 | gokr | If you have proper iterators etc - indexing is much more rare. |
14:15:10 | novist | BlaXpirit: you are right, gotta move on. though im afraid moving on will be away from nim. and im not talking about myself |
14:15:14 | * | darkf quit (Quit: Leaving) |
14:15:33 | * | pregressive quit (Client Quit) |
14:16:04 | coffeepot | "for i = 1 .. s.len" or "for i = 0 .. <s.len" (if my syntax is right?) |
14:16:05 | Jehan_ | Eh, whatever. I think it's time to withdraw from the Nim community anyway, it's only bikeshedding these days. |
14:16:06 | * | Jehan_ quit (Quit: Leaving) |
14:16:07 | novist | gokr: iterators only are good for sequential access. nim is low level enough to often deal with random access |
14:16:20 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:16:21 | EXetoC | coffeepot: s.high |
14:16:29 | EXetoC | there's that too |
14:16:35 | BlaXpirit | > implying random access is low level |
14:16:41 | coffeepot | bikeshedding is a sign that the language is useful enough for people to quibble about details :) |
14:16:43 | BlaXpirit | ridiculous |
14:16:57 | BlaXpirit | coffeepot, there is something in these words |
14:17:40 | novist | BlaXpirit: my reasoning is random access being more complex thus lower level which is synonymous to "complex" |
14:17:54 | BlaXpirit | wut |
14:18:04 | gokr | novist: Well, I can only say I have never felt it's a problem in Smalltalk. Exact reasons are probably several, but to be as black and white as BlaXpirit is ... well, I am with Jehan here. |
14:18:43 | novist | smalltalk you said has 1-based indexing right? |
14:18:48 | gokr | yeah |
14:18:54 | novist | and ranges inclusive or not? |
14:19:23 | gokr | Smalltalk has Intervals and you don't use them that much. |
14:19:43 | BlaXpirit | "interval" is typically both ends non-inclusive :| |
14:19:46 | * | Ven joined #nim |
14:20:12 | novist | so how do you print "hi" 100 times in smalltalk? |
14:20:25 | * | Ven quit (Client Quit) |
14:21:11 | gokr | 100 timesRepeat: [Transcript show: 'Hi'] |
14:21:31 | BlaXpirit | mm i expected something like ruby |
14:21:44 | novist | thats cool. how about 1 to: 100 do: ... ? seems like that range would include both 1 and 100 |
14:21:52 | gokr | Sure, it does. |
14:21:54 | novist | 1-indexing + inclusive ranges = less headache |
14:22:01 | BlaXpirit | sure |
14:22:17 | novist | now we know why you had no problems in smalltalk :) |
14:22:34 | BlaXpirit | no other language has 0-based and inclusive, we know |
14:24:06 | * | askatasuna joined #nim |
14:24:16 | gokr | novist: Well, you also seldom do "range arithmetics" in Smalltalk. |
14:24:36 | coffeepot | "for idx, item in items:" no -1 yet you have the index? |
14:25:08 | EXetoC | coffeepot: what do you mean? |
14:25:28 | BlaXpirit | means use this code and u avoid dealing with indices |
14:25:51 | BlaXpirit | rather with off-by-1 errors |
14:25:51 | EXetoC | ok |
14:25:59 | coffeepot | well, is this about having to use -1 at the loop extent which looks "ugly", or about using idx+1 in the loop? |
14:26:08 | fowl | no, it means high(arr) is not the same as len(arr) |
14:26:39 | fowl | think about if arr can be indexed from -10 to 10, if you start at 0 you're wrong too |
14:26:54 | coffeepot | fowl: yes, quite! |
14:27:14 | BlaXpirit | code that starts at 0 needs to be abolished |
14:27:25 | BlaXpirit | to prepare for the new age of openArray-free code |
14:29:04 | EXetoC | don't bring up 1-indexing if you're going to argue for familiarity |
14:29:29 | Arrrrr | in 2050 "programing language features that went wrong" |
14:29:32 | * | bjz quit (Quit: Textual IRC Client: www.textualapp.com) |
14:29:39 | coffeepot | haha |
14:30:46 | dom96 | Does somebody want to change the syntax now to introduce 1-indexing? |
14:30:56 | BlaXpirit | nope |
14:31:01 | coffeepot | hang on though, if you have 1-indexing, doesn't the compiler have to do something more complex when just looping through an array type structure? As in, with 0-indexing it's taking the start mem addr and adding zero, whereas with 1-indexing you'd have to dec the mem addr by one to make it consistent wouldn't you? |
14:31:11 | BlaXpirit | pls |
14:31:28 | EXetoC | dom96: no |
14:31:36 | BlaXpirit | nobody said 1-indexing is good, don't start this |
14:31:57 | dom96 | BlaXpirit: oh good. |
14:34:00 | bluenote | doesn't Nim have a "indices" template anyways? |
14:34:08 | bluenote | for i in whatever.indices: |
14:34:18 | BlaXpirit | does it? |
14:34:24 | bluenote | just avoid writing ranges in general... |
14:34:26 | BlaXpirit | i really really doubt it |
14:34:44 | bluenote | I though I have seen it, or maybe I have written it myself? |
14:34:53 | * | milosn quit (Ping timeout: 256 seconds) |
14:34:54 | bluenote | but at least I never write ranges manually |
14:35:12 | coffeepot | i must say i tend to just do "for idx, item in list:" |
14:37:40 | * | TEttinger joined #nim |
14:41:20 | BlaXpirit | damn i'm stupid |
14:44:04 | coffeepot | BlaXpirit: why? |
14:44:30 | BlaXpirit | forgot that no regex at compile time, even though regex implementation was one of the main topics on my mind recently |
14:44:49 | coffeepot | :) |
14:44:57 | * | EXetoC quit (Quit: WeeChat 1.1.1) |
14:45:46 | Arrrrr | this kind of discussion a the lesser evil. If nim gets popular, most will simply complain and talk shit about things they dont like. So one should ask if, when someone complains here about a thing, is because he is new or he has a point. If 80% of future users complain about a detail, who is right then. |
14:47:00 | coffeepot | i think this kind of thing is just personal preference |
14:47:46 | fowl | Arrrrr, everybody thinks their slice of time is representative of some larger collective mindset |
14:48:10 | coffeepot | like the request to have colons after if predicates, which to the testament of nim, was able to be introduced as an optional switch |
14:48:15 | fowl | 'if you change these things then language X will be on board!' |
14:48:42 | novist | when i started to think i realized indeed most of </-1 can be avoided. but it requires changing of thinking |
14:49:14 | novist | so maybe instead next to tutorials there should be a page indicating "the old way" vs "the nim way" |
14:49:27 | novist | so new people know how to do it right |
14:49:41 | coffeepot | to me, zero indexing IS the old way - and kinda seems odd to have 1 indexed :D |
14:50:10 | BlaXpirit | wat |
14:50:13 | novist | well what i meant is loops, iterating, string slicing (although i still think ^2 is weird, both ^ and 2) |
14:51:10 | novist | i mean examples like bad: for i in 0.. <s.len and good: for i in 0..high(s) |
14:51:18 | coffeepot | novist what's your previous language experience out of interest? |
14:51:30 | BlaXpirit | novist, no, that's still bad |
14:51:34 | BlaXpirit | in many cases |
14:51:58 | novist | c++/c#/php/js/python in that order |
14:52:05 | novist | why is it bad BlaXpirit? |
14:52:16 | BlaXpirit | if something is not 0-indexed |
14:52:35 | renesac | [11:00:08] <Araq> in C you write '<', in Nim you write '.. <'. get over it. <-- they are not the same thing |
14:52:41 | novist | oh right, low(s) i see |
14:52:48 | renesac | it has been shown in the slicing issue |
14:52:53 | novist | i guess my mistake just illustrates the need |
14:53:05 | * | bcinman joined #nim |
14:53:19 | renesac | and in the for issue (I reopened my issue was re-opened) |
14:53:19 | BlaXpirit | many would not consider it a mistake |
14:53:23 | fowl | renesac, slicing behavior was anomalous its way different than iteration |
14:53:44 | BlaXpirit | novist, i'm just hoping for generic sequence operations instead of openarray |
14:53:44 | fowl | 0.. -1 will not iterate at all |
14:54:08 | renesac | https://github.com/Araq/Nim/issues/1008 <-- this is still a bug |
14:54:40 | renesac | inclusive upper bounds can be paid in performance or safety |
14:54:47 | renesac | araq choses to pay in safety |
14:55:08 | renesac | and an extra gotcha of course |
14:55:16 | novist | btw was there any effort to make ..-1 (without space) work? |
14:55:26 | BlaXpirit | "effort" |
14:55:29 | novist | or at leas talking about that |
14:55:30 | BlaXpirit | well no |
14:55:43 | BlaXpirit | but there sure was talking about ..< |
14:55:52 | coffeepot | I am confused, aren't C++, c#, python, js 0 indexed anyway? Not sure about php |
14:56:06 | novist | there could be ..- too, even if its bit hackish fix |
14:56:19 | novist | coffeepot: yes they are |
14:56:41 | renesac | coffeepot: and fortran, lua, julia, matlab, etc are 1 indexed, but it don't matter |
14:57:21 | renesac | the problem is that we don't know any language, besides nim, that is 0 indexed with inclusive upper-bounds |
14:57:32 | coffeepot | sure, but novist mentioned being used to 1-indexing so I assumed coming from one of the sci languages you listed renesac |
14:57:50 | coffeepot | ahhhh i see i think i understand now |
14:57:51 | * | xcombelle quit (Ping timeout: 264 seconds) |
14:57:53 | fowl | inclusive upper bounds? |
14:57:53 | renesac | and we suspect that there is a good reason for such language don't exist |
14:58:00 | novist | oh no you misunderstood. 1-indexing i so dont like ;) |
14:58:30 | renesac | [low, high] instead of [low, high) (not sure on the notation) |
14:58:32 | BlaXpirit | misunderstandings spread like crazy around here |
14:58:47 | coffeepot | *head scratching intensifies* |
14:58:55 | novist | *hair fell out* |
14:59:03 | BlaXpirit | coffeepot, nobody suggested 1-based indexing |
14:59:32 | * | ChrisMAN joined #nim |
14:59:55 | * | mwbrown joined #nim |
15:00:12 | * | OnO joined #nim |
15:01:06 | renesac | people only said that inclusive intervals like nim uses suit 1-based indexing, while 0-based indexing should be combined with half-inclusive intervals |
15:01:29 | BlaXpirit | + |
15:01:56 | renesac | to avoid performance/safety problems like issue #1008 |
15:02:06 | coffeepot | when you say inclusive intervals do you mean that a for loop would essentially add +1 to the upper bound? |
15:02:08 | renesac | for instance |
15:02:28 | renesac | coffeepot: no, it compares with <= |
15:02:33 | renesac | instead of < |
15:02:35 | BlaXpirit | like currently |
15:02:37 | BlaXpirit | adsadfghfgh |
15:02:49 | renesac | it is different from adding or subtracting 1 |
15:02:50 | BlaXpirit | inclusive upper bound <= exclusive upper bound < |
15:03:21 | renesac | away |
15:04:49 | coffeepot | blimey now i feel like a dunce - i never even noticed this :D |
15:05:31 | coffeepot | for i in 0..10: echo i -> 11 counts :D |
15:07:54 | TEttinger | so, are people just noticing the issues from both-ends-inclusive indexing now? was there much code written in Nimrod before it became Nim? |
15:08:24 | * | endragor quit (Ping timeout: 272 seconds) |
15:09:15 | * | repax quit (Read error: Connection reset by peer) |
15:09:16 | coffeepot | I probably never noticed it because i don't use indexes if I can help it |
15:09:43 | coffeepot | ofc i've never written anything large in nim :) |
15:10:01 | dom96 | I've been coding in Nim for 5 years now. It has never been an issue for me. |
15:10:34 | coffeepot | maybe as novist said all that's needed is a note in the docs |
15:11:01 | coffeepot | this is where someone tells me there is a note and I just glided over it ;) |
15:11:02 | novist | more like noobie tutorials |
15:11:17 | novist | with explicit note how its not supposed to be done |
15:11:55 | coffeepot | dom96 how did you come across nim? |
15:12:01 | dom96 | coffeepot: wikipedia |
15:12:05 | federico3 | inclusiveness seems to be a big concern - maybe a dedicated page on the docs with a lot of examples could help |
15:12:10 | coffeepot | that's ironic :) |
15:12:12 | dom96 | coffeepot: indeed |
15:12:17 | novist | i bet there will be people that define array like array[0..MAX_SIZE, int] and then for i in 0.. <MAX_SIZE:... instead of for i in 0..arr.high() |
15:12:30 | dom96 | It was linked from the Python page and I was looking for Python-inspired languages. |
15:12:41 | federico3 | otherwise someone wll end up forking Nim into a non-inclusive one (named "Ni" of course) |
15:13:02 | dom96 | novist: and they will get an out of bounds error |
15:13:15 | coffeepot | i was looking for nim without realising it when i reluctantly learned python (wanted a compiled, clear high level lang) |
15:13:21 | novist | doesnt high() return last index? |
15:13:26 | * | xcombelle joined #nim |
15:13:48 | coffeepot | spent a good while learning how I could compile python code lol |
15:13:50 | dom96 | I always use .. <x.len anyway |
15:14:01 | BlaXpirit | lame |
15:14:05 | novist | why arr.high() is wrong? isnt it essentially same? |
15:14:13 | dom96 | coffeepot: I basically wanted a compiled Python too heh |
15:14:15 | BlaXpirit | arr.high is best |
15:14:27 | dom96 | I never said it was wrong |
15:14:27 | * | HakanD quit (Read error: Connection reset by peer) |
15:14:38 | novist | so why index oob error? |
15:14:53 | dom96 | novist: for your earlier example |
15:15:42 | novist | dom96: btw if you still want compiled python check out nuitka project if you havent already |
15:15:55 | dom96 | for arrays it is ideal, but you should use arr.low instead of '0' |
15:16:14 | dom96 | novist: I'm pretty happy with Nim |
15:16:29 | novist | right, well i wrote it with 0-based indexing in mind. people that choose otherwise would know what to write isntead of 0 ;) |
15:16:55 | dom96 | true |
15:17:34 | * | OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
15:20:25 | coffeepot | dom96, while you're here: have you considered writing a more in depth tutorial for jester? |
15:21:05 | dom96 | coffeepot: yeah. First I need to implement some things and release 0.1 finally. |
15:21:20 | coffeepot | what's on your feature list for it? |
15:21:24 | * | mwbrown quit (Read error: Connection reset by peer) |
15:21:38 | dom96 | caching support |
15:21:44 | dom96 | is all that's left I think |
15:22:18 | coffeepot | i'm not a webdev, but i'd like to learn to use jester as from what i learnt of django, jester seems nicer |
15:22:28 | dom96 | that's nice to hear :) |
15:23:01 | dom96 | i'll see what I can do but nowadays I have very little time :\ |
15:24:16 | coffeepot | know that feel - i think if i won the lottery i'd be happy to just finally get the time to finish my home projects! |
15:24:36 | emilsp | coffeepot, if you dislike django, there's flask, which is as simple as it gets |
15:25:02 | coffeepot | that was next on my learn list but then i found nim and gradually python seemed less and less cool |
15:25:23 | emilsp | don't learn a language/framework/library/toolkit/whatever just because it's cool |
15:25:58 | coffeepot | i didn't learn it because it was "cool" in a kid way, I learnt it because it seemed "cool" in an expressive, productive, less boilerplate way :) |
15:26:14 | novist | bottle is even more lightweight than flask o/ |
15:26:21 | coffeepot | I didn't get on with dynamic typing tho |
15:26:43 | emilsp | dynamic typing just means you'll have to 'define' the types when writin documentation |
15:27:22 | coffeepot | part of why i mention a jester tutorial is the real prospect of nim doing very well in the same areas as python. It's as expressive, and has a capable and clean web framework already |
15:28:10 | coffeepot | emilsp: that was part of the thing, documenting types but not guaranteeing type safety. It was my first experience of dynamic typing though. I'm sure you adapt after time |
15:28:42 | * | saml quit (Ping timeout: 244 seconds) |
15:28:43 | novist | one thing that python cant brag about is performance. i bet jester's page vies per second is sky-high compared to python solution |
15:29:06 | emilsp | if you're worried about typesaftey in anything written in python, you use a linter and it will weed out 50% of the bugs related to that |
15:29:48 | emilsp | novist, python is not meant for perf, it's more of a 'first langugae' language |
15:30:16 | * | xcombelle quit (Ping timeout: 250 seconds) |
15:30:49 | * | pafmaf quit (Quit: This computer has gone to sleep) |
15:31:14 | * | pafmaf joined #nim |
15:31:42 | coffeepot | emilsp: yes, that's the thing, there's a lot of things you can do to get around the fact there's no strong typing. I say this partly in jest, partly serious. I'm sure you get used to dynamic typing but it feels "wrong" to me as all my language experience has been with typed languages. |
15:31:58 | coffeepot | personal preference i suppose |
15:32:26 | novist | emilsp: i would argue its more "do it fast" language |
15:32:33 | novist | fast as in writing code |
15:32:46 | coffeepot | also: nim could be a "first language", there's been times I've literally copied someone's pseudocode over to try out something and it's just compiled! |
15:33:01 | novist | ah the joys of VM freezing in the middle of debugging session.. |
15:33:33 | * | saml joined #nim |
15:34:03 | novist | ah its not a freeze.. its windows dicking up. lovely. |
15:38:53 | * | xcombelle joined #nim |
15:40:33 | * | HakanD joined #nim |
15:46:27 | novist | should auto-deref work here? https://paste2box.com/qNftXQ#/tPC-KT1ra3q97aJBV1MdsncD7hB3Dse6hhERV3fOcOI/Yfu2fRCz.txt |
15:46:33 | * | milosn joined #nim |
15:57:09 | Arrrrr | Is not working? |
15:57:28 | * | brson joined #nim |
15:57:35 | novist | nope |
15:57:50 | novist | adding [] to a works |
15:58:02 | novist | just making sure if i should make a bug report |
15:58:18 | Arrrrr | from inside test proc? |
15:59:17 | novist | yes |
16:16:56 | * | BitPuffin joined #nim |
16:17:55 | * | pregressive joined #nim |
16:22:11 | coffeepot | have a good evening all! :) |
16:23:22 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
16:26:22 | * | Tennis quit (Quit: Leaving) |
16:28:31 | * | HakanD quit (Quit: Lingo: www.lingoirc.com) |
16:29:39 | BlaXpirit | brain melting |
16:30:17 | BlaXpirit | string templates were easy, but changing stringification to inserting actual nodes/values... |
16:30:23 | * | HakanD joined #nim |
16:31:12 | BlaXpirit | and by that i mean, for example, dropping 'quotes' from https://gist.github.com/7e4a445f5c64ef658d2d#file-1-nim-L14-L16 |
16:39:09 | * | pafmaf quit (Quit: This computer has gone to sleep) |
16:44:03 | * | OnO joined #nim |
16:51:05 | * | EXetoC joined #nim |
16:54:08 | * | jfchevrette joined #nim |
17:06:25 | * | repax joined #nim |
17:06:56 | * | BlaXpirit_ joined #nim |
17:09:35 | * | BlaXpirit quit (Ping timeout: 256 seconds) |
17:10:48 | * | BlaXpirit_ quit (Client Quit) |
17:11:07 | * | BlaXpirit joined #nim |
17:11:53 | * | shodan45 joined #nim |
17:15:17 | * | pafmaf joined #nim |
17:18:53 | * | HakanD_ joined #nim |
17:18:53 | * | HakanD quit (Read error: Connection reset by peer) |
17:21:07 | * | HakanD_ quit (Client Quit) |
17:21:34 | * | HakanD_ joined #nim |
17:26:13 | * | HakanD_ quit (Ping timeout: 264 seconds) |
17:30:33 | * | HakanD joined #nim |
17:40:24 | * | xcombelle quit (Ping timeout: 272 seconds) |
17:44:13 | * | gsingh931 joined #nim |
17:45:56 | * | gsingh93_ joined #nim |
17:50:03 | * | Varriount quit (Read error: Connection reset by peer) |
17:50:35 | * | Varriount joined #nim |
17:54:11 | * | HakanD quit (Quit: Be back later ...) |
17:54:38 | * | HakanD joined #nim |
17:59:13 | * | HakanD quit (Ping timeout: 255 seconds) |
18:02:23 | * | Varriount quit (Read error: Connection reset by peer) |
18:02:58 | * | Varriount joined #nim |
18:04:21 | Arrrrr | http://i.imgur.com/zQGfUnP.jpg |
18:04:38 | * | jfchevrette quit (Quit: Textual IRC Client: www.textualapp.com) |
18:09:46 | dom96 | Arrrrr: playing GTA 5 for PC? |
18:10:29 | Arrrrr | No, my notebook is so old. I saw it on reddit. |
18:18:38 | squirtle | :C i want a bacon sandwhich |
18:19:01 | * | gsingh931 quit (Ping timeout: 264 seconds) |
18:19:36 | reactormonk | I got a bacon phone :-) |
18:22:30 | * | flaviu quit (Remote host closed the connection) |
18:29:08 | * | anthony joined #nim |
18:29:32 | * | anthony is now known as Guest18935 |
18:30:35 | * | BlaXpirit_ joined #nim |
18:30:44 | * | Guest18935 quit (Max SendQ exceeded) |
18:33:39 | * | squirtle is now known as dtscode |
18:33:50 | * | HakanD joined #nim |
18:36:22 | renesac | sudo make me a sandwich |
18:39:30 | federico3 | renesac: This incident will be reported. |
18:40:24 | renesac | who does sudo report these "incidents" to? |
18:41:34 | dom96 | me |
18:41:46 | TEttinger | the ultimate authority, /dev/null |
18:41:55 | renesac | dom96: are you santa? |
18:41:59 | renesac | :O |
18:42:08 | dom96 | perhaps |
18:44:43 | Arrrrr | Could var/let keyword be optional? You don't have to use them in crystal *runs away* |
18:44:59 | renesac | bwt: if anyone knows of a xkcd font with international accented characters let me know [/off-topic] |
18:45:09 | * | pafmaf quit (Quit: This computer has gone to sleep) |
18:45:22 | * | xcombelle joined #nim |
18:46:08 | TEttinger | xkcd font? |
18:46:21 | renesac | a font like Randal's handwriting |
18:46:28 | TEttinger | oh ok |
18:46:48 | TEttinger | I make fonts but nothing handwriting-like |
18:47:15 | renesac | well, I guess if I really wanted I could modify one of the available ones |
18:47:20 | renesac | to add accents |
18:47:29 | TEttinger | http://fontstruct.com/fontstructions/show/820062 is one of mine |
18:47:38 | TEttinger | it has accented chars, yes :) |
18:48:01 | TEttinger | http://fontstruct.com/fontstructions/show/mandrill_2 should have more |
18:51:51 | * | vendethiel- joined #nim |
18:52:17 | EXetoC | Arrrrr: it reduces the readability |
18:53:22 | * | irrequietus joined #nim |
18:53:33 | Arrrrr | Not if you allow it only if followed by an assignment. |
18:53:56 | * | vendethiel quit (Ping timeout: 250 seconds) |
18:57:38 | repax | Arrrrr: What does optional var/let mean? That you can introduce variables and constants implicitly? |
18:58:05 | renesac | Arrrrr: I though you were joking |
18:58:17 | Arrrrr | Well, of course i suppose you cant have both. |
18:59:20 | Arrrrr | I dont think anyone will take i seriuosly, but i like it. |
19:00:08 | repax | It's a very bad idea. So many bugs come from misspelt variable names in languages supporting this. |
19:01:10 | pigmej | hmm, let's make whole syntax optional;D |
19:01:56 | repax | pigmej: You can option out of using Nim |
19:02:49 | pigmej | repax: that was irony :) |
19:03:04 | repax | pigmej: Yeah, I got it. |
19:03:24 | pigmej | then I don't got it ;/ |
19:03:25 | pigmej | ;d |
19:03:50 | repax | You're all a bunch of nimrooders ;) |
19:06:10 | * | TEttinger quit (Ping timeout: 256 seconds) |
19:08:43 | repax | Does anyone know if there are any plans for major todos/changes/additions to the language? I'm feeling it is stabilising.. |
19:13:09 | repax | What would you think of a standardised tag for procs that do memory allocation? That way you could track them - both manual allocations and procs using GC allocations. Suppose you wish to not have any allocations in certain parts of a program.. |
19:14:18 | renesac | repax: a pragma to be verified by the nim's effect system? |
19:14:36 | renesac | like the "noSideEffects'? |
19:14:36 | repax | renesac: Yeah |
19:14:43 | * | gsingh931 joined #nim |
19:15:05 | renesac | sounds interesting, not high priority though |
19:15:06 | repax | renesac: Well, perhaps you're ok with other kind of side effects |
19:15:40 | repax | You just don't want allocations. |
19:15:55 | renesac | well, you can disable the GC for a part of your code, but that takes care just of the deallocation part |
19:16:13 | * | bluenote quit (Ping timeout: 246 seconds) |
19:16:46 | repax | I came to think of this after reading the NASA's 10 rules for safety in their code.. An article that surfaced on Reddit the other day.. |
19:18:03 | repax | Ah, here it is: "Rules for Developing Safety Critical Code" : http://pixelscommander.com/wp-content/uploads/2014/12/P10.pdf |
19:18:59 | repax | Rule 3: "Do not use dynamic memory allocation after initialization." |
19:20:55 | renesac | you can fill a feature request on github |
19:21:22 | renesac | or better yet, submit a pull request implementing it |
19:21:32 | repax | I could. Just wanted to see if there were opinions. |
19:23:29 | repax | Tags is a nice feature. I think they could be used to infer lots of stuff statically from code. |
19:25:38 | * | BlaXpirit_ quit (Quit: Quit Konversation) |
19:31:34 | * | xcombelle quit (Remote host closed the connection) |
19:34:30 | * | dtscode is now known as charmander |
19:35:02 | * | Matthias247 joined #nim |
19:35:29 | * | charmander is now known as bulbasaur |
19:40:23 | * | filcuc joined #nim |
19:44:55 | * | filcuc quit (Remote host closed the connection) |
19:46:58 | Arrrrr | I have to go, see you nimroders! |
19:47:02 | * | Arrrrr quit (Quit: Page closed) |
19:47:45 | * | filcuc joined #nim |
19:53:31 | repax | bbl |
20:06:29 | * | gsingh93_ quit (Ping timeout: 250 seconds) |
20:09:05 | * | gokr_ joined #nim |
20:11:02 | * | pafmaf joined #nim |
20:13:56 | * | ^aurora^_ quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
20:15:02 | * | vendethiel- quit (Ping timeout: 265 seconds) |
20:20:35 | * | vendethiel joined #nim |
20:21:03 | * | HakanD quit (Quit: Be back later ...) |
20:21:37 | * | HakanD joined #nim |
20:23:18 | * | gsingh931 quit (Quit: WeeChat 1.1.1) |
20:23:46 | * | gsingh93 joined #nim |
20:26:20 | * | HakanD quit (Ping timeout: 272 seconds) |
20:40:24 | * | wb joined #nim |
20:44:11 | * | Sembei quit (Ping timeout: 250 seconds) |
20:48:32 | * | ^aurora^ joined #nim |
20:48:46 | * | Demos joined #nim |
20:50:26 | * | pafmaf quit (Quit: Verlassend) |
20:55:01 | * | gsingh93 quit (Ping timeout: 250 seconds) |
20:57:46 | * | Sembei joined #nim |
20:59:21 | * | mpthrapp quit (Remote host closed the connection) |
21:09:33 | * | BitPuffin quit (Ping timeout: 245 seconds) |
21:14:25 | * | bjz joined #nim |
21:18:45 | * | filcuc quit (Quit: Konversation terminated!) |
21:27:45 | OnO | just wanted to say I am sorry for being such a b**tch regarding this colon stuff, all I want to understand exactly grammar and hope other do too |
21:29:10 | OnO | yeah... now I will crawl back under the stone ;P |
21:30:17 | ggVGc | OnO: why do you censor letters within a word? If you think the word is offensive then don't use it, and if not then just write it |
21:30:26 | ggVGc | we all read the word the same anyway |
21:30:32 | ggVGc | so you are still putting it in our minds |
21:30:48 | Varriount | OnO: Oh? I haven't actually been reading that particular forum thread. |
21:30:56 | Varriount | Nor the github issue |
21:31:12 | ggVGc | as a note I don't find it offensive and don't care what people write, but I think it's silly to censor and at the same time give the whole meaning anyway |
21:31:15 | Varriount | ggVGc: Let him type how he wants (within reason) |
21:31:15 | ggVGc | makes no sense |
21:31:48 | dom96 | OnO: Don't worry. I hope that even though your proposal may not be accepted you stick with Nim, and before I forget: Witam :) |
21:32:18 | OnO | ggVGc: well, as a precaution for being kicked, also knowing the IRC logs gets online :> |
21:32:33 | OnO | dom96: Dobry wieczór |
21:33:34 | OnO | I think I will, I enjoy playing with and learning new languages (including computer programming ones ;P) |
21:33:51 | OnO | and so far I think Nim has such a great potential |
21:34:19 | reactormonk | OnO, unless you can make the compiler do the syntax highlight, I'm actually against changing the syntax because it's gonna be a bitch to support in all possible editors and nim-mode hl already has a bugs |
21:34:21 | OnO | I was updating my benchmarks with latencies and distribution: https://github.com/nanoant/WebFrameworkBenchmark |
21:34:54 | OnO | and Nim is really killer there, I just wonder what would be the result if AsyncHTTPServer will be multi-threaded |
21:35:58 | OnO | reactormonk: this is valid argument I accept :) |
21:36:21 | OnO | reactormonk: I really missed such arguments, that's why I was bitching do much |
21:36:31 | OnO | s/do/so |
21:41:25 | * | Varriount is jamming along to videogame music |
21:41:39 | renesac | OnO: in the python faq they make the syntax highligh argument too |
21:41:42 | renesac | :P |
21:42:00 | * | gsingh93 joined #nim |
21:42:40 | OnO | renesac: yeah, by disabling highlight totally in the "less readable" part, pretty funny |
21:43:27 | renesac | OnO: actually, they should have disabled syntax highlighting in the python code, but the 'less readable' wasn't python code so they couldn't highlight |
21:43:33 | renesac | but I was refering to the paragraph after that |
21:43:41 | renesac | where they discuss syntax highlighint |
21:43:48 | renesac | *highlighting |
21:44:41 | OnO | btw. do you think I should fill a bug about compiler diagnostics, especially described http://forum.nim-lang.org/t/671/7 |
21:44:58 | OnO | test.nim(2, 6) Error: ':' expected <-- the location compiler gives is completely wrong |
21:45:15 | Araq | OnO: just fix it instead please ;-) |
21:45:59 | Araq | afaict the location is 1 line off, which is a very common problem for most compilers |
21:46:15 | Araq | and nothing I lose sleep over |
21:46:34 | renesac | yeah, to give a more precise error message it would have to consider which keywords were used |
21:47:13 | * | Matthias247 quit (Read error: Connection reset by peer) |
21:47:24 | renesac | the compiler gives worse error messages in other places... this isn't that bad... |
21:47:49 | Araq | ???(???,???) invalid AST :P |
21:47:55 | renesac | though, it seems like it could be improved |
21:48:25 | Araq | error messages always can be improved but you should look at how the devel compiler now reports gc-safety issues |
21:49:09 | Araq | IMHO the error reporting got from "unworkable" to "impressive" for that feature |
21:49:27 | Varriount | ???(???,???) Unknown Error: Executing rm -rf / |
21:50:02 | renesac | I haven't saw that, but cheers! |
21:50:37 | gokr | When I studied like... 20 years ago I recall some modified C compiler that gave hilarious error messages. Lecturing you and basically saying that you are an idiot etc. It was quite fun. |
21:51:48 | Araq | lol |
21:51:53 | ggVGc | gokr: meet intercal, http://en.wikipedia.org/wiki/INTERCAL |
21:53:27 | Araq | OnO: btw the reason why *I* prefer the colons are purely aesthetic. so it's no surprise I cannot convince you ;-) |
21:53:46 | Demos | it is quite common though |
21:53:53 | Demos | like most people like them |
21:54:02 | OnO | editor and syntax highlight argument convinces me :> |
21:54:08 | Demos | I like them most of the time, except when I am writing "dense" code |
21:54:14 | OnO | I am textmate bundle maintainer, so I know that pain |
21:56:18 | reactormonk | OnO, if you want you can document your example and put it somewhere |
21:57:00 | OnO | nah... I'll work on PR and fix that |
21:57:02 | * | HakanD joined #nim |
21:59:46 | OnO | https://github.com/Araq/Nim/pull/2565 |
22:00:23 | OnO | now I'll try to have a look why "expected" token locations are borked |
22:02:23 | * | Trustable quit (Remote host closed the connection) |
22:04:43 | * | flaviu joined #nim |
22:05:14 | * | vendethiel quit (Ping timeout: 256 seconds) |
22:06:59 | * | nande joined #nim |
22:07:04 | * | pregressive quit () |
22:07:10 | * | vendethiel joined #nim |
22:11:16 | fowl | turns out if IDrawable forwards all the functions used by Drawable then IDrawable can be Drawable and it can be captured in another IDrawable :p not sure if this is useful yet |
22:15:43 | * | tinAndi joined #nim |
22:16:39 | * | gmpreussner|work quit (Read error: Connection reset by peer) |
22:19:07 | Araq | fowl: your interface stuff is cool, but I wonder if it shouldn't simply require a 'ref object' you can capture properly |
22:20:05 | Araq | it's the nature of this thing to have ref semantics and require boxing, why pretend to support anything elseß |
22:20:07 | Araq | ? |
22:21:07 | fowl | you mean require the captured obj to be a ref or require the interface to be a ref |
22:21:50 | Araq | the interface to be a ref |
22:22:30 | Araq | and to require the caputred obj to be ref, but not so sure about that |
22:23:09 | fowl | i dont see any reason to force people into that |
22:23:18 | * | tinAndi quit (Quit: ChatZilla 0.9.91.1 [Firefox 37.0.1/20150402191859]) |
22:23:41 | Araq | hrm this spider is quick |
22:24:01 | fowl | i think its cool that obj as IDrawable or obj as ref IDrawable works :p |
22:24:31 | Araq | (but not quick enough) |
22:25:15 | Araq | yeah well I dunno. actually I don't even care. |
22:26:12 | Araq | single inheritance plus composition plus closures are more than I ever need |
22:29:20 | fowl | Araq, all of go's cool features are being recreated in nim with macros lol |
22:30:23 | gokr | go fowl go... eh, no, I mean nim fowl nim! |
22:31:15 | BlaXpirit | :p |
22:31:23 | gokr | Btw, am I guessing correctly that concepts can be used to actually "get rid" of the somewhat special beast openArray? |
22:31:39 | BlaXpirit | that's what i've been preaching about |
22:31:47 | gokr | Ok, missed that |
22:31:54 | Araq | yeah but it's different. |
22:32:10 | Araq | openArray is not generic, it's polymorphic |
22:32:20 | gokr | ah |
22:32:28 | BlaXpirit | more like duomorphic |
22:32:32 | gokr | Hehe |
22:32:47 | BlaXpirit | it is harmful. |
22:32:55 | BlaXpirit | low high are all u need |
22:34:02 | Araq | BlaXpirit: everything is harmful according to you, that word lost its meaning. |
22:34:13 | fowl | BlaXpirit, https://gist.github.com/fowlmouth/8cc9ee26bcf509b5fea5 |
22:35:54 | BlaXpirit | lol |
22:44:08 | * | gsingh93 quit (Ping timeout: 245 seconds) |
22:44:13 | OnO | okie, I did another PR fixing location of the erroneous parser token: https://github.com/Araq/Nim/pull/2566 |
22:44:24 | OnO | now it is high time to get some sleep |
22:49:37 | * | irrequietus quit () |
22:49:40 | OnO | good night |
22:49:42 | * | OnO quit (Quit: Textual IRC Client: www.textualapp.com) |
23:05:31 | * | BlaXpirit quit (Quit: Quit Konversation) |
23:28:37 | * | ChrisMAN quit (Ping timeout: 264 seconds) |