00:45:21 | * | ftsf joined #nim |
00:45:22 | * | Notkea quit (Read error: Connection reset by peer) |
00:45:49 | * | Notkea joined #nim |
02:01:32 | * | zachk quit (Quit: Leaving) |
02:36:50 | FromGitter | <gogolxdong> Is there any AEAD implementation in Nim? |
03:01:00 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
03:07:41 | * | banc quit (Quit: ZNC - http://znc.in) |
03:11:42 | FromGitter | <arnetheduck> @gogolxdong https://github.com/cheatfate/nimcrypto implements GCM.. |
03:17:44 | * | theelous3_ quit (Ping timeout: 250 seconds) |
03:24:09 | * | banc joined #nim |
03:37:40 | * | abm quit (Ping timeout: 250 seconds) |
03:39:21 | FromGitter | <gogolxdong> yes, how about AEAD |
03:40:15 | FromGitter | <gogolxdong> AEAD_AES_128_GCM AES-128 with a 16-octet authentication tag |
03:40:46 | FromGitter | <gogolxdong> AES Galois/Counter Mode (AES-GCM) [GCM] is a family of AEAD algorithms based upon AES. |
04:02:38 | * | leorize joined #nim |
04:11:37 | FromGitter | <gogolxdong> have no idea of how they combined. |
04:13:27 | * | leorize quit (Quit: WeeChat 2.3) |
04:14:31 | * | leorize joined #nim |
04:20:00 | * | leorize quit (Quit: WeeChat 2.3) |
04:52:44 | * | ah_ joined #nim |
04:53:09 | * | ah_ quit (Client Quit) |
04:58:53 | bozaloshtsh | Is it impossible to have a table with a case object as a key? |
04:59:39 | bozaloshtsh | sorry, TableRef. Table[A, A] works where A is a case object |
04:59:46 | bozaloshtsh | that's a strange restriction. |
05:00:13 | bozaloshtsh | if I try newTable[A, A]() I get "parallel 'fields' iterator does not work for case objects |
05:01:35 | * | nsf joined #nim |
05:04:46 | bozaloshtsh | Is there a workaround for this or am I just Not To Use a case object as a table key? |
05:13:34 | xace | bozaloshtsh: im a bit too busy to actually help, but iirc you need to `import hashes` and proc hash(x: A): Hash = result = x.KEY.hash \n result = !$result # note that !$ finishes the hash |
05:14:03 | bozaloshtsh | xace: I implemented a hash for it, there's a different compile error for that (one that makes sense) |
05:15:56 | xace | hmm, i cant gather another guess at your problem atm. im a beginner myself and im very busy atm... sorry |
05:16:35 | bozaloshtsh | no worries, this seems to be a pretty deep issue, or there's some implicit restrictions on case objects I can't find clearly mentioned anywhere in the docs |
05:20:58 | bozaloshtsh | https://ptpb.pw/3ke-/nim |
05:29:17 | * | dddddd quit (Remote host closed the connection) |
05:31:16 | bozaloshtsh | filed an issue on github |
05:41:23 | FromGitter | <gogolxdong> Is there a statement as 1..12.toSeq? |
05:53:17 | * | narimiran joined #nim |
05:53:58 | bozaloshtsh | gogolxdong: (1..12).toSeq should work |
06:04:59 | narimiran | bozaloshtsh: you must put it in front: `toSeq(1..12)` |
06:05:21 | narimiran | but there is an issue/PR which would allow it after an iterator |
06:06:17 | bozaloshtsh | hmm, it seems that with the devel branch, (1..12).toSeq works, but on master, (1..12).toSeq gives me a stange type error |
06:06:38 | narimiran | oh, it is already merged in devel? i wasn't sure |
06:07:08 | bozaloshtsh | I'm avoiding the devel branch currently, there seem to be some very strange regressions in codegen |
06:07:31 | narimiran | bozaloshtsh: don't avoid it. report those regressions! |
06:07:51 | bozaloshtsh | too tired to squint at the generated C code, perhaps tomorrow :p |
06:08:48 | bozaloshtsh | I need to set up choosenim (or whatever it's called) so that I can switch between compilers quickly for situations like this |
06:09:01 | narimiran | yep, choosenim is the way to go |
06:14:51 | ldlework | or dive into NixOS :) |
06:19:30 | FromGitter | <gogolxdong> Is there a reference shows how AEAD_AES_128_GCM works? |
06:26:25 | FromGitter | <gogolxdong> Do I have to understand how AES, GCM and AEAD works separately first? |
06:39:45 | * | Vladar joined #nim |
07:06:51 | * | krux02 joined #nim |
07:16:40 | * | narimiran quit (Remote host closed the connection) |
07:16:45 | * | ftsf quit (Quit: Leaving) |
07:18:26 | * | jjido joined #nim |
07:22:46 | * | leorize joined #nim |
07:40:46 | * | krux02 quit (Ping timeout: 250 seconds) |
07:53:08 | * | NimBot joined #nim |
07:55:22 | * | krux02 joined #nim |
08:02:05 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
08:09:36 | * | krux02 quit (Ping timeout: 246 seconds) |
08:19:42 | * | krux02 joined #nim |
08:25:10 | FromGitter | <alehander42> Araq, very cool |
08:25:29 | FromGitter | <alehander42> but I was under the impression one looks at the first several iterations in fixpoint analysis too |
08:26:24 | * | krux02 quit (Ping timeout: 246 seconds) |
08:28:25 | FromGitter | <alehander42> but overally, pretty cool, that it works for many cases of even raw pointers and various owners |
08:29:15 | Araq | not "first several iterations", it's exactly: |
08:29:20 | Araq | - consider 0 iterations. |
08:29:24 | Araq | - consider 1 iteration. |
08:29:28 | Araq | - consider 2 iterations. |
08:29:37 | Araq | if I understood it correctly |
08:29:38 | FromGitter | <alehander42> on the other hand I imagine a similar system preventing only nil refs should be a bit simpler, as they are supposed to point to either nil or to a valid value, as the gc keeps it alive, so you maintain a flag, not a set |
08:37:31 | * | krux02 joined #nim |
08:43:19 | * | stefanos82 joined #nim |
08:45:20 | FromGitter | <alehander42> yes, you're right about the loops |
08:45:40 | FromGitter | <alehander42> the interesting thing is they use the same scheme for static functions |
08:45:47 | FromGitter | <alehander42> static variables * |
08:46:03 | FromGitter | <alehander42> in functions |
08:50:54 | FromGitter | <alehander42> on the other hand, what would happen to ref in nogc ? i read that the idea was to be a rc pointer? |
08:52:22 | FromGitter | <alehander42> in this case, it still becomes invalid/nil mostly because of assignment/branches, not because of the ref-ed object disappearing |
08:56:14 | Araq | can't really follow you |
08:57:53 | FromGitter | <alehander42> my point is, if this is true, one can replicate a similar impl for ref-s with an enum instead of a set : nil / maybenil / safe (or a set with only two elements: nil / safe ) and with a bit simpler rules for changing those enums |
08:58:42 | FromGitter | <alehander42> and even a `maybenil` assumption for functions returning a ref |
08:59:53 | FromGitter | <alehander42> after all, one can use `ref T not nil` if the system can prove a function returns a valid reference |
09:00:43 | FromGitter | <alehander42> (but I guess you think of a more general ptr/owner safety checking, I am only thinking about the refs thing) |
09:01:16 | * | Vladar quit (Remote host closed the connection) |
09:01:38 | Araq | oh yeah, but note that the paper also mentions not-null inference/annotations |
09:02:10 | Araq | you're right that it makes the "pset" easier. |
09:02:57 | FromGitter | <alehander42> yeah, because gc/rc prevents some cases of dangling, I should've phrased it like that |
09:03:36 | Araq | I'll tinker with this and see if it helps with "index out of bounds" detections |
09:04:31 | Araq | cause that's the more general problem, you can map "use after move" and "access of a nil" to array indexing problems |
09:06:27 | FromGitter | <alehander42> but for the annotations, they say `by default we assume that a function returns values that are derived from its arguments.` which is a bit more liberal than I like: they say later that they just teach people to not use globals/etc if they can, but it still happens |
09:06:53 | FromGitter | <alehander42> that's why I'd just assume it might be nil/invalid without annotation and make the caller do a check |
09:07:00 | Araq | so what, we have .noSideEffect for that and can be precise |
09:07:43 | FromGitter | <alehander42> hm yeah, for pure functions we can be precise too, but for the general case we can assume unsafety |
09:08:37 | FromGitter | <alehander42> so 3 cases: pure functions can be proved, functions returning `not nil` can be assumed to be safe, others can be assumed to return unsafe value |
09:09:54 | FromGitter | <alehander42> yeah, i can see it for nil, but how is use after move similar |
09:10:18 | FromGitter | <alehander42> if we imagine that a variable is a collection of its value and after move it becomes empty? |
09:10:35 | Araq | var x = move(y); use(y); --> var x = y; setLen(y, 0); y[0] |
09:11:08 | FromGitter | <alehander42> yes |
09:12:25 | FromGitter | <alehander42> well in general for indexing pset <=> max valid index |
09:13:42 | FromGitter | <alehander42> which might be hard to analyze, I mean you quickly get to symbolic math (e.g. accessing 3*n elements of seq[with n] + seq[with n] ) |
09:18:07 | Araq | https://github.com/nim-lang/Nim/blob/devel/compiler/guards.nim#L833 sure it gets messy ;-) |
09:20:45 | Araq | but symbolic math is fun and it's not clear how many rules you actually need in practice to cover what the average programmer is capable of writing |
09:21:27 | Araq | and runtime array index checking sucks as much as nil deref bugs |
09:36:12 | * | Ven`` joined #nim |
09:40:16 | * | Ven`` quit (Ping timeout: 244 seconds) |
09:43:04 | * | Ven`` joined #nim |
09:47:44 | * | Ven`` quit (Ping timeout: 250 seconds) |
09:56:53 | * | Ven`` joined #nim |
09:58:39 | * | endragor joined #nim |
10:05:30 | FromGitter | <alehander42> yeaah |
10:05:49 | FromGitter | <alehander42> I asked @zah once about the guards stuff, it seemed very advanced :D |
10:05:59 | FromGitter | <alehander42> that's kinda true |
10:06:23 | FromGitter | <alehander42> for pseudolang I planned simple O[n] annotations as a langdev experiment |
10:07:14 | * | dom96_w joined #nim |
10:07:34 | * | dom96_w quit (Changing host) |
10:07:34 | * | dom96_w joined #nim |
10:07:38 | * | dddddd joined #nim |
10:08:06 | dom96_w | PMunch: That's a good idea about a Small Langs devroom (from yesterday). There is actually a devroom for "minimal languages", maybe we should apply for an "emerging languages" devroom next year |
10:08:09 | FromGitter | <alehander42> and on "paper" it looked feasible to symmath through some of the common scenarios: one still can't solve hard problems, but it can learn to recognize a lot of solvable summation/product/even recurrent cases |
10:08:55 | FromGitter | <alehander42> at least from what i remember about the O math from algo class exercises |
10:10:38 | FromGitter | <alehander42> but you also kinda need a lot of interprocedural analysis which is more feasible in a limited language/small programs |
10:10:38 | FromGitter | <AchalaSB> how to call Async Function inside main function.. ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ `httpRequest` is my main function [https://gitter.im/nim-lang/Nim?at=5bfe699eb6c07010529e059f] |
10:10:59 | * | floppydh joined #nim |
10:11:55 | dom96_w | You're not giving it the correct arguments it seems |
10:12:07 | dom96_w | nothing `async` specific about it though |
10:12:54 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
10:13:39 | FromGitter | <AchalaSB> My main function is not of the type `async`. My question is can I call that inside async function call? |
10:13:51 | leorize | you can |
10:14:11 | Araq | waitFor asyncProc() |
10:14:32 | Araq | don't use asyncCheck asyncProc(). Right? |
10:22:04 | FromGitter | <AchalaSB> Here is my code. Where I have to change my code. ⏎ By changing asyncCheck into asyncProc, got errors ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bfe6c4cf849b222e0b7e132] |
10:23:57 | leorize | your error is right there |
10:24:16 | leorize | `httpRequest` take a `FunSettings` as it's first argument |
10:24:31 | leorize | but you call it with an `AsyncSocket` instead |
10:27:34 | FromGitter | <alehander42> @AchalaSB where are FunSettings and FunResponse coming from ? |
10:28:00 | FromGitter | <alehander42> they seem to be your own types, but you're not creating a FunSettings anywhere in server |
10:28:15 | FromGitter | <AchalaSB> Its user defined types |
10:28:31 | * | Ven`` joined #nim |
10:28:39 | FromGitter | <alehander42> ok, so where are the settings in proc serve? |
10:28:59 | FromGitter | <alehander42> I guess you have to load them from somewhere(a file or something else?) |
10:30:25 | FromGitter | <AchalaSB> The proc serve is to load my file in server |
10:31:51 | FromGitter | <alehander42> great, but you still need those FunSettings , right? |
10:32:01 | FromGitter | <alehander42> where do they come from |
10:32:08 | FromGitter | <AchalaSB> Then how can I call my function in server synchronsly? |
10:32:24 | FromGitter | <AchalaSB> how can I call FunSetting in my proc serve |
10:32:56 | FromGitter | <alehander42> well, it's not a function, FunSettings is an object: you need to create it and fill it with values somewhere |
10:33:01 | FromGitter | <alehander42> that's why I asked you |
10:34:16 | FromGitter | <AchalaSB> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bfe6f28b6c07010529e2a8b] |
10:34:43 | FromGitter | <alehander42> ok, and now you need to create it and actually pass it to httpServer, right? |
10:34:54 | FromGitter | <AchalaSB> yes |
10:36:01 | FromGitter | <alehander42> ok, and fix your other arguments of httpServer |
10:38:32 | FromGitter | <alehander42> in `socket.client.httpRequest( socket.address)`, you need to pass the FunSettings value and see what are socket.client (AsyncSocket) and socket.address(string) types : httpRequest *must* match those types, always look in the errors a bit, they help |
10:41:58 | FromGitter | <AchalaSB> you mean `asyncCheck socket.client.httpRequest(FunSetting.socket.address)` or `asyncCheck socket.client.httpRequest(settings: FunSetting, socket.address)` |
10:43:07 | leorize | you have to create a new `FunSetting` object |
10:43:08 | FromGitter | <alehander42> well, this depends on your logic: I don't know which of those 2 addresses you need. I guess the first one? |
10:43:14 | FromGitter | <alehander42> and use waitFor not asyncCheck |
10:43:32 | leorize | use `await` |
10:43:38 | leorize | since that func is an async func |
10:43:40 | FromGitter | <AchalaSB> tried with this also `proc serve*(server: Server, port= 8545, settings: FunSettings, address=""):Future[void] {.async.} = ` |
10:46:12 | FromGitter | <alehander42> ok , but then you need to pass the settings to your serve functions. you really need to make sure you have a good plan about this program: are you sure you know why you need the `settings` |
10:49:21 | FromGitter | <AchalaSB> I need settings to fetch my file/file path |
10:55:16 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
11:01:07 | FromGitter | <gogolxdong> result of `sha256.hmac(salt, secret) ` is different from ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ which in Go, anyone knows where the trick is? [https://gitter.im/nim-lang/Nim?at=5bfe75737d26db1e830b6e4b] |
11:07:52 | FromGitter | <mratsim> in nimcrypto? |
11:07:57 | FromGitter | <gogolxdong> yes |
11:09:28 | FromGitter | <mratsim> is it sha3_256, sha2_256 or keccak_256? |
11:10:02 | * | PMunch joined #nim |
11:10:04 | FromGitter | <gogolxdong> sha2_256 I think , how to distinguish |
11:10:22 | FromGitter | <mratsim> if you’re working with Ethereum/IPFS you probably need keccak_256 |
11:10:57 | FromGitter | <gogolxdong> QUIC uses sha256 |
11:11:27 | FromGitter | <mratsim> there are test vectors here: https://github.com/cheatfate/nimcrypto/blob/master/tests/testhmac.nim, you can try them with QUIC to make sure which SHA(2, 3, Keccak) they are using |
11:11:37 | FromGitter | <mratsim> I agree that it’s a mess |
11:22:17 | FromGitter | <gogolxdong> I though it's identical with the one in Go, but turned out wrong, there is no need to rerun your test vectors since it has been tested vastly. |
11:24:27 | FromGitter | <gogolxdong> also noticed the test suite of HMAC-SHA2-256 test vectors is the implementation of hmac* itself, so nowhere to go as for me. |
11:38:06 | FromGitter | <mratsim> I not sure I understand what you mean by implementation itself |
11:38:56 | FromGitter | <mratsim> sha2_256.digest() basically does ctx.init, ctx.update, ctx.finish, ctx.clear |
11:39:09 | FromGitter | <mratsim> digest is just a wrapper on top of those 4 procs |
11:39:29 | FromGitter | <m4d3bug> can I use any package to change the format to the excel's format? |
11:40:05 | FromGitter | <mratsim> the tests vectors give the inputs -> result so you can put the same input in the go implementation and check i you have the same results |
11:40:19 | * | seni joined #nim |
11:40:44 | * | vlad1777d joined #nim |
11:40:45 | FromGitter | <mratsim> @m4d3bug : https://forum.nim-lang.org/t/3288? |
11:41:21 | FromGitter | <mratsim> there is even a package: https://github.com/KeepCoolWithCoolidge/nimlibxlsxwriter not sure what you mean by “the format" |
11:43:05 | * | couven92 joined #nim |
11:48:45 | * | abm joined #nim |
11:50:53 | FromGitter | <m4d3bug> I am using nimMime to send email with attach |
11:51:48 | FromGitter | <mratsim> so you want to send a mail in Excel format? |
11:52:45 | FromGitter | <mratsim> or just the mime type? |
11:53:20 | FromGitter | <m4d3bug> It seem I just need to pass any data which is string typehttps://github.com/enthus1ast/nimMime/blob/master/mime.nim#L311 |
11:53:48 | FromGitter | <m4d3bug> and data should be Excel format |
11:54:02 | FromGitter | <mratsim> If it’s similar to the OpenDocument Format mime types (.odf) it’s probably application/vnd-something |
11:54:10 | FromGitter | <m4d3bug> Is that right? |
11:54:56 | FromGitter | <mratsim> yes according to the signature you should pass the Excel mime types to mimeTypeOverride |
11:55:55 | FromGitter | <m4d3bug> but now only send the txt is ok |
11:57:26 | FromGitter | <m4d3bug> maybe I should turn the data to the Excel format before I pass it to the newAttachment? |
12:02:54 | FromGitter | <mratsim> I can’t say, this is completely out of my expertise. Intuitively I suppose there is a “attachFile” proc that just dump the content of a file and attach a mime type to that raw dump |
12:08:31 | * | krux02 quit (Remote host closed the connection) |
12:08:58 | FromGitter | <m4d3bug> I used vnd-something first @mratsim |
12:09:08 | FromGitter | <m4d3bug> but I change it to application/octet-stream |
12:10:41 | * | norok2 joined #nim |
12:14:44 | FromGitter | <m4d3bug> Is that right? @mratsim |
12:15:12 | FromGitter | <mratsim> octet-stream just means binary blob |
12:15:33 | FromGitter | <mratsim> what if you don’t put anything and let the client auto-infer from the .xls(x) extension? |
12:22:01 | * | Ven`` joined #nim |
12:37:27 | * | dddddd quit (Quit: Hasta otra..) |
12:41:20 | * | Snircle joined #nim |
12:46:28 | * | norok2 quit (Quit: Konversation terminated!) |
12:53:38 | PMunch | Hmm, is there a way to call a procedure but redirect it's stdout to stderr? |
12:53:56 | FromGitter | <mratsim> muck with 1& > 2 |
12:54:02 | FromGitter | <mratsim> os something like that |
12:54:05 | PMunch | In Nim |
12:54:07 | FromGitter | <mratsim> or* |
12:54:20 | PMunch | I know how to do it for processes |
12:54:47 | PMunch | Problem is that LSP communicates over stdin/stdout, with extra information passed over stderr |
12:55:19 | PMunch | But when I call nimsuggest as a library it sometimes crashes with error messages written to stdout |
13:03:53 | dom96_w | You can't overwrite Nim's stdout |
13:04:04 | dom96_w | you can probably do some magic with POSIX/WinAPI though |
13:04:37 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:05:41 | PMunch | Hmm |
13:05:43 | FromGitter | <alehander42> maybe nimsuggest shouldn't write error messages to stdout |
13:06:26 | FromGitter | <alehander42> ah it writes info messages |
13:08:10 | dom96_w | you're likely better off just changing your procedure to take either stdin or stderr |
13:13:55 | * | Ven`` joined #nim |
13:15:40 | * | nsf quit (Quit: WeeChat 2.3) |
13:17:09 | PMunch | Yeah that's what I'm working on atm |
13:17:23 | * | endragor quit (Remote host closed the connection) |
13:18:20 | * | seni quit (Ping timeout: 250 seconds) |
13:26:00 | * | endragor joined #nim |
13:30:28 | * | endragor quit (Ping timeout: 250 seconds) |
13:34:54 | * | vlad1777d quit (Ping timeout: 268 seconds) |
13:35:16 | * | vlad1777d joined #nim |
13:35:21 | Araq | dom96_w, you can there is some API proc to do that |
13:35:29 | Araq | forgot its name though |
13:35:48 | Araq | system.reopen |
13:35:53 | dom96_w | PMunch: btw why are you calling nimsuggest as a library? |
13:36:06 | dom96_w | You should be calling it as a process IMO |
13:36:10 | PMunch | To avoid having to juggle external processes |
13:36:22 | Araq | dom96_w, I told him to use it as a library :-) |
13:36:30 | PMunch | nimlsp is written in Nim, so I don't see a reason why nimsuggest should run as a separate process |
13:36:51 | Araq | yeah for nimlsp it's the right thing to do |
13:36:53 | dom96_w | because if it crashes your LSP server dies too |
13:37:12 | dom96_w | or if it uses too much memory your LSP server is screwed |
13:37:13 | PMunch | Yeah, which should trigger an error in your editor, and give you the option to restart it |
13:37:25 | dom96_w | as a process you'll be able to act as its supervisor and restart it if it misbehaves |
13:37:27 | PMunch | Unlike most of the bridges which just silently hangs.. |
13:37:44 | Araq | dom96_w, true but whether that is handled well depends on the LS protocol |
13:37:46 | PMunch | Moving that supervisor role to the editor |
13:39:02 | dom96_w | :'( |
13:39:20 | dom96_w | IMO LSP should just be an agent that calls to various suggestion engines |
13:39:36 | dom96_w | and ensures they aren't misbehaving |
13:39:45 | dom96_w | I doubt an editor will handle all of these cases |
13:39:56 | dom96_w | Does the LSP protocol mandate this? |
13:40:05 | PMunch | Well it would need to be able to supervise the process it starts anyways |
13:40:08 | * | endragor joined #nim |
13:41:08 | dom96_w | Another disadvantage: you cannot update nimsuggest easily |
13:41:42 | PMunch | Advantage: you don't have to match nimsuggest and nimlsp versions |
13:43:10 | dom96_w | why would you have to? Surely the nimsuggest protocol won't change in backwards incompatible ways (that would break all editors that use it...) |
13:43:39 | PMunch | Well to get any of the potentially new features you would need to have a nimlsp that implements them |
13:43:51 | PMunch | So you can easily update nimsuggest, but you'll also have to update nimlsp |
13:44:20 | * | endragor quit (Ping timeout: 250 seconds) |
13:44:37 | PMunch | Plus, nimlsp shouldn't be any harder than nimsuggest to update |
13:47:02 | dom96_w | So we'll end up with nimlsp bundled with Nim |
13:47:08 | dom96_w | Because nimsuggest will become effectively obsolete |
13:47:53 | dom96_w | if you're doing this then why don't you just implement it in nimsuggest? |
13:48:08 | PMunch | Because you didn't want that last time I asked |
13:48:41 | dom96_w | So you're listening to my advice for that but not for this lol |
13:48:55 | dom96_w | You can't pick and choose advice like this |
13:49:55 | PMunch | I created an issue for nimsuggest that it should implement LSP (or it already existed and I commented on it, can't remember). You said it should be a separate tool, so I started working on that and realised interfacing with another program was just unnecessary work. |
13:51:22 | PMunch | Well, my goal here is just to make it work. I don't really care how it's done as long as it is maintainable and preferably easy to implement |
13:53:44 | dom96_w | Oh well. It's up to you. I had a couple of awesome features in mind for this which depend on handling it this way, I guess I'll either need to extract code from your project or start from scratch. |
13:53:51 | PMunch | I realised that the nimsuggest bridge was just a lot of work for little to no gain, so I made it importable as a library instead (which of course could be used for other projects, krux02 have already hinted that he wants to rewrite the emacs plugin this way: https://github.com/nim-lang/Nim/pull/9784) |
13:54:09 | PMunch | Hmm, what kind of features? |
13:54:50 | dom96_w | Having more and more binaries that effectively contain the full functionality of the compiler is a bad idea IMO. |
13:55:03 | * | vlad1777d quit (Ping timeout: 246 seconds) |
13:55:12 | dom96_w | Not only is it a pain for compile times, it also means that we'll have multiple binaries with different Nim version support |
13:55:52 | PMunch | Yeah I can see that |
13:55:55 | dom96_w | Mainly the supervisor features. I would make the LSP server as stable as possible and allow users the ability to report any bugs with a simple click. |
13:55:59 | * | vlad1777d joined #nim |
13:56:06 | dom96_w | (Any bugs in nimsuggest that is) |
13:56:48 | dom96_w | LSP supports popping up questions in the editor for this |
13:57:08 | PMunch | But for me it's outweighed by the ease of programming all of this.. |
13:57:41 | PMunch | Well if you make a super solid supervisor that I can import as a library I could just use that |
13:58:35 | dom96_w | Just go for it. It might very well turn out to be good enough, but I don't think the problems with nimsuggest will be magically solved by just using a different protocol |
13:58:49 | * | enthus1ast quit (Quit: WeeChat 1.6) |
13:58:57 | PMunch | I just want to be able to use nimsuggest with "var nimsuggest = initNimSuggest("/path/to/project/file.nim"); let suggestions = nimsuggest.sug(10, 4)" |
13:59:36 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:59:37 | * | enthus1ast joined #nim |
14:00:07 | PMunch | Importing it as a library makes that easier to achieve, but if I could import a supervisor instead that offers the safe (or better) functionality with little extra work then I'd be all for that |
14:00:40 | PMunch | s/safe/same |
14:02:00 | * | dom96_w joined #nim |
14:08:07 | * | Ven`` quit (Ping timeout: 268 seconds) |
14:09:16 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:16:33 | * | Ven`` joined #nim |
14:25:23 | shashlick | how do you use a var at compile time and run time |
14:26:38 | * | endragor joined #nim |
14:30:55 | PMunch | shashlick, not entirely sure what you mean |
14:33:07 | * | ng0 joined #nim |
14:39:02 | * | norok2 joined #nim |
14:39:19 | norok2 | hey, can anybody help me with this? https://stackoverflow.com/questions/53520162/generate-a-new-sequence-with-values-from-a-function |
14:40:19 | leorize | norok2: array indices are of type `int`, not `int64` |
14:41:15 | leorize | the `..<` iterator takes the type from `n`, which was `int64`. you just need to convert `n` to int with `int(n)` |
14:43:34 | leorize | for the second error, it was because `toSeq(0..<5)` generated an array of `int`, but your function take an `int64`, which is considered incompatible by the compiler |
14:43:47 | leorize | and sorry for not posting this on SO, I don't have an account there |
14:44:00 | norok2 | @leorize thanks for the reply, it's OK |
14:45:04 | norok2 | but then why `..< int(n)` does indeed work? the `squared` proc is expecting `int64` |
14:46:08 | norok2 | I would rather do `result[int(i)] = ` or something, however ugly that might be |
14:49:22 | FromGitter | <mratsim> use can use `newSeqWith(yourfunction)` from sequtils |
14:49:26 | FromGitter | <mratsim> you* |
14:50:33 | FromGitter | <mratsim> example: https://github.com/SimonDanisch/julia-challenge/blob/master/nim/nim_sol_mratsim.nim#L49 |
14:51:14 | leorize | norok2: because `int` can be converted to `int64` |
14:51:19 | leorize | the issue with map is that: |
14:51:35 | leorize | it's signature is: `proc map[T, S](s: openArray[T]; op: proc (x: T): S {.closure.}): seq[S]` |
14:52:06 | leorize | meaning that the mapped proc must take the same type as the array elements |
14:52:51 | FromGitter | <mratsim> you should use mapIt instead of passing a closure. That’s quite costly. |
14:53:10 | FromGitter | <mratsim> or use zero-functional or loopfusion packages ;) |
14:54:23 | leorize | I'm wondering if there's something like newSeqWith to generate arrays at compile time |
14:54:48 | FromGitter | <alehander42> `a: array[Type, N]` ? |
14:55:09 | leorize | but then you'd need to fill it by hand |
14:55:25 | FromGitter | <alehander42> well you do ` = [..]` |
14:55:31 | FromGitter | <alehander42> but i usually have enum arrays |
14:55:40 | FromGitter | <mratsim> use “fill" |
14:55:49 | FromGitter | <mratsim> or implement “newArrayWith” ;) |
14:56:07 | FromGitter | <mratsim> initArrayWith* |
14:56:33 | * | dom96_w joined #nim |
14:56:45 | leorize | hmm, it's not really hard :p |
14:56:58 | FromGitter | <mratsim> if you do newSeqWith in a macro it will be transformed into an array in C code |
14:57:58 | leorize | yea, it's should be easy, but I wonder if it has any practical use case lol |
14:59:47 | FromGitter | <narimiran> "to generate arrays at compile time" you can use `block` inside of which you loop or whatever you need to do? |
15:00:25 | FromGitter | <mratsim> @leorize, it is useful: https://github.com/status-im/nim-byteutils/blob/master/byteutils.nim#L14-L15 |
15:01:47 | FromGitter | <mratsim> contrary to newSeqWith it doesn’t call multiple times the input though, so you can’t use it for `rand(10)` to fill an array with random values |
15:01:48 | shashlick | PMunch: so I have a var which I'm using during compile time so I've marked it with {.compiletime.} |
15:01:56 | shashlick | i want to use it during runtime too |
15:02:08 | shashlick | i'm okay repopulating it but don't want two names for the same var |
15:02:09 | PMunch | And keep it's last value from the compile time? |
15:02:15 | PMunch | Ah.. |
15:02:16 | PMunch | Hmm |
15:02:27 | PMunch | Not quite sure if that is even possible |
15:02:27 | FromGitter | <mratsim> let runtime = comptime? |
15:02:44 | shashlick | i don't care about the contents - want to reuse the name |
15:03:09 | FromGitter | <mratsim> they must be in different scope then |
15:03:36 | shashlick | well, they are globals which i need to get rid of anyway... hmm |
15:03:44 | shashlick | i think i'll move to an object |
15:04:43 | shashlick | still i'll have two names |
15:04:58 | shashlick | so i'll have to write two procs to populate them the same way |
15:09:00 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:09:55 | * | nsf joined #nim |
15:18:48 | * | Ven`` joined #nim |
15:26:00 | leorize | shashlick: you can use `when nimvm:` I think |
15:28:04 | leorize | oops, it doesn't work |
15:29:46 | shashlick | 😞 |
15:30:08 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:31:31 | leorize | could this be a VM bug? https://ptpb.pw/77Kj/nim |
15:31:40 | leorize | that example prints: |
15:31:43 | leorize | `[1, 1, 1, 1, 1, 1, 1, 1, 1, 1]` |
15:31:48 | leorize | `[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]` |
15:31:57 | leorize | but they should be equal to each other :/ |
15:35:28 | * | vlad1777d quit (Ping timeout: 245 seconds) |
15:36:08 | * | Ven`` quit (Ping timeout: 250 seconds) |
15:36:11 | norok2 | @leorize: why the `result[i] = ...` is so strict about the type, but the `newSeq[int64](n)` isn't? I mean `i` and `n` were `int64` in both cases. Is this an unwanted feature or there is more to it? |
15:36:28 | * | Ven`` joined #nim |
15:36:57 | leorize | @mratsim: that code I linked above is the array version of `newSeqWith` :D |
15:38:24 | leorize | norok2: seq indices are `int`-only |
15:38:54 | leorize | `int64` could be bigger than `int` on certain architectures, which is why conversion is blocked |
15:39:53 | norok2 | this I understand, but then `newSeq[T](n)` should require `n` to be `int`-only |
15:41:20 | leorize | that's because the signature of `newSeq` is: `proc newSeq[T](len = 0.Natural): seq[T]` |
15:41:50 | leorize | and `Natural` is a `range` |
15:42:09 | leorize | which currently still have poor compiler schematic check sadly... |
15:43:03 | norok2 | OK, so that's kind of an unwanted feature :-P |
15:43:36 | norok2 | regarding the `map`-way, how would I then have `toSeq()` to generate `int64` items? |
15:44:26 | leorize | the iterator you placed in there should yield `int64` |
15:45:56 | FromGitter | <mratsim> @leorize, if you use static int as a result instead of compiletime it works I think |
15:46:20 | * | dddddd joined #nim |
15:46:23 | FromGitter | <mratsim> see here: https://github.com/numforge/laser/blob/master/laser/openmp.nim#L13-L25 |
15:46:41 | FromGitter | <mratsim> though there is a PR to disallow static result type so I have to check |
15:47:06 | leorize | yep, static int work |
15:47:34 | leorize | that's certainly unexpected... is there a bug filled for it? |
15:48:19 | FromGitter | <mratsim> let me open one |
15:48:26 | FromGitter | <mratsim> what’s your github handle? |
15:48:50 | leorize | "@alaviss" |
15:50:10 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:53:41 | * | Trustable joined #nim |
15:56:54 | * | abm quit (Read error: Connection reset by peer) |
16:01:26 | norok2 | var arr = toSeq(0 ..< 5) |
16:01:27 | norok2 | var sq_arr = map(arr, proc(x: int): int64 = squared(x)) |
16:02:09 | norok2 | this would work but that's basically doing (again) `int` to `int64` casting |
16:02:41 | norok2 | it looks like sometimes this needs to be explicit and sometimes not, how can know when this is needed? |
16:03:34 | leorize | use `0 ..< 5'i64` and you got a seq of `int64` |
16:04:24 | * | narimiran joined #nim |
16:04:26 | leorize | all `int` literal are to be assumed as `int`, unless they're larger than `int32` then the compiler will turn them into `int64` |
16:04:43 | FromGitter | <mratsim> @leorize: https://github.com/nim-lang/Nim/issues/9817 |
16:05:22 | * | Vladar joined #nim |
16:06:46 | leorize | thanks for filling the bug! |
16:06:57 | norok2 | thanks for the int, but this does not answer the question on why `squared(i)` with `i` and `int` works inside the `squared_seq` procedure, but it doesn't when using it with `map()` |
16:07:38 | leorize | I showed you the signature of `map()` |
16:07:53 | leorize | it takes a proc that take the same type as the array element |
16:07:59 | leorize | but `int` is not `int64` |
16:08:17 | norok2 | but in `squared()` this is also the case |
16:08:35 | norok2 | why in `map()` this is honored, and in `squared()` not |
16:08:54 | leorize | it's honored because it's explicitly laid out |
16:09:21 | leorize | `int` can be implicitly converted to `int64`, so the compiler will do that when needed |
16:09:45 | leorize | the type signature of `map()` however, forbid this entirely by enforcing the type for the mapped function |
16:10:16 | leorize | in such cases, you should use `mapIt` |
16:10:29 | norok2 | I thought it was deprecated |
16:10:30 | leorize | it's more relaxed than `map`, and also faster |
16:10:41 | leorize | no, it's not deprecated |
16:11:17 | norok2 | BTW `0 ..< 5'i64` does not work -- gives type mismatch error, but `0'i64 ..< 5'i64`does work |
16:12:55 | leorize | type inferrence is weird at times |
16:29:27 | * | msmorgan__ left #nim (#nim) |
16:30:50 | * | msmorgan joined #nim |
16:34:39 | * | rockcavera quit (Remote host closed the connection) |
16:46:17 | PMunch | Discovered a tiny issue with my library wrapping, https://github.com/nim-lang/Nim/pull/9818. Once this is merged I'll set the nimlsp master to use the library version and continue working on actual features :) |
16:46:37 | PMunch | But I've just tested it out in some different editors and the results are looking good so far, lot's of stuff already working :) |
16:53:54 | FromGitter | <arnetheduck> does lsp have room for language-specific extensions? |
16:56:03 | * | endragor quit (Remote host closed the connection) |
16:56:35 | * | floppydh quit (Quit: WeeChat 2.3) |
16:57:26 | * | dom96_w joined #nim |
17:15:53 | * | craigger quit (Quit: bye) |
17:18:25 | * | craigger joined #nim |
17:23:22 | * | nsf quit (Quit: WeeChat 2.3) |
17:36:09 | * | Jesin joined #nim |
17:48:44 | * | Perkol joined #nim |
17:55:58 | PMunch | arnetheduck, not sure. What kind were you thinking of? |
18:04:03 | * | ng0 quit (Remote host closed the connection) |
18:04:43 | * | norok2 quit (Quit: Konversation terminated!) |
18:05:06 | * | ng0 joined #nim |
18:14:40 | * | Trustable quit (Remote host closed the connection) |
18:36:59 | * | jjido joined #nim |
18:46:27 | * | Jesin quit (Quit: Leaving) |
18:46:42 | * | Snircle quit (Read error: Connection reset by peer) |
18:47:17 | * | Snircle joined #nim |
18:52:04 | * | Jesin joined #nim |
18:52:26 | * | jjido quit (Ping timeout: 250 seconds) |
18:58:36 | * | PMunch quit (Remote host closed the connection) |
19:06:03 | * | nsf joined #nim |
19:07:14 | * | jjido joined #nim |
19:21:55 | * | d_s joined #nim |
19:26:37 | * | leorize quit (Quit: WeeChat 2.2) |
19:28:32 | * | jjido quit (Read error: No route to host) |
19:29:20 | * | Armaldio joined #nim |
19:35:19 | * | jjido joined #nim |
19:36:30 | FromDiscord_ | <Armaldio> Hello everyone, |
19:36:30 | FromDiscord_ | <Armaldio> I'm currently facing a problem while starting a process. |
19:36:30 | FromDiscord_ | <Armaldio> |
19:36:30 | FromDiscord_ | <Armaldio> I have node.js installed and want to start node on a file (cmd: 'node index.js'). |
19:36:31 | FromDiscord_ | <Armaldio> I've managed to ouput the result of a simple file with "static" content using startProcess("node", "", @[filepath]) |
19:36:34 | FromDiscord_ | <Armaldio> However, my code is dynamic in the sense there are prompts, so it doesn't work because it wait for process to stop before giving you access to the output. |
19:36:34 | FromDiscord_ | <Armaldio> |
19:36:35 | FromDiscord_ | <Armaldio> I can see two options here: |
19:36:38 | FromDiscord_ | <Armaldio> Having somehow the output through streams than I can somehow read in nim asynchronously, but I'm not sure it will really fit cause of prompts and seems also overcomplicated |
19:36:41 | FromDiscord_ | <Armaldio> Second possibility is that I'm missing a proc that just start my process and "give it the hand" like if I was launching it myself. |
19:36:42 | FromDiscord_ | <Armaldio> |
19:36:43 | FromDiscord_ | <Armaldio> Am i clear enough ? |
19:47:26 | xace | Armaldio: im not really sure, but there are input streams too to control the prompts if thats what you are asking |
19:50:55 | xace | otherwise maybe you are asking about running() or waitForExit() im not really sure |
20:03:08 | * | Ven`` joined #nim |
20:10:51 | FromDiscord_ | <Armaldio> it's just that when I start my node process it act like if it's a background process, run it and end it |
20:10:51 | FromDiscord_ | <Armaldio> But i'd like to be able to interact with the subprocess interactively |
20:11:47 | * | nsf quit (Quit: WeeChat 2.3) |
20:12:43 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:15:51 | * | zachk joined #nim |
20:16:25 | * | zachk quit (Changing host) |
20:16:25 | * | zachk joined #nim |
20:16:45 | * | theelous3_ joined #nim |
20:20:25 | * | jjido quit (Read error: Connection reset by peer) |
20:26:41 | FromGitter | <zetashift> @Calinou you there by any chance? |
20:26:57 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:27:44 | Calinou | hi, yes :) |
20:28:57 | FromGitter | <zetashift> hey! the godot-nim small post I wrote has been sitting there for a while now: https://github.com/nim-lang/website/pull/93 if it's not good enough I can close it, or if something needs to be added could you let me know so I can try and change it |
20:29:10 | FromGitter | <rayman22201> @Armaldio, this is an example from python, but the concept is the exact same: https://stackoverflow.com/questions/14457303/python-subprocess-and-user-interaction ⏎ You would use https://nim-lang.org/docs/osproc.html#startProcess and https://nim-lang.org/docs/osproc.html#inputStream to interact with the process |
20:29:55 | FromDiscord_ | <Armaldio> Thanks @rayman22201! Will look at these resources and let you know if I can make it work 😃 |
20:32:18 | * | Perkol quit (Quit: Leaving) |
20:32:28 | FromGitter | <rayman22201> 👍 |
20:34:04 | * | miran joined #nim |
20:34:11 | Calinou | @zetashift The content looks good, but the writing leaves to be desired (it doesn't feel very professional to me). Still, it can be merged since we don't have too many news articles lately |
20:34:44 | Calinou | I also saw a few more typos but I can use the GitHub suggestions feature now :) |
20:34:48 | Calinou | (so you can apply them with a single click) |
20:36:26 | * | narimiran quit (Ping timeout: 250 seconds) |
20:36:34 | FromGitter | <zetashift> cool cool |
20:37:06 | FromGitter | <zetashift> and yeah I'm not a good writer |
20:37:06 | Calinou | also I'm very busy finishing my game for the Game Off jam :P |
20:38:50 | FromGitter | <zetashift> ah yeah it can wait, just needed confirmation if I should close it or not |
20:40:20 | * | miran is now known as narimiran |
20:46:32 | * | Jesin quit (Quit: Leaving) |
20:53:37 | * | Sembei joined #nim |
20:54:40 | * | narimiran quit (Ping timeout: 272 seconds) |
20:55:36 | FromGitter | <arnetheduck> @PMunch I was thinking that the only reason to keep nimsuggest around is that it might be able to support stuff that's outside of LSP |
20:55:52 | FromGitter | <arnetheduck> however, if LSP has extension points, could just drop nimsuggest completely |
20:56:49 | FromGitter | <arnetheduck> that said, +1 for turning it into a lib - that's the beginning of a lot of analysis tools that become easier to write |
21:00:56 | * | jjido joined #nim |
21:03:10 | * | stefanos82 quit (Remote host closed the connection) |
21:04:14 | FromGitter | <rayman22201> I agree with you completely @arnetheduck. Dom96 makes a good point about including the whole Nim compiler as a dependency. That isn't ideal, but I feel like the pros outway the cons here, and compile times can be fixed in other ways. I would rather have more cool compiler based analysis tools. Nim also isn't trying to be erlang, so trying to shoehorn supervisor features into LSP doesn't seem like a great idea to me. |
21:04:45 | * | Ven`` joined #nim |
21:07:35 | FromGitter | <arnetheduck> the approach has served `llvm` and `clang` well, to say the least.. compile times are something that nim needs to deal with generally, not just for the compiler.. as long as it relies on the current compile-all-sources-always, nim apps are going to be limited to scripts and trinkets |
21:07:49 | Araq | it's not the whole compiler fwiw, the C and JS codegens are not used |
21:08:17 | FromGitter | <arnetheduck> yeah, that too, but that separation is not very clean in the compiler |
21:08:25 | * | Ven`` quit (Client Quit) |
21:10:49 | FromGitter | <arnetheduck> that's why it's good that work is being done towards treating it as a library - compiler, nimsuggest etc.. that'll promote some good refactoring as well |
21:12:44 | FromGitter | <rayman22201> exactly +100 |
21:16:45 | FromGitter | <arnetheduck> shoehorning supervisors in seems to be a recurring theme among nim developers, not sure where that's coming from either.. ie it's been used as an argument to keep exceptions - that you can have an outer supervisor loop that somehow will be able to deal with the mess after an exception rips through the call stack with no care for partially committed state |
21:17:41 | * | sz0 joined #nim |
21:23:19 | Araq | that argument remains to be uncontested |
21:24:26 | * | Vladar quit (Remote host closed the connection) |
21:28:32 | Araq | "rips through the call stack with no care for partially committed state" is just words, no facts. Does an Erlang supervisor roll back file system changes? no. that would not even been desirable for logging files. So... the "shitty" partial solution is what every system does. |
21:30:19 | FromGitter | <arnetheduck> no, it's not just words, it's an expression of the fact that nim lacks the tools to unwind safely - ie deterministic destructors etc |
21:30:43 | Araq | and why error handling is better when it's tied to a concurrency primitive ("lightweight processes!") remains a mystery too. |
21:32:28 | Araq | ok, so ignoring the fact that we're getting destructors, that means C# and Java and Python ... cannot "unwind safely". |
21:35:12 | jjido | Supervisor is good to look at ordering and deadlock prevention. It is for concurrency not error handling. |
21:35:14 | FromGitter | <arnetheduck> ever seen a java program? every book and tutorial out there points out that you have to write a finally statement in nearly every proc to make sure it's safe - c# likewise with `using`.. python, not a bastion of reliability / not a systems programming language as nim purports to be |
21:35:18 | FromGitter | <rayman22201> I'm confused. sorry. :-/ Araq, is your statement pro supervisor, or pro exceptions, or both? I always saw those as two different concepts (though they can work together). |
21:35:46 | FromGitter | <arnetheduck> nim destructors are like c# disposables.. deterministic, sometimes, from what understand? |
21:37:37 | Araq | jjido: for deadlock prevention you don't need a supervisor, you can also use static analysis |
21:38:44 | Araq | rayman22201: my point is that exceptions don't have any alternative. |
21:40:46 | FromGitter | <rayman22201> ah. ok. I see. Yeah, I have to agree with you there. There isn't really a way to fully "roll back" or "fully commit" state in a moderately complex system in practice (i.e. modern computer software). There is just new error states, and how you handle those error states. |
21:40:57 | Araq | exit() only works when you run on an OS, wrapping everything in an Either is infeasible. The very idea of a "function that cannot fail" is an illusion, software runs on hardware with finite resources. |
21:41:07 | FromGitter | <rayman22201> yeah |
21:45:14 | FromGitter | <arnetheduck> another illusion then is that "you can deal with every failure" like a supervisor tries to do |
21:45:33 | FromGitter | <rayman22201> also true. |
21:46:53 | * | jjido_ joined #nim |
21:50:41 | Araq | I don't see how that is a comparable illusion. when my software crashes, my OS doesn't. |
21:51:15 | Araq | it would be cool if we could always assume an OS and exit() but I wouldn't call the result a "systems" programming language then. |
21:53:10 | Araq | the C++ software on the Mars Rover restarts quickly though without an OS, so maybe we need a restart() primitive instead |
21:57:25 | FromGitter | <arnetheduck> c++? https://softwareengineering.stackexchange.com/questions/159637/what-is-the-mars-curiosity-rovers-software-built-in |
21:58:29 | Araq | https://www.youtube.com/watch?v=3SdSKZFoUa8 |
22:00:02 | FromGitter | <rayman22201> cool |
22:05:45 | Araq | https://youtu.be/3SdSKZFoUa8?t=4295 here is where he talks about rebooting |
22:20:58 | * | rockcavera joined #nim |
22:23:10 | federico3 | rebooting is pretty common practice on airplanes and other scenarios as well but is getting offtopic |
22:25:02 | FromGitter | <arnetheduck> notably he says "reboot and wait for human input" - that means in particular: don't blindly try again |
22:25:35 | FromGitter | <arnetheduck> doesn't sound like a supervisor or a top-level exception handler |
22:32:15 | Araq | he also says "it reboots many times a day" |
22:32:30 | Araq | and I don't think he implies that it waits for human input then |
22:32:39 | federico3 | it doesn't |
22:34:04 | livcd | are we getting estructors ? |
22:35:37 | Araq | yeah, of the deterministic variant, C++ inspired |
22:36:17 | Araq | and yeah, they too have their share of problems because nothing is perfect in this world |
22:37:31 | * | jjido_ quit (Quit: Textual IRC Client: www.textualapp.com) |
22:37:42 | FromGitter | <arnetheduck> well, reboot in the sense "controlled shutdown sequence, then controlled startup sequence", not the supervisor kind "something didn't work, let's try again" |
22:38:23 | FromGitter | <arnetheduck> er, destructors + refs = non-deterministic, no? |
22:40:36 | Araq | what to map 'ref' to is an open problem, but a shared_ptr is not unthinkable. and yeah, I know, shared_ptr is not "deterministic" either, it races into what thread does the destruction, yawn |
22:42:05 | FromGitter | <arnetheduck> yay refcounting and cycles :) |
22:42:20 | Araq | ^ so predictable. |
22:42:30 | FromGitter | <arnetheduck> irresistable :) |
22:45:44 | Araq | my favourite solution so far though is to write a precise and simple copying GC for refs. and to tell people to not use 'ref'. but when they do, at least they get a O(live heap) cost instead of O(heap size) |
22:48:36 | FromGitter | <arnetheduck> so how would you represent a graph, if not through refs? indices? |
22:51:14 | Araq | yes |
22:53:46 | Araq | preferably of the (index, generation) variant |
23:00:59 | * | abm joined #nim |
23:01:50 | * | tiorock joined #nim |
23:01:50 | * | tiorock quit (Changing host) |
23:01:50 | * | tiorock joined #nim |
23:01:50 | * | rockcavera is now known as Guest97851 |
23:01:50 | * | Guest97851 quit (Killed (cherryh.freenode.net (Nickname regained by services))) |
23:01:50 | * | tiorock is now known as rockcavera |
23:05:47 | * | vlad1777d joined #nim |
23:06:38 | * | jjido quit (Read error: Connection reset by peer) |
23:07:08 | * | jjido joined #nim |
23:07:17 | * | Armaldio quit (Remote host closed the connection) |
23:44:40 | * | jjido quit (Remote host closed the connection) |
23:49:21 | * | vlad1777d quit (Remote host closed the connection) |
23:49:30 | FromGitter | <zacharycarter> I just read most of the conversation above - I am slightly confused... I think exception handling can take on different forms - and Nim uses try / except in the stdlib pretty thoroughly |
23:51:13 | * | vlad1777d joined #nim |
23:51:44 | FromGitter | <zacharycarter> so if I had some code that was like - ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bff2a10f048fa10513bcc5f] |
23:51:55 | FromGitter | <zacharycarter> sorry just going to just this |
23:54:12 | FromGitter | <zacharycarter> if I have code like this - https://gist.github.com/zacharycarter/ecf846bd75c79ca611046ec59cb05697 |
23:54:25 | FromGitter | <zacharycarter> isn't that similar to Java? |
23:58:19 | FromGitter | <zacharycarter> I know that's not a destructor - but what's the difference between that and Java's ability to unwind safely? |