00:15:11 | * | kunev quit (Ping timeout: 256 seconds) |
00:15:54 | * | kunev joined #nim |
01:32:40 | * | smt quit (Read error: Connection reset by peer) |
01:32:46 | * | Trustable quit (Remote host closed the connection) |
01:33:01 | * | smt joined #nim |
01:34:09 | * | Vantage_ quit (Quit: Leaving) |
01:52:32 | * | cspar quit (Ping timeout: 256 seconds) |
01:53:03 | * | cspar joined #nim |
02:39:32 | * | vantage quit (Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org) |
03:07:07 | FromGitter | <Varriount> Yay, NimLime now displays errors in the status bar when you click on the error regions. |
03:31:46 | * | yglukhov joined #nim |
03:36:22 | * | yglukhov quit (Ping timeout: 264 seconds) |
03:41:17 | * | dddddd quit (Remote host closed the connection) |
04:35:01 | * | DarkArctic quit (Read error: Connection reset by peer) |
04:36:53 | * | Senketsu quit (Quit: WeeChat 2.1) |
05:13:25 | * | r3d9u11 joined #nim |
05:13:59 | * | miran joined #nim |
05:19:38 | * | ftsf joined #nim |
05:20:17 | ftsf | hi, getting an error in js: "Uncaught ReferenceError: colonanonymous__223267 is not defined", no error in C version |
05:20:26 | ftsf | is that a known problem? |
05:26:40 | Araq | no. |
05:28:36 | * | r3d9u11 quit (Remote host closed the connection) |
05:28:43 | ftsf | hmm worked around by changing the anon function to a named one |
05:29:16 | ftsf | in the middle of a gamejam now but i'll make a proper test case after it's over. |
05:31:08 | shashlick | so if #4057 and #4103 are duplicates, can we close one? |
05:36:06 | ftsf | https://gist.github.com/ftsf/40ba9cbb8aa6c58bcafa8c221751244e |
05:43:24 | * | Vantage joined #nim |
06:27:57 | * | yglukhov joined #nim |
06:38:09 | * | nsf joined #nim |
06:38:23 | * | Vantage quit (Quit: Leaving) |
06:46:14 | * | miran quit (Ping timeout: 268 seconds) |
06:58:33 | * | Lord_Nightmare quit (Excess Flood) |
06:59:08 | * | Lord_Nightmare joined #nim |
07:09:00 | * | xet7 joined #nim |
07:11:57 | * | rokups joined #nim |
07:14:04 | * | yglukhov quit (Remote host closed the connection) |
07:19:16 | * | vantage joined #nim |
07:31:16 | * | yglukhov joined #nim |
07:33:27 | * | nc-x joined #nim |
07:35:16 | nc-x | maybe https://github.com/nim-lang/Nim/issues/6975 is also duplicate of https://github.com/nim-lang/Nim/issues/4057 (though it does not uses --threads:on) |
07:35:27 | * | cspar quit (Ping timeout: 240 seconds) |
07:39:49 | * | nc-x quit (Ping timeout: 260 seconds) |
07:40:51 | * | cspar joined #nim |
07:46:09 | * | yglukhov quit (Remote host closed the connection) |
07:54:56 | * | yglukhov joined #nim |
08:01:33 | * | yglukhov quit (Remote host closed the connection) |
08:10:03 | * | cspar quit (Ping timeout: 256 seconds) |
08:24:41 | * | cspar joined #nim |
08:29:39 | * | ShalokShalom2 joined #nim |
08:29:43 | ShalokShalom2 | https://en.m.wikipedia.org/wiki/Nim_(programming_language) |
08:29:53 | ShalokShalom2 | Is Nimfix still in beta? |
08:30:59 | * | Senketsu joined #nim |
08:42:38 | FromGitter | <GULPF> I'm not sure it even exists anymore, it should probably be removed from the article |
08:46:29 | * | yglukhov joined #nim |
08:46:31 | FromGitter | <mratsim> spry-lang domain expired :/ (it’s a Rebol/smalltalk lang written in Nim and one of the best examples of Nim metaprogrmming …) |
08:48:56 | FromGitter | <alehander42> haha py2nim is on wikipedia, bizarre |
08:49:12 | * | yglukhov quit (Remote host closed the connection) |
08:49:25 | * | yglukhov joined #nim |
08:49:39 | FromGitter | <alehander42> yeah I remember spry-lang had some coverage on prog sites |
08:50:44 | FromGitter | <alehander42> I don't know why, but "new prog lang written in X" is 90% of the time receipt for upvotes and comments |
08:57:58 | * | xkapastel quit (Quit: Connection closed for inactivity) |
09:01:43 | * | rauss quit (Read error: Connection reset by peer) |
09:03:45 | * | rauss joined #nim |
09:06:12 | FromGitter | <alehander42> i am sure there was a reason, but why again can't I produce `await` from a macro :? |
09:06:31 | FromGitter | <alehander42> e.g. ⏎ ⏎ ```a = quote: ⏎ await f()``` [https://gitter.im/nim-lang/Nim?at=5adc50975d7286b43a54eaa5] |
09:06:55 | FromGitter | <alehander42> ah probably the async macro runs first |
09:07:01 | FromGitter | <alehander42> and then when my macro expands, it's too late? |
09:08:10 | FromGitter | <alehander42> ok workaround: i am not sure why, but even if it my macro returns "echo stuff; async call" |
09:08:22 | FromGitter | <alehander42> await macroInvocation() seems to work |
09:24:48 | ShalokShalom2 | well, somebody with deep awareness about Nim can update that outdated article |
09:43:07 | FromGitter | <arnetheduck> travis CI runtimes with vs without #7669: 35 min 58 sec vs 42 min 51 sec |
09:44:54 | * | ofelas quit (Quit: shutdown -h now) |
09:49:03 | FromGitter | <alehander42> I am still not convinced: why not just make `--deadCodeElim:on` the default, what is the harm in having the switch? |
09:49:56 | * | BitPuffin joined #nim |
09:50:17 | FromGitter | <arnetheduck> what's the use of having the switch? every switch means more code to maintain - code that the test suite rarely passes over |
09:51:18 | FromGitter | <alehander42> well at the very least, having that switch makes it very easy to compare what does dead code elimination actually remove in your source code |
09:51:38 | FromGitter | <arnetheduck> so does the compiler warning about unused code |
09:54:15 | FromGitter | <mratsim> I think remove options from Nim is good, the language has so much features that it probably feels ovewhelming if introduced the wrong way to non programming lang theorists (you can do X, Y, Z, and the coffee too) |
09:56:19 | FromGitter | <alehander42> I agree, just I didn't imagine this switch to be such a feature, but I don't know how much code is related to it |
09:56:21 | dom96 | alehander42: You can generate 'yield' |
09:56:45 | * | cspar quit (Ping timeout: 264 seconds) |
09:58:33 | FromGitter | <arnetheduck> and how does it make it simple? can't diff at the `c` files anyway because DCE changes the traversal order therefore code ordering, and since a lot of people say nim is not a transpiler, you're not supposed to look in there anyway :) |
09:58:49 | * | cspar joined #nim |
10:00:20 | FromGitter | <alehander42> well you can still find the otherwise ungenerated functions quite easily |
10:00:25 | dom96 | if dead code elimination has a bug, there will at least be a way to disable it |
10:00:32 | FromGitter | <alehander42> yeah, that too |
10:00:54 | FromGitter | <alehander42> I agree it would be useful in very few cases, but I still it could be there at least for compiler developer purposes |
10:01:15 | FromGitter | <alehander42> but again that's IMHO, not too familiar with all compiler internals |
10:02:17 | FromGitter | <alehander42> btw @mratsim do you have any examples of features of Nim that can be removed |
10:03:00 | FromGitter | <mratsim> GC ? :D |
10:04:16 | FromGitter | <arnetheduck> er.. the existence of an option makes it more likely that it's bugged - less code = less bugs, it's that simple.. by that argument, you should intro an option for every fixed issue in the tracker, in case it breaks |
10:04:17 | FromGitter | <alehander42> you do need optional gc :D |
10:04:21 | FromGitter | <mratsim> no feature jumps at me, I always have some use for features, especially the hidden ones at the bottom of the manual |
10:05:24 | FromGitter | <alehander42> @arnetheduck that's a strawman, dead code elimination is an important component of a compiler, not just a random fix, it makes some sense to have a flag for it |
10:06:11 | FromGitter | <alehander42> it's simply a cost/benefit thing: if the code for enabling such a flag is indeed too complicated, drop it |
10:06:40 | FromGitter | <alehander42> but if there are enough valid usecases for it, don't |
10:07:12 | dom96 | Dead code elimination has been off by default for a long time. To suddenly make it default *and* remove the option to disable it is a bit reckless. |
10:07:24 | dom96 | At least keep the flag for a couple of versions as a deprecation path |
10:07:29 | FromGitter | <arnetheduck> @alehander42 not really.. it's a useless leftover from when compilers did that kind of stuff because noone imagined a better way.. |
10:07:59 | dom96 | Also I can't imagine this flag adding that much more complexity |
10:08:13 | dom96 | if deadCodeElim: performCodeElim() vs. performCodeElim() |
10:10:56 | FromGitter | <arnetheduck> @dom96 er, you're being ironic about complexity, right? |
10:11:00 | FromGitter | <alehander42> @arnetheduck ok, so how much code does it cost indeed? is the compiler full with many `when defined(deadCodeElim) .. else` stuff |
10:11:03 | * | leorize quit (Quit: WeeChat 2.1) |
10:11:49 | FromGitter | <alehander42> I would imagine you should have one place where you write " if this is not unused or deadCodeElim is off, include it in the final tree" |
10:12:05 | FromGitter | <alehander42> I don't get why would that add to the complexity of a compiler |
10:12:29 | FromGitter | <alehander42> if you already have "detect if this is unused" logic |
10:13:50 | dom96 | yeah, I'm not being ironic, that's my thinking too |
10:13:56 | FromGitter | <arnetheduck> every feature choice adds complexity... in lines of code, in open bugs, in cognitive effort needed to decide between them.. look at it this way, the js backend (and nlvm) never had that feature to begin with (it's a dead option) - you would *never ever* request it as a feature if it didn't exist already - you wouldn't be able to come up with a sane use case |
10:15:59 | FromGitter | <arnetheduck> in this case, it's easy to see how many lines of code at least: a little more than #7669 - but they're *all useless* - the best reason you've come up with so far is that they exist in case there's a bug in them |
10:19:33 | FromGitter | <alehander42> yes, I looked at the PR: it removes two functions and changes two more conditions |
10:19:49 | FromGitter | <alehander42> everything else is processing switch / docs about switch / formatting |
10:20:44 | FromGitter | <alehander42> and removing `{.deadCodeElim: on.}` which is a completely orthogonal issue related to making deadCodeElim on by default |
10:20:48 | * | nsf quit (Quit: WeeChat 2.0.1) |
10:22:31 | FromGitter | <arnetheduck> @alehander42 yeah, which is why I find it quite hard to believe that you're arguing for something that adds 25% compile time and is useless at the same time :) why on earth should devs have to think about adding `{.deadCodeElim: on.}`? |
10:22:46 | FromGitter | <alehander42> but I am not arguing about that :D |
10:22:57 | FromGitter | <alehander42> you see, your idea is 2 ideas: |
10:23:03 | FromGitter | <alehander42> making dce on by default |
10:23:06 | FromGitter | <alehander42> and removing the switch |
10:23:10 | FromGitter | <alehander42> I agree with the first part |
10:23:35 | FromGitter | <alehander42> and agree with @dom96 for the second: at least for some time, the switch should remain there |
10:24:11 | FromGitter | <alehander42> this is what happens with all removed features in nim anyway: they go through deprecation period |
10:24:30 | FromGitter | <arnetheduck> no, it's just one idea - DCE is not a feature in 2018 - it's just the way compilers should work.. I'd even remove it from the promo material, it's embarrassing that it's there :) |
10:25:35 | FromGitter | <arnetheduck> the idea is to remove the option, the rest is a coincidental side effect :) |
10:26:04 | FromGitter | <alehander42> no, the second idea depends on realizing the first idea |
10:26:05 | FromGitter | <alehander42> :D |
10:29:37 | * | r3d9u11 joined #nim |
10:30:27 | FromGitter | <alehander42> the middleground is obviously the right decision: you get :on by default, the compile times are improved, people don't need to add that manually, and if they add `:off` they know this is going to disappear as an option soon ⏎ ⏎ and if really there is absolutely no usecase for it, nobody will complain, and the option would be totally removed |
10:30:40 | FromGitter | <alehander42> `:on` * |
10:35:55 | FromGitter | <arnetheduck> again, the branch is not about improving compile times, it's about removing cruft from the compiler that doesn't serve any purpose - what you're proposing is not a middle ground, it's picking the smallest cherry among many large cherries - less code, less risk of bugs, less cognitive effort for developers, fewer "put-this-magic-string-to-make-it-compile-faster-with-no-downside" |
10:37:44 | FromGitter | <alehander42> maybe I can't express myself correctly |
10:38:18 | FromGitter | <arnetheduck> if you're worried the test suite passing is not enough to verify the sanity of the code, sure, feel free to provide a patch to flip the default.. feels like a waste of time though - for example, since there's a whole bunch of `{dce:off`} in the code, the feature is not completely untested either |
10:38:24 | FromGitter | <alehander42> what I propose fulfills "less risk of bugs", "less cognitive effort..", "fewer put-this-magic" |
10:38:41 | FromGitter | <alehander42> and it will fullfill the "less code" if it's indeed free of bugs in a short time |
10:40:55 | FromGitter | <arnetheduck> isn't that what `devel` is for? to flush out unexpected bugs.. or are you proposing to keep the code over a release? |
10:41:02 | FromGitter | <alehander42> the only thing different from your proposal is that somewhere there will be this *deprecated* option for a little longer: the same thing that happens with almost any other default/feature being removed |
10:42:20 | vantage | sometimes you might not want dead code elimination, like when compiling to a library |
10:43:01 | FromGitter | <mratsim> exportc proc are not eliminated iirc |
10:43:17 | vantage | ok nvm then |
10:44:40 | FromGitter | <arnetheduck> I still don't get it - you would never do that for any other feature addition or fix - ie add or keep a broken branch of code just to have the option to disable it.. the branch keeps backwards compatibility by still parsing it both on command line and in pragma |
10:45:33 | FromGitter | <alehander42> which branch is broken? |
10:45:47 | FromGitter | <arnetheduck> dce is not new, it gets used all the time even when compiling without it on the command line, it's the only mode for the JS backend and passes the test suite |
10:46:17 | FromGitter | <alehander42> all I am saying is that you can't possibly know every usecase people might have for a feature, so keeping the option to turn it `:off` for a little while can't hurt: after such a period you remove it completely |
10:46:27 | FromGitter | <alehander42> it's the basic concept of "deprecation period" |
10:46:30 | FromGitter | <arnetheduck> imagine you're fixing a random bug - there's some code that's broken - you don't add an option and a branch to be able to disable the fix |
10:47:36 | FromGitter | <arnetheduck> just like you can't know if people rely on a bug - they might have written a workaround |
10:48:14 | FromGitter | <alehander42> the lack of an optimization is not a bug |
10:48:40 | FromGitter | <alehander42> you might like to call it that, but using the same logic you can forbid disabling any of the other optimizations |
10:48:56 | vantage | arne you could always just change nim.cfg? |
10:50:09 | vantage | i think make dead code elim automatic would have more losses than gais |
10:50:19 | vantage | gains* |
10:52:21 | FromGitter | <alehander42> even if you see it as a bug, that fact is that it has been a "feature" until now, so people have the right to rely on it for some weird purpose and have the right of a deprecation period for that |
10:52:50 | * | Vantage_ joined #nim |
10:52:57 | FromGitter | <arnetheduck> vantage, what would those gains be? |
10:53:43 | vantage | nim goes in c code comes out. dce removes that one to one relationship |
10:54:01 | vantage | making it more difficult to test the nim compiler |
10:55:01 | vantage | so you might add dce to always be on , but then your going to need to switch it off again |
10:55:38 | vantage | and that would need a large refactoring i think |
10:56:05 | vantage | that might not be an issue but i imagine it could be. |
10:56:50 | vantage | at the end of the day "premature optimization is evil" i think thats why dce is on by default |
10:56:59 | FromGitter | <arnetheduck> if you're digging around in the c files, the only thing that changes is the order in which things are added it, and this order already does not correspond to what's in the nim file |
10:57:41 | * | vantage quit (Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org) |
10:58:00 | Vantage_ | You could still have your line traces |
10:58:35 | dom96 | arnetheduck: I'm surprised you're so against keeping this flag, is it because you fear you will have to support it in nlvm? |
10:58:55 | FromGitter | <alehander42> yeah, one can argue that in a visual debugger you might want to be able to see what kind of code would be generated for an unused function |
10:59:23 | Vantage_ | btw arnetheduck, I've seen you vlvm project, its interesting, I wish there was cling repl for it |
10:59:25 | FromGitter | <alehander42> I am not saying I agree with that, just giving an example of a usecase you can't anticipate |
10:59:32 | Vantage_ | nlvm* |
11:00:26 | Vantage_ | I'm just wondering why its there to begin with |
11:01:46 | Vantage_ | at the end of the day I think the total number of people that actually use dce is small. but probably most of them are those with finished products that are released. Does Dead code make debugging slower? whats so bad about it? |
11:01:48 | FromGitter | <arnetheduck> no, `nlvm` doesn't support that flag and won't - no one would ask for it, just like no one noticed it was missing for js :) |
11:01:52 | FromGitter | <mratsim> @Vantage "Premature optimization is evil” is often cited without the surrounding context: "We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%.”. Most of the code I write is performance critical and I always optimize down to the Assembly generatted for Nim code. |
11:02:15 | FromGitter | <alehander42> @mratsim nobody is arguing against making the option :on by default |
11:02:22 | FromGitter | <alehander42> `:on` , oh gitter .... |
11:02:46 | Vantage_ | Well there's the saying, blind optimization is just stupid. |
11:03:27 | FromGitter | <mratsim> blind trust in sayings is stupid too ;) |
11:03:40 | FromGitter | <alehander42> no @Vantage_ that's not the case here, dce is important, my point is more general about the way to phase off a feature |
11:03:55 | Vantage_ | I think that blind optimization is a stupid idea, it makes logical sense |
11:03:58 | FromGitter | <mratsim> I agree that it should follow the normal deprecation cycle. |
11:04:00 | FromGitter | <arnetheduck> Vantage, dce is neither a feature nor an optimization - it's just a way to traverse the AST - one is lazy, the other one eager.. there are already other ways in nim to make the traversal eager |
11:04:53 | Vantage_ | what about... dum dum dum... a repl inside your program... you would need dead code then or no? |
11:05:18 | FromGitter | <mratsim> anyway, I think we are bikeshedding here, this is such a small feature with 0 impact, I’d rather talk about say Exceptions. |
11:05:24 | FromGitter | <arnetheduck> for it to be reachable from within your program, you'd have to export it |
11:06:16 | FromGitter | <alehander42> @mratsim btw did you have the chance to test with quicktest, or did you find a better way to randomize tests |
11:06:21 | FromGitter | <arnetheduck> haha, @mratsim of course we're bikeshedding - it's sunday evening and no pressure to do useful things :) |
11:06:51 | FromGitter | <mratsim> @Vantage_ All nim code currently should be compilable with or without dead-code elim. -d:release implies dead code slim, a code working on non-release but crashing on release is a bug. |
11:07:31 | FromGitter | <mratsim> @alehander42 didn’t try yet, I was busy squeezing the last drops of performance of mpint yesterday. Got it within 10% of ttmath without any assembly :D |
11:07:43 | Vantage_ | mratsim what about Exceptions? |
11:07:56 | FromGitter | <alehander42> @mratsim haha awesome |
11:08:08 | FromGitter | <mratsim> @arnetheduck wants to remove exceptions too :thinking_face: |
11:08:18 | Vantage_ | nooo! |
11:08:24 | Vantage_ | why :'( |
11:08:57 | FromGitter | <mratsim> He said that they were dinosaurs leftover from a mystical amber originating from the Jurassic era (or something like that ;) ) |
11:09:16 | FromGitter | <arnetheduck> so if we really wanna close this topic, maybe someone in favor of adding a deprecation period would be so kind as to create that branch that flips the switch? then my branch can stay purely useful and be merged whenever the deprecation gods have had their fill :) |
11:09:41 | FromGitter | <alehander42> the tools which would autotranslate Nim1 to Nim2 would make 2to3 look like a child toy :D |
11:10:05 | FromGitter | <mratsim> I think Go1to2 will give us a run for our money |
11:10:16 | FromGitter | <mratsim> they don’t have macros. |
11:11:08 | FromGitter | <alehander42> oh I don't think macros will be enough :D |
11:11:44 | * | r3d9u11 quit (Ping timeout: 260 seconds) |
11:11:47 | FromGitter | <mratsim> you can put the old compiler AST parsing as a macro and to AST to AST transformation? |
11:11:52 | FromGitter | <alehander42> ok, I'll add a flip branch |
11:12:46 | FromGitter | <arnetheduck> @alehander42 check with Araq first maybe, he seemed keen on getting rid of it altogether as well which is why I did the branch |
11:12:53 | FromGitter | <alehander42> ok |
11:13:48 | FromGitter | <alehander42> well that's what you would do anyway: you'll translate the old AST to newer one |
11:14:32 | FromGitter | <alehander42> which can reuse macro's helpers, but I don't think you can qualify it as macro itself :D (or I am missing something) |
11:15:29 | FromGitter | <alehander42> anyway converting exception-based code to error-based code will have a lot of gotchas :D |
11:15:34 | Vantage_ | arnetheduck, araq should know more about the compiler than anyone, if he said it was good then why waste time arguing? |
11:16:05 | Vantage_ | alehander, counts as a transpiler? |
11:16:29 | FromGitter | <alehander42> oh you used the forbidden word :D |
11:16:34 | Vantage_ | is there an article or a forum post I'm missing here? |
11:16:53 | Vantage_ | sometimes I wish nim copy-pasted for me |
11:17:21 | FromGitter | <alehander42> about what? |
11:17:46 | FromGitter | <arnetheduck> @alehander42 apparently that's impossible or at least infeasible - ie translate exceptions to non-exceptions without "special" support - special meaning that `c` is not enough |
11:19:10 | dom96 | Araq would like to remove exceptions now, but I won't let him :P |
11:19:12 | FromGitter | <arnetheduck> bjarne & co tried that with cfront and gave up, per comments on https://stackoverflow.com/a/15731985 |
11:20:05 | Vantage_ | are errors and exceptions the same thing? |
11:20:37 | FromGitter | <matrixbot> `ehmry` I'm calling a private procedure from a private template in a module and I get `attempting to call undeclared routine`, how is this possible? |
11:20:38 | FromGitter | <arnetheduck> Vantage, to tease out principles and background, and possibly to come up with a practical use case |
11:21:39 | FromGitter | <arnetheduck> bikeshedding is great that way.. you don't learn anything about the subject at hand, but everything about what drives people and where they come from |
11:21:58 | Vantage_ | arne, I think the reason it was still there was because "code dust" |
11:22:19 | * | PMunch joined #nim |
11:22:28 | Vantage_ | "bikeshedding" is a new term for me |
11:22:42 | FromGitter | <arnetheduck> "code dust" is new to me :) |
11:23:04 | PMunch | bikeshedding is such a nice term |
11:23:24 | Vantage_ | Its old and had a use but no it doesn't I made the term up |
11:25:31 | FromGitter | <arnetheduck> so what does it mean? maybe we can be trend-setters here :) |
11:25:41 | FromGitter | <mratsim> here you go: https://en.wikipedia.org/wiki/Law_of_triviality |
11:26:28 | Vantage_ | mratsim, https://phinze.github.io/2014/05/24/useful-tech-terms-part-1.html |
11:27:08 | FromGitter | <matrixbot> `ehmry` vantage_: the source document for bikeshedding is worth reading |
11:27:15 | Yardanico | ehmry: pro tip - you can use matrix-irc bridge directly (without gitter) |
11:27:15 | FromGitter | <mratsim> @ehmry, template are inserted at the call point, so if the private proc is not visible at that position it cannot be called. |
11:27:28 | FromGitter | <matrixbot> `ehmry` I don't know what its called, parkinsons law maybe |
11:27:32 | FromGitter | <alehander42> @arnetheduck yeah probably you wouldn't be able to do in general |
11:27:40 | Yardanico | ehmry: https://gist.github.com/fstab/ce805d3001600ac147b79d413668770d |
11:27:43 | FromGitter | <mratsim> yes Parkinson law of triviality == bikeshedding |
11:28:05 | FromGitter | <alehander42> but the problem is there is no easy way to make so big backward-incompatible changes to a language |
11:28:31 | FromGitter | <alehander42> the cost is too great for such a benefit :D |
11:28:40 | FromGitter | <matrixbot> `ehmry` yardanico: the matrix IRC bridge sucks, thats why I use the gitter. its probably also written in JS though |
11:28:50 | FromGitter | <arnetheduck> @mratsim getting rid of exceptions felt useful enough to warrant a forum post and not just a few lines in a chat :) |
11:29:14 | FromGitter | <alehander42> the same thing as gc: nogc mode working well and compatible with most of stdlib etc would be amazing |
11:29:20 | FromGitter | <mratsim> I think error codes are the dinosaurs :P |
11:29:32 | FromGitter | <matrixbot> `ehmry` mamy: but the template should be hidden inside a procedure that is not exported? |
11:29:42 | FromGitter | <mratsim> gc: no-gc should work at one point with the —newruntime |
11:29:43 | FromGitter | <alehander42> but still I wouldn't want the mental burden of lifetimes/borrows for a lot of stuff |
11:29:55 | FromGitter | <matrixbot> `ehmry` er, the procedure is exported that calls the template, not the template |
11:29:57 | * | ShalokShalom2 quit (Ping timeout: 240 seconds) |
11:30:09 | Vantage_ | alehander, I don't know how to "safely" write code with NOGC |
11:30:18 | FromGitter | <mratsim> one other thing, template calls must not use the method call syntax |
11:30:30 | * | ehmry joined #nim |
11:30:32 | FromGitter | <mratsim> you have to do yourtemplate(foo) |
11:30:38 | FromGitter | <alehander42> that's one of the reasons I use Nim after all: a huge amount of code doesn't need super-optimized memory handling and performs almost the same way |
11:30:46 | Vantage_ | is valgrind working with nim. |
11:31:00 | FromGitter | <mratsim> no it doesn’t know about Nim allocator |
11:31:11 | Vantage_ | because often in games, memory-leaks are inevitable |
11:31:20 | FromGitter | <arnetheduck> I'm not proposing error codes - I'm all for results however.. only sample code in `rust` is full of `unwrap`, for production code, there are better options and thanks to nim macros you could make it even more transparent |
11:31:59 | FromGitter | <mratsim> Ah, good :), if we can have something ergonomic, that is not error code without the issues of Exceptions that would be awesome |
11:32:21 | FromGitter | <alehander42> @arnetheduck don't they have `?` now |
11:32:46 | Vantage_ | but I'd still like to treat Errors like objects :( (Might just be my python speaking) |
11:33:34 | FromGitter | <mratsim> @Vantage_ Nim GC shouldn’t leak, compared to C++. Especially if you don’t introduce reference cycles, it wouldn’t have to add the slow cycle detector (mark and sweep like in Java) |
11:34:42 | Vantage_ | mratsim, sometimes you use external libraries. The way in which you use it might lead to leaks |
11:34:46 | FromGitter | <mratsim> I would like a memory pool module in the stdlib though. |
11:35:08 | FromGitter | <mratsim> or being able to mix memory regions with normal GC data structures |
11:35:13 | FromGitter | <arnetheduck> @alehander42 yeah, that's used for propagating errors up a call stack, and `Nim` could have a `try` equivalent as a block implemented using a macro that would do the same, but be explicit about two things: errors being part of the api of functions, and errors being a little visible in code that calls that API even if it's not handling it |
11:35:38 | FromGitter | <alehander42> I agree a code formatter would be nice, still I hate the gofmt "one convention for every possible project" thing, other langs do great with comfigurable formatters(ruby, python etc) |
11:35:55 | Vantage_ | I think to learn nim first you have to learn how the GC works, then learn all the stuff nim automates |
11:36:33 | * | cspar quit (Ping timeout: 248 seconds) |
11:36:48 | FromGitter | <mratsim> I think it really depends from where you’re coming from. If you come from Python, you can be happy without think about that. If you come from C/C++ well I suppose you are tremendously curious about that. |
11:37:04 | FromGitter | <mratsim> and also what you want to do. |
11:37:42 | FromGitter | <alehander42> @arnetheduck yeah, that's what I would imagine, actually I remember developing a similar syntax for `mylanguage compiling to go` before finding out other languages already do that |
11:37:43 | FromGitter | <mratsim> Also coming from Python the first thing you have to earn are types :P |
11:38:03 | FromGitter | <mratsim> Ok, I’ll try to do something useful now. |
11:38:06 | FromGitter | <mratsim> brb |
11:38:15 | FromGitter | <arnetheduck> @alehander42 so nim without exceptions but with results would be even more ergonomic than rust with `?`, but still have the advantages |
11:38:18 | FromGitter | <alehander42> I also had a weird `escalate <stuff>` keyword that you could use to explicitly bubble some exceptions |
11:38:25 | FromGitter | <alehander42> errors* |
11:39:22 | FromGitter | <arnetheduck> Vantage, https://forum.nim-lang.org/t/3772 |
11:40:58 | FromGitter | <alehander42> yeah, basically your thing is something like ⏎ ⏎ ```try: ⏎ a = f(2).g?(4) ⏎ b = a + 2 ⏎ except: ⏎ # do stuff with g's error``` ⏎ ⏎ ? [https://gitter.im/nim-lang/Nim?at=5adc74ca270d7d3708f2753f] |
11:41:12 | FromGitter | <mratsim> I think Rust just copy pasted Haskell for their error management: https://wiki.haskell.org/Handling_errors_in_Haskell. But this is much more elegant in Haskell due to the pattern matching and `>>=` (bind) operator. |
11:43:05 | FromGitter | <arnetheduck> yeah, there are those that insist that `result` and `either` are monads.. haskell people are so easy to identify from afar :) |
11:48:46 | Vantage_ | mratsim, GC refs ptrs still affect code, so you still need to learn about it. |
12:00:01 | * | SenasOzys quit (Ping timeout: 248 seconds) |
12:07:27 | * | arecaceae quit (Remote host closed the connection) |
12:07:50 | * | arecaceae joined #nim |
12:15:02 | * | SenasOzys joined #nim |
12:16:01 | * | Lord_Nightmare quit (Ping timeout: 248 seconds) |
12:18:38 | * | dddddd_ joined #nim |
12:19:40 | * | yglukhov quit (Remote host closed the connection) |
12:20:29 | * | yglukhov joined #nim |
12:20:36 | * | dddddd_ is now known as dddddd |
12:21:03 | * | Lord_Nightmare joined #nim |
12:22:57 | * | Vantage_ is now known as CodeDoes |
12:23:35 | * | CodeDoes is now known as vantage |
12:24:58 | * | yglukhov quit (Ping timeout: 264 seconds) |
12:35:07 | * | nsf joined #nim |
12:37:21 | * | simonsolnes quit (Ping timeout: 248 seconds) |
12:40:13 | * | jjido joined #nim |
12:52:55 | FromGitter | <tim-st> how can I update my nim repo fork to lastest dev version? I have github desktop app |
12:56:11 | vantage | git pull |
12:56:25 | vantage | git checkout origin/devel |
12:56:28 | vantage | I THINK |
12:56:59 | FromGitter | <tim-st> not possible from gui version? |
12:57:09 | vantage | Sure |
12:57:22 | FromGitter | <ephja> that would make it a terrible application :p |
12:57:36 | vantage | open the git-gui |
12:57:54 | FromGitter | <tim-st> I have |
12:57:56 | vantage | remote->fetch from->origin |
12:58:54 | FromGitter | <tim-st> there is no button `remote` |
12:58:56 | vantage | branch->checkout |
12:59:04 | * | miran joined #nim |
12:59:12 | vantage | you have to be inside the repo when you open the git-gui |
12:59:24 | vantage | git for windows right? |
13:00:13 | FromGitter | <tim-st> "Github Desktop" v1.1.0 |
13:00:24 | vantage | lol can't help |
13:00:30 | FromGitter | <tim-st> ok, thx |
13:00:34 | vantage | I have only the git for windows |
13:02:47 | * | cheeseburger joined #nim |
13:04:02 | cheeseburger | Hey #nim is it possible to have an optional proc as an argument? Using `customProc: proc=nil` doesn't seem to work |
13:04:26 | FromGitter | <zacharycarter> I don't think you can assign nil to a proc |
13:04:32 | cheeseburger | In the lib I'm writing I want users to be able to optionally pass a different filter proc |
13:04:47 | FromGitter | <tim-st> maybe you should default to an no operation proc |
13:04:47 | FromGitter | <zacharycarter> probably provide an overload |
13:05:17 | FromGitter | <zacharycarter> or that |
13:05:23 | FromGitter | <zacharycarter> just a proc that discards the result |
13:05:31 | FromGitter | <zacharycarter> so |
13:05:39 | FromGitter | <tim-st> Or you can use static declartion an then with `when` you can create this optional param |
13:05:39 | FromGitter | <zacharycarter> customProc: proc() = discard; |
13:05:41 | cheeseburger | Thanks @zacharycarter |
13:05:46 | FromGitter | <zacharycarter> well it was Tim's idea :P |
13:05:47 | FromGitter | <zacharycarter> but np |
13:05:54 | Araq | vantage: valgrind does work with nim |
13:06:06 | FromGitter | <zacharycarter> but only for windows / linux? |
13:06:11 | Araq | 'koch' knows how to do it, I have forgotten, need to document it |
13:06:23 | FromGitter | <zacharycarter> osx valgrind support is stinky |
13:06:27 | cheeseburger | Thanks @zacharycarter and @tim-st, I'll try that! :) |
13:06:44 | Araq | cheeseburger: customProc: proc() = nil |
13:07:09 | vantage | cheeseburger, make a proc that raises an error if its called |
13:07:29 | FromGitter | <tim-st> btw @Araq proc param=-1 still doesnt work :( only param = -1 |
13:07:45 | Araq | why would it? |
13:08:02 | vantage | thanks Araq |
13:08:02 | Araq | =- is an operator on its own. |
13:08:37 | FromGitter | <ephja> the standard DOM API is so tedious. gotta add some abstractions |
13:09:01 | Araq | ephja: use karax? |
13:09:02 | FromGitter | <ephja> the JS DOM API that is |
13:09:09 | FromGitter | <ephja> yeah maybe |
13:11:52 | FromGitter | <tim-st> @Araq because it shouldnt be possible to use this operator inside a proc param declaration |
13:12:12 | FromGitter | <tim-st> and then the only logical thing is = -1 |
13:12:29 | Araq | that's not how Nim or most programming languages work |
13:12:55 | Araq | tokens are not retroactively split into tokens that match "the only logical thing" |
13:13:17 | Araq | it's a layered design, tokenization, parsing, semantic checking |
13:13:33 | FromGitter | <tim-st> Python: `def test(a=-1): print a` |
13:13:43 | Araq | you cannot divide by a pointer deref in C: a/*b |
13:13:54 | Araq | because /* starts a comment. |
13:14:40 | FromGitter | <ephja> I guess you can't really parse the JS API that well using official documents |
13:14:58 | miran | wow, we're under 1300 open issues! when did this happen? :) |
13:15:55 | cheeseburger | I've tried to create a minimal example of what I want to do, if anyone can take a look it's much appreciated: https://ghostbin.com/paste/amgns |
13:16:06 | cheeseburger | (Is there a better place to paste code?) |
13:16:41 | FromGitter | <ephja> I think the IDL spec is interleaved with html tables and other crap |
13:19:54 | Araq | tim-st: Python works the same way, it's just more inconsistent in its operators, =- is not a single token, but -= is. |
13:20:34 | FromGitter | <tim-st> ok thanks, just thought it would be more developer friendly |
13:20:39 | Araq | every tool renders it as 'def test(a = -1)' anyway, the spaces won't kill you. |
13:20:58 | FromGitter | <tim-st> wasnt sure anymore because nimpretty isnt integrated yet |
13:21:11 | FromGitter | <tim-st> and I didnt used pycharm for months |
13:21:16 | Araq | comments are nasty beasts :-) |
13:25:41 | federico3 | any way to import procs that have no asterisk? |
13:33:45 | * | simonsolnes joined #nim |
13:34:01 | FromGitter | <ephja> https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API that might be the best way to generate complete bindings |
13:36:07 | Araq | federico3: include instead of import? :-) |
13:36:32 | * | user1101 joined #nim |
13:37:20 | FromGitter | <arnetheduck> wooohoo, thanks Araq, there's another feature to kill, `include`! |
13:38:00 | Araq | you can't be serious. |
13:40:11 | FromGitter | <ephja> 🐤 |
13:41:36 | FromGitter | <arnetheduck> totally, that's a nasty beast if there ever was one... incomplete and order-dependent snippets of code? |
13:41:53 | * | yglukhov joined #nim |
13:45:12 | Araq | sure let's write parseStmt(staticRead"file.nim") instead |
13:45:47 | Araq | oh I know, these should be removed too then because they can emulate 'include' |
13:46:48 | FromGitter | <arnetheduck> well, at least it's complex enough that no one in their right mind will use it, except as a last possible resort.. bad ideas should be hard |
13:48:52 | Araq | and it's bad because you say so, got it. :P |
13:49:01 | FromGitter | <arnetheduck> of coz ;) |
13:49:18 | Araq | I find it tremendously useful and it doesn't add much complexity to the compiler. |
13:49:50 | Araq | you have my sympathy about removing exceptions though. |
13:49:55 | FromGitter | <arnetheduck> you know, sometimes there's a reason certain things disappear from newer languages that existed in old ones ;) |
13:50:36 | Araq | like C# had to add partial classes for code generators. |
13:50:40 | Araq | ;-) |
13:51:48 | Araq | "old" is not a criterion for anything. |
13:52:10 | FromGitter | <arnetheduck> well, looking at the compiler cgen, that's not how includes are used.. |
13:52:54 | Araq | yeah, they are mostly a workaround for cyclic module dependencies |
13:52:58 | Araq | in the compiler. |
13:53:13 | Araq | in the stdlib they are used to split interfaces and implementation |
13:53:28 | Araq | and in fact should be used *more*, not *less* in the stdlib. |
13:54:11 | FromGitter | <arnetheduck> oh dear. more forward declarations? I was just about to add that to the list 🔥 |
13:54:27 | * | yglukhov quit (Remote host closed the connection) |
13:54:33 | Araq | forward decls are one thing, recursive module dependencies another. |
13:55:18 | FromGitter | <arnetheduck> recursive module deps, that's a code smell if there ever was one 💩 and repeating the same thing twice? even vim does code folding these days.. |
13:55:48 | Araq | required code folding is a code smell :P |
13:56:02 | Araq | I never use it, it always folds what I'm interested in. |
13:56:22 | Araq | though that can probably be solved with smarter editors |
13:58:04 | vantage | how do I include a folder in dll searching? |
13:58:33 | vantage | `--passL:"/LIBPATH:~/libs"` doesn't work for me |
13:58:45 | FromGitter | <zacharycarter> should just be |
13:58:54 | FromGitter | <zacharycarter> --passL: "~/libs" I think |
13:58:59 | FromGitter | <zacharycarter> you don't need LIBPATH: |
13:59:32 | Araq | fwiw, I want to remove exceptions, .tags, iterators, typed vs untyped, methods, closures, the GC and converters. |
13:59:41 | Araq | :P |
13:59:57 | FromGitter | <zacharycarter> I like all those things |
13:59:57 | vantage | THank ya |
14:00:04 | vantage | forgot the space |
14:00:04 | FromGitter | <zacharycarter> I don't like exceptions |
14:00:07 | FromGitter | <arnetheduck> put that in the thread for posterity :) |
14:00:08 | FromGitter | <mratsim> includes are useful to test private proc. Also I use them when I directly {.emit.} C code because I get code duplication or whatever otherwise |
14:00:09 | FromGitter | <zacharycarter> I don't know what .tags are |
14:00:26 | FromGitter | <mratsim> tags are part of the Effect system |
14:00:26 | vantage | does that work with windows though |
14:00:29 | FromGitter | <zacharycarter> what is going to replace the GC? |
14:00:38 | FromGitter | <mratsim> Terminators |
14:00:42 | FromGitter | <zacharycarter> oooo |
14:00:43 | Araq | the "new runtime". |
14:00:54 | cheeseburger | When I pass "proc(item1, item2: T): T = nil" as a parameter type, what is the "nil" on the end doing? If I change "nil" to "item1" the compiler says it's an "undeclared identifier" |
14:01:00 | vantage | Araq, Want to make RUST MINUS? |
14:01:21 | FromGitter | <tim-st> Do you want to replace gc like rust does it? I think rust is quite difficult with the lifetime params |
14:01:35 | FromGitter | <zacharycarter> I don't think he's talking about an ownership system |
14:01:36 | FromGitter | <mratsim> @cheeseburg, nil assign a nil pointer to a ref type |
14:01:44 | FromGitter | <zacharycarter> but I could be totally wrong |
14:01:49 | FromGitter | <tim-st> how then? |
14:01:51 | FromGitter | <mratsim> @zacharycarter you didn’t read about lent type. |
14:01:58 | FromGitter | <mratsim> that’s like inverse borrowing |
14:02:03 | FromGitter | <zacharycarter> ah |
14:02:05 | Araq | I'm only half-serious. |
14:02:11 | FromGitter | <zacharycarter> I saw this last night |
14:02:14 | FromGitter | <zacharycarter> don't know if it's intersting at all or not |
14:02:20 | FromGitter | <zacharycarter> http://www.cs.columbia.edu/~simha/preprint_isca18_REST_memory_safety.pdf |
14:02:29 | Araq | the features will all replaced by macros |
14:02:30 | FromGitter | <zacharycarter> or if everyone already knows about this and I'm just slow |
14:02:32 | cheeseburger | @mratsim what if the return type isn't known to be a ref type or not? |
14:02:33 | FromGitter | <zacharycarter> which is probably the case |
14:02:38 | Araq | *would all be replaced by macro solutions. |
14:02:59 | FromGitter | <mratsim> It is, for the escape analysis,/optimization opportunities that can come from it. I don’t like how seq can copy under your feet. |
14:03:11 | FromGitter | <mratsim> @cheeseburger: compile-time error |
14:03:47 | cheeseburger | @mratsim ok makes sense. Why can it be "nil" but not any other identifier? |
14:03:52 | FromGitter | <mratsim> you proably should put `T: not(ref|ptr|seq|tring)` in your signature though |
14:04:20 | FromGitter | <mratsim> nil is the keyword for null in Nim |
14:04:24 | FromGitter | <ephja> Araq: remove iterators from the language and replace with concepts? |
14:04:31 | * | yglukhov joined #nim |
14:04:43 | FromGitter | <mratsim> iterators are one of the best thing in Nim |
14:04:53 | Araq | that's impossible, but iterators can be based on macros. |
14:05:23 | FromGitter | <tim-st> as long as the syntax will be the same. In rust many people didnt like their iterators and want python like iterators |
14:05:47 | Araq | anyway, calm down, relax. removing/replacing a feature is hard work |
14:05:53 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:06:03 | FromGitter | <mratsim> Rust iterators are fast: https://github.com/alehander42/zero-functional/tree/master/benchmarks |
14:06:30 | Araq | and every single item on my list is more a research project than a "solution" waiting to be implemented. |
14:07:04 | FromGitter | <mratsim> The “hidden” research is done there :D https://github.com/Araq/nox |
14:07:22 | FromGitter | <ephja> impossible because of the coroutine stuff or because of some other reason? |
14:07:28 | miran | "This repository is empty." ? |
14:07:31 | FromGitter | <ephja> actually, my POC defined a foreach macro |
14:07:32 | Araq | yes, even removing exceptions, you will be surprised to learn Nim's iterators do require exceptions |
14:07:57 | FromGitter | <mratsim> @miran it had “This is research for next features in Nim” at one point |
14:08:01 | Araq | or a comparable "on scope exit cleanup" feature. |
14:08:30 | miran | mratsim: i have seen that description, but - tha doesn't change that it is empty :) |
14:08:41 | FromGitter | <ephja> replacing exceptions with something else actually seems like a decent idea when the language in question actually has modern features |
14:09:08 | cheeseburger | I can't get the optional proc argument thing to work. Is there another way of doing it I can look at? |
14:09:21 | * | yglukhov quit (Ping timeout: 264 seconds) |
14:10:08 | Araq | proc foo(opt: proc () = nil) = |
14:10:16 | Araq | if opt != nil: opt() |
14:10:24 | FromGitter | <ephja> it would be a good idea to upload a test case and the relevant output to gist or some other service |
14:11:23 | cheeseburger | Cool I've updated the paste with the output: https://ghostbin.com/paste/amgns |
14:11:47 | Araq | btw you can map exceptions to 'if's, it's not pretty but it works and the result is what otherwise would have been hand coded. |
14:12:00 | cheeseburger | @Araq I'm using your example but no luck integrating it |
14:12:20 | Araq | except that it's slower and has much worse interop with JS and C++. |
14:12:42 | * | yglukhov joined #nim |
14:13:44 | * | vantage quit (Quit: Leaving) |
14:14:46 | FromGitter | <ephja> yes that or a default proc. btw, the earlier example was incomplete. you need to do `foo: proc() = (proc() = discard)`. discard alone won't make it a proc literal. the argument type can be omitted (inferred) in this case since a default value is provided |
14:15:35 | * | vantage joined #nim |
14:16:02 | cheeseburger | Hmm @ephja that gives me a "type mismatch" |
14:16:20 | cheeseburger | But that helps me understand what you were saying, thanks :) |
14:16:47 | cheeseburger | I think I misunderstood the proc type argument |
14:18:00 | FromGitter | <mratsim> @arnetheduck thoughts about th `+%`, `-%` … operators? |
14:18:17 | cheeseburger | Ok it works now! Thanks for the help everyone. I am still learning nim |
14:18:21 | cheeseburger | I've updated the paste |
14:18:24 | FromGitter | <mratsim> maybe those should be in a pointer arithmetic package |
14:18:38 | cheeseburger | Now I have another question, which was the bug that I fixed |
14:19:06 | miran | cheeseburger: what was updated? where was the error? |
14:19:08 | cheeseburger | The proc definition was "proc doSomeStuffWithOptionalFilter[T] (items: seq[T], customProc: proc(item1, item2: T): T = nil) =" |
14:19:15 | * | Vantage_ joined #nim |
14:19:32 | cheeseburger | And I was calling it with this: "items.doSomeStuffWithOptionalFilter[CustomItem]()" |
14:19:38 | cheeseburger | But that doesn't work |
14:19:49 | cheeseburger | I had to remove the "[CustomItem]" bit |
14:19:58 | cheeseburger | So it's just "items.doSomeStuffWithOptionalFilter()" |
14:20:01 | * | xkapastel joined #nim |
14:20:16 | cheeseburger | I suppose it is getting "T" from the type contained in the seq that was passed |
14:20:47 | cheeseburger | But why would specifying the type cause this?: "Error: expression 'doSomeStuffWithOptionalFilter(items, nil)' has no type (or is ambiguous)" |
14:21:00 | cheeseburger | As I am specifying the type |
14:23:58 | FromGitter | <arnetheduck> @mratsim no opinion there, I've worked with both and it's fine.. except that having both unsigned types and unsigned operators for signed types is.. well you've heard the rest of the story, useless options -> useless cognitive and other costs |
14:25:24 | FromGitter | <arnetheduck> or rather, not enough information to have an opinion.. I could think it's mostly a matter of habit, which way you prefer. unsigned/wrapping arithmetic is generally useful for more than just pointers btw |
14:26:56 | Vantage_ | Is half the language gonna be macros now ??? |
14:27:41 | FromGitter | <ephja> should have thought about all this in 2008 :p |
14:29:58 | FromGitter | <mratsim> @Vantage_ it’s better than having everything in the compiler actually. I really don’t like to look into the Nim code and see {.magic: “FooYouCannotReplicateTooBad”.} |
14:31:27 | FromGitter | <mratsim> Also that would mean that if you need a very advanced feature, you can implement it yourself, without compiler plugins or whatnot, distribute it yourself as well and you don’t have to wait for the core devs |
14:31:30 | Vantage_ | mratsim I'd like less magic |
14:31:34 | * | yglukhov quit (Remote host closed the connection) |
14:31:35 | Vantage_ | I think we all would |
14:31:43 | FromGitter | <mratsim> also it’s less surface to maintain for the core devs |
14:32:22 | Araq | Vantage_: no, not "now", it's a long term vision. |
14:33:10 | Vantage_ | what would define 1.0.0 |
14:33:29 | Araq | 1. bugfixes. |
14:33:41 | Araq | 2. features behind a more fine-grained .experimental switch. |
14:34:03 | PMunch | Should probably resolve some of the large RFCs as well no? |
14:34:23 | Araq | so that .experimental is not an all-or-nothing switch. |
14:34:48 | Araq | RFCs .. which ones? |
14:36:17 | PMunch | I haven't looked through all of them, but for example the conv/to discussion and generic `new` procs are quite a big, but simple to implement, change to the stdlib |
14:37:11 | Araq | not a fan of these RFCs. |
14:37:29 | PMunch | Why not? |
14:38:01 | Araq | it's just more bikeshedding. |
14:38:26 | PMunch | Not really, the generics offer a completely different/new set of features |
14:38:43 | PMunch | Which Nim currently doesn't have, and not really for a good reason |
14:38:49 | Araq | no. |
14:38:59 | Araq | 1. it's entirely possible macros to get the same. |
14:39:02 | PMunch | IMHO it would also make the stdlib look more cohesive and thought through.. |
14:39:13 | Araq | 2. the underlying analysis is weak. |
14:39:16 | PMunch | Yeah, but not procs or templates.. |
14:39:21 | PMunch | Weak how? |
14:39:40 | PMunch | And what analysis? |
14:39:53 | Araq | yeah, exactly. what analysis. |
14:40:16 | PMunch | -_- I meant what do you want analysed? |
14:40:58 | FromGitter | <mratsim> conv/to? I think I missed this one |
14:41:02 | Araq | costs vs benefits? |
14:42:20 | Araq | init[Table[string, int]]() vs initTable[string ,int]() |
14:42:49 | PMunch | Oops, got to go |
14:42:49 | * | PMunch quit (Quit: leaving) |
14:42:55 | Araq | you claim it makes generic code easier to write, I claim it makes the common thing more cumbersome and generic code is possible already. |
14:56:49 | FromGitter | <ephja> the only thing that would add more convenience is return type inference like with @[...] imo, as long as you can't override the default constructor |
14:57:30 | FromGitter | <ephja> I don't mind having most things as "regular" parameters though. it's fairly obvious when a type is passed in rather than an object |
14:58:48 | Vantage_ | http://wiki.c2.com/?EconomicsOfRefactoring |
15:00:09 | FromGitter | <ephja> maybe the contract stuff you considered implementing could be used for implementing user range types, and then it would be easy to support float ranges as well |
15:00:50 | FromGitter | <ephja> I guess you could do that now but with only runtime checks |
15:02:01 | FromGitter | <mratsim> I don’t see how you can make range type with compile-time range checks |
15:04:43 | FromGitter | <ephja> contracts could be checked at compile time if possible |
15:04:56 | Araq | is this a joke, Vantage_ ? |
15:05:34 | Vantage_ | ? |
15:05:58 | Araq | "Economics Of Refactoring" -- where is the economics? it's just same hand waving about how great XP is. |
15:09:04 | Vantage_ | Best I can suggest is try to find a way to do it a little at a time. This way the customer still gets new functionality and the code gets better slowly. |
15:09:04 | Vantage_ | Perhaps there are times when it makes sense to do it all in one big, focused effort. I don't know. |
15:09:07 | Vantage_ | I guess the point of the article is it's better to make small intentional changes than big changes |
15:09:52 | Vantage_ | http://wiki.c2.com/?ExtremeProgramming |
15:33:29 | * | SenasOzys quit (Ping timeout: 268 seconds) |
15:33:30 | * | cheeseburger quit (Ping timeout: 260 seconds) |
15:40:02 | * | edcragg quit (Quit: ZNC - http://znc.in) |
15:41:00 | * | edcragg joined #nim |
15:48:40 | * | SenasOzys joined #nim |
15:49:55 | FromDiscord | <geckojsc> is it possible to define a macro of this form: |
15:49:55 | FromDiscord | <geckojsc> mymacro foo: |
15:49:55 | FromDiscord | <geckojsc> a = 10 |
15:49:56 | FromDiscord | <geckojsc> bar() |
15:49:56 | FromDiscord | <geckojsc> other expressions... |
15:50:15 | FromDiscord | <geckojsc> where foo is any valid identifier |
15:52:15 | Yardanico | yes, why not? :) |
15:52:44 | Vantage_ | geckojsc show us how you'd want to use it |
15:53:35 | FromDiscord | <geckojsc> I want to do something like |
15:53:35 | FromDiscord | <geckojsc> with p: |
15:53:35 | FromDiscord | <geckojsc> x = 10 |
15:53:35 | FromDiscord | <geckojsc> y = 20 |
15:53:45 | FromDiscord | <geckojsc> instead of |
15:53:45 | FromDiscord | <geckojsc> p.x = 10 |
15:53:45 | FromDiscord | <geckojsc> p.y = 20 |
15:54:06 | FromDiscord | <geckojsc> I'm totally new to this macro thing though, don't really know where to start xD |
15:54:28 | Yardanico | Do you want to do that inside of a proc which takes an object as a first argument? |
15:58:31 | FromDiscord | <geckojsc> I'm not sure xD would that affect the way I define it? Ideally it would work on any object regardless of where it's defined |
15:58:34 | * | JStoker quit (Killed (wolfe.freenode.net (Nickname regained by services))) |
15:58:40 | * | JStoker joined #nim |
15:58:42 | FromGitter | <alehander42> Araq what is the initTable example? |
15:58:46 | FromGitter | <alehander42> it doesnt render well in gitter |
15:59:40 | * | petersjt014[m] quit (*.net *.split) |
15:59:40 | * | Demos[m] quit (*.net *.split) |
15:59:57 | FromGitter | <alehander42> anyway iirc your argument for the rfc was that you want the stlib to not depend on all language advanced concepts , but generics can't be possibly included in those |
16:01:26 | * | dddddd quit (Remote host closed the connection) |
16:02:49 | * | beatmox quit (Ping timeout: 260 seconds) |
16:03:11 | * | beatmox joined #nim |
16:03:31 | FromDiscord | <claude> there's also the `{.this: p.}` pragma which works for the rest of the module |
16:03:42 | FromGitter | <alehander42> https://scontent.fsof2-1.fna.fbcdn.net/v/t1.0-9/31124539_1931351253543941_2586509720323883008_o.jpg?_nc_cat=0&oh=128cd57fccbceeb9a73a1b5b04fbaa83&oe=5B4FD1BB :D :D |
16:05:13 | Vantage_ | doesn't the {.this: self.} pragma only work inside procs? claude |
16:06:57 | FromDiscord | <claude> yes |
16:07:33 | * | petersjt014[m] joined #nim |
16:11:10 | FromGitter | <mratsim> @geckojsc, the easiest solution is with templates: `template x() = p.x` though you might get recursive template replacmeent of x: example (that gets recursive replacement :/: https://github.com/numforge/number-theory/blob/e11ea81ae8aad7833468f1ffad953277f40c329b/src/modular_arithmetic.nim#L130-L142 |
16:11:30 | Vantage_ | alehander42 lol. "ONly a mother could love it" |
16:12:41 | FromGitter | <alehander42> srsly its not so bad, weird quote |
16:13:12 | * | Yardanico quit (Ping timeout: 260 seconds) |
16:13:43 | FromGitter | <mratsim> and otherwise @geckojsc, here is a macro that can replace a list of identifiers by a list of other NimNodes: https://github.com/status-im/nim-mpint/blob/d5794ffbe1717f4eba7c92794a916ff0d614b619/src/private/as_words.nim#L33-L54 |
16:15:10 | FromGitter | <mratsim> what you’re looking for is probably to replace ident”x” by DotExpr.newTree(ident”p”, ident”x”) |
16:15:22 | FromGitter | <mratsim> nnkDotExpr* sorry |
16:17:42 | * | Trustable joined #nim |
16:17:47 | FromGitter | <mratsim> or just use: let replacement = quote do: `p`.`ident($x)` (you need to convert the input x, to its string symbol and recreate an ident from this I think. |
16:18:45 | FromGitter | <mratsim> but try templates first ;) |
16:19:25 | FromDiscord | <geckojsc> the `this` pragma sounds interesting, is it documented anywhere? |
16:21:04 | FromGitter | <mratsim> in the manual ;) |
16:21:19 | FromGitter | <mratsim> it doesn’t work with Generics and static though :/. |
16:24:21 | * | Vantage_ quit (Ping timeout: 264 seconds) |
16:25:03 | * | leorize joined #nim |
16:25:30 | * | Demos[m] joined #nim |
16:26:38 | FromDiscord | <geckojsc> ahh i think that's just what I was looking for tbh :) |
16:28:01 | * | nc-x joined #nim |
16:28:48 | * | solitudesf quit (Ping timeout: 255 seconds) |
16:28:50 | * | TheManiac quit (Ping timeout: 240 seconds) |
16:28:51 | * | libman[m] quit (Ping timeout: 240 seconds) |
16:28:51 | * | Abnegation quit (Ping timeout: 240 seconds) |
16:28:51 | * | unclechu quit (Ping timeout: 240 seconds) |
16:28:52 | * | notdekka[m] quit (Ping timeout: 240 seconds) |
16:28:57 | * | petersjt014[m] quit (Ping timeout: 245 seconds) |
16:28:57 | * | Miguelngel[m] quit (Ping timeout: 245 seconds) |
16:28:58 | * | planetis[m] quit (Ping timeout: 245 seconds) |
16:28:59 | * | narimiran[m] quit (Ping timeout: 245 seconds) |
16:28:59 | * | macsek1911[m] quit (Ping timeout: 245 seconds) |
16:29:05 | * | hohlerde quit (Ping timeout: 258 seconds) |
16:29:05 | * | stisa quit (Ping timeout: 258 seconds) |
16:29:07 | * | dyce[m] quit (Ping timeout: 246 seconds) |
16:29:15 | * | survivorm[m] quit (Ping timeout: 255 seconds) |
16:29:15 | * | zielmicha[m] quit (Ping timeout: 255 seconds) |
16:29:21 | * | byteflame quit (Ping timeout: 240 seconds) |
16:29:21 | * | mgdelacroix[m] quit (Ping timeout: 240 seconds) |
16:29:30 | * | Demos[m] quit (Ping timeout: 256 seconds) |
16:29:35 | * | amp907[m] quit (Ping timeout: 276 seconds) |
16:29:42 | * | pqflx3[m] quit (Ping timeout: 255 seconds) |
16:29:46 | * | krux02[m] quit (Ping timeout: 265 seconds) |
16:30:37 | nc-x | What is the reasoning behind " the stlib to not depend on all language advanced concepts ". Is it for ease of external contributors? I mean if a person has the skills and knowledge to for eg. write a json parser, I don't understand why he won't be able to understand generics or typedescs or concepts or any other such feature. |
16:31:04 | nc-x | On the other hand reduction of copy paste code could lead to lesser bugs. |
16:31:30 | nc-x | And ease of maintability and contribution even for external contributors. |
16:33:19 | * | Vantage_ joined #nim |
16:33:36 | FromGitter | <mratsim> are you sure about the stdlib and not just system.nim |
16:34:10 | FromGitter | <mratsim> I think restrictions was more for gc:none or os:standalone compilation. |
16:34:13 | FromGitter | <mratsim> were* |
16:34:38 | * | nc-x_ joined #nim |
16:34:59 | FromGitter | <mratsim> and “advanced concepts” are macros i think, not generics. |
16:35:55 | * | nc-x quit (Ping timeout: 260 seconds) |
16:36:42 | nc-x_ | mratsim: @Alehander42 and I are talking about the RFC's regarding the Stdlib API's to provide a generic interface for which Araq seems to be against. |
16:37:15 | FromGitter | <mratsim> ah |
16:37:30 | * | nc-x_ is now known as nc-x |
16:47:19 | nc-x | As for the recent talks regarding removing Exceptions, IMHO it would be really great if that happens (I don't like exceptions, heck I would even prefer Go's error handling to exceptions (but Rust's is preferable :) ). But I guess it's too late now :( |
16:50:35 | * | Vantage_ quit (Read error: Connection reset by peer) |
16:51:07 | vantage | whats the differency between exceptions and errors |
16:51:39 | * | nc-x quit (Ping timeout: 260 seconds) |
16:54:35 | * | Vantage_ joined #nim |
16:59:12 | FromGitter | <mratsim> you have your code littered with `let err = yourcode(foo, bar, bar); case err of FirstErr: … of SecondErr: …` breaking reading and program flow |
16:59:54 | miran | in python you can slice a container like `a[3:50:7]`, but in nim slices can only continous, with step=1? |
17:00:05 | miran | *only be |
17:00:39 | FromGitter | <mratsim> if it’s for an iterator use countup or countdown |
17:01:12 | Vantage_ | mratsim isn't that an error? |
17:01:24 | Vantage_ | What would python exceptions be then |
17:01:28 | miran | i know for those two, but i cannot do `a[countup(3, 50, 7)]` |
17:01:28 | Vantage_ | an error or an exception |
17:01:41 | FromGitter | <mratsim> Python exceptions are exceptions |
17:02:29 | FromGitter | <mratsim> basically when something isn’t suppose to happen, it breaks the program immediately, but this allows you to chain functions, ie. Error codes don’t monopolize the function return values |
17:03:10 | FromGitter | <mratsim> otherwise you always have to do `var foo: Foo; let err = doSomething(foo, param)` |
17:03:39 | FromGitter | <mratsim> instead of `let foo = doSomethin(param)` |
17:04:02 | FromGitter | <mratsim> the main issue with exceptions is when you want to do a recoverable library or application |
17:04:24 | Vantage_ | I would rather want to avoid always having to do let err= |
17:05:43 | Vantage_ | if its just an implementation detail then I don't care. But if it actually changes the way we need to code then I'd have to reevaluate |
17:06:03 | FromGitter | <mratsim> It’s pervasive. That impacts everything. |
17:06:33 | Vantage_ | well that's gonna be something controversial |
17:06:49 | miran | you speak like this is going to happen? is it? |
17:06:53 | Vantage_ | araq said he wants to use the power of macros to ease it |
17:07:02 | FromGitter | <mratsim> I see error code as `let err = div(a, 0); if err == 1: {.error: “You divided by 0”.}` ugh ... |
17:07:14 | Vantage_ | Maybe "IN the future" |
17:07:39 | Vantage_ | I like My try except or try catch |
17:08:11 | FromGitter | <mratsim> Yeah but, if you don’t exhaustively try you might not be able to recover properly |
17:08:21 | Vantage_ | An Error "indicates serious problems that a reasonable application should not try to catch." An Exception "indicates conditions that a reasonable application might want to catch." Error along with RuntimeException & their subclasses are unchecked exceptions. All other Exception classes are checked exceptions. SAYS GOOGLE |
17:08:28 | FromGitter | <mratsim> when interacting with say databases, you might leave it in inconsistent state |
17:08:52 | * | rauss quit (Read error: Connection reset by peer) |
17:08:57 | FromGitter | <mratsim> Google designed Go … so I don’t believe them when talking about language designs :P |
17:09:25 | Vantage_ | No I googled "error vs exception" |
17:09:32 | Vantage_ | that was the result |
17:10:04 | * | rauss joined #nim |
17:10:39 | FromGitter | <Vindaar> @miran: in case you're fine with a copy of the stepped slice, this is what I use: http://ix.io/18sf |
17:11:42 | miran | yeah, i thought there might be some "automatic" "sugary" way :) |
17:12:13 | FromGitter | <Vindaar> yep, I know :) |
17:12:51 | Vantage_ | Can you overload the operator `..` ? |
17:13:48 | Vantage_ | https://rosettacode.org/wiki/Loops/For_with_a_specified_step#Nim |
17:13:56 | Vantage_ | for x in countdown(10,0,3): echo(x) |
17:14:06 | Vantage_ | isn't that what you wanted? |
17:14:33 | miran | this is what Araq has posted before on a similar topic: https://gist.github.com/Araq/701565f110abd65801fbaea03143c24d |
17:14:52 | miran | i would really like to see this `a..b|c` syntax |
17:15:11 | Vantage_ | thanx miran |
17:22:12 | * | Yardanico joined #nim |
17:23:23 | FromGitter | <mratsim> @miran this is what I use in Arraymancer: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/accessors_macros_syntax.nim#L59 |
17:25:36 | miran | mratsim: "step can be negative" is much more logical than `countdown(50, 3, 7)`, IMO |
17:26:34 | FromGitter | <mratsim> I’m for having this explicit. This creates silent bugs in Python code |
17:26:51 | FromGitter | <mratsim> That’s the whole point of having a statically typed language I think |
17:27:41 | * | r3d9u11 joined #nim |
17:28:17 | FromGitter | <mratsim> I mean, likere there: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/accessors_macros_syntax.nim#L209 |
17:28:21 | FromGitter | <mratsim> like* |
17:28:43 | FromGitter | <mratsim> if there is no -stepping I don’t “countdown”. |
17:28:54 | FromGitter | <mratsim> but in Nim there is no step so the question doesn’t arise ;) |
17:29:15 | FromGitter | <mratsim> -stepping ==> negative stepping. |
17:29:46 | miran | basically: `5..0` -> nothing; `5..0|-1` -> six elements |
17:29:57 | FromGitter | <mratsim> and note that it checks `|-` it doesn’t check if the step is positive or negative (which is intended but might be a gotcha) |
17:30:12 | FromGitter | <mratsim> yes |
17:30:25 | FromGitter | <mratsim> actually it’s an error |
17:31:19 | FromGitter | <mratsim> https://github.com/mratsim/Arraymancer/blob/d774881059b1598a3073fede1b28a45731674e6f/src/tensor/private/p_checks.nim#L58-L73 |
17:35:48 | miran | this should be part of nim syntax, much nicer and more elegant than countdown/countup |
17:37:05 | Vantage_ | He could always do `i%3 == 0` |
17:46:28 | FromGitter | <mratsim> @miran, I’m sure Araq wants more RFCs in the tracker :D |
17:46:41 | miran | ...and mentions on IRC :P |
17:47:02 | FromGitter | <mratsim> I made sure to put an uppercase, it’s not the same identifier |
17:49:30 | * | yglukhov joined #nim |
17:50:53 | * | jjido joined #nim |
17:51:15 | * | SenasOzys__ joined #nim |
17:51:26 | * | r3d9u11 quit (Remote host closed the connection) |
17:52:33 | * | SenasOzys quit (Read error: Connection reset by peer) |
17:52:46 | Vantage_ | https://gist.github.com/CodeDoes/8d071ade52c431d14327d21f4cb5f5f7 |
17:52:51 | FromGitter | <alehander42> Iraq |
17:53:20 | Vantage_ | Are RFC refering to Request for Comment or something else |
17:53:55 | * | yglukhov quit (Ping timeout: 256 seconds) |
17:54:04 | FromGitter | <alehander42> oh we really have to make json's `%` work with variant objects |
17:58:03 | FromGitter | <alehander42> oh tables too |
17:58:04 | FromGitter | <alehander42> why |
17:59:14 | Vantage_ | why what? |
18:00:17 | FromGitter | <alehander42> ok, it seemed easy, weird |
18:00:33 | FromGitter | <alehander42> @dom96 are you ok with a PR adding default `%` for Table[K, V] ? |
18:00:59 | FromGitter | <alehander42> variant objects seem to work, I was mistaken initially |
18:01:20 | dom96 | sure |
18:05:21 | * | simonsolnes quit (Ping timeout: 248 seconds) |
18:13:08 | vegax87 | do you know if is possible to gather values from a txt just like numpy.loadtxt() with Arraymancer? |
18:13:29 | * | yglukhov joined #nim |
18:14:28 | FromGitter | <GULPF> @alehander42 I have a PR for that, #7203 |
18:16:24 | FromGitter | <alehander42> @GULPF awesome! |
18:18:48 | * | yglukhov quit (Read error: Connection reset by peer) |
18:19:23 | * | yglukhov joined #nim |
18:22:37 | * | simonsolnes joined #nim |
18:31:51 | FromGitter | <tim-st> When I try to load a dll and the error is `could not load: dllname.dll` does it mean the file is found but somehow of wrong format? |
18:35:02 | Yardanico | firstly check for 32/64bit |
18:36:02 | FromGitter | <tim-st> I only found a 64bit version^^ |
18:36:34 | Yardanico | I mean, your program and your dll both should have same architecture |
18:36:49 | FromGitter | <tim-st> they have |
18:37:20 | FromGitter | <mratsim> @vegax87, there is a read_csv: https://github.com/mratsim/Arraymancer/blob/master/src/io/io_csv.nim |
18:37:53 | Vantage_ | tim-st what dll? |
18:37:57 | FromGitter | <tim-st> @mratsim can I use this file with your wrapper?https://github.com/facebook/rocksdb/issues/2531 |
18:38:16 | Vantage_ | I once tried sdl_gfx.dll and it was invalid or the wrong version |
18:38:44 | Vantage_ | with a similar message |
18:38:47 | FromGitter | <tim-st> I try to use the rocksdb nim wrapper with the dll I linked |
18:39:00 | FromGitter | <tim-st> I already got leveldb working without problems |
18:39:24 | FromGitter | <mratsim> @tim-st, I only tried on OSX, and it’s a 1-to-1 wrapper so if the original lib doesn’t work, the wrapper won't |
18:39:24 | Vantage_ | if you totally take away the dll it shouldn't even be able to compile |
18:39:42 | Vantage_ | and if you get to that message it should be that the dll might be invalid |
18:40:34 | FromGitter | <tim-st> @mratsim ok thanks, will try other dll versions |
18:41:09 | FromGitter | <tim-st> The dll is compiled by facebook, I think it should be ok |
18:42:34 | Vantage_ | right os? |
18:43:04 | FromGitter | <tim-st> I am on windows 10 x64 I would say it's the correct version: https://repo1.maven.org/maven2/org/rocksdb/rocksdbjni/5.11.3/ |
18:43:19 | FromGitter | <tim-st> I renamed it to `librocksdb.dll` |
18:53:39 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:57:13 | * | elrood joined #nim |
18:58:38 | * | jjido joined #nim |
18:59:39 | * | Vantage_ quit (Quit: Leaving) |
19:02:49 | * | Vantage_ joined #nim |
19:04:47 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:07:24 | * | rokups quit (Quit: Connection closed for inactivity) |
19:14:09 | * | jjido joined #nim |
19:16:51 | * | jjido quit (Client Quit) |
19:22:00 | * | CodeVantage joined #nim |
19:22:06 | * | vantage quit (Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org) |
19:22:19 | * | Vantage_ quit (Ping timeout: 256 seconds) |
19:22:40 | * | CodeVantage quit (Client Quit) |
19:22:53 | * | Vantage joined #nim |
19:24:43 | * | CodeVantage joined #nim |
19:24:44 | * | Vantage quit (Client Quit) |
19:24:44 | * | CodeVantage quit (Client Quit) |
19:24:57 | * | CodeVantage joined #nim |
19:33:39 | * | pqflx3[m] joined #nim |
19:38:21 | * | miran quit (Quit: Konversation terminated!) |
19:41:52 | FromGitter | <mratsim> what is this nimnomagic64 define in system.nim? |
19:48:05 | * | byteflame joined #nim |
19:48:05 | * | Abnegation joined #nim |
19:48:05 | FromGitter | <binary132> can anyone comment on a) the usable portability of nim between major OS, b) the same but particularly to do with debugging? |
19:48:06 | * | dyce[m] joined #nim |
19:48:06 | * | Miguelngel[m] joined #nim |
19:48:06 | * | unclechu joined #nim |
19:48:06 | * | solitudesf joined #nim |
19:48:06 | * | Demos[m] joined #nim |
19:48:07 | * | mgdelacroix[m] joined #nim |
19:48:12 | * | macsek1911[m] joined #nim |
19:48:12 | * | libman[m] joined #nim |
19:48:12 | * | TheManiac joined #nim |
19:48:13 | * | narimiran[m] joined #nim |
19:48:13 | * | petersjt014[m] joined #nim |
19:48:14 | * | zielmicha[m]1 joined #nim |
19:48:14 | * | amp907[m] joined #nim |
19:48:14 | * | notdekka[m] joined #nim |
19:48:14 | * | survivorm[m] joined #nim |
19:48:14 | * | planetis[m] joined #nim |
19:48:15 | * | stisa joined #nim |
19:48:15 | * | krux02[m] joined #nim |
19:48:16 | * | hohlerde joined #nim |
19:48:28 | FromGitter | <binary132> one of the major drawbacks for me to get into Rust is that its debugging and cross-platform support are not that good |
19:50:43 | FromGitter | <mratsim> @binary132 Cross platform support is top notch (unless you are looking for GUI programming but most languages just give up on that) |
19:51:20 | FromGitter | <binary132> gui doesn't seem impossible with some of the decent C simple gui solutions |
19:51:45 | FromGitter | <alehander42> @binary132 you can use most c-lang debuggers for Nim as it generates line directives |
19:51:48 | FromGitter | <mratsim> For debugging, if you stay in pure Nim code, once you get used to the terse error messages it’s not bad |
19:52:00 | dom96 | huh, I'm curious, in what way is Rust not cross-platform? |
19:52:03 | FromGitter | <alehander42> there are also js sourcemaps in the works for the js backend |
19:52:03 | FromGitter | <mratsim> also yes, you can use GDB/LLDB for debugging |
19:52:16 | FromGitter | <alehander42> and there is a time-travelling visual nim debugger in the works |
19:52:36 | FromGitter | <mratsim> here is a tuto for GDB/LLDB with a view on Nim stack: https://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.html |
19:53:05 | FromGitter | <mratsim> Also the stack traces are quite good |
19:53:16 | FromGitter | <mratsim> it’s not Elm but we’re getting there :D |
19:55:00 | FromGitter | <binary132> well I don't want Elm :P |
19:55:11 | FromGitter | <binary132> thx @mratsim , that's handy |
19:55:22 | dom96 | I know Elm's compile-time errors are good, but are its stack traces that good too? |
19:55:24 | FromGitter | <binary132> wow, cool @alehander42 :) |
19:55:39 | FromGitter | <mratsim> ah no, I don’t know about Elm stack traces. |
19:56:23 | FromGitter | <mratsim> I like Nim ones |
19:56:47 | dom96 | Yeah, hard to get better than Nim/Python's stack traces |
19:57:38 | FromGitter | <alehander42> yeah, I'd like to see those elm traces :D |
19:57:57 | FromGitter | <mratsim> Python’s take a lot of screen space sometimes. And for reason unknown (static, generic, templates?) I’ve seen some cases where Nim’s skips one call or template |
20:00:45 | FromGitter | <binary132> Go stack traces, duh |
20:01:04 | FromGitter | <binary132> who doesn't love picking apart a maze of coroutine references :) |
20:01:16 | FromGitter | <binary132> oh, on that note, does nim have coroutines? |
20:04:52 | dom96 | Kind of. :) |
20:05:08 | dom96 | We do have proper coroutines but judging by their usage they will be removed from the stdlib. |
20:05:28 | dom96 | We also have "closure iterators" which come close and are used by Nim's async await functionality. |
20:05:34 | * | xet7 quit (Remote host closed the connection) |
20:05:47 | FromGitter | <binary132> ah, that's a bit like Rust's experimental concurrency api, no? |
20:08:11 | dom96 | It's exactly like Rust's concurrency API :P |
20:08:23 | dom96 | Nim's async await is also implemented using macros |
20:08:38 | dom96 | The difference is: it's already usable and has been for years |
20:08:47 | dom96 | Used in production too |
20:11:09 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
20:11:39 | * | Lord_Nightmare joined #nim |
20:16:28 | * | smt quit (Read error: Connection reset by peer) |
20:17:40 | * | smt joined #nim |
20:28:25 | * | adeohluwa joined #nim |
20:28:45 | adeohluwa | https://usercontent.irccloud-cdn.com/file/BEcSP6OT/Screenshot_20180422-212756.png |
20:30:00 | adeohluwa | trying to install nimlang on termux |
20:30:07 | adeohluwa | Lmao! |
20:31:16 | dom96 | Is that devel? |
20:31:31 | dom96 | Somebody did get it running on termux |
20:31:42 | dom96 | Wonder if they just didn't make a PR for the changes they had to make |
20:31:46 | FromGitter | <alehander42> hahaha wow |
20:31:49 | * | nim joined #nim |
20:32:01 | nim | hi |
20:32:10 | adeohluwa | so far |
20:32:17 | dom96 | nim: creative nickname :) |
20:32:19 | FromGitter | <alehander42> oh it became sentient ! |
20:32:21 | adeohluwa | $pkg install clang |
20:32:26 | adeohluwa | to add gcc |
20:32:31 | nim | why nim not popular yet? |
20:32:45 | adeohluwa | dom96: what's devel? |
20:32:55 | nim | and its really perf like c/rust - in real app? |
20:33:26 | dom96 | adeohluwa: The git HEAD |
20:33:27 | adeohluwa | nim: I would say because its new & not yet backed by super large organizations |
20:33:48 | nim | its from 2008 not ? |
20:34:02 | nim | 10 year age.. |
20:34:56 | adeohluwa | dom96: yes it is |
20:35:02 | * | Trustable quit (Remote host closed the connection) |
20:35:34 | * | nim quit (Client Quit) |
20:35:45 | dom96 | Pretty sure that's our troll. |
20:36:54 | FromGitter | <mratsim> So Ubuntu 14.04 support expires in July but Travis CI is still stuck on this version. And no updates in sight: https://github.com/travis-ci/travis-ci/issues/7260 |
20:37:21 | dom96 | Isn't there a flag you can set to get a newer version? |
20:37:38 | FromGitter | <mratsim> basically you’re forced to use docker |
20:37:49 | FromGitter | <mratsim> the flag allows you 12.04 or 14.04 |
20:40:12 | FromGitter | <mratsim> @alehander42 is that the kind of use case for breeze? https://gist.github.com/mratsim/9d176b7b366fae9b990ff82932756ead |
20:40:57 | FromGitter | <mratsim> Having some kind of declarative configuration and generating types/proc from it? |
20:41:16 | adeohluwa | already got it working... |
20:44:28 | FromGitter | <mratsim> ah, I see, that would be super useful |
20:44:46 | adeohluwa | new error |
20:44:59 | adeohluwa | https://usercontent.irccloud-cdn.com/file/82DppA0T/Screenshot_20180422-214425.png |
20:51:47 | FromGitter | <mratsim> did you perhaps compile to C++ just before and now are compiling to C? If so try clearing your nimcache |
20:52:58 | FromGitter | <mratsim> I have this kind of symbol(.text+0xaf0) with C++ stuff in my cache |
20:55:37 | * | BitPuffin quit (Remote host closed the connection) |
20:55:56 | * | nsf quit (Quit: WeeChat 2.0.1) |
21:10:54 | * | yglukhov quit (Read error: Connection reset by peer) |
21:11:29 | * | yglukhov joined #nim |
21:14:25 | * | elrood quit (Quit: Leaving) |
21:24:50 | * | athenot joined #nim |
21:27:51 | FromGitter | <honewatson> O |
21:29:28 | * | xkapastel quit (Quit: Connection closed for inactivity) |
21:35:53 | FromGitter | <zacharycarter> Northern VA Nim meetup 2018 was a success :D |
21:43:55 | * | athenot_ joined #nim |
21:44:44 | * | athenot quit (Ping timeout: 276 seconds) |
21:49:24 | FromGitter | <mratsim> awesome! |
21:50:08 | FromGitter | <mratsim> The lineInfo proc in the macros module is great. |
21:50:30 | FromGitter | <zacharycarter> sooooo quick question |
21:50:41 | FromGitter | <zacharycarter> let's say I have a concept named Foo |
21:51:24 | FromGitter | <zacharycarter> if I have a proc that accepts a parameter of Foo and I try to use the name proc from typetraits on the value passed into the proc, it returns the name of the concept |
21:51:33 | FromGitter | <zacharycarter> not the type that was passed in |
21:51:39 | FromGitter | <zacharycarter> should it be that way? |
21:52:29 | FromDiscord | <claude> whats the result if you do proc[T: Foo](param: T) |
21:52:33 | FromGitter | <zacharycarter> and if it should - is there a way to do some sort of refinement? |
21:52:45 | FromGitter | <zacharycarter> well let me share a little code |
21:53:02 | FromGitter | <mratsim> I didn’t try concepts yet. I only raised ~40 static bugs :P |
21:53:20 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5add044f270d7d3708f47f3f] |
21:54:20 | FromGitter | <zacharycarter> the result is - `"Shape":{` |
21:54:47 | FromDiscord | <claude> just try `proc marshallShape[T: Shape](shape: T)` |
21:54:57 | FromGitter | <zacharycarter> okay thanks |
21:55:16 | FromGitter | <zacharycarter> you are awesome! |
21:55:19 | FromGitter | <zacharycarter> thank you! |
21:55:37 | FromGitter | <zacharycarter> this is for the aws lib @Varriount and I are working on |
21:55:48 | FromGitter | <zacharycarter> well he's been working on it - but that's what we met up about today |
21:58:10 | * | NimBot joined #nim |
22:10:37 | * | SenasOzys__ quit (Ping timeout: 256 seconds) |
22:16:03 | * | cspar joined #nim |
22:17:14 | * | athenot joined #nim |
22:17:53 | * | athenot_ quit (Ping timeout: 276 seconds) |
22:21:29 | * | SenasOzys joined #nim |
22:25:04 | * | CodeVantage quit (Ping timeout: 246 seconds) |
22:46:40 | * | leorize quit (Quit: WeeChat 2.1) |
22:54:03 | * | adeohluwa quit (Quit: Connection closed for inactivity) |
22:55:52 | * | xkapastel joined #nim |
22:57:30 | * | CodeVantage joined #nim |
22:59:55 | * | CodeVantage quit (Client Quit) |
23:38:32 | * | krux02 joined #nim |
23:41:36 | krux02 | does anybody here uses emacs with nim? |
23:41:49 | krux02 | Currently It seems to be broken: Error from syntax checker nim-nimsuggest: (wrong-type-argument flycheck-error-p [cl-struct-flycheck-error scratch.nim nim-nimsuggest ??? -1 0 system [Processing] info nil]) |
23:43:21 | * | athenot_ joined #nim |
23:44:20 | * | athenot quit (Ping timeout: 276 seconds) |
23:53:37 | * | Lord_Nightmare quit (Ping timeout: 248 seconds) |
23:56:26 | * | Lord_Nightmare joined #nim |