00:00:06 | BlaXpirit | renesac, sure .get gives u exceptions |
00:00:22 | BlaXpirit | and yes, these are are also my favorite Maybe names |
00:00:46 | renesac | well, but then the code ends up littered with .gets |
00:00:53 | renesac | if people starts using maybes everywhere |
00:01:06 | renesac | I don't know |
00:01:18 | flaviu | Doing headers with RST is a PITA. |
00:01:32 | BlaXpirit | 3 first words were unnecessary |
00:01:41 | renesac | lol |
00:01:43 | flaviu | I can't write the header until I've rendered it, since the underline needs to be the same length as the header. |
00:01:53 | BlaXpirit | o.o |
00:02:07 | BlaXpirit | are you doing nre? |
00:02:16 | renesac | when the nim forum will accept markdown instead of rst? |
00:02:20 | renesac | :P |
00:02:27 | flaviu | BlaXpirit: I'm calling it "docweave". |
00:02:32 | * | saml_ joined #nim |
00:02:50 | BlaXpirit | so you're making some trickery |
00:03:07 | BlaXpirit | flaviu, but you'd still need to do rst without trickery if it is to be in stdlib |
00:03:17 | BlaXpirit | there will be no readme |
00:03:36 | flaviu | BlaXpirit: I don't really care about this module getting into the stdlib. |
00:03:43 | flaviu | It's just a utility. |
00:03:49 | BlaXpirit | oh come on |
00:04:23 | flaviu | Actually, I'd be actively against this being put in the stdlib. |
00:04:31 | BlaXpirit | -__- |
00:05:07 | BlaXpirit | no reason |
00:05:15 | renesac | what module? |
00:05:53 | flaviu | BlaXpirit: It doesn't belong. |
00:05:58 | flaviu | https://github.com/flaviut/docweave |
00:06:40 | * | bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
00:06:50 | BlaXpirit | flaviu, it will be the dawn of stdlib |
00:07:02 | flaviu | This module does not belong. |
00:07:07 | * | bcinman joined #nim |
00:07:08 | BlaXpirit | well i'm talking about nre |
00:07:20 | flaviu | Oh, sorry for the confusion then. |
00:07:26 | BlaXpirit | and i assumed you wanted to make "docweave" to do tricks with "nre"s docs |
00:07:46 | flaviu | Nah, I just want it to extract nre's docstrings into a readme. |
00:08:16 | BlaXpirit | ok |
00:08:34 | renesac | no comments or documentation, I'm not really sure what it does from a first glance |
00:08:44 | BlaXpirit | > extract nre's docstrings into a readme |
00:08:45 | renesac | an alternative for html doc gen? |
00:09:02 | BlaXpirit | i assume it's like rst doc gen |
00:09:32 | BlaXpirit | generate a rst file |
00:10:06 | renesac | hum |
00:10:43 | flaviu | BlaXpirit: Yeah. |
00:11:26 | renesac | BlaXpirit: any reason why your proposed Maybe don't have the `or` operator? |
00:11:50 | renesac | and I'm not really sure if I'm a fan of the "?" and "?=" operators |
00:12:03 | BlaXpirit | renesac, the reason is i don't get it |
00:12:28 | BlaXpirit | if you are knowledgable of these things, do give feedback |
00:12:38 | BlaXpirit | for now i'm just gonna make a pull request with the base version |
00:12:41 | renesac | well, I programmed some in Lua |
00:13:14 | renesac | and there the "or" on non booleans would test for nil and return the first non nil object |
00:13:17 | renesac | or nil |
00:13:40 | BlaXpirit | this is not Nim's style |
00:13:45 | renesac | that seems exactly what that `or` operator is for |
00:13:56 | renesac | what is nim's style? |
00:14:11 | BlaXpirit | `or` operator returns a boolean or the result of a bitwise operation |
00:14:34 | renesac | the `or` operator only returns a boolean if comparing two booleans |
00:14:49 | renesac | it is overloaded for integers, to do something completely different |
00:14:58 | BlaXpirit | like i said |
00:15:08 | renesac | it can also be overloaded to Maybe[T] |
00:15:23 | dom96 | it's also overloaded for Future[T] |
00:15:26 | renesac | to do something closer to it's logical meaning |
00:16:15 | renesac | the only problem with all those overloads is if you make a mistake somewhere, it can pass quietly because the other type is also acceptable there |
00:16:35 | renesac | I'm not sure how much of a problem it is in real life though |
00:16:50 | BlaXpirit | m or x is not worth it because nim has if m: m else: x |
00:16:51 | * | bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
00:16:54 | BlaXpirit | or something like that |
00:17:08 | flaviu | Instead of or, it's possible to do myOption.get(foo) |
00:17:16 | flaviu | If myOption is None, that returns foo. |
00:17:25 | BlaXpirit | it's slightly different but yes, i have that in |
00:18:34 | renesac | flaviu: it isn't as clear what "foo" means in this expression by just looking at it w/o knowing the name of the parameter |
00:18:56 | BlaXpirit | it's anything |
00:19:03 | renesac | I would guess you were getting a "foo" field in myOption |
00:19:08 | BlaXpirit | m.get(foo) is pretty much m or foo |
00:19:18 | renesac | yeah |
00:19:26 | BlaXpirit | it's a kind of a pythonism |
00:19:38 | flaviu | Yes, inspired by python. |
00:19:52 | renesac | it is? |
00:20:01 | dom96 | OT: I love macros.quote. |
00:20:23 | BlaXpirit | https://docs.python.org/dev/library/stdtypes.html#dict.get |
00:21:02 | renesac | hum |
00:21:29 | renesac | I still don't like the look of it |
00:22:02 | renesac | of course, it would be annoying if dic["abc"] returned an option I guess |
00:22:03 | BlaXpirit | it's just so usual to me from python that i didn't consider that it's weird |
00:22:32 | BlaXpirit | other names welcome |
00:22:38 | renesac | `or` |
00:22:46 | BlaXpirit | nope :| |
00:23:16 | BlaXpirit | although...... actually it kinda makes sense |
00:23:46 | BlaXpirit | if m1 or m2: will still work |
00:24:16 | * | Matthias247 quit (Read error: Connection reset by peer) |
00:24:29 | * | davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
00:24:55 | BlaXpirit | should just steal these https://github.com/fowlmouth/nimlibs/blob/master/fowltek/maybe_t.nim#L31-L35 |
00:25:04 | * | jholland quit (Quit: Connection closed for inactivity) |
00:25:24 | BlaXpirit | and by L31-L35 I mean L24-L35 |
00:25:25 | renesac | I don't understand that one |
00:25:43 | renesac | (it's my turn now) |
00:25:54 | BlaXpirit | just read the code, it's easy |
00:26:33 | renesac | oh |
00:26:52 | renesac | instead of doing my.x in a normal object |
00:27:03 | renesac | do my.?x if that object is wrapped by maybe? |
00:27:47 | BlaXpirit | .? is just . for 'maybe', yes |
00:28:00 | BlaXpirit | but it returns a maybe and not just the value |
00:28:48 | renesac | oh, it returns a maybe? |
00:29:38 | renesac | I guess it makes sense |
00:34:45 | renesac | and yeah, "none" will certaninly generate a lot of name clashes |
00:35:03 | renesac | when importing this module |
00:35:20 | BlaXpirit | nothing |
00:36:01 | renesac | much longer, but probably not very used exacly for this reason |
00:36:07 | renesac | so a possibility |
00:37:15 | * | user7181 quit (Quit: leaving) |
00:37:27 | renesac | though there is the overload resolution |
00:37:41 | renesac | I'm not sure if a variable with the same name would be usable |
00:37:55 | renesac | or if it would shadow it |
00:39:54 | BlaXpirit | shadow |
00:42:28 | * | vendethiel quit (Ping timeout: 272 seconds) |
00:44:40 | flaviu | Lol, that code has some really catastrophic backtracking. |
00:44:57 | BlaXpirit | which |
00:45:29 | * | irrequietus quit () |
00:45:45 | flaviu | Mydocweave |
00:45:55 | flaviu | s/Mydocweave/docweave/ |
00:50:52 | Varriount | Yay, finally removed Bittorrent in favor of something less... horrid. |
00:52:58 | flaviu | Varriount: I'd be happy to discuss the merits of various torrent clients in #nim-offtopic. |
01:02:29 | * | wb quit (Ping timeout: 276 seconds) |
01:09:27 | * | chop1n joined #nim |
01:10:20 | * | chop1n left #nim ("Textual IRC Client: www.textualapp.com") |
01:27:22 | * | vendethiel joined #nim |
01:34:54 | * | HakanD___ joined #nim |
01:36:03 | * | ChrisMAN joined #nim |
01:39:12 | * | HakanD___ quit (Ping timeout: 250 seconds) |
01:43:20 | BlaXpirit | how to type `()` inside `` `` |
01:43:29 | BlaXpirit | in doc comment |
01:43:45 | BlaXpirit | ```()``` doesn't work, neither does `` `()` `` |
01:47:43 | * | BitPuffin quit (Ping timeout: 252 seconds) |
01:49:41 | * | flaviu quit (Read error: Connection reset by peer) |
01:49:41 | * | Mimbus quit (Read error: Connection reset by peer) |
01:50:31 | def- | BlaXpirit: I wondered about this as well. Haven't found a solution yet |
01:54:04 | * | flaviu joined #nim |
02:02:30 | BlaXpirit | https://github.com/Araq/Nim/pull/2515 "Add optionals module (Maybe[T])" |
02:06:27 | * | BlaXpirit quit (Quit: Quit Konversation) |
02:10:56 | * | ChrisMAN quit (Ping timeout: 264 seconds) |
02:12:26 | * | a5i joined #nim |
02:26:04 | * | pregressive joined #nim |
02:30:20 | * | pregressive quit (Ping timeout: 250 seconds) |
02:40:43 | * | pregressive joined #nim |
02:42:58 | * | gsingh93 joined #nim |
02:45:07 | * | jholland joined #nim |
02:45:34 | * | vendethiel quit (Ping timeout: 250 seconds) |
02:53:55 | * | darkf joined #nim |
02:55:43 | * | TEttinger joined #nim |
03:38:11 | * | ajpocus joined #nim |
03:38:27 | * | gsingh93 quit (Quit: WeeChat 1.1.1) |
03:39:22 | * | gsingh93 joined #nim |
03:41:43 | * | ajpocus quit (Quit: Leaving) |
03:52:19 | reactormonk | any way to get the return value of an executed process AND the input/output streams? |
03:52:42 | reactormonk | ah, just go with waitForExit |
03:52:48 | reactormonk | or peekExitCode. neat. |
03:59:55 | * | mpthrapp_ joined #nim |
04:02:40 | * | mpthrapp quit (Ping timeout: 255 seconds) |
04:04:44 | * | bcinman joined #nim |
04:14:46 | * | endragor joined #nim |
04:30:22 | * | endragor quit (Remote host closed the connection) |
04:33:15 | * | a5i quit (Quit: Connection closed for inactivity) |
04:53:50 | * | dashed joined #nim |
04:58:45 | * | wb joined #nim |
05:21:12 | * | dtscode is now known as dtscokeacola |
05:46:07 | * | saml_ quit (Remote host closed the connection) |
05:59:19 | * | pregressive quit (Remote host closed the connection) |
06:04:46 | * | endragor joined #nim |
06:30:22 | * | dtscokeacola is now known as dtscode |
06:34:36 | * | dtscode is now known as charmander |
06:42:09 | * | Demon_Fox joined #nim |
06:49:24 | * | bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
06:58:42 | * | EXetoC quit (Remote host closed the connection) |
07:07:29 | * | charmander is now known as dtscode |
07:08:22 | novist | I get scratch.nim(19, 43) Error: cannot evaluate at compile time: ctor_counter when my code is imported from other module. any idea why that could be? executing module itself works fine.. https://paste2box.com/iQY-cQ#/P6EiojsvWIv6czhlvRk8O6QlFFuVnvMWOedq7UhypTU/scratch.nim |
07:12:08 | Varriount | novist: Likely a bug or vm limitation |
07:12:17 | * | akiradeveloper joined #nim |
07:12:44 | * | BlaXpirit joined #nim |
07:14:49 | * | gsingh93 quit (Ping timeout: 245 seconds) |
07:15:45 | * | bcinman joined #nim |
07:15:58 | * | bcinman quit (Client Quit) |
07:17:04 | novist | hmm i must have bad karma, tripping on all these bugs hehe |
07:25:24 | * | MagusOTB joined #nim |
07:27:58 | fowl | novist, try var ctor_counter{.compileTime.} = 0 |
07:28:56 | novist | hey that worked, thanks! |
07:29:07 | novist | although.. whats the point of "static:" then? |
07:29:25 | novist | it works even without static block |
07:29:41 | fowl | to execute code at compile time |
07:29:55 | fowl | it doesnt necessarily live beyond the life time of the module though |
07:29:58 | Varriount | novist: Could you submit a PR to the pragma part of the manual adding that the compileTime pragma can be used on variables? |
07:30:14 | Varriount | https://github.com/Araq/Nim/blob/devel/doc/manual/pragmas.txt |
07:30:34 | novist | sure thing |
07:30:56 | fowl | whats up Varriount |
07:31:16 | fowl | working on anything interesting? |
07:31:41 | Varriount | fowl: I don't know. Do Calculus tests counts as 'interesting'? |
07:32:10 | fowl | not to me :p |
07:34:21 | * | dashed quit (Quit: Connection closed for inactivity) |
07:42:39 | * | vendethiel joined #nim |
07:56:53 | * | akiradeveloper quit (Ping timeout: 250 seconds) |
07:58:06 | * | baby_rage_nospac joined #nim |
08:01:34 | * | Arrrrrrr joined #nim |
08:03:04 | Varriount | Hello Arrrrrrr |
08:03:12 | baby_rage_nospac | I'm asian and that's racist |
08:03:25 | Varriount | ? |
08:03:42 | Arrrrrrr | Hello Varriount. Hello Nimrods. |
08:03:42 | baby_rage_nospac | we don't spell "l" as "r" |
08:04:11 | Arrrrrrr | Im very sorry baby_rage_nospac |
08:04:16 | * | Arrrrrrr is now known as Arrrrrrrrrrrrrrr |
08:04:36 | baby_rage_nospac | now I'm 200% triggered now |
08:05:13 | Varriount | Um... ok? |
08:05:31 | fowl | do not continue this conversation |
08:05:43 | baby_rage_nospac | :^) |
08:06:20 | * | baby_rage_nospac quit (Quit: Leaving) |
08:07:12 | fowl | obvious troll is obvious |
08:07:13 | Araq | aha single letters can be racist too now. interesting. |
08:07:40 | * | vendethiel quit (Ping timeout: 244 seconds) |
08:08:55 | Arrrrrrrrrrrrrrr | How does nim resolves the concurrency problem? http://blog.rust-lang.org/2015/04/10/Fearless-Concurrency.html |
08:08:57 | BlaXpirit | some modules in nim standard library do tests via isMainModule. are they included in koch test? |
08:09:20 | Varriount | BlaXpirit: Yes. |
08:09:26 | BlaXpirit | Varriount, but how? |
08:09:38 | Varriount | BlaXpirit: The tester compiles and runs the module. |
08:09:51 | BlaXpirit | but why does it run it? |
08:10:01 | Varriount | BlaXpirit: To test things? |
08:10:03 | BlaXpirit | does it just run all of stdlib? |
08:10:15 | Varriount | BlaXpirit: Yes. |
08:10:15 | BlaXpirit | even if most modules have no tests? |
08:10:19 | BlaXpirit | ok.. |
08:10:22 | Varriount | BlaXpirit: Yes. |
08:10:28 | BlaXpirit | so i suppose i'll test my new module in ismainmodule |
08:11:37 | Araq | Arrrrrrrrrrrrrrr: thread local heaps + a *bunch* of other features like locking levels to prevent deadlocks statically, annotations to enforce you do your locking consistently, message passing etc |
08:12:20 | Varriount | Araq: I don't think I've seen any other language that has locking levels. It's quite an itneresting feature. |
08:12:56 | Arrrrrrrrrrrrrrr | You should write a post explaining this, people would like to learn more (i guess). |
08:13:02 | Araq | BlaXpirit: the tester tests the module at least compiles and if it has isMainModule it is also *run* |
08:13:17 | BlaXpirit | is it in any category? |
08:13:35 | Araq | yes, category 'lib' |
08:13:46 | Varriount | Araq: I don't think that the tester actually tries to detect if a module has an 'isMainModule' in it. |
08:13:54 | Varriount | It just runs the exe |
08:13:58 | BlaXpirit | oh ok. lib+stdlib for stdlib then |
08:14:22 | Araq | Varriount: but I did program it this way, let me take a look |
08:14:59 | BlaXpirit | I see exactly as many executables as sources |
08:15:35 | Araq | if contents.contains("when isMainModule"): |
08:15:36 | Araq | testSpec r, makeTest(test, options, cat, actionRun) |
08:15:38 | Araq | else: |
08:15:39 | Araq | testNoSpec r, makeTest(test, options, cat, actionCompile) |
08:15:51 | Araq | maybe I got the logic wrong :P |
08:16:15 | Araq | also it's apparently case sensitive so if you write ismainmodule it won't work :P |
08:16:19 | Varriount | Well, I stand corrected. |
08:16:41 | BlaXpirit | so weird, I put an when isMainModule: assert false and it passed |
08:17:14 | Araq | BlaXpirit: now that *sucks* |
08:17:26 | BlaXpirit | i'm probably doing something wrong |
08:20:31 | BlaXpirit | the module is being tested for a smaller amount of time than the rest |
08:20:38 | fowl | Araq, do you use generics with macros.getType at all? i want to change them quite a bit |
08:20:55 | Araq | fowl: go head |
08:21:08 | Araq | we don't use them in getType for now |
08:21:10 | fowl | cool |
08:23:07 | BlaXpirit | reNimcCrash when I put syntactically wrong code, even in isMainModule, but assert(1 == 2) just passes |
08:27:10 | Varriount | BlaXpirit: Well duh. Didn't you hear? Math is a lie. |
08:27:27 | Varriount | 1 == 2, and 3/0 = Fish |
08:28:20 | BlaXpirit | dude |
08:28:29 | BlaXpirit | does this mean lib testing actually doesn't work? |
08:28:39 | BlaXpirit | i added assert false to other module and it passed |
08:28:45 | BlaXpirit | can someone try this too? |
08:29:06 | BlaXpirit | add assert false to actors.nim or something and koch test c lib |
08:31:02 | fowl | BlaXpirit, try do_assert before you run through the town screaming that the british are coming |
08:31:07 | BlaXpirit | i did |
08:31:16 | fowl | carry on then |
08:31:33 | fowl | lol |
08:31:46 | TEttinger | it's kinda amazing to me how active this channel is (maybe because development is so active and not afraid to break things once to improve them later :P ) |
08:33:07 | BlaXpirit | hellooo |
08:33:58 | Arrrrrrrrrrrrrrr | Is nice because your questions receive a fast answer. |
08:34:09 | Arrrrrrrrrrrrrrr | I have learned a lot in 2 days. |
08:36:08 | novist | just noticed [0 .. ^2] thing |
08:36:12 | novist | man slices are total mess.. |
08:36:22 | BlaXpirit | were |
08:36:26 | * | Jehan_ joined #nim |
08:37:20 | novist | i really dont like special cases... it doesnt look self explanatory at all. usual characteristic of special cases |
08:37:35 | * | Sembei joined #nim |
08:37:37 | BlaXpirit | dont use it |
08:38:08 | novist | why ranges and slices had to be smashed into the one syntax at all |
08:38:32 | Arrrrrrrrrrrrrrr | what does ^2 in that context? |
08:38:44 | novist | like [0:-2] in python |
08:38:47 | TEttinger | there's quite a few languages coming close to or just getting into a "mature and usable" state now. Julia is nice, but last I checked couldn't compile a standalone executable (which makes it kinda pointless for games). Rust I kinda doubt is as close to ready as advertised, a friend of mine uses the rust nightly and things break constantly. |
08:39:15 | Jehan_ | Julia really has a different target audience. |
08:39:36 | Jehan_ | Mathematicians and scientists in general. |
08:39:54 | BlaXpirit | which is a pity |
08:40:00 | Arrrrrrrrrrrrrrr | what does [0:-2] in python? |
08:40:29 | TEttinger | Nim's older than those two, I think, and it also performs very well... I think the imperative non-heavily-OOP model is a pretty good fit for a lot more software than people think if they've been conditioned into thinking with design patterns and best practices |
08:40:31 | BlaXpirit | a[0 .. ^2] is exactly the same as a[0 .. a.len - 2] |
08:40:32 | novist | but seriously why array/string slicing could not be like [0:-2]? then .. could have stayed inclusive and ones that dong like could implement range(start, stop, step) that produces non-inclusive range. world would be happy, not weird |
08:40:46 | Araq | novist: negative indexing in Python is a *special* case, moreso than Nim's ^ |
08:40:54 | BlaXpirit | novist, you don't understand it. it's all been discussed. |
08:40:57 | novist | but it sure does not look like special case |
08:41:17 | Araq | proof: the implementation in Python uses an 'if' to implement it :P |
08:41:17 | novist | yeah i have seen discussion stop two weeks ago.. |
08:42:19 | Araq | it's called "coming to a conclusion" |
08:42:23 | BlaXpirit | so can anyone confirm or deny that nim's standard library is not being tested at all? |
08:42:45 | Araq | BlaXpirit: will look into it, but I'm afraid you're right |
08:42:59 | BlaXpirit | it takes 1 minute to check, srsly |
08:42:59 | fowl | BlaXpirit, tonight is the first i've heard of those tests supposed to be running |
08:43:06 | Araq | good thing we also have the stdlib directory |
08:43:13 | BlaXpirit | that one works |
08:44:15 | Araq | novist: in Nim foo[-1] never worked, now foo[^1] does. a definite improvement and no runtime overhead, in contrast to -1 |
08:44:27 | Araq | but I won't repeat more of the arguments here |
08:44:36 | novist | i just dont understand why there has to be introduced special less obvious syntax |
08:44:54 | BlaXpirit | "less obvious to a Python programmer" |
08:44:59 | novist | everyone knows what -1 is. now what is ^1? nothing xor 1? |
08:45:02 | BlaXpirit | you're not making sense |
08:45:15 | BlaXpirit | no, not everyone knows what -1 "is" |
08:45:23 | BlaXpirit | i will stop now. |
08:45:51 | novist | its pretty obvious its "negative" right? and if it is used as index of indexable object then its negative index. no? |
08:45:55 | Triplefox | the thing that triggered the most discussion (at least for me) was that inclusive range behavior plus negative indexes created some non-obvious bug situations |
08:46:26 | novist | Triplefox: dont forget pervasive -1 with inclusive ranges |
08:46:47 | novist | for i in 0..ID_LENGTH-1: .. /facepalm |
08:47:26 | Araq | that too has been discussed to death |
08:47:30 | * | Sembei quit (Max SendQ exceeded) |
08:47:45 | Araq | for c in 'A'..'Z': # not so stupid to be consistent, is it? |
08:47:53 | novist | no its great |
08:48:23 | fowl | i do wish for ... too but only because i come from ruby |
08:48:24 | novist | but its not used more often than 0..a-1 |
08:49:16 | Arrrrrrrrrrrrrrr | is in ruby x...y == x..y-1 in nim? |
08:49:37 | fowl | yea |
08:49:53 | Arrrrrrrrrrrrrrr | It's a good idea. |
08:50:12 | novist | anyone see a conflict in that? shorter .. produces longer range, while longer ... produces shorter range. odd |
08:50:45 | novist | although i think nothing prevents defining custom ... operator right? |
08:50:55 | Arrrrrrrrrrrrrrr | I would not care. |
08:51:11 | fowl | lol |
08:51:12 | Arrrrrrrrrrrrrrr | Is a good observation tho., |
08:51:18 | BlaXpirit | novist, yes, after negative indices were removed, nothing prevents it |
08:51:31 | * | HakanD___ joined #nim |
08:52:01 | novist | anyways for slicing in making myself proc slice(...). less weirdness ^_^ |
08:53:55 | Arrrrrrrrrrrrrrr | Is there a way to making procs/types be autoincluded in every module like ints, without hacking the source code? |
08:54:45 | BlaXpirit | Arrrrrrrrrrrrrrr, http://blaxpirit.com/blog/4/make-a-nim-module-available-to-all-your-projects.html |
08:55:01 | Arrrrrrrrrrrrrrr | Ah, you have a blog. I'll have a look a tit |
08:56:26 | novist | BlaXpirit: i dont think its what he meant |
08:56:28 | Arrrrrrrrrrrrrrr | But does it save you to import the code? |
08:56:33 | BlaXpirit | no |
08:57:06 | novist | i was too thinking that a way to define common pragmas/imports in main project file and have them effective through entire project would be useful |
08:57:30 | BlaXpirit | include would work |
08:57:32 | Jehan_ | You can use --import or --include to add a module that's automatically imported/included. |
08:57:54 | novist | oh was not aware of cmd line switches, awesome then, thanks Jehan_ |
08:58:53 | Araq | yup, --import and --include are so often overlooked it's crazy |
09:00:00 | * | vendethiel joined #nim |
09:00:28 | * | pregressive joined #nim |
09:02:28 | Jehan_ | There are a lot of other interesting command line switches that are often overlooked, too. :) |
09:03:00 | Arrrrrrrrrrrrrrr | Your random is fantastic BlaXpirit, have you seen this? http://www.pcg-random.org/ in theory looks even better than mersenne. |
09:03:28 | BlaXpirit | author sucks |
09:03:36 | BlaXpirit | promised to at least 3 people to change license |
09:03:40 | Arrrrrrrrrrrrrrr | lol |
09:03:50 | Arrrrrrrrrrrrrrr | Maybe he doesn't have the time |
09:03:53 | BlaXpirit | asked for a pull request to change license, got 3 of them for each project |
09:03:59 | BlaXpirit | completely ignored |
09:04:23 | BlaXpirit | also it's a new thing without any references from serious sources |
09:04:23 | Arrrrrrrrrrrrrrr | What's the problem with apache 2 license? |
09:04:29 | BlaXpirit | read it and see |
09:04:56 | * | pregressive quit (Ping timeout: 264 seconds) |
09:05:53 | Arrrrrrrrrrrrrrr | tl;dr: ? |
09:06:07 | Arrrrrrrrrrrrrrr | I saw it in some java projects like libGDX |
09:06:42 | Jehan_ | Araq: Are there any plans to get rodfiles working again in the future (I realize that it's not going to be a pre-1.0 thing regardless)? |
09:06:49 | * | Sembei joined #nim |
09:09:00 | fowl | why isnt string just "distinct seq[char]" |
09:09:38 | HakanD___ | thanks all for help |
09:09:43 | HakanD___ | for yesterday |
09:09:45 | HakanD___ | bugs fixed (: |
09:09:49 | * | Sembei quit (Max SendQ exceeded) |
09:10:19 | fowl | cool HakanD___ |
09:11:39 | Jehan_ | fowl: Because it's magic? I mean, literally. :) |
09:12:00 | * | Sembei joined #nim |
09:14:40 | * | vendethiel- joined #nim |
09:14:44 | fowl | Jehan_, i dont follow |
09:14:50 | * | vendethiel quit (Ping timeout: 272 seconds) |
09:15:00 | fowl | im asking 'why is it the way it is' and you're saying 'it is the way it is' |
09:15:39 | fowl | every string function casts it to pgenericseq |
09:17:10 | Jehan_ | fowl: That's the code generator. |
09:17:25 | Jehan_ | If you look at the compiler, you'll note that there's plenty of code specific for tyString. |
09:18:10 | * | Sembei quit (Max SendQ exceeded) |
09:19:45 | * | Sembei joined #nim |
09:20:32 | * | milosn quit (Ping timeout: 272 seconds) |
09:21:26 | BlaXpirit | nim-lang.org down? |
09:21:44 | BlaXpirit | no. apparently it's just me. |
09:21:55 | TEttinger | BlaXpirit, I'm also unclear on apache license stuff. MIT is problematic if someone commits something that violates a third party's patent, which BSD licenses specifically address |
09:22:42 | * | Sembei quit (Max SendQ exceeded) |
09:25:22 | TEttinger | http://xorshift.di.unimi.it/splitmix64.c is a good PRNG that fits most of the bill that PCG does |
09:25:35 | * | akiradeveloper joined #nim |
09:25:49 | TEttinger | it's SplitMix64 in the table on http://xorshift.di.unimi.it/ |
09:26:01 | BlaXpirit | was that added recently? |
09:26:26 | TEttinger | yes |
09:26:58 | TEttinger | it's derived from the same reference implementation that Java 8 uses for its latest RNG |
09:27:18 | BlaXpirit | well it's extremely easy to add if u want it in your project |
09:27:44 | BlaXpirit | and for now i'll just say, this is the first time i see it |
09:27:50 | TEttinger | yep |
09:28:04 | TEttinger | I'm using it in a java lib I'm working on/with |
09:28:21 | TEttinger | (not splittablerandom, since that would need users to use java 8) |
09:28:46 | TEttinger | there's an advantage in that it can use ANY long as a seed |
09:29:24 | TEttinger | XS+128, which is otherwise excellent, needs the seed to be not "everywhere 0" after a certain number of iterations |
09:29:42 | TEttinger | so they recommend you use an avalanche function from murmurhash3 |
09:30:09 | TEttinger | (both are public domain, but it's kinda a hassle) |
09:30:12 | BlaXpirit | TEttinger, i have this |
09:30:55 | BlaXpirit | https://github.com/BlaXpirit/nim-random/blob/1170147/src/random/xorshift.nim#L65 |
09:31:58 | TEttinger | looks like that will work yeah |
09:32:51 | TEttinger | it's such an amazing field isn't it? this research into random numbers and how to generate them |
09:33:30 | TEttinger | one month, the fastest uses 1024 bits of state, the next, it's 128, and the next it's kinda 64 if you're using GCC |
09:33:34 | TEttinger | *clang |
09:34:59 | TEttinger | if I understood the math behind quasirandom number generators or low-discrepancy sequences, I'd try to implement the faure sequence |
09:35:17 | * | Sembei joined #nim |
09:35:31 | BlaXpirit | k |
09:36:45 | * | Sembei quit (Read error: Connection reset by peer) |
09:37:16 | TEttinger | heh |
09:37:18 | TEttinger | https://en.wikipedia.org/wiki/Low-discrepancy_sequence |
09:37:43 | * | akiradeveloper quit () |
09:42:10 | * | Sembei joined #nim |
09:43:53 | * | user7181 joined #nim |
09:44:57 | HakanD___ | Nim attracts lots of python programmers, especially those who are looking for statically typed and/or faster languages. Working on https://github.com/Araq/Nim/wiki/Nim-for-Python-Programmers , and putting on the docs might help with adoption |
09:45:34 | * | Sembei quit (Max SendQ exceeded) |
09:45:48 | * | HakanD___ is now known as HakanD |
09:48:53 | Arrrrrrrrrrrrrrr | I noticed there aren't too many contributors, so i suppose they are very busy. |
09:49:00 | * | Arrrrrrrrrrrrrrr is now known as Arrrrr |
09:50:19 | * | BitPuffin joined #nim |
09:59:45 | * | Sembei joined #nim |
10:04:22 | * | davidhq joined #nim |
10:16:20 | * | Sembei quit (Read error: Connection reset by peer) |
10:16:58 | * | MyMind joined #nim |
10:22:22 | Arrrrr | {.inheritable.} is long and ugly, can it be changed to simply {.open.} ? |
10:24:07 | * | rr joined #nim |
10:24:30 | * | rr is now known as Guest17376 |
10:25:08 | * | Guest17376 quit (Client Quit) |
10:33:43 | * | johnsoft quit (Ping timeout: 245 seconds) |
10:33:50 | * | johnsoft joined #nim |
10:38:18 | Araq | Arrrrr: it's long and ugly because you should inherit from RootObj instead |
10:40:16 | Araq | Jehan_: rodfiles are planned for 2.0 but I'm also playing with other ideas how to implement caching |
10:40:27 | Jehan_ | Araq: *nod* |
10:40:41 | Arrrrr | Ah thanks, this is (a bit) better than using {.inheritable.} |
10:40:52 | Jehan_ | As long as there's a long term plan for huge projects. :) |
10:41:29 | Araq | it's easy enough to get them back into the shape where it once was |
10:41:31 | Jehan_ | Note that it's generally advisable to use inheritance only with ref object types, not object types. |
10:41:46 | Arrrrr | Why? |
10:41:51 | Jehan_ | I'm not sure if the latter still crash, but the semantics are problematic, anyway. |
10:42:38 | Jehan_ | Because assignment to a super type has to strip off the extraneous attributes and cast down to the supertype. |
10:42:54 | Jehan_ | Meaning that you won't get any actual polymorphism out of it. |
10:43:38 | Jehan_ | It works only (kinda sorta) with procedure parameters that are passed (explicitly or implicitly) by reference. |
10:43:46 | * | Trustable joined #nim |
10:44:43 | Arrrrr | and why doesn't it happen with refs ? |
10:45:04 | Araq | because every ref is the same size, it's a pointer |
10:46:14 | Arrrrr | Ok ... then why it has to strip off the differences instead of, i dont know, hide them. |
10:47:48 | Jehan_ | Where should the extra storage come from? |
10:48:01 | Jehan_ | E.g. when you're copying a 2-word object into a 1-word object? |
10:48:09 | * | milosn joined #nim |
10:49:07 | Jehan_ | If the entire hierarchy were known, you could do it, but not with open inheritance (where you don't know what subtypes may be added later on). |
10:49:36 | Arrrrr | Ok, i get it. Does this happen in c++ ? |
10:49:50 | Arrrrr | It seems (for me at least) counterintuitive |
10:50:22 | Jehan_ | It's not even possible in C++. |
10:50:22 | Arrrrr | although i understand what you mean. |
10:50:34 | Jehan_ | if you have class B : public A { … } |
10:50:42 | Araq | no? I thought C++ has the same problem |
10:50:51 | Jehan_ | Then you cannot assign a B to A. Only a B* to an A*. |
10:51:04 | Jehan_ | Araq: yeah, that's what I was saying. |
10:51:11 | Araq | aye that's what I wanted to do too and at some point |
10:51:53 | Araq | I mean, crashing at runtime when the types are not exactly the same |
10:52:16 | * | MyMind quit (Ping timeout: 240 seconds) |
10:52:35 | Jehan_ | The problem right now is that Nim doesn't actually cast to the supertype upon assignment. |
10:53:16 | Arrrrr | Would not be possible to make it working like with refs? |
10:53:41 | Araq | actually what could be done is to transfer the object type field on assignment if the sizes are the same and if not, raise an exception |
10:53:57 | Jehan_ | Araq: Hmm, that'd work, too. |
10:54:04 | Araq | that can be useful for a Ruby wrapper |
10:54:39 | Jehan_ | It would be nice for this case to be able to reserve memory for subtypes in the supertype. |
10:55:04 | Araq | you can do that on your own though |
10:55:17 | Araq | with mild hacks |
10:55:32 | Jehan_ | Hmm, how? |
10:55:46 | * | milosn quit (Read error: Connection reset by peer) |
10:56:34 | * | milosn joined #nim |
10:56:48 | Araq | add some fields to the supertype on your own |
10:57:08 | Arrrrr | could not the size be checked at runtime when assigning object values? like "This A class has more weight than a normal A class, so put more space" or something. |
10:57:14 | Araq | and use them in the subtypes, via 'cast' perhaps |
10:57:36 | Jehan_ | Well, the problem is that this doesn't work so well with ref fields. |
10:57:46 | Araq | true |
10:58:21 | Araq | but internally we have the very same problems then with the GC tracing etc |
10:58:48 | Araq | seems like too much work for a niche feature |
10:58:58 | Jehan_ | Do we? The GC would know that the rest of the object is essentially empty. |
10:59:33 | Arrrrr | Maybe is niche, but people with little idea about values vs refs dont expect that. |
10:59:37 | * | milosn quit (Read error: Connection reset by peer) |
10:59:52 | Arrrrr | You can work around it but well. |
11:00:30 | Araq | Arrrrr: Nim is getting better at handling it, but it's still not optimized for stupidity ;-) |
11:01:39 | * | milosn joined #nim |
11:05:39 | Arrrrr | I would say that many will land to nim expecting an easy programing language but fast, so they will be used to how assigning subtypes to supertypes works with refs types, but will not expect it with values. I'm not saying it should be changed because of this fact, but i would expect most being surprised because of this fact. |
11:06:25 | HakanD | value types/ref types are common source of confusion for people coming from dynamically typed languages |
11:07:42 | Arrrrr | Yeah, but one thing is not knowing something, so you cannot make false assumptions, and be confused with something because of its likeness with a previous and very used feature. |
11:07:48 | * | untitaker quit (Ping timeout: 250 seconds) |
11:08:05 | HakanD | compiler is giving "Error: unhandled exception: false [AssertionError]" |
11:08:07 | HakanD | is it a bug? |
11:08:24 | HakanD | i mean, in the compiler? |
11:10:00 | flaviu | TEttinger: Have you read the PCG paper? It's great! |
11:11:14 | HakanD | nvm, false alarm |
11:11:50 | flaviu | HakanD: If it comes from the compiler process, then yes, it is a bug. |
11:12:30 | HakanD | thanks |
11:12:35 | HakanD | it was coming from my code tho -_- |
11:13:44 | * | untitaker joined #nim |
11:17:19 | Araq | Arrrrr: I am not aware of any official description of Nim that uses the word "easy" |
11:18:28 | Araq | I'm much more concerned about "bug prone for people who programmed in Nim for a couple of days or weeks" |
11:19:31 | Arrrrr | Ok, whatever. I'm just saying it makes sense, is not a matter of stupidity or intelligence, but cohesion. Maybe is niche because noone can actually do it. |
11:19:36 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
11:22:11 | Triplefox | probably the most pressing thing for "nim newbies" is a summary of the safe/productive subset |
11:23:56 | Araq | BlaXpirit: can you fix the tester bug? |
11:24:29 | * | Matthias247 joined #nim |
11:26:06 | Triplefox | today's languages tend to have so many features that you never quite know which features are designed for everyday tasks and which are covering a really difficult edge case and shouldn't be thrown in lightly...it's no wonder people end up thinking Go is okay |
11:27:53 | * | Strikecarl joined #nim |
11:28:04 | Araq | Triplefox: you are very welcome to improve our tutorial ;-) |
11:28:41 | Triplefox | i'll think about it the next time i work in nim...however as it is, i'm writing C :p |
11:29:04 | flaviu | Is there some way to tell Nim to use a different executable extension? |
11:29:26 | * | milosn quit (Read error: Connection reset by peer) |
11:29:27 | Araq | Triplefox: now that's just *sad* :-( |
11:29:30 | Arrrrr | But would you tell me not having the full power of object inheritance in value objects is just a matter of being a newbe? I know that in a month or 2 or three i will be able to overcome it, but that only means having to write more code or doing it in a counterintuitive way, no that i have become more clever. However i can understand there is no time/manpower to employ it in something people gave up for decades. |
11:29:31 | dom96 | flaviu: likely only with --out:foo.bin |
11:29:32 | def- | flaviu: -o:file.exe |
11:29:51 | flaviu | yeah, but I want to put it in a nim.cfg file. |
11:29:57 | pigmej | Arrrrr: isn't it that you're trying ot use too much java inside nim ? |
11:30:16 | * | milosn joined #nim |
11:31:15 | Arrrrr | Well, tell me how making that assumption is wrong or useless. |
11:31:24 | dom96 | flaviu: you can put that in a nim.cfg file |
11:31:35 | Arrrrr | Maybe is not a problem in java, doesnt mean is only usefull in java. |
11:31:52 | flaviu | dom96: Sure I can. But then every executable is called foo.bin. |
11:32:07 | dom96 | flaviu: put it in a project-specific nim.cfg then |
11:32:10 | Araq | Arrrrr: expecting the "full power of inheritance" in value objects makes you a newbie. |
11:32:18 | Triplefox | easy test: does the rule of least power apply to your pet feature |
11:32:24 | pigmej | Arrrrr: well, the thing is inheritance is not the best for quite a lot of cases |
11:32:26 | Arrrrr | Why |
11:32:29 | Triplefox | if it's not "least powerful" you probably don't need it |
11:32:30 | flaviu | dom96: There are multiple executables in my project. |
11:32:31 | Triplefox | yet |
11:32:48 | Arrrrr | If using inheritance in value objects is wrong, then dont allow it. |
11:32:56 | dom96 | flaviu: you can have an executable-specific cfg file then |
11:33:24 | pigmej | Arrrrr: genrally, when you're learning new language you shouldn't try to use it as another language |
11:33:27 | flaviu | dom96: And I can also figure out a way to get autotools to write my nim.cfg files! |
11:33:37 | pigmej | so if you're learning Nim, then stop thinking 'in java I would...' |
11:33:47 | flaviu | Arrrrr: for what it's worth, I agree. |
11:33:49 | pigmej | it will probably have terrible consequences |
11:33:55 | Araq | well *I* can do it ;-) it's not simply always wrong. |
11:33:58 | dom96 | flaviu: what you want isn't implemented, so i'm suggesting alternatives. |
11:34:07 | pigmej | Araq: ;D |
11:35:04 | pigmej | Arrrrr: for example composition combined with awesome nim ucfs could give you way better / readable code (even If I'm Nim newbie too) |
11:36:14 | Arrrrr | I gree with you that composition is always prefered. But i dont see then why we call bicycle something that only has one wheel. |
11:36:45 | pigmej | "[...] Nim's support for object oriented programming (OOP) is minimalistic [...]" |
11:36:47 | pigmej | from docs |
11:36:47 | * | milosn quit (Ping timeout: 256 seconds) |
11:37:11 | Triplefox | there's a basic architecture pattern i've started applying across all the languages i'm using today, and it requires essentially no language features, although some can eliminate boilerplate |
11:37:11 | BlaXpirit | Araq, I don't think i'm the right person to fix testing. it will be much faster for someone who is familiar with it |
11:37:49 | def- | BlaXpirit: i think i know already why it fails |
11:38:01 | def- | BlaXpirit: I'm just not sure how to fix it |
11:38:05 | Arrrrr | but pigmej i can still use a lot of stuff with refs types, and the only reason you are giving me to dont use them in values is "only a noob would do that", which for me is nonsense |
11:39:02 | Arrrrr | I know for example why i would prefer using values instead of refs, and is not because of a language limitation, but a cpu/cache limitation. |
11:39:56 | Arrrrr | I dont see why limit that on nim (of course, besides you want to put effort in other things, which is different from saying is good as it is) |
11:40:31 | Araq | well I already said it's not good and gave a couple of alternatives we should try |
11:42:33 | BlaXpirit | can non-immediate templates access variables in scope? |
11:44:05 | BlaXpirit | nvm, i just need mixin |
11:47:39 | * | HakanD_ joined #nim |
11:48:20 | Araq | hrm our JS tests are quite broken, right? |
11:49:04 | BlaXpirit | you fixed testing and found broken tests, huh? |
11:49:10 | def- | Araq: the JS backend has problems, yes |
11:49:23 | Araq | no I fixed yet another JS codegen bug |
11:49:33 | Araq | and didn't run the tests before but after my patch |
11:49:50 | Araq | and of course now I wonder whether I broke something or if was broken before |
11:50:01 | def- | the js tests never succeeded |
11:50:17 | def- | at least many of them |
11:50:34 | def- | taddr, tunittests, texcpt1 (all with and without -d:release) |
11:50:48 | * | HakanD quit (Ping timeout: 256 seconds) |
11:51:15 | * | jefus quit (Quit: WeeChat 0.4.2) |
11:52:07 | * | jefus joined #nim |
11:54:50 | Araq | taddr works for me |
11:55:08 | Araq | unittest cannot work and I'm disabling it |
11:55:15 | Araq | looking at the exception stuff now |
11:55:42 | Araq | tactiontable fails for me |
11:55:59 | * | milosn joined #nim |
11:57:35 | * | user7181 quit (Quit: leaving) |
12:11:18 | * | BlaXpirit quit (Read error: Connection reset by peer) |
12:11:54 | * | BlaXpirit joined #nim |
12:12:36 | Arrrrr | I go to go, thanks for explaining to me how value objects work in the stack, nimroders. |
12:12:39 | * | Arrrrr quit (Quit: Page closed) |
12:13:00 | Araq | "for example asynchttpyserver just starts and http server and lets it run", def- |
12:13:07 | Araq | that's a very good point |
12:13:19 | * | Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
12:13:23 | Araq | we need some other tag in the source that is checked for |
12:13:49 | Araq | like #TESTRUN |
12:14:07 | Araq | bbl |
12:15:12 | BlaXpirit | Araq, what about when defined(test): |
12:15:46 | BlaXpirit | testing in isMainModule never was a good idea anyway |
12:17:38 | fowl | cursed from the start? |
12:48:26 | * | Kingsquee quit (Quit: Konversation terminated!) |
12:58:21 | * | milosn quit (Ping timeout: 264 seconds) |
13:14:01 | * | milosn joined #nim |
13:23:45 | * | HakanD_ quit (Read error: Connection reset by peer) |
13:27:53 | novist | is it somehow possible to override proc that is defined in stdlib? for example proc echo defined in system.nim. Can i make my own custom echo which is preferred than what is defined in system.nim in my project? |
13:29:40 | dom96 | you can make one but you will need to prefix it with the module name to disambiguate it |
13:30:21 | novist | i see.. that wouldnt work for stuff like operators though. okie.. |
13:31:13 | * | TEttinger quit (Ping timeout: 245 seconds) |
13:34:13 | * | dhasenan quit (Remote host closed the connection) |
13:34:33 | * | dhasenan joined #nim |
13:35:19 | dhasenan | Hrm. Can they turn you into a republic while you're at war? |
13:35:56 | dhasenan | Apparently you can. |
13:39:51 | dhasenan | Yay, wrong channel. |
13:48:24 | * | ob_ joined #nim |
13:53:25 | * | Matthias247 quit (Quit: Matthias247) |
13:58:27 | * | milosn quit (Ping timeout: 256 seconds) |
13:59:31 | fowl | novist, dom96 that is not a problem if its from system |
13:59:59 | flaviu | I'm clearly using the wrong tool here :P |
13:59:59 | flaviu | It takes 2 seconds to parse a standard nim file with my regexes. |
14:00:12 | fowl | of course your echo won't flow back through modules that use system.echo |
14:00:46 | fowl | flaviu, parsing nim syntax or searching for something? |
14:01:12 | flaviu | Searching for something that happens to involve parsing a subset of nim syntax. |
14:02:00 | flaviu | https://github.com/flaviut/docweave/blob/master/src/docweave.nim#L9-L43 |
14:02:39 | dom96 | fowl: interesting |
14:02:52 | * | Matthias247 joined #nim |
14:09:39 | * | MagusOTB quit (Remote host closed the connection) |
14:10:37 | * | xcombelle joined #nim |
14:14:37 | fowl | dom96, seems to be that way and i just tested defining my own echo |
14:26:59 | * | johnsoft quit (Ping timeout: 246 seconds) |
14:27:08 | * | gmpreussner joined #nim |
14:27:28 | * | HakanD joined #nim |
14:29:07 | * | Matthias247 quit (Read error: Connection reset by peer) |
14:32:29 | xcombelle | hi |
14:34:57 | def- | hi xcombelle |
14:35:36 | xcombelle | hi def- |
14:41:31 | repax | BlaXpirit: Stunning implementation of Maybe[T]. :) |
14:43:17 | * | jefus quit (Quit: WeeChat 1.1.1) |
14:56:22 | * | johnsoft joined #nim |
15:02:37 | flaviu | When using fsanitize with nim, `fun:markstackandregisters_[:digit:]*` should be added to the blacklist. |
15:12:53 | BlaXpirit | 2 overloaded procs: one accepts typedesc, other accepts concept - doesn't work, because apparently typedesc accepts everything |
15:13:12 | BlaXpirit | 1 proc with `when val is typedesc` causes a crash |
15:13:22 | BlaXpirit | 1 proc with `when compiles(typetraits.name(val))` works |
15:13:39 | * | darkf quit (Quit: Leaving) |
15:19:19 | BlaXpirit | gee, showstoppers cropping up like crazy |
15:19:52 | flaviu | I'm trying to test and make sure I don't leak memory, how would I do that? I'm using GC_fullCollect(), but my tooling still says I'm leaking memory. |
15:20:12 | * | milosn joined #nim |
15:22:32 | Jehan_ | flaviu: Difficult to say without context. Do you mean that there's memory that should be freed by the GC but isn't? Or that there's foreign memory that's not being managed properly? |
15:23:19 | flaviu | foreign memory, but I'm not sure if there is a problem or not. |
15:23:38 | federico3 | I'm tempted to suggest not using async on Nim-for-Python-Programmers |
15:25:15 | Jehan_ | federico3: In general, I recommend against using concurrency unless you inarguably need it. |
15:25:42 | Jehan_ | You're incurring a lot of cost, and you have to make sure the benefits are worth it. |
15:26:15 | federico3 | well, sometimes you really want it |
15:27:00 | * | HakanD quit (Quit: Be back later ...) |
15:27:08 | Jehan_ | federico3: Of course. |
15:27:41 | Jehan_ | But for a lot of applications it's essentially pointless. |
15:28:00 | Jehan_ | Well, not so much pointless, but really not worth the trouble. |
15:28:23 | dom96 | federico3: why? |
15:28:43 | federico3 | speaking of which, any recommended message passing library/design/method for Nim? |
15:29:02 | flaviu | one GC_fullCollect at the end shows 21 leaks, two GC_fullcollect shows only 16 leaks. |
15:29:08 | flaviu | Not sure what's going on. |
15:30:29 | federico3 | dom96: 1) it seems to be at a relatively early stage 2) Mixing Python-like OO design with asyncs leads to a lot of memory safety errors that confuse newcomers coming from Python |
15:30:49 | BlaXpirit | isn't async singlethreaded |
15:31:02 | federico3 | yep |
15:34:09 | dom96 | what memory safety errors are you referring to? |
15:36:01 | federico3 | dom96: well, for example when an async proc is called on an object instance and it tries to change values in internal attributes or attributes on other instances |
15:38:20 | * | jefus joined #nim |
15:40:32 | dom96 | federico3: can you give an example? |
15:41:21 | * | jefus quit (Client Quit) |
15:42:42 | * | jefus joined #nim |
15:43:57 | * | mpthrapp joined #nim |
15:46:28 | * | mpthrapp_ quit (Ping timeout: 255 seconds) |
15:53:21 | federico3 | hm, I'll have to recreate one. |
16:02:11 | * | banister joined #nim |
16:17:33 | * | pregressive joined #nim |
16:23:15 | Araq | BlaXpirit: 'when defined(testing)' is fine too, but I don't consider isMainModule as wrong |
16:26:45 | flaviu | Araq: What about longer test suites? At some point, a test suite it big enough that it needs to be split out. |
16:27:21 | Araq | really? I thought a test suite always can run in under 5 minutes :P |
16:27:57 | Araq | flaviu: but to be serious: |
16:28:06 | flaviu | There can be multiple files and still run in under 5 minutes. |
16:28:08 | Araq | we already have a nice lib vs stdlib split in the tester |
16:28:26 | * | clynamen quit (Ping timeout: 246 seconds) |
16:29:31 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:32:59 | Araq | dom96: please review https://github.com/Araq/Nim/pull/2513 |
16:38:16 | * | bcinman joined #nim |
16:39:09 | dom96 | done |
16:45:48 | Araq | can we merge https://github.com/Araq/Nim/pull/2244 now? |
16:46:05 | Araq | if async is unstable anyway, we might as well make it faster |
16:50:51 | * | BitPuffin quit (Ping timeout: 276 seconds) |
16:56:36 | dom96 | and make it even less stable in the process? |
16:56:41 | dom96 | let's not do that |
16:57:11 | Araq | actually fewer closure iterators and allocations could also make it more stable as a side-effect |
16:57:24 | * | BitPuffin joined #nim |
16:57:29 | dom96 | This doesn't just make the implementation unsafe |
16:57:33 | dom96 | it makes the API unsafe! |
16:57:42 | Araq | why? |
16:58:20 | dom96 | https://github.com/Araq/Nim/pull/2244/files#diff-3a2daa5a0e408529216e7d6e0900bc29R422 |
16:58:39 | dom96 | Async and pointers in params don't mix. |
16:59:43 | Araq | why does this have to be exported? |
17:02:18 | dom96 | I guess it could be moved to asynchttpserver |
17:03:23 | dom96 | This isn't the way this should be done though. |
17:03:32 | dom96 | We need to come up with a way to speed up async whole. |
17:05:53 | Araq | bbs |
17:21:27 | * | yymoto2 joined #nim |
17:32:34 | * | BitPuffin quit (Remote host closed the connection) |
17:33:09 | * | BitPuffin joined #nim |
17:39:18 | * | Senketsu quit (Quit: Leaving) |
17:40:47 | * | gimireh joined #nim |
17:41:44 | gmpreussner | what's the best way to manage a project with a lot of packages? would package dependencies go into each package's nim.cfg? |
17:41:58 | gmpreussner | i don't want to go through nimble for my personal stuff fyi |
17:44:21 | Jehan_ | gmpreussner: Use Peru to keep them in sync, nimble build to build them (locally), and add the paths to your config. At least that would be my suggestion for now. |
17:44:26 | BlaXpirit | gmpreussner, nimble can install all dependencies specified in a .nimble file, why avoid it |
17:45:20 | Jehan_ | BlaXpirit: The point is that you don't want a package update in a global directory to break your stuff. |
17:45:31 | BlaXpirit | oh i'm a dummy |
17:45:41 | Jehan_ | One of the big shortcomings of Nimble is that you can have only one installation. |
17:45:59 | pigmej | Jehan_: what's Peru? |
17:46:09 | BlaXpirit | it's a bad sign that people aren't crying everywhere about this |
17:46:22 | Jehan_ | pigmej: https://github.com/buildinspace/peru |
17:46:54 | Jehan_ | BlaXpirit: Meh, I (mostly) just don't use Nimble. Except to look up where packages are. |
17:46:54 | BlaXpirit | sure looks cool as heck |
17:47:40 | Araq | er I think Nimble can handle just fine it's just that nobody knows about it |
17:47:52 | pigmej | Jehan_: ee, weird |
17:48:06 | BlaXpirit | Araq, i wouldn't be surprised |
17:48:21 | Jehan_ | Araq: If there's a way to specify a different installation path, it's not documented anywhere. |
17:49:16 | flaviu | BlaXpirit: I use it in Nimlets to do dependency management. |
17:49:17 | pigmej | for me the biggest problem with nimble is versioning |
17:49:30 | flaviu | https://github.com/nimlets/nimlets |
17:50:20 | pigmej | correct me if I'm wrong, but isn't nimble replacing global package versions "just when some package needs it" ? |
17:50:37 | pigmej | and there is no way to have multiple versions of the same package, isn't it? |
17:51:00 | BlaXpirit | something a bit like that |
17:51:18 | pigmej | just like pythons pip without virtualenv |
17:51:59 | BlaXpirit | pigmej, actually it keeps all old versions of packages |
17:52:24 | BlaXpirit | problem is only the biggest version is ever used |
17:52:36 | pigmej | ah so exactly like in python pip ;) |
17:52:52 | BlaXpirit | i don't think pip even can keep old version |
17:53:04 | pigmej | BlaXpirit: and probably 'biggest' means lastest on disk when sorted by name? |
17:53:13 | BlaXpirit | i dont know |
17:53:15 | pigmej | BlaXpirit: it can, it will in fact keep it |
17:53:21 | pigmej | sometimies by accident sometimes not |
17:53:26 | pigmej | who know, pip is broken as hell |
17:53:36 | BlaXpirit | i think you are mistaken here. |
17:53:45 | pigmej | about pip ? |
17:54:09 | * | gsingh93 joined #nim |
17:54:38 | pigmej | there is even thingy called yolk which will list multiple packages |
17:54:59 | pigmej | and it will show you which version is used (but sometimes it will fail too) |
17:55:10 | Jehan_ | Well, dealing with multiple versions isn't trivial. |
17:55:16 | Jehan_ | Unless you do something like virtualenv. |
17:55:41 | * | yymoto2 quit (Quit: Lost terminal) |
17:55:41 | pigmej | virtualenv is also quite hmm, hacky :) |
17:55:48 | * | gsingh93 quit (Client Quit) |
17:56:14 | pigmej | generally, default python package management / installing shouln't be used as example as "good package management" |
17:56:55 | * | gsingh93 joined #nim |
17:59:00 | Jehan_ | What virtualenv does well is creating a standalone version of a piece of software that won't get screwed up by messing around with the rest of the system. |
17:59:18 | Jehan_ | That alone is enormously valuable. |
17:59:23 | pigmej | I like how rebar works |
17:59:24 | * | shodan45 quit (Quit: Konversation terminated!) |
18:00:10 | pigmej | Jehan_: well, in theory you're right, but it can crash after system upgrades or some other upgrades (some dynamic loaded libs are copied as they are) |
18:00:18 | pigmej | and soo on |
18:00:47 | Jehan_ | pigmej: Yes, I know. Nothing's perfect (though --always-copy deals with some of the worst stuff). |
18:01:15 | pigmej | Jehan_: sure, I just wnated to say that pythonic 'separtion' is not really good |
18:01:20 | pigmej | it works, but that's mostly all :) |
18:01:34 | Jehan_ | It is better than what most other systems offer. |
18:01:57 | pigmej | Jehan_: rebar, hex from erlang world are hmm, wayt better |
18:02:16 | federico3 | Jehan_: which speaks volumes about the quality of language-specific packaging |
18:02:18 | pigmej | for python conda does pretty cool work, but it's non standard thingy, |
18:02:19 | Jehan_ | Erlang isn't "most other systems". |
18:02:23 | pigmej | nix is cool also for python things |
18:02:27 | Jehan_ | Erlang isn't even remotely mainstream. |
18:02:40 | pigmej | probably nix + nim would allow multiple versions |
18:02:40 | pigmej | etc |
18:02:53 | Jehan_ | And I remember the last time I had to clean up after uninstalling RVM, for example. |
18:02:53 | pigmej | Jehan_: huh, erlang world is quite big |
18:03:09 | pigmej | rebar3 and hex are quite cool, really |
18:03:16 | Jehan_ | pigmej: That's different from being mainstream. And I wish Erlang were more mainstream, I'm not dissing it. |
18:03:19 | pigmej | before that it was mostly crap :) |
18:04:10 | pigmej | Jehan_: yeah, but not beeing mainstream doesn't mean that it does not have cool tools ;) |
18:04:29 | dom96 | Why do people seem to think that Nimble cannot handle multiple versions of the same packages being installed at the same time? |
18:04:34 | Jehan_ | pigmej: Yeah, I know. In fact, most cool tools are somewhat obscure. |
18:04:58 | pigmej | dom96: probably because docs are not good enough ? |
18:05:33 | BlaXpirit | lol maybe Nimble can handle, then Nim can't |
18:05:58 | pigmej | BlaXpirit: rotfl :D |
18:06:09 | pigmej | but the result is the same :) |
18:06:42 | pigmej | hmm, just checked nix with nim and it will work pretty well, so that will be a solution too |
18:06:50 | dom96 | BlaXpirit: That is correct, Nimble resolves the dependencies not Nim. |
18:07:35 | Jehan_ | dom96: How does Nim know which path the correct version is on? |
18:07:50 | Jehan_ | Nevermind, how do I even specify a version in Nim? |
18:08:06 | dom96 | Jehan_: Nimble passes the paths explicitly to Nim |
18:08:20 | dom96 | You specify the version in a .nimble file. |
18:08:33 | Jehan_ | I'm calling Nim, not Nimble, to build my main program. |
18:08:59 | dom96 | Well, sorry, but you will have to call Nimble to build your main program not Nim. |
18:09:01 | Jehan_ | And there's no way around that, because I have to do other things as part of the build. |
18:09:02 | BlaXpirit | oooh i get it. you're not supposed to call nim directly |
18:09:20 | BlaXpirit | that can work |
18:09:28 | Jehan_ | Okay, then Nimble is still not for me. Aside from the lack of virtualenv support. |
18:09:40 | pigmej | Jehan_: check nix ;) |
18:09:41 | gmpreussner | i have to admit that, now that i'm starting to work on larger projects, i'm not at all clear on how to organize them and manage dependencies. neither Nim nor the Nimble docs are very helpful in this regard. |
18:09:43 | BlaXpirit | you don't need virtualenv |
18:09:55 | BlaXpirit | Nimble manages dependencies well |
18:10:06 | dom96 | Jehan_: All we need is `nimble c file.nim`. |
18:10:25 | BlaXpirit | each package is allowed to want different versions, no problem |
18:10:25 | dom96 | After that is implemented I don't see any issues. |
18:10:31 | Jehan_ | BlaXpirit: There's a lot more to virtualenv than just managing dependencies. |
18:10:41 | BlaXpirit | like a ton of hacks? |
18:10:49 | pigmej | BlaXpirit: check nix ;) |
18:11:01 | pigmej | sorry for repeating, but nix is really cool if you want to do 'separation' |
18:11:09 | Jehan_ | Being able to create a standalone distribution, for example. |
18:11:22 | BlaXpirit | it doesn't do that so well actually |
18:11:24 | gmpreussner | can i use Nimble with packages that only exist on the local file system? |
18:11:30 | BlaXpirit | yes |
18:11:44 | BlaXpirit | `nimble install` in the folder |
18:12:09 | gmpreussner | will that create a copy into nimbleDir, or will it fetch files from the folder when needed? |
18:12:10 | dom96 | gmpreussner: How can I improve the docs? I think that the docs are already pretty detailed. |
18:12:17 | BlaXpirit | gmpreussner, copy |
18:12:25 | dom96 | Perhaps the issue is that people are not reading developers.markdown? |
18:12:31 | dom96 | https://github.com/nim-lang/nimble/blob/master/developers.markdown |
18:12:59 | Jehan_ | nimble c file.nim does not work? |
18:13:06 | Araq | IMHO the problem is that Nimble has no real website. I never read these github pages |
18:13:13 | BlaXpirit | >_> |
18:13:23 | Jehan_ | Scratch that, nimble doesn't even work with the devel branch at the moment. |
18:13:50 | dom96 | Jehan_: It hasn't been implemented yet. |
18:13:58 | gmpreussner | dom96: sorry, i didn't mean to bitch. what i'm saying is that there seem to be no guidelines on how to organize large projects. i'm thinking of frameworks and programs that may consist of dozens or hundreds of modules. |
18:13:58 | Jehan_ | Ah. Well, that doesn't help me, then. |
18:14:14 | gmpreussner | and by modules i mean packages |
18:14:21 | pigmej | dom96: you say docs are detailed |
18:14:27 | gmpreussner | sorry, i always mix up those two, because we refer to packages as 'modules' at work :) |
18:14:29 | pigmej | and you said that nimble can manage multiple versions |
18:14:39 | pigmej | even knowing this I don't see this in docs |
18:15:06 | dom96 | gmpreussner: None of us have projects of that magnitude so coming up with guidelines for them hasn't been a priority as of yet. |
18:15:18 | gmpreussner | dom96: yeah, understood |
18:15:23 | Araq | gmpreussner: so where can I find this information for C++? I don't think this criticsm is fair. |
18:15:47 | dom96 | pigmej: fair enough |
18:16:02 | pigmej | dom96: I'm not saying that those docs are bad |
18:16:07 | gmpreussner | well, it's not criticism. it's just an obstacle i ran into today. i haven't put much thought into this, and now that i have to, i feel stuck :) |
18:16:13 | pigmej | I think that they have too high entry level |
18:16:26 | pigmej | so for someone new, it's a problem |
18:16:50 | gmpreussner | Araq: with C++, the IDEs usually make it easy |
18:17:18 | gmpreussner | for example, in Visual Studio, organizing a solution into projects is the natural worklow, and VS takes care of the dependencies |
18:17:32 | gmpreussner | or you can at least tweak them in the project settings |
18:18:00 | gmpreussner | i found the workflow for C# particularly easy. i don't have to worry about anything there. the IDE figures out what needs to be imported |
18:18:22 | Jehan_ | How does Nimble know which version of Nim to call, by the way? |
18:18:44 | dom96 | Jehan_: It just calls whatever is in your PATH. |
18:19:01 | Araq | that's not the same at all. so you don't want docs of how to organize stuff, you want IDE support for Nim. |
18:19:18 | * | bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
18:19:19 | Araq | which is of course a very valid desire ;-) |
18:19:34 | pigmej | Araq: I will try to improve nim support in emacs if so :) |
18:19:47 | * | bcinman joined #nim |
18:19:53 | dom96 | pigmej: It would be awesome if somebody could help out with docs, perhaps you would be willing to do so? |
18:20:18 | pigmej | dom96: I'm probably too new in nim world |
18:20:24 | gmpreussner | Araq: with Nim, i don't know what the idiomatic workflow is, not even in principle. is it nim.cfg? is it nimble? how do i deal with sub-directories? how do i handle module name collisions across different packages? how do i make sure that the main program compiles, but that individual modules are compilable as well? what about separate test harnesses? etc. etc. |
18:20:42 | dom96 | pigmej: That's a good thing, you know the questions newcomers ask. |
18:20:58 | Jehan_ | Right now … no offense, but I'll just keep not using Nimble for the time being. I don't think what I get out of it is worth the problem it's causing me. |
18:21:05 | dom96 | pigmej: You can document your journey to understanding how Nimble works :) |
18:21:13 | pigmej | dom96: np |
18:21:22 | Jehan_ | For what it's worth, I think it's essential that Nimble works with existing build tools and doesn't try to take over the build process. |
18:21:26 | pigmej | I can remember my questions / thoughts ;-) |
18:21:55 | BlaXpirit | i think Nimble is very good |
18:22:02 | Araq | :O |
18:22:30 | Araq | BlaXpirit: I don't believe you. |
18:22:58 | dom96 | Araq: hah |
18:23:27 | Jehan_ | For better or worse, using external libraries with autoconf/make/etc. is simply unavoidable for a lot of stuff. |
18:23:48 | dom96 | Jehan_: is there any chance you could give me a detailed description of your project so that I could perhaps help you understand how I would use Nimble to build it? |
18:24:09 | Jehan_ | dom96: My point is that I don't want to use Nimble to build it. |
18:24:24 | dom96 | is that because you prefer to use make to build your project? |
18:24:34 | flaviu | It should be possible to hack around with staticExec to run make. |
18:24:36 | Jehan_ | I want Nimble to simply put packages where I can find them. |
18:24:50 | Jehan_ | dom96: Not so much prefer but need. |
18:25:07 | dom96 | Jehan_: It already does that. |
18:25:27 | dom96 | They will always be in ~/.nimble/pkgs/pkgName-ver |
18:25:44 | Jehan_ | dom96: Yeah, that's another problem. |
18:25:59 | Jehan_ | How does Nimble deal with packages that need to run autoconf, by the way? |
18:26:36 | Jehan_ | Simply put: I need to give my code, as a standalone distribution, to other people. |
18:26:38 | repax | ~/.nimble is a weird place for non-config files. |
18:26:51 | Jehan_ | Those people don't want stuff in their home directory that doesn't belong there. |
18:27:21 | Jehan_ | The distribution absolutely needs to be standalone. |
18:27:37 | Jehan_ | Not to mention that there may be multiple versions of the code. |
18:27:53 | Araq | that's not nimble's business |
18:28:04 | Araq | nimble is not for end users of software |
18:28:10 | Araq | it's for Nim developers |
18:28:22 | flaviu | Is there some way to have Nim use standard malloc? |
18:28:48 | dom96 | Jehan_: Nimble already has a config file in which you can override where the "Nimble dir" is (~/.nimble). Perhaps if this became a cmd line argument it would be helpful to you? |
18:28:48 | Jehan_ | Araq: yeah. But given that I already need to maintain my own package tree then, Nimble is essentially useless for me. |
18:28:59 | dom96 | That said, I do agree with Araq. |
18:29:18 | BlaXpirit | dom96, that would definitely be best |
18:29:29 | BlaXpirit | > cmd line argument |
18:29:40 | Jehan_ | dom96: When I say "no stuff in the home directory of other people", that means exactly that. |
18:29:40 | Araq | flaviu: no and that wouldn't help you anyway to detect leaks. |
18:29:53 | Jehan_ | Not "except for a nimble config file". |
18:30:05 | flaviu | Araq: I'm not looking to locate leaks. |
18:30:20 | flaviu | I'm looking for buffer overflows. |
18:30:26 | dom96 | Jehan_: Yeah, which is why I suggest implementing a cmd line argument in Nimble to replace the nimble config file. |
18:30:32 | Jehan_ | What's the problem with giving Nimble a --dir option to tell it where to look anyway? |
18:30:54 | Araq | flaviu: lol. |
18:30:54 | Jehan_ | Why the obsession with putting stuff in $HOME? |
18:31:03 | dom96 | That's pretty much my suggestion |
18:31:22 | Jehan_ | Fine. That's all I've been asking for. Sigh. |
18:31:39 | Araq | $HOME is cool, it's a fucking mess already and doesn't require sudo. :P |
18:31:54 | federico3 | ...where else? |
18:32:11 | flaviu | $XDG_CONFIG_HOME is better. |
18:32:20 | Jehan_ | Araq: It's not $HOME vs. /usr/lib, it's $HOME vs. $HOME/some/local/development/dir |
18:32:21 | Araq | I have ~/projects for this reason, so ~ can be full of garbage |
18:32:36 | dom96 | Jehan_: My goal from the very beginning with Nimble was to keep it simple, which is why I prefer to hear the user's full story before simply implementing every feature they ask for. |
18:32:48 | federico3 | flaviu: sure, if it's available (but it's still under $HOME) |
18:33:05 | repax | home is for "your" files. nimble-packages can always be downloaded anew |
18:33:27 | Jehan_ | dom96: That's okay. As I said, I'm doing fine without Nimble so far. |
18:33:58 | Jehan_ | I'm only telling you that it's virtually useless for me right now in that it only creates extra work and doesn't give me any benefits. |
18:35:20 | dom96 | alright. |
18:35:52 | * | federico3 stating the obvious: nimble could check for an optional $NIMBLE_HOME |
18:35:54 | Jehan_ | You don't need to feel forced to do anything about it, but if you want feedback, that's why I'm not using Nimble. |
18:36:30 | gmpreussner | dom96: i put together a gist with some quick ideas here: https://gist.github.com/gmpreussner/df7705a7c2c3c57f0e62 - tell me if it's unreasonable or if i'm crazy :) |
18:36:30 | * | MagusOTB joined #nim |
18:36:31 | Jehan_ | What I've been telling you is the long answer to why versioning doesn't do what I need, that's all. |
18:37:06 | Jehan_ | SInce everybody seemed to try to tell me that I don't need what I know I need. |
18:37:06 | MagusOTB | the default constructor for a type zero initializes everything, right? |
18:37:12 | def- | MagusOTB: right |
18:37:34 | repax | I'm not using nimble because I want all dependencies in subdirectories of the project so that I can control exactly what version I'm using and when I'm updating any one depencency. I'm sure Nimble is a useful tool though |
18:38:45 | * | xcombelle quit (Ping timeout: 248 seconds) |
18:38:51 | Araq | I do use nimble but I want to know how I can make it "git clone" so that I can contribute easily to a nimble package |
18:39:04 | dom96 | gmpreussner: thank you |
18:39:05 | BlaXpirit | repax, or just specify exact versions in .nimble file and have nimble do it for u |
18:39:13 | dom96 | repax: ^^ |
18:39:37 | dom96 | Araq: you can't :P |
18:39:56 | Araq | btw instead of version nailing you can also do feature detection via system.declared and system.compiles :P |
18:40:34 | repax | BlaXpirit: I'm probably just not sufficiently familiar then. Good to know it can handle it |
18:40:53 | BlaXpirit | i wasn't either, until just nopw |
18:41:50 | Jehan_ | Looking at the documentation right now, there doesn't seem a way to tell Nimble to use specific command line options for Nim? |
18:42:05 | BlaXpirit | isn't that nim.cfg |
18:43:09 | dom96 | indeed. You should be putting them in your nim.cfg file. |
18:43:35 | dom96 | My planned "nimble c file.nim" feature will support passing command line options to Nim though. |
18:44:47 | BlaXpirit | the design is so awesome |
18:45:14 | Jehan_ | What I was thinking of how to deal with debug vs. release builds. |
18:45:19 | Jehan_ | … was how ... |
18:46:11 | Jehan_ | Given that right now "nimble build" seems to be the way how you'd go about building something locally. |
18:46:46 | dom96 | "nimble build" was in fact designed for end-users of your package so it will always build in release mode |
18:47:02 | repax | Good to know |
18:47:08 | Jehan_ | Umm. That's another thing. I very rarely want to build in release mode. |
18:47:26 | Jehan_ | I almost always want to at least have checks enabled that guarantee memory safety. |
18:48:14 | dom96 | That's an option we should introduce for the .nimble file. |
18:48:24 | Jehan_ | Release is (1) for code that absolutely needs every last bit of performance or (2) benchmark games, IMHO. |
18:48:44 | Jehan_ | But a lot of code doesn't fall under (1) or (2) and is better off with not having buffer overflows. |
18:49:09 | repax | I usually have different shell scripts for doing debug / release / test builds / or just "nim check"s |
18:49:34 | Varriount | Jehan_: You do know that alternate 'modes' can be defined in the config file, right? |
18:49:52 | Jehan_ | Varriount: Yeah, that's what I'm doing. |
18:50:00 | Jehan_ | The question is how to tell Nimble which one to pick. |
18:50:12 | Jehan_ | In short, I have -d:memsafe for this mode. |
18:52:16 | gmpreussner | Araq: wrt better IDE support, i don't think that needs to be the first step. the things i mentioned for visual studio ultimately boil down to making the right settings in some configuration files. i'd be totally fine configuring those files by hand now. |
18:52:50 | Jehan_ | Another fun problem: one of my projects has Nim code that generates other Nim code (from a plain text database). |
18:52:52 | gmpreussner | if there is some workflow with, say, nim.cfg that allows me to manage large projects, i'd be good to go :) |
18:53:49 | gmpreussner | i should qualify: as long as i don't end up hard-coding a bunch of absolute paths :) |
18:54:12 | repax | A config file can never be sufficiently flexible |
18:54:23 | gmpreussner | yeah, i think something like nimble is needed |
18:55:13 | gmpreussner | maybe i'll just write my own build script that discovers available packages and generates appropriate command lines |
18:55:14 | * | Arrrrr joined #nim |
18:55:16 | repax | In the end you would have to implement a scripting language to perform the setup of a build (like all the build systems out there) |
18:55:39 | * | xcombelle_ joined #nim |
18:55:57 | Jehan_ | repax: Yeah. Which is why essentially all I need is "nimble path". |
18:56:30 | Arrrrr | (Hello Nimrod. I want to know how to do this: 'for y in 0..(HEIGHT-1 / 2)', it does not compile) |
18:56:35 | * | xcombelle_ is now known as xcombelle |
18:56:58 | repax | Jehan_: how about your nim to nim build. I'm sure it can be built by nimble somehow. It just seems overwhelming to me |
18:57:32 | BlaXpirit | Arrrrr, / returns float |
18:57:37 | Jehan_ | repax: It's not even something fancy, it mostly just generates a case statement. But it does require an extra step. |
18:57:49 | repax | Perhaps I'm thinking too much in imperative terms |
18:57:53 | Arrrrr | Yeah, that's what the compiler yells to me, i dont know how to make the conversion |
18:58:09 | BlaXpirit | you probably meant 0..(HEIGHT-1) div 2 |
18:58:35 | Jehan_ | Arrrrr: x/y gives a floating point result if x and y are ints. |
18:58:36 | Arrrrr | wow you were right. Thanks! |
18:58:50 | flaviu | Arrrrr: *Nim |
18:59:00 | Arrrrr | So, div gives an entire result? |
18:59:13 | Jehan_ | x div y produces an int. |
18:59:25 | BlaXpirit | floor div |
19:00:33 | Arrrrr | Ok, i'll remember that. Thanks |
19:01:05 | * | bjz quit (Quit: Textual IRC Client: www.textualapp.com) |
19:01:19 | MagusOTB | what's the deal with 'result' in the docs? |
19:01:33 | repax | MagusOTB: can you elaborate? |
19:01:35 | MagusOTB | is it some kind of magic, or is using that to refer to the return value a convention? |
19:01:41 | dom96 | gmpreussner: replied |
19:01:48 | BlaXpirit | MagusOTB, i'm sure it's mentioned somewhere |
19:02:16 | BlaXpirit | maybe this http://nim-lang.org/manual.html#return-statement |
19:02:49 | MagusOTB | ok so result is magic |
19:02:57 | MagusOTB | it's zero initialized by the compiler? |
19:02:57 | gmpreussner | dom96: awesome, thanks |
19:03:01 | def- | MagusOTB: yes |
19:03:01 | dom96 | it's also a convention to use 'result' instead of defining your own var |
19:03:03 | MagusOTB | what if the result is a compound type? |
19:03:22 | Jehan_ | MagusOTB: Every procedure has an implicit variable result that holds the return value. It is initialized as though reset(result) had been called. |
19:03:27 | Varriount | MagusOTB: If it's an object, then all it's fields are initialized to zero. |
19:03:42 | Varriount | MagusOTB: If it's a reference, the reference is 0 (a null reference) |
19:03:48 | MagusOTB | so the same thing you get by calling the proc that comes with the typename |
19:03:53 | dom96 | gmpreussner: np. Hope that helps somewhat, I know it's not ideal but that is how I would do it. Let me know if you come up with a better solution or if you have any questions. |
19:04:50 | gmpreussner | oki |
19:06:08 | gmpreussner | dom96: i think your suggestions will work fine for now. it is kind of what i concluded, except i didn't know about 'nimble install' for local files |
19:13:02 | * | bjz joined #nim |
19:17:58 | repax | One might also want to build object files and temporaries on a scratch disc or ram disc instead of among source files |
19:18:38 | Araq | repax: --nimcache is already configurable |
19:18:44 | repax | Great |
19:18:46 | BlaXpirit | :o |
19:23:24 | * | brson joined #nim |
19:24:48 | pigmej | what does nimsuggest expect on projectfile ? |
19:26:56 | * | xcombelle quit (Ping timeout: 240 seconds) |
19:28:32 | gmpreussner | Araq: for the --out parameter, can we make it generate the target directory if it doesn't exist? |
19:28:33 | Arrrrr | Does nim have a switch to test if a file has any problem without having to compile it? |
19:28:47 | * | ChrisMAN joined #nim |
19:28:48 | repax | pigmej: That's a good question. Nimsuggest should perhaps have access to as much information as nimble has (in order to find all dependencies) |
19:28:50 | def- | Arrrrr: nim check |
19:28:54 | gmpreussner | Araq: for the --nimcache directory it seems to work that way already |
19:29:18 | Arrrrr | Fantastic , thanks def- |
19:29:31 | pigmej | repax: are you aware of some documentation for nimsuggest? |
19:29:41 | Araq | gmpreussner PRs welcome :P |
19:30:03 | Araq | pigmej: there is no documentation. ask me |
19:30:06 | repax | pigmej: No. I think it is more like the compiler - i.e. having limited knowledge of the project |
19:30:52 | pigmej | Araq: what should I know before I will start integration of it with emacs company mode |
19:31:12 | pigmej | Araq: I think about one nimsuggest process per project |
19:31:21 | pigmej | but what more should I know about nimsuggest itself before :) |
19:31:31 | pigmej | like what the heck is that projectfile.nim |
19:31:54 | Araq | it usually helps to be completely ignorant when one starts a new project. |
19:32:08 | repax | I find it hard not to be ;) |
19:32:22 | pigmej | Araq: you mean ? |
19:32:31 | Araq | too much knowledge keeps one from doing it |
19:32:58 | pigmej | ok |
19:33:08 | pigmej | fine, just wondering what's that projectfile.nim :) |
19:33:14 | * | gimireh quit (Quit: Leaving) |
19:33:32 | pigmej | aporia uses current file as projectfile argument for example |
19:33:45 | Araq | pretty sure it doesn't |
19:33:52 | * | banister joined #nim |
19:33:55 | * | banister quit (Max SendQ exceeded) |
19:34:06 | pigmej | it does ;) at least for me |
19:34:07 | repax | The most pressing issue with nimsuggest as I see it has to do with its knowledge of include dirs and project-wide defined symbols |
19:34:29 | Araq | the projectfile is the file that is the main file of your project |
19:34:30 | pigmej | Araq: or maybe it's first file where ctrl+space was hit |
19:35:09 | Araq | repax: NimStudio works around that |
19:35:29 | pigmej | Araq: yeah, aporia uses first file where completion was called |
19:36:05 | pigmej | (it even copies it to /tmp/aporia) |
19:37:36 | BlaXpirit | please help me fix this code. https://bpaste.net/show/19c223b03522 |
19:37:45 | BlaXpirit | as far as i'm aware, this is a bug, but i dunno |
19:37:48 | pigmej | Araq: what are sug|con|def|use ? |
19:38:00 | repax | So, perhaps NimStudio is a useful source for pigmej? |
19:38:17 | pigmej | sug => suggestion, con ?, def ?, use? |
19:39:07 | Araq | sug # dot was pressed |
19:39:20 | Araq | con # ( was pressed (show parameters and types) |
19:39:27 | Araq | def # goto definition |
19:39:35 | Araq | use # list usages |
19:39:51 | pigmej | cool |
19:40:00 | pigmej | and the difference between file and dirtyfile ? |
19:40:01 | * | xcombelle joined #nim |
19:40:13 | pigmej | dirtyfile is something like 'may be broken/ under construction file' ? |
19:40:23 | pigmej | kind of ignore syntax errors etc? |
19:40:40 | Araq | dirtyfile is the temporary file |
19:40:51 | Araq | you need to save the file for nimsuggest |
19:40:53 | gmpreussner | dom96: i got this working as suggested. i think 'nimble c <file>' is going to be critical though - otherwise i can build either all or nothing :) |
19:41:05 | Araq | but might not want that |
19:41:09 | * | dewdrop quit (Read error: Connection reset by peer) |
19:41:25 | Araq | so the editor uses a temporary file |
19:41:38 | gmpreussner | dom96: in particular, there is no convenient way to build the tests associated with a package right now |
19:41:59 | Araq | and you tell nimsuggest "foo.nim" is actually in "/tmp/foo.nim" |
19:42:24 | pigmej | Araq: ah cool |
19:42:25 | * | cjbest joined #nim |
19:43:20 | Araq | pigmej: also nimsuggest can compile unrelated modules, so you don't really have to create one process per project |
19:43:30 | Araq | but it's true that "per project" works better |
19:43:53 | BlaXpirit | Araq, please advise on this very short piece of code. https://bpaste.net/show/19c223b03522 |
19:44:21 | dom96 | gmpreussner: cool. I'll see about implementing that ASAP. |
19:44:34 | flaviu | Wow, the performance of findAll in nre is terrible! |
19:45:15 | * | devdri joined #nim |
19:45:49 | Araq | BlaXpirit: known bug. |
19:45:52 | Araq | hi devdri welcome |
19:45:55 | BlaXpirit | what can i do? |
19:46:04 | * | bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
19:46:18 | Araq | I never understood why 'distinct G[T]' is required |
19:46:22 | * | bcinman joined #nim |
19:46:23 | * | devdri quit (Client Quit) |
19:46:43 | BlaXpirit | because i oversimplified the example |
19:46:46 | * | pregressive quit (Remote host closed the connection) |
19:46:48 | BlaXpirit | in reality it's actually needed |
19:47:06 | def- | BlaXpirit: that's the bug i think: https://github.com/Araq/Nim/issues/1385 |
19:47:38 | BlaXpirit | :s |
19:50:08 | Arrrrr | omg, it's been a hard hour but at last i managed to get only one char from window's input without having to press enter http://pastebin.com/rEsqQrTT i feel less stupid now |
19:50:51 | Arrrrr | I'm trying to program a roguelike just for experimentation purposes |
19:51:01 | federico3 | can I list all procs that can act on a given type? The equivalent of dir() ? |
19:51:37 | def- | Arrrrr: i think we're missing just that for the terminal module, where it's only defined for non-windows |
19:51:56 | * | cjbest quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
19:52:12 | Arrrrr | i didnt found it inside windows module, but found a way to program it from c++ |
19:53:12 | pigmej | hmm, Araq i'm getting werid errors from nimsuggest |
19:53:17 | pigmej | for example Error: cannot open '/home/pigmej/Apps/Nim/compiler/lib/system.nim |
19:54:38 | gmpreussner | dom96: is --NimblePath more of an internal feature used by nimble, or is there a way to make Nim read this from the environment? putting it in a nim.cfg is probably not good (absolute path) |
19:55:20 | dom96 | gmpreussner: it's so that Nim knows where to find Nimble packages |
19:55:37 | gmpreussner | right, but i suppose it's only passed by nimble right now? |
19:55:48 | dom96 | gmpreussner: nope, it's in Nim's cfg file. |
19:56:10 | dom96 | It's what allows you to use installed Nimble packages even when compiling with 'nim c' |
19:56:13 | gmpreussner | can it be added as a global environment variable, so i don't have to have an absolute path in nim.cfg? |
19:56:37 | gmpreussner | i guess i could throw it into the global nim.cfg for now |
19:57:15 | Araq | pigmej: add 'nim' to your PATH |
19:57:35 | Araq | pigmej: put 'nimsuggest' into the dir where 'nim' is |
19:57:42 | dom96 | gmpreussner: nope |
19:57:52 | federico3 | how can I access "ftell"? |
19:58:10 | Araq | federico3: no, but we know everybody's life depends on this feature |
19:58:37 | pigmej | Araq: hmm, in fact they are both symlinked |
19:58:42 | federico3 | hum? |
19:59:10 | pigmej | Araq: where nim binary or where nim sources ? |
19:59:21 | federico3 | Araq: were you talking to me? |
19:59:28 | Araq | federico3: system.getFilePos |
19:59:29 | def- | federico3: getFilePos? |
20:00:28 | federico3 | thanks |
20:00:41 | Araq | federico3: yes, "can I list all procs that can act on a given type?" |
20:00:46 | pigmej | ok it seems in the same place where binary is located |
20:00:51 | Araq | I replied |
20:00:56 | Araq | to that question |
20:00:58 | * | endragor quit (Ping timeout: 256 seconds) |
20:01:19 | federico3 | ah - well, I find python's help() and dir() very useful to explore the language |
20:01:46 | pigmej | Araq: now I will need to know what to do with: skVar, skForVar, and so on |
20:01:47 | pigmej | what are those ? |
20:02:02 | pigmej | skVar => seems as a local variable, skForVar same but for for loop |
20:02:18 | Araq | well yes |
20:02:30 | pigmej | what more is there ? |
20:02:43 | * | HakanD joined #nim |
20:03:40 | gmpreussner | dom96: is --NimblePath the path to nimble, the pkgs directory, or to individual packages within pkgs? i can't get it to work :| |
20:03:52 | dom96 | the pkgs directory |
20:04:07 | dom96 | i.e. ~/.nimble/pkgs |
20:05:03 | Araq | pigmej: procs, converters, iterators, macros, templates, lets, types, consts, methods |
20:05:17 | pigmej | Araq: ok so mostly 'everything' ;-) |
20:05:18 | pigmej | cool |
20:05:41 | * | Arrrrr quit (Quit: Page closed) |
20:07:24 | renesac | Araq: the manual says "If the operator ends with ``=`` and its first character is none of |
20:07:24 | renesac | ``<``, ``>``, ``!``, ``=``, ``~``, ``?``, it is an *assignment operator* which |
20:07:24 | renesac | has the lowest precedence." |
20:07:33 | Araq | pigmej: skField. that might be all. |
20:07:39 | renesac | and right after it, there is the table |
20:07:56 | renesac | where the precedence level 0 (lowest) has the arrow like operators |
20:08:10 | renesac | with the assignment operators above that |
20:08:26 | Araq | yea yeah yeah, fix it. the table is correct |
20:08:27 | renesac | this is very confusing |
20:08:35 | Araq | the text needs an update |
20:08:53 | renesac | ok |
20:10:34 | renesac | and I think the paragraph about arrow operators should be moved to the precedence section |
20:10:41 | renesac | as it isn't right associative anymore |
20:10:48 | renesac | it only changes precedence |
20:10:54 | gmpreussner | Araq: i find --out rather useless. wouldn't something like --outPath be better? |
20:11:46 | gmpreussner | --out seems only useful if you want to rename the build product |
20:11:59 | gmpreussner | most of the time i'm just test compiling modules, however |
20:13:28 | Araq | gmpreussner: meh I guess I agree |
20:13:52 | Araq | pigmej: https://github.com/Araq/Nim/blob/devel/doc/idetools.txt#L201 |
20:14:00 | Araq | still somewhat up to date |
20:14:30 | repax | gmpreussner: And it's not --nimcache:dir/ that you're looking for? |
20:15:27 | pigmej | Araq: cool. |
20:15:39 | pigmej | i will be there later, I have to go off for hour or two |
20:15:55 | pigmej | but well nimsuggest seems fine |
20:17:23 | Araq | bbl |
20:20:25 | gmpreussner | repax: no, the nimcache is separate. i'm talking about the binaries that are created. they usually end up alongside their corresponding .nim modules |
20:22:01 | * | xcombelle quit (Ping timeout: 252 seconds) |
20:22:17 | gmpreussner | dom96: import packageName/module does not work for me in conjuction with --NimblePath. i can do "import module", and it finds the right one (by accident?), but i cannot qualify the package name |
20:22:35 | gmpreussner | Error: cannot find 'packageName/module' |
20:22:50 | dom96 | where did you point --nimblepath to? |
20:23:11 | gmpreussner | --NimblePath:"~/.nimble/pkgs" |
20:23:26 | gmpreussner | the files live in "~/.nimble/pkgs/package-0.1/" |
20:23:49 | gmpreussner | 0.1 is the version i specified in the .nimble file |
20:25:07 | dom96 | What does the directory structure in package-0.1 look like? |
20:25:39 | gmpreussner | it's flattened out. just a bunch of files, including module.nim |
20:25:58 | gmpreussner | there's also a .nimble and a .json. that's it |
20:26:01 | Jehan_ | Just import module, then. |
20:26:17 | Jehan_ | If you want to import foo.module or foo/module, you'll have to put it in a foo subdirectory. |
20:26:29 | dom96 | yeah, you need to put it in a packageName subdir |
20:27:05 | gmpreussner | oh ok, so packageName refers to a subdirectory WITHIN the package's srcDir |
20:27:13 | Jehan_ | Yeah. |
20:27:27 | Jehan_ | The Nimble package directories are simply added to the search path. |
20:27:36 | gmpreussner | understood |
20:28:13 | Jehan_ | Which is why I have a feature request that foo:module is resolved so that it looks for foo.nimble, then module in that directory. :) |
20:28:32 | gmpreussner | yeah, that might be better. packageName subdir seems rather ugly |
20:28:36 | Jehan_ | To avoid conflicts and stuff (plus, smarter lookup of local modules). |
20:29:04 | Jehan_ | Right now, you can (for example) override posix.nim by accident, which of course breaks everything. |
20:29:23 | gmpreussner | couldn't we just always infer the 'scope' from the package name? |
20:29:34 | dom96 | Jehan_: I like that idea. |
20:29:45 | gmpreussner | so if i have packageName.nimble, then "import packageName/module" should just work? |
20:29:58 | dom96 | Would require tons of code changes though. |
20:30:01 | gmpreussner | regardless of where srcDir is within packageName |
20:30:19 | Jehan_ | dom96: What idea? |
20:30:32 | dom96 | Jehan_: foo:module |
20:31:16 | Jehan_ | dom96: Yeah, not sure how much work it would be. |
20:31:17 | gmpreussner | for example, i have /packageName/packageName.nimble, /packageName/src/moduleName.nim, srcDir="src". then "import packageName:moduleName" should just work. |
20:31:43 | Jehan_ | But most importantly, module lookup should start with modules local to the current package. |
20:32:17 | Jehan_ | It only requires two packages to have a foo.nim module to get some really bad problems. |
20:32:42 | Jehan_ | Especially if they just happen to be slightly different versions that were copied at different times from the same source. |
20:34:31 | * | xcombelle joined #nim |
20:35:42 | dom96 | gmpreussner: Nimble c is now ready for action. |
20:36:05 | dom96 | only tested briefly so let me know if you find any bugs. |
20:36:11 | gmpreussner | Jehan_: yep, i have this problem right now. complex.nim in a nimble package colliding with the one in stdlib, and no way to disambiguate |
20:36:17 | gmpreussner | dom96: ok, will do right now |
20:36:52 | dom96 | gmpreussner: hrm, that's a serious problem :\ |
20:37:19 | Jehan_ | gmpreussner: Yeah, I had similar issues myself more than once. |
20:38:52 | Jehan_ | These days, I mostly stuff things in a subdirectory (but of course that doesn't help with packages). |
20:39:18 | Jehan_ | Also, if I were ever to use one of the same directories as the stlib, I might run into issues again. |
20:39:51 | Jehan_ | Anyhow, good night. :) |
20:39:59 | * | Jehan_ quit (Quit: Leaving) |
20:42:32 | * | dtscode is now known as dtscocain |
20:43:05 | federico3 | oh - there is no sound support |
20:44:01 | * | xcombelle quit (Ping timeout: 252 seconds) |
20:54:36 | gmpreussner | dom96: gonna pm you with some stuff |
20:57:00 | onionhammer | cool s |
20:57:02 | * | bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
20:57:04 | reactormonk | how can I set environment variables for startProcess? |
20:57:18 | onionhammer | so nimble is getting a path command arg? dom96 |
20:58:12 | dom96 | I suppose. It won't be convenient though. |
20:58:22 | onionhammer | why? |
20:58:24 | dom96 | It won't be what you asked for. |
20:58:48 | dom96 | It will be what you can already override in the nimble config file |
20:58:52 | dom96 | i.e. the nimble dir |
20:58:58 | onionhammer | nimble install name . |
20:59:24 | onionhammer | . meaning here |
20:59:33 | onionhammer | or nim l |
20:59:48 | onionhammer | oops, phone |
21:00:06 | fowl | araq would say that being able to override posix.nim or system.nim is a feature |
21:00:22 | fowl | :p |
21:07:02 | federico3 | uh oh, there is no syslog |
21:08:05 | * | gsingh93 quit (Ping timeout: 246 seconds) |
21:11:31 | * | vendethiel joined #nim |
21:11:40 | * | HakanD quit (Quit: Be back later ...) |
21:12:40 | * | vendethiel- quit (Ping timeout: 265 seconds) |
21:12:45 | * | HakanD joined #nim |
21:13:58 | * | Kingsquee joined #nim |
21:15:12 | * | bcinman joined #nim |
21:23:53 | BlaXpirit | repax, renesac, fowl, flaviu: I updated optionals module. https://github.com/Araq/Nim/pull/2515 |
21:24:10 | BlaXpirit | (tell me if you don't care about this so i don't bother you anymore) |
21:24:57 | * | a5i joined #nim |
21:25:03 | flaviu | I care, but my opinion on that implementation is unchanged. |
21:25:18 | BlaXpirit | flaviu, on what implementation |
21:25:29 | flaviu | Of the optionals module. |
21:25:37 | flaviu | Araq, mind taking a look at https://gist.github.com/flaviut/234c784502a81376dd37 ? |
21:25:42 | BlaXpirit | what in particular? |
21:25:56 | BlaXpirit | look at my last comment there |
21:26:43 | fowl | BlaXpirit, or should be a template |
21:26:53 | BlaXpirit | why? |
21:27:15 | fowl | to avoid executing the default param until its needed |
21:27:26 | flaviu | BlaXpirit: That's going in the opposite direction, IMO. |
21:27:28 | BlaXpirit | ah right, right |
21:27:48 | BlaXpirit | flaviu, i'm not sure you understand |
21:28:02 | BlaXpirit | the only bad direction i've taken here is the complexity of the module. |
21:28:08 | fowl | i dont understand why you need just[t] and none[t] |
21:28:18 | flaviu | BlaXpirit: I do understand, I just don't like it. |
21:28:41 | BlaXpirit | fowl, let me try to explain |
21:28:55 | BlaXpirit | there is that `?` operator which returns one of the two implementations, right? |
21:29:10 | BlaXpirit | the procedures `just` and `nothing` relied on it |
21:29:34 | BlaXpirit | which means that you cannot choose a different implementation of maybe for your type |
21:30:04 | flaviu | The module API should be no more than Option[T], `?=`, `[]`, `or`, rawGet, isSome, isNone. Everything else is unnecessary and should not exist. |
21:31:02 | BlaXpirit | oh but consider this too. a procedure that accepts a Maybe can also accept a zero-overhead Just |
21:31:11 | BlaXpirit | it is literally zero overhead |
21:32:17 | flaviu | Why would that be useful? |
21:32:26 | BlaXpirit | > it is literally zero overhead |
21:32:28 | * | dtscocain is now known as dtscode |
21:32:59 | flaviu | I understand its advantages, but why is it useful? |
21:33:42 | BlaXpirit | flaviu, let's drop the thought that 2 different implementations of Maybe are not useful. people thought they were. |
21:33:50 | * | banister joined #nim |
21:33:54 | * | banister quit (Max SendQ exceeded) |
21:34:19 | flaviu | BlaXpirit: I don't understand how Just and Nothing are useful. |
21:34:47 | BlaXpirit | they are required if you want to opt out of nil-based implementation |
21:35:34 | flaviu | But they are concrete types? Why even use an Just[T] when a T does the exact same thing. |
21:35:40 | BlaXpirit | they are required because you don't know what underlying implementation of Maybe you'll be using when you're instantiating them |
21:36:11 | BlaXpirit | later they can be converted to a concrete Maybe type |
21:36:28 | fowl | BlaXpirit, so Just[T] will be one of the maybe kinds? |
21:36:36 | BlaXpirit | well, yes, yes, it is |
21:36:40 | BlaXpirit | it's all in the docs |
21:36:56 | BlaXpirit | now, why is Just[T] needed: because there are converters from Just to Maybes |
21:37:57 | flaviu | Why not have just() return a Maybe directly? |
21:38:12 | BlaXpirit | i've covered that, although explanation was very poor |
21:38:19 | * | banister joined #nim |
21:38:23 | * | banister quit (Max SendQ exceeded) |
21:38:58 | BlaXpirit | you wouldn't be able to opt out of nil-based implementation |
21:39:11 | BlaXpirit | you don't know what underlying implementation of Maybe you'll be using when you're instantiating a Just |
21:40:11 | flaviu | I see. |
21:40:13 | fowl | flaviu, isNil(x) will never work, isNil returns bool |
21:40:39 | BlaXpirit | ? |
21:40:44 | flaviu | fowl: How do concepts work, I don't understand. |
21:41:12 | flaviu | I assumed that each expression is wrapped in a when compiles(...), but I don't really understand it. |
21:41:25 | BlaXpirit | how i'm trying to understand it: each part must compile, and, if it returns an expression, it must be boolean true |
21:41:51 | BlaXpirit | isNil(x) returns an expression which is not even boolean, so yeah |
21:42:05 | BlaXpirit | (but this is all conjecture) |
21:42:13 | BlaXpirit | wait, it is lol |
21:42:20 | flaviu | Aha! |
21:42:25 | flaviu | That was the problem, works now. |
21:42:33 | fowl | flaviu, if theres a return type isNil(x) is bool |
21:43:08 | fowl | i can't get the "x = nil" or anything like that ie "var y = x; y = nil" to work |
21:43:13 | flaviu | fowl: I can't parse your sentence, but "isNil(x) is bool" works fine. |
21:44:40 | fowl | flaviu, i meant if it returns something you need "is T" |
21:45:15 | flaviu | fowl: Ok, I understand! Thanks! |
21:46:26 | flaviu | https://gist.github.com/cf4b6f97d60a5c6db888 works great! |
21:46:38 | fowl | as to how they work, i believe the code inside the concept is semantically checked |
21:47:01 | fowl | i stumbled on the section in the compiler but it didnt make much sense |
21:48:43 | BlaXpirit | please write some of your comments under the pull request :p |
21:48:56 | * | EXetoC joined #nim |
21:49:25 | flaviu | BlaXpirit: Working on it, actually. |
21:49:33 | BlaXpirit | thx |
22:00:33 | flaviu | Error: type mismatch: got (typedesc[ref int], nil) *sigh* |
22:01:09 | BlaXpirit | you don't know how much fun i had today |
22:01:16 | BlaXpirit | both literally and sarcastically |
22:06:18 | * | banister joined #nim |
22:06:22 | * | banister quit (Max SendQ exceeded) |
22:08:34 | flaviu | Is there some way to say "Anything but this type"? |
22:08:58 | BlaXpirit | flaviu, maybe implement 2nd proc to capture that type |
22:10:57 | * | bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
22:11:22 | HakanD | gn |
22:11:25 | * | HakanD quit (Quit: Be back later ...) |
22:11:58 | * | renesac left #nim ("Once you know what it is you want to be true, instinct is a very useful device for enabling you to know that it is") |
22:12:22 | * | renesac joined #nim |
22:13:16 | flaviu | BlaXpirit: I don't understand what you mean. |
22:13:54 | * | renesac_ joined #nim |
22:14:22 | * | renesac_ left #nim (#nim) |
22:15:10 | * | bcinman joined #nim |
22:19:44 | * | pregressive joined #nim |
22:25:07 | * | brson quit (Quit: leaving) |
22:30:42 | * | HakanD joined #nim |
22:35:09 | * | HakanD quit (Ping timeout: 244 seconds) |
22:37:55 | flaviu | Ah, I see. |
22:45:34 | * | pregressive quit (Remote host closed the connection) |
22:46:56 | * | Matthias247 joined #nim |
22:47:00 | * | bcinman quit (Ping timeout: 256 seconds) |
22:49:43 | * | bcinman joined #nim |
23:08:41 | * | user7181 joined #nim |
23:12:51 | pigmej | sadly my elisp skills are not enough to make nimsuggest + emacs working (and I don't have probably enough time to improve my elisp now ;/). |
23:26:33 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:29:29 | * | bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
23:30:16 | * | bcinman joined #nim |
23:40:52 | * | bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
23:41:01 | reactormonk | pigmej, wanna team up? Got time in... 18h from now? |
23:42:06 | pigmej | reactormonk: if I will have something usefull then, ok ;) |
23:43:58 | * | BlaXpirit quit (Quit: Quit Konversation) |
23:46:02 | * | davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |