00:17:02 | krux02 | Araq: lol |
00:17:47 | krux02 | isn't `not nil` an unary use of `not`? |
00:18:16 | krux02 | well good night |
00:18:17 | * | dddddd quit (Remote host closed the connection) |
00:18:58 | * | krux02 quit (Remote host closed the connection) |
00:51:59 | * | citycide quit (Ping timeout: 276 seconds) |
00:59:11 | * | wildlander quit (Quit: Konversation terminated!) |
01:03:00 | * | Sembei joined #nim |
01:03:05 | * | darithorn quit () |
01:04:26 | * | citycide joined #nim |
01:05:45 | * | Pisuke quit (Ping timeout: 252 seconds) |
01:06:30 | * | theelous3_ quit (Ping timeout: 252 seconds) |
01:24:12 | * | zachk quit (Quit: Leaving) |
02:09:06 | * | couven92 quit (Quit: Client Disconnecting) |
02:14:21 | FromGitter | <zetashift> Why isn't this printing `c` instead of `b`? https://pastebin.com/fKLUkmgv |
02:17:08 | FromGitter | <kayabaNerve> @zetashift What is it printing? |
02:17:41 | FromGitter | <kayabaNerve> Also, you set the initial value to 1 and only increment it on the second time, yet you return it when it finds 1 |
02:17:52 | FromGitter | <kayabaNerve> L11 should be == 0 |
02:18:15 | FromGitter | <kayabaNerve> Or you should move the increment out of the else |
02:18:24 | FromGitter | <kayabaNerve> *set the intial value to 0 |
02:18:34 | FromGitter | <kayabaNerve> Or you should have the initial value set to 1 |
02:20:56 | FromGitter | <zetashift> @kayabaNerve thanks! it's printing all together `{'a': 3, 'b': 1, 'c': 0, 'd': 0} ⏎ b ⏎ ` |
02:21:39 | FromGitter | <kayabaNerve> Got it. So did I solve it? :P |
02:23:03 | FromGitter | <zetashift> I need to increment it everytime it stumbles on that char again |
02:23:12 | FromGitter | <zetashift> but the initial value had to be set to 1 yeah |
02:25:49 | FromGitter | <zetashift> this is my code currently and it correctly prints the table with it's values but still the wrong value: https://pastebin.com/WCvGqy3Z |
02:28:00 | FromGitter | <kayabaNerve> Why are you using a table btw |
02:28:16 | FromGitter | <kayabaNerve> And it's because you don't break out of your for loop |
02:28:58 | FromGitter | <zetashift> thought it would be the best structure to handle this. |
02:29:05 | FromGitter | <zetashift> maybe a Seq would be faster |
02:29:15 | FromGitter | <kayabaNerve> Generally a double for is using |
02:29:15 | FromGitter | <zetashift> A Seq containing a Seq* |
02:29:57 | FromGitter | <zetashift> thanks that solved it :P |
02:30:09 | FromGitter | <zetashift> Here I was thinking I was being nice with the result |
02:33:26 | * | k1tt3hk4t joined #nim |
02:33:52 | * | darithorn joined #nim |
02:37:48 | FromGitter | <kayabaNerve> ... are you supposed to be able to break out of if statements? |
02:39:00 | FromGitter | <kayabaNerve> I would've never guessed yes except that's what's happening right now. |
02:39:17 | * | cyraxjoe quit (Quit: I'm out!) |
02:39:42 | FromGitter | <zetashift> you can do an early return yea that's what I did, not sure if that's good practice though |
02:39:55 | FromGitter | <kayabaNerve> Docs say `break` breaks out of its block statement. An if statement is... possibly technically a block statement? Except I'm trying to use the if to decide if I want to break out of the for loop. Because it's breaking out of an if an if statement, the loop still runs |
02:40:09 | FromGitter | <zetashift> I just did `return k` |
02:40:12 | FromGitter | <kayabaNerve> I can't name a loop so I'd have to put the loop in a named block statement to do this if this is intended |
02:40:18 | FromGitter | <kayabaNerve> @zetashift I'm not talking about your code |
02:40:31 | FromGitter | <zetashift> ah sorry |
02:41:02 | * | cyraxjoe joined #nim |
02:45:08 | FromGitter | <kayabaNerve> Nope. I'm just an idiot, as I thought. |
02:45:28 | FromGitter | <kayabaNerve> Can't believe I didn't catch this 0_0 |
02:47:40 | FromGitter | <kayabaNerve> @zetashift |
02:47:44 | FromGitter | <kayabaNerve> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5be3a3d047217e07ffea82f4] |
02:48:17 | FromGitter | <kayabaNerve> There's the two loop version, and the generic answer to your problem. |
02:49:37 | FromGitter | <kayabaNerve> A seq + checking if the seq contains it effectively does the same thing |
03:01:51 | * | k1tt3hk4t quit (Quit: WeeChat 2.3) |
03:05:23 | * | banc quit (Quit: ZNC - http://znc.in) |
03:11:06 | Demos[m] | I want just regular ligatures |
03:11:15 | Demos[m] | sorry, response to a month old message |
03:11:18 | Demos[m] | please ignore |
03:13:03 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
03:21:30 | * | banc joined #nim |
03:39:06 | martin1_1 | is there any widely accepted code formatter? I've found a few but I'm not sure which one should I go with |
04:39:56 | * | endragor joined #nim |
04:42:32 | * | vlad1777d_ quit (Ping timeout: 268 seconds) |
05:00:08 | leorize | martin1_1: there's nimpretty |
05:00:50 | * | chemist69 quit (Ping timeout: 252 seconds) |
05:02:56 | * | chemist69 joined #nim |
05:22:15 | * | endragor quit (Remote host closed the connection) |
05:22:27 | * | endragor joined #nim |
05:34:29 | * | nsf joined #nim |
05:35:06 | * | darithorn quit () |
05:37:46 | * | vlad1777d_ joined #nim |
06:01:48 | FromDiscord_ | <treeform> nimpretty is the standard |
06:10:27 | * | martin1_1 quit (Ping timeout: 240 seconds) |
06:53:56 | FromGitter | <tim-st> PMunch: Now with full suggestion support from critbits-tree, I hope the lsp protocol supports import name suggestions: https://gist.github.com/tim-st/df0ce1c4b712abe7d4e2a90f0b8c78a2 |
06:59:27 | * | mech422__ joined #nim |
07:01:32 | * | krux02 joined #nim |
07:02:16 | FromGitter | <AchalaSB> Hi, Anyone have idea to solve this issue? |
07:02:30 | FromGitter | <AchalaSB> `````` |
07:02:39 | * | mech422_ quit (Ping timeout: 244 seconds) |
07:04:09 | FromGitter | <AchalaSB> Hi, Anyone have idea to solve this issue? ``` vagrant@bodhi64 /v/Samples> make hello ⏎ nim c --out:hello hello.nim ⏎ /etc/nim.cfg(256, 1) Error: closing " expected ⏎ Makefile:10: recipe for target 'hello' failed ⏎ make: *** [hello] Error 1. ``` [https://gitter.im/nim-lang/Nim?at=5be3dfe892b7d11721563711] |
07:11:49 | FromGitter | <krux02> seems to be an illegal makefile |
07:18:33 | * | kapil____ quit (Quit: Connection closed for inactivity) |
07:26:41 | * | Vladar joined #nim |
08:42:02 | FromGitter | <AchalaSB> Makefile is there inside Samples folder |
08:46:47 | * | PMunch joined #nim |
09:00:52 | PMunch | martin1_, just merged your PR for nimlsp |
09:01:07 | PMunch | How's the stability by the way? I've been getting some random freezes |
09:01:33 | PMunch | I can see in the Sublime console window that it is trying to send requests, but nimlsp seems to be hanging on something |
09:02:34 | PMunch | I'm assuming it's either nimsuggest output it's waiting for, or it's something around its input/output streams that locks up |
09:26:07 | Araq | the joys of interprocess communication |
09:47:59 | FromGitter | <survivorm> Oh yeah. Freezes in random places, sometimes interwined with something low-level. Joy of debugging interprocess communications is something that couldn't be underestimated :) |
10:03:56 | FromGitter | <alehander42> can we add `isEmpty` to the stdlib |
10:04:15 | FromGitter | <alehander42> I am sure somebody else suggested it before, but I can't remember if people liked the idea or hated it |
10:10:03 | FromGitter | <alehander42> maybe `not isEmpty` looks strange ? I think I prefer it compared to `len > 0` still |
10:11:20 | FromGitter | <Varriount> @PMunch How's the language server? |
10:12:37 | FromGitter | <alehander42> when do we usually get `len(a) == L` seq modified while iterating over it [AssertionError] ? |
10:15:34 | * | craigger_ quit (Read error: Connection reset by peer) |
10:16:51 | * | craigger joined #nim |
10:18:16 | * | chemist69 quit (Ping timeout: 260 seconds) |
10:18:38 | * | elrood joined #nim |
10:19:07 | FromGitter | <narimiran> @alehander42 `isEmpty` == `not isAny` ? |
10:19:10 | * | chemist69 joined #nim |
10:28:56 | FromGitter | <alehander42> do we have isAny |
10:29:58 | FromGitter | <narimiran> oh, i meant `anyIt` (IIRC the previous discussion was about `isEmpty` in that context) |
10:35:02 | FromGitter | <alehander42> aah nah, I meant a general isEmpty |
10:37:27 | * | martin1_ quit (Ping timeout: 240 seconds) |
10:40:15 | * | martin1_ joined #nim |
10:43:47 | * | dddddd joined #nim |
11:03:05 | * | martin1_ quit (Quit: WeeChat 2.2) |
11:04:03 | * | martin1_ joined #nim |
11:04:28 | Araq | alehander42: I want it too. for packedjson 'len == 0' is expensive. On the other hand, we have TR macros for that, maybe we should use them more |
11:05:38 | martin1_ | PMunch: the stability is sub-optimal to be honest.. I'm getting some random freezes as well.. I think the issue now is when getting messages from the client, I'll see if I can find the issue this night and hopefuly submit another PR |
11:08:34 | * | floppydh joined #nim |
11:09:20 | FromGitter | <alehander42> Araq, that's true, some types can overload `isEmpty` with more optimal checks |
11:09:45 | * | Vladar quit (Remote host closed the connection) |
11:09:48 | FromGitter | <alehander42> well the use of TR macros is impl detail |
11:14:44 | Araq | hmm thinking the unthinkable here |
11:15:09 | Araq | maybe every string should really be an Option[string not empty] |
11:16:16 | FromGitter | <mratsim> as long as options are”cost-free” abstractions in most cases |
11:16:55 | Araq | well I don't want to write if not x.isEmpty: for y in x.unwrap(): |
11:17:03 | FromGitter | <mratsim> everytime I see string processing I’m always think “so where will this allocate and how can I avoid this” and the common answer is avoid strings :D |
11:17:46 | Araq | avoiding strings is generally a good thing, not only for performance, but also for correctness |
11:18:40 | martin1_ | I'm pretty much a newcomer to the language so maybe this was already discussed but, given that nim is style insesitive it would be nice if nimsuggest could be configured to enforce a style on the suggestions, wouldn't it? |
11:19:02 | Araq | we're getting 'nim --styleCheck:error' for that |
11:19:04 | FromGitter | <mratsim> there is a -nep1 flag to warn |
11:19:10 | FromGitter | <alehander42> thankfully, strings are unavoidable in real world |
11:19:23 | Araq | mratsim: already renamed to --styleCheck |
11:19:26 | FromGitter | <mratsim> the real world is a matrix, and you don’t need strings there :D |
11:19:50 | FromGitter | <alehander42> Araq, why is it so important if a string is empty on a type level ? |
11:20:13 | Araq | because it's usually invalid. |
11:20:20 | Araq | empty filename? that's special. |
11:20:23 | FromGitter | <alehander42> eh nope |
11:20:25 | Araq | empty Nim identifier? special. |
11:20:32 | FromGitter | <alehander42> well that's why filenames and idents have their own types |
11:20:50 | Araq | an empty SQL query? likely something special. |
11:20:57 | FromGitter | <alehander42> it's the same as saying "empty lists are usually invalid" |
11:21:11 | FromGitter | <alehander42> sql: again it needs its own type in good code |
11:21:15 | Araq | and that would be equally true |
11:21:38 | Araq | keep in mind that you're talking to the only person left who dislikes Option[T] |
11:22:25 | FromGitter | <alehander42> :D I see this and still here I think the lesson is different |
11:22:32 | FromGitter | <alehander42> if your data is probably invalid for len == 0 |
11:22:44 | FromGitter | <alehander42> probably you need to `distinct` or wrap it somehow |
11:23:29 | Araq | type SqlQuery = distinct Option[string not empty] ? |
11:23:53 | FromGitter | <alehander42> yeah maybe |
11:23:56 | FromGitter | <alehander42> but still |
11:24:00 | FromGitter | <alehander42> if you think about it |
11:24:07 | FromGitter | <alehander42> it just needs a full blown validation assert |
11:24:14 | FromGitter | <alehander42> abs paths need to start with `/` |
11:24:22 | FromGitter | <alehander42> sql queries need to be valid |
11:24:32 | FromGitter | <alehander42> idents need to be \w |
11:24:44 | Araq | yeah and what does the validator return? |
11:24:44 | FromGitter | <alehander42> the len check is a lot of work for just one edge case |
11:25:20 | FromGitter | <alehander42> well, hopefully something that can optionally contain an error message :D |
11:25:25 | Araq | it returns an (string not empty) | Error |
11:25:45 | Araq | (or it raises an exception, yadda yadda) |
11:26:00 | FromGitter | <alehander42> well ok, string not empty seems fine |
11:26:51 | FromGitter | <alehander42> but my point is that you can also have domains where string len>=4 or string [a-zA-Z] makes perfect sense |
11:27:14 | Araq | sure and also empty lines are usually perfectly fine and valid |
11:27:27 | Araq | so it's really lines(): seq[string] |
11:27:34 | Araq | not lines(): seq[string not empty] |
11:27:38 | FromGitter | <alehander42> no, what I mean is that in the same vein people might say "I want type string len >= A" |
11:27:56 | FromGitter | <alehander42> and know you want dependent types :D |
11:28:23 | Araq | I think you don't want dependent types. |
11:28:57 | FromGitter | <alehander42> yeah, but string not empty is a hardcoded instance of a dependent type |
11:29:22 | FromGitter | <alehander42> I hope that one day somebody will make them magic/ergonomic enough to use in normal langs :D |
11:29:28 | Araq | it's a useful hardcoding |
11:29:41 | Araq | there is always the more general solution lurking everywhere |
11:30:01 | Araq | so everything ends up in sophistry. |
11:30:04 | FromGitter | <alehander42> yeah which reminds me |
11:31:06 | Araq | and while we are talking about type thery some javascript kiddie implements Bomberman for the iPhone and becomes a millionaire |
11:32:25 | FromGitter | <alehander42> the sink type in destructors, is it basically an affine type or a linear type? does it have to be always consumed? |
11:32:49 | Araq | it's affine. |
11:33:08 | Araq | I started with "always has to be consumed" and gave up rather quickly |
11:33:23 | FromGitter | <alehander42> well good for the kiddie, games are useful too |
11:33:29 | Araq | it's a much harder problem, and in addition to that, also annoying |
11:33:50 | FromGitter | <alehander42> yeah , so the wiki is a bit older |
11:34:06 | Araq | proc put(t: Table; key, val: sink U) # overwrite t[key] if it exists, otherwise create the entry |
11:34:10 | FromGitter | <alehander42> yeah it doesn't seem too useful too |
11:34:27 | Araq | note that you want 'key' to be 'sink' but whether it really is consumed varies at runtime |
11:35:10 | Araq | well I suppose you could swap() the key then |
11:35:32 | FromGitter | <alehander42> yeah iirc this was the problem: with branched code often you have a case where a var is not consumed |
11:35:59 | Araq | neither Rust nor C++ are after linear types, that's telling us something |
11:36:03 | FromGitter | <alehander42> yes |
11:36:54 | Araq | on the other hand "AST substructure is not added to tree" is a bug linear types would find |
11:37:38 | FromGitter | <alehander42> so this affine check mechanism would be general enough to be used for various resources , e.g. modelling that a network message is always consumed max once etc ? |
11:37:54 | FromGitter | <alehander42> in the beginning I thought this is something deeply tied to memory ptr types |
11:38:26 | Araq | depending on how you structure the code, 'sink' will find this problem. |
11:40:03 | FromGitter | <alehander42> good. and the linear types: what is so hard about checking them, if you have the ability to prove that a value is used in a branch (which you do? if you have affine types?) can't you just check if its provable in all branches? |
11:40:44 | FromGitter | <alehander42> actually you just prove that is not used after consumption |
11:40:49 | FromGitter | <alehander42> I have to take a look at it |
11:41:42 | Araq | every function call can 'raise', that's why. |
11:42:21 | Araq | and before you say "aha, exceptions bad!!!!!", the 'if error: return/goto errHandler' has exactly the same problem |
11:42:41 | FromGitter | <alehander42> so if a function calls only functions with checked side effects? is it easier then? |
11:42:54 | FromGitter | <alehander42> no, I like exceptions |
11:44:00 | Araq | if we map overflows to exceptions (and what would be the alternative anyway?) every function can raise |
11:44:01 | FromGitter | <alehander42> yeah you wrote Furthermore the compiler should probably get even smarter in its inference of raises: []. |
11:44:25 | Araq | I changed my mind a bit, raises: [] is a myth |
11:44:41 | Araq | it's programming, programs run on physical machines, you can always have |
11:44:44 | Araq | overflows |
11:44:49 | Araq | out of heap memory |
11:44:49 | FromGitter | <alehander42> and if we map overflow, we get exceptions everywhere? |
11:44:53 | Araq | out of stack space. |
11:45:58 | FromGitter | <alehander42> well, some of those errors are probably "fatal", so one shouldn't guarantee correctness after them |
11:47:48 | Araq | that works but then you cannot recover from non-critical component failures |
11:48:00 | Araq | unless you assume an OS with process management |
11:49:43 | Araq | and libraries that willy-nilly call exit because "exceptions are bad, mmkay?" are not that convincing |
11:50:24 | Araq | that remains true when it was the Nim compiler that inserted these trap instructions |
11:56:06 | FromGitter | <alehander42> hm true |
11:56:14 | FromGitter | <alehander42> I have to read more about that |
11:56:38 | FromGitter | <alehander42> ok, how do languages with linear types deal with this |
11:56:44 | * | theelous3 joined #nim |
12:35:16 | * | dabedoc joined #nim |
12:35:18 | dabedoc | hello |
12:38:06 | * | dabedoc left #nim (#nim) |
12:43:59 | * | Snircle joined #nim |
12:45:52 | FromGitter | <narimiran> hello dabedoc |
12:52:47 | * | PMunch quit (Ping timeout: 240 seconds) |
12:53:19 | * | PMunch joined #nim |
12:56:04 | PMunch | Varriount, it's getting there |
12:56:18 | PMunch | It has quite a bit of functionality already, but it's not very stable |
12:56:35 | PMunch | I think there might be an issue in the nimsuggest interface layer that makes it freeze up |
13:08:21 | * | btbytes joined #nim |
13:08:41 | * | btbytes quit (Client Quit) |
13:09:07 | * | btbytes joined #nim |
13:24:26 | * | endragor quit (Remote host closed the connection) |
13:26:08 | * | martin1__ joined #nim |
13:26:31 | * | seni joined #nim |
13:27:48 | * | PMunch_ joined #nim |
13:28:21 | * | PMunch quit (Remote host closed the connection) |
13:28:37 | * | PMunch_ quit (Client Quit) |
13:28:47 | * | PMunch joined #nim |
13:32:44 | * | dom96_w joined #nim |
13:39:27 | * | martin1__ quit (Ping timeout: 244 seconds) |
13:40:05 | * | martin1__ joined #nim |
13:40:46 | Araq | PMunch, how do you call nimsuggest? as a process or do you use it as a library? |
13:41:45 | PMunch | As a process |
13:41:55 | PMunch | Is it available as a library? |
13:42:18 | Araq | well kind of, you would need to replicate the program driver |
13:42:51 | PMunch | Huh? |
13:43:12 | * | Vladar joined #nim |
13:43:25 | PMunch | Basically right now I open nimsuggest in stdin mode and ready and write to the process |
13:43:32 | PMunch | One process for each project file |
13:43:44 | * | endragor joined #nim |
13:43:59 | Araq | nimsuggest.nim uses the compiler as a library |
13:44:05 | Araq | your program could do the same |
13:44:16 | Araq | yes, it uses undocumented hooks |
13:44:45 | Araq | we can document these and ensure they are reasonably stable now that the compiler's hardest refactorings are behind us |
13:45:31 | Araq | btw communication over stdin/stdout is much more fragile than sockets IME |
13:45:36 | PMunch | So basically reverse engineer nimsuggest? |
13:46:05 | PMunch | Yeah I know, but with sockets I would need to find an unused port for each of the nimsuggest procedures I need to have running |
13:46:56 | Araq | "revese engineer" 600 lines of code, yes |
13:46:59 | PMunch | But making a library out of nimsuggest would definitely be the best |
13:47:34 | Araq | and most of its complexity is the multi-threading that it does |
13:47:48 | PMunch | Yeah it's not huge, but still there's some work to be done to make it work |
13:47:50 | Araq | and that you can hopefully avoid, but I'm not sure |
13:47:52 | PMunch | I'll look into it though |
13:47:57 | * | endragor quit (Ping timeout: 252 seconds) |
13:48:09 | PMunch | But I'm probably stuck at work all day today, like I was yesterday.. |
13:48:16 | * | dom96_w quit (Ping timeout: 260 seconds) |
13:49:22 | Araq | sure thing, no worries |
13:50:26 | * | btbytes quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:54:51 | * | Vladar quit (Remote host closed the connection) |
13:56:10 | * | Vladar joined #nim |
13:59:21 | FromGitter | <Varriount> PMunch Opening a connection on port 0 causes the system to allocate a random free socket. |
14:01:58 | PMunch | Oh, that's good to know |
14:02:06 | * | theelous3 quit (*.net *.split) |
14:02:07 | * | vlad1777d_ quit (*.net *.split) |
14:02:07 | * | Sembei quit (*.net *.split) |
14:02:07 | * | edcragg_ quit (*.net *.split) |
14:02:08 | * | rockcavera quit (*.net *.split) |
14:02:08 | * | def- quit (*.net *.split) |
14:02:08 | * | oprypin quit (*.net *.split) |
14:02:08 | * | livcd quit (*.net *.split) |
14:02:08 | * | shadowbane quit (*.net *.split) |
14:02:09 | * | copygirl quit (*.net *.split) |
14:02:09 | * | Summertime quit (*.net *.split) |
14:02:09 | * | so quit (*.net *.split) |
14:02:09 | * | def-- joined #nim |
14:02:09 | PMunch | But how do I know which port to connect to then? |
14:02:17 | * | copygirl joined #nim |
14:02:25 | * | vlad1777d_ joined #nim |
14:02:30 | * | rockcavera joined #nim |
14:02:31 | * | Summertime joined #nim |
14:02:35 | * | livcd joined #nim |
14:02:38 | * | edcragg_ joined #nim |
14:02:41 | * | oprypin joined #nim |
14:03:21 | * | rockcavera is now known as Guest324 |
14:03:28 | * | Guest324 quit (Changing host) |
14:03:28 | * | Guest324 joined #nim |
14:03:30 | * | livcd quit (Changing host) |
14:03:31 | * | livcd joined #nim |
14:03:48 | * | Sembei joined #nim |
14:04:14 | * | shadowbane joined #nim |
14:04:24 | * | gsingh93 quit (Ping timeout: 246 seconds) |
14:04:31 | * | so joined #nim |
14:04:31 | * | theelous3 joined #nim |
14:06:57 | * | gsingh93 joined #nim |
14:09:45 | * | eubn joined #nim |
14:24:19 | * | btbytes joined #nim |
14:26:45 | FromGitter | <Varriount> You could send that port via stdout, or via about connection |
14:27:07 | FromGitter | <Varriount> PMunch: ^ |
14:30:20 | PMunch | Hmm I guess |
14:30:28 | PMunch | Still think a library is the way to go thoug |
14:32:11 | FromGitter | <Varriount> A library is harder to integrate with. |
14:32:47 | PMunch | How so? |
14:33:46 | PMunch | A library with "var nimsuggest = initNimSuggest(projectfile = "somefile.nim"); nimsuggest.sug("somefile.nim", "dirtyfile.nim", 10,4)" syntax should be much easier than socket or stdin communication |
14:33:55 | FromGitter | <Varriount> Not all languages have easy C interoperability. |
14:34:14 | FromGitter | <Varriount> How would we load this library in JS, or Python? |
14:34:42 | PMunch | Oh yeah, I'm not saying that nimsuggest should be turned into library, just that it should also be available as a library. |
14:35:11 | Araq | the LSP server would use nimsuggest as a library, the editors use the LSP protocol |
14:35:20 | Araq | no language integration woes |
14:35:32 | PMunch | I imagine the nimsuggest program should just be read from socket/stdin -> Call corresponding library function -> write out over socket/stdout |
14:37:18 | PMunch | I think we should maintain the capability of writing direct nimsuggest plugins |
14:37:43 | PMunch | Just add the possibility to interact with nimsuggest from Nim without having to go through a socket/stdin |
14:43:50 | FromGitter | <zacharycarter> for anyone using vulkan - https://github.com/zeux/volk |
14:48:38 | * | btbytes quit (Quit: Textual IRC Client: www.textualapp.com) |
14:49:51 | * | btbytes joined #nim |
15:09:50 | * | dom96_w joined #nim |
15:16:39 | FromGitter | <kaushalmodi> Is `{'b' .. 'z'} + 'a'` supposed to work/ |
15:16:40 | FromGitter | <kaushalmodi> ? |
15:16:57 | FromGitter | <kaushalmodi> ref: https://nim-by-example.github.io/bitsets/ |
15:17:21 | FromGitter | <kaushalmodi> I get this error: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5be45381bb8878747499174b] |
15:19:18 | FromGitter | <pr-yemibedu> Simon Peyton has a video illustrating Haskell with an extension for linear typing through function restrictions and mentions Rust as being one of the few with a linear type system (using borrowing and ownership) https://www.bing.com/videos/search?q=linear+haskell+&&view=detail&mid=8999700116D3709B94838999700116D3709B9483&&FORM=VRDGAR |
15:19:59 | PMunch | kaushalmodi, yes + only works between sets |
15:20:29 | FromGitter | <pr-yemibedu> In Rust they try to leave out exceptions and prefer the Result type which includes the error and leaving "panic" for exceptional cases. |
15:20:31 | PMunch | See this: https://nim-lang.org/docs/manual.html#types-set-type |
15:20:45 | PMunch | So if you want to add a unit to a set you need to use incl |
15:21:05 | PMunch | Which is the same as adding a set only containing that one unit |
15:21:09 | FromGitter | <pr-yemibedu> so it would be ``` {'b' .. 'z'} + {'a'} ``` basically |
15:21:33 | PMunch | So either {'b'..'z'} + {'a'} or {'b'..'z'}.incl 'a' |
15:21:56 | PMunch | pr-yemibedu, sounds like Midori |
15:22:54 | FromGitter | <kaushalmodi> PMunch: Thanks. I was just confirming |
15:23:08 | FromGitter | <kaushalmodi> Was porting that set of Nim by Examples to my notes which I found that issue |
15:23:25 | FromGitter | <kaushalmodi> may be `+` was overloaded for `set[T],T` at some point |
15:24:03 | FromGitter | <pr-yemibedu> it could be overloaded. but the explicit nature as it stands makes better sense |
15:24:14 | FromGitter | <kaushalmodi> @pr-yemibedu I agree :) |
15:24:29 | FromGitter | <kaushalmodi> Wanted to check if anyone knew the history of deprecating that older syntax |
15:25:02 | FromGitter | <pr-yemibedu> I don't but it makes the algebra more concrete. |
15:25:15 | Araq | I don't recall any changes for + on sets |
15:26:12 | FromGitter | <kaushalmodi> Araq: I stumbled upon this when reading https://nim-by-example.github.io/bitsets/ |
15:26:38 | FromGitter | <kaushalmodi> the table there seems a bit outdated compared to one in https://nim-lang.github.io/Nim/manual.html#types-set-type |
15:27:26 | PMunch | Make him a PR: https://github.com/flaviut/nim-by-example/blob/master/content/content/bitsets.md |
15:30:29 | FromGitter | <pr-yemibedu> or do you want to add the convenience to the language? |
15:34:04 | FromGitter | <pr-yemibedu> speaking of, does a person do a type check on a value or variable for conditional processing? ``` |
15:34:08 | FromGitter | <kaushalmodi> @pr-yemibedu no |
15:34:45 | * | narimiran joined #nim |
15:34:46 | FromGitter | <kaushalmodi> We can already do incl and + {..} |
15:35:24 | FromGitter | <pr-yemibedu> sounds like a document update then for the existing logic. |
15:38:32 | FromGitter | <alehander42> @pr-yemibedu ok, but isn't Rust using affine types: it checks if a value is borrowed |
15:38:57 | FromGitter | <alehander42> but it's not an error if it's never borrowed ? (AFAIK?) |
15:39:40 | * | dom96_w quit (Changing host) |
15:39:40 | * | dom96_w joined #nim |
15:39:56 | dom96_w | Would be cool to see this in Nim: https://github.com/ixy-languages/ixy-languages (Any volunteers?) |
15:42:19 | FromGitter | <alehander42> oh yeah I saw this today, wondered if they thought of Nim |
15:42:22 | * | citycide quit (Ping timeout: 268 seconds) |
15:44:05 | FromGitter | <pr-yemibedu> we are talking about passing to a function and you are either moving the reference or you are borrowing the reference. Values are copied. |
15:44:55 | FromGitter | <pr-yemibedu> it think the ownership part is needed to balance out notion. |
15:50:40 | FromGitter | <pr-yemibedu> I am a newbie for both of these languages so pardon my lack of detailed knowledge in the mechanics or how they cross boundaries exactly. Too many syntax and capability feature matrices in my head. |
15:50:43 | * | citycide joined #nim |
16:04:59 | * | Trustable joined #nim |
16:10:12 | * | darithorn joined #nim |
16:21:24 | FromGitter | <alehander42> hmm |
16:22:18 | FromGitter | <alehander42> I have to watch the video maybe, but in general it seems harder to achieve |
16:22:25 | FromGitter | <alehander42> I have no doubt somebody in haskell has it |
16:24:01 | * | Vladar quit (Remote host closed the connection) |
16:28:00 | FromGitter | <pr-yemibedu> Just realize that Simon gave credit to Rust team and contributors for being first for having a *practical implementation* of a useful constraint to reason about correctness. |
16:31:01 | FromGitter | <Varriount> Meh, depends on your definition of practical. |
16:33:58 | FromGitter | <mratsim> I thought formal language like Coq or even Idris had that? |
16:35:10 | FromGitter | <pr-yemibedu> practical means the implementation can be used for real world applications where the average effort is not more than the total understanding of the concept involved. Since the language uses this all throughout *safe* code, it is simplified its meaning and it also enables the compiler to help you fine straightforward cases to maintain the constraint. |
16:35:28 | FromGitter | <alehander42> I agree, not many people use idris |
16:35:35 | FromGitter | <alehander42> btw idris is adding uniqueness types iirc |
16:35:41 | FromGitter | <alehander42> this should be interesting |
16:35:47 | FromGitter | <pr-yemibedu> Idris does not have it just yet |
16:35:52 | FromGitter | <mratsim> I’m sure Ada has that stuff and it powers aerospace |
16:37:33 | FromGitter | <alehander42> uniqueness types are like an alt of monads |
16:37:35 | FromGitter | <pr-yemibedu> Idris does not guarantee that the use of a ref is limited. It may tell you that you type have a structural constraint. |
16:37:57 | FromGitter | <mratsim> ref can escape in Idris? |
16:38:22 | FromGitter | <alehander42> for side effects: they seem inspired by Clean, I read some criticism of Clean's uniqueness types practicity tho |
16:38:48 | FromGitter | <alehander42> @pr-yemibedu http://docs.idris-lang.org/en/latest/reference/uniqueness-types.html |
16:38:58 | FromGitter | <alehander42> > A value with a unique type is guaranteed to have at most one reference to it at run-tim |
16:39:16 | FromGitter | <pr-yemibedu> oh so nice. thank you. |
16:39:17 | FromGitter | <alehander42> but it does seem newer ⏎ ⏎ > They are inspired by linear types, Uniqueness Types in the Clean programming language, and ownership types and borrowed pointers in the Rust programming language. |
16:39:25 | FromGitter | <alehander42> so in a way, you're still correct |
16:40:29 | FromGitter | <alehander42> unique types in clean seem fun: ftp://ftp.cs.ru.nl/pub/Clean/papers/2008/vrie08-IFL07-UniquenessTypingSimplified.pdf |
16:40:57 | FromGitter | <alehander42> in their example e.g. file operation returns a "new" file handler which is a "different type" |
16:41:11 | FromGitter | <pr-yemibedu> pdf not found on server. |
16:41:13 | FromGitter | <alehander42> which makes the usage "referentially transparent" |
16:41:27 | FromGitter | <alehander42> did this mean that it's always the same if called several times? |
16:41:43 | FromGitter | <alehander42> ugh gitter breaks it |
16:41:44 | FromGitter | <pr-yemibedu> so the Pony programming language does a lot of work to help to allow some of this. Reference capabilities. |
16:41:48 | FromGitter | <alehander42> you have to copy the ftp:// |
16:41:49 | FromGitter | <alehander42> too |
16:41:55 | FromGitter | <pr-yemibedu> okay. got it. |
16:43:27 | FromGitter | <alehander42> hm I was thinking of idempotent |
16:43:50 | FromGitter | <alehander42> this definition of "pure" seems strange to me, the side effect only applies to the input which is never used again |
16:43:56 | FromGitter | <alehander42> but it still changes the actual "world" |
16:44:29 | FromGitter | <pr-yemibedu> So this allows Pony to compile to nice little binaries and have all kinds of nice features. https://tutorial.ponylang.io/capabilities/reference-capabilities.html |
16:44:48 | FromGitter | <alehander42> I haven't analyzed Pony a lot, how are capabilities different than e.g. a ownership checker |
16:45:48 | FromGitter | <pr-yemibedu> so when Simon talks about effecting, He mentions as getting new tokens for channels over getting a sequenced token for transitioning to a *new world*. |
16:46:02 | * | mrwonko joined #nim |
16:48:42 | FromGitter | <alehander42> seems interesting, I have to play with it to make sense of it |
16:48:52 | xace | I have tried variatons of this, but cant I define a proc in a similiar fashion?: proc isSrt(extension:string): bool = if extension == ".srt": return true else: return false |
16:48:57 | FromGitter | <pr-yemibedu> So the Rep Cap of Pony has more transitive states for the data than you see with Rust. |
16:49:06 | FromGitter | <alehander42> I don't understand very well how the tag cap helps with sharing data |
16:49:49 | FromGitter | <alehander42> so I usually work with ref and val in my actor and then write to iso or val and send this other actors? |
16:50:15 | FromGitter | <pr-yemibedu> @alehander42 have you seen the little matrix of read and write of the caps? https://soyyomakesgames.wordpress.com/2016/10/10/ponys-capabilities-made-simple/ |
16:52:41 | FromGitter | <alehander42> I see, this makes more sense |
16:52:49 | FromGitter | <alehander42> so basically they have something like erlang |
16:52:57 | FromGitter | <alehander42> but instead of sending copies of data around |
16:53:16 | FromGitter | <alehander42> they share it internally most of the time but they protect it using the caps |
16:53:21 | FromGitter | <pr-yemibedu> as you notice *tag* sounds like a way to identify something |
16:54:11 | FromGitter | <pr-yemibedu> so they can gain performance by not having to copy all the data. |
16:54:22 | FromGitter | <alehander42> yes exactly |
16:54:32 | FromGitter | <alehander42> sounds cool |
16:55:05 | FromGitter | <pr-yemibedu> they also help you to have more control over lifetimes of data so each actor can collect garbage without global state checks. |
16:55:43 | * | martin1__ quit (Ping timeout: 272 seconds) |
16:55:46 | FromGitter | <alehander42> of course, now I wonder if any of the nim actor libs can somehow have similar type-based impl |
16:56:02 | FromGitter | <alehander42> hm, that's also nice |
16:56:07 | FromGitter | <pr-yemibedu> the beauty comes at a price. |
16:56:53 | FromGitter | <alehander42> what are the cons |
16:58:27 | FromGitter | <pr-yemibedu> Pony and Rust and Idris have these semantics all the way down. |
16:59:44 | FromGitter | <alehander42> well, that's true. but still I can imagine that in languages like Nim you can at least limit some kind of subset in which you can simulate something similar |
17:00:06 | FromGitter | <alehander42> like , how C has subset impl-s with very strong static checkers |
17:01:03 | FromGitter | <alehander42> I read that the rust guys had a more pony-like design in the beginning https://www.reddit.com/r/rust/comments/34rszb/pony_type_and_memory_safe_language/cqxkmm8/ |
17:02:09 | FromGitter | <pr-yemibedu> so the love of Nim having options means that many things needs lots of checking over what is implementing which set of features. |
17:02:35 | FromGitter | <pr-yemibedu> you can do many of these things in Nim. |
17:03:36 | FromGitter | <alehander42> yeah, I agree, I still find it interesting to experiment with |
17:03:47 | FromGitter | <pr-yemibedu> so the limits are that you would need type to be able to describe use constraints (of that the functions can give guarantees they will use the data as prescribed). |
17:04:05 | FromGitter | <alehander42> maybe the biggest problem with languages like Pony/Erlang is: they seem very cool for their domain, but I wouldn't want to use them for everything |
17:04:31 | * | smt joined #nim |
17:04:36 | * | theelous3 quit (Quit: Leaving) |
17:05:27 | FromGitter | <mratsim> I think you can subvert the effect system to do capabilities ;) |
17:05:42 | FromGitter | <mratsim> or “hasCustomPragma” annotations :P |
17:05:47 | FromGitter | <pr-yemibedu> I agree. I like the notion of subsets of the language being Rust like or Pony like to help reason and to get Python like quickness of prototyping an idea. |
17:06:52 | FromGitter | <pr-yemibedu> that would attach the capabilities to the function site and not guarantee transition with the data. |
17:07:14 | FromGitter | <alehander42> you can attach pragmas to variables |
17:07:24 | FromGitter | <alehander42> but I have no idea what they can do |
17:07:32 | FromGitter | <pr-yemibedu> a new assignment would loose a capability implicitly. Pony forces you to be explicit about this. |
17:08:37 | * | martin1__ joined #nim |
17:08:49 | FromGitter | <pr-yemibedu> ```let a {. iso .} = 4 ⏎ let b {. ref .} = ref a``` [https://gitter.im/nim-lang/Nim?at=5be46da162866f74736a2410] |
17:09:11 | FromGitter | <alehander42> wow I was just writing the same syntax |
17:09:28 | FromGitter | <pr-yemibedu> that makes sense, but the compiler needs more machinery if those caps were to be reversed. |
17:09:37 | FromGitter | <alehander42> oh yeah |
17:09:52 | FromGitter | <alehander42> but I can still imagine hacks |
17:10:00 | FromGitter | <alehander42> e.g. you can have an actor pragma |
17:10:11 | FromGitter | <mratsim> pragmas, pragmas everywhere |
17:10:28 | FromGitter | <alehander42> for a function and analyze all the var usage inside.. but then you need to invoke only other actor functions |
17:10:39 | FromGitter | <alehander42> and you basically reimplement effect checking |
17:10:46 | FromGitter | <pr-yemibedu> that is just for locals. so when a val is passed into the procedure, the price has to be paid in a lot of spots beyond simple macro transforms. |
17:10:51 | FromGitter | <mratsim> I wonder how far monster went with his Actor library https://forum.nim-lang.org/t/3291 |
17:12:22 | FromGitter | <pr-yemibedu> his last reply literally mentions Pony as a base for further analysis :) :-) . |
17:15:16 | FromGitter | <alehander42> I wonder if somebody did a compiled-to-erlang research typed lang |
17:15:25 | FromGitter | <alehander42> also possible to find cool ideas there |
17:15:50 | FromGitter | <pr-yemibedu> so does Nim have support for traits? That would allow for other provisions on data. |
17:17:13 | FromGitter | <alehander42> btw session types seem like something that could be also very cool |
17:17:32 | FromGitter | <alehander42> for an actor-based lang , somehow encoding protocol validity |
17:18:37 | FromGitter | <alehander42> found the idea here http://ohad.space/blog/Quartz:%20Towards%20a%20statically%20typed%20Erlang.html |
17:18:58 | FromGitter | <pr-yemibedu> http://simonjf.com/2016/05/28/session-type-implementations.html |
17:19:20 | FromGitter | <pr-yemibedu> and the Simon Peyton video touches on this. |
17:19:25 | FromGitter | <mratsim> traits like Rust? imho concepts are more powerful |
17:20:15 | FromGitter | <mratsim> what’s the difference between session types and Generics? |
17:20:33 | FromGitter | <pr-yemibedu> the too new for prime time language Hackett has many videos. Some engage this talk about them. author Alexis King. |
17:21:06 | FromGitter | <mratsim> actually session types can probably be implemented as concepts: ⏎ ⏎ > Session types are a type discipline for communication-centric programming, where programs can be checked to see if they conform to protocols. |
17:21:34 | FromGitter | <mratsim> or design by contracts: https://github.com/Udiknedormin/NimContracts |
17:24:07 | FromGitter | <pr-yemibedu> the code contracts vs the data contracts involves a lot of extra typing. Very good in its ability to exist but then starts to make have a ref cap palatable. |
17:28:04 | xace | proc isSrt(extension:string): bool = result = if extension == ".srt": true else: false # anyhow i settled on this, my interpretation is that the single line if statement is only allowed in assignment expressions |
17:28:45 | FromGitter | <pr-yemibedu> for clarification of names used to describe what a language *allows* versus what is *based* on. https://gankro.github.io/blah/linear-rust/ |
17:29:40 | narimiran | xace: `proc isSrt(extension: string): bool = extension == ".srt"` |
17:29:52 | narimiran | no need for `if true: true` ;) |
17:29:57 | FromGitter | <alehander42> @xace try to not use a lot of stuff on one line, becomes harder to read |
17:30:02 | xace | narimiran: ah, thats true |
17:30:41 | xace | alehander42: Yeah, i'm currently trying to learn the language, it's just experimentation |
17:31:38 | mrwonko | How would I set up my nimble file when I have a frontend and backend, and the backend should statically embed the compiled frontend JS in the binary? |
17:32:11 | mrwonko | I'll probably want separate tasks for compiling the frontend and backend, and then nimble install would first compile the backend and then the frontend. |
17:32:54 | * | martin1__ quit (Ping timeout: 252 seconds) |
17:35:20 | mrwonko | And what should my directory structure look like in that case? Would I have a separate nimble module for the frontend that the backend depends on? |
17:37:06 | * | PMunch quit (Quit: Leaving) |
17:38:29 | FromGitter | <pr-yemibedu> Does Nim have something like ``` if typeof(A) == type(string): ``` or ``` if A isA string: ``` ? |
17:39:16 | FromGitter | <kaushalmodi> yes |
17:39:19 | FromGitter | <kaushalmodi> `is` |
17:39:27 | FromGitter | <kaushalmodi> assert A is string |
17:39:45 | FromGitter | <pr-yemibedu> excellent. This language is amazing in its simplicity. |
17:39:52 | FromGitter | <kaushalmodi> ```A = "abc" ⏎ doAssert A is string``` [https://gitter.im/nim-lang/Nim?at=5be474e83102f145216e0e15] |
17:40:23 | FromGitter | <kaushalmodi> `doAssert` is preferred over `assert` if you want asserts that can never be turned off |
17:40:39 | FromGitter | <kaushalmodi> also look at typetraits stdlib to see how to print/echo type names |
17:40:44 | * | mrwonko quit (Quit: mrwonko) |
17:40:51 | FromGitter | <mrwonko> I'm still here, just not in IRC. |
17:41:29 | FromGitter | <kaushalmodi> @pr-yemibedu https://scripter.co/notes/nim/#check-type, https://scripter.co/notes/nim/#typetraits |
17:41:36 | FromGitter | <pr-yemibedu> thank you. the vscode plugin does not help a lot in seeing the type of a hovered binding. |
17:49:18 | FromGitter | <mratsim> @mrwonko, you can have a look at https://github.com/Vindaar/NeuralNetworkLiveDemo or https://github.com/brentp/nim-plotly for packages with a frontend+backend |
17:51:27 | FromGitter | <alehander42> Mrwonko you can also read the frontend files on compile time |
17:51:37 | FromGitter | <alehander42> In the backend |
17:52:53 | FromGitter | <alehander42> But you need to serve them yourself, i think there are libs in other langs that use the same api that filesystens have |
18:12:49 | FromGitter | <iffy> How do I expand a seq to be passed in as varargs to a proc? |
18:13:04 | FromGitter | <iffy> (in python: foo(*mytuple) ) |
18:13:28 | narimiran | @iffy there is `varargs` |
18:13:59 | narimiran | https://nim-lang.org/docs/manual.html#types-varargs |
18:14:04 | FromDiscord_ | <treeform> Is there some thing like asyncproc that allows me to read from stdout and stderr from another process using the asyncdispatch stuff? |
18:15:02 | FromGitter | <iffy> narimiran: right, I have a proc expecting varargs and I want to call it like this: someproc(arg1, *my_seq_of_other_args) |
18:16:49 | * | nsf quit (Quit: WeeChat 2.3) |
18:17:08 | narimiran | @iffy http://ix.io/1rkR/nim |
18:17:51 | FromGitter | <iffy> narimiran: and if I don't get to decide how the proc is defined (it only accepts a single varargs argument)? |
18:18:22 | narimiran | what exactly would you like to do? ;) |
18:19:00 | FromGitter | <iffy> There exists a proc: `proc run(args:varargs[string, `$`])` and I want to call it like this: `run("first arg", seq_of_other_args)` |
18:19:42 | FromGitter | <iffy> as a workaround, I'm just creating a new seq with "first arg" in front and calling run with the new seq |
18:20:48 | narimiran | yeah, i don't think you can mix single arg and seq[args] if proc expects (just) varargs |
18:21:08 | FromGitter | <iffy> okay; good enough; thank you! |
18:21:28 | * | floppydh quit (Quit: WeeChat 2.3) |
18:30:33 | * | Yardanico joined #nim |
18:31:51 | * | dada78641 quit (Ping timeout: 252 seconds) |
18:32:14 | * | dada78641 joined #nim |
18:32:57 | * | tobbez quit (Ping timeout: 252 seconds) |
18:34:31 | * | tobbez joined #nim |
18:34:33 | xace | let s:set[char]={'å','ä','ö','Å','Ä','Ö'} # isn't compiling, any suggestions on how to deal with this? |
18:35:54 | * | zachk joined #nim |
18:36:23 | narimiran | xace: those are not ascii chars, i guess that's the problem |
18:37:04 | * | zachk quit (Changing host) |
18:37:04 | * | zachk joined #nim |
18:38:31 | FromGitter | <mrwonko> @mratsim thanks for the links, but the NeuralNetworkLiveDemo sadly doesn't use nimble at all, and nim-plotly does not seem to contain any backend (or frontend), just the library (which supports (but does not require) the JS backend) |
18:39:03 | FromGitter | <mrwonko> @alehander42 Yes, I was planning on reading the compiled frontend js on compile time, that's what I meant by "statically embed" |
18:39:43 | xace | narimiran: yeah, but i figured since their value is <255 it wouldnt be a problem |
18:40:22 | xace | does this mean that chars are limited to the ascii length? |
18:41:36 | xace | https://nim-lang.org/docs/system.html#char says they are 8bit. ill try giving the decimal value |
18:41:44 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:44:54 | FromGitter | <Vindaar> @mrwonko Indeed, the NN demo requires to manually compile and start the JS and C programs independently. Both could be done via `nimble` though. I can try to implement that later, if you like. ⏎ I'm not sure what you mean by "statically embedding" the JS program though. |
18:45:10 | FromGitter | <Vindaar> (the compiling, not the starting of course) |
18:46:15 | FromGitter | <mrwonko> I mean once the nim frontend has been compiled to JS, that can be read by the backend at compile time and included directly in the binary, so the web server can serve it to the client from memory. |
18:47:12 | FromGitter | <Vindaar> Oh, well in principle that should be "easy" |
18:47:24 | FromGitter | <mrwonko> I'll probably just add a task that does `nim js` for building the frontend |
18:47:44 | FromGitter | <Vindaar> yes, and then just `staticRead` the build `.js` from the server |
18:47:57 | FromGitter | <Vindaar> *built |
18:48:08 | FromGitter | <mrwonko> yeah, that will be the easy part |
18:49:37 | xace | const s:set[char]={chr(229),chr(228),chr(246),chr(197),chr(196),chr(214)} # was accepted |
18:51:18 | * | dom96_w joined #nim |
18:54:13 | * | btbytes quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:55:40 | * | dom96_w quit (Client Quit) |
18:55:57 | * | miran joined #nim |
18:57:54 | * | Guest324 is now known as rockcavera |
18:58:08 | xace | where can i find the meaning of these {.magic: "Chr".} pragmas? Where do I find the magic "Chr" definition? |
18:58:15 | * | jlhouchin joined #nim |
18:58:29 | * | btbytes joined #nim |
18:58:34 | * | narimiran quit (Ping timeout: 272 seconds) |
19:12:13 | FromGitter | <mrwonko> in asynchttpserver.server, how do I define the listen address? It seems to use 0.0.0.0 by default (which gives me a firewall warning), I only want to listen on 127.0.0.1 instead. |
19:13:02 | FromGitter | <mrwonko> ah, serve seems to have an optional address argument |
19:13:51 | FromGitter | <mrwonko> yeah, that did the trick |
19:14:20 | Araq | xace, it's built into the compiler but there are docs for what it does |
19:33:48 | miran | when i use `asyncdispatch.runForever()` i get "Error: unhandled exception: No handles or timers registered in dispatcher. [ValueError]", what should i do? |
19:45:19 | FromGitter | <mrwonko> I'm using xmlgen for some simple html generation (is that the right tool for that, if I want to keep things simple and stick to the stdlib?), how can I prevent injections? |
19:45:29 | FromGitter | <mrwonko> sorry, it's called htmlgen |
19:46:55 | FromGitter | <mrwonko> xmldom.escapeXml sounds good |
19:53:45 | FromGitter | <mrwonko> I'm looking for the os.getEnv documentation. https://nim-lang.org/docs/os.html lists it in the exports, but clicking on it sends me to https://nim-lang.org/docs/ospaths.html#getEnv which is an anchor that does not exist |
20:06:10 | Araq | miran, before you register any handler, runForever would be an endless loop |
20:06:23 | Araq | the ValueError tells you you're using it wrong |
20:06:45 | FromGitter | <mrwonko> if I use strformat.& in my asynchttpserver callback, I get some kind of effect that makes the function signature not match, I think it's something about `{.locks: <unknown>.}` |
20:08:35 | * | Yardanico quit (Remote host closed the connection) |
20:09:01 | * | Yardanico joined #nim |
20:09:19 | * | Yardanico_ joined #nim |
20:11:15 | Araq | locks is irrelevant |
20:15:00 | * | theelous3_ joined #nim |
20:17:25 | FromGitter | <mrwonko> okay give me a second, it's difficult to reproduce |
20:25:00 | FromGitter | <mrwonko> building a minimal reproduction actually gave me a significantly more useful error message, "This expression is not GC-safe.": https://gist.github.com/mrwonko/617bdd870dd8c31b6874b51acf39ecfb in the original context I only got a type mismatch |
20:26:52 | FromGitter | <tim-st> it's global, you have to put the string inside a main() proc |
20:27:04 | FromGitter | <tim-st> (and also the server etc) |
20:29:42 | * | Trustable quit (Remote host closed the connection) |
20:31:15 | * | Yardanico_ quit (Remote host closed the connection) |
20:36:17 | FromGitter | <alehander42> @iffy you can define a macro apply |
20:36:29 | FromGitter | <alehander42> which generates a call, but there isnt a builtin way |
20:36:37 | FromGitter | <alehander42> (maybe call is a better name? as in js) |
20:36:54 | * | NimBot joined #nim |
20:36:59 | FromGitter | <iffy> okay, making my own seq is a better alternative in this case, but I'll keep it in mind for the future |
20:39:24 | FromGitter | <mrwonko> oh wow that resulted in a nasty compile error inside the generated C code in clang: member reference base type 'tyObject_FuturecolonObjectType__te3W2Tqi7xuJ7rlPtg9al5w *(tyObject_Request_1Wfxxtqzahm0R6lueM9aQmQ *)' is not a structure or union |
20:39:29 | * | nsf joined #nim |
20:42:44 | FromGitter | <pr-yemibedu> I am using foldl and supplying `{}` as an initial `set[char]` is not enough. so I have ``` ⏎ let ex = "ab" ⏎ let s:set[char] = {} ⏎ let val:set[char]=foldl(ex, a + {b}, s) ⏎ ``` which works but ``` ... [https://gitter.im/nim-lang/Nim?at=5be49fc347217e07fff0ce80] |
20:44:59 | FromGitter | <mrwonko> this is as short as I could get the repro, without the & or the case it doesn't seem to trigger: https://gist.github.com/mrwonko/9e59750c13ad411c9945b918bb8c5a11 I think I'll create an issue on github for this? |
20:45:25 | Araq | please do |
20:45:46 | Araq | from strformat import `&` is wrong btw |
20:46:04 | Araq | import strformat |
20:49:32 | FromGitter | <mrwonko> okay, here it is with the fixed import: https://github.com/nim-lang/Nim/issues/9655 |
20:49:32 | FromGitter | <tim-st> I think the case together with async proc is the problem, the crash on gcc windows |
20:49:58 | FromGitter | <tim-st> 1) same crash |
20:51:23 | FromGitter | <mrwonko> Okay, I'll leave it at that for today, see you later. |
21:04:05 | * | Yardanico quit (Remote host closed the connection) |
21:20:39 | * | nsf quit (Quit: WeeChat 2.3) |
21:35:38 | miran | Araq: re runForever and using it wrong: that's the only way i was able to reproduce a bug i'm trying to solve |
21:38:31 | * | martin1__ joined #nim |
21:40:06 | FromGitter | <kayabaNerve> I put runForever on the first line of my async proc so it'd run forever. Now nothing works. Nim is broken! /s |
21:41:18 | * | miran quit (Ping timeout: 245 seconds) |
21:41:27 | * | btbytes quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:42:02 | * | Ven`` joined #nim |
21:42:20 | * | btbytes joined #nim |
21:44:43 | * | btbytes quit (Client Quit) |
21:46:26 | * | Ven`` quit (Client Quit) |
21:49:25 | * | dom96_w joined #nim |
21:54:56 | * | dom96_w quit (Ping timeout: 244 seconds) |
21:55:54 | * | martin1__ quit (Ping timeout: 252 seconds) |
22:41:54 | * | krux02 quit (Remote host closed the connection) |
23:19:54 | FromGitter | <zacharycarter> This is slightly off topic - but has anyone done any 3d work with Godot? I'm not very much concerned with whether or not you've used Nim, but the complete lack of 3d examples beyond the platformer demo for Godot, leave me scratching my head in regards to how to do a lot of things with the engine |
23:19:59 | FromGitter | <zacharycarter> I'm thinking about just using Unity |
23:20:15 | * | chemist69 quit (Ping timeout: 252 seconds) |
23:23:53 | * | btbytes joined #nim |
23:24:25 | Araq | zacharycarter: 3D is fine with Godot |
23:24:39 | Araq | no need to switch to Unity for this reason |
23:24:59 | Araq | but well ... I only know so much, not any details |
23:28:47 | FromGitter | <zacharycarter> Araq: it's the capabilities, it's the lack of examples / learning resources |
23:28:56 | * | btbytes quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
23:28:57 | FromGitter | <zacharycarter> I can look at a unity project and totally understand how to do something with the engine |
23:29:06 | FromGitter | <zacharycarter> but finding a comparable example for godot is not such a trivial task |
23:29:55 | FromGitter | <zacharycarter> also - godot does this funky node / component bullshit where the nodes themselves are components instead of individual components being added to nodes |
23:30:11 | FromGitter | <zacharycarter> so it's not like you can look at a unity project and immediately understand how to port it to godot |
23:33:43 | Araq | "fuky node / component bullshit" is pretty standard, Urho used something like this too. |
23:33:54 | Araq | and yeah, I dislike it too |
23:34:28 | FromGitter | <zacharycarter> well |
23:34:45 | FromGitter | <zacharycarter> with unity - you have a hierarchy of nodes and then each node you add components too |
23:34:55 | FromGitter | <zacharycarter> with godot, each node in of itself is a component it seems |
23:35:11 | FromGitter | <zacharycarter> so a node in unity can have ten different components doing different things |
23:35:18 | FromGitter | <zacharycarter> optimally - working together to achieve something |
23:35:32 | FromGitter | <zacharycarter> in godot - you have like, a 3d mesh node / component |
23:35:37 | FromGitter | <zacharycarter> it's just fundamentally different / weird |
23:36:06 | FromGitter | <zacharycarter> the whole scene graph thing is definitely overused - not every game needs it |
23:36:14 | FromGitter | <zacharycarter> but now engines bake it in |
23:39:10 | FromGitter | <zacharycarter> https://armory3d.org/manual/#/code/wasm - we might have a new option for game engines with Nim |
23:39:27 | FromGitter | <zacharycarter> although I have a feeling without a true LLVM backend - this won't work out so well |
23:40:06 | Araq | we have a true LLVM backend, it's called nlvm |
23:40:44 | FromGitter | <zacharycarter> I know of it's existence - I just didn't know what it's status was |
23:41:11 | FromGitter | <zacharycarter> Araq: do you know if anyone has played with wasm yet via nlvm? |
23:41:42 | FromGitter | <zacharycarter> I guess it might be a better question for the maintainer |
23:45:14 | Araq | I know people played with it |
23:52:10 | * | theelous3_ quit (Ping timeout: 246 seconds) |